A simple C++ compiler built using lex and yacc tools for basic C++ statements. The following control constructs are handled :-
- IF ELSE
- WHILE
- FOR
- Generation of tokens
- Construction of Symbol table
- Expression Evaluation
- Syntax validation
- Error handling
- Abstract Syntax Tree Generation
- Intermediate Code Generation in Quadruple format
- Implementation of Constant Folding & Constant Propogation code optimization techniques
Each phase expects a '.cpp' input file to run. Please input the 'inputfile.cpp' to the lex and yacc code of all phases to see an output.
Find a detailed report here.