public override object VisitCompilationUnit([NotNull] DoshikParser.CompilationUnitContext context)
        {
            _compilationContext.CompilationUnit = new CompilationUnit(_compilationContext.ExternalApi);

            var memberDeclarations = context.memberDeclaration();

            foreach (var memberDeclaration in memberDeclarations)
            {
                Visit(memberDeclaration);
            }

            return(null);
        }
Exemple #2
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="DoshikParser.compilationUnit"/>.
 /// <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 VisitCompilationUnit([NotNull] DoshikParser.CompilationUnitContext context)
 {
     return(VisitChildren(context));
 }
 public static void Apply(CompilationContext compilationContext, DoshikParser.CompilationUnitContext antlrContext)
 {
     antlrContext.Accept(new CompilationUnitCreationVisitor(compilationContext));
 }
 /// <summary>
 /// Exit a parse tree produced by <see cref="DoshikParser.compilationUnit"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitCompilationUnit([NotNull] DoshikParser.CompilationUnitContext context)
 {
 }