public void consumeUntil(IntStream input, int tokenType) { // System.out.println("consumeUntil "+tokenType); int ttype = input.LA(1); while (ttype != Token.EOF && ttype != tokenType) { input.consume(); ttype = input.LA(1); } }
/** Consume tokens until one matches the given token set */ public void consumeUntil(IntStream input, BitSet set) { // System.out.println("consumeUntil("+set.toString(getTokenNames())+")"); int ttype = input.LA(1); while (ttype != Token.EOF && !set.member(ttype)) { // System.out.println("consume during recover LA(1)="+getTokenNames()[input.LA(1)]); input.consume(); ttype = input.LA(1); } }
public boolean mismatchIsMissingToken(IntStream input, BitSet follow) { if (follow == null) { // we have no information about the follow; we can only consume // a single token and hope for the best return false; } // compute what can follow this grammar element reference if (follow.member(Token.EOR_TOKEN_TYPE)) { BitSet viableTokensFollowingThisRule = computeContextSensitiveRuleFOLLOW(); follow = follow.or(viableTokensFollowingThisRule); if (state._fsp >= 0) { // remove EOR if we're not the start symbol follow.remove(Token.EOR_TOKEN_TYPE); } } // if current token is consistent with what could come after set // then we know we're missing a token; error recovery is free to // "insert" the missing token // System.out.println("viable tokens="+follow.toString(getTokenNames())); // System.out.println("LT(1)="+((TokenStream)input).LT(1)); // BitSet cannot handle negative numbers like -1 (EOF) so I leave EOR // in follow set to indicate that the fall of the start symbol is // in the set (EOF can follow). if (follow.member(input.LA(1)) || follow.member(Token.EOR_TOKEN_TYPE)) { // System.out.println("LT(1)=="+((TokenStream)input).LT(1)+" is consistent with what follows; // inserting..."); return true; } return false; }
/** * This code is factored out from mismatched token and mismatched set recovery. It handles "single * token insertion" error recovery for both. No tokens are consumed to recover from insertions. * Return true if recovery was possible else return false. */ protected boolean recoverFromMismatchedElement( IntStream input, RecognitionException e, BitSet follow) { if (follow == null) { // we have no information about the follow; we can only consume // a single token and hope for the best return false; } // System.out.println("recoverFromMismatchedElement"); // compute what can follow this grammar element reference if (follow.member(Token.EOR_TOKEN_TYPE)) { BitSet viableTokensFollowingThisRule = computeContextSensitiveRuleFOLLOW(); follow = follow.or(viableTokensFollowingThisRule); follow.remove(Token.EOR_TOKEN_TYPE); } // if current token is consistent with what could come after set // then it is ok to "insert" the missing token, else throw exception // System.out.println("viable tokens="+follow.toString(getTokenNames())+")"); if (follow.member(input.LA(1))) { // System.out.println("LT(1)=="+input.LT(1)+" is consistent with what follows; inserting..."); reportError(e); return true; } // System.err.println("nothing to do; throw exception"); return false; }
public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { IntStream input = _input; int _s = s; switch (s) { case 0: int LA6_0 = input.LA(1); s = -1; if ((LA6_0 == 'w')) { s = 1; } else if ((LA6_0 == 'h')) { s = 2; } else if ((LA6_0 == ';')) { s = 3; } else if ((LA6_0 == 'o')) { s = 4; } else if ((LA6_0 == '(')) { s = 5; } else if ((LA6_0 == ')')) { s = 6; } else if ((LA6_0 == 'c')) { s = 7; } else if ((LA6_0 == 'i')) { s = 8; } else if ((LA6_0 == 'd')) { s = 9; } else if ((LA6_0 == 'r')) { s = 10; } else if ((LA6_0 == '/')) { s = 11; } else if (((LA6_0 >= '\t' && LA6_0 <= '\n') || LA6_0 == '\r' || LA6_0 == ' ')) { s = 12; } else if (((LA6_0 >= '\u0000' && LA6_0 <= '\b') || (LA6_0 >= '\u000B' && LA6_0 <= '\f') || (LA6_0 >= '\u000E' && LA6_0 <= '\u001F') || (LA6_0 >= '!' && LA6_0 <= '\'') || (LA6_0 >= '*' && LA6_0 <= '.') || (LA6_0 >= '0' && LA6_0 <= ':') || (LA6_0 >= '<' && LA6_0 <= 'b') || (LA6_0 >= 'e' && LA6_0 <= 'g') || (LA6_0 >= 'j' && LA6_0 <= 'n') || (LA6_0 >= 'p' && LA6_0 <= 'q') || (LA6_0 >= 's' && LA6_0 <= 'v') || (LA6_0 >= 'x' && LA6_0 <= '\uFFFF'))) { s = 13; } if (s >= 0) return s; break; } NoViableAltException nvae = new NoViableAltException(getDescription(), 6, _s, input); error(nvae); throw nvae; }
/** * Match current input symbol against ttype. Upon error, do one token insertion or deletion if * possible. You can override to not recover here and bail out of the current production to the * normal error exception catch (at the end of the method) by just throwing * MismatchedTokenException upon input.LA(1)!=ttype. */ public void match(IntStream input, int ttype, BitSet follow) throws RecognitionException { if (input.LA(1) == ttype) { input.consume(); errorRecovery = false; failed = false; return; } if (backtracking > 0) { failed = true; return; } mismatch(input, ttype, follow); return; }
/** * Match current input symbol against ttype. Attempt single token insertion or deletion error * recovery. If that fails, throw MismatchedTokenException. * * <p>To turn off single token insertion or deletion error recovery, override * recoverFromMismatchedToken() and have it throw an exception. See * TreeParser.recoverFromMismatchedToken(). This way any error in a rule will cause an exception * and immediate exit from rule. Rule would recover by resynchronizing to the set of symbols that * can follow rule ref. */ public Object match(IntStream input, int ttype, BitSet follow) throws RecognitionException { // System.out.println("match "+((TokenStream)input).LT(1)); Object matchedSymbol = getCurrentInputSymbol(input); if (input.LA(1) == ttype) { input.consume(); state.errorRecovery = false; state.failed = false; return matchedSymbol; } if (state.backtracking > 0) { state.failed = true; return matchedSymbol; } matchedSymbol = recoverFromMismatchedToken(input, ttype, follow); return matchedSymbol; }
public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { IntStream input = _input; int _s = s; switch (s) { case 0: int LA16_18 = input.LA(1); s = -1; if (((LA16_18 >= '\u0000' && LA16_18 <= '\uFFFF'))) { s = 58; } else s = 57; if (s >= 0) return s; break; } NoViableAltException nvae = new NoViableAltException(getDescription(), 16, _s, input); error(nvae); throw nvae; }
/** * Attempt to recover from a single missing or extra token. * * <p>EXTRA TOKEN * * <p>LA(1) is not what we are looking for. If LA(2) has the right token, however, then assume * LA(1) is some extra spurious token. Delete it and LA(2) as if we were doing a normal match(), * which advances the input. * * <p>MISSING TOKEN * * <p>If current token is consistent with what could come after ttype then it is ok to "insert" * the missing token, else throw exception For example, Input "i=(3;" is clearly missing the ')'. * When the parser returns from the nested call to expr, it will have call chain: * * <p>stat -> expr -> atom * * <p>and it will be trying to match the ')' at this point in the derivation: * * <p>=> ID '=' '(' INT ')' ('+' atom)* ';' ^ match() will see that ';' doesn't match ')' and * report a mismatched token error. To recover, it sees that LA(1)==';' is in the set of tokens * that can follow the ')' token reference in rule atom. It can assume that you forgot the ')'. */ public void recoverFromMismatchedToken( IntStream input, RecognitionException e, int ttype, BitSet follow) throws RecognitionException { // if next token is what we are looking for then "delete" this token if (input.LA(2) == ttype) { reportError(e); /* * System.err.println("recoverFromMismatchedToken deleting "+input.LT * (1)+ " since "+input.LT(2)+" is what we want"); */ beginResync(); input.consume(); // simply delete extra token endResync(); input.consume(); // move past ttype token as if all were ok return; } if (!recoverFromMismatchedElement(input, e, follow)) { throw e; } }
public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { IntStream input = _input; int _s = s; switch (s) { case 0: int LA12_19 = input.LA(1); s = -1; if (((LA12_19 >= '\u0000' && LA12_19 <= '\uFFFF'))) { s = 48; } else s = 23; if (s >= 0) return s; break; case 1: int LA12_0 = input.LA(1); s = -1; if ((LA12_0 == '1')) { s = 1; } else if ((LA12_0 == 'a')) { s = 2; } else if ((LA12_0 == 'b')) { s = 3; } else if ((LA12_0 == '2')) { s = 4; } else if ((LA12_0 == 'c')) { s = 5; } else if ((LA12_0 == 'd')) { s = 6; } else if ((LA12_0 == '3')) { s = 7; } else if ((LA12_0 == '4')) { s = 8; } else if ((LA12_0 == '5')) { s = 9; } else if ((LA12_0 == '6')) { s = 10; } else if ((LA12_0 == '7')) { s = 11; } else if ((LA12_0 == '8')) { s = 12; } else if ((LA12_0 == '9')) { s = 13; } else if ((LA12_0 == 's')) { s = 14; } else if ((LA12_0 == 'n')) { s = 15; } else if ((LA12_0 == '^')) { s = 16; } else if (((LA12_0 >= 'A' && LA12_0 <= 'Z') || LA12_0 == '_' || (LA12_0 >= 'e' && LA12_0 <= 'm') || (LA12_0 >= 'o' && LA12_0 <= 'r') || (LA12_0 >= 't' && LA12_0 <= 'z'))) { s = 17; } else if ((LA12_0 == '0')) { s = 18; } else if ((LA12_0 == '\"')) { s = 19; } else if ((LA12_0 == '\'')) { s = 20; } else if ((LA12_0 == '/')) { s = 21; } else if (((LA12_0 >= '\t' && LA12_0 <= '\n') || LA12_0 == '\r' || LA12_0 == ' ')) { s = 22; } else if (((LA12_0 >= '\u0000' && LA12_0 <= '\b') || (LA12_0 >= '\u000B' && LA12_0 <= '\f') || (LA12_0 >= '\u000E' && LA12_0 <= '\u001F') || LA12_0 == '!' || (LA12_0 >= '#' && LA12_0 <= '&') || (LA12_0 >= '(' && LA12_0 <= '.') || (LA12_0 >= ':' && LA12_0 <= '@') || (LA12_0 >= '[' && LA12_0 <= ']') || LA12_0 == '`' || (LA12_0 >= '{' && LA12_0 <= '\uFFFF'))) { s = 23; } if (s >= 0) return s; break; case 2: int LA12_20 = input.LA(1); s = -1; if (((LA12_20 >= '\u0000' && LA12_20 <= '\uFFFF'))) { s = 48; } else s = 23; if (s >= 0) return s; break; } NoViableAltException nvae = new NoViableAltException(getDescription(), 12, _s, input); error(nvae); throw nvae; }
public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { IntStream input = _input; int _s = s; switch (s) { case 0: int LA12_19 = input.LA(1); s = -1; if (((LA12_19 >= '\u0000' && LA12_19 <= '\uFFFF'))) { s = 45; } else s = 23; if (s >= 0) return s; break; case 1: int LA12_0 = input.LA(1); s = -1; if ((LA12_0 == 'V')) { s = 1; } else if ((LA12_0 == '@')) { s = 2; } else if ((LA12_0 == 'A')) { s = 3; } else if ((LA12_0 == ')')) { s = 4; } else if ((LA12_0 == 'S')) { s = 5; } else if ((LA12_0 == 'u')) { s = 6; } else if ((LA12_0 == 'd')) { s = 7; } else if ((LA12_0 == 'l')) { s = 8; } else if ((LA12_0 == 'm')) { s = 9; } else if ((LA12_0 == 'N')) { s = 10; } else if ((LA12_0 == 'M')) { s = 11; } else if ((LA12_0 == 'F')) { s = 12; } else if ((LA12_0 == 'W')) { s = 13; } else if ((LA12_0 == '{')) { s = 14; } else if ((LA12_0 == '}')) { s = 15; } else if ((LA12_0 == '^')) { s = 16; } else if (((LA12_0 >= 'B' && LA12_0 <= 'E') || (LA12_0 >= 'G' && LA12_0 <= 'L') || (LA12_0 >= 'O' && LA12_0 <= 'R') || (LA12_0 >= 'T' && LA12_0 <= 'U') || (LA12_0 >= 'X' && LA12_0 <= 'Z') || LA12_0 == '_' || (LA12_0 >= 'a' && LA12_0 <= 'c') || (LA12_0 >= 'e' && LA12_0 <= 'k') || (LA12_0 >= 'n' && LA12_0 <= 't') || (LA12_0 >= 'v' && LA12_0 <= 'z'))) { s = 17; } else if (((LA12_0 >= '0' && LA12_0 <= '9'))) { s = 18; } else if ((LA12_0 == '\"')) { s = 19; } else if ((LA12_0 == '\'')) { s = 20; } else if ((LA12_0 == '/')) { s = 21; } else if (((LA12_0 >= '\t' && LA12_0 <= '\n') || LA12_0 == '\r' || LA12_0 == ' ')) { s = 22; } else if (((LA12_0 >= '\u0000' && LA12_0 <= '\b') || (LA12_0 >= '\u000B' && LA12_0 <= '\f') || (LA12_0 >= '\u000E' && LA12_0 <= '\u001F') || LA12_0 == '!' || (LA12_0 >= '#' && LA12_0 <= '&') || LA12_0 == '(' || (LA12_0 >= '*' && LA12_0 <= '.') || (LA12_0 >= ':' && LA12_0 <= '?') || (LA12_0 >= '[' && LA12_0 <= ']') || LA12_0 == '`' || LA12_0 == '|' || (LA12_0 >= '~' && LA12_0 <= '\uFFFF'))) { s = 23; } if (s >= 0) return s; break; case 2: int LA12_20 = input.LA(1); s = -1; if (((LA12_20 >= '\u0000' && LA12_20 <= '\uFFFF'))) { s = 45; } else s = 23; if (s >= 0) return s; break; } NoViableAltException nvae = new NoViableAltException(getDescription(), 12, _s, input); error(nvae); throw nvae; }
public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { IntStream input = _input; int _s = s; switch (s) { case 0: int LA12_0 = input.LA(1); s = -1; if ((LA12_0 == ';')) { s = 1; } else if ((LA12_0 == 'r')) { s = 2; } else if ((LA12_0 == '^')) { s = 3; } else if (((LA12_0 >= 'A' && LA12_0 <= 'Z') || LA12_0 == '_' || (LA12_0 >= 'a' && LA12_0 <= 'q') || (LA12_0 >= 's' && LA12_0 <= 'z'))) { s = 4; } else if (((LA12_0 >= '0' && LA12_0 <= '9'))) { s = 5; } else if ((LA12_0 == '\"')) { s = 6; } else if ((LA12_0 == '\'')) { s = 7; } else if ((LA12_0 == '/')) { s = 8; } else if (((LA12_0 >= '\t' && LA12_0 <= '\n') || LA12_0 == '\r' || LA12_0 == ' ')) { s = 9; } else if (((LA12_0 >= '\u0000' && LA12_0 <= '\b') || (LA12_0 >= '\u000B' && LA12_0 <= '\f') || (LA12_0 >= '\u000E' && LA12_0 <= '\u001F') || LA12_0 == '!' || (LA12_0 >= '#' && LA12_0 <= '&') || (LA12_0 >= '(' && LA12_0 <= '.') || LA12_0 == ':' || (LA12_0 >= '<' && LA12_0 <= '@') || (LA12_0 >= '[' && LA12_0 <= ']') || LA12_0 == '`' || (LA12_0 >= '{' && LA12_0 <= '\uFFFF'))) { s = 10; } if (s >= 0) return s; break; case 1: int LA12_7 = input.LA(1); s = -1; if (((LA12_7 >= '\u0000' && LA12_7 <= '\uFFFF'))) { s = 15; } else s = 10; if (s >= 0) return s; break; case 2: int LA12_6 = input.LA(1); s = -1; if (((LA12_6 >= '\u0000' && LA12_6 <= '\uFFFF'))) { s = 15; } else s = 10; if (s >= 0) return s; break; } NoViableAltException nvae = new NoViableAltException(getDescription(), 12, _s, input); error(nvae); throw nvae; }
public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { IntStream input = _input; int _s = s; switch (s) { case 0: int LA12_0 = input.LA(1); s = -1; if ((LA12_0 == 'c')) { s = 1; } else if ((LA12_0 == '{')) { s = 2; } else if ((LA12_0 == '}')) { s = 3; } else if ((LA12_0 == 'n')) { s = 4; } else if ((LA12_0 == ',')) { s = 5; } else if ((LA12_0 == '-')) { s = 6; } else if ((LA12_0 == 'C')) { s = 7; } else if ((LA12_0 == '(')) { s = 8; } else if ((LA12_0 == ')')) { s = 9; } else if ((LA12_0 == 'a')) { s = 10; } else if ((LA12_0 == 'F')) { s = 11; } else if ((LA12_0 == 'S')) { s = 12; } else if ((LA12_0 == '^')) { s = 13; } else if (((LA12_0 >= 'A' && LA12_0 <= 'B') || (LA12_0 >= 'D' && LA12_0 <= 'E') || (LA12_0 >= 'G' && LA12_0 <= 'R') || (LA12_0 >= 'T' && LA12_0 <= 'Z') || LA12_0 == '_' || LA12_0 == 'b' || (LA12_0 >= 'd' && LA12_0 <= 'm') || (LA12_0 >= 'o' && LA12_0 <= 'z'))) { s = 14; } else if (((LA12_0 >= '0' && LA12_0 <= '9'))) { s = 15; } else if ((LA12_0 == '\"')) { s = 16; } else if ((LA12_0 == '\'')) { s = 17; } else if ((LA12_0 == '/')) { s = 18; } else if (((LA12_0 >= '\t' && LA12_0 <= '\n') || LA12_0 == '\r' || LA12_0 == ' ')) { s = 19; } else if (((LA12_0 >= '\u0000' && LA12_0 <= '\b') || (LA12_0 >= '\u000B' && LA12_0 <= '\f') || (LA12_0 >= '\u000E' && LA12_0 <= '\u001F') || LA12_0 == '!' || (LA12_0 >= '#' && LA12_0 <= '&') || (LA12_0 >= '*' && LA12_0 <= '+') || LA12_0 == '.' || (LA12_0 >= ':' && LA12_0 <= '@') || (LA12_0 >= '[' && LA12_0 <= ']') || LA12_0 == '`' || LA12_0 == '|' || (LA12_0 >= '~' && LA12_0 <= '\uFFFF'))) { s = 20; } if (s >= 0) return s; break; case 1: int LA12_16 = input.LA(1); s = -1; if (((LA12_16 >= '\u0000' && LA12_16 <= '\uFFFF'))) { s = 36; } else s = 20; if (s >= 0) return s; break; case 2: int LA12_17 = input.LA(1); s = -1; if (((LA12_17 >= '\u0000' && LA12_17 <= '\uFFFF'))) { s = 36; } else s = 20; if (s >= 0) return s; break; } NoViableAltException nvae = new NoViableAltException(getDescription(), 12, _s, input); error(nvae); throw nvae; }
public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { IntStream input = _input; int _s = s; switch (s) { case 0: int LA12_11 = input.LA(1); s = -1; if (((LA12_11 >= '\u0000' && LA12_11 <= '\uFFFF'))) { s = 26; } else s = 14; if (s >= 0) return s; break; case 1: int LA12_0 = input.LA(1); s = -1; if ((LA12_0 == 'm')) { s = 1; } else if ((LA12_0 == ':')) { s = 2; } else if ((LA12_0 == 'o')) { s = 3; } else if ((LA12_0 == '-')) { s = 4; } else if ((LA12_0 == 's')) { s = 5; } else if ((LA12_0 == 'e')) { s = 6; } else if ((LA12_0 == '^')) { s = 7; } else if (((LA12_0 >= 'A' && LA12_0 <= 'Z') || LA12_0 == '_' || (LA12_0 >= 'a' && LA12_0 <= 'd') || (LA12_0 >= 'f' && LA12_0 <= 'l') || LA12_0 == 'n' || (LA12_0 >= 'p' && LA12_0 <= 'r') || (LA12_0 >= 't' && LA12_0 <= 'z') || LA12_0 == '\u00E4' || LA12_0 == '\u00F6' || LA12_0 == '\u00FC')) { s = 8; } else if (((LA12_0 >= '0' && LA12_0 <= '9'))) { s = 9; } else if ((LA12_0 == '\"')) { s = 10; } else if ((LA12_0 == '\'')) { s = 11; } else if ((LA12_0 == '/')) { s = 12; } else if (((LA12_0 >= '\t' && LA12_0 <= '\n') || LA12_0 == '\r' || LA12_0 == ' ')) { s = 13; } else if (((LA12_0 >= '\u0000' && LA12_0 <= '\b') || (LA12_0 >= '\u000B' && LA12_0 <= '\f') || (LA12_0 >= '\u000E' && LA12_0 <= '\u001F') || LA12_0 == '!' || (LA12_0 >= '#' && LA12_0 <= '&') || (LA12_0 >= '(' && LA12_0 <= ',') || LA12_0 == '.' || (LA12_0 >= ';' && LA12_0 <= '@') || (LA12_0 >= '[' && LA12_0 <= ']') || LA12_0 == '`' || (LA12_0 >= '{' && LA12_0 <= '\u00E3') || (LA12_0 >= '\u00E5' && LA12_0 <= '\u00F5') || (LA12_0 >= '\u00F7' && LA12_0 <= '\u00FB') || (LA12_0 >= '\u00FD' && LA12_0 <= '\uFFFF'))) { s = 14; } if (s >= 0) return s; break; case 2: int LA12_10 = input.LA(1); s = -1; if (((LA12_10 >= '\u0000' && LA12_10 <= '\uFFFF'))) { s = 26; } else s = 14; if (s >= 0) return s; break; } NoViableAltException nvae = new NoViableAltException(getDescription(), 12, _s, input); error(nvae); throw nvae; }
public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { IntStream input = _input; int _s = s; switch (s) { case 0: int LA13_0 = input.LA(1); s = -1; if ((LA13_0 == '[')) { s = 1; } else if ((LA13_0 == ']')) { s = 2; } else if ((LA13_0 == '(')) { s = 3; } else if ((LA13_0 == ',')) { s = 4; } else if ((LA13_0 == ')')) { s = 5; } else if ((LA13_0 == '=')) { s = 6; } else if ((LA13_0 == '<')) { s = 7; } else if ((LA13_0 == '>')) { s = 8; } else if ((LA13_0 == '.')) { s = 9; } else if ((LA13_0 == '?')) { s = 10; } else if ((LA13_0 == 'e')) { s = 11; } else if ((LA13_0 == '&')) { s = 12; } else if ((LA13_0 == 's')) { s = 13; } else if ((LA13_0 == '*')) { s = 14; } else if ((LA13_0 == 'i')) { s = 15; } else if ((LA13_0 == ';')) { s = 16; } else if ((LA13_0 == '^')) { s = 17; } else if ((LA13_0 == '$' || (LA13_0 >= 'A' && LA13_0 <= 'Z') || LA13_0 == '_' || (LA13_0 >= 'a' && LA13_0 <= 'd') || (LA13_0 >= 'f' && LA13_0 <= 'h') || (LA13_0 >= 'j' && LA13_0 <= 'r') || (LA13_0 >= 't' && LA13_0 <= 'z'))) { s = 18; } else if ((LA13_0 == '\"')) { s = 19; } else if ((LA13_0 == '\'')) { s = 20; } else if ((LA13_0 == '/')) { s = 21; } else if (((LA13_0 >= '\t' && LA13_0 <= '\n') || LA13_0 == '\r' || LA13_0 == ' ')) { s = 22; } else if (((LA13_0 >= '\u0000' && LA13_0 <= '\b') || (LA13_0 >= '\u000B' && LA13_0 <= '\f') || (LA13_0 >= '\u000E' && LA13_0 <= '\u001F') || LA13_0 == '!' || LA13_0 == '#' || LA13_0 == '%' || LA13_0 == '+' || LA13_0 == '-' || (LA13_0 >= '0' && LA13_0 <= ':') || LA13_0 == '@' || LA13_0 == '\\' || LA13_0 == '`' || (LA13_0 >= '{' && LA13_0 <= '\uFFFF'))) { s = 23; } if (s >= 0) return s; break; } NoViableAltException nvae = new NoViableAltException(getDescription(), 13, _s, input); error(nvae); throw nvae; }
public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { IntStream input = _input; int _s = s; switch (s) { case 0: int LA12_35 = input.LA(1); s = -1; if (((LA12_35 >= '\u0000' && LA12_35 <= '\uFFFF'))) { s = 81; } else s = 39; if (s >= 0) return s; break; case 1: int LA12_0 = input.LA(1); s = -1; if ((LA12_0 == '?')) { s = 1; } else if ((LA12_0 == '*')) { s = 2; } else if ((LA12_0 == '+')) { s = 3; } else if ((LA12_0 == '=')) { s = 4; } else if ((LA12_0 == 'f')) { s = 5; } else if ((LA12_0 == 't')) { s = 6; } else if ((LA12_0 == 'g')) { s = 7; } else if ((LA12_0 == 'w')) { s = 8; } else if ((LA12_0 == ',')) { s = 9; } else if ((LA12_0 == '(')) { s = 10; } else if ((LA12_0 == ')')) { s = 11; } else if ((LA12_0 == '.')) { s = 12; } else if ((LA12_0 == 'a')) { s = 13; } else if ((LA12_0 == 'i')) { s = 14; } else if ((LA12_0 == ':')) { s = 15; } else if ((LA12_0 == ';')) { s = 16; } else if ((LA12_0 == 'r')) { s = 17; } else if ((LA12_0 == '<')) { s = 18; } else if ((LA12_0 == '>')) { s = 19; } else if ((LA12_0 == '|')) { s = 20; } else if ((LA12_0 == '&')) { s = 21; } else if ((LA12_0 == '{')) { s = 22; } else if ((LA12_0 == '}')) { s = 23; } else if ((LA12_0 == 'c')) { s = 24; } else if ((LA12_0 == '!')) { s = 25; } else if ((LA12_0 == '[')) { s = 26; } else if ((LA12_0 == ']')) { s = 27; } else if ((LA12_0 == '-')) { s = 28; } else if ((LA12_0 == 'E')) { s = 29; } else if ((LA12_0 == 'e')) { s = 30; } else if ((LA12_0 == 'h')) { s = 31; } else if ((LA12_0 == '^')) { s = 32; } else if (((LA12_0 >= 'A' && LA12_0 <= 'D') || (LA12_0 >= 'F' && LA12_0 <= 'Z') || LA12_0 == '_' || LA12_0 == 'b' || LA12_0 == 'd' || (LA12_0 >= 'j' && LA12_0 <= 'q') || LA12_0 == 's' || (LA12_0 >= 'u' && LA12_0 <= 'v') || (LA12_0 >= 'x' && LA12_0 <= 'z'))) { s = 33; } else if (((LA12_0 >= '0' && LA12_0 <= '9'))) { s = 34; } else if ((LA12_0 == '\"')) { s = 35; } else if ((LA12_0 == '\'')) { s = 36; } else if ((LA12_0 == '/')) { s = 37; } else if (((LA12_0 >= '\t' && LA12_0 <= '\n') || LA12_0 == '\r' || LA12_0 == ' ')) { s = 38; } else if (((LA12_0 >= '\u0000' && LA12_0 <= '\b') || (LA12_0 >= '\u000B' && LA12_0 <= '\f') || (LA12_0 >= '\u000E' && LA12_0 <= '\u001F') || (LA12_0 >= '#' && LA12_0 <= '%') || LA12_0 == '@' || LA12_0 == '\\' || LA12_0 == '`' || (LA12_0 >= '~' && LA12_0 <= '\uFFFF'))) { s = 39; } if (s >= 0) return s; break; case 2: int LA12_36 = input.LA(1); s = -1; if (((LA12_36 >= '\u0000' && LA12_36 <= '\uFFFF'))) { s = 81; } else s = 39; if (s >= 0) return s; break; } NoViableAltException nvae = new NoViableAltException(getDescription(), 12, _s, input); error(nvae); throw nvae; }
public boolean mismatchIsUnwantedToken(IntStream input, int ttype) { return input.LA(2) == ttype; }
public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { IntStream input = _input; int _s = s; switch (s) { case 0: int LA12_19 = input.LA(1); s = -1; if (((LA12_19 >= '\u0000' && LA12_19 <= '\uFFFF'))) { s = 40; } else s = 22; if (s >= 0) return s; break; case 1: int LA12_0 = input.LA(1); s = -1; if ((LA12_0 == 'u')) { s = 1; } else if ((LA12_0 == 'v')) { s = 2; } else if ((LA12_0 == 'i')) { s = 3; } else if ((LA12_0 == 'T')) { s = 4; } else if ((LA12_0 == ':')) { s = 5; } else if ((LA12_0 == '(')) { s = 6; } else if ((LA12_0 == ')')) { s = 7; } else if ((LA12_0 == ',')) { s = 8; } else if ((LA12_0 == '-')) { s = 9; } else if ((LA12_0 == '^')) { s = 10; } else if ((LA12_0 == '.')) { s = 11; } else if ((LA12_0 == '{')) { s = 12; } else if ((LA12_0 == '}')) { s = 13; } else if ((LA12_0 == 'h')) { s = 14; } else if ((LA12_0 == 'e')) { s = 15; } else if (((LA12_0 >= 'A' && LA12_0 <= 'S') || (LA12_0 >= 'U' && LA12_0 <= 'Z') || LA12_0 == '_' || (LA12_0 >= 'a' && LA12_0 <= 'd') || (LA12_0 >= 'f' && LA12_0 <= 'g') || (LA12_0 >= 'j' && LA12_0 <= 't') || (LA12_0 >= 'w' && LA12_0 <= 'z'))) { s = 16; } else if (((LA12_0 >= '0' && LA12_0 <= '9'))) { s = 17; } else if ((LA12_0 == '\"')) { s = 18; } else if ((LA12_0 == '\'')) { s = 19; } else if ((LA12_0 == '/')) { s = 20; } else if (((LA12_0 >= '\t' && LA12_0 <= '\n') || LA12_0 == '\r' || LA12_0 == ' ')) { s = 21; } else if (((LA12_0 >= '\u0000' && LA12_0 <= '\b') || (LA12_0 >= '\u000B' && LA12_0 <= '\f') || (LA12_0 >= '\u000E' && LA12_0 <= '\u001F') || LA12_0 == '!' || (LA12_0 >= '#' && LA12_0 <= '&') || (LA12_0 >= '*' && LA12_0 <= '+') || (LA12_0 >= ';' && LA12_0 <= '@') || (LA12_0 >= '[' && LA12_0 <= ']') || LA12_0 == '`' || LA12_0 == '|' || (LA12_0 >= '~' && LA12_0 <= '\uFFFF'))) { s = 22; } if (s >= 0) return s; break; case 2: int LA12_18 = input.LA(1); s = -1; if (((LA12_18 >= '\u0000' && LA12_18 <= '\uFFFF'))) { s = 40; } else s = 22; if (s >= 0) return s; break; } NoViableAltException nvae = new NoViableAltException(getDescription(), 12, _s, input); error(nvae); throw nvae; }
public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { IntStream input = _input; int _s = s; switch (s) { case 0: int LA12_14 = input.LA(1); s = -1; if (((LA12_14 >= '\u0000' && LA12_14 <= '\uFFFF'))) { s = 31; } else s = 17; if (s >= 0) return s; break; case 1: int LA12_13 = input.LA(1); s = -1; if (((LA12_13 >= '\u0000' && LA12_13 <= '\uFFFF'))) { s = 31; } else s = 17; if (s >= 0) return s; break; case 2: int LA12_0 = input.LA(1); s = -1; if ((LA12_0 == 'a')) { s = 1; } else if ((LA12_0 == 'c')) { s = 2; } else if ((LA12_0 == 'd')) { s = 3; } else if ((LA12_0 == 't')) { s = 4; } else if ((LA12_0 == 'f')) { s = 5; } else if ((LA12_0 == 'p')) { s = 6; } else if ((LA12_0 == 'e')) { s = 7; } else if ((LA12_0 == '(')) { s = 8; } else if ((LA12_0 == ')')) { s = 9; } else if ((LA12_0 == '^')) { s = 10; } else if (((LA12_0 >= 'A' && LA12_0 <= 'Z') || LA12_0 == '_' || LA12_0 == 'b' || (LA12_0 >= 'g' && LA12_0 <= 'o') || (LA12_0 >= 'q' && LA12_0 <= 's') || (LA12_0 >= 'u' && LA12_0 <= 'z'))) { s = 11; } else if (((LA12_0 >= '0' && LA12_0 <= '9'))) { s = 12; } else if ((LA12_0 == '\"')) { s = 13; } else if ((LA12_0 == '\'')) { s = 14; } else if ((LA12_0 == '/')) { s = 15; } else if (((LA12_0 >= '\t' && LA12_0 <= '\n') || LA12_0 == '\r' || LA12_0 == ' ')) { s = 16; } else if (((LA12_0 >= '\u0000' && LA12_0 <= '\b') || (LA12_0 >= '\u000B' && LA12_0 <= '\f') || (LA12_0 >= '\u000E' && LA12_0 <= '\u001F') || LA12_0 == '!' || (LA12_0 >= '#' && LA12_0 <= '&') || (LA12_0 >= '*' && LA12_0 <= '.') || (LA12_0 >= ':' && LA12_0 <= '@') || (LA12_0 >= '[' && LA12_0 <= ']') || LA12_0 == '`' || (LA12_0 >= '{' && LA12_0 <= '\uFFFF'))) { s = 17; } if (s >= 0) return s; break; } NoViableAltException nvae = new NoViableAltException(getDescription(), 12, _s, input); error(nvae); throw nvae; }
public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { IntStream input = _input; int _s = s; switch (s) { case 0: int LA12_10 = input.LA(1); s = -1; if (((LA12_10 >= '\u0000' && LA12_10 <= '\uFFFF'))) { s = 23; } else s = 14; if (s >= 0) return s; break; case 1: int LA12_11 = input.LA(1); s = -1; if (((LA12_11 >= '\u0000' && LA12_11 <= '\uFFFF'))) { s = 23; } else s = 14; if (s >= 0) return s; break; case 2: int LA12_0 = input.LA(1); s = -1; if ((LA12_0 == 'V')) { s = 1; } else if ((LA12_0 == '{')) { s = 2; } else if ((LA12_0 == '}')) { s = 3; } else if ((LA12_0 == 'm')) { s = 4; } else if ((LA12_0 == 'O')) { s = 5; } else if ((LA12_0 == 'A')) { s = 6; } else if ((LA12_0 == '^')) { s = 7; } else if (((LA12_0 >= 'B' && LA12_0 <= 'N') || (LA12_0 >= 'P' && LA12_0 <= 'U') || (LA12_0 >= 'W' && LA12_0 <= 'Z') || LA12_0 == '_' || (LA12_0 >= 'a' && LA12_0 <= 'l') || (LA12_0 >= 'n' && LA12_0 <= 'z'))) { s = 8; } else if (((LA12_0 >= '0' && LA12_0 <= '9'))) { s = 9; } else if ((LA12_0 == '\"')) { s = 10; } else if ((LA12_0 == '\'')) { s = 11; } else if ((LA12_0 == '/')) { s = 12; } else if (((LA12_0 >= '\t' && LA12_0 <= '\n') || LA12_0 == '\r' || LA12_0 == ' ')) { s = 13; } else if (((LA12_0 >= '\u0000' && LA12_0 <= '\b') || (LA12_0 >= '\u000B' && LA12_0 <= '\f') || (LA12_0 >= '\u000E' && LA12_0 <= '\u001F') || LA12_0 == '!' || (LA12_0 >= '#' && LA12_0 <= '&') || (LA12_0 >= '(' && LA12_0 <= '.') || (LA12_0 >= ':' && LA12_0 <= '@') || (LA12_0 >= '[' && LA12_0 <= ']') || LA12_0 == '`' || LA12_0 == '|' || (LA12_0 >= '~' && LA12_0 <= '\uFFFF'))) { s = 14; } if (s >= 0) return s; break; } NoViableAltException nvae = new NoViableAltException(getDescription(), 12, _s, input); error(nvae); throw nvae; }