예제 #1
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");
    }
  }