CSE440 compiler construction project - pascal to mips compiler
C++ C Python
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tests
.gitignore
CSE440Fall2010Project1Specifications.pdf
CSE440_598Fall2010Projects3_4.pdf
Makefile
Project2Specs.odt
README
TODO
code_generation.cpp
code_generation.h
cse440p1.config
cse440p1.creator
cse440p1.files
cse440p1.includes
insensitive_map.h
iso7185pascal.html
main.cpp
parser.h
pascal.l
pascal.y
push.sh
semantic_checker.cpp
semantic_checker.h
symbol_table.cpp
symbol_table.h
test.py
two_way_map.h
utils.cpp
utils.h

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[]