Esempio n. 1
0
        private static ExpressionSyntax Index(ParserRuleContext node)
        {
            if (node.ChildCount == 1)
            {
                return(Expression(node.GetRuleContext <ParserRuleContext>(0)));
            }

            Debug.Assert(node.ChildCount == 4);
            var expr  = visitNode(node.GetRuleContext <ParserRuleContext>(0));
            var index = (ArgumentListSyntax)Arguments(node.GetRuleContext <ParserRuleContext>(2));

            return(CSharp.ElementAccessExpression(
                       expr, CSharp
                       .BracketedArgumentList(index.Arguments)));
        }