Class ClassDfnGenerator
java.lang.Object
org.ek9lang.compiler.phase7.AbstractDfnGenerator
org.ek9lang.compiler.phase7.AggregateDfnGenerator
org.ek9lang.compiler.phase7.ClassDfnGenerator
- All Implemented Interfaces:
Function<EK9Parser.ClassDeclarationContext,
IRConstruct>
final class ClassDfnGenerator
extends AggregateDfnGenerator
implements Function<EK9Parser.ClassDeclarationContext,IRConstruct>
Creates the appropriate IR Construct for a class declaration.
Deals with the following ANTLR grammar.
classDeclaration : Identifier extendDeclaration? (traitPreamble traitsList)? (AS? (ABSTRACT | OPEN))? aggregateParts? | Identifier parameterisedParams (AS? (ABSTRACT | OPEN))? aggregateParts ;
The key part here is that you can use the 'ctx' to look up the class aggregate. For generic type use with parameterisation this will still be an aggregate (but with the appropriate configuration).
//TODO pull most of the methods down into AbstractDfnGenerator and rename them. //TODO most of the init and properties stuff applies to records, components, dynamic classes //TODO and even Functions as these become classes in implementation. Dynamic functions with //TODO capture variables are just properties on the class again in implementation.-
Field Summary
Fields inherited from class org.ek9lang.compiler.phase7.AbstractDfnGenerator
notImplicitSuper, operationDfnGenerator, stackContext, voidStr
-
Constructor Summary
ConstructorsConstructorDescriptionClassDfnGenerator
(IRGenerationContext stackContext) Constructor using stack context - the single source of state. -
Method Summary
Methods inherited from class org.ek9lang.compiler.phase7.AggregateDfnGenerator
createFieldDeclarations, createInitializationOperations, createOperationsForAggregateParts, processAggregate
Methods inherited from class org.ek9lang.compiler.phase7.AbstractDfnGenerator
createCallMetaDataExtractor, createDebugInfoCreator, createInitOperation, createInstanceInitOperation, getParsedModule, newPerConstructContext, newSyntheticInitOperation, processAsMethodOrOperator, processPropertiesForInstanceInit, processSyntheticConstructor
-
Constructor Details
-
ClassDfnGenerator
ClassDfnGenerator(IRGenerationContext stackContext) Constructor using stack context - the single source of state.
-
-
Method Details
-
apply
- Specified by:
apply
in interfaceFunction<EK9Parser.ClassDeclarationContext,
IRConstruct>
-