Class CodeGenerationApplications

java.lang.Object
org.ek9lang.compiler.CompilerPhase
org.ek9lang.compiler.phase10.CodeGenerationApplications
All Implemented Interfaces:
BiFunction<Workspace, CompilerFlags, CompilationPhaseResult>

public class CodeGenerationApplications extends CompilerPhase
MULTI THREADED Generate application infrastructure classes.

This phase generates two things per module that contains application declarations:

  • _Application class — a dumb static struct (fields only, no methods) where each field stores a registered component or service
  • Application classes themselves (e.g., MyApp.class) are generated in the aggregates phase since they have IRConstructs with operations

This phase runs AFTER CodeGenerationConstants and BEFORE CodeGenerationAggregates because:

  • Components may reference constants (so constants must exist first)
  • _Application struct must exist on disk before programs reference it via GETSTATIC (ASM COMPUTE_FRAMES needs the class file)