//---------------------------------------------------- // The following code was generated by CUP v0.10k // Wed May 03 15:14:50 NZST 2006 //---------------------------------------------------- package grammar; import java_cup.runtime.*; import node.*; import node.exprNode.*; import node.exprNode.binaryNode.*; import node.exprNode.postfixNode.*; import node.exprNode.simpleNode.*; import node.setComponentNode.*; import java.io.*; /** CUP v0.10k generated parser. * @version Wed May 03 15:14:50 NZST 2006 */ public class parser extends java_cup.runtime.lr_parser { /** Default constructor. */ public parser() {super();} /** Constructor which sets the default scanner. */ public parser(java_cup.runtime.Scanner s) {super(s);} /** Production table. */ protected static final short _production_table[][] = unpackFromStrings(new String[] { "\000\024\000\002\002\004\000\002\003\003\000\002\004" + "\005\000\002\004\003\000\002\005\004\000\002\005\003" + "\000\002\006\004\000\002\006\004\000\002\006\004\000" + "\002\006\003\000\002\007\003\000\002\007\003\000\002" + "\007\003\000\002\007\005\000\002\007\006\000\002\007" + "\005\000\002\010\003\000\002\010\004\000\002\011\003" + "\000\002\011\005" }); /** Access to production table. */ public short[][] production_table() {return _production_table;} /** Parse-action table. */ protected static final short[][] _action_table = unpackFromStrings(new String[] { "\000\036\000\014\004\015\005\011\007\004\015\013\016" + "\014\001\002\000\014\004\015\005\011\007\004\015\013" + "\016\014\001\002\000\004\002\036\001\002\000\022\002" + "\ufffe\004\015\005\011\007\004\010\ufffe\011\ufffe\015\013" + "\016\014\001\002\000\030\002\ufff8\004\ufff8\005\ufff8\007" + "\ufff8\010\ufff8\011\ufff8\012\034\013\035\014\033\015\ufff8" + "\016\ufff8\001\002\000\022\002\ufffc\004\ufffc\005\ufffc\007" + "\ufffc\010\ufffc\011\ufffc\015\ufffc\016\ufffc\001\002\000\030" + "\002\ufff5\004\ufff5\005\ufff5\007\ufff5\010\ufff5\011\ufff5\012" + "\ufff5\013\ufff5\014\ufff5\015\ufff5\016\ufff5\001\002\000\006" + "\002\000\011\030\001\002\000\030\002\ufff7\004\ufff7\005" + "\ufff7\007\ufff7\010\ufff7\011\ufff7\012\ufff7\013\ufff7\014\ufff7" + "\015\ufff7\016\ufff7\001\002\000\006\004\021\006\020\001" + "\002\000\030\002\ufff6\004\ufff6\005\ufff6\007\ufff6\010\ufff6" + "\011\ufff6\012\ufff6\013\ufff6\014\ufff6\015\ufff6\016\ufff6\001" + "\002\000\006\004\021\017\ufff1\001\002\000\004\017\026" + "\001\002\000\004\004\021\001\002\000\010\004\uffef\017" + "\uffef\020\022\001\002\000\004\004\023\001\002\000\006" + "\004\uffee\017\uffee\001\002\000\004\017\025\001\002\000" + "\030\002\ufff3\004\ufff3\005\ufff3\007\ufff3\010\ufff3\011\ufff3" + "\012\ufff3\013\ufff3\014\ufff3\015\ufff3\016\ufff3\001\002\000" + "\030\002\ufff4\004\ufff4\005\ufff4\007\ufff4\010\ufff4\011\ufff4" + "\012\ufff4\013\ufff4\014\ufff4\015\ufff4\016\ufff4\001\002\000" + "\004\017\ufff0\001\002\000\014\004\015\005\011\007\004" + "\015\013\016\014\001\002\000\022\002\uffff\004\015\005" + "\011\007\004\010\uffff\011\uffff\015\013\016\014\001\002" + "\000\022\002\ufffd\004\ufffd\005\ufffd\007\ufffd\010\ufffd\011" + "\ufffd\015\ufffd\016\ufffd\001\002\000\022\002\ufffa\004\ufffa" + "\005\ufffa\007\ufffa\010\ufffa\011\ufffa\015\ufffa\016\ufffa\001" + "\002\000\022\002\ufffb\004\ufffb\005\ufffb\007\ufffb\010\ufffb" + "\011\ufffb\015\ufffb\016\ufffb\001\002\000\022\002\ufff9\004" + "\ufff9\005\ufff9\007\ufff9\010\ufff9\011\ufff9\015\ufff9\016\ufff9" + "\001\002\000\004\002\001\001\002\000\006\010\040\011" + "\030\001\002\000\030\002\ufff2\004\ufff2\005\ufff2\007\ufff2" + "\010\ufff2\011\ufff2\012\ufff2\013\ufff2\014\ufff2\015\ufff2\016" + "\ufff2\001\002" }); /** Access to parse-action table. */ public short[][] action_table() {return _action_table;} /** reduce_goto table. */ protected static final short[][] _reduce_table = unpackFromStrings(new String[] { "\000\036\000\014\003\004\004\011\005\005\006\007\007" + "\006\001\001\000\012\004\036\005\005\006\007\007\006" + "\001\001\000\002\001\001\000\006\006\031\007\006\001" + "\001\000\002\001\001\000\002\001\001\000\002\001\001" + "\000\002\001\001\000\002\001\001\000\006\010\016\011" + "\015\001\001\000\002\001\001\000\006\010\026\011\015" + "\001\001\000\002\001\001\000\006\010\023\011\015\001" + "\001\000\002\001\001\000\002\001\001\000\002\001\001" + "\000\002\001\001\000\002\001\001\000\002\001\001\000" + "\002\001\001\000\010\005\030\006\007\007\006\001\001" + "\000\006\006\031\007\006\001\001\000\002\001\001\000" + "\002\001\001\000\002\001\001\000\002\001\001\000\002" + "\001\001\000\002\001\001\000\002\001\001" }); /** Access to reduce_goto table. */ public short[][] reduce_table() {return _reduce_table;} /** Instance of action encapsulation class. */ protected CUP$parser$actions action_obj; /** Action encapsulation object initializer. */ protected void init_actions() { action_obj = new CUP$parser$actions(this); } /** Invoke a user supplied parse action. */ public java_cup.runtime.Symbol do_action( int act_num, java_cup.runtime.lr_parser parser, java.util.Stack stack, int top) throws java.lang.Exception { /* call code in generated class */ return action_obj.CUP$parser$do_action(act_num, parser, stack, top); } /** Indicates start state. */ public int start_state() {return 0;} /** Indicates start production. */ public int start_production() {return 0;} /** EOF Symbol index. */ public int EOF_sym() {return 0;} /** error Symbol index. */ public int error_sym() {return 1;} /** Scan to get the next Symbol. */ public java_cup.runtime.Symbol scan() throws java.lang.Exception { return lexer.yylex(); } private Yylex lexer; private String text; private Reader sourceReader; public parser( String text ) { this(); this.text = text; sourceReader = new StringReader( text ); lexer = new Yylex( sourceReader ); } public String terminal_name( int id ) { return sym.terminal_name( id ); } public String non_terminal_name( int id ) { return sym.non_terminal_name( id ); } public String rule_name( int id ) { return sym.rule_name( id ); } public void report_error( String message, Object info ) { System.err.println( message ); if ( info instanceof Symbol ) { Symbol symbol = ( Symbol ) info; System.err.println( text ); for ( int i = 0; i < symbol.left; i++ ) System.err.print( " " ); for ( int i = symbol.left; i < symbol.right; i++ ) System.err.print( "^" ); System.err.println(); } else System.err.println(); } } /** Cup generated class to encapsulate user supplied action code.*/ class CUP$parser$actions { private final parser parser; /** Constructor */ CUP$parser$actions(parser parser) { this.parser = parser; } /** Method with the actual generated action code. */ public final java_cup.runtime.Symbol CUP$parser$do_action( int CUP$parser$act_num, java_cup.runtime.lr_parser CUP$parser$parser, java.util.Stack CUP$parser$stack, int CUP$parser$top) throws java.lang.Exception { /* Symbol object for return from actions */ java_cup.runtime.Symbol CUP$parser$result; /* select the action based on the action number */ switch (CUP$parser$act_num) { /*. . . . . . . . . . . . . . . . . . . .*/ case 19: // Element ::= CHAR MINUS CHAR { SetComponentNode RESULT = null; int chr1left = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left; int chr1right = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right; Character chr1 = (Character)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value; int chr2left = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left; int chr2right = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right; Character chr2 = (Character)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value; RESULT = new SetRangeNode( chr1.charValue(), chr2.charValue() ); CUP$parser$result = new java_cup.runtime.Symbol(7/*Element*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT); } return CUP$parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 18: // Element ::= CHAR { SetComponentNode RESULT = null; int chrleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left; int chrright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right; Character chr = (Character)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value; RESULT = new SetElementNode( chr.charValue() ); CUP$parser$result = new java_cup.runtime.Symbol(7/*Element*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT); } return CUP$parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 17: // Set ::= Element Set { SetComponentNode RESULT = null; int elementleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left; int elementright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right; SetComponentNode element = (SetComponentNode)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value; int setleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left; int setright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right; SetComponentNode set = (SetComponentNode)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value; RESULT = new SetComponentSeqNode( element, set ); CUP$parser$result = new java_cup.runtime.Symbol(6/*Set*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT); } return CUP$parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 16: // Set ::= Element { SetComponentNode RESULT = null; int elementleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left; int elementright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right; SetComponentNode element = (SetComponentNode)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value; RESULT = element; CUP$parser$result = new java_cup.runtime.Symbol(6/*Set*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT); } return CUP$parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 15: // SimpleExpr ::= LEFT OrExpr RIGHT { ExprNode RESULT = null; int exprleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left; int exprright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right; ExprNode expr = (ExprNode)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value; RESULT = expr; CUP$parser$result = new java_cup.runtime.Symbol(5/*SimpleExpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT); } return CUP$parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 14: // SimpleExpr ::= LEFTSQ CARET Set RIGHTSQ { ExprNode RESULT = null; int setleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left; int setright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right; SetComponentNode set = (SetComponentNode)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value; RESULT = new NotSetNode( set ); CUP$parser$result = new java_cup.runtime.Symbol(5/*SimpleExpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT); } return CUP$parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 13: // SimpleExpr ::= LEFTSQ Set RIGHTSQ { ExprNode RESULT = null; int setleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left; int setright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right; SetComponentNode set = (SetComponentNode)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value; RESULT = new SetNode( set ); CUP$parser$result = new java_cup.runtime.Symbol(5/*SimpleExpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT); } return CUP$parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 12: // SimpleExpr ::= STRING { ExprNode RESULT = null; int stringleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left; int stringright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right; String string = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value; RESULT = new StringNode( string ); CUP$parser$result = new java_cup.runtime.Symbol(5/*SimpleExpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT); } return CUP$parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 11: // SimpleExpr ::= CHAR { ExprNode RESULT = null; int chrleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left; int chrright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right; Character chr = (Character)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value; RESULT = new CharNode( chr.charValue() ); CUP$parser$result = new java_cup.runtime.Symbol(5/*SimpleExpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT); } return CUP$parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 10: // SimpleExpr ::= DOT { ExprNode RESULT = null; RESULT = new DotNode(); CUP$parser$result = new java_cup.runtime.Symbol(5/*SimpleExpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT); } return CUP$parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 9: // SequenceExpr ::= SimpleExpr { ExprNode RESULT = null; int exprleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left; int exprright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right; ExprNode expr = (ExprNode)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value; RESULT = expr; CUP$parser$result = new java_cup.runtime.Symbol(4/*SequenceExpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT); } return CUP$parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 8: // SequenceExpr ::= SimpleExpr PLUS { ExprNode RESULT = null; int exprleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left; int exprright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right; ExprNode expr = (ExprNode)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value; RESULT = new SeqNode( expr ); CUP$parser$result = new java_cup.runtime.Symbol(4/*SequenceExpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT); } return CUP$parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 7: // SequenceExpr ::= SimpleExpr STAR { ExprNode RESULT = null; int exprleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left; int exprright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right; ExprNode expr = (ExprNode)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value; RESULT = new OptSeqNode( expr ); CUP$parser$result = new java_cup.runtime.Symbol(4/*SequenceExpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT); } return CUP$parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 6: // SequenceExpr ::= SimpleExpr QUEST { ExprNode RESULT = null; int exprleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left; int exprright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right; ExprNode expr = (ExprNode)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value; RESULT = new OptNode( expr ); CUP$parser$result = new java_cup.runtime.Symbol(4/*SequenceExpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT); } return CUP$parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 5: // ConcatExpr ::= SequenceExpr { ExprNode RESULT = null; int exprleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left; int exprright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right; ExprNode expr = (ExprNode)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value; RESULT = expr; CUP$parser$result = new java_cup.runtime.Symbol(3/*ConcatExpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT); } return CUP$parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 4: // ConcatExpr ::= ConcatExpr SequenceExpr { ExprNode RESULT = null; int expr1left = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left; int expr1right = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right; ExprNode expr1 = (ExprNode)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value; int expr2left = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left; int expr2right = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right; ExprNode expr2 = (ExprNode)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value; RESULT = new ConcatNode( expr1, expr2 ); CUP$parser$result = new java_cup.runtime.Symbol(3/*ConcatExpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT); } return CUP$parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 3: // OrExpr ::= ConcatExpr { ExprNode RESULT = null; int exprleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left; int exprright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right; ExprNode expr = (ExprNode)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value; RESULT = expr; CUP$parser$result = new java_cup.runtime.Symbol(2/*OrExpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT); } return CUP$parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 2: // OrExpr ::= OrExpr OR ConcatExpr { ExprNode RESULT = null; int expr1left = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left; int expr1right = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right; ExprNode expr1 = (ExprNode)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value; int expr2left = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left; int expr2right = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right; ExprNode expr2 = (ExprNode)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value; RESULT = new OrNode( expr1, expr2 ); CUP$parser$result = new java_cup.runtime.Symbol(2/*OrExpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT); } return CUP$parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 1: // RegularExpr ::= OrExpr { ExprNode RESULT = null; int exprleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left; int exprright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right; ExprNode expr = (ExprNode)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value; RESULT = expr; CUP$parser$result = new java_cup.runtime.Symbol(1/*RegularExpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT); } return CUP$parser$result; /*. . . . . . . . . . . . . . . . . . . .*/ case 0: // $START ::= RegularExpr EOF { Object RESULT = null; int start_valleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left; int start_valright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right; ExprNode start_val = (ExprNode)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value; RESULT = start_val; CUP$parser$result = new java_cup.runtime.Symbol(0/*$START*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT); } /* ACCEPT */ CUP$parser$parser.done_parsing(); return CUP$parser$result; /* . . . . . .*/ default: throw new Exception( "Invalid action number found in internal parse table"); } } }