| Goal | ::= | SSAInfo "MAIN" StmtList "END" ( Procedure )* <EOF> |
| SSAInfo | ::= | "//" "PhiNodeCount" "=" IntegerLiteral |
| StmtList | ::= | ( ( Label )? Stmt )* |
| Procedure | ::= | Label "[" IntegerLiteral "]" StmtExp |
| Stmt | ::= | NoOpStmt |
| | | ErrorStmt | |
| | | CJumpStmt | |
| | | JumpStmt | |
| | | HStoreStmt | |
| | | HLoadStmt | |
| | | MoveStmt | |
| | | PrintStmt | |
| NoOpStmt | ::= | "NOOP" |
| ErrorStmt | ::= | "ERROR" |
| CJumpStmt | ::= | "CJUMP" Temp Label |
| JumpStmt | ::= | "JUMP" Label |
| HStoreStmt | ::= | "HSTORE" Temp IntegerLiteral SimpleExp |
| HLoadStmt | ::= | "HLOAD" Temp Temp IntegerLiteral |
| MoveStmt | ::= | "MOVE" Temp Exp |
| PrintStmt | ::= | "PRINT" SimpleExp |
| Exp | ::= | Call |
| | | HAllocate | |
| | | BinOp | |
| | | SimpleExp | |
| StmtExp | ::= | "BEGIN" StmtList "RETURN" SimpleExp "END" |
| Call | ::= | "CALL" SimpleExp "(" ( SimpleExp )* ")" |
| HAllocate | ::= | "HALLOCATE" SimpleExp |
| BinOp | ::= | Operator SimpleExp SimpleExp |
| Operator | ::= | "LT" |
| | | "PLUS" | |
| | | "MINUS" | |
| | | "TIMES" | |
| SimpleExp | ::= | Temp |
| | | IntegerLiteral | |
| | | Label | |
| Temp | ::= | "TEMP" IntegerLiteral |
| IntegerLiteral | ::= | <INTEGER_LITERAL> |
| Label | ::= | <IDENTIFIER> |