This is a repo for a compiler implementation for a small language called Tiger.
Create a .env file and add your LSU login ID and LSU serve name. This setup script will download the needed JLex and JavaCup class files.
./setup
source .env
source .aliases
prog<1-2>
Your working directory should be ready to build the project.
To run the lexer by itself:
prog1
cd src
make
This will build the JLex lexer that can then be tested.
To run the parser:
prog2
cd src
make
This will build the Java CUP parser that should then be tested.
Note: Using make clean
will remove old lexer and parser class files.
To test your lexer against the one provided from class:
cd src
chmod +x diff
./diff <testname>
For example:
./diff test1
This will run test1.tig first using your lexer and then with the provided lexer. The two outputs will be diffed and that output will be displayed to you.
To recursively run all the test at once run:
./diff all
To test your parser against the one provided from class:
cd src
chmod u+x diff
./diff <testname>
./diff all
If things go wrong make sure your .profile and .env files are setup correctly and have been sourced. Also, make sure your directory structure is setup correctly.