Class OperationDfnGenerator
java.lang.Object
org.ek9lang.compiler.phase7.generator.AbstractGenerator
org.ek9lang.compiler.phase7.generator.OperationDfnGenerator
- All Implemented Interfaces:
BiConsumer<OperationInstr, EK9Parser.OperationDetailsContext>
public final class OperationDfnGenerator
extends AbstractGenerator
implements BiConsumer<OperationInstr, EK9Parser.OperationDetailsContext>
Deals with the generation of the IR for OperationDetails.
This is used quite widely by many of the constructs defined in the grammar.
methods, operators, etc. In various construct types.
But the context for this is only for methods/operators that do actually have processing defined. Note, that in Ek9 it is possible to use the 'default' reserved word to get EK9 to generate the appropriate functionality. For example '?' _isSet can be auto generated if the properties on the aggregate have the '?' _isSet Operator.
This processing does NOT deal with that.
-
Field Summary
Fields inherited from class AbstractGenerator
stackContext, symbolTypeOrException, typeNameOrException, variableNameForIR -
Constructor Summary
ConstructorsConstructorDescriptionOperationDfnGenerator(IRGenerationContext stackContext, GeneratorSet generators) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(OperationInstr operation, EK9Parser.OperationDetailsContext ctx) voidaccept(OperationInstr operation, EK9Parser.OperationDetailsContext ctx, List<IRInstr> beforeInstanceInit) accept(OperationInstr, EK9Parser.OperationDetailsContext), withbeforeInstanceInit- THE capture stores of a dynamic class's explicit capture constructor (CaptureStores,support/IsCaptureConstructor) - placed while the body is built: just after the constructor's super(...) call, implicit or explicit, or first when it has none or delegates with this(...) - so before every_i_initit runs and outside the partial-construction region (D10).voidacceptInMethodFrame(OperationInstr operation, EK9Parser.OperationDetailsContext ctx) THE operation in its own method frame (IR tidy W3.4, OPS-17): the frame named after the operation, with the debug info of its symbol's token, aroundaccept(OperationInstr, EK9Parser.OperationDetailsContext).voidacceptInMethodFrame(OperationInstr operation, EK9Parser.OperationDetailsContext ctx, List<IRInstr> beforeInstanceInit) acceptInMethodFrame(OperationInstr, EK9Parser.OperationDetailsContext)for a dynamic class's explicit capture constructor, with its capture stores (accept(OperationInstr, EK9Parser.OperationDetailsContext, List)).Methods inherited from class AbstractGenerator
addCoverageProbe, createTempVariable, createTempVariableFromContext, getRecordedSymbolOrException, processBlockStatements, processBlockStatements, resultVariableOrTempMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiConsumer
andThen
-
Constructor Details
-
OperationDfnGenerator
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceBiConsumer<OperationInstr, EK9Parser.OperationDetailsContext>
-
accept
public void accept(OperationInstr operation, EK9Parser.OperationDetailsContext ctx, List<IRInstr> beforeInstanceInit) accept(OperationInstr, EK9Parser.OperationDetailsContext), withbeforeInstanceInit- THE capture stores of a dynamic class's explicit capture constructor (CaptureStores,support/IsCaptureConstructor) - placed while the body is built: just after the constructor's super(...) call, implicit or explicit, or first when it has none or delegates with this(...) - so before every_i_initit runs and outside the partial-construction region (D10). Empty for every other operation. -
acceptInMethodFrame
THE operation in its own method frame (IR tidy W3.4, OPS-17): the frame named after the operation, with the debug info of its symbol's token, aroundaccept(OperationInstr, EK9Parser.OperationDetailsContext). Every driver of a method, operator or function body calls this - only a program's main is generated in its construct's frame (OPS-14), throughaccept(OperationInstr, EK9Parser.OperationDetailsContext)itself. -
acceptInMethodFrame
public void acceptInMethodFrame(OperationInstr operation, EK9Parser.OperationDetailsContext ctx, List<IRInstr> beforeInstanceInit) acceptInMethodFrame(OperationInstr, EK9Parser.OperationDetailsContext)for a dynamic class's explicit capture constructor, with its capture stores (accept(OperationInstr, EK9Parser.OperationDetailsContext, List)).
-