예제 #1
0
        public override AST_Node VisitClasslist([NotNull] CoolParser.ClasslistContext context)
        {
            List <AST_ClassDef> li = new List <AST_ClassDef>();

            foreach (var item in context.classdefine())
            {
                AST_ClassDef i = (AST_ClassDef)Visit(item);
                li.Add(i);
            }
            return(new AST_Root(context, new AST_Node[] { new AST_ListClass(context, li) }));
        }
 /// <summary>
 /// Visit a parse tree produced by the <c>classlist</c>
 /// labeled alternative in <see cref="CoolParser.program"/>.
 /// <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 VisitClasslist([NotNull] CoolParser.ClasslistContext context)
 {
     return(VisitChildren(context));
 }