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; }
/** * This is called by {@link #reportError} when the exception is a * {@link FailedPredicateException}. * * @see #reportError * * @param recognizer the parser instance * @param e the recognition exception */ protected void reportFailedPredicate(Parser recognizer, FailedPredicateException e) { String ruleName = recognizer.getRuleNames()[recognizer._ctx.getRuleIndex()]; String msg = "rule "+ruleName+" "+e.getMessage(); recognizer.notifyErrorListeners(e.getOffendingToken(), msg, e); }
public static String failedPredicate(FailedPredicateException e) { String ruleName = e.getRecognizer().getRuleNames()[e.getRuleIndex()]; return "rule<" + ruleName + ">:" + e.getMessage(); }
@Override public void reportFailedPredicate(Parser parser, FailedPredicateException e) { parser.notifyErrorListeners(e.getOffendingToken(), getExpectationTxt((Parser) e.getRecognizer()), getException("FailedPredicate", parser)); }
/** * This is called by {@link #reportError} when the exception is a * {@link FailedPredicateException}. * * @see #reportError * * @param recognizer the parser instance * @param e the recognition exception */ protected void reportFailedPredicate(@NotNull Parser recognizer, @NotNull FailedPredicateException e) { String ruleName = recognizer.getRuleNames()[recognizer._ctx.getRuleIndex()]; String msg = "rule "+ruleName+" "+e.getMessage(); notifyErrorListeners(recognizer, msg, e); }
protected void reportFailedPredicate(@NotNull Parser recognizer, @NotNull FailedPredicateException e) { String ruleName = recognizer.getRuleNames()[recognizer.getContext().getRuleIndex()]; BeetlException exception = new BeetlParserException(BeetlException.PARSER_PREDICATE_ERROR, ruleName, e); // exception.token = this.getGrammarToken(e.getOffendingToken()); exception.pushToken(this.getGrammarToken(e.getOffendingToken())); throw exception; }
/** * This is called by {@link #reportError} when the exception is a * {@link FailedPredicateException}. * * @see #reportError * * @param recognizer the parser instance * @param e the recognition exception */ protected void reportFailedPredicate(Parser recognizer, FailedPredicateException e) { String ruleName = recognizer.getRuleNames()[recognizer._ctx.getRuleIndex()]; String msg = "rule "+ruleName+" "+e.getMessage(); recognizer.notifyErrorListeners(e.getOffendingToken(), msg, e); }
@Override public void reportFailedPredicate(Parser parser, FailedPredicateException e) { parser.notifyErrorListeners(e.getOffendingToken(), getExpectationTxt((Parser) e.getRecognizer()), getException("FailedPredicate", parser)); }
@Override public void reportFailedPredicate(Parser parser, FailedPredicateException e) { setErrorState(parser); DiagnosticPos pos = getPosition(getMissingSymbol(parser)); if (parser.getContext() instanceof BallerinaParser.ShiftExprPredicateContext) { dlog.error(pos, DiagnosticCode.INVALID_SHIFT_OPERATOR); } else if (parser.getContext() instanceof BallerinaParser.RestDescriptorPredicateContext) { dlog.error(pos, DiagnosticCode.INVALID_RECORD_REST_DESCRIPTOR); } else { dlog.error(pos, DiagnosticCode.FAILED_PREDICATE, e.getMessage()); } }
protected void reportFailedPredicate(@NotNull Parser recognizer, @NotNull FailedPredicateException e) { String ruleName = recognizer.getRuleNames()[recognizer.getContext().getRuleIndex()]; BeetlException exception = new BeetlParserException(BeetlException.PARSER_PREDICATE_ERROR, ruleName, e); // exception.token = this.getGrammarToken(e.getOffendingToken()); exception.pushToken(this.getGrammarToken(e.getOffendingToken())); throw exception; }
public final Expr_stmtContext expr_stmt() throws RecognitionException { Expr_stmtContext _localctx = new Expr_stmtContext(_ctx, getState()); enterRule(_localctx, 22, RULE_expr_stmt); try { enterOuterAlt(_localctx, 1); { setState(582); if (!(!_input.LT(1).getText().equalsIgnoreCase("GO"))) throw new FailedPredicateException(this, "!_input.LT(1).getText().equalsIgnoreCase(\"GO\")"); setState(583); expr(0); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; }
/** * This is called by {@link #reportError} when the exception is a * {@link FailedPredicateException}. * * @see #reportError * * @param recognizer the parser instance * @param e the recognition exception */ protected void reportFailedPredicate(Parser recognizer, FailedPredicateException e) { String ruleName = recognizer.getRuleNames()[recognizer._ctx.getRuleIndex()]; String msg = "rule "+ruleName+" "+e.getMessage(); recognizer.notifyErrorListeners(e.getOffendingToken(), msg, e); }
if (!(!_input.LT(1).getText().equalsIgnoreCase("EXEC") && !_input.LT(1).getText().equalsIgnoreCase("EXECUTE") && !_input.LT(1).getText().equalsIgnoreCase("INNER") && !_input.LT(1).getText().equalsIgnoreCase("LEFT") && !_input.LT(1).getText().equalsIgnoreCase("GROUP") && !_input.LT(1).getText().equalsIgnoreCase("ORDER") && !_input.LT(1).getText().equalsIgnoreCase("LIMIT") && !_input.LT(1).getText().equalsIgnoreCase("WITH"))) throw new FailedPredicateException(this, "!_input.LT(1).getText().equalsIgnoreCase(\"EXEC\") &&\n !_input.LT(1).getText().equalsIgnoreCase(\"EXECUTE\") && \n !_input.LT(1).getText().equalsIgnoreCase(\"INNER\") &&\n !_input.LT(1).getText().equalsIgnoreCase(\"LEFT\") &&\n !_input.LT(1).getText().equalsIgnoreCase(\"GROUP\") &&\n !_input.LT(1).getText().equalsIgnoreCase(\"ORDER\") &&\n !_input.LT(1).getText().equalsIgnoreCase(\"LIMIT\") &&\n !_input.LT(1).getText().equalsIgnoreCase(\"WITH\")"); setState(2419); switch ( getInterpreter().adaptivePredict(_input,297,_ctx) ) { case 1: ident(); setState(2432); switch ( getInterpreter().adaptivePredict(_input,299,_ctx) ) { case 1: match(L_ID); setState(2428); _errHandler.sync(this); _la = _input.LA(1); while (_la==T_COMMA) { _errHandler.sync(this); _la = _input.LA(1); _errHandler.reportError(this, re); _errHandler.recover(this, re);
/** * This is called by {@link #reportError} when the exception is a * {@link FailedPredicateException}. * * @see #reportError * * @param recognizer the parser instance * @param e the recognition exception */ protected void reportFailedPredicate(Parser recognizer, FailedPredicateException e) { String ruleName = recognizer.getRuleNames()[recognizer._ctx.getRuleIndex()]; String msg = "rule "+ruleName+" "+e.getMessage(); recognizer.notifyErrorListeners(e.getOffendingToken(), msg, e); }
if (!(!_input.LT(1).getText().equalsIgnoreCase("ALL"))) throw new FailedPredicateException(this, "!_input.LT(1).getText().equalsIgnoreCase(\"ALL\")"); setState(2602); switch ( getInterpreter().adaptivePredict(_input,328,_ctx) ) { case 1: _errHandler.reportError(this, re); _errHandler.recover(this, re);
try { setState(920); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,93,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); if (!(lineTerminatorAhead())) throw new FailedPredicateException(this, "lineTerminatorAhead()"); if (!(_input.LT(1).getText().equals("}") )) throw new FailedPredicateException(this, "_input.LT(1).getText().equals(\"}\") "); _errHandler.reportError(this, re); _errHandler.recover(this, re);
unaryExpr(); _ctx.stop = _input.LT(-1); setState(900); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,90,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { pushNewRecursionContext(_localctx, _startState, RULE_expression); setState(895); if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); setState(896); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__16) | (1L << T__17) | (1L << T__18) | (1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__52) | (1L << T__53) | (1L << T__54) | (1L << T__55) | (1L << T__56) | (1L << T__57) | (1L << T__58) | (1L << T__59))) != 0)) ) { _errHandler.recoverInline(this); if ( _input.LA(1)==Token.EOF ) matchedEOF = true; _errHandler.reportMatch(this); consume(); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,90,_ctx);
queryPrimary(); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,63,_ctx) ) { case 1: pushNewRecursionContext(_localctx, _startState, RULE_queryTerm); setState(593); if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); setState(594); ((SetOperationContext)_localctx).operator = match(INTERSECT); setState(596); _errHandler.sync(this); _la = _input.LA(1); if (_la==ALL || _la==DISTINCT) { pushNewRecursionContext(_localctx, _startState, RULE_queryTerm); setState(599); if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); setState(600); ((SetOperationContext)_localctx).operator = _input.LT(1); _la = _input.LA(1); if ( !(_la==EXCEPT || _la==UNION) ) { _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,64,_ctx);
if (!(!_input.LT(1).getText().equalsIgnoreCase("INTO"))) throw new FailedPredicateException(this, "!_input.LT(1).getText().equalsIgnoreCase(\"INTO\")"); setState(3234); switch ( getInterpreter().adaptivePredict(_input,407,_ctx) ) { case 1: match(T_EQUAL); setState(3232); _la = _input.LA(1); if (_la==T_GREATER) { _errHandler.reportError(this, re); _errHandler.recover(this, re);
int _alt; setState(1565); switch ( getInterpreter().adaptivePredict(_input,162,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); _errHandler.sync(this); _la = _input.LA(1); if (!(!_input.LT(1).getText().equalsIgnoreCase("IS") && !_input.LT(1).getText().equalsIgnoreCase("AS") && !(_input.LT(1).getText().equalsIgnoreCase("DYNAMIC") && _input.LT(2).getText().equalsIgnoreCase("RESULT")) )) throw new FailedPredicateException(this, "!_input.LT(1).getText().equalsIgnoreCase(\"IS\") &&\n !_input.LT(1).getText().equalsIgnoreCase(\"AS\") &&\n !(_input.LT(1).getText().equalsIgnoreCase(\"DYNAMIC\") && _input.LT(2).getText().equalsIgnoreCase(\"RESULT\"))\n "); setState(1557); create_routine_param_item(); setState(1562); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,161,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,161,_ctx);