Module org.kink_lang.kink
Class OverriddenControlGenerator
java.lang.Object
org.kink_lang.kink.internal.compile.javaclassir.OverriddenControlGenerator
- All Implemented Interfaces:
ControlGenerator
Generates insns for controls for the case when
intrinsic implementations cannot be used.
-
Constructor Summary
ConstructorDescriptionOverriddenControlGenerator
(Vm vm, String programName, String programText, KeyStrSupplier keySup, TraceAccumulator traceAccum) Constructs a generator. -
Method Summary
Modifier and TypeMethodDescriptionbranch
(BranchItree itree, BiFunction<Itree, org.kink_lang.kink.internal.compile.javaclassir.ResultContext, List<Insn>> generate, org.kink_lang.kink.internal.compile.javaclassir.ResultContext resultCtx) Generates insns of branch without else.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) Generates insns of branch with else.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) Generates insns of new_val without trait.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) Generates insns ofif
preloaded fun.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) Generates insns of new_val with trait.
-
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 ofif
preloaded fun.- Specified by:
preloadedIf
in interfaceControlGenerator
- Parameters:
itree
- the itree to compile.generate
- generates insns of sub expressions.resultCtx
- the result context ofif
.- 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 interfaceControlGenerator
- 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 interfaceControlGenerator
- 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 interfaceControlGenerator
- 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 interfaceControlGenerator
- Parameters:
itree
- the itree to compile.generate
- generates insns of sub expressions.resultCtx
- the result context of new_val.- Returns:
- insns.
-