A complete compiler for TL13 programming language, a simplified subset of Pascal. It includes these four phases/parts:
- Scanner -- scans the LL(1) language
- Predictive Recursive Descent Parser -- Its a top-down parser. For a syntactically valid input program, it outputs a Graphviz DOT file containing the program's parse tree
- Core -- It does type checking and its final output is MIPS assembly code. Intermediate output includes a type-annotated Abstract Syntax Tree (AST) and a Control Flow Graph (CFG) labeled with ILOC instructions
- Optimizations -- It includes translation into SSA form using * algorithm
It also contains the following language extensions:
- Permits operators to occur adjacent to identifiers/numbers/keywords without intervening spaces (so that, for example, both "x := x + 1" and "x:=x+1;" would be legal---and equivalent---statements)
- Supports multi-line comments whose beginning is marked by some (sequence of) character(s) and whose ending is marked by some (sequence of) character(s)
- Supports "char" base type
- Output file is named as Inputfile's base name followed by ".pt.dot", ".ast.dot", ".iloc.cgf.dot" , ".s" and ".ssa.dot"
- compiler/test-inputs -- test inputs
- install Graphviz
- Compile all the .java files (javac -d build -sourcepath src src/edu/utsa/tl13/Compiler.java)
- Run Compiler.java program with inputfile name given as first parameter. (java -cp build/ edu.utsa.tl13.Compiler test-inputs/sqrt.tl13)
http://www.cs.utsa.edu/~vonronne/classes/cs5363-s13/project/