Class DynamicConstructEmitter

java.lang.Object
org.ek9lang.compiler.phase7.generator.AbstractGenerator
org.ek9lang.compiler.phase7.generator.DynamicConstructEmitter

public final class DynamicConstructEmitter extends AbstractGenerator
THE emission of a dynamic class or dynamic function where it is written (INFRA-2): generate its construct in a fresh IRContext (counter isolation), add the construct to the IR module, evaluate the captured expressions, then construct it with those captured values.

The two forms differ in three things only, so those are the parameters: how the construct is generated, the debug info of the construction, and the metadata of the constructor (which SynthesisedCallMetaData factory describes it).

  • Constructor Details

  • Method Details

    • emit

      public <T extends ICanCaptureVariables & ISymbol> List<IRInstr> emit(T dynamicSymbol, Function<IRGenerationContext, IRConstruct> generate, EK9Parser.DynamicVariableCaptureContext captureCtx, DebugInfo debugInfo, String resultVariable, Function<List<ISymbol>, CallMetaDataDetails> metaData)
      Emit the dynamic construct and the instructions that construct it.
      Parameters:
      dynamicSymbol - The dynamic function or class - this parameterisation's own copy inside a generic body.
      generate - Generates the construct, given the nested context to generate it in.
      captureCtx - The construct's capture list (may be null for none).
      debugInfo - Debug info of the construction.
      resultVariable - The variable that receives the constructed object.
      metaData - The constructor's metadata, given the constructor's own parameter types.
      Returns:
      the capture evaluation and the constructor call