Skip to content

COMP442/6421 Compiler Design by Prof. Joey Paquet, Winter 2022

Notifications You must be signed in to change notification settings

yan-ren/comp442-6421-compiler-design

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compiler Design

Overview

A simple compiler implemented in Java to utilize the main compilation concept. Following phases are implemented

  • Lexical Analyzer
  • Syntactic Analyzer
  • Intemediate Representation (Abstract Syntax Tree)
  • Semantic Translation
  • Object Code (Moon assembly code)

Repository structure

Path / File Description
src/main/ Source code
src/maun/java/Driver.java Main compilier driver
src/test/ Unit tests and driver tests
doc/ Reports for each phases, grammar, etc
input/ Input files for compiler driver
output/ Compiler output files
pom.xml Maven build file

Summary for each compilation phases

  • Lexical Analyzer
    • Table driven scanner approach, where the state transition table is implemented to represent the DFA.
  • Sytactic Analyzer
    • Table driven predictive parsing
  • Intemediate Representation (Abstract Syntax Tree)
  • Semantic Translation
    • Visitor pattern
  • Code generation
    • label approach/stack approach

Buid with

  • Java 11
  • Maven

Contact

Contact repository owner for any inquiry