/* Generated By:JJTree&JavaCC: Do not edit this line. SLParser.java */
package org.jamocha.languages.sl.parser;

import org.jamocha.languages.sl.sl2clips_adapter.configurations.*;
import java.io.InputStream;
import java.io.StringReader;

public class SLParser/*@bgen(jjtree)*/implements SLParserTreeConstants, SLParserConstants {/*@bgen(jjtree)*/
  protected JJTSLParserState jjtree = new JJTSLParserState();
        public static ContentSLConfiguration parse(String string) throws ParseException {
                SLParser parser = new SLParser(new StringReader(string));
        SimpleNode content = parser.Content();
        return (ContentSLConfiguration) content.jjtAccept(new SLInterpreter(), null);
        }

        public static ContentSLConfiguration parse(InputStream stream) throws ParseException {
                SLParser parser = new SLParser(stream);
        SimpleNode content = parser.Content();
        return (ContentSLConfiguration) content.jjtAccept(new SLInterpreter(), null);
        }

        public static void main(String args[]){
        try{
                System.out.print("SL> ");
            ContentSLConfiguration res = SLParser.parse(System.in);
            String result = res.compile(SLCompileType.ACTION_AND_ASSERT);
            System.out.println(result);
            System.out.println("Thank you.");
        }
        catch(ParseException e){
            System.out.println("parse(): an invalid expression!");
            System.out.println(e.getMessage());
            e.printStackTrace();
        }
        catch (TokenMgrError e){
            System.out.println("a Token Manager error!");
            System.out.println(e.getMessage());
            e.printStackTrace();
        }
    }

/* Content syntax follows */
  final public SimpleNode Content() throws ParseException {
 /*@bgen(jjtree) Content */
  SLContent jjtn000 = new SLContent(this, JJTCONTENT);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      jj_consume_token(LBRACE);
      label_1:
      while (true) {
        ContentExpression();
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case TRUE:
        case FALSE:
        case LBRACE:
        case STRING:
          ;
          break;
        default:
          jj_la1[0] = jj_gen;
          break label_1;
        }
      }
      jj_consume_token(RBRACE);
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        {if (true) return jjtn000;}
    } catch (Throwable jjte000) {
          if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
          } else {
            jjtree.popNode();
          }
          if (jjte000 instanceof RuntimeException) {
            {if (true) throw (RuntimeException)jjte000;}
          }
          if (jjte000 instanceof ParseException) {
            {if (true) throw (ParseException)jjte000;}
          }
          {if (true) throw (Error)jjte000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

  final public SimpleNode ContentExpression() throws ParseException {
 /*@bgen(jjtree) ContentExpression */
  SLContentExpression jjtn000 = new SLContentExpression(this, JJTCONTENTEXPRESSION);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      if (jj_2_1(2)) {
        Proposition();
      } else {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case LBRACE:
          jj_consume_token(LBRACE);
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case IOTA:
          case ANY:
          case ALL:
            IdentifyingExpression();
            break;
          case ACTION:
          case PIPE:
          case SEMICOLON:
            ActionExpression();
            break;
          default:
            jj_la1[1] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
          jj_consume_token(RBRACE);
          break;
        default:
          jj_la1[2] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        {if (true) return jjtn000;}
    } catch (Throwable jjte000) {
          if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
          } else {
            jjtree.popNode();
          }
          if (jjte000 instanceof RuntimeException) {
            {if (true) throw (RuntimeException)jjte000;}
          }
          if (jjte000 instanceof ParseException) {
            {if (true) throw (ParseException)jjte000;}
          }
          {if (true) throw (Error)jjte000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

  final public SimpleNode Proposition() throws ParseException {
 /*@bgen(jjtree) Proposition */
  SLProposition jjtn000 = new SLProposition(this, JJTPROPOSITION);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      Wff();
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        {if (true) return jjtn000;}
    } catch (Throwable jjte000) {
          if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
          } else {
            jjtree.popNode();
          }
          if (jjte000 instanceof RuntimeException) {
            {if (true) throw (RuntimeException)jjte000;}
          }
          if (jjte000 instanceof ParseException) {
            {if (true) throw (ParseException)jjte000;}
          }
          {if (true) throw (Error)jjte000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

  final public SimpleNode Wff() throws ParseException {
 /*@bgen(jjtree) Wff */
  SLWff jjtn000 = new SLWff(this, JJTWFF);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case LBRACE:
        jj_consume_token(LBRACE);
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case NOT:
          UnaryLogicalOp();
          Wff();
          break;
        case AND:
        case OR:
        case IMPLIES:
        case EQUIV:
          BinaryLogicalOp();
          Wff();
          Wff();
          break;
        case FORALL:
        case EXISTS:
          Quantifier();
          Variable();
          Wff();
          break;
        case MODAL_B:
        case MODAL_U:
        case MODAL_PG:
        case MODAL_I:
          ModalOp();
          Agent();
          Wff();
          break;
        case FEASIBLE:
        case DONE:
          ActionOp();
          jj_consume_token(LBRACE);
          ActionExpression();
          jj_consume_token(RBRACE);
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case TRUE:
          case FALSE:
          case LBRACE:
          case STRING:
            Wff();
            break;
          default:
            jj_la1[3] = jj_gen;
            ;
          }
          break;
        case EQUAL:
        case RESULT:
          BinaryTermOp();
          TermOrIE();
          TermOrIE();
          break;
        case STRING:
          PredicateSymbol();
          label_2:
          while (true) {
            TermOrIE();
            switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
            case IOTA:
            case ANY:
            case ALL:
            case LBRACE:
            case STRING:
            case VARIABLE_IDENTIFIER:
            case INTEGER:
            case FLOAT:
            case DATETIME:
              ;
              break;
            default:
              jj_la1[4] = jj_gen;
              break label_2;
            }
          }
          break;
        default:
          jj_la1[5] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
        jj_consume_token(RBRACE);
        break;
      case TRUE:
      case FALSE:
      case STRING:
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case TRUE:
        case FALSE:
          BooleanSymbol();
          break;
        case STRING:
          PropositionSymbol();
          break;
        default:
          jj_la1[6] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
        break;
      default:
        jj_la1[7] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        {if (true) return jjtn000;}
    } catch (Throwable jjte000) {
          if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
          } else {
            jjtree.popNode();
          }
          if (jjte000 instanceof RuntimeException) {
            {if (true) throw (RuntimeException)jjte000;}
          }
          if (jjte000 instanceof ParseException) {
            {if (true) throw (ParseException)jjte000;}
          }
          {if (true) throw (Error)jjte000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

  final public void TermOrIE() throws ParseException {
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case LBRACE:
    case STRING:
    case VARIABLE_IDENTIFIER:
    case INTEGER:
    case FLOAT:
    case DATETIME:
      Term();
      break;
    case IOTA:
    case ANY:
    case ALL:
      IdentifyingExpression();
      break;
    default:
      jj_la1[8] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

  final public void Term() throws ParseException {
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case VARIABLE_IDENTIFIER:
      Variable();
      break;
    case STRING:
    case INTEGER:
    case FLOAT:
    case DATETIME:
      Constant();
      break;
    case LBRACE:
      jj_consume_token(LBRACE);
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case ACTION:
      case PIPE:
      case SEMICOLON:
        ActionExpression();
        break;
      case STRING:
        FunctionalTerm();
        break;
      case SEQUENCE:
      case SET:
        SetOrSequence();
        break;
      default:
        jj_la1[9] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
      jj_consume_token(RBRACE);
      break;
    default:
      jj_la1[10] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

  final public SimpleNode IdentifyingExpression() throws ParseException {
 /*@bgen(jjtree) IdentifyingExpression */
  SLIdentifyingExpression jjtn000 = new SLIdentifyingExpression(this, JJTIDENTIFYINGEXPRESSION);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      ReferentialOp();
      TermOrIE();
      Wff();
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        {if (true) return jjtn000;}
    } catch (Throwable jjte000) {
          if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
          } else {
            jjtree.popNode();
          }
          if (jjte000 instanceof RuntimeException) {
            {if (true) throw (RuntimeException)jjte000;}
          }
          if (jjte000 instanceof ParseException) {
            {if (true) throw (ParseException)jjte000;}
          }
          {if (true) throw (Error)jjte000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

  final public void FunctionalTerm() throws ParseException {
    if (jj_2_2(2)) {
      FunctionalTermWithTermOrIE();
    } else {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case STRING:
        FunctionalTermWithParameter();
        break;
      default:
        jj_la1[11] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    }
  }

  final public SimpleNode FunctionalTermWithTermOrIE() throws ParseException {
 /*@bgen(jjtree) FunctionalTermWithTermOrIE */
  SLFunctionalTermWithTermOrIE jjtn000 = new SLFunctionalTermWithTermOrIE(this, JJTFUNCTIONALTERMWITHTERMORIE);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      FunctionSymbol();
      label_3:
      while (true) {
        TermOrIE();
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case IOTA:
        case ANY:
        case ALL:
        case LBRACE:
        case STRING:
        case VARIABLE_IDENTIFIER:
        case INTEGER:
        case FLOAT:
        case DATETIME:
          ;
          break;
        default:
          jj_la1[12] = jj_gen;
          break label_3;
        }
      }
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        {if (true) return jjtn000;}
    } catch (Throwable jjte000) {
          if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
          } else {
            jjtree.popNode();
          }
          if (jjte000 instanceof RuntimeException) {
            {if (true) throw (RuntimeException)jjte000;}
          }
          if (jjte000 instanceof ParseException) {
            {if (true) throw (ParseException)jjte000;}
          }
          {if (true) throw (Error)jjte000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

  final public SimpleNode FunctionalTermWithParameter() throws ParseException {
 /*@bgen(jjtree) FunctionalTermWithParameter */
  SLFunctionalTermWithParameter jjtn000 = new SLFunctionalTermWithParameter(this, JJTFUNCTIONALTERMWITHPARAMETER);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      FunctionSymbol();
      label_4:
      while (true) {
        Parameter();
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case PARAMETER_NAME:
          ;
          break;
        default:
          jj_la1[13] = jj_gen;
          break label_4;
        }
      }
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        {if (true) return jjtn000;}
    } catch (Throwable jjte000) {
          if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
          } else {
            jjtree.popNode();
          }
          if (jjte000 instanceof RuntimeException) {
            {if (true) throw (RuntimeException)jjte000;}
          }
          if (jjte000 instanceof ParseException) {
            {if (true) throw (ParseException)jjte000;}
          }
          {if (true) throw (Error)jjte000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

  final public SimpleNode ActionExpression() throws ParseException {
 /*@bgen(jjtree) ActionExpression */
  SLActionExpression jjtn000 = new SLActionExpression(this, JJTACTIONEXPRESSION);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);Token t;
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case ACTION:
        t = jj_consume_token(ACTION);
        Agent();
        TermOrIE();
        break;
      case PIPE:
        t = jj_consume_token(PIPE);
        jj_consume_token(LBRACE);
        ActionExpression();
        jj_consume_token(RBRACE);
        jj_consume_token(LBRACE);
        ActionExpression();
        jj_consume_token(RBRACE);
        break;
      case SEMICOLON:
        t = jj_consume_token(SEMICOLON);
        jj_consume_token(LBRACE);
        ActionExpression();
        jj_consume_token(RBRACE);
        jj_consume_token(LBRACE);
        ActionExpression();
        jj_consume_token(RBRACE);
        break;
      default:
        jj_la1[14] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        jjtn000.setName(t.image);
        {if (true) return jjtn000;}
    } catch (Throwable jjte000) {
          if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
          } else {
            jjtree.popNode();
          }
          if (jjte000 instanceof RuntimeException) {
            {if (true) throw (RuntimeException)jjte000;}
          }
          if (jjte000 instanceof ParseException) {
            {if (true) throw (ParseException)jjte000;}
          }
          {if (true) throw (Error)jjte000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

  final public SimpleNode Agent() throws ParseException {
 /*@bgen(jjtree) Agent */
  SLAgent jjtn000 = new SLAgent(this, JJTAGENT);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      TermOrIE();
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        {if (true) return jjtn000;}
    } catch (Throwable jjte000) {
          if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
          } else {
            jjtree.popNode();
          }
          if (jjte000 instanceof RuntimeException) {
            {if (true) throw (RuntimeException)jjte000;}
          }
          if (jjte000 instanceof ParseException) {
            {if (true) throw (ParseException)jjte000;}
          }
          {if (true) throw (Error)jjte000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

  final public SimpleNode SetOrSequence() throws ParseException {
 /*@bgen(jjtree) SetOrSequence */
  SLSetOrSequence jjtn000 = new SLSetOrSequence(this, JJTSETORSEQUENCE);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case SET:
        jj_consume_token(SET);
        break;
      case SEQUENCE:
        jj_consume_token(SEQUENCE);
        break;
      default:
        jj_la1[15] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
      label_5:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case IOTA:
        case ANY:
        case ALL:
        case LBRACE:
        case STRING:
        case VARIABLE_IDENTIFIER:
        case INTEGER:
        case FLOAT:
        case DATETIME:
          ;
          break;
        default:
          jj_la1[16] = jj_gen;
          break label_5;
        }
        TermOrIE();
      }
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        {if (true) return jjtn000;}
    } catch (Throwable jjte000) {
          if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
          } else {
            jjtree.popNode();
          }
          if (jjte000 instanceof RuntimeException) {
            {if (true) throw (RuntimeException)jjte000;}
          }
          if (jjte000 instanceof ParseException) {
            {if (true) throw (ParseException)jjte000;}
          }
          {if (true) throw (Error)jjte000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

  final public SimpleNode Parameter() throws ParseException {
 /*@bgen(jjtree) Parameter */
  SLParameter jjtn000 = new SLParameter(this, JJTPARAMETER);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      ParameterName();
      TermOrIE();
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        {if (true) return jjtn000;}
    } catch (Throwable jjte000) {
          if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
          } else {
            jjtree.popNode();
          }
          if (jjte000 instanceof RuntimeException) {
            {if (true) throw (RuntimeException)jjte000;}
          }
          if (jjte000 instanceof ParseException) {
            {if (true) throw (ParseException)jjte000;}
          }
          {if (true) throw (Error)jjte000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

/* Operators */
  final public SimpleNode UnaryLogicalOp() throws ParseException {
 /*@bgen(jjtree) UnaryLogicalOp */
  SLUnaryLogicalOp jjtn000 = new SLUnaryLogicalOp(this, JJTUNARYLOGICALOP);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);Token t;
    try {
      t = jj_consume_token(NOT);
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        jjtn000.setName(t.image);
        {if (true) return jjtn000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
    throw new Error("Missing return statement in function");
  }

  final public SimpleNode BinaryLogicalOp() throws ParseException {
 /*@bgen(jjtree) BinaryLogicalOp */
  SLBinaryLogicalOp jjtn000 = new SLBinaryLogicalOp(this, JJTBINARYLOGICALOP);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);Token t;
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case AND:
        t = jj_consume_token(AND);
        break;
      case OR:
        t = jj_consume_token(OR);
        break;
      case IMPLIES:
        t = jj_consume_token(IMPLIES);
        break;
      case EQUIV:
        t = jj_consume_token(EQUIV);
        break;
      default:
        jj_la1[17] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        jjtn000.setName(t.image);
        {if (true) return jjtn000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

  final public SimpleNode BinaryTermOp() throws ParseException {
 /*@bgen(jjtree) BinaryTermOp */
  SLBinaryTermOp jjtn000 = new SLBinaryTermOp(this, JJTBINARYTERMOP);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);Token t;
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case EQUAL:
        t = jj_consume_token(EQUAL);
        break;
      case RESULT:
        t = jj_consume_token(RESULT);
        break;
      default:
        jj_la1[18] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        jjtn000.setName(t.image);
        {if (true) return jjtn000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

  final public SimpleNode Quantifier() throws ParseException {
 /*@bgen(jjtree) Quantifier */
  SLQuantifier jjtn000 = new SLQuantifier(this, JJTQUANTIFIER);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);Token t;
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case FORALL:
        t = jj_consume_token(FORALL);
        break;
      case EXISTS:
        t = jj_consume_token(EXISTS);
        break;
      default:
        jj_la1[19] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        jjtn000.setName(t.image);
        {if (true) return jjtn000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

  final public SimpleNode ModalOp() throws ParseException {
 /*@bgen(jjtree) ModalOp */
  SLModalOp jjtn000 = new SLModalOp(this, JJTMODALOP);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);Token t;
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case MODAL_B:
        t = jj_consume_token(MODAL_B);
        break;
      case MODAL_U:
        t = jj_consume_token(MODAL_U);
        break;
      case MODAL_PG:
        t = jj_consume_token(MODAL_PG);
        break;
      case MODAL_I:
        t = jj_consume_token(MODAL_I);
        break;
      default:
        jj_la1[20] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        jjtn000.setName(t.image);
        {if (true) return jjtn000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

  final public SimpleNode ActionOp() throws ParseException {
 /*@bgen(jjtree) ActionOp */
  SLActionOp jjtn000 = new SLActionOp(this, JJTACTIONOP);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);Token t;
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case FEASIBLE:
        t = jj_consume_token(FEASIBLE);
        break;
      case DONE:
        t = jj_consume_token(DONE);
        break;
      default:
        jj_la1[21] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        jjtn000.setName(t.image);
        {if (true) return jjtn000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

  final public SimpleNode ReferentialOp() throws ParseException {
 /*@bgen(jjtree) ReferentialOp */
  SLReferentialOp jjtn000 = new SLReferentialOp(this, JJTREFERENTIALOP);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);Token t;
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case IOTA:
        t = jj_consume_token(IOTA);
        break;
      case ANY:
        t = jj_consume_token(ANY);
        break;
      case ALL:
        t = jj_consume_token(ALL);
        break;
      default:
        jj_la1[22] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        jjtn000.setName(t.image);
        {if (true) return jjtn000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

/* Symbols */
  final public SimpleNode PropositionSymbol() throws ParseException {
 /*@bgen(jjtree) PropositionSymbol */
  SLPropositionSymbol jjtn000 = new SLPropositionSymbol(this, JJTPROPOSITIONSYMBOL);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      String();
          jjtree.closeNodeScope(jjtn000, true);
          jjtc000 = false;
        {if (true) return jjtn000;}
    } catch (Throwable jjte000) {
          if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
          } else {
            jjtree.popNode();
          }
          if (jjte000 instanceof RuntimeException) {
            {if (true) throw (RuntimeException)jjte000;}
          }
          if (jjte000 instanceof ParseException) {
            {if (true) throw (ParseException)jjte000;}
          }
          {if (true) throw (Error)jjte000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

  final public SimpleNode PredicateSymbol() throws ParseException {
 /*@bgen(jjtree) PredicateSymbol */
  SLPredicateSymbol jjtn000 = new SLPredicateSymbol(this, JJTPREDICATESYMBOL);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      String();
          jjtree.closeNodeScope(jjtn000, true);
          jjtc000 = false;
        {if (true) return jjtn000;}
    } catch (Throwable jjte000) {
          if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
          } else {
            jjtree.popNode();
          }
          if (jjte000 instanceof RuntimeException) {
            {if (true) throw (RuntimeException)jjte000;}
          }
          if (jjte000 instanceof ParseException) {
            {if (true) throw (ParseException)jjte000;}
          }
          {if (true) throw (Error)jjte000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

  final public SimpleNode FunctionSymbol() throws ParseException {
 /*@bgen(jjtree) FunctionSymbol */
  SLFunctionSymbol jjtn000 = new SLFunctionSymbol(this, JJTFUNCTIONSYMBOL);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      String();
          jjtree.closeNodeScope(jjtn000, true);
          jjtc000 = false;
        {if (true) return jjtn000;}
    } catch (Throwable jjte000) {
          if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
          } else {
            jjtree.popNode();
          }
          if (jjte000 instanceof RuntimeException) {
            {if (true) throw (RuntimeException)jjte000;}
          }
          if (jjte000 instanceof ParseException) {
            {if (true) throw (ParseException)jjte000;}
          }
          {if (true) throw (Error)jjte000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

/* Constants */
  final public SimpleNode BooleanSymbol() throws ParseException {
 /*@bgen(jjtree) BooleanSymbol */
  SLBooleanSymbol jjtn000 = new SLBooleanSymbol(this, JJTBOOLEANSYMBOL);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);Token t;
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case TRUE:
        t = jj_consume_token(TRUE);
        break;
      case FALSE:
        t = jj_consume_token(FALSE);
        break;
      default:
        jj_la1[23] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        jjtn000.setName(t.image);
        {if (true) return jjtn000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
    throw new Error("Missing return statement in function");
  }

  final public SimpleNode String() throws ParseException {
 /*@bgen(jjtree) String */
  SLString jjtn000 = new SLString(this, JJTSTRING);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);Token t;
    try {
      t = jj_consume_token(STRING);
          jjtree.closeNodeScope(jjtn000, true);
          jjtc000 = false;
                //jjtThis.setName(ParserUtils.getStringLiteral(t.image)); 
                jjtn000.setName(t.image);
                {if (true) return jjtn000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

  final public void NumericalConstant() throws ParseException {
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case INTEGER:
      Integer();
      break;
    case FLOAT:
      Float();
      break;
    default:
      jj_la1[24] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

  final public SimpleNode Integer() throws ParseException {
 /*@bgen(jjtree) Integer */
  SLInteger jjtn000 = new SLInteger(this, JJTINTEGER);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);Token t;
    try {
      t = jj_consume_token(INTEGER);
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        jjtn000.setName(t.image);
        {if (true) return jjtn000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

  final public SimpleNode Float() throws ParseException {
 /*@bgen(jjtree) Float */
  SLFloat jjtn000 = new SLFloat(this, JJTFLOAT);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);Token t;
    try {
      t = jj_consume_token(FLOAT);
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        jjtn000.setName(t.image);
        {if (true) return jjtn000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
    throw new Error("Missing return statement in function");
  }

  final public SimpleNode DateTime() throws ParseException {
 /*@bgen(jjtree) DateTime */
  SLDateTime jjtn000 = new SLDateTime(this, JJTDATETIME);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);Token t;
    try {
      t = jj_consume_token(DATETIME);
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        jjtn000.setName(t.image);
        {if (true) return jjtn000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
    throw new Error("Missing return statement in function");
  }

  final public void Constant() throws ParseException {
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case INTEGER:
    case FLOAT:
      NumericalConstant();
      break;
    case STRING:
      String();
      break;
    case DATETIME:
      DateTime();
      break;
    default:
      jj_la1[25] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

  final public SimpleNode Variable() throws ParseException {
 /*@bgen(jjtree) Variable */
  SLVariable jjtn000 = new SLVariable(this, JJTVARIABLE);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);Token t;
    try {
      t = jj_consume_token(VARIABLE_IDENTIFIER);
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        jjtn000.setName(t.image);
        {if (true) return jjtn000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

  final public SimpleNode ParameterName() throws ParseException {
 /*@bgen(jjtree) ParameterName */
  SLParameterName jjtn000 = new SLParameterName(this, JJTPARAMETERNAME);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);Token t;
    try {
      t = jj_consume_token(PARAMETER_NAME);
      jjtree.closeNodeScope(jjtn000, true);
      jjtc000 = false;
        jjtn000.setName(t.image);
        {if (true) return jjtn000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
          }
    }
    throw new Error("Missing return statement in function");
  }

  final private boolean jj_2_1(int xla) {
    jj_la = xla; jj_lastpos = jj_scanpos = token;
    try { return !jj_3_1(); }
    catch(LookaheadSuccess ls) { return true; }
    finally { jj_save(0, xla); }
  }

  final private boolean jj_2_2(int xla) {
    jj_la = xla; jj_lastpos = jj_scanpos = token;
    try { return !jj_3_2(); }
    catch(LookaheadSuccess ls) { return true; }
    finally { jj_save(1, xla); }
  }

  final private boolean jj_3R_47() {
    if (jj_scan_token(DATETIME)) return true;
    return false;
  }

  final private boolean jj_3R_26() {
    if (jj_scan_token(NOT)) return true;
    return false;
  }

  final private boolean jj_3R_37() {
    if (jj_3R_41()) return true;
    return false;
  }

  final private boolean jj_3R_40() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_scan_token(23)) {
    jj_scanpos = xsp;
    if (jj_scan_token(24)) {
    jj_scanpos = xsp;
    if (jj_scan_token(25)) return true;
    }
    }
    return false;
  }

  final private boolean jj_3R_35() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3R_37()) {
    jj_scanpos = xsp;
    if (jj_3R_38()) {
    jj_scanpos = xsp;
    if (jj_3R_39()) return true;
    }
    }
    return false;
  }

  final private boolean jj_3R_51() {
    if (jj_scan_token(FLOAT)) return true;
    return false;
  }

  final private boolean jj_3R_21() {
    if (jj_3R_32()) return true;
    return false;
  }

  final private boolean jj_3R_23() {
    if (jj_3R_34()) return true;
    return false;
  }

  final private boolean jj_3R_20() {
    if (jj_3R_31()) return true;
    return false;
  }

  final private boolean jj_3R_22() {
    if (jj_3R_33()) return true;
    return false;
  }

  final private boolean jj_3R_25() {
    if (jj_3R_36()) return true;
    return false;
  }

  final private boolean jj_3R_30() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_scan_token(21)) {
    jj_scanpos = xsp;
    if (jj_scan_token(22)) return true;
    }
    return false;
  }

  final private boolean jj_3R_19() {
    if (jj_3R_30()) return true;
    return false;
  }

  final private boolean jj_3R_50() {
    if (jj_scan_token(INTEGER)) return true;
    return false;
  }

  final private boolean jj_3R_14() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3R_24()) {
    jj_scanpos = xsp;
    if (jj_3R_25()) return true;
    }
    return false;
  }

  final private boolean jj_3R_24() {
    if (jj_3R_35()) return true;
    return false;
  }

  final private boolean jj_3R_18() {
    if (jj_3R_29()) return true;
    return false;
  }

  final private boolean jj_3R_17() {
    if (jj_3R_28()) return true;
    return false;
  }

  final private boolean jj_3R_16() {
    if (jj_3R_27()) return true;
    return false;
  }

  final private boolean jj_3R_12() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3R_22()) {
    jj_scanpos = xsp;
    if (jj_3R_23()) return true;
    }
    return false;
  }

  final private boolean jj_3R_15() {
    if (jj_3R_26()) return true;
    return false;
  }

  final private boolean jj_3R_49() {
    if (jj_3R_51()) return true;
    return false;
  }

  final private boolean jj_3R_48() {
    if (jj_3R_50()) return true;
    return false;
  }

  final private boolean jj_3R_46() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3R_48()) {
    jj_scanpos = xsp;
    if (jj_3R_49()) return true;
    }
    return false;
  }

  final private boolean jj_3R_29() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_scan_token(17)) {
    jj_scanpos = xsp;
    if (jj_scan_token(18)) {
    jj_scanpos = xsp;
    if (jj_scan_token(19)) {
    jj_scanpos = xsp;
    if (jj_scan_token(20)) return true;
    }
    }
    }
    return false;
  }

  final private boolean jj_3R_13() {
    if (jj_scan_token(STRING)) return true;
    return false;
  }

  final private boolean jj_3R_11() {
    if (jj_scan_token(LBRACE)) return true;
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3R_15()) {
    jj_scanpos = xsp;
    if (jj_3R_16()) {
    jj_scanpos = xsp;
    if (jj_3R_17()) {
    jj_scanpos = xsp;
    if (jj_3R_18()) {
    jj_scanpos = xsp;
    if (jj_3R_19()) {
    jj_scanpos = xsp;
    if (jj_3R_20()) {
    jj_scanpos = xsp;
    if (jj_3R_21()) return true;
    }
    }
    }
    }
    }
    }
    return false;
  }

  final private boolean jj_3R_28() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_scan_token(15)) {
    jj_scanpos = xsp;
    if (jj_scan_token(16)) return true;
    }
    return false;
  }

  final private boolean jj_3R_8() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3R_11()) {
    jj_scanpos = xsp;
    if (jj_3R_12()) return true;
    }
    return false;
  }

  final private boolean jj_3R_33() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_scan_token(6)) {
    jj_scanpos = xsp;
    if (jj_scan_token(7)) return true;
    }
    return false;
  }

  final private boolean jj_3R_9() {
    if (jj_3R_13()) return true;
    return false;
  }

  final private boolean jj_3R_31() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_scan_token(13)) {
    jj_scanpos = xsp;
    if (jj_scan_token(14)) return true;
    }
    return false;
  }

  final private boolean jj_3R_6() {
    if (jj_3R_8()) return true;
    return false;
  }

  final private boolean jj_3R_10() {
    if (jj_3R_14()) return true;
    return false;
  }

  final private boolean jj_3R_7() {
    if (jj_3R_9()) return true;
    Token xsp;
    if (jj_3R_10()) return true;
    while (true) {
      xsp = jj_scanpos;
      if (jj_3R_10()) { jj_scanpos = xsp; break; }
    }
    return false;
  }

  final private boolean jj_3R_32() {
    if (jj_3R_13()) return true;
    return false;
  }

  final private boolean jj_3R_41() {
    if (jj_scan_token(VARIABLE_IDENTIFIER)) return true;
    return false;
  }

  final private boolean jj_3_2() {
    if (jj_3R_7()) return true;
    return false;
  }

  final private boolean jj_3R_34() {
    if (jj_3R_13()) return true;
    return false;
  }

  final private boolean jj_3R_27() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_scan_token(9)) {
    jj_scanpos = xsp;
    if (jj_scan_token(10)) {
    jj_scanpos = xsp;
    if (jj_scan_token(11)) {
    jj_scanpos = xsp;
    if (jj_scan_token(12)) return true;
    }
    }
    }
    return false;
  }

  final private boolean jj_3R_45() {
    if (jj_3R_47()) return true;
    return false;
  }

  final private boolean jj_3_1() {
    if (jj_3R_6()) return true;
    return false;
  }

  final private boolean jj_3R_44() {
    if (jj_3R_13()) return true;
    return false;
  }

  final private boolean jj_3R_36() {
    if (jj_3R_40()) return true;
    return false;
  }

  final private boolean jj_3R_43() {
    if (jj_3R_46()) return true;
    return false;
  }

  final private boolean jj_3R_42() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3R_43()) {
    jj_scanpos = xsp;
    if (jj_3R_44()) {
    jj_scanpos = xsp;
    if (jj_3R_45()) return true;
    }
    }
    return false;
  }

  final private boolean jj_3R_39() {
    if (jj_scan_token(LBRACE)) return true;
    return false;
  }

  final private boolean jj_3R_38() {
    if (jj_3R_42()) return true;
    return false;
  }

  public SLParserTokenManager token_source;
  SimpleCharStream jj_input_stream;
  public Token token, jj_nt;
  private int jj_ntk;
  private Token jj_scanpos, jj_lastpos;
  private int jj_la;
  public boolean lookingAhead = false;
  private boolean jj_semLA;
  private int jj_gen;
  final private int[] jj_la1 = new int[26];
  static private int[] jj_la1_0;
  static private int[] jj_la1_1;
  static {
      jj_la1_0();
      jj_la1_1();
   }
   private static void jj_la1_0() {
      jj_la1_0 = new int[] {0x800000c0,0x73800000,0x80000000,0x800000c0,0x83800000,0x7fff00,0xc0,0x800000c0,0x83800000,0x7c000000,0x80000000,0x0,0x83800000,0x0,0x70000000,0xc000000,0x83800000,0x1e00,0x6000,0x18000,0x1e0000,0x600000,0x3800000,0xc0,0x0,0x0,};
   }
   private static void jj_la1_1() {
      jj_la1_1 = new int[] {0x2,0x0,0x0,0x2,0x20d2,0x2,0x2,0x2,0x20d2,0x2,0x20d2,0x2,0x20d2,0x8,0x0,0x0,0x20d2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0x20c2,};
   }
  final private JJCalls[] jj_2_rtns = new JJCalls[2];
  private boolean jj_rescan = false;
  private int jj_gc = 0;

  public SLParser(java.io.InputStream stream) {
     this(stream, null);
  }
  public SLParser(java.io.InputStream stream, String encoding) {
    try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
    token_source = new SLParserTokenManager(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 26; i++) jj_la1[i] = -1;
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  }

  public void ReInit(java.io.InputStream stream) {
     ReInit(stream, null);
  }
  public void ReInit(java.io.InputStream stream, String encoding) {
    try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
    token_source.ReInit(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jjtree.reset();
    jj_gen = 0;
    for (int i = 0; i < 26; i++) jj_la1[i] = -1;
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  }

  public SLParser(java.io.Reader stream) {
    jj_input_stream = new SimpleCharStream(stream, 1, 1);
    token_source = new SLParserTokenManager(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 26; i++) jj_la1[i] = -1;
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  }

  public void ReInit(java.io.Reader stream) {
    jj_input_stream.ReInit(stream, 1, 1);
    token_source.ReInit(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jjtree.reset();
    jj_gen = 0;
    for (int i = 0; i < 26; i++) jj_la1[i] = -1;
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  }

  public SLParser(SLParserTokenManager tm) {
    token_source = tm;
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 26; i++) jj_la1[i] = -1;
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  }

  public void ReInit(SLParserTokenManager tm) {
    token_source = tm;
    token = new Token();
    jj_ntk = -1;
    jjtree.reset();
    jj_gen = 0;
    for (int i = 0; i < 26; i++) jj_la1[i] = -1;
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  }

  final private Token jj_consume_token(int kind) throws ParseException {
    Token oldToken;
    if ((oldToken = token).next != null) token = token.next;
    else token = token.next = token_source.getNextToken();
    jj_ntk = -1;
    if (token.kind == kind) {
      jj_gen++;
      if (++jj_gc > 100) {
        jj_gc = 0;
        for (int i = 0; i < jj_2_rtns.length; i++) {
          JJCalls c = jj_2_rtns[i];
          while (c != null) {
            if (c.gen < jj_gen) c.first = null;
            c = c.next;
          }
        }
      }
      return token;
    }
    token = oldToken;
    jj_kind = kind;
    throw generateParseException();
  }

  static private final class LookaheadSuccess extends java.lang.Error { }
  final private LookaheadSuccess jj_ls = new LookaheadSuccess();
  final private boolean jj_scan_token(int kind) {
    if (jj_scanpos == jj_lastpos) {
      jj_la--;
      if (jj_scanpos.next == null) {
        jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
      } else {
        jj_lastpos = jj_scanpos = jj_scanpos.next;
      }
    } else {
      jj_scanpos = jj_scanpos.next;
    }
    if (jj_rescan) {
      int i = 0; Token tok = token;
      while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
      if (tok != null) jj_add_error_token(kind, i);
    }
    if (jj_scanpos.kind != kind) return true;
    if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
    return false;
  }

  final public Token getNextToken() {
    if (token.next != null) token = token.next;
    else token = token.next = token_source.getNextToken();
    jj_ntk = -1;
    jj_gen++;
    return token;
  }

  final public Token getToken(int index) {
    Token t = lookingAhead ? jj_scanpos : token;
    for (int i = 0; i < index; i++) {
      if (t.next != null) t = t.next;
      else t = t.next = token_source.getNextToken();
    }
    return t;
  }

  final private int jj_ntk() {
    if ((jj_nt=token.next) == null)
      return (jj_ntk = (token.next=token_source.getNextToken()).kind);
    else
      return (jj_ntk = jj_nt.kind);
  }

  private java.util.Vector<int[]> jj_expentries = new java.util.Vector<int[]>();
  private int[] jj_expentry;
  private int jj_kind = -1;
  private int[] jj_lasttokens = new int[100];
  private int jj_endpos;

  private void jj_add_error_token(int kind, int pos) {
    if (pos >= 100) return;
    if (pos == jj_endpos + 1) {
      jj_lasttokens[jj_endpos++] = kind;
    } else if (jj_endpos != 0) {
      jj_expentry = new int[jj_endpos];
      for (int i = 0; i < jj_endpos; i++) {
        jj_expentry[i] = jj_lasttokens[i];
      }
      boolean exists = false;
      for (java.util.Enumeration e = jj_expentries.elements(); e.hasMoreElements();) {
        int[] oldentry = (int[])(e.nextElement());
        if (oldentry.length == jj_expentry.length) {
          exists = true;
          for (int i = 0; i < jj_expentry.length; i++) {
            if (oldentry[i] != jj_expentry[i]) {
              exists = false;
              break;
            }
          }
          if (exists) break;
        }
      }
      if (!exists) jj_expentries.addElement(jj_expentry);
      if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
    }
  }

  public ParseException generateParseException() {
    jj_expentries.removeAllElements();
    boolean[] la1tokens = new boolean[46];
    for (int i = 0; i < 46; i++) {
      la1tokens[i] = false;
    }
    if (jj_kind >= 0) {
      la1tokens[jj_kind] = true;
      jj_kind = -1;
    }
    for (int i = 0; i < 26; i++) {
      if (jj_la1[i] == jj_gen) {
        for (int j = 0; j < 32; j++) {
          if ((jj_la1_0[i] & (1<<j)) != 0) {
            la1tokens[j] = true;
          }
          if ((jj_la1_1[i] & (1<<j)) != 0) {
            la1tokens[32+j] = true;
          }
        }
      }
    }
    for (int i = 0; i < 46; i++) {
      if (la1tokens[i]) {
        jj_expentry = new int[1];
        jj_expentry[0] = i;
        jj_expentries.addElement(jj_expentry);
      }
    }
    jj_endpos = 0;
    jj_rescan_token();
    jj_add_error_token(0, 0);
    int[][] exptokseq = new int[jj_expentries.size()][];
    for (int i = 0; i < jj_expentries.size(); i++) {
      exptokseq[i] = (int[])jj_expentries.elementAt(i);
    }
    return new ParseException(token, exptokseq, tokenImage);
  }

  final public void enable_tracing() {
  }

  final public void disable_tracing() {
  }

  final private void jj_rescan_token() {
    jj_rescan = true;
    for (int i = 0; i < 2; i++) {
    try {
      JJCalls p = jj_2_rtns[i];
      do {
        if (p.gen > jj_gen) {
          jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
          switch (i) {
            case 0: jj_3_1(); break;
            case 1: jj_3_2(); break;
          }
        }
        p = p.next;
      } while (p != null);
      } catch(LookaheadSuccess ls) { }
    }
    jj_rescan = false;
  }

  final private void jj_save(int index, int xla) {
    JJCalls p = jj_2_rtns[index];
    while (p.gen > jj_gen) {
      if (p.next == null) { p = p.next = new JJCalls(); break; }
      p = p.next;
    }
    p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
  }

  static final class JJCalls {
    int gen;
    Token first;
    int arg;
    JJCalls next;
  }

}
