Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 9b8422f12f
115 lines (89 sloc) 4.722 kb
___________________
< 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[]
Jump to Line
Something went wrong with that request. Please try again.