Compiler project built for CS 4386.
Currently we are at phase 0, which simply identifies the tokens.
Run the basic test with make run
. If you want to run the extensive tests, execute make test
. Both commands will build the lexer and parsers.
Another test case will run on an actual code file (adv-tests.txt
). Use make adv-test
to run these advanced tests.
There is one last test case that just has illegal tokens (bad-tests.txt
). This file will make the scanner not happy and can be run using make bad-test
.
To run a custom test, simply create a new rule in the Makefile
in the following format:
test: all
$(JAVA) -cp $(CP) LexerTest tests.txt > tests-output.txt
cat tests.txt
cat -n tests-output.txt
Replace test
with the make command you wish to use, replace tests.txt
with the input test file, and tests-output.txt
with the file you wish to output text to.