Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

ASU Fall 2012: Compiler Construction - Final Presentation


Published on

The presentation for the course Compiler Construction. The language was a subset of Object Oriented Pascal

Published in: Technology
  • Be the first to comment

  • Be the first to like this

ASU Fall 2012: Compiler Construction - Final Presentation

  1. 1. Compiler Construction Final presentation Manish Sinha Ankit Mandhani
  2. 2. 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
  3. 3. 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
  4. 4. Not supported due to design limitations ● Code generation for local arrays ● Better heap and stack management
  5. 5. 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
  6. 6. Collaboration
  7. 7. Achieving Collaboration ● Design and Architecture ● Source code management – Using git – Resolving merges and conflicts – Diff and resolve tool – Hosting code ● Bug tracking
  8. 8. Lesson: How to improve collaboration ● Source code management – Better usage of branches – Using rebase instead of merge ● Bug tracking: Using a real bug tracker
  9. 9. Language: Possible Changes ● Return keyword assignment: assignment_statement | ...... | return expression ● Last Statement not having semicolon statement_sequences: statement_sequence SEMICOLON statement_sequence: statement | statement_sequence SEMICOLON statement
  10. 10. Language Features Possible new features
  11. 11. 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
  12. 12. 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
  13. 13. break construct e.g. break Grammar changes: statement: BREAK
  14. 14. The end