Java Postfix Pseudo-Assembly 3 Address Generator
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
AddOperator.java
DivOperator.java
Driver.java
ExpressionTree.java
MulOperator.java
Node.java
OperandNode.java
Operator.java
OperatorNode.java
README.md
SubOperator.java
ThreeAddressAssembly.txt
screenshot.PNG

README.md

CMSC350_Project2

Postfix 3 Address Generator

  • Given an infix expression, evaluate the expression using two stacks.
  • Uses string tokenizer to properly split the expression onto their respective stacks.
  • Basic GUI and exception handling for invalid input.

screenshot

Generated in ThreeAddressAssembly.txt

Add R0 2 3 
Sub R1 R0 1 
---------------------------------------------
Add R0 2 3 
Sub R1 R0 1 
Add R0 5 9 
Sub R1 3 R0 
Mul R2 2 3 
Div R3 R1 R2 
---------------------------------------------
Add R0 2 3 
Sub R1 R0 1 
Add R0 5 9 
Sub R1 3 R0 
Mul R2 2 3 
Div R3 R1 R2 
Add R0 2 5 
Mul R1 3 2 
Add R2 R1 R2 
Sub R3 R1 1 
Mul R4 7 R3 
---------------------------------------------
Add R0 2 3 
Sub R1 R0 1 
Add R0 5 9 
Sub R1 3 R0 
Mul R2 2 3 
Div R3 R1 R2 
Add R0 2 5 
Mul R1 3 2 
Add R2 R1 R2 
Sub R3 R1 1 
Mul R4 7 R3 
Add R0 9 4 
Div R1 7 2 
Add R2 R1 R2 
Mul R3 R1 3 
Sub R4 R2 5 
---------------------------------------------
Add R0 2 3 
Sub R1 R0 1 
Add R0 5 9 
Sub R1 3 R0 
Mul R2 2 3 
Div R3 R1 R2 
Add R0 2 5 
Mul R1 3 2 
Add R2 R1 R2 
Sub R3 R1 1 
Mul R4 7 R3 
Add R0 9 4 
Div R1 7 2 
Add R2 R1 R2 
Mul R3 R1 3 
Sub R4 R2 5 
Add R0 1 2 
Mul R1 3 4 
Div R2 R1 5 
Sub R3 R1 R2 
---------------------------------------------
Add R0 5 9 
Sub R1 3 R0 
Mul R2 2 3 
Div R3 R1 R2 
---------------------------------------------
Add R0 5 9 
Sub R1 3 R0 
Mul R2 2 3 
Div R3 R1 R2 
---------------------------------------------
Add R0 9 4 
Div R1 7 2 
Add R2 R1 R2 
Mul R3 R1 3 
Sub R4 R2 5 
---------------------------------------------```