private bool additiveExpression_sempred(AdditiveExpressionContext _localctx, int predIndex) { switch (predIndex) { case 10: return Precpred(Context, 2); case 11: return Precpred(Context, 1); } return true; }
private AdditiveExpressionContext additiveExpression(int _p) { ParserRuleContext _parentctx = Context; int _parentState = State; AdditiveExpressionContext _localctx = new AdditiveExpressionContext(Context, _parentState); AdditiveExpressionContext _prevctx = _localctx; int _startState = 26; EnterRecursionRule(_localctx, 26, RULE_additiveExpression, _p); try { int _alt; EnterOuterAlt(_localctx, 1); { { State = 191; multiplicativeExpression(0); } Context.Stop = TokenStream.Lt(-1); State = 201; ErrorHandler.Sync(this); _alt = Interpreter.AdaptivePredict(TokenStream,17,Context); while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.InvalidAltNumber ) { if ( _alt==1 ) { if ( ParseListeners!=null ) TriggerExitRuleEvent(); _prevctx = _localctx; { State = 199; switch ( Interpreter.AdaptivePredict(TokenStream,16,Context) ) { case 1: { _localctx = new AdditiveExpressionContext(_parentctx, _parentState); PushNewRecursionContext(_localctx, _startState, RULE_additiveExpression); State = 193; if (!(Precpred(Context, 2))) throw new FailedPredicateException(this, "Precpred(Context, 2)"); State = 194; Match(Plus); State = 195; multiplicativeExpression(0); } break; case 2: { _localctx = new AdditiveExpressionContext(_parentctx, _parentState); PushNewRecursionContext(_localctx, _startState, RULE_additiveExpression); State = 196; if (!(Precpred(Context, 1))) throw new FailedPredicateException(this, "Precpred(Context, 1)"); State = 197; Match(Minus); State = 198; multiplicativeExpression(0); } break; } } } State = 203; ErrorHandler.Sync(this); _alt = Interpreter.AdaptivePredict(TokenStream,17,Context); } } } catch (RecognitionException re) { _localctx.exception = re; ErrorHandler.ReportError(this, re); ErrorHandler.Recover(this, re); } finally { UnrollRecursionContexts(_parentctx); } return _localctx; }