Class EnumerationDfnGenerator

java.lang.Object
org.ek9lang.compiler.phase7.AbstractDfnGenerator
org.ek9lang.compiler.phase7.EnumerationDfnGenerator
All Implemented Interfaces:
Function<EK9Parser.TypeDeclarationContext, IRConstruct>

final class EnumerationDfnGenerator extends AbstractDfnGenerator implements Function<EK9Parser.TypeDeclarationContext, IRConstruct>
Creates the appropriate IR Construct for an enumeration declaration.

Enumerations are fundamentally different from classes/records:

  • No user-defined properties (no aggregateParts in grammar)
  • Synthetic _ordinal (Integer) and _name (String) instance fields
  • All operators/constructors are synthetic (added by earlier phases)
  • Enum values are ConstantSymbol instances in the aggregate scope

Extends AbstractDfnGenerator directly (not AggregateDfnGenerator) because enumerations have no aggregateParts context to parse.