Exemplo n.º 1
0
  private void dispatch(final boolean fireOnlyIfMixed) throws SAXException {
    if (fireOnlyIfMixed && buffer.length() == 0) return; // skip it

    Object[] ctx = (Object[]) context.peek();
    String here = (String) ctx[0];
    Attributes attrs = (Attributes) ctx[1];
    buffer.delete(0, buffer.length());
  }
Exemplo n.º 2
0
 public void endElement(String ns, String name, String qname) throws SAXException {
   dispatch(false);
   context.pop();
   if ("package".equals(name)) { // NOI18N
     handler.end_package();
   } else if ("jdo".equals(name)) { // NOI18N
     handler.end_jdo();
   } else if ("class".equals(name)) { // NOI18N
     handler.end_class();
   } else if ("map".equals(name)) { // NOI18N
     handler.end_map();
   } else if ("field".equals(name)) { // NOI18N
     handler.end_field();
   } else if ("collection".equals(name)) { // NOI18N
     handler.end_collection();
   } else if ("extension".equals(name)) { // NOI18N
     handler.end_extension();
   } else if ("array".equals(name)) { // NOI18N
     handler.end_array();
   }
 }
Exemplo n.º 3
0
  public void startElement(String ns, String name, String qname, Attributes attrs)
      throws SAXException {
    dispatch(true);
    context.push(new Object[] {qname, new org.xml.sax.helpers.AttributesImpl(attrs)});

    if ("package".equals(name)) { // NOI18N
      handler.start_package(attrs);
    } else if ("jdo".equals(name)) { // NOI18N
      handler.start_jdo(attrs);
    } else if ("class".equals(name)) { // NOI18N
      handler.start_class(attrs);
    } else if ("map".equals(name)) { // NOI18N
      handler.start_map(attrs);
    } else if ("field".equals(name)) { // NOI18N
      handler.start_field(attrs);
    } else if ("collection".equals(name)) { // NOI18N
      handler.start_collection(attrs);
    } else if ("extension".equals(name)) { // NOI18N
      handler.start_extension(attrs);
    } else if ("array".equals(name)) { // NOI18N
      handler.start_array(attrs);
    }
  }
Exemplo n.º 4
0
  /** Method with the actual generated action code. */
  public final java_cup.runtime.Symbol CUP$GMP2OPTParser$do_action(
      int CUP$GMP2OPTParser$act_num,
      java_cup.runtime.lr_parser CUP$GMP2OPTParser$parser,
      java.util.Stack CUP$GMP2OPTParser$stack,
      int CUP$GMP2OPTParser$top)
      throws java.lang.Exception {
    /* Symbol object for return from actions */
    java_cup.runtime.Symbol CUP$GMP2OPTParser$result;

    /* select the action based on the action number */
    switch (CUP$GMP2OPTParser$act_num) {
        /*. . . . . . . . . . . . . . . . . . . .*/
      case 10: // grad2 ::= RmsGrad RGRAD
        {
          Object RESULT = null;
          int rgleft =
              ((java_cup.runtime.Symbol)
                      CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                  .left;
          int rgright =
              ((java_cup.runtime.Symbol)
                      CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                  .right;
          Float rg =
              (Float)
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                      .value;
          // ___________________________________________________________________
          if (DEBUG) System.out.println("CUP:gopt: RMS Force " + rg);
          float rms = rg.floatValue();
          temp3.putField(rms);

          CUP$GMP2OPTParser$result =
              new java_cup.runtime.Symbol(
                  7 /*grad2*/,
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 1))
                      .left,
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                      .right,
                  RESULT);
        }
        return CUP$GMP2OPTParser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 9: // grad1 ::= MaxGrad MGRAD
        {
          Object RESULT = null;
          int mgleft =
              ((java_cup.runtime.Symbol)
                      CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                  .left;
          int mgright =
              ((java_cup.runtime.Symbol)
                      CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                  .right;
          Float mg =
              (Float)
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                      .value;
          // ___________________________________________________________________
          if (DEBUG) System.out.println("CUP:gopt: Maximum Force " + mg);
          float maxim = mg.floatValue();
          temp2.putField(maxim);

          CUP$GMP2OPTParser$result =
              new java_cup.runtime.Symbol(
                  6 /*grad1*/,
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 1))
                      .left,
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                      .right,
                  RESULT);
        }
        return CUP$GMP2OPTParser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 8: // cycle ::= NSearch ITERATION NT$1 grad1 grad2
        {
          Object RESULT = null;
          // propagate RESULT from NT$1
          if (((java_cup.runtime.Symbol)
                      CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 2))
                  .value
              != null)
            RESULT =
                (Object)
                    ((java_cup.runtime.Symbol)
                            CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 2))
                        .value;
          int cleft =
              ((java_cup.runtime.Symbol)
                      CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 3))
                  .left;
          int cright =
              ((java_cup.runtime.Symbol)
                      CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 3))
                  .right;
          Integer c =
              (Integer)
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 3))
                      .value;

          CUP$GMP2OPTParser$result =
              new java_cup.runtime.Symbol(
                  5 /*cycle*/,
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 4))
                      .left,
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                      .right,
                  RESULT);
        }
        return CUP$GMP2OPTParser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 7: // NT$1 ::=
        {
          Object RESULT = null;
          int cleft =
              ((java_cup.runtime.Symbol)
                      CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                  .left;
          int cright =
              ((java_cup.runtime.Symbol)
                      CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                  .right;
          Integer c =
              (Integer)
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                      .value;
          // ___________________________________________________________________
          if (DEBUG) System.out.println("CUP:gopt:  ITERATION " + c);
          int cycl = c.intValue();
          temp1.putField(cycl + 1);
          temp1.putField(", ");
          temp2.putField(cycl);
          temp2.putField(", ");
          temp3.putField(cycl);
          temp3.putField(", ");
          CUP$GMP2OPTParser$result =
              new java_cup.runtime.Symbol(
                  9 /*NT$1*/,
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                      .right,
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                      .right,
                  RESULT);
        }
        return CUP$GMP2OPTParser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 6: // scfcycle ::= Energ ENERGY NT$0 cycle
        {
          Object RESULT = null;
          // propagate RESULT from NT$0
          if (((java_cup.runtime.Symbol)
                      CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 1))
                  .value
              != null)
            RESULT =
                (Object)
                    ((java_cup.runtime.Symbol)
                            CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 1))
                        .value;
          int eleft =
              ((java_cup.runtime.Symbol)
                      CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 2))
                  .left;
          int eright =
              ((java_cup.runtime.Symbol)
                      CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 2))
                  .right;
          Float e =
              (Float)
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 2))
                      .value;

          CUP$GMP2OPTParser$result =
              new java_cup.runtime.Symbol(
                  4 /*scfcycle*/,
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 3))
                      .left,
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                      .right,
                  RESULT);
        }
        return CUP$GMP2OPTParser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 5: // NT$0 ::=
        {
          Object RESULT = null;
          int eleft =
              ((java_cup.runtime.Symbol)
                      CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                  .left;
          int eright =
              ((java_cup.runtime.Symbol)
                      CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                  .right;
          Float e =
              (Float)
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                      .value;
          // ___________________________________________________________________
          if (DEBUG) System.out.println("CUP:gopt:  ENERGY " + e);
          float energ = e.floatValue();
          energ = 100 * energ;
          temp1.putField(energ);

          CUP$GMP2OPTParser$result =
              new java_cup.runtime.Symbol(
                  8 /*NT$0*/,
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                      .right,
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                      .right,
                  RESULT);
        }
        return CUP$GMP2OPTParser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 4: // scfpat ::= scfcycle
        {
          Object RESULT = null;

          CUP$GMP2OPTParser$result =
              new java_cup.runtime.Symbol(
                  3 /*scfpat*/,
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                      .left,
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                      .right,
                  RESULT);
        }
        return CUP$GMP2OPTParser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 3: // scfpat ::= scfpat scfcycle
        {
          Object RESULT = null;
          if (DEBUG) System.out.println("CUP:gopt: in scfpat");
          CUP$GMP2OPTParser$result =
              new java_cup.runtime.Symbol(
                  3 /*scfpat*/,
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 1))
                      .left,
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                      .right,
                  RESULT);
        }
        return CUP$GMP2OPTParser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 2: // scfintro ::= FOUNDITER
        {
          Object RESULT = null;
          if (DEBUG) System.out.println("CUP:gopt:  found the start of Iteration");
          CUP$GMP2OPTParser$result =
              new java_cup.runtime.Symbol(
                  2 /*scfintro*/,
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                      .left,
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                      .right,
                  RESULT);
        }
        return CUP$GMP2OPTParser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 1: // $START ::= startpt EOF
        {
          Object RESULT = null;
          int start_valleft =
              ((java_cup.runtime.Symbol)
                      CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 1))
                  .left;
          int start_valright =
              ((java_cup.runtime.Symbol)
                      CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 1))
                  .right;
          Object start_val =
              (Object)
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 1))
                      .value;
          RESULT = start_val;
          CUP$GMP2OPTParser$result =
              new java_cup.runtime.Symbol(
                  0 /*$START*/,
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 1))
                      .left,
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                      .right,
                  RESULT);
        }
        /* ACCEPT */
        CUP$GMP2OPTParser$parser.done_parsing();
        return CUP$GMP2OPTParser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 0: // startpt ::= scfintro scfpat SCFDONE
        {
          Object RESULT = null;
          if (DEBUG) System.out.println("CUP:gopt:  end of parse tree ");
          table = new JTable();

          //       table = parseSCF.getTable();

          CUP$GMP2OPTParser$result =
              new java_cup.runtime.Symbol(
                  1 /*startpt*/,
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 2))
                      .left,
                  ((java_cup.runtime.Symbol)
                          CUP$GMP2OPTParser$stack.elementAt(CUP$GMP2OPTParser$top - 0))
                      .right,
                  RESULT);
        }
        return CUP$GMP2OPTParser$result;

        /* . . . . . .*/
      default:
        throw new Exception("Invalid action number found in internal parse table");
    }
  }
  /** Method with the actual generated action code. */
  public final java_cup.runtime.Symbol CUP$WavefunctionParser$do_action(
      int CUP$WavefunctionParser$act_num,
      java_cup.runtime.lr_parser CUP$WavefunctionParser$parser,
      java.util.Stack CUP$WavefunctionParser$stack,
      int CUP$WavefunctionParser$top)
      throws java.lang.Exception {
    /* Symbol object for return from actions */
    java_cup.runtime.Symbol CUP$WavefunctionParser$result;

    /* select the action based on the action number */
    switch (CUP$WavefunctionParser$act_num) {
        /*. . . . . . . . . . . . . . . . . . . .*/
      case 2: // scfintro ::= FOUNDITER RUNTYP
        {
          Object RESULT = null;
          if (DEBUG) System.out.println("CUP:WFparser: gaussian:  found FOUNDITER ");
          CUP$WavefunctionParser$result =
              new java_cup.runtime.Symbol(
                  2 /*scfintro*/,
                  ((java_cup.runtime.Symbol)
                          CUP$WavefunctionParser$stack.elementAt(CUP$WavefunctionParser$top - 1))
                      .left,
                  ((java_cup.runtime.Symbol)
                          CUP$WavefunctionParser$stack.elementAt(CUP$WavefunctionParser$top - 0))
                      .right,
                  RESULT);
        }
        return CUP$WavefunctionParser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 1: // $START ::= startpt EOF
        {
          Object RESULT = null;
          int start_valleft =
              ((java_cup.runtime.Symbol)
                      CUP$WavefunctionParser$stack.elementAt(CUP$WavefunctionParser$top - 1))
                  .left;
          int start_valright =
              ((java_cup.runtime.Symbol)
                      CUP$WavefunctionParser$stack.elementAt(CUP$WavefunctionParser$top - 1))
                  .right;
          Object start_val =
              (Object)
                  ((java_cup.runtime.Symbol)
                          CUP$WavefunctionParser$stack.elementAt(CUP$WavefunctionParser$top - 1))
                      .value;
          RESULT = start_val;
          CUP$WavefunctionParser$result =
              new java_cup.runtime.Symbol(
                  0 /*$START*/,
                  ((java_cup.runtime.Symbol)
                          CUP$WavefunctionParser$stack.elementAt(CUP$WavefunctionParser$top - 1))
                      .left,
                  ((java_cup.runtime.Symbol)
                          CUP$WavefunctionParser$stack.elementAt(CUP$WavefunctionParser$top - 0))
                      .right,
                  RESULT);
        }
        /* ACCEPT */
        CUP$WavefunctionParser$parser.done_parsing();
        return CUP$WavefunctionParser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 0: // startpt ::= scfintro
        {
          Object RESULT = null;
          if (DEBUG) System.out.println("CUP:WFParser: gaussian:  end of parse tree ");

          CUP$WavefunctionParser$result =
              new java_cup.runtime.Symbol(
                  1 /*startpt*/,
                  ((java_cup.runtime.Symbol)
                          CUP$WavefunctionParser$stack.elementAt(CUP$WavefunctionParser$top - 0))
                      .left,
                  ((java_cup.runtime.Symbol)
                          CUP$WavefunctionParser$stack.elementAt(CUP$WavefunctionParser$top - 0))
                      .right,
                  RESULT);
        }
        return CUP$WavefunctionParser$result;

        /* . . . . . .*/
      default:
        throw new Exception("Invalid action number found in internal parse table");
    }
  }
  /** 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 14: // expresion ::= LPARENT expresion RPARENT
        {
          Integer RESULT = null;
          int EXWleft =
              ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 1)).left;
          int EXWright =
              ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 1)).right;
          Integer EXW =
              (Integer)
                  ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 1)).value;
          RESULT = new Integer(EXW.intValue());
          CUP$parser$result =
              parser
                  .getSymbolFactory()
                  .newSymbol(
                      "expresion",
                      0,
                      ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)),
                      ((java_cup.runtime.Symbol) CUP$parser$stack.peek()),
                      RESULT);
        }
        return CUP$parser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 13: // expresion ::= RESTA expresion
        {
          Integer RESULT = null;
          int EPX1left = ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).left;
          int EPX1right = ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).right;
          Integer EPX1 = (Integer) ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
          RESULT = new Integer(EPX1 * (-1));
          CUP$parser$result =
              parser
                  .getSymbolFactory()
                  .newSymbol(
                      "expresion",
                      0,
                      ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 1)),
                      ((java_cup.runtime.Symbol) CUP$parser$stack.peek()),
                      RESULT);
        }
        return CUP$parser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 12: // expresion ::= expresion POTENCIA expresion
        {
          Integer RESULT = null;
          int ED1left =
              ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)).left;
          int ED1right =
              ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)).right;
          Integer ED1 =
              (Integer)
                  ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)).value;
          int ED2left = ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).left;
          int ED2right = ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).right;
          Integer ED2 = (Integer) ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
          RESULT = new Integer((int) Math.pow(ED1.intValue(), ED2.intValue()));
          CUP$parser$result =
              parser
                  .getSymbolFactory()
                  .newSymbol(
                      "expresion",
                      0,
                      ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)),
                      ((java_cup.runtime.Symbol) CUP$parser$stack.peek()),
                      RESULT);
        }
        return CUP$parser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 11: // expresion ::= expresion DIVISION expresion
        {
          Integer RESULT = null;
          int EC1left =
              ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)).left;
          int EC1right =
              ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)).right;
          Integer EC1 =
              (Integer)
                  ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)).value;
          int EC2left = ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).left;
          int EC2right = ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).right;
          Integer EC2 = (Integer) ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
          RESULT = new Integer(EC1.intValue() / EC2.intValue());
          CUP$parser$result =
              parser
                  .getSymbolFactory()
                  .newSymbol(
                      "expresion",
                      0,
                      ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)),
                      ((java_cup.runtime.Symbol) CUP$parser$stack.peek()),
                      RESULT);
        }
        return CUP$parser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 10: // expresion ::= expresion MULTIPLICACION expresion
        {
          Integer RESULT = null;
          int EA1left =
              ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)).left;
          int EA1right =
              ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)).right;
          Integer EA1 =
              (Integer)
                  ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)).value;
          int EA2left = ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).left;
          int EA2right = ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).right;
          Integer EA2 = (Integer) ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
          RESULT = new Integer(EA1.intValue() * EA2.intValue());
          CUP$parser$result =
              parser
                  .getSymbolFactory()
                  .newSymbol(
                      "expresion",
                      0,
                      ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)),
                      ((java_cup.runtime.Symbol) CUP$parser$stack.peek()),
                      RESULT);
        }
        return CUP$parser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 9: // expresion ::= expresion RESTA expresion
        {
          Integer RESULT = null;
          int EE1left =
              ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)).left;
          int EE1right =
              ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)).right;
          Integer EE1 =
              (Integer)
                  ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)).value;
          int EE2left = ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).left;
          int EE2right = ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).right;
          Integer EE2 = (Integer) ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
          RESULT = new Integer(EE1.intValue() - EE2.intValue());
          CUP$parser$result =
              parser
                  .getSymbolFactory()
                  .newSymbol(
                      "expresion",
                      0,
                      ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)),
                      ((java_cup.runtime.Symbol) CUP$parser$stack.peek()),
                      RESULT);
        }
        return CUP$parser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 8: // expresion ::= expresion SUMA expresion
        {
          Integer RESULT = null;
          int E1left =
              ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)).left;
          int E1right =
              ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)).right;
          Integer E1 =
              (Integer)
                  ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)).value;
          int E2left = ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).left;
          int E2right = ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).right;
          Integer E2 = (Integer) ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
          RESULT = new Integer(E1.intValue() + E2.intValue());
          CUP$parser$result =
              parser
                  .getSymbolFactory()
                  .newSymbol(
                      "expresion",
                      0,
                      ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)),
                      ((java_cup.runtime.Symbol) CUP$parser$stack.peek()),
                      RESULT);
        }
        return CUP$parser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 7: // expresion ::= ENTERO
        {
          Integer RESULT = null;
          int D1left = ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).left;
          int D1right = ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).right;
          Integer D1 = (Integer) ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
          RESULT = new Integer(D1.intValue());
          CUP$parser$result =
              parser
                  .getSymbolFactory()
                  .newSymbol(
                      "expresion",
                      0,
                      ((java_cup.runtime.Symbol) CUP$parser$stack.peek()),
                      ((java_cup.runtime.Symbol) CUP$parser$stack.peek()),
                      RESULT);
        }
        return CUP$parser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 6: // ecuacion ::= error NT$1 RESULTADO
        {
          Object RESULT = null;
          // propagate RESULT from NT$1
          RESULT =
              (Object)
                  ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 1)).value;

          CUP$parser$result =
              parser
                  .getSymbolFactory()
                  .newSymbol(
                      "ecuacion",
                      2,
                      ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)),
                      ((java_cup.runtime.Symbol) CUP$parser$stack.peek()),
                      RESULT);
        }
        return CUP$parser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 5: // NT$1 ::=
        {
          Object RESULT = null;
          System.out.println("Aprenda a escribir br..");
          CUP$parser$result =
              parser
                  .getSymbolFactory()
                  .newSymbol(
                      "NT$1",
                      4,
                      ((java_cup.runtime.Symbol) CUP$parser$stack.peek()),
                      ((java_cup.runtime.Symbol) CUP$parser$stack.peek()),
                      RESULT);
        }
        return CUP$parser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 4: // ecuacion ::= expresion NT$0 RESULTADO
        {
          Object RESULT = null;
          // propagate RESULT from NT$0
          RESULT =
              (Object)
                  ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 1)).value;
          int EQleft =
              ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)).left;
          int EQright =
              ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)).right;
          Integer EQ =
              (Integer)
                  ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)).value;

          CUP$parser$result =
              parser
                  .getSymbolFactory()
                  .newSymbol(
                      "ecuacion",
                      2,
                      ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 2)),
                      ((java_cup.runtime.Symbol) CUP$parser$stack.peek()),
                      RESULT);
        }
        return CUP$parser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 3: // NT$0 ::=
        {
          Object RESULT = null;
          int EQleft = ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).left;
          int EQright = ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).right;
          Integer EQ = (Integer) ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
          System.out.println("Sintaxis OK");
          System.out.println("Resultado = " + EQ.intValue());

          CUP$parser$result =
              parser
                  .getSymbolFactory()
                  .newSymbol(
                      "NT$0",
                      3,
                      ((java_cup.runtime.Symbol) CUP$parser$stack.peek()),
                      ((java_cup.runtime.Symbol) CUP$parser$stack.peek()),
                      RESULT);
        }
        return CUP$parser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 2: // sesion ::= ecuacion
        {
          Object RESULT = null;

          CUP$parser$result =
              parser
                  .getSymbolFactory()
                  .newSymbol(
                      "sesion",
                      1,
                      ((java_cup.runtime.Symbol) CUP$parser$stack.peek()),
                      ((java_cup.runtime.Symbol) CUP$parser$stack.peek()),
                      RESULT);
        }
        return CUP$parser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 1: // $START ::= sesion 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 =
              parser
                  .getSymbolFactory()
                  .newSymbol(
                      "$START",
                      0,
                      ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 1)),
                      ((java_cup.runtime.Symbol) CUP$parser$stack.peek()),
                      RESULT);
        }
        /* ACCEPT */
        CUP$parser$parser.done_parsing();
        return CUP$parser$result;

        /*. . . . . . . . . . . . . . . . . . . .*/
      case 0: // sesion ::= sesion ecuacion
        {
          Object RESULT = null;

          CUP$parser$result =
              parser
                  .getSymbolFactory()
                  .newSymbol(
                      "sesion",
                      1,
                      ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 1)),
                      ((java_cup.runtime.Symbol) CUP$parser$stack.peek()),
                      RESULT);
        }
        return CUP$parser$result;

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