コード例 #1
0
ファイル: JSONParser.cs プロジェクト: mpmedia/Excess
	private bool multiplicativeExpression_sempred(MultiplicativeExpressionContext _localctx, int predIndex) {
		switch (predIndex) {
		case 7: return Precpred(Context, 3);
		case 8: return Precpred(Context, 2);
		case 9: return Precpred(Context, 1);
		}
		return true;
	}
コード例 #2
0
ファイル: JSONParser.cs プロジェクト: mpmedia/Excess
	private MultiplicativeExpressionContext multiplicativeExpression(int _p) {
		ParserRuleContext _parentctx = Context;
		int _parentState = State;
		MultiplicativeExpressionContext _localctx = new MultiplicativeExpressionContext(Context, _parentState);
		MultiplicativeExpressionContext _prevctx = _localctx;
		int _startState = 24;
		EnterRecursionRule(_localctx, 24, RULE_multiplicativeExpression, _p);
		try {
			int _alt;
			EnterOuterAlt(_localctx, 1);
			{
			{
			State = 174; castExpression();
			}
			Context.Stop = TokenStream.Lt(-1);
			State = 187;
			ErrorHandler.Sync(this);
			_alt = Interpreter.AdaptivePredict(TokenStream,15,Context);
			while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.InvalidAltNumber ) {
				if ( _alt==1 ) {
					if ( ParseListeners!=null )
						TriggerExitRuleEvent();
					_prevctx = _localctx;
					{
					State = 185;
					switch ( Interpreter.AdaptivePredict(TokenStream,14,Context) ) {
					case 1:
						{
						_localctx = new MultiplicativeExpressionContext(_parentctx, _parentState);
						PushNewRecursionContext(_localctx, _startState, RULE_multiplicativeExpression);
						State = 176;
						if (!(Precpred(Context, 3))) throw new FailedPredicateException(this, "Precpred(Context, 3)");
						State = 177; Match(Star);
						State = 178; castExpression();
						}
						break;
					case 2:
						{
						_localctx = new MultiplicativeExpressionContext(_parentctx, _parentState);
						PushNewRecursionContext(_localctx, _startState, RULE_multiplicativeExpression);
						State = 179;
						if (!(Precpred(Context, 2))) throw new FailedPredicateException(this, "Precpred(Context, 2)");
						State = 180; Match(Div);
						State = 181; castExpression();
						}
						break;
					case 3:
						{
						_localctx = new MultiplicativeExpressionContext(_parentctx, _parentState);
						PushNewRecursionContext(_localctx, _startState, RULE_multiplicativeExpression);
						State = 182;
						if (!(Precpred(Context, 1))) throw new FailedPredicateException(this, "Precpred(Context, 1)");
						State = 183; Match(Mod);
						State = 184; castExpression();
						}
						break;
					}
					} 
				}
				State = 189;
				ErrorHandler.Sync(this);
				_alt = Interpreter.AdaptivePredict(TokenStream,15,Context);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			UnrollRecursionContexts(_parentctx);
		}
		return _localctx;
	}