Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Java Python Shell

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
doc
lib
src/edu/mit/compilers
tests
.gitattributes
.gitignore
AUTHORS
README
build.xml
code

README

Code is organized in the following structure:

build.xml - The master build file for the project.
src
|-edu/mit/compilers/tools/CLI.java:
|   command-line parsing libraries, modified from originally provided CLI.java
|-edu/mit/compilers/le02/Main.java:
|    the main entry point for the compiler
|-edu/mit/compilers/le02/CompilerException.java
|   the base SourceLocation-aware exception class for the compiler
|----------------Previous phases----------------
|-src/edu/mit/compilers/le02/SourceLocation.java
|   encodes input locations for use in error reporting
|-src/edu/mit/compilers/le02/ErrorReporting.java
|   collects errors and pretty-prints them with context
|-src/edu/mit/compilers/le02/Util.java
|   miscellaneous utility methods
|-src/edu/mit/compilers/le02/DecafType.java
|   enum containing the valid types of the Decaf language
|-src/edu/mit/compilers/le02/symboltable/*Descriptor.java
|   different kinds of descriptors used in symbol tables
|-src/edu/mit/compilers/le02/symboltable/SymbolTable.java
|   symbol tables used in each context in the CodeIR
|-src/edu/mit/compilers/le02/semanticchecks/*.java
|   semantic checks that the compiler runs upon the populated CodeIR
|-src/edu/mit/compilers/le02/ir/IrGenerator.java
|   generates the CodeIR/AST based on the concrete parse tree
|-src/edu/mit/compilers/le02/ir/IntRangeChecker.java
|   checks integer ranges after processing of unary minus on raw ints
|-src/edu/mit/compilers/le02/grammar/scanner.g
|   scanner ANTLR grammar, used to create autogenerated scanner
|-src/edu/mit/compilers/le02/grammar/parser.g
|   parser ANTLR grammar, used to create autogenerated parser
|-src/edu/mit/compilers/le02/stgenerator/ASTDescriptorVisitor.java
|   walks the AST and populates symbol tables and adds descriptors to each
|   node in the AST that has a descriptor
|-src/edu/mit/compilers/le02/ast/*Node.java
|   node classes that are used to build up the AST
|   see src/edu/mit/compilers/le02/ast/AstDesign.txt for documentation
|-src/edu/mit/compilers/le02/ast/ASTNodeVisitor.java
|   base AST walking class, used for semantic checks/symbol table generation
|-src/edu/mit/compilers/le02/ast/AstPrettyPrinter.java
|   pretty-prints the AST
|----------------Codegen----------------
|-src/edu/mit/compilers/cfg/*Statement.java
|   Classes roughly encapsulating flattened low-level IR statements.
|-src/edu/mit/compilers/cfg/CFGGenerator.java
|   The first pass CFG generator that flattens the AST tree
|-src/edu/mit/compilers/cfg/BasicBlockGraph.java
|   The second pass CFG generator that merges adjacent non-branching blocks
|   of BasicStatements into single BasicBlockNodes.
|-src/edu/mit/compilers/cfg/CFGFragment.java
|   A non-branching fragment of the control flow graph; mergeable
|-src/edu/mit/compilers/cfg/*Argument.java
|   Represents a single memory location or register location.
|-src/edu/mit/compilers/cfg/BasicBlockNode.java
|   Represents a single element of the final CFG structure. Contains a target
|   and optionally a branch target and a conditional at the end to evaluate
|-src/edu/mit/compilers/cfg/CFGVisualizer.java
|   Generates a .dot graphviz file from a first or second-stage CFG.
|-src/edu/mit/compilers/cfg/ControlFlowGraph.java
|   Encapsulates a Control Flow Graph. Contains a list of functions and their
|   start nodes, and all globals and strings.
|-src/edu/mit/compilers/cfg/AsmWriter.java
|   Transforms a second-stage ControlFlowGraph into a set of assembly
|   instructions that are written to the output file.

tests
|-src/**/*.java
|   unit tests for code
|-tests/codegen
|   contains .dcf programs to compile, and the expected output of those
|   programs' output when compiled and run.
|-tests/semantics
|   contains legal and illegal programs, and verifies that they pass or fail
|   semantic checks appropriately
|-tests/parser
|   contains legal and illegal programs, and verifies that they pass or fail
|   parsing appropriately
|-tests/scanner
|   contains legal and illegal programs, and verifies that they pass or fail
|   scanning appropriately and produce correct golden outputs
Something went wrong with that request. Please try again.