示例#1
0
    public TermsContext terms()
    {
        TermsContext _localctx = new TermsContext(Context, State);

        EnterRule(_localctx, 2, RULE_terms);
        try {
            State = 45;
            switch (Interpreter.AdaptivePredict(TokenStream, 1, Context))
            {
            case 1:
                EnterOuterAlt(_localctx, 1);
                {
                    State           = 37; _localctx.a = term();
                    _localctx.value = _localctx.a.value;
                }
                break;

            case 2:
                EnterOuterAlt(_localctx, 2);
                {
                    State = 40; _localctx.a = term();
                    State = 41; Match(PLUS);
                    State = 42; _localctx.b = terms();

                    _localctx.value = PumpingLemma.LinearIntegerExpression.Plus(_localctx.a.value, _localctx.b.value);
                }
                break;
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
 public TermsService(TermsContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
	public TermsContext terms() {
		TermsContext _localctx = new TermsContext(Context, State);
		EnterRule(_localctx, 2, RULE_terms);
		try {
			State = 45;
			switch ( Interpreter.AdaptivePredict(TokenStream,1,Context) ) {
			case 1:
				EnterOuterAlt(_localctx, 1);
				{
				State = 37; _localctx.a = term();
				 _localctx.value =  _localctx.a.value; 
				}
				break;
			case 2:
				EnterOuterAlt(_localctx, 2);
				{
				State = 40; _localctx.a = term();
				State = 41; Match(PLUS);
				State = 42; _localctx.b = terms();

						 _localctx.value =  PumpingLemma.LinearIntegerExpression.Plus(_localctx.a.value, _localctx.b.value); 
						 
				}
				break;
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}