Intro
There are two versions of assignments(Java or C++) for the CS143-Compiler course, this repo is my Java-version solution.
Course resources:
Here are my notes:
PA
PA2J
This assignment is to write a lexical analyser for COOL, using jlex(Java).
By the way, the jlex framework is a bit outdated, you can install jflex to replace it:
> brew install jfelx
> apt-get install jfelx
Generate lexer:
> jflex --jlex cool.lex
> make lexer
> make dotest
To test if the lexer generated works, you can run diff.sh
which compares the output of our own lexer and the standard lexer(./bin/lexer
) with all cool files in ./examples
as input:
> ./diff.sh