Class OverriddenControlGenerator

java.lang.Object
org.kink_lang.kink.internal.compile.javaclassir.OverriddenControlGenerator
All Implemented Interfaces:
ControlGenerator

public class OverriddenControlGenerator extends Object implements ControlGenerator
Generates insns for controls for the case when intrinsic implementations cannot be used.
  • Constructor Details

    • OverriddenControlGenerator

      public OverriddenControlGenerator(Vm vm, String programName, String programText, KeyStrSupplier keySup, TraceAccumulator traceAccum)
      Constructs a generator.
      Parameters:
      vm - the vm.
      programName - the program name.
      programText - the program text.
      keySup - the key str supplier.
      traceAccum - the trace accumulator.
  • Method Details

    • preloadedIf

      public List<Insn> preloadedIf(IfItree itree, BiFunction<Itree,org.kink_lang.kink.internal.compile.javaclassir.ResultContext,List<Insn>> generate, org.kink_lang.kink.internal.compile.javaclassir.ResultContext resultCtx)
      Description copied from interface: ControlGenerator
      Generates insns of if preloaded fun.
      Specified by:
      preloadedIf in interface ControlGenerator
      Parameters:
      itree - the itree to compile.
      generate - generates insns of sub expressions.
      resultCtx - the result context of if.
      Returns:
      insns.
    • branch

      public List<Insn> branch(BranchItree itree, BiFunction<Itree,org.kink_lang.kink.internal.compile.javaclassir.ResultContext,List<Insn>> generate, org.kink_lang.kink.internal.compile.javaclassir.ResultContext resultCtx)
      Description copied from interface: ControlGenerator
      Generates insns of branch without else.
      Specified by:
      branch in interface ControlGenerator
      Parameters:
      itree - the itree to compile.
      generate - generates insns of sub expressions.
      resultCtx - the result context of branch.
      Returns:
      insns.
    • branchWithElse

      public List<Insn> branchWithElse(BranchWithElseItree itree, BiFunction<Itree,org.kink_lang.kink.internal.compile.javaclassir.ResultContext,List<Insn>> generate, org.kink_lang.kink.internal.compile.javaclassir.ResultContext resultCtx)
      Description copied from interface: ControlGenerator
      Generates insns of branch with else.
      Specified by:
      branchWithElse in interface ControlGenerator
      Parameters:
      itree - the itree to compile.
      generate - generates insns of sub expressions.
      resultCtx - the result context of branch.
      Returns:
      insns.
    • traitNewVal

      public List<Insn> traitNewVal(TraitNewValItree itree, BiFunction<Itree,org.kink_lang.kink.internal.compile.javaclassir.ResultContext,List<Insn>> generate, org.kink_lang.kink.internal.compile.javaclassir.ResultContext resultCtx)
      Description copied from interface: ControlGenerator
      Generates insns of new_val with trait.
      Specified by:
      traitNewVal in interface ControlGenerator
      Parameters:
      itree - the itree to compile.
      generate - generates insns of sub expressions.
      resultCtx - the result context of new_val.
      Returns:
      insns.
    • noTraitNewVal

      public List<Insn> noTraitNewVal(NoTraitNewValItree itree, BiFunction<Itree,org.kink_lang.kink.internal.compile.javaclassir.ResultContext,List<Insn>> generate, org.kink_lang.kink.internal.compile.javaclassir.ResultContext resultCtx)
      Description copied from interface: ControlGenerator
      Generates insns of new_val without trait.
      Specified by:
      noTraitNewVal in interface ControlGenerator
      Parameters:
      itree - the itree to compile.
      generate - generates insns of sub expressions.
      resultCtx - the result context of new_val.
      Returns:
      insns.