Exemple #1
0
	private BitAndExprContext bitAndExpr(int _p) {
		ParserRuleContext _parentctx = _ctx;
		int _parentState = State;
		BitAndExprContext _localctx = new BitAndExprContext(_ctx, _parentState);
		BitAndExprContext _prevctx = _localctx;
		int _startState = 12;
		EnterRecursionRule(_localctx, 12, RULE_bitAndExpr, _p);
		try {
			int _alt;
			EnterOuterAlt(_localctx, 1);
			{
			{
			State = 105; _localctx._eqExpr = eqExpr(0);
			 _localctx.retValue =  _localctx._eqExpr.retValue;
			}
			_ctx.stop = _input.Lt(-1);
			State = 115;
			_errHandler.Sync(this);
			_alt = Interpreter.AdaptivePredict(_input,5,_ctx);
			while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.InvalidAltNumber ) {
				if ( _alt==1 ) {
					if ( _parseListeners!=null ) TriggerExitRuleEvent();
					_prevctx = _localctx;
					{
					{
					_localctx = new BitAndExprContext(_parentctx, _parentState);
					_localctx.first = _prevctx;
					PushNewRecursionContext(_localctx, _startState, RULE_bitAndExpr);
					State = 108;
					if (!(Precpred(_ctx, 2))) throw new FailedPredicateException(this, "Precpred(_ctx, 2)");
					State = 109; Match(T__19);
					State = 110; _localctx._eqExpr = eqExpr(0);
					 _localctx.retValue =  new BinaryExpression(BinaryExpressionType.BitwiseAnd, _localctx.first.retValue, _localctx._eqExpr.retValue);
					}
					} 
				}
				State = 117;
				_errHandler.Sync(this);
				_alt = Interpreter.AdaptivePredict(_input,5,_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 bitAndExpr_sempred(BitAndExprContext _localctx, int predIndex) {
		switch (predIndex) {
		case 4: return Precpred(_ctx, 2);
		}
		return true;
	}