/** Reinitialise parser. */ public void ReInit(CharStream stream) { jjmatchedPos = jjnewStateCnt = 0; curLexState = defaultLexState; input_stream = stream; ReInitRounds(); } private void ReInitRounds()
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); }
ReInitRounds(); if (curChar < 64) jjCheckNAddStates(0, 2); else if (curChar == 48) jjCheckNAddStates(3, 6); if ((0x3fe000000000000L & l) != 0L) jjCheckNAddStates(7, 9); else if (curChar == 48) jjCheckNAddStates(10, 13); break; case 37: case 33: jjCheckNAddStates(14, 16); break; case 871: if (kind > 247) kind = 247; jjCheckNAdd(31); break; case 3: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(17, 23); else if (curChar == 45) jjAddStates(24, 27); else if (curChar == 39) jjCheckNAddStates(28, 32); else if (curChar == 36)
matchedToken = jjFillToken(); matchedToken.specialToken = specialToken; return matchedToken; jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_0(); break; case 1: jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_1(); if (jjmatchedPos == 0 && jjmatchedKind > 10) jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_2(); if (jjmatchedPos == 0 && jjmatchedKind > 10) matchedToken = jjFillToken(); matchedToken.specialToken = specialToken; if (jjnewLexState[jjmatchedKind] != -1) matchedToken = jjFillToken(); if (specialToken == null) specialToken = matchedToken; SkipLexicalActions(matchedToken);
private void jjCheckNAddTwoStates(int state1, int state2) { jjCheckNAdd(state1); jjCheckNAdd(state2); }
/** Constructor. */ public OrientSqlTokenManager(CharStream stream, int lexState){ this(stream); SwitchTo(lexState); }
/** Constructor with user supplied CharStream. */ public OrientSql(CharStream stream) { token_source = new OrientSqlTokenManager(stream); token = new Token(); jj_ntk = -1; jj_gen = 0; for (int i = 0; i < 415; 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(CharStream stream) { token_source.ReInit(stream); token = new Token(); jj_ntk = -1; jjtree.reset(); jj_gen = 0; for (int i = 0; i < 415; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); }
private void jjCheckNAddStates(int start, int end) { do { jjCheckNAdd(jjnextStates[start]); } while (start++ != end); }
/** 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; }
/** 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; }
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; }
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(); }