Git Product home page Git Product logo

6035-compiler's Introduction

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

6035-compiler's People

Contributors

dfkoh avatar mfrend avatar lizthegrey avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.