Class ApplicationDfnGenerator
java.lang.Object
org.ek9lang.compiler.phase7.AbstractDfnGenerator
org.ek9lang.compiler.phase7.ApplicationDfnGenerator
- All Implemented Interfaces:
Function<EK9Parser.ApplicationDeclarationContext, IRConstruct>
final class ApplicationDfnGenerator
extends AbstractDfnGenerator
implements Function<EK9Parser.ApplicationDeclarationContext, IRConstruct>
Creates the appropriate IR Construct for an application declaration.
An application in EK9 is a configuration block that sets up dependency injection. It becomes an IRConstruct with two methods:
_prepare- Sets up components by processing block statements and register statements. Each register statement creates a component and stores it in a static field on the global_Applicationclass (root-level singleton, no module prefix)._decommission- Releases all registered components in reverse registration order.
The _Application class itself (a dumb static struct with no methods) is generated
separately by ApplicationClassGenerator during the code generation phase.
-
Field Summary
Fields inherited from class AbstractDfnGenerator
generators, notImplicitSuper, operationDfnGenerator, stackContext, voidStr -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class AbstractDfnGenerator
createDebugInfoCreator, createInitOperation, createInstanceInitOperation, getParsedModule, newPerConstructContext, newSyntheticInitOperation, processAsMethodOrOperator, processPropertiesForInstanceInit, processSyntheticConstructor
-
Constructor Details
-
ApplicationDfnGenerator
ApplicationDfnGenerator(IRGenerationContext stackContext)
-
-
Method Details
-
apply
- Specified by:
applyin interfaceFunction<EK9Parser.ApplicationDeclarationContext, IRConstruct>
-