Class CodeGenerationApplications
java.lang.Object
org.ek9lang.compiler.CompilerPhase
org.ek9lang.compiler.phase10.CodeGenerationApplications
- All Implemented Interfaces:
BiFunction<Workspace, CompilerFlags, CompilationPhaseResult>
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:
_Applicationclass — 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)
_Applicationmust 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.)
-
Field Summary
Fields inherited from class CompilerPhase
compilableProgramAccess, listener, modelFrozen, reporter -
Constructor Summary
ConstructorsConstructorDescriptionCodeGenerationApplications(SharedThreadContext<CompilableProgram> compilableProgramAccess, FileHandling fileHandling, ConstructOutputSink outputSink, Consumer<CompilationEvent> listener, CompilerReporter reporter) -
Method Summary
Modifier and TypeMethodDescriptionbooleandoApply(Workspace workspace, CompilerFlags compilerFlags) Do the compilation phase.Methods inherited from class CompilerPhase
apply, getParsedModuleForSourceMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiFunction
andThen
-
Constructor Details
-
Method Details
-
doApply
Description copied from class:CompilerPhaseDo the compilation phase.- Specified by:
doApplyin classCompilerPhase
-