Skip to content

HrishikeshVish/CD2020

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CD2020

compiler-design-2020

PES University, Bangalore

A repository for Mini Project of Compiler Design, 6th Sem, Computer Science, PES University.

Aekansh Dixit

Hrishikesh V

Ravendra Singh

Varun R. Gupta

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)

2. Phase 2 Syntax Analysis

- Abstract Syntax Tree Construction (Done)
- Global & Local Variables Distinction (Done)
- Class Definition (Done)
- Arrays/Pointers Definition (Done)
- Using Arrays in loops, if statements (Done)
- Array subscript access (Done)
- Object creation with 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)
- break statements, access control (Done)
- Modify Symbol table based on scope (Done)
- Prevent multiple definitions of the variables (Done)
- Evaluate Complex Expressions (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)