_errHandler.sync(this); _alt = 1; do { _la = _input.LA(1); if ( !(_la==WS || _la==CHAR) ) { _errHandler.recoverInline(this); if ( _input.LA(1)==Token.EOF ) matchedEOF = true; _errHandler.reportMatch(this); consume(); _la = _input.LA(1); if ((_la != WS) && (_la != CHAR)) return _localctx; else if (_alt == 1) continue; throw new NoViableAltException(this); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,181,_ctx); } while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER );
public final BinaryFunctionNameContext binaryFunctionName() throws RecognitionException { BinaryFunctionNameContext _localctx = new BinaryFunctionNameContext(_ctx, getState()); enterRule(_localctx, 4, RULE_binaryFunctionName); int _la; try { enterOuterAlt(_localctx, 1); { setState(39); ((BinaryFunctionNameContext)_localctx).name = _input.LT(1); _la = _input.LA(1); if ( !(_la==MIN || _la==MAX) ) { ((BinaryFunctionNameContext)_localctx).name = (Token)_errHandler.recoverInline(this); } else { if ( _input.LA(1)==Token.EOF ) matchedEOF = true; _errHandler.reportMatch(this); consume(); } } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; }
protected void reportNoViableAlternative(final Parser recognizer, final NoViableAltException e) { final TokenStream tokens = recognizer.getInputStream(); final String input; if (tokens != null) { if (e.getStartToken().getType() == -1) { input = "<EOF>"; } else { input = tokens.getText(e.getStartToken(), e.getOffendingToken()); } } else { input = "<unknown input>"; } final String msg = "no viable alternative at input " + this.escapeWSAndQuote(input); recognizer.notifyErrorListeners(e.getOffendingToken(), msg, e); }
private String spliceParens(int startIndex, int initialParenCount) { TokenStreamRewriter r = new TokenStreamRewriter(tokenStream); int i = startIndex, parens = initialParenCount; for ( ; i < tokenStream.size(); i++ ) { String tokenText = tokenStream.get(i).getText(); if ( tokenText.equals("(") ) parens++; else if ( tokenText.equals(")") ) parens--; if ( parens == 0 ) break; } r.insertBefore(startIndex, "/__MAXWELL__/"); r.delete(startIndex, i); return r.getText(); }
int _alt; setState(2023); _errHandler.sync(this); switch (_input.LA(1)) { case LP_: case COMMA: _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,225,_ctx); while ( _alt!=1 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1+1 ) { _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,225,_ctx); setState(2021); _errHandler.sync(this); _la = _input.LA(1); if (_la==PRIVILEGES) { throw new NoViableAltException(this);
public final ParseContext parse() throws RecognitionException { ParseContext _localctx = new ParseContext(_ctx, getState()); enterRule(_localctx, 0, RULE_parse); try { enterOuterAlt(_localctx, 1); { setState(72); ((ParseContext)_localctx).expression = expression(); setState(73); match(EOF); ((ParseContext)_localctx).e = ((ParseContext)_localctx).expression.e; if (fullExpression == null) fullExpression = (((ParseContext)_localctx).expression!=null?_input.getText(((ParseContext)_localctx).expression.start,((ParseContext)_localctx).expression.stop):null); tokenPos = (((ParseContext)_localctx).expression!=null?(((ParseContext)_localctx).expression.start):null).getTokenIndex(); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; }
private boolean select_list_alias_sempred(Select_list_aliasContext _localctx, int predIndex) { switch (predIndex) { case 3: return !_input.LT(1).getText().equalsIgnoreCase("INTO") && !_input.LT(1).getText().equalsIgnoreCase("FROM"); } return true; } private boolean from_alias_clause_sempred(From_alias_clauseContext _localctx, int predIndex) {
protected NoViableAltException noViableAlt(TokenStream input, ParserRuleContext outerContext, ATNConfigSet configs, int startIndex) { return new NoViableAltException(parser, input, input.get(startIndex), input.LT(1), configs, outerContext); }
@Override public void reportContextSensitivity(Parser recognizer, DFA dfa, int startIndex, int stopIndex, int prediction, ATNConfigSet configs) { String format = "reportContextSensitivity d=%s, input='%s'"; String decision = getDecisionDescription(recognizer, dfa); String text = recognizer.getTokenStream().getText(Interval.of(startIndex, stopIndex)); String message = String.format(format, decision, text); recognizer.notifyErrorListeners(message); }
if ( stop>tokens.size()-1 ) stop = tokens.size()-1; if ( start<0 ) start = 0; return tokens.getText(interval); // no instructions to execute while ( i <= stop && i < tokens.size() ) { RewriteOperation op = indexToOp.get(i); Token t = tokens.get(i); if ( op==null ) { if ( stop==tokens.size()-1 ) { if ( op.index >= tokens.size()-1 ) buf.append(op.text);
int currentToken = stream.get(tokenIndex).getType(); if (labels.contains(currentToken)) { activeStates.add(new ParsingState(transition.target, tokenIndex + 1, caller));
public final QueryContext query() throws RecognitionException { QueryContext _localctx = new QueryContext(_ctx, getState()); enterRule(_localctx, 8, RULE_query); int _la; try { enterOuterAlt(_localctx, 1); { setState(522); _errHandler.sync(this); _la = _input.LA(1); if (_la==WITH) { { setState(521); with(); } } setState(524); queryNoWith(); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; }
private boolean block_end_sempred(Block_endContext _localctx, int predIndex) { switch (predIndex) { case 0: return !_input.LT(2).getText().equalsIgnoreCase("TRANSACTION"); } return true; } private boolean expr_stmt_sempred(Expr_stmtContext _localctx, int predIndex) {
@Override public void reportAttemptingFullContext(Parser recognizer, DFA dfa, int startIndex, int stopIndex, BitSet conflictingAlts, ATNConfigSet configs) { String format = "reportAttemptingFullContext d=%s, input='%s'"; String decision = getDecisionDescription(recognizer, dfa); String text = recognizer.getTokenStream().getText(Interval.of(startIndex, stopIndex)); String message = String.format(format, decision, text); recognizer.notifyErrorListeners(message); }
public final Block_endContext block_end() throws RecognitionException { Block_endContext _localctx = new Block_endContext(_ctx, getState()); enterRule(_localctx, 8, RULE_block_end); try { enterOuterAlt(_localctx, 1); { setState(489); if (!(!_input.LT(2).getText().equalsIgnoreCase("TRANSACTION"))) throw new FailedPredicateException(this, "!_input.LT(2).getText().equalsIgnoreCase(\"TRANSACTION\")"); setState(490); match(T_END); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; }
try { setState(756); _errHandler.sync(this); switch (_input.LA(1)) { case NUMBER: enterOuterAlt(_localctx, 1); throw new NoViableAltException(this); _errHandler.reportError(this, re); _errHandler.recover(this, re);