//---------------------------------------------------- // The following code was generated by CUP v0.10k // Fri Mar 16 08:36:05 NZDT 2007 //---------------------------------------------------- package grammar; /** CUP generated class containing symbol constants. */ public class sym { /* terminals */ public static final int MINUS = 6; public static final int IDENT = 11; public static final int DIVIDE = 8; public static final int LEFT = 2; public static final int NUMBER = 10; public static final int EOF = 0; public static final int PLUS = 5; public static final int RIGHT = 3; public static final int ASSIGN = 9; public static final int error = 1; public static final int TIMES = 7; public static final int NEWLINE = 4; static final int Factor = 5; static final int Term = 4; static final int Stmt = 2; static final int Expr = 3; static final int $START = 0; static final int StmtList = 1; public static String terminal_name( int id ) { switch ( id ) { case 6: return "MINUS"; case 11: return "IDENT"; case 8: return "DIVIDE"; case 2: return "LEFT"; case 10: return "NUMBER"; case 0: return "EOF"; case 5: return "PLUS"; case 3: return "RIGHT"; case 9: return "ASSIGN"; case 1: return "error"; case 7: return "TIMES"; case 4: return "NEWLINE"; default: return "unknown terminal" + id; } } public static String non_terminal_name( int id ) { switch ( id ) { case 5: return "Factor"; case 4: return "Term"; case 2: return "Stmt"; case 3: return "Expr"; case 0: return "$START"; case 1: return "StmtList"; default: return "unknown non_terminal" + id; } } public static String rule_name( int id ) { switch ( id ) { case 16: return "Factor ::= IDENT "; case 15: return "Factor ::= NUMBER "; case 14: return "Factor ::= LEFT Expr RIGHT "; case 13: return "Term ::= Factor "; case 12: return "Term ::= Term DIVIDE Factor "; case 11: return "Term ::= Term TIMES Factor "; case 10: return "Expr ::= Term "; case 9: return "Expr ::= MINUS Term "; case 8: return "Expr ::= Expr MINUS Term "; case 7: return "Expr ::= Expr PLUS Term "; case 6: return "Stmt ::= NEWLINE "; case 5: return "Stmt ::= error NEWLINE "; case 4: return "Stmt ::= Expr NEWLINE "; case 3: return "Stmt ::= IDENT ASSIGN Expr NEWLINE "; case 2: return "StmtList ::= StmtList Stmt "; case 1: return "StmtList ::= "; case 0: return "$START ::= StmtList EOF "; default: return "unknown rule" + id; } } }