//---------------------------------------------------- // The following code was generated by CUP v0.10k // Wed May 03 15:14:45 NZST 2006 //---------------------------------------------------- package grammar; /** CUP generated class containing symbol constants. */ public class sym { /* terminals */ public static final int SHORT = 36; public static final int SIGNED = 37; public static final int LEFT = 77; public static final int GT = 62; public static final int ARROW = 82; public static final int BITNOT = 74; public static final int RIGHT = 78; public static final int LEFTSQ = 79; public static final int GE = 64; public static final int FLOATCONST = 6; public static final int RIGHTSHIFT = 66; public static final int REGISTER = 28; public static final int INCR = 75; public static final int ENUM = 24; public static final int SIZEOF = 72; public static final int COMMA = 40; public static final int RIGHTCURLY = 19; public static final int LT = 61; public static final int CHARCONST = 4; public static final int DOUBLE = 34; public static final int STRUCT = 22; public static final int BITANDASSIGN = 51; public static final int MODASSIGN = 46; public static final int NOT = 73; public static final int PLUSASSIGN = 42; public static final int LE = 63; public static final int DECR = 76; public static final int FLOAT = 33; public static final int GOTO = 25; public static final int INTCONST = 3; public static final int EQ = 59; public static final int RIGHTASSIGN = 48; public static final int MOD = 70; public static final int LONG = 35; public static final int PLUS = 67; public static final int DIVIDE = 69; public static final int WHILE = 9; public static final int UNION = 23; public static final int ASSIGN = 41; public static final int CHAR = 32; public static final int SWITCH = 15; public static final int DO = 10; public static final int LEFTSHIFT = 65; public static final int FOR = 14; public static final int STAR = 71; public static final int VOID = 39; public static final int EXTERN = 27; public static final int RETURN = 21; public static final int BITOR = 56; public static final int ELSE = 8; public static final int BREAK = 12; public static final int DOT = 81; public static final int AMPERSAND = 58; public static final int INT = 31; public static final int LEFTCURLY = 18; public static final int EOF = 0; public static final int DIVIDEASSIGN = 45; public static final int SEMICOLON = 11; public static final int DEFAULT = 17; public static final int LEFTASSIGN = 47; public static final int TIMESASSIGN = 44; public static final int BITORASSIGN = 49; public static final int MINUS = 68; public static final int OR = 54; public static final int IDENT = 2; public static final int error = 1; public static final int CONTINUE = 13; public static final int RIGHTSQ = 80; public static final int IF = 7; public static final int BITXOR = 57; public static final int UNSIGNED = 38; public static final int COLON = 53; public static final int ETC = 20; public static final int QUEST = 52; public static final int MINUSASSIGN = 43; public static final int CASE = 16; public static final int BITXORASSIGN = 50; public static final int STRINGCONST = 5; public static final int AND = 55; public static final int STATIC = 29; public static final int NE = 60; public static final int TYPEDEF = 30; public static final int AUTO = 26; static final int Declarator = 21; static final int StructDecl = 6; static final int PreExpr = 46; static final int AddExpr = 43; static final int StructType = 9; static final int EnumType = 11; static final int UnionType = 10; static final int ExternalDeclList = 2; static final int $START = 0; static final int ExternalDecl = 3; static final int TypeName = 19; static final int QuestExpr = 34; static final int AndExpr = 36; static final int Ident = 48; static final int OrExpr = 35; static final int AbstractDeclarator = 23; static final int ShiftExpr = 42; static final int AbstractDirectDeclarator = 24; static final int ExprOpt = 31; static final int InitDeclaratorList = 12; static final int RelExpr = 41; static final int ParamList = 26; static final int AssignExpr = 33; static final int DirectDeclarator = 22; static final int BlockStmt = 30; static final int Enumerator = 16; static final int InitDeclarator = 15; static final int ParamListOpt = 25; static final int Expr = 32; static final int MulExpr = 44; static final int InitialiserList = 18; static final int EqualExpr = 40; static final int StructDeclList = 4; static final int BitAndExpr = 39; static final int Decl = 5; static final int CastExpr = 45; static final int PostExpr = 47; static final int Stmt = 29; static final int Type = 7; static final int BitOrExpr = 37; static final int EnumeratorList = 14; static final int DeclaratorList = 13; static final int AbstractDeclaratorOpt = 20; static final int DeclStmtList = 28; static final int Initialiser = 17; static final int TranslationUnit = 1; static final int ParamDecl = 27; static final int BasicType = 8; static final int BitXOrExpr = 38; public static String terminal_name( int id ) { switch ( id ) { case 36: return "SHORT"; case 37: return "SIGNED"; case 77: return "LEFT"; case 62: return "GT"; case 82: return "ARROW"; case 74: return "BITNOT"; case 78: return "RIGHT"; case 79: return "LEFTSQ"; case 64: return "GE"; case 6: return "FLOATCONST"; case 66: return "RIGHTSHIFT"; case 28: return "REGISTER"; case 75: return "INCR"; case 24: return "ENUM"; case 72: return "SIZEOF"; case 40: return "COMMA"; case 19: return "RIGHTCURLY"; case 61: return "LT"; case 4: return "CHARCONST"; case 34: return "DOUBLE"; case 22: return "STRUCT"; case 51: return "BITANDASSIGN"; case 46: return "MODASSIGN"; case 73: return "NOT"; case 42: return "PLUSASSIGN"; case 63: return "LE"; case 76: return "DECR"; case 33: return "FLOAT"; case 25: return "GOTO"; case 3: return "INTCONST"; case 59: return "EQ"; case 48: return "RIGHTASSIGN"; case 70: return "MOD"; case 35: return "LONG"; case 67: return "PLUS"; case 69: return "DIVIDE"; case 9: return "WHILE"; case 23: return "UNION"; case 41: return "ASSIGN"; case 32: return "CHAR"; case 15: return "SWITCH"; case 10: return "DO"; case 65: return "LEFTSHIFT"; case 14: return "FOR"; case 71: return "STAR"; case 39: return "VOID"; case 27: return "EXTERN"; case 21: return "RETURN"; case 56: return "BITOR"; case 8: return "ELSE"; case 12: return "BREAK"; case 81: return "DOT"; case 58: return "AMPERSAND"; case 31: return "INT"; case 18: return "LEFTCURLY"; case 0: return "EOF"; case 45: return "DIVIDEASSIGN"; case 11: return "SEMICOLON"; case 17: return "DEFAULT"; case 47: return "LEFTASSIGN"; case 44: return "TIMESASSIGN"; case 49: return "BITORASSIGN"; case 68: return "MINUS"; case 54: return "OR"; case 2: return "IDENT"; case 1: return "error"; case 13: return "CONTINUE"; case 80: return "RIGHTSQ"; case 7: return "IF"; case 57: return "BITXOR"; case 38: return "UNSIGNED"; case 53: return "COLON"; case 20: return "ETC"; case 52: return "QUEST"; case 43: return "MINUSASSIGN"; case 16: return "CASE"; case 50: return "BITXORASSIGN"; case 5: return "STRINGCONST"; case 55: return "AND"; case 29: return "STATIC"; case 60: return "NE"; case 30: return "TYPEDEF"; case 26: return "AUTO"; default: return "unknown terminal" + id; } } public static String non_terminal_name( int id ) { switch ( id ) { case 21: return "Declarator"; case 6: return "StructDecl"; case 46: return "PreExpr"; case 43: return "AddExpr"; case 9: return "StructType"; case 11: return "EnumType"; case 10: return "UnionType"; case 2: return "ExternalDeclList"; case 0: return "$START"; case 3: return "ExternalDecl"; case 19: return "TypeName"; case 34: return "QuestExpr"; case 36: return "AndExpr"; case 48: return "Ident"; case 35: return "OrExpr"; case 23: return "AbstractDeclarator"; case 42: return "ShiftExpr"; case 24: return "AbstractDirectDeclarator"; case 31: return "ExprOpt"; case 12: return "InitDeclaratorList"; case 41: return "RelExpr"; case 26: return "ParamList"; case 33: return "AssignExpr"; case 22: return "DirectDeclarator"; case 30: return "BlockStmt"; case 16: return "Enumerator"; case 15: return "InitDeclarator"; case 25: return "ParamListOpt"; case 32: return "Expr"; case 44: return "MulExpr"; case 18: return "InitialiserList"; case 40: return "EqualExpr"; case 4: return "StructDeclList"; case 39: return "BitAndExpr"; case 5: return "Decl"; case 45: return "CastExpr"; case 47: return "PostExpr"; case 29: return "Stmt"; case 7: return "Type"; case 37: return "BitOrExpr"; case 14: return "EnumeratorList"; case 13: return "DeclaratorList"; case 20: return "AbstractDeclaratorOpt"; case 28: return "DeclStmtList"; case 17: return "Initialiser"; case 1: return "TranslationUnit"; case 27: return "ParamDecl"; case 8: return "BasicType"; case 38: return "BitXOrExpr"; default: return "unknown non_terminal" + id; } } public static String rule_name( int id ) { switch ( id ) { case 159: return "Ident ::= IDENT "; case 158: return "PostExpr ::= STRINGCONST "; case 157: return "PostExpr ::= FLOATCONST "; case 156: return "PostExpr ::= INTCONST "; case 155: return "PostExpr ::= CHARCONST "; case 154: return "PostExpr ::= Ident "; case 153: return "PostExpr ::= LEFT Expr RIGHT "; case 152: return "PostExpr ::= PostExpr DOT Ident "; case 151: return "PostExpr ::= PostExpr ARROW Ident "; case 150: return "PostExpr ::= PostExpr LEFTSQ Expr RIGHTSQ "; case 149: return "PostExpr ::= PostExpr LEFT ExprOpt RIGHT "; case 148: return "PostExpr ::= PostExpr DECR "; case 147: return "PostExpr ::= PostExpr INCR "; case 146: return "PreExpr ::= PostExpr "; case 145: return "PreExpr ::= SIZEOF PreExpr "; case 144: return "PreExpr ::= SIZEOF LEFT TypeName RIGHT "; case 143: return "PreExpr ::= DECR CastExpr "; case 142: return "PreExpr ::= INCR CastExpr "; case 141: return "PreExpr ::= STAR CastExpr "; case 140: return "PreExpr ::= AMPERSAND CastExpr "; case 139: return "PreExpr ::= MINUS CastExpr "; case 138: return "PreExpr ::= BITNOT CastExpr "; case 137: return "PreExpr ::= NOT CastExpr "; case 136: return "CastExpr ::= PreExpr "; case 135: return "CastExpr ::= LEFT TypeName RIGHT CastExpr "; case 134: return "MulExpr ::= PreExpr "; case 133: return "MulExpr ::= MulExpr MOD PreExpr "; case 132: return "MulExpr ::= MulExpr DIVIDE PreExpr "; case 131: return "MulExpr ::= MulExpr STAR PreExpr "; case 130: return "AddExpr ::= MulExpr "; case 129: return "AddExpr ::= AddExpr MINUS MulExpr "; case 128: return "AddExpr ::= AddExpr PLUS MulExpr "; case 127: return "ShiftExpr ::= AddExpr "; case 126: return "ShiftExpr ::= ShiftExpr RIGHTSHIFT AddExpr "; case 125: return "ShiftExpr ::= ShiftExpr LEFTSHIFT AddExpr "; case 124: return "RelExpr ::= ShiftExpr "; case 123: return "RelExpr ::= RelExpr GE ShiftExpr "; case 122: return "RelExpr ::= RelExpr LE ShiftExpr "; case 121: return "RelExpr ::= RelExpr GT ShiftExpr "; case 120: return "RelExpr ::= RelExpr LT ShiftExpr "; case 119: return "EqualExpr ::= RelExpr "; case 118: return "EqualExpr ::= EqualExpr NE RelExpr "; case 117: return "EqualExpr ::= EqualExpr EQ RelExpr "; case 116: return "BitAndExpr ::= EqualExpr "; case 115: return "BitAndExpr ::= BitAndExpr AMPERSAND EqualExpr "; case 114: return "BitXOrExpr ::= BitAndExpr "; case 113: return "BitXOrExpr ::= BitXOrExpr BITXOR BitAndExpr "; case 112: return "BitOrExpr ::= BitXOrExpr "; case 111: return "BitOrExpr ::= BitOrExpr BITOR BitXOrExpr "; case 110: return "AndExpr ::= BitOrExpr "; case 109: return "AndExpr ::= AndExpr AND BitOrExpr "; case 108: return "OrExpr ::= AndExpr "; case 107: return "OrExpr ::= OrExpr OR AndExpr "; case 106: return "QuestExpr ::= OrExpr "; case 105: return "QuestExpr ::= OrExpr QUEST Expr COLON QuestExpr "; case 104: return "AssignExpr ::= QuestExpr "; case 103: return "AssignExpr ::= QuestExpr BITANDASSIGN AssignExpr "; case 102: return "AssignExpr ::= QuestExpr BITXORASSIGN AssignExpr "; case 101: return "AssignExpr ::= QuestExpr BITORASSIGN AssignExpr "; case 100: return "AssignExpr ::= QuestExpr RIGHTASSIGN AssignExpr "; case 99: return "AssignExpr ::= QuestExpr LEFTASSIGN AssignExpr "; case 98: return "AssignExpr ::= QuestExpr MODASSIGN AssignExpr "; case 97: return "AssignExpr ::= QuestExpr DIVIDEASSIGN AssignExpr "; case 96: return "AssignExpr ::= QuestExpr TIMESASSIGN AssignExpr "; case 95: return "AssignExpr ::= QuestExpr MINUSASSIGN AssignExpr "; case 94: return "AssignExpr ::= QuestExpr PLUSASSIGN AssignExpr "; case 93: return "AssignExpr ::= QuestExpr ASSIGN AssignExpr "; case 92: return "Expr ::= AssignExpr "; case 91: return "Expr ::= Expr COMMA AssignExpr "; case 90: return "ExprOpt ::= Expr "; case 89: return "ExprOpt ::= "; case 88: return "BlockStmt ::= LEFTCURLY DeclStmtList RIGHTCURLY "; case 87: return "Stmt ::= SEMICOLON "; case 86: return "Stmt ::= RETURN ExprOpt SEMICOLON "; case 85: return "Stmt ::= CONTINUE SEMICOLON "; case 84: return "Stmt ::= BREAK SEMICOLON "; case 83: return "Stmt ::= GOTO Ident SEMICOLON "; case 82: return "Stmt ::= FOR LEFT ExprOpt SEMICOLON ExprOpt SEMICOLON ExprOpt RIGHT Stmt "; case 81: return "Stmt ::= DO Stmt WHILE LEFT Expr RIGHT SEMICOLON "; case 80: return "Stmt ::= WHILE LEFT Expr RIGHT Stmt "; case 79: return "Stmt ::= SWITCH LEFT Expr RIGHT BlockStmt "; case 78: return "Stmt ::= IF LEFT Expr RIGHT Stmt "; case 77: return "Stmt ::= IF LEFT Expr RIGHT Stmt ELSE Stmt "; case 76: return "Stmt ::= BlockStmt "; case 75: return "Stmt ::= Expr SEMICOLON "; case 74: return "Stmt ::= Ident COLON Stmt "; case 73: return "Stmt ::= DEFAULT COLON Stmt "; case 72: return "Stmt ::= CASE QuestExpr COLON Stmt "; case 71: return "DeclStmtList ::= error RIGHTCURLY "; case 70: return "DeclStmtList ::= error SEMICOLON "; case 69: return "DeclStmtList ::= DeclStmtList Decl "; case 68: return "DeclStmtList ::= DeclStmtList Stmt "; case 67: return "DeclStmtList ::= "; case 66: return "ParamDecl ::= Type Declarator "; case 65: return "ParamList ::= ParamList COMMA ParamDecl "; case 64: return "ParamList ::= ParamDecl "; case 63: return "ParamListOpt ::= ParamList COMMA ETC "; case 62: return "ParamListOpt ::= ParamList "; case 61: return "ParamListOpt ::= "; case 60: return "AbstractDirectDeclarator ::= LEFT AbstractDeclarator RIGHT "; case 59: return "AbstractDirectDeclarator ::= AbstractDirectDeclarator LEFT ParamListOpt RIGHT "; case 58: return "AbstractDirectDeclarator ::= LEFT ParamListOpt RIGHT "; case 57: return "AbstractDirectDeclarator ::= AbstractDirectDeclarator LEFTSQ ExprOpt RIGHTSQ "; case 56: return "AbstractDirectDeclarator ::= LEFTSQ ExprOpt RIGHTSQ "; case 55: return "AbstractDeclarator ::= AbstractDirectDeclarator "; case 54: return "AbstractDeclarator ::= STAR AbstractDeclarator "; case 53: return "AbstractDeclarator ::= STAR "; case 52: return "DirectDeclarator ::= Ident "; case 51: return "DirectDeclarator ::= LEFT Declarator RIGHT "; case 50: return "DirectDeclarator ::= DirectDeclarator LEFT ParamListOpt RIGHT "; case 49: return "DirectDeclarator ::= DirectDeclarator LEFTSQ ExprOpt RIGHTSQ "; case 48: return "Declarator ::= DirectDeclarator "; case 47: return "Declarator ::= STAR Declarator "; case 46: return "AbstractDeclaratorOpt ::= AbstractDeclarator "; case 45: return "AbstractDeclaratorOpt ::= "; case 44: return "TypeName ::= Type AbstractDeclaratorOpt "; case 43: return "InitialiserList ::= InitialiserList COMMA Initialiser "; case 42: return "InitialiserList ::= Initialiser "; case 41: return "Initialiser ::= LEFTCURLY InitialiserList RIGHTCURLY "; case 40: return "Initialiser ::= AssignExpr "; case 39: return "Enumerator ::= Ident ASSIGN AssignExpr "; case 38: return "Enumerator ::= Ident "; case 37: return "InitDeclarator ::= Declarator ASSIGN Initialiser "; case 36: return "InitDeclarator ::= Declarator "; case 35: return "EnumeratorList ::= EnumeratorList COMMA Enumerator "; case 34: return "EnumeratorList ::= Enumerator "; case 33: return "DeclaratorList ::= DeclaratorList COMMA Declarator "; case 32: return "DeclaratorList ::= Declarator "; case 31: return "InitDeclaratorList ::= InitDeclaratorList COMMA InitDeclarator "; case 30: return "InitDeclaratorList ::= InitDeclarator "; case 29: return "EnumType ::= ENUM Ident "; case 28: return "EnumType ::= ENUM Ident LEFTCURLY EnumeratorList RIGHTCURLY "; case 27: return "UnionType ::= UNION Ident "; case 26: return "UnionType ::= UNION Ident LEFTCURLY StructDeclList RIGHTCURLY "; case 25: return "StructType ::= STRUCT Ident "; case 24: return "StructType ::= STRUCT Ident LEFTCURLY StructDeclList RIGHTCURLY "; case 23: return "BasicType ::= VOID "; case 22: return "BasicType ::= DOUBLE "; case 21: return "BasicType ::= FLOAT "; case 20: return "BasicType ::= LONG "; case 19: return "BasicType ::= INT "; case 18: return "BasicType ::= SHORT "; case 17: return "BasicType ::= CHAR "; case 16: return "Type ::= EnumType "; case 15: return "Type ::= UnionType "; case 14: return "Type ::= StructType "; case 13: return "Type ::= BasicType "; case 12: return "StructDecl ::= Type DeclaratorList SEMICOLON "; case 11: return "Decl ::= Type InitDeclaratorList SEMICOLON "; case 10: return "Decl ::= Type SEMICOLON "; case 9: return "StructDeclList ::= StructDeclList StructDecl "; case 8: return "StructDeclList ::= "; case 7: return "ExternalDecl ::= Type Declarator BlockStmt "; case 6: return "ExternalDecl ::= Decl "; case 5: return "ExternalDeclList ::= error RIGHTCURLY "; case 4: return "ExternalDeclList ::= error SEMICOLON "; case 3: return "ExternalDeclList ::= ExternalDeclList ExternalDecl "; case 2: return "ExternalDeclList ::= "; case 1: return "TranslationUnit ::= ExternalDeclList "; case 0: return "$START ::= TranslationUnit EOF "; default: return "unknown rule" + id; } } }