compiler-design-2020
A repository for Mini Project of Compiler Design, 6th Sem, Computer Science, PES University.
Deliverables
1. Phase 1 Lex Analysis
- Token Generation (Done)
- Convert input stream to valid datatypes (Done)
- Remove Comments (Done)
- Record Lexemes (Done)
- Skip Whitespaces (Done)
- Identify Keywords (Done)
- Lexical Errors (Done)
- Line Numbers (Done)
- Truncate long identifiers (Pending)
- Symbol Table (Done)
- Abstract Syntax Tree Construction (Done)
- Global & Local Variables Distinction (Done)
- Class Definition (Done)
- Arrays/Pointers definition (Done)
- Array usage in loops, if statements (Done)
- Array access using subscripts (Done)
- Object Creation using new keyword (Done)
- Arithmetic and Boolean Expressions (Done)
- Define if, while (Done)
- Define For (Done)
- cin and cout (Done)
- Shift Reduce, Reduce Reduce Error correction (Done)
- Valid Actions for grammar productions (Done)
- use yyloc to print the error tokens (Pending)
- Error Handing and Error Recovery (Done)
- #include Productions (Done)
3. Phase 3 Semantic Analysis
- Type Checking, Declare before use (Done)
- Evaluate if, for, while (Done)
- Evaluate if-else block (Done)
- Local variables should be destroyed after exiting block (Done)
- break statements, access control (Done)
- Modify Symbol Table based on Scope (Done)
- Prevent multiple definitions of variables (Done)
- Evaluate Complex Expressions with Parenthesis (Done)
4. Phase 4 Intermediate Code Generation
- Generate three address code (Done)
- Quadruple format (Done)
- Insert Temporaries to Symbol Table (Done)
5. Phase 5 Intermediate Code Optimization
- Eliminate dead code (Done)
- Subexpression elimination (Done)
- Constant Folding, Propagation (Done)
- Loop Invariant code outside loop (Done)
- live Variable Analysis (Done)
6. Phase 6 Target Code Generation
- Assembly Code (Done)