Class ClassDfnGenerator
java.lang.Object
org.ek9lang.compiler.phase7.AbstractDfnGenerator
org.ek9lang.compiler.phase7.ClassDfnGenerator
- All Implemented Interfaces:
Function<EK9Parser.ClassDeclarationContext,
IRConstruct>
final class ClassDfnGenerator
extends AbstractDfnGenerator
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.-
Constructor Details
-
ClassDfnGenerator
ClassDfnGenerator(ParsedModule parsedModule, CompilerFlags compilerFlags)
-
-
Method Details
-
apply
- Specified by:
apply
in interfaceFunction<EK9Parser.ClassDeclarationContext,
IRConstruct>
-