Exemple #1
0
	private EqExprContext eqExpr(int _p) {
		ParserRuleContext _parentctx = _ctx;
		int _parentState = State;
		EqExprContext _localctx = new EqExprContext(_ctx, _parentState);
		EqExprContext _prevctx = _localctx;
		int _startState = 14;
		EnterRecursionRule(_localctx, 14, RULE_eqExpr, _p);
		int _la;
		try {
			int _alt;
			EnterOuterAlt(_localctx, 1);
			{
			{
			State = 119; _localctx._relExpr = relExpr(0);
			 _localctx.retValue =  _localctx._relExpr.retValue;
			}
			_ctx.stop = _input.Lt(-1);
			State = 134;
			_errHandler.Sync(this);
			_alt = Interpreter.AdaptivePredict(_input,7,_ctx);
			while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.InvalidAltNumber ) {
				if ( _alt==1 ) {
					if ( _parseListeners!=null ) TriggerExitRuleEvent();
					_prevctx = _localctx;
					{
					State = 132;
					switch ( Interpreter.AdaptivePredict(_input,6,_ctx) ) {
					case 1:
						{
						_localctx = new EqExprContext(_parentctx, _parentState);
						_localctx.first = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_eqExpr);
						State = 122;
						if (!(Precpred(_ctx, 3))) throw new FailedPredicateException(this, "Precpred(_ctx, 3)");
						State = 123;
						_la = _input.La(1);
						if ( !(_la==T__23 || _la==T__12) ) {
						_errHandler.RecoverInline(this);
						}
						Consume();
						State = 124; _localctx._relExpr = relExpr(0);
						 _localctx.retValue =  new BinaryExpression(BinaryExpressionType.Equal, _localctx.first.retValue, _localctx._relExpr.retValue);
						}
						break;

					case 2:
						{
						_localctx = new EqExprContext(_parentctx, _parentState);
						_localctx.first = _prevctx;
						PushNewRecursionContext(_localctx, _startState, RULE_eqExpr);
						State = 127;
						if (!(Precpred(_ctx, 2))) throw new FailedPredicateException(this, "Precpred(_ctx, 2)");
						State = 128;
						_la = _input.La(1);
						if ( !(_la==T__28 || _la==T__6) ) {
						_errHandler.RecoverInline(this);
						}
						Consume();
						State = 129; _localctx._relExpr = relExpr(0);
						 _localctx.retValue =  new BinaryExpression(BinaryExpressionType.NotEqual, _localctx.first.retValue, _localctx._relExpr.retValue);
						}
						break;
					}
					} 
				}
				State = 136;
				_errHandler.Sync(this);
				_alt = Interpreter.AdaptivePredict(_input,7,_ctx);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.ReportError(this, re);
			_errHandler.Recover(this, re);
		}
		finally {
			UnrollRecursionContexts(_parentctx);
		}
		return _localctx;
	}
Exemple #2
0
	private bool eqExpr_sempred(EqExprContext _localctx, int predIndex) {
		switch (predIndex) {
		case 5: return Precpred(_ctx, 3);

		case 6: return Precpred(_ctx, 2);
		}
		return true;
	}