All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cinchapi.ccl.v2.generated.Grammar Maven / Gradle / Ivy

Go to download

The official specificiation and library for the Concourse Criteria Language

There is a newer version: 3.1.2
Show newest version
/* Grammar.java */
/* Generated By:JJTree&JavaCC: Do not edit this line. Grammar.java */
package com.cinchapi.ccl.v2.generated;

/**
 * The Grammar generated by JavaCC
 */
public class Grammar/*@bgen(jjtree)*/implements GrammarTreeConstants, GrammarConstants {/*@bgen(jjtree)*/
  protected JJTGrammarState jjtree = new JJTGrammarState();public static void main(String args[]) {
        System.out.println("Reading from standard input...");
        Grammar grammar = new Grammar(System.in);
        while (true) {
            try {
                ASTStart start = grammar.StartCommandLine();
                GrammarVisitor visitor = new GrammarDumpVisitor();
                start.jjtAccept(visitor, null);
                System.out.println("Thank you.");
            } catch (Exception e) {
                System.out.println("Oops.");
                System.out.println(e.getMessage());
                e.printStackTrace();
            }
        }
    }

/** Main production. */
  final public ASTStart Start() throws ParseException {/*@bgen(jjtree) Start */
  ASTStart jjtn000 = new ASTStart(JJTSTART);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
      case WHERE:{
        jj_consume_token(WHERE);
        break;
        }
      default:
        jj_la1[0] = jj_gen;
        ;
      }
      DisjunctionExpression();
      jj_consume_token(0);
jjtree.closeNodeScope(jjtn000, true);
    jjtc000 = false;
{if ("" != null) 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");
}

/** Main production. */
  final public ASTStart StartCommandLine() throws ParseException {/*@bgen(jjtree) Start */
  ASTStart jjtn000 = new ASTStart(JJTSTART);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
      case WHERE:{
        jj_consume_token(WHERE);
        break;
        }
      default:
        jj_la1[1] = jj_gen;
        ;
      }
      DisjunctionExpression();
      jj_consume_token(35);
jjtree.closeNodeScope(jjtn000, true);
    jjtc000 = false;
{if ("" != null) 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 DisjunctionExpression() throws ParseException {
    ConjunctionExpression();
    label_1:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
      case DISJUNCTION:{
        ;
        break;
        }
      default:
        jj_la1[2] = jj_gen;
        break label_1;
      }
ASTOr jjtn001 = new ASTOr(JJTOR);
                               boolean jjtc001 = true;
                               jjtree.openNodeScope(jjtn001);
      try {
        jj_consume_token(DISJUNCTION);
        ConjunctionExpression();
      } catch (Throwable jjte001) {
if (jjtc001) {
                                 jjtree.clearNodeScope(jjtn001);
                                 jjtc001 = false;
                               } else {
                                 jjtree.popNode();
                               }
                               if (jjte001 instanceof RuntimeException) {
                                 {if (true) throw (RuntimeException)jjte001;}
                               }
                               if (jjte001 instanceof ParseException) {
                                 {if (true) throw (ParseException)jjte001;}
                               }
                               {if (true) throw (Error)jjte001;}
      } finally {
if (jjtc001) {
                                 jjtree.closeNodeScope(jjtn001,  2);
                               }
      }
    }
}

  final public void ConjunctionExpression() throws ParseException {
    UnaryExpression();
    label_2:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
      case CONJUNCTION:{
        ;
        break;
        }
      default:
        jj_la1[3] = jj_gen;
        break label_2;
      }
ASTAnd jjtn001 = new ASTAnd(JJTAND);
                         boolean jjtc001 = true;
                         jjtree.openNodeScope(jjtn001);
      try {
        jj_consume_token(CONJUNCTION);
        UnaryExpression();
      } catch (Throwable jjte001) {
if (jjtc001) {
                           jjtree.clearNodeScope(jjtn001);
                           jjtc001 = false;
                         } else {
                           jjtree.popNode();
                         }
                         if (jjte001 instanceof RuntimeException) {
                           {if (true) throw (RuntimeException)jjte001;}
                         }
                         if (jjte001 instanceof ParseException) {
                           {if (true) throw (ParseException)jjte001;}
                         }
                         {if (true) throw (Error)jjte001;}
      } finally {
if (jjtc001) {
                           jjtree.closeNodeScope(jjtn001,  2);
                         }
      }
    }
}

  final public void UnaryExpression() throws ParseException {
    switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    case OPEN_PARENTHESES:{
      jj_consume_token(OPEN_PARENTHESES);
      DisjunctionExpression();
      jj_consume_token(CLOSE_PARENTHESES);
      break;
      }
    case RESERVED_IDENTIFIER:
    case SIGNED_DECIMAL:
    case NUMERIC:
    case ALPHANUMERIC:{
      RelationalExpression();
      break;
      }
    default:
      jj_la1[4] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
}

  final public void RelationalExpression() throws ParseException {/*@bgen(jjtree) RelationalExpression */
  ASTRelationalExpression jjtn000 = new ASTRelationalExpression(JJTRELATIONALEXPRESSION);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);Token k;
  Token o;
  Token v;
  Token t;
    try {
      if (jj_2_1(2)) {
        switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
        case RESERVED_IDENTIFIER:{
          k = jj_consume_token(RESERVED_IDENTIFIER);
          break;
          }
        case SIGNED_DECIMAL:{
          k = jj_consume_token(SIGNED_DECIMAL);
          break;
          }
        case NUMERIC:{
          k = jj_consume_token(NUMERIC);
          break;
          }
        case ALPHANUMERIC:{
          k = jj_consume_token(ALPHANUMERIC);
          break;
          }
        default:
          jj_la1[5] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
jjtn000.key(k.image);
        switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
        case LINKS_TO:{
          o = jj_consume_token(LINKS_TO);
jjtn000.operator(o.image);
          v = jj_consume_token(NUMERIC);
jjtn000.appendValue(v.image);
          break;
          }
        case UNARY_OPERATOR:{
          o = jj_consume_token(UNARY_OPERATOR);
jjtn000.operator(o.image);
          switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
          case SIGNED_DECIMAL:
          case NUMERIC:
          case ALPHANUMERIC:
          case NON_ALPHANUMERIC_AND_ALPHANUMERIC:{
            label_3:
            while (true) {
              switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
              case SIGNED_DECIMAL:{
                v = jj_consume_token(SIGNED_DECIMAL);
                break;
                }
              case NUMERIC:{
                v = jj_consume_token(NUMERIC);
                break;
                }
              case ALPHANUMERIC:{
                v = jj_consume_token(ALPHANUMERIC);
                break;
                }
              case NON_ALPHANUMERIC_AND_ALPHANUMERIC:{
                v = jj_consume_token(NON_ALPHANUMERIC_AND_ALPHANUMERIC);
                break;
                }
              default:
                jj_la1[6] = jj_gen;
                jj_consume_token(-1);
                throw new ParseException();
              }
jjtn000.appendValue(v.image.replace("\\@", "@"));
              switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
              case SIGNED_DECIMAL:
              case NUMERIC:
              case ALPHANUMERIC:
              case NON_ALPHANUMERIC_AND_ALPHANUMERIC:{
                ;
                break;
                }
              default:
                jj_la1[7] = jj_gen;
                break label_3;
              }
            }
            break;
            }
          case QUOTED_STRING:{
            label_4:
            while (true) {
              v = jj_consume_token(QUOTED_STRING);
jjtn000.appendValue(v.image.replace("\\\"", "\""));
              switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
              case QUOTED_STRING:{
                ;
                break;
                }
              default:
                jj_la1[8] = jj_gen;
                break label_4;
              }
            }
            break;
            }
          default:
            jj_la1[9] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
          break;
          }
        default:
          jj_la1[10] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
        switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
        case TIMESTAMP:{
          jj_consume_token(TIMESTAMP);
          label_5:
          while (true) {
            switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
            case QUOTED_STRING:{
              t = jj_consume_token(QUOTED_STRING);
              break;
              }
            case SIGNED_DECIMAL:{
              t = jj_consume_token(SIGNED_DECIMAL);
              break;
              }
            case NUMERIC:{
              t = jj_consume_token(NUMERIC);
              break;
              }
            case ALPHANUMERIC:{
              t = jj_consume_token(ALPHANUMERIC);
              break;
              }
            default:
              jj_la1[11] = jj_gen;
              jj_consume_token(-1);
              throw new ParseException();
            }
jjtn000.timestamp(t.image);
            switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
            case QUOTED_STRING:
            case SIGNED_DECIMAL:
            case NUMERIC:
            case ALPHANUMERIC:{
              ;
              break;
              }
            default:
              jj_la1[12] = jj_gen;
              break label_5;
            }
          }
          break;
          }
        default:
          jj_la1[13] = jj_gen;
          ;
        }
      } else {
        switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
        case RESERVED_IDENTIFIER:
        case SIGNED_DECIMAL:
        case NUMERIC:
        case ALPHANUMERIC:{
          switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
          case RESERVED_IDENTIFIER:{
            k = jj_consume_token(RESERVED_IDENTIFIER);
            break;
            }
          case SIGNED_DECIMAL:{
            k = jj_consume_token(SIGNED_DECIMAL);
            break;
            }
          case NUMERIC:{
            k = jj_consume_token(NUMERIC);
            break;
            }
          case ALPHANUMERIC:{
            k = jj_consume_token(ALPHANUMERIC);
            break;
            }
          default:
            jj_la1[14] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
jjtn000.key(k.image);
          o = jj_consume_token(BINARY_OPERATOR);
jjtn000.operator(o.image);
          switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
          case SIGNED_DECIMAL:
          case NUMERIC:
          case ALPHANUMERIC:
          case NON_ALPHANUMERIC_AND_ALPHANUMERIC:{
            switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
            case SIGNED_DECIMAL:{
              v = jj_consume_token(SIGNED_DECIMAL);
              break;
              }
            case NUMERIC:{
              v = jj_consume_token(NUMERIC);
              break;
              }
            case ALPHANUMERIC:{
              v = jj_consume_token(ALPHANUMERIC);
              break;
              }
            case NON_ALPHANUMERIC_AND_ALPHANUMERIC:{
              v = jj_consume_token(NON_ALPHANUMERIC_AND_ALPHANUMERIC);
              break;
              }
            default:
              jj_la1[15] = jj_gen;
              jj_consume_token(-1);
              throw new ParseException();
            }
jjtn000.addValue(v.image.replace("\\@", "@"));
            break;
            }
          case QUOTED_STRING:{
            v = jj_consume_token(QUOTED_STRING);
jjtn000.addValue(v.image.replace("\\\"", "\""));
            break;
            }
          default:
            jj_la1[16] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
          switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
          case SIGNED_DECIMAL:
          case NUMERIC:
          case ALPHANUMERIC:
          case NON_ALPHANUMERIC_AND_ALPHANUMERIC:{
            switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
            case SIGNED_DECIMAL:{
              v = jj_consume_token(SIGNED_DECIMAL);
              break;
              }
            case NUMERIC:{
              v = jj_consume_token(NUMERIC);
              break;
              }
            case ALPHANUMERIC:{
              v = jj_consume_token(ALPHANUMERIC);
              break;
              }
            case NON_ALPHANUMERIC_AND_ALPHANUMERIC:{
              v = jj_consume_token(NON_ALPHANUMERIC_AND_ALPHANUMERIC);
              break;
              }
            default:
              jj_la1[17] = jj_gen;
              jj_consume_token(-1);
              throw new ParseException();
            }
jjtn000.addValue(v.image.replace("\\@", "@"));
            break;
            }
          case QUOTED_STRING:{
            v = jj_consume_token(QUOTED_STRING);
jjtn000.addValue(v.image.replace("\\\"", "\""));
            break;
            }
          default:
            jj_la1[18] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
          switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
          case TIMESTAMP:{
            jj_consume_token(TIMESTAMP);
            label_6:
            while (true) {
              switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
              case QUOTED_STRING:{
                t = jj_consume_token(QUOTED_STRING);
                break;
                }
              case SIGNED_DECIMAL:{
                t = jj_consume_token(SIGNED_DECIMAL);
                break;
                }
              case NUMERIC:{
                t = jj_consume_token(NUMERIC);
                break;
                }
              case ALPHANUMERIC:{
                t = jj_consume_token(ALPHANUMERIC);
                break;
                }
              default:
                jj_la1[19] = jj_gen;
                jj_consume_token(-1);
                throw new ParseException();
              }
jjtn000.timestamp(t.image);
              switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
              case QUOTED_STRING:
              case SIGNED_DECIMAL:
              case NUMERIC:
              case ALPHANUMERIC:{
                ;
                break;
                }
              default:
                jj_la1[20] = jj_gen;
                break label_6;
              }
            }
            break;
            }
          default:
            jj_la1[21] = jj_gen;
            ;
          }
          break;
          }
        default:
          jj_la1[22] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
    } finally {
if (jjtc000) {
      jjtree.closeNodeScope(jjtn000, true);
    }
    }
}

  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); }
  }

  private boolean jj_3_1()
 {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_scan_token(7)) {
    jj_scanpos = xsp;
    if (jj_scan_token(27)) {
    jj_scanpos = xsp;
    if (jj_scan_token(28)) {
    jj_scanpos = xsp;
    if (jj_scan_token(29)) return true;
    }
    }
    }
    xsp = jj_scanpos;
    if (jj_3R_7()) {
    jj_scanpos = xsp;
    if (jj_3R_8()) return true;
    }
    return false;
  }

  private boolean jj_3R_8()
 {
    if (jj_scan_token(UNARY_OPERATOR)) return true;
    return false;
  }

  private boolean jj_3R_7()
 {
    if (jj_scan_token(LINKS_TO)) return true;
    return false;
  }

  /** Generated Token Manager. */
  public GrammarTokenManager token_source;
  SimpleCharStream jj_input_stream;
  /** Current token. */
  public Token token;
  /** Next token. */
  public Token jj_nt;
  private int jj_ntk;
  private Token jj_scanpos, jj_lastpos;
  private int jj_la;
  private int jj_gen;
  final private int[] jj_la1 = new int[23];
  static private int[] jj_la1_0;
  static private int[] jj_la1_1;
  static {
	   jj_la1_init_0();
	   jj_la1_init_1();
	}
	private static void jj_la1_init_0() {
	   jj_la1_0 = new int[] {0x40,0x40,0x200,0x100,0x38000088,0x38000080,0x78000000,0x78000000,0x1000000,0x79000000,0x40400,0x39000000,0x39000000,0x20,0x38000080,0x78000000,0x79000000,0x78000000,0x79000000,0x39000000,0x39000000,0x20,0x38000080,};
	}
	private static void jj_la1_init_1() {
	   jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
	}
  final private JJCalls[] jj_2_rtns = new JJCalls[1];
  private boolean jj_rescan = false;
  private int jj_gc = 0;

  /** Constructor with InputStream. */
  public Grammar(java.io.InputStream stream) {
	  this(stream, null);
  }
  /** Constructor with InputStream and supplied encoding */
  public Grammar(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 GrammarTokenManager(jj_input_stream);
	 token = new Token();
	 jj_ntk = -1;
	 jj_gen = 0;
	 for (int i = 0; i < 23; i++) jj_la1[i] = -1;
	 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  }

  /** Reinitialise. */
  public void ReInit(java.io.InputStream stream) {
	  ReInit(stream, null);
  }
  /** Reinitialise. */
  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 < 23; i++) jj_la1[i] = -1;
	 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  }

  /** Constructor. */
  public Grammar(java.io.Reader stream) {
	 jj_input_stream = new SimpleCharStream(stream, 1, 1);
	 token_source = new GrammarTokenManager(jj_input_stream);
	 token = new Token();
	 jj_ntk = -1;
	 jj_gen = 0;
	 for (int i = 0; i < 23; i++) jj_la1[i] = -1;
	 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  }

  /** Reinitialise. */
  public void ReInit(java.io.Reader stream) {
	if (jj_input_stream == null) {
	   jj_input_stream = new SimpleCharStream(stream, 1, 1);
	} else {
	   jj_input_stream.ReInit(stream, 1, 1);
	}
	if (token_source == null) {
 token_source = new GrammarTokenManager(jj_input_stream);
	}

	 token_source.ReInit(jj_input_stream);
	 token = new Token();
	 jj_ntk = -1;
	 jjtree.reset();
	 jj_gen = 0;
	 for (int i = 0; i < 23; i++) jj_la1[i] = -1;
	 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  }

  /** Constructor with generated Token Manager. */
  public Grammar(GrammarTokenManager tm) {
	 token_source = tm;
	 token = new Token();
	 jj_ntk = -1;
	 jj_gen = 0;
	 for (int i = 0; i < 23; i++) jj_la1[i] = -1;
	 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  }

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

  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();
  }

  @SuppressWarnings("serial")
  static private final class LookaheadSuccess extends java.lang.Error { }
  final private LookaheadSuccess jj_ls = new LookaheadSuccess();
  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;
  }


/** Get the next Token. */
  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;
  }

/** Get the specific Token. */
  final public Token getToken(int index) {
	 Token t = token;
	 for (int i = 0; i < index; i++) {
	   if (t.next != null) t = t.next;
	   else t = t.next = token_source.getNextToken();
	 }
	 return t;
  }

  private int jj_ntk_f() {
	 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.List jj_expentries = new java.util.ArrayList();
  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];
	   }

	   for (int[] oldentry : jj_expentries) {
		 if (oldentry.length == jj_expentry.length) {
		   boolean isMatched = true;

		   for (int i = 0; i < jj_expentry.length; i++) {
			 if (oldentry[i] != jj_expentry[i]) {
			   isMatched = false;
			   break;
			 }

		   }
		   if (isMatched) {
			 jj_expentries.add(jj_expentry);
			 break;
		   }
		 }
	   }

	   if (pos != 0) {
		 jj_lasttokens[(jj_endpos = pos) - 1] = kind;
	   }
	 }
  }

  /** Generate ParseException. */
  public ParseException generateParseException() {
	 jj_expentries.clear();
	 boolean[] la1tokens = new boolean[36];
	 if (jj_kind >= 0) {
	   la1tokens[jj_kind] = true;
	   jj_kind = -1;
	 }
	 for (int i = 0; i < 23; i++) {
	   if (jj_la1[i] == jj_gen) {
		 for (int j = 0; j < 32; j++) {
		   if ((jj_la1_0[i] & (1< jj_gen) {
			 jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
			 switch (i) {
			   case 0: jj_3_1(); break;
			 }
		   }
		   p = p.next;
		 } while (p != null);

		 } catch(LookaheadSuccess ls) { }
	 }
	 jj_rescan = false;
  }

  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;
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy