
//----------------------------------------------------
// The following code was generated by CUP v0.10k
// Wed Sep 07 07:10:41 GMT+01:00 2005
//----------------------------------------------------

package yacs.parser;

import java.util.HashMap;
import yacs.domain.*;
import java_cup.runtime.*;

/** CUP v0.10k generated parser.
  * @version Wed Sep 07 07:10:41 GMT+01:00 2005
  */
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\026\000\002\003\003\000\002\002\004\000\002\004" +
    "\003\000\002\004\004\000\002\005\006\000\002\005\006" +
    "\000\002\005\006\000\002\005\006\000\002\005\006\000" +
    "\002\005\006\000\002\006\003\000\002\006\007\000\002" +
    "\006\007\000\002\006\007\000\002\006\007\000\002\006" +
    "\003\000\002\006\005\000\002\006\005\000\002\006\005" +
    "\000\002\006\005\000\002\006\004\000\002\006\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\065\000\014\006\014\011\013\014\004\025\006\027" +
    "\007\001\002\000\014\006\014\011\013\014\004\025\006" +
    "\027\007\001\002\000\016\002\001\006\014\011\013\014" +
    "\004\025\006\027\007\001\002\000\032\005\ufff7\007\ufff7" +
    "\013\ufff7\014\ufff7\015\ufff7\016\ufff7\017\ufff7\020\ufff7\021" +
    "\ufff7\022\ufff7\023\ufff7\024\ufff7\001\002\000\032\005\ufff2" +
    "\007\ufff2\013\ufff2\014\ufff2\015\ufff2\016\ufff2\017\ufff2\020" +
    "\ufff2\021\ufff2\022\ufff2\023\ufff2\024\ufff2\001\002\000\004" +
    "\002\065\001\002\000\016\002\uffff\006\uffff\011\uffff\014" +
    "\uffff\025\uffff\027\uffff\001\002\000\026\013\017\014\020" +
    "\015\022\016\021\017\045\020\046\021\044\022\043\023" +
    "\047\024\050\001\002\000\006\025\027\026\030\001\002" +
    "\000\014\006\014\011\013\014\004\025\006\027\007\001" +
    "\002\000\014\007\016\013\017\014\020\015\022\016\021" +
    "\001\002\000\032\005\uffec\007\uffec\013\uffec\014\uffec\015" +
    "\uffec\016\uffec\017\uffec\020\uffec\021\uffec\022\uffec\023\uffec" +
    "\024\uffec\001\002\000\014\006\014\011\013\014\004\025" +
    "\006\027\007\001\002\000\014\006\014\011\013\014\004" +
    "\025\006\027\007\001\002\000\014\006\014\011\013\014" +
    "\004\025\006\027\007\001\002\000\014\006\014\011\013" +
    "\014\004\025\006\027\007\001\002\000\032\005\uffef\007" +
    "\uffef\013\uffef\014\uffef\015\uffef\016\uffef\017\uffef\020\uffef" +
    "\021\uffef\022\uffef\023\uffef\024\uffef\001\002\000\032\005" +
    "\uffee\007\uffee\013\uffee\014\uffee\015\uffee\016\uffee\017\uffee" +
    "\020\uffee\021\uffee\022\uffee\023\uffee\024\uffee\001\002\000" +
    "\032\005\ufff0\007\ufff0\013\ufff0\014\ufff0\015\022\016\021" +
    "\017\ufff0\020\ufff0\021\ufff0\022\ufff0\023\ufff0\024\ufff0\001" +
    "\002\000\032\005\ufff1\007\ufff1\013\ufff1\014\ufff1\015\022" +
    "\016\021\017\ufff1\020\ufff1\021\ufff1\022\ufff1\023\ufff1\024" +
    "\ufff1\001\002\000\004\010\036\001\002\000\004\010\031" +
    "\001\002\000\006\025\032\026\033\001\002\000\004\012" +
    "\035\001\002\000\004\012\034\001\002\000\032\005\ufff6" +
    "\007\ufff6\013\ufff6\014\ufff6\015\ufff6\016\ufff6\017\ufff6\020" +
    "\ufff6\021\ufff6\022\ufff6\023\ufff6\024\ufff6\001\002\000\032" +
    "\005\ufff4\007\ufff4\013\ufff4\014\ufff4\015\ufff4\016\ufff4\017" +
    "\ufff4\020\ufff4\021\ufff4\022\ufff4\023\ufff4\024\ufff4\001\002" +
    "\000\006\025\037\026\040\001\002\000\004\012\042\001" +
    "\002\000\004\012\041\001\002\000\032\005\ufff3\007\ufff3" +
    "\013\ufff3\014\ufff3\015\ufff3\016\ufff3\017\ufff3\020\ufff3\021" +
    "\ufff3\022\ufff3\023\ufff3\024\ufff3\001\002\000\032\005\ufff5" +
    "\007\ufff5\013\ufff5\014\ufff5\015\ufff5\016\ufff5\017\ufff5\020" +
    "\ufff5\021\ufff5\022\ufff5\023\ufff5\024\ufff5\001\002\000\014" +
    "\006\014\011\013\014\004\025\006\027\007\001\002\000" +
    "\014\006\014\011\013\014\004\025\006\027\007\001\002" +
    "\000\014\006\014\011\013\014\004\025\006\027\007\001" +
    "\002\000\014\006\014\011\013\014\004\025\006\027\007" +
    "\001\002\000\014\006\014\011\013\014\004\025\006\027" +
    "\007\001\002\000\014\006\014\011\013\014\004\025\006" +
    "\027\007\001\002\000\014\005\052\013\017\014\020\015" +
    "\022\016\021\001\002\000\016\002\ufff8\006\ufff8\011\ufff8" +
    "\014\ufff8\025\ufff8\027\ufff8\001\002\000\014\005\054\013" +
    "\017\014\020\015\022\016\021\001\002\000\016\002\ufff9" +
    "\006\ufff9\011\ufff9\014\ufff9\025\ufff9\027\ufff9\001\002\000" +
    "\014\005\056\013\017\014\020\015\022\016\021\001\002" +
    "\000\016\002\ufffc\006\ufffc\011\ufffc\014\ufffc\025\ufffc\027" +
    "\ufffc\001\002\000\014\005\060\013\017\014\020\015\022" +
    "\016\021\001\002\000\016\002\ufffd\006\ufffd\011\ufffd\014" +
    "\ufffd\025\ufffd\027\ufffd\001\002\000\014\005\062\013\017" +
    "\014\020\015\022\016\021\001\002\000\016\002\ufffb\006" +
    "\ufffb\011\ufffb\014\ufffb\025\ufffb\027\ufffb\001\002\000\014" +
    "\005\064\013\017\014\020\015\022\016\021\001\002\000" +
    "\016\002\ufffa\006\ufffa\011\ufffa\014\ufffa\025\ufffa\027\ufffa" +
    "\001\002\000\004\002\000\001\002\000\016\002\ufffe\006" +
    "\ufffe\011\ufffe\014\ufffe\025\ufffe\027\ufffe\001\002\000\032" +
    "\005\uffed\007\uffed\013\uffed\014\uffed\015\uffed\016\uffed\017" +
    "\uffed\020\uffed\021\uffed\022\uffed\023\uffed\024\uffed\001\002" +
    "" });

  /** Access to parse-action table. */
  public short[][] action_table() {return _action_table;}

  /** <code>reduce_goto</code> table. */
  protected static final short[][] _reduce_table = 
    unpackFromStrings(new String[] {
    "\000\065\000\012\003\007\004\004\005\010\006\011\001" +
    "\001\000\004\006\066\001\001\000\006\005\065\006\011" +
    "\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\004\006\014\001\001\000\002\001\001\000\002\001" +
    "\001\000\004\006\025\001\001\000\004\006\024\001\001" +
    "\000\004\006\023\001\001\000\004\006\022\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\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\002\001\001\000\002\001\001\000\004" +
    "\006\062\001\001\000\004\006\060\001\001\000\004\006" +
    "\056\001\001\000\004\006\054\001\001\000\004\006\052" +
    "\001\001\000\004\006\050\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\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" +
    "\002\001\001" });

  /** Access to <code>reduce_goto</code> 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 1;}

  /** <code>EOF</code> Symbol index. */
  public int EOF_sym() {return 0;}

  /** <code>error</code> Symbol index. */
  public int error_sym() {return 1;}


  /** User initialization code. */
  public void user_init() throws java.lang.Exception
    {


  // Die in "parser" bereits befindlichen Variablenreferenzen in das
  // "action_obj" übertragen. Dies muss hier separat geschehen, da
  // erst während der "init"-Phase das "action_obj" instantiiert ist.
  action_obj.actionVariablesMap.putAll(this.parserVariablesMap);


    }


 /* this is where the parser code goes */

  /** HashtMap zum Zwischenspeichern der bereits vorhandenen Variablen */
  public HashMap parserVariablesMap = new HashMap();

 /**
  * Hinzufügen bereits vorhandener Variablen. Anstatt neue Variablen
  * zu erzeugen, werden so die Referenzen bestehender Objekte
  * verwendet.
  * @param variablesMap HashMap
  */
  public void addVariablesMap(HashMap variablesMap) {
    this.parserVariablesMap.putAll(variablesMap);
  }

 /**
  * Gibt den gescannten und geparsten Ausdruck als Expression zurück.
  * @return Expression
  */
  public Expression expression() {
    return action_obj.expression;
  }


}

/** Cup generated class to encapsulate user supplied action code.*/
class CUP$parser$actions {


  /* this is where the action code goes */

  /** der erzeugte Ausdruck */
  public Expression expression;

  /** HashtMap zum "Wiederfinden" der generierten Variablen */
  public HashMap actionVariablesMap = new HashMap();

  /** temporäre Variable zum Zwischenspeichern */
  public Variable tmpVariable;


  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 21: // expr_part ::= LPAREN expr_part RPAREN 
            {
              Expression RESULT = null;
		int eleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int eright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		Expression e = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		 RESULT = e; 
              CUP$parser$result = new java_cup.runtime.Symbol(4/*expr_part*/, ((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 20: // expr_part ::= MINUS expr_part 
            {
              Expression RESULT = null;
		int eleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int eright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		Expression e = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
		 RESULT = new UnaryOperator(sym.UMINUS, "-", e); 
              CUP$parser$result = new java_cup.runtime.Symbol(4/*expr_part*/, ((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 19: // expr_part ::= expr_part DIVIDE expr_part 
            {
              Expression RESULT = null;
		int lleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
		int lright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
		Expression l = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
		int rleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int rright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		Expression r = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
		 RESULT = new BinaryOperator(sym.DIVIDE, "/", l, r); 
              CUP$parser$result = new java_cup.runtime.Symbol(4/*expr_part*/, ((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: // expr_part ::= expr_part TIMES expr_part 
            {
              Expression RESULT = null;
		int lleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
		int lright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
		Expression l = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
		int rleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int rright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		Expression r = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
		 RESULT = new BinaryOperator(sym.TIMES, "*", l, r); 
              CUP$parser$result = new java_cup.runtime.Symbol(4/*expr_part*/, ((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 17: // expr_part ::= expr_part MINUS expr_part 
            {
              Expression RESULT = null;
		int lleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
		int lright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
		Expression l = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
		int rleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int rright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		Expression r = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
		 RESULT = new BinaryOperator(sym.MINUS, "-", l, r); 
              CUP$parser$result = new java_cup.runtime.Symbol(4/*expr_part*/, ((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 16: // expr_part ::= expr_part PLUS expr_part 
            {
              Expression RESULT = null;
		int lleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
		int lright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
		Expression l = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
		int rleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int rright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		Expression r = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
		 RESULT = new BinaryOperator(sym.PLUS, "+", l, r); 
              CUP$parser$result = new java_cup.runtime.Symbol(4/*expr_part*/, ((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 15: // expr_part ::= VARIABLE 
            {
              Expression RESULT = null;
		int vleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int vright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		String v = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
		 tmpVariable = (Variable)actionVariablesMap.get(v);
                  if (tmpVariable == null) {
                    // Variable mit leerer Domäne instantiieren:
                    tmpVariable = new Variable(v, new Domain());
                    actionVariablesMap.put(v, tmpVariable);
                  }
                  RESULT = tmpVariable;
               
              CUP$parser$result = new java_cup.runtime.Symbol(4/*expr_part*/, ((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 14: // expr_part ::= LBRACKET NUMBER COMMA FLOAT RBRACKET 
            {
              Expression RESULT = null;
		int loleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
		int loright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
		Integer lo = (Integer)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
		int hileft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int hiright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		Double hi = (Double)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		 RESULT = new Constant(lo.doubleValue(), hi.doubleValue()); 
              CUP$parser$result = new java_cup.runtime.Symbol(4/*expr_part*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 13: // expr_part ::= LBRACKET FLOAT COMMA NUMBER RBRACKET 
            {
              Expression RESULT = null;
		int loleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
		int loright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
		Double lo = (Double)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
		int hileft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int hiright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		Integer hi = (Integer)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		 RESULT = new Constant(lo.doubleValue(), hi.doubleValue()); 
              CUP$parser$result = new java_cup.runtime.Symbol(4/*expr_part*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 12: // expr_part ::= LBRACKET NUMBER COMMA NUMBER RBRACKET 
            {
              Expression RESULT = null;
		int loleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
		int loright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
		Integer lo = (Integer)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
		int hileft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int hiright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		Integer hi = (Integer)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		 RESULT = new Constant(lo.doubleValue(), hi.doubleValue()); 
              CUP$parser$result = new java_cup.runtime.Symbol(4/*expr_part*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 11: // expr_part ::= LBRACKET FLOAT COMMA FLOAT RBRACKET 
            {
              Expression RESULT = null;
		int loleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
		int loright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
		Double lo = (Double)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
		int hileft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int hiright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		Double hi = (Double)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		 RESULT = new Constant(lo, hi); 
              CUP$parser$result = new java_cup.runtime.Symbol(4/*expr_part*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 10: // expr_part ::= NUMBER 
            {
              Expression RESULT = null;
		int nleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int nright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		Integer n = (Integer)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
		 RESULT = new Constant(n); 
              CUP$parser$result = new java_cup.runtime.Symbol(4/*expr_part*/, ((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: // expr ::= expr_part LOWER_EQUAL expr_part SEMI 
            {
              Expression RESULT = null;
		int lleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
		int lright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
		Expression l = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
		int rleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int rright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		Expression r = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		 RESULT = new BinaryOperator(sym.LOWER_EQUAL, "<=", l, r); 
              CUP$parser$result = new java_cup.runtime.Symbol(3/*expr*/, ((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 8: // expr ::= expr_part GREATER_EQUAL expr_part SEMI 
            {
              Expression RESULT = null;
		int lleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
		int lright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
		Expression l = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
		int rleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int rright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		Expression r = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		 RESULT = new BinaryOperator(sym.GREATER_EQUAL, ">=", l, r); 
              CUP$parser$result = new java_cup.runtime.Symbol(3/*expr*/, ((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 7: // expr ::= expr_part LOWER expr_part SEMI 
            {
              Expression RESULT = null;
		int lleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
		int lright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
		Expression l = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
		int rleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int rright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		Expression r = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		 RESULT = new BinaryOperator(sym.LOWER, "<", l, r); 
              CUP$parser$result = new java_cup.runtime.Symbol(3/*expr*/, ((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 6: // expr ::= expr_part GREATER expr_part SEMI 
            {
              Expression RESULT = null;
		int lleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
		int lright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
		Expression l = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
		int rleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int rright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		Expression r = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		 RESULT = new BinaryOperator(sym.GREATER, ">", l, r); 
              CUP$parser$result = new java_cup.runtime.Symbol(3/*expr*/, ((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 5: // expr ::= expr_part NOT_EQUAL expr_part SEMI 
            {
              Expression RESULT = null;
		int lleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
		int lright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
		Expression l = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
		int rleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int rright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		Expression r = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		 RESULT = new BinaryOperator(sym.NOT_EQUAL, "!=", l, r); 
              CUP$parser$result = new java_cup.runtime.Symbol(3/*expr*/, ((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 4: // expr ::= expr_part EQUAL expr_part SEMI 
            {
              Expression RESULT = null;
		int lleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
		int lright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
		Expression l = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
		int rleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int rright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		Expression r = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		 RESULT = new BinaryOperator(sym.EQUAL, "=", l, r); 
              CUP$parser$result = new java_cup.runtime.Symbol(3/*expr*/, ((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 3: // expr_list ::= expr_list expr 
            {
              Expression RESULT = null;
		int lleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int lright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		Expression l = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		int rleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int rright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		Expression r = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
		 RESULT = new BinaryOperator(sym.SEMI, ";", l, r); 
              CUP$parser$result = new java_cup.runtime.Symbol(2/*expr_list*/, ((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 2: // expr_list ::= expr 
            {
              Expression RESULT = null;
		int eleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int eright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		Expression e = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
		 RESULT = e; 
              CUP$parser$result = new java_cup.runtime.Symbol(2/*expr_list*/, ((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 1: // $START ::= expr_all 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;
		Object start_val = (Object)((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;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 0: // expr_all ::= expr_list 
            {
              Object RESULT = null;
		int eleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int eright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		Expression e = (Expression)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
		
                System.out.println(" => "+e.toString());
                this.expression = e;
               
              CUP$parser$result = new java_cup.runtime.Symbol(1/*expr_all*/, ((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;

          /* . . . . . .*/
          default:
            throw new Exception(
               "Invalid action number found in internal parse table");

        }
    }
}

