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 _Application class (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.