public override Node VisitProgram([NotNull] coolgrammarParser.ProgramContext context) { var clases = new List <Class_Def>(); foreach (var item in context.@class()) { clases.Add((Class_Def)Visit(item)); } return(new Program(clases)); }
/// <summary> /// Visit a parse tree produced by <see cref="coolgrammarParser.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 VisitProgram([NotNull] coolgrammarParser.ProgramContext context) { return(VisitChildren(context)); }