This is just a project to exercise the concepts and theory of compilers. As you might guess, this is a C++ compiler and it will be built using JFlex and Cup. Because we don't have access to the official C++ Standard, we decided to follow this specifiation.
JFlex is a scanner generator. JFlex reads a lexical specification and outputs java sources for the generated scanner. If you don't have experience with JFlex, access the official website and try it! See the README
file for more information and examples.
CUP is a LALR (lookahead-LR method) parser generator. CUP reads a syntacitc specification and outputs the java sources for the generated parser. If you dont't have experience with CUP, access the manual for more information.
- First, make sure you have Ant installed in your computer.
- By this moment, you just need to run
ant
on the project's root directory.
The Lexical and Syntax Analyzers must be extended together. It is extremely important to follow these guidelines:
- After modifying
lexical.flex
and/orparser.cup
, runant compile
. - Resolve Warnings before pushing (or create a remote branch for fixing and open an issue in the repository).
- Implement grammar rules one by one.
- Add
NOT IMPLEMENTED
on rules not implemented.