Running and Testing
We recommend using PyCharm to run the compiler and run the unit tests. However, the compiler can be run and tested from the command line with the commands below.
python3 bin/jstcc.py [input file] [options]
# Options include:
# -o [file name]
# Redirect STDOUT/STDERR to file name
# -sym [0, 1]
# 0: No debug
# 1: Print Symbol Table
# -s [0, 1, 2, 3]
# 0: No debug
# 1: Tokens
# 2: Source Code
# 3: Tokens and Source Code
# -p [0, 1, 2, 3]
# 0: No debug
# 1: Productions
# 2: Productions and Source Code
# 3: Productions, Source, Info (warnings)
# -ast
# Enables output of GraphViz 'dot' compatiable AST nodes.
# -tac [0, 1, 2]
# 0: No debug
# 1: 3AC Only
# 2: 3AC and Source Code
# -mips [0, 1, 2]
# 0: 3AC Only
# 1: Source Only
# 2: 3AC and Source Code
# -w [0, 1]
# Warnings
To run all unit tests, switch to the top of project directory and run:
python3 -m unittest
To test just the Symbol Table using it's custom test driver, run:
python3 bin/symbol_table_driver.py