示例#1
0
        public override void ExitAliasAssignment(AdvplParser.AliasAssignmentContext ctx)
        {
            if (ctx.expression().Length > 0)
            {
                if (ctx.expression(0).children.Count > 0)
                {
                    IParseTree it = ctx.expression(0).children[0];

                    IdentifierContext lastCxt = null;
                    for (int nx = 0; nx < it.ChildCount; nx++)
                    {
                        IParseTree tree = it.GetChild(nx);
                        if (tree is IdentifierContext)
                        {
                            lastCxt = (IdentifierContext)tree;
                        }
                    }
                    if (lastCxt != null)
                    {
                        String varName = lastCxt.GetText().ToUpper();
                        if (!currentScope.existLocalScope(varName))
                        {
                            defineVar(Symbol.Type.tALIAS, lastCxt.Start, ctx);
                        }
                    }
                }
            }
        }
示例#2
0
        public override object VisitInterface_definition([NotNull] Interface_definitionContext context)
        {
            var identifier = context.identifier();

            IdentifierContext = identifier;
            return(null);
        }
示例#3
0
 public HomeController()
 {
     _identifierContext          = new IdentifierContext();
     _noticeContext              = new NoticeContext();
     _bankContext                = new BankContext();
     _tagDetailIdentifierContext = new TagDetailIdentifierContext();
 }
示例#4
0
    public IdentifierContext identifier()
    {
        IdentifierContext _localctx = new IdentifierContext(Context, State);

        EnterRule(_localctx, 4, RULE_identifier);
        int _la;

        try {
            EnterOuterAlt(_localctx, 1);
            {
                State = 36;
                _la   = TokenStream.LA(1);
                if (!(_la == IDENTIFIER || _la == NUMBER))
                {
                    ErrorHandler.RecoverInline(this);
                }
                else
                {
                    ErrorHandler.ReportMatch(this);
                    Consume();
                }
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
        public override Expression VisitIdentifier(IdentifierContext context)
        {
            var identifierName = context.GetText();
            var identifier     = _parserContext.Scope.Lookup(identifierName);

            return(identifier);
        }
示例#6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="function"></param>
        /// <returns></returns>
        private ErrorInformation CreateError(IdentifierContext function)
        {
            ParserRuleContext method = (ParserRuleContext)function.Parent.Parent.Parent.Parent;

            if (method is Common_member_declarationContext)
            {
                method = (ParserRuleContext)method.Parent;
            }
            int spaceBefore = method.Start.Column;
            List <ReplaceCodeInfomation> replaceCode = new List <ReplaceCodeInfomation>()
            {
                new ReplaceCodeInfomation()
                {
                    Start       = method.Start.StartIndex - 1,
                    Length      = 1,
                    ReplaceCode = " /// <summary>\r\n"
                                  + InsertSpace(spaceBefore) + "/// " + function.GetText() + "\r\n"
                                  + InsertSpace(spaceBefore) + "/// </summary>\r\n"
                                  + InsertParameterComment(function.Symbol as MethodSymbol, spaceBefore)
                                  + InsertSpace(spaceBefore) + "/// <returns></returns>\r\n"
                                  + InsertSpace(spaceBefore)
                }
            };

            return(new ErrorInformation()
            {
                ErrorCode = "IF0002",
                ErrorMessage = "UIT: You should add comment for method " + function.GetText(),
                DisplayText = "Add comment before function",
                StartIndex = function.Start.StartIndex,
                Length = 1,
                ReplaceCode = replaceCode
            });
        }
示例#7
0
 public override object VisitIdentifier([NotNull] IdentifierContext context)
 {
     if (context.InRule(typeof(Field_declarationContext)))
     {
         Identifier = context;
     }
     return(null);
 }
示例#8
0
 public override object VisitIdentifier([NotNull] IdentifierContext context)
 {
     if (context.InRule(typeof(Local_variable_declarationContext)) &&
         context.InRule(typeof(Local_variable_declaratorContext)))
     {
         Identifiers.Add(context);
     }
     return(base.VisitIdentifier(context));
 }
        public Form GetForm(IdentifierContext context)
        {
            if (null == context)
            {
                throw new ArgumentNullException(nameof(context));
            }

            return(GetForm(context, context.IdentifierValue, true));
        }
        public bool CheckCompatibility(IdentifierContext context)
        {
            if (null == context)
            {
                throw new ArgumentNullException(nameof(context));
            }

            return(true);
        }
        public static void ShowFindCertificateForm(IWin32Window owner, SessionContext sessionContext, string identifierValue)
        {
            if (null == sessionContext)
            {
                throw new ArgumentNullException(nameof(sessionContext));
            }

            var identifierContext =
                new IdentifierContext(sessionContext, identifierValue ?? string.Empty);

            sessionContext.ExtensionManager.TryGetIdentifierFormProvider(ExtensionCatalog.FindCertificate)
            ?.GetForm(identifierContext)
            .Show(owner);
        }
示例#12
0
 public override object VisitIdentifier([NotNull] IdentifierContext context)
 {
     if (context.InRule(typeof(Typed_member_declarationContext)))
     {
         if (context.InRule(typeof(TypeContext)))
         {
             typeContext = context;
         }
         else if (context.InRule(typeof(Member_nameContext)))
         {
             Symbol = context.Scope.Resolve(typeContext.GetText());
             return(null);
         }
     }
     return(base.VisitIdentifier(context));
 }
示例#13
0
 public override void EnterIdentifier([NotNull] IdentifierContext context)
 {
     if (startVar || structStart || enumStart)
     {
         name = context.Start.Text;
         if (structStart)
         {
             currStruct.Name = name;
         }
         if (enumStart)
         {
             currEnum.name = name;
         }
         varlist.Add(name);
     }
 }
 public override object VisitIdentifier([NotNull] IdentifierContext context)
 {
     if (context.Scope != null)
     {
         currentScope = context.Scope;
     }
     else if (context.Symbol == null)
     {
         var symbol = currentScope.Resolve(context.GetText());
         if (symbol != null)
         {
             context.Symbol = symbol;
             context.Scope  = symbol.GetScope();
         }
     }
     return(context);
 }
示例#15
0
        public IdentifierContext identifier()
        {
            IdentifierContext _localctx = new IdentifierContext(Context, State);

            EnterRule(_localctx, 14, RULE_identifier);
            try {
                EnterOuterAlt(_localctx, 1);
                {
                    State = 76; Match(REGULAR_ID);
                }
            }
            catch (RecognitionException re) {
                _localctx.exception = re;
                ErrorHandler.ReportError(this, re);
                ErrorHandler.Recover(this, re);
            }
            finally {
                ExitRule();
            }
            return(_localctx);
        }
示例#16
0
        private void ParseInterfaceDeclaration(Interface_definitionContext node)
        {
            var members = node.interface_body().interface_member_declaration();

            foreach (var member in members)
            {
                if (member is Interface_member_declarationContext)
                {
                    Interface_member_declarationContext memberContext = member as Interface_member_declarationContext;
                    Type_Context typeContext = memberContext.type_();

                    bool isProperty = typeContext != null;

                    IdentifierContext identifierContext = memberContext.identifier();

                    if (identifierContext != null)
                    {
                        string name = this.GetNodeName(identifierContext);
                        this.WriteKeyValue((isProperty ? "Property" : "Method"), name);
                    }
                }
            }
        }
        public static bool IsSameName(Unary_expressionContext unary_ExpressionContext, string methodName)
        {
            List <SimpleNameExpressionContext> simpleNameExpression = unary_ExpressionContext.GetDeepChildContext <SimpleNameExpressionContext>();
            List <Member_accessContext>        memberAccessContext  = unary_ExpressionContext.GetDeepChildContext <Member_accessContext>();

            if (simpleNameExpression.Count > 0)
            {
                string name = simpleNameExpression[0].identifier().GetText();
                if (name == methodName)
                {
                    if (memberAccessContext.Count > 0)
                    {
                        return(false);
                    }
                    else
                    {
                        return(true);
                    }
                }
                else
                {
                    return(false);
                }
            }

            if (memberAccessContext.Count > 0)
            {
                var thisContext = unary_ExpressionContext.GetDeepChildContext <ThisReferenceExpressionContext>();
                if (thisContext.Count > 0)
                {
                    IdentifierContext identifier = memberAccessContext[0].identifier();
                    return(methodName == identifier.GetText() ? true : false);
                }
            }

            return(false);
        }
示例#18
0
 protected string GetNodeName(IdentifierContext node)
 {
     return(node.GetText());
 }
示例#19
0
 public IdentifierController()
 {
     _noticeContext     = new NoticeContext();
     _identifierContext = new IdentifierContext();
 }
示例#20
0
	public PrimaryExpressionContext primaryExpression() {
		PrimaryExpressionContext _localctx = new PrimaryExpressionContext(Context, State);
		EnterRule(_localctx, 12, RULE_primaryExpression);
		try {
			int _alt;
			State = 112;
			switch (TokenStream.La(1)) {
			case Identifier:
				_localctx = new IdentifierContext(_localctx);
				EnterOuterAlt(_localctx, 1);
				{
				State = 101; Match(Identifier);
				}
				break;
			case Constant:
				_localctx = new ConstantContext(_localctx);
				EnterOuterAlt(_localctx, 2);
				{
				State = 102; Match(Constant);
				}
				break;
			case StringLiteral:
				_localctx = new StringLiteralContext(_localctx);
				EnterOuterAlt(_localctx, 3);
				{
				State = 104;
				ErrorHandler.Sync(this);
				_alt = 1;
				do {
					switch (_alt) {
					case 1:
						{
						{
						State = 103; Match(StringLiteral);
						}
						}
						break;
					default:
						throw new NoViableAltException(this);
					}
					State = 106;
					ErrorHandler.Sync(this);
					_alt = Interpreter.AdaptivePredict(TokenStream,6,Context);
				} while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.InvalidAltNumber );
				}
				break;
			case LeftParen:
				_localctx = new ParenthesizedContext(_localctx);
				EnterOuterAlt(_localctx, 4);
				{
				State = 108; Match(LeftParen);
				State = 109; expression();
				State = 110; Match(RightParen);
				}
				break;
			default:
				throw new NoViableAltException(this);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}
示例#21
0
文件: RParser.cs 项目: mpmedia/Excess
	private ExprContext expr(int _p) {
		ParserRuleContext _parentctx = Context;
		int _parentState = State;
		ExprContext _localctx = new ExprContext(Context, _parentState);
		ExprContext _prevctx = _localctx;
		int _startState = 4;
		EnterRecursionRule(_localctx, 4, RULE_expr, _p);
		int _la;
		try {
			int _alt;
			EnterOuterAlt(_localctx, 1);
			{
			State = 129;
			switch ( Interpreter.AdaptivePredict(TokenStream,12,Context) ) {
			case 1:
				{
				_localctx = new SignContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;

				State = 35;
				_la = TokenStream.La(1);
				if ( !(_la==T__14 || _la==T__15) ) {
				ErrorHandler.RecoverInline(this);
				}
				else {
				    Consume();
				}
				State = 36; expr(35);
				}
				break;
			case 2:
				{
				_localctx = new NegationContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 37; Match(T__25);
				State = 38; expr(29);
				}
				break;
			case 3:
				{
				_localctx = new FormulaeContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 39; Match(T__30);
				State = 40; expr(26);
				}
				break;
			case 4:
				{
				_localctx = new FunctionContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 41; Match(T__34);
				State = 42; Match(T__7);
				State = 44;
				_la = TokenStream.La(1);
				if (_la==T__53 || _la==ID) {
					{
					State = 43; formlist();
					}
				}

				State = 46; Match(T__8);
				State = 47; expr(23);
				}
				break;
			case 5:
				{
				_localctx = new RepeatStatementContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 48; Match(T__42);
				State = 52;
				ErrorHandler.Sync(this);
				_la = TokenStream.La(1);
				while (_la==NL) {
					{
					{
					State = 49; Match(NL);
					}
					}
					State = 54;
					ErrorHandler.Sync(this);
					_la = TokenStream.La(1);
				}
				State = 55; expr(17);
				}
				break;
			case 6:
				{
				_localctx = new HelpContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 56; Match(T__43);
				State = 57; expr(16);
				}
				break;
			case 7:
				{
				_localctx = new CompoundContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 58; Match(T__35);
				State = 60;
				_la = TokenStream.La(1);
				if (_la==NL) {
					{
					State = 59; Match(NL);
					}
				}

				State = 62; exprlist();
				State = 63; Match(T__36);
				}
				break;
			case 8:
				{
				_localctx = new IfStatementContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 65; Match(T__37);
				State = 66; Match(T__7);
				State = 67; expr(0);
				State = 68; Match(T__8);
				State = 70;
				_la = TokenStream.La(1);
				if (_la==NL) {
					{
					State = 69; Match(NL);
					}
				}

				State = 72; expr(0);
				}
				break;
			case 9:
				{
				_localctx = new IfElseStatementContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 74; Match(T__37);
				State = 75; Match(T__7);
				State = 76; expr(0);
				State = 77; Match(T__8);
				State = 79;
				_la = TokenStream.La(1);
				if (_la==NL) {
					{
					State = 78; Match(NL);
					}
				}

				State = 81; expr(0);
				State = 83;
				_la = TokenStream.La(1);
				if (_la==NL) {
					{
					State = 82; Match(NL);
					}
				}

				State = 85; Match(T__38);
				State = 87;
				_la = TokenStream.La(1);
				if (_la==NL) {
					{
					State = 86; Match(NL);
					}
				}

				State = 89; expr(0);
				}
				break;
			case 10:
				{
				_localctx = new ForEachStatementContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 91; Match(T__39);
				State = 92; Match(T__7);
				State = 93; Match(ID);
				State = 94; Match(T__40);
				State = 95; expr(0);
				State = 96; Match(T__8);
				State = 98;
				_la = TokenStream.La(1);
				if (_la==NL) {
					{
					State = 97; Match(NL);
					}
				}

				State = 100; expr(0);
				}
				break;
			case 11:
				{
				_localctx = new WhileStatementContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 102; Match(T__41);
				State = 103; Match(T__7);
				State = 104; expr(0);
				State = 105; Match(T__8);
				State = 107;
				_la = TokenStream.La(1);
				if (_la==NL) {
					{
					State = 106; Match(NL);
					}
				}

				State = 109; expr(0);
				}
				break;
			case 12:
				{
				_localctx = new NextStatementContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 111; Match(T__44);
				}
				break;
			case 13:
				{
				_localctx = new BreakStatementContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 112; Match(T__45);
				}
				break;
			case 14:
				{
				_localctx = new ParenthesizedContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 113; Match(T__7);
				State = 114; expr(0);
				State = 115; Match(T__8);
				}
				break;
			case 15:
				{
				_localctx = new IdentifierContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 117; Match(ID);
				}
				break;
			case 16:
				{
				_localctx = new StringLiteralContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 118; Match(STRING);
				}
				break;
			case 17:
				{
				_localctx = new HexLiteralContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 119; Match(HEX);
				}
				break;
			case 18:
				{
				_localctx = new IntLiteralContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 120; Match(INT);
				}
				break;
			case 19:
				{
				_localctx = new FloatLiteralContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 121; Match(FLOAT);
				}
				break;
			case 20:
				{
				_localctx = new ComplexLiteralContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 122; Match(COMPLEX);
				}
				break;
			case 21:
				{
				_localctx = new NullLiteralContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 123; Match(T__46);
				}
				break;
			case 22:
				{
				_localctx = new NAContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 124; Match(T__47);
				}
				break;
			case 23:
				{
				_localctx = new InfLiteralContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 125; Match(T__48);
				}
				break;
			case 24:
				{
				_localctx = new NanLiteralContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 126; Match(T__49);
				}
				break;
			case 25:
				{
				_localctx = new TrueLiteralContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 127; Match(T__50);
				}
				break;
			case 26:
				{
				_localctx = new FalseLiteralContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 128; Match(T__51);
				}
				break;
			}
			Context.Stop = TokenStream.Lt(-1);
			State = 185;
			ErrorHandler.Sync(this);
			_alt = Interpreter.AdaptivePredict(TokenStream,14,Context);
			while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.InvalidAltNumber ) {
				if ( _alt==1 ) {
					if ( ParseListeners!=null )
						TriggerExitRuleEvent();
					_prevctx = _localctx;
					{
					State = 183;
					switch ( Interpreter.AdaptivePredict(TokenStream,13,Context) ) {
					case 1:
						{
						_localctx = new NamespaceContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 131;
						if (!(Precpred(Context, 38))) throw new FailedPredicateException(this, "Precpred(Context, 38)");
						State = 132;
						_la = TokenStream.La(1);
						if ( !(_la==T__9 || _la==T__10) ) {
						ErrorHandler.RecoverInline(this);
						}
						else {
						    Consume();
						}
						State = 133; expr(39);
						}
						break;
					case 2:
						{
						_localctx = new MemberAccessContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 134;
						if (!(Precpred(Context, 37))) throw new FailedPredicateException(this, "Precpred(Context, 37)");
						State = 135;
						_la = TokenStream.La(1);
						if ( !(_la==T__11 || _la==T__12) ) {
						ErrorHandler.RecoverInline(this);
						}
						else {
						    Consume();
						}
						State = 136; expr(38);
						}
						break;
					case 3:
						{
						_localctx = new PowerContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 137;
						if (!(Precpred(Context, 36))) throw new FailedPredicateException(this, "Precpred(Context, 36)");
						State = 138; Match(T__13);
						State = 139; expr(37);
						}
						break;
					case 4:
						{
						_localctx = new SequenceContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 140;
						if (!(Precpred(Context, 34))) throw new FailedPredicateException(this, "Precpred(Context, 34)");
						State = 141; Match(T__16);
						State = 142; expr(35);
						}
						break;
					case 5:
						{
						_localctx = new UserOpContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 143;
						if (!(Precpred(Context, 33))) throw new FailedPredicateException(this, "Precpred(Context, 33)");
						State = 144; Match(USER_OP);
						State = 145; expr(34);
						}
						break;
					case 6:
						{
						_localctx = new MultiplicationContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 146;
						if (!(Precpred(Context, 32))) throw new FailedPredicateException(this, "Precpred(Context, 32)");
						State = 147;
						_la = TokenStream.La(1);
						if ( !(_la==T__17 || _la==T__18) ) {
						ErrorHandler.RecoverInline(this);
						}
						else {
						    Consume();
						}
						State = 148; expr(33);
						}
						break;
					case 7:
						{
						_localctx = new AdditionContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 149;
						if (!(Precpred(Context, 31))) throw new FailedPredicateException(this, "Precpred(Context, 31)");
						State = 150;
						_la = TokenStream.La(1);
						if ( !(_la==T__14 || _la==T__15) ) {
						ErrorHandler.RecoverInline(this);
						}
						else {
						    Consume();
						}
						State = 151; expr(32);
						}
						break;
					case 8:
						{
						_localctx = new ComparisonContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 152;
						if (!(Precpred(Context, 30))) throw new FailedPredicateException(this, "Precpred(Context, 30)");
						State = 153;
						_la = TokenStream.La(1);
						if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24))) != 0)) ) {
						ErrorHandler.RecoverInline(this);
						}
						else {
						    Consume();
						}
						State = 154; expr(31);
						}
						break;
					case 9:
						{
						_localctx = new LogicalAndContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 155;
						if (!(Precpred(Context, 28))) throw new FailedPredicateException(this, "Precpred(Context, 28)");
						State = 156;
						_la = TokenStream.La(1);
						if ( !(_la==T__26 || _la==T__27) ) {
						ErrorHandler.RecoverInline(this);
						}
						else {
						    Consume();
						}
						State = 157; expr(29);
						}
						break;
					case 10:
						{
						_localctx = new LogicalOrContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 158;
						if (!(Precpred(Context, 27))) throw new FailedPredicateException(this, "Precpred(Context, 27)");
						State = 159;
						_la = TokenStream.La(1);
						if ( !(_la==T__28 || _la==T__29) ) {
						ErrorHandler.RecoverInline(this);
						}
						else {
						    Consume();
						}
						State = 160; expr(28);
						}
						break;
					case 11:
						{
						_localctx = new FormulaeContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 161;
						if (!(Precpred(Context, 25))) throw new FailedPredicateException(this, "Precpred(Context, 25)");
						State = 162; Match(T__30);
						State = 163; expr(26);
						}
						break;
					case 12:
						{
						_localctx = new RightAssignmentContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 164;
						if (!(Precpred(Context, 24))) throw new FailedPredicateException(this, "Precpred(Context, 24)");
						State = 165;
						_la = TokenStream.La(1);
						if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__31) | (1L << T__32) | (1L << T__33))) != 0)) ) {
						ErrorHandler.RecoverInline(this);
						}
						else {
						    Consume();
						}
						State = 166; expr(25);
						}
						break;
					case 13:
						{
						_localctx = new ListAccessContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 167;
						if (!(Precpred(Context, 41))) throw new FailedPredicateException(this, "Precpred(Context, 41)");
						State = 168; Match(T__4);
						State = 169; sublist();
						State = 170; Match(T__5);
						State = 171; Match(T__5);
						}
						break;
					case 14:
						{
						_localctx = new IndexContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 173;
						if (!(Precpred(Context, 40))) throw new FailedPredicateException(this, "Precpred(Context, 40)");
						State = 174; Match(T__6);
						State = 175; sublist();
						State = 176; Match(T__5);
						}
						break;
					case 15:
						{
						_localctx = new FunctionCallContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 178;
						if (!(Precpred(Context, 39))) throw new FailedPredicateException(this, "Precpred(Context, 39)");
						State = 179; Match(T__7);
						State = 180; sublist();
						State = 181; Match(T__8);
						}
						break;
					}
					} 
				}
				State = 187;
				ErrorHandler.Sync(this);
				_alt = Interpreter.AdaptivePredict(TokenStream,14,Context);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			UnrollRecursionContexts(_parentctx);
		}
		return _localctx;
	}
	public TermContext term() {
		TermContext _localctx = new TermContext(Context, State);
		EnterRule(_localctx, 12, RULE_term);
		try {
			State = 77;
			switch (TokenStream.La(1)) {
			case ID:
				_localctx = new IdentifierContext(_localctx);
				EnterOuterAlt(_localctx, 1);
				{
				State = 70; Match(ID);
				}
				break;
			case T__6:
				_localctx = new NegationContext(_localctx);
				EnterOuterAlt(_localctx, 2);
				{
				State = 71; Match(T__6);
				State = 72; term();
				}
				break;
			case T__7:
				_localctx = new ParenthesisContext(_localctx);
				EnterOuterAlt(_localctx, 3);
				{
				State = 73; Match(T__7);
				State = 74; expression();
				State = 75; Match(T__8);
				}
				break;
			default:
				throw new NoViableAltException(this);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}
示例#23
0
 public Identifier(IdentifierContext context)
     : this(context.Name, context.GetSourceSpan( ))
 {
 }
示例#24
0
	public IdentifierContext identifier() {
		IdentifierContext _localctx = new IdentifierContext(_ctx, State);
		EnterRule(_localctx, 244, RULE_identifier);
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 1332; Match(IDENTIFIER);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.ReportError(this, re);
			_errHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}