Compiler Construction Final presentation Manish Sinha Ankit Mandhani
Jun 29, 2015
Compiler Construction Final presentation
Manish SinhaAnkit Mandhani
Design: Features Supported● Parse Trees
● Semantic Checking
● Generation of three address codes and Control Flow Graph
● Code Generation– All expressions
– Multidimensional arrays
– Local, global and heap variables
– Loops and Branching
– Multiple class and objects
– Simple Method calls
– Print statements
Features possible but not supported
● Complex Method Calls– Method calls with parameters
– Method calls using objects
– Recursion and nested method calls
● Optimizations– Value and extended value numbering
– Constant folding
● Control flow for Goto and Labels
Not supported due to design limitations
● Code generation for local arrays
● Better heap and stack management
Could have done differently
● Nested symbol table– For handling all cases of semantic checking
– For code generation
● More modular code for Project 4 to handle all cases of memory allocation and access efficiently
● More information in TAC
● Better and Quicker Design decisions for Project 2
Collaboration
Achieving Collaboration
● Design and Architecture
● Source code management– Using git
– Resolving merges and conflicts
– Diff and resolve tool
– Hosting code
● Bug tracking
Lesson: How to improve collaboration
● Source code management– Better usage of branches
– Using rebase instead of merge
● Bug tracking: Using a real bug tracker
Language: Possible Changes
● Return keywordassignment: assignment_statement
| ......
| return expression
● Last Statement not having semicolonstatement_sequences: statement_sequence SEMICOLON
statement_sequence: statement
| statement_sequence SEMICOLON statement
Language Features
Possible new features
for looping construct
e.g. for(i := 0; i < 4; i := i+1)Grammar changes:statement: for_statement
for_statement: FOR LPAREN for_statement_conditions RPAREN for_body
for_statement_conditions: statement SEMICOLON expression
SEMICOLON statement
for_body: PBEGIN statement_sequences END
foreach looping construct
e.g. foreach(house: integer in houses)Grammar changes:statement: foreach_statement
foreach_statement: FOREACH LPAREN foreach_statement_conditions RPAREN for_body
foreach_statement_conditions: identifier COLON type_denoter in variable_access
break construct
e.g. breakGrammar changes:statement: BREAK
The end