Home > pascal-mips-compiler

pascal-mips-compiler

Pascal-mips-compiler is a project mainly written in C++ and C, it's free.

CSE440 compiler construction project - pascal to mips compiler


< 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

  5. 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.
  6. 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
  7. What cases are handled

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

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

Previous:Accessories