Example #1
0
        public override Node VisitArrayDeclaration(TParser.ArrayDeclarationContext context)
        {
            var col = new NodesCollection <Node>(context.Start);

            if (context.commaExpressions() == null)
            {
                return(new ArrayDeclaration(col, context.Start));
            }
            foreach (var exp in context.commaExpressions().expression())
            {
                col.Add(Visit(exp));
            }
            return(new ArrayDeclaration(col, context.Start));
        }
Example #2
0
 /// <summary>
 /// Visit a parse tree produced by the <c>ArrayDeclaration</c>
 /// labeled alternative in <see cref="TParser.expression"/>.
 /// <para>
 /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
 /// on <paramref name="context"/>.
 /// </para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 /// <return>The visitor result.</return>
 public virtual Result VisitArrayDeclaration([NotNull] TParser.ArrayDeclarationContext context)
 {
     return(VisitChildren(context));
 }
 /// <summary>
 /// Enter a parse tree produced by the <c>ArrayDeclaration</c>
 /// labeled alternative in <see cref="TParser.expression"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void EnterArrayDeclaration([NotNull] TParser.ArrayDeclarationContext context)
 {
 }