Class CodeGenerationApplications
java.lang.Object
org.ek9lang.compiler.CompilerPhase
org.ek9lang.compiler.phase10.CodeGenerationApplications
- All Implemented Interfaces:
BiFunction<Workspace, CompilerFlags, CompilationPhaseResult>
MULTI THREADED
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)
_Applicationstruct must exist on disk before programs reference it via GETSTATIC (ASM COMPUTE_FRAMES needs the class file)
-
Field Summary
Fields inherited from class CompilerPhase
compilableProgramAccess, listener, reporter -
Constructor Summary
ConstructorsConstructorDescriptionCodeGenerationApplications(SharedThreadContext<CompilableProgram> compilableProgramAccess, FileHandling fileHandling, 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
-