//---------------------------------------------------- // The following code was generated by CUP v0.10k // Wed May 03 15:14:50 NZST 2006 //---------------------------------------------------- package grammar; /** CUP generated class containing symbol constants. */ public class sym { /* terminals */ public static final int MINUS = 14; public static final int LEFT = 5; public static final int QUEST = 8; public static final int CARET = 4; public static final int STAR = 10; public static final int PLUS = 9; public static final int EOF = 0; public static final int STRING = 3; public static final int RIGHT = 6; public static final int RIGHTSQ = 13; public static final int DOT = 11; public static final int error = 1; public static final int OR = 7; public static final int LEFTSQ = 12; public static final int CHAR = 2; static final int Element = 7; static final int SequenceExpr = 4; static final int Set = 6; static final int SimpleExpr = 5; static final int OrExpr = 2; static final int RegularExpr = 1; static final int $START = 0; static final int ConcatExpr = 3; public static String terminal_name( int id ) { switch ( id ) { case 14: return "MINUS"; case 5: return "LEFT"; case 8: return "QUEST"; case 4: return "CARET"; case 10: return "STAR"; case 9: return "PLUS"; case 0: return "EOF"; case 3: return "STRING"; case 6: return "RIGHT"; case 13: return "RIGHTSQ"; case 11: return "DOT"; case 1: return "error"; case 7: return "OR"; case 12: return "LEFTSQ"; case 2: return "CHAR"; default: return "unknown terminal" + id; } } public static String non_terminal_name( int id ) { switch ( id ) { case 7: return "Element"; case 4: return "SequenceExpr"; case 6: return "Set"; case 5: return "SimpleExpr"; case 2: return "OrExpr"; case 1: return "RegularExpr"; case 0: return "$START"; case 3: return "ConcatExpr"; default: return "unknown non_terminal" + id; } } public static String rule_name( int id ) { switch ( id ) { case 19: return "Element ::= CHAR MINUS CHAR "; case 18: return "Element ::= CHAR "; case 17: return "Set ::= Element Set "; case 16: return "Set ::= Element "; case 15: return "SimpleExpr ::= LEFT OrExpr RIGHT "; case 14: return "SimpleExpr ::= LEFTSQ CARET Set RIGHTSQ "; case 13: return "SimpleExpr ::= LEFTSQ Set RIGHTSQ "; case 12: return "SimpleExpr ::= STRING "; case 11: return "SimpleExpr ::= CHAR "; case 10: return "SimpleExpr ::= DOT "; case 9: return "SequenceExpr ::= SimpleExpr "; case 8: return "SequenceExpr ::= SimpleExpr PLUS "; case 7: return "SequenceExpr ::= SimpleExpr STAR "; case 6: return "SequenceExpr ::= SimpleExpr QUEST "; case 5: return "ConcatExpr ::= SequenceExpr "; case 4: return "ConcatExpr ::= ConcatExpr SequenceExpr "; case 3: return "OrExpr ::= ConcatExpr "; case 2: return "OrExpr ::= OrExpr OR ConcatExpr "; case 1: return "RegularExpr ::= OrExpr "; case 0: return "$START ::= RegularExpr EOF "; default: return "unknown rule" + id; } } }