//---------------------------------------------------- // The following code was generated by CUP v0.10k // Wed May 03 15:16:06 NZST 2006 //---------------------------------------------------- package grammar; /** CUP generated class containing symbol constants. */ public class sym { /* terminals */ public static final int COMMA = 6; public static final int SEMICOLON = 5; public static final int LEFTBRACE = 2; public static final int error = 1; public static final int IDENT = 7; public static final int EOF = 0; public static final int ASSIGN = 4; public static final int RIGHTBRACE = 3; static final int Type = 4; static final int Decl = 3; static final int Program = 1; static final int Expr = 7; static final int ExprList = 8; static final int DeclrList = 5; static final int DeclList = 2; static final int Declr = 6; static final int $START = 0; public static String terminal_name( int id ) { switch ( id ) { case 6: return "COMMA"; case 5: return "SEMICOLON"; case 2: return "LEFTBRACE"; case 1: return "error"; case 7: return "IDENT"; case 0: return "EOF"; case 4: return "ASSIGN"; case 3: return "RIGHTBRACE"; default: return "unknown terminal" + id; } } public static String non_terminal_name( int id ) { switch ( id ) { case 4: return "Type"; case 3: return "Decl"; case 1: return "Program"; case 7: return "Expr"; case 8: return "ExprList"; case 5: return "DeclrList"; case 2: return "DeclList"; case 6: return "Declr"; case 0: return "$START"; default: return "unknown non_terminal" + id; } } public static String rule_name( int id ) { switch ( id ) { case 16: return "ExprList ::= Expr COMMA ExprList "; case 15: return "ExprList ::= Expr "; case 14: return "Expr ::= IDENT "; case 13: return "Expr ::= LEFTBRACE error RIGHTBRACE "; case 12: return "Expr ::= LEFTBRACE ExprList RIGHTBRACE "; case 11: return "Declr ::= error "; case 10: return "Declr ::= IDENT "; case 9: return "Declr ::= IDENT ASSIGN Expr "; case 8: return "DeclrList ::= DeclrList COMMA Declr "; case 7: return "DeclrList ::= Declr "; case 6: return "Type ::= IDENT "; case 5: return "Decl ::= error SEMICOLON "; case 4: return "Decl ::= Type DeclrList SEMICOLON "; case 3: return "DeclList ::= DeclList Decl "; case 2: return "DeclList ::= "; case 1: return "Program ::= DeclList "; case 0: return "$START ::= Program EOF "; default: return "unknown rule" + id; } } }