%import common.WS %import common.CPP_COMMENT %import common.INT %import common.SIGNED_INT %ignore WS %ignore CPP_COMMENT start: (stackop | arithop)* stackop: (PUSH|POP) SEGMENT INDEX PUSH: "push" POP: "pop" arithop: ADD | SUB | NEG | EQ | GT | LT | AND | OR | NOT ADD: "add" SUB: "sub" NEG: "neg" EQ: "eq" GT: "gt" LT: "lt" AND: "and" OR: "or" NOT: "not" SEGMENT: "argument" | "local" | "static" | "constant" | "this" | "that" | "pointer" | "temp" INDEX: INT