Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
CSE440 compiler construction project - pascal to mips compiler
branch: master
Failed to load latest commit information.
tests more tests
.gitignore revamp test system, but still need to correct the .out files
CSE440Fall2010Project1Specifications.pdf Adding project specs
CSE440_598Fall2010Projects3_4.pdf simple code generation
Makefile added test target in Makefile
Project2Specs.odt replace pdf specs with a mutable document since we have to correct it
README updated readme
TODO updated todo
code_generation.cpp fix varible access for comma
code_generation.h added a -s option and fixed nonvoid method register remapping.
cse440p1.config qt creator ftw
cse440p1.creator qt creator ftw
cse440p1.files -S instead of -s, and crash if file not found
cse440p1.includes qt creator ftw
insensitive_map.h generate 3 address code
iso7185pascal.html use html pascal specs instead of crappy pdf
main.cpp fix main class allocation
parser.h untested object instantiation, fields, constructors
pascal.l renaming token types to be consistent
pascal.y parser and semantic checker are inserting implicit 'this' references
push.sh compatibility check with stats's fricken old versions.
semantic_checker.cpp kind of check constructor parameters
semantic_checker.h removing obsolete check against recursive data structures
symbol_table.cpp fix errors accessing objects
symbol_table.h using proper class name in function invocations
test.py added -v option for test.py
two_way_map.h use the earliest declared instead of lowest register
utils.cpp check for reading from function return value
utils.h check for reading from function return value

README

 ___________________
< CSE 440 Project 4 >
 -------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

 1. Project Information
 2. Building, running, and testing instructions
 3. What cases are handled
 4. What the parse tree looks like


 1. Project Information

    Authors:

        Josh Wolfe
        Andrew Kelley

    Description:

        Compiles a pascal-like language to MIPS assembly.

    Comment policy:

        Instead of comments everywhere, use descriptive variable names and
        functions.

 2. Building and running instructions

    To compile the project, cd to the project directory and run:

        make

    You can run the program manually like this:

        ./opc tests/test_name.p > out.mips

    To run the MIPS program, you must have spim (or some other MIPS interpreter):

        to install spim in Ubuntu/Debian:

            sudo apt-get install spim

        to run the MIPS program:

            spim -file out.mips

    To run the test suite, you must have Python 2.6 or later and spim:

        make test

 3. What cases are handled

    all the tests in tests/ that have a .p, a .p.errors, and a .p.out.

 4. What the parse tree looks like

    Program
        ClassList[]
            ClassDeclaration
                ClassBlock
                    VariableDeclarationList[]
                        VariableDeclaration
                            IdentifierList[]
                            TypeDenoter
                                ArrayType
                    FunctionDeclarationList[]
                        FunctionDeclaration
                            VariableDeclarationList[]
                            FunctionBlock
                                VariableDeclarationList[]
                                StatementList[]
                                    Statement
                                        AssignmentStatement
                                            VariableAccess
                                                IndexedVariable
                                                    VariableAccess
                                                    ExpressionList[]
                                                        Expression
                                                            AdditiveExpression
                                                                MultiplicativeExpression
                                                                    NegatableExpression[]
                                                                        PrimaryExpression
                                                                            VariableAccess
                                                                            FunctionDesignator
                                                                                ActualParameterList[]
                                                                                    ActualParameter
                                                                                        Expression
                                                                                        Expression
                                                                                        Expression
                                                                            MethodDesignator
                                                                                VariableAccess
                                                                                FunctionDesignator
                                                                            Expression
                                                                            PrimaryExpression
                                                                    MultiplicativeExpression
                                                                AdditiveExpression
                                                            AdditiveExpression
                                                AttributeDesignator
                                            Expression
                                        IfStatement
                                            Expression
                                            Statement
                                            Statement
                                        PrintStatement
                                            Expression
                                        WhileStatement
                                            Expression
                                            Statement
                                        StatementList[]
Something went wrong with that request. Please try again.