//---------------------------------------------------- // The following code was generated by CUP v0.10k // Wed Nov 01 09:43:09 NZDT 2006 //---------------------------------------------------- package grammar; /** CUP generated class containing symbol constants. */ public class sym { /* terminals */ public static final int DIVIDE = 26; public static final int STRINGVALUE = 55; public static final int CHAR = 39; public static final int GE = 20; public static final int INTVALUE = 53; public static final int CONTINUE = 52; public static final int INT = 38; public static final int FOR = 48; public static final int MINUS = 24; public static final int NOT = 29; public static final int SEMICOLON = 8; public static final int AND = 16; public static final int LT = 17; public static final int RIGHTSQ = 7; public static final int OR = 15; public static final int BOOL = 40; public static final int COMMA = 9; public static final int CLASS = 13; public static final int INC = 30; public static final int DOTDOT = 11; public static final int UNTIL = 46; public static final int LEFTSQ = 6; public static final int EXIT = 50; public static final int PLUS = 23; public static final int IF = 43; public static final int ASSIGN = 14; public static final int DOT = 12; public static final int LE = 19; public static final int LEFT = 2; public static final int EOF = 0; public static final int RETURN = 49; public static final int TRUE = 35; public static final int SIZE = 28; public static final int NEW = 33; public static final int error = 1; public static final int CHARVALUE = 54; public static final int NULL = 34; public static final int REALVALUE = 56; public static final int MOD = 27; public static final int IDENT = 57; public static final int BREAK = 51; public static final int VOID = 42; public static final int EQ = 21; public static final int REAL = 41; public static final int TIMES = 25; public static final int RIGHTBRACE = 5; public static final int COLON = 10; public static final int ELSE = 44; public static final int WHILE = 45; public static final int LEFTBRACE = 4; public static final int NE = 22; public static final int BUILTIN = 32; public static final int DEC = 31; public static final int FALSE = 36; public static final int RIGHT = 3; public static final int GT = 18; public static final int VAR = 37; public static final int DO = 47; static final int AssignExprListOpt = 15; static final int RelExpr = 25; static final int ExprListOpt = 13; static final int FormalParamDeclList = 5; static final int Stmt = 12; static final int OrExpr = 23; static final int ExprOpt = 20; static final int GlobalDeclStmt = 6; static final int Primary = 30; static final int DeclaratorList = 18; static final int AssignExprList = 16; static final int GlobalDeclStmtList = 2; static final int Expr = 21; static final int ExprList = 14; static final int AssignExpr = 22; static final int MulExpr = 27; static final int $START = 0; static final int FieldDecl = 9; static final int Type = 1; static final int LocalDeclStmtList = 3; static final int PostfixExpr = 29; static final int DeclExprStmtOpt = 11; static final int AddExpr = 26; static final int LocalDeclStmt = 7; static final int PrefixExpr = 28; static final int IdentList = 17; static final int FormalParamDecl = 8; static final int Variable = 32; static final int LiteralValue = 31; static final int VariableDecl = 10; static final int AndExpr = 24; static final int FieldDeclList = 4; static final int Declarator = 19; public static String terminal_name( int id ) { switch ( id ) { case 26: return "DIVIDE"; case 55: return "STRINGVALUE"; case 39: return "CHAR"; case 20: return "GE"; case 53: return "INTVALUE"; case 52: return "CONTINUE"; case 38: return "INT"; case 48: return "FOR"; case 24: return "MINUS"; case 29: return "NOT"; case 8: return "SEMICOLON"; case 16: return "AND"; case 17: return "LT"; case 7: return "RIGHTSQ"; case 15: return "OR"; case 40: return "BOOL"; case 9: return "COMMA"; case 13: return "CLASS"; case 30: return "INC"; case 11: return "DOTDOT"; case 46: return "UNTIL"; case 6: return "LEFTSQ"; case 50: return "EXIT"; case 23: return "PLUS"; case 43: return "IF"; case 14: return "ASSIGN"; case 12: return "DOT"; case 19: return "LE"; case 2: return "LEFT"; case 0: return "EOF"; case 49: return "RETURN"; case 35: return "TRUE"; case 28: return "SIZE"; case 33: return "NEW"; case 1: return "error"; case 54: return "CHARVALUE"; case 34: return "NULL"; case 56: return "REALVALUE"; case 27: return "MOD"; case 57: return "IDENT"; case 51: return "BREAK"; case 42: return "VOID"; case 21: return "EQ"; case 41: return "REAL"; case 25: return "TIMES"; case 5: return "RIGHTBRACE"; case 10: return "COLON"; case 44: return "ELSE"; case 45: return "WHILE"; case 4: return "LEFTBRACE"; case 22: return "NE"; case 32: return "BUILTIN"; case 31: return "DEC"; case 36: return "FALSE"; case 3: return "RIGHT"; case 18: return "GT"; case 37: return "VAR"; case 47: return "DO"; default: return "unknown terminal" + id; } } public static String non_terminal_name( int id ) { switch ( id ) { case 15: return "AssignExprListOpt"; case 25: return "RelExpr"; case 13: return "ExprListOpt"; case 5: return "FormalParamDeclList"; case 12: return "Stmt"; case 23: return "OrExpr"; case 20: return "ExprOpt"; case 6: return "GlobalDeclStmt"; case 30: return "Primary"; case 18: return "DeclaratorList"; case 16: return "AssignExprList"; case 2: return "GlobalDeclStmtList"; case 21: return "Expr"; case 14: return "ExprList"; case 22: return "AssignExpr"; case 27: return "MulExpr"; case 0: return "$START"; case 9: return "FieldDecl"; case 1: return "Type"; case 3: return "LocalDeclStmtList"; case 29: return "PostfixExpr"; case 11: return "DeclExprStmtOpt"; case 26: return "AddExpr"; case 7: return "LocalDeclStmt"; case 28: return "PrefixExpr"; case 17: return "IdentList"; case 8: return "FormalParamDecl"; case 32: return "Variable"; case 31: return "LiteralValue"; case 10: return "VariableDecl"; case 24: return "AndExpr"; case 4: return "FieldDeclList"; case 19: return "Declarator"; default: return "unknown non_terminal" + id; } } public static String rule_name( int id ) { switch ( id ) { case 114: return "Variable ::= Primary DOT IDENT "; case 113: return "Variable ::= Primary LEFTSQ Expr RIGHTSQ "; case 112: return "Variable ::= IDENT "; case 111: return "LiteralValue ::= STRINGVALUE "; case 110: return "LiteralValue ::= CHARVALUE "; case 109: return "LiteralValue ::= FALSE "; case 108: return "LiteralValue ::= TRUE "; case 107: return "LiteralValue ::= NULL "; case 106: return "LiteralValue ::= REALVALUE "; case 105: return "LiteralValue ::= INTVALUE "; case 104: return "Primary ::= NEW Type LEFTBRACE ExprList RIGHTBRACE "; case 103: return "Primary ::= NEW Type "; case 102: return "Primary ::= NEW LEFTSQ Expr RIGHTSQ Type "; case 101: return "Primary ::= IDENT LEFT ExprListOpt RIGHT "; case 100: return "Primary ::= Primary LEFTSQ Expr DOTDOT Expr RIGHTSQ "; case 99: return "Primary ::= Variable "; case 98: return "Primary ::= LiteralValue "; case 97: return "Primary ::= LEFT Expr RIGHT "; case 96: return "PostfixExpr ::= Primary "; case 95: return "PostfixExpr ::= Variable DEC "; case 94: return "PostfixExpr ::= Variable INC "; case 93: return "PrefixExpr ::= PostfixExpr "; case 92: return "PrefixExpr ::= DEC Variable "; case 91: return "PrefixExpr ::= INC Variable "; case 90: return "PrefixExpr ::= SIZE PrefixExpr "; case 89: return "PrefixExpr ::= NOT PrefixExpr "; case 88: return "PrefixExpr ::= MINUS PrefixExpr "; case 87: return "MulExpr ::= PrefixExpr "; case 86: return "MulExpr ::= MulExpr MOD PrefixExpr "; case 85: return "MulExpr ::= MulExpr DIVIDE PrefixExpr "; case 84: return "MulExpr ::= MulExpr TIMES PrefixExpr "; case 83: return "AddExpr ::= MulExpr "; case 82: return "AddExpr ::= AddExpr MINUS MulExpr "; case 81: return "AddExpr ::= AddExpr PLUS MulExpr "; case 80: return "RelExpr ::= AddExpr "; case 79: return "RelExpr ::= AddExpr NE AddExpr "; case 78: return "RelExpr ::= AddExpr EQ AddExpr "; case 77: return "RelExpr ::= AddExpr GE AddExpr "; case 76: return "RelExpr ::= AddExpr LE AddExpr "; case 75: return "RelExpr ::= AddExpr GT AddExpr "; case 74: return "RelExpr ::= AddExpr LT AddExpr "; case 73: return "AndExpr ::= RelExpr "; case 72: return "AndExpr ::= AndExpr AND RelExpr "; case 71: return "OrExpr ::= AndExpr "; case 70: return "OrExpr ::= OrExpr OR AndExpr "; case 69: return "Expr ::= OrExpr "; case 68: return "ExprList ::= Expr "; case 67: return "ExprList ::= ExprList COMMA Expr "; case 66: return "ExprListOpt ::= "; case 65: return "ExprListOpt ::= ExprList "; case 64: return "AssignExpr ::= IDENT LEFT ExprListOpt RIGHT "; case 63: return "AssignExpr ::= Variable DEC "; case 62: return "AssignExpr ::= Variable INC "; case 61: return "AssignExpr ::= DEC Variable "; case 60: return "AssignExpr ::= INC Variable "; case 59: return "AssignExpr ::= Variable ASSIGN OrExpr "; case 58: return "AssignExprList ::= AssignExpr "; case 57: return "AssignExprList ::= AssignExprList COMMA AssignExpr "; case 56: return "AssignExprListOpt ::= "; case 55: return "AssignExprListOpt ::= AssignExprList "; case 54: return "ExprOpt ::= "; case 53: return "ExprOpt ::= Expr "; case 52: return "DeclExprStmtOpt ::= SEMICOLON "; case 51: return "DeclExprStmtOpt ::= VariableDecl "; case 50: return "DeclExprStmtOpt ::= AssignExprList SEMICOLON "; case 49: return "Stmt ::= error RIGHTBRACE "; case 48: return "Stmt ::= error SEMICOLON "; case 47: return "Stmt ::= BUILTIN LEFT ExprListOpt RIGHT "; case 46: return "Stmt ::= CONTINUE SEMICOLON "; case 45: return "Stmt ::= BREAK SEMICOLON "; case 44: return "Stmt ::= EXIT IDENT SEMICOLON "; case 43: return "Stmt ::= IDENT COLON Stmt "; case 42: return "Stmt ::= RETURN Expr SEMICOLON "; case 41: return "Stmt ::= RETURN SEMICOLON "; case 40: return "Stmt ::= FOR LEFT DeclExprStmtOpt ExprOpt SEMICOLON AssignExprListOpt RIGHT Stmt "; case 39: return "Stmt ::= DO Stmt UNTIL LEFT Expr RIGHT SEMICOLON "; case 38: return "Stmt ::= WHILE LEFT Expr RIGHT Stmt "; case 37: return "Stmt ::= IF LEFT Expr RIGHT Stmt ELSE Stmt "; case 36: return "Stmt ::= IF LEFT Expr RIGHT Stmt "; case 35: return "Stmt ::= LEFTBRACE LocalDeclStmtList RIGHTBRACE "; case 34: return "Stmt ::= AssignExpr SEMICOLON "; case 33: return "Stmt ::= SEMICOLON "; case 32: return "Declarator ::= IDENT ASSIGN Expr "; case 31: return "Declarator ::= IDENT "; case 30: return "IdentList ::= IDENT "; case 29: return "IdentList ::= IdentList COMMA IDENT "; case 28: return "DeclaratorList ::= Declarator "; case 27: return "DeclaratorList ::= DeclaratorList COMMA Declarator "; case 26: return "Type ::= LEFTSQ RIGHTSQ Type "; case 25: return "Type ::= IDENT "; case 24: return "Type ::= REAL "; case 23: return "Type ::= BOOL "; case 22: return "Type ::= CHAR "; case 21: return "Type ::= INT "; case 20: return "VariableDecl ::= Type DeclaratorList SEMICOLON "; case 19: return "FieldDecl ::= error SEMICOLON "; case 18: return "FieldDecl ::= Type IdentList SEMICOLON "; case 17: return "FieldDeclList ::= "; case 16: return "FieldDeclList ::= FieldDeclList FieldDecl "; case 15: return "FormalParamDecl ::= error SEMICOLON "; case 14: return "FormalParamDecl ::= VAR Type IdentList SEMICOLON "; case 13: return "FormalParamDecl ::= Type IdentList SEMICOLON "; case 12: return "FormalParamDeclList ::= "; case 11: return "FormalParamDeclList ::= FormalParamDeclList FormalParamDecl "; case 10: return "LocalDeclStmt ::= Stmt "; case 9: return "LocalDeclStmt ::= VariableDecl "; case 8: return "LocalDeclStmtList ::= "; case 7: return "LocalDeclStmtList ::= LocalDeclStmtList LocalDeclStmt "; case 6: return "GlobalDeclStmt ::= LocalDeclStmt "; case 5: return "GlobalDeclStmt ::= VOID IDENT LEFT FormalParamDeclList RIGHT LEFTBRACE LocalDeclStmtList RIGHTBRACE "; case 4: return "GlobalDeclStmt ::= Type IDENT LEFT FormalParamDeclList RIGHT LEFTBRACE LocalDeclStmtList RIGHTBRACE "; case 3: return "GlobalDeclStmt ::= CLASS IDENT LEFT FieldDeclList RIGHT SEMICOLON "; case 2: return "GlobalDeclStmtList ::= "; case 1: return "GlobalDeclStmtList ::= GlobalDeclStmtList GlobalDeclStmt "; case 0: return "$START ::= GlobalDeclStmtList EOF "; default: return "unknown rule" + id; } } }