Class UnchangedControlGenerator

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

public class UnchangedControlGenerator extends Object implements ControlGenerator
Generator of intrinsic implementation of control.
  • Constructor Details

    • UnchangedControlGenerator

      public UnchangedControlGenerator(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.