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
SINGLE THREADED. There is exactly ONE global _Application for the whole program, so there is nothing to fan out over - the collection scans are sequential and the generator is called once. 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 must be generated before programs reference it via GETSTATIC. (Ordering only - NOT a file-on-disk requirement: Ek9ClassWriter resolves superclasses from ISymbol data, and the CLI batch path writes no class files at all.)