Exemplo n.º 1
0
        public override AccessNode VisitAccess([NotNull] AccessContext context)
        {
            var name = context.Name()?.GetText();
            var expr = this.VisitFirstChild <ExprNode, Node>(new ParserRuleContext[] {
                context.invokeFunction(),
                context.instantiateObject(),
                context.expr(),
            });

            // No need to check for right parenthesis because of parser rules enforcing matching parens
            var hasParens = context.LeftParen() != null;

            var chain = context.accessChain().Invoke(VisitAccessChain);

            return(new AccessNode(name, expr, chain, hasParens, GetLocation(context)));
        }