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.
-
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
-
EnumerationDfnGenerator
EnumerationDfnGenerator(IRGenerationContext stackContext)
-
-
Method Details
-
apply
- Specified by:
applyin interfaceFunction<EK9Parser.TypeDeclarationContext, IRConstruct>
-