org.jetbrains.kotlin.cfg
Class ControlFlowBuilderAdapter
java.lang.Object
org.jetbrains.kotlin.cfg.ControlFlowBuilderAdapter
- All Implemented Interfaces:
- ControlFlowBuilder
- Direct Known Subclasses:
- ControlFlowInstructionsGenerator
public abstract class ControlFlowBuilderAdapter
- extends java.lang.Object
- implements ControlFlowBuilder
Method Summary |
void |
bindLabel(Label label)
|
void |
bindValue(PseudoValue value,
KtElement element)
|
CallInstruction |
call(KtElement valueElement,
ResolvedCall<?> resolvedCall,
java.util.Map<PseudoValue,ReceiverValue> receiverValues,
java.util.Map<PseudoValue,ValueParameterDescriptor> arguments)
|
InstructionWithValue |
createAnonymousObject(KtObjectLiteralExpression expression)
|
InstructionWithValue |
createLambda(KtFunction expression)
|
Label |
createUnboundLabel()
|
Label |
createUnboundLabel(java.lang.String name)
|
void |
declareFunction(KtElement subroutine,
Pseudocode pseudocode)
|
void |
declareParameter(KtParameter parameter)
|
void |
declareVariable(KtVariableDeclaration property)
|
void |
enterLexicalScope(KtElement element)
|
LoopInfo |
enterLoop(KtLoopExpression expression)
|
void |
enterLoopBody(KtLoopExpression expression)
|
void |
enterSubroutine(KtElement subroutine)
|
void |
enterTryFinally(GenerationTrigger trigger)
|
void |
exitLexicalScope(KtElement element)
|
void |
exitLoopBody(KtLoopExpression expression)
|
Pseudocode |
exitSubroutine(KtElement subroutine)
|
void |
exitTryFinally()
|
PseudoValue |
getBoundValue(KtElement element)
|
Label |
getConditionEntryPoint(KtElement labelElement)
|
KtLoopExpression |
getCurrentLoop()
|
KtElement |
getCurrentSubroutine()
|
protected abstract ControlFlowBuilder |
getDelegateBuilder()
|
Label |
getEntryPoint(KtElement labelElement)
|
Label |
getExitPoint(KtElement labelElement)
|
KtElement |
getReturnSubroutine()
|
void |
jump(Label label,
KtElement element)
|
void |
jumpOnFalse(Label label,
KtElement element,
PseudoValue conditionValue)
|
void |
jumpOnTrue(Label label,
KtElement element,
PseudoValue conditionValue)
|
void |
jumpToError(KtElement element)
|
InstructionWithValue |
loadConstant(KtExpression expression,
constant)
|
InstructionWithValue |
loadStringTemplate(KtStringTemplateExpression expression,
java.util.List<PseudoValue> inputValues)
|
void |
loadUnit(KtExpression expression)
|
MagicInstruction |
magic(KtElement instructionElement,
KtElement valueElement,
java.util.List<PseudoValue> inputValues,
MagicKind kind)
|
void |
mark(KtElement element)
|
MergeInstruction |
merge(KtExpression expression,
java.util.List<PseudoValue> inputValues)
|
PseudoValue |
newValue(KtElement element)
|
void |
nondeterministicJump(Label label,
KtElement element,
PseudoValue inputValue)
|
void |
nondeterministicJump(java.util.List<Label> labels,
KtElement element)
|
OperationInstruction |
predefinedOperation(KtExpression expression,
ControlFlowBuilder.PredefinedOperation operation,
java.util.List<PseudoValue> inputValues)
|
ReadValueInstruction |
readVariable(KtExpression expression,
ResolvedCall<?> resolvedCall,
java.util.Map<PseudoValue,ReceiverValue> receiverValues)
|
void |
repeatPseudocode(Label startLabel,
Label finishLabel)
|
void |
returnNoValue(KtReturnExpression returnExpression,
KtElement subroutine)
|
void |
returnValue(KtExpression returnExpression,
PseudoValue returnValue,
KtElement subroutine)
|
void |
throwException(KtThrowExpression throwExpression,
PseudoValue thrownValue)
|
void |
write(KtElement assignment,
KtElement lValue,
PseudoValue rValue,
AccessTarget target,
java.util.Map<PseudoValue,ReceiverValue> receiverValues)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ControlFlowBuilderAdapter
public ControlFlowBuilderAdapter()
getDelegateBuilder
@NotNull
protected abstract ControlFlowBuilder getDelegateBuilder()
loadUnit
public void loadUnit(@NotNull
KtExpression expression)
- Specified by:
loadUnit
in interface ControlFlowBuilder
loadConstant
@NotNull
public InstructionWithValue loadConstant(@NotNull
KtExpression expression,
@Nullable
constant)
- Specified by:
loadConstant
in interface ControlFlowBuilder
createAnonymousObject
@NotNull
public InstructionWithValue createAnonymousObject(@NotNull
KtObjectLiteralExpression expression)
- Specified by:
createAnonymousObject
in interface ControlFlowBuilder
createLambda
@NotNull
public InstructionWithValue createLambda(@NotNull
KtFunction expression)
- Specified by:
createLambda
in interface ControlFlowBuilder
loadStringTemplate
@NotNull
public InstructionWithValue loadStringTemplate(@NotNull
KtStringTemplateExpression expression,
@NotNull
java.util.List<PseudoValue> inputValues)
- Specified by:
loadStringTemplate
in interface ControlFlowBuilder
magic
@NotNull
public MagicInstruction magic(@NotNull
KtElement instructionElement,
@Nullable
KtElement valueElement,
@NotNull
java.util.List<PseudoValue> inputValues,
@NotNull
MagicKind kind)
- Specified by:
magic
in interface ControlFlowBuilder
merge
@NotNull
public MergeInstruction merge(@NotNull
KtExpression expression,
@NotNull
java.util.List<PseudoValue> inputValues)
- Specified by:
merge
in interface ControlFlowBuilder
readVariable
@NotNull
public ReadValueInstruction readVariable(@NotNull
KtExpression expression,
@NotNull
ResolvedCall<?> resolvedCall,
@NotNull
java.util.Map<PseudoValue,ReceiverValue> receiverValues)
- Specified by:
readVariable
in interface ControlFlowBuilder
call
@NotNull
public CallInstruction call(@NotNull
KtElement valueElement,
@NotNull
ResolvedCall<?> resolvedCall,
@NotNull
java.util.Map<PseudoValue,ReceiverValue> receiverValues,
@NotNull
java.util.Map<PseudoValue,ValueParameterDescriptor> arguments)
- Specified by:
call
in interface ControlFlowBuilder
predefinedOperation
@NotNull
public OperationInstruction predefinedOperation(@NotNull
KtExpression expression,
@NotNull
ControlFlowBuilder.PredefinedOperation operation,
@NotNull
java.util.List<PseudoValue> inputValues)
- Specified by:
predefinedOperation
in interface ControlFlowBuilder
createUnboundLabel
@NotNull
public Label createUnboundLabel()
- Specified by:
createUnboundLabel
in interface ControlFlowBuilder
createUnboundLabel
@NotNull
public Label createUnboundLabel(@NotNull
java.lang.String name)
- Specified by:
createUnboundLabel
in interface ControlFlowBuilder
bindLabel
public void bindLabel(@NotNull
Label label)
- Specified by:
bindLabel
in interface ControlFlowBuilder
jump
public void jump(@NotNull
Label label,
@NotNull
KtElement element)
- Specified by:
jump
in interface ControlFlowBuilder
jumpOnFalse
public void jumpOnFalse(@NotNull
Label label,
@NotNull
KtElement element,
@Nullable
PseudoValue conditionValue)
- Specified by:
jumpOnFalse
in interface ControlFlowBuilder
jumpOnTrue
public void jumpOnTrue(@NotNull
Label label,
@NotNull
KtElement element,
@Nullable
PseudoValue conditionValue)
- Specified by:
jumpOnTrue
in interface ControlFlowBuilder
nondeterministicJump
public void nondeterministicJump(@NotNull
Label label,
@NotNull
KtElement element,
@Nullable
PseudoValue inputValue)
- Specified by:
nondeterministicJump
in interface ControlFlowBuilder
nondeterministicJump
public void nondeterministicJump(@NotNull
java.util.List<Label> labels,
@NotNull
KtElement element)
- Specified by:
nondeterministicJump
in interface ControlFlowBuilder
jumpToError
public void jumpToError(@NotNull
KtElement element)
- Specified by:
jumpToError
in interface ControlFlowBuilder
throwException
public void throwException(@NotNull
KtThrowExpression throwExpression,
@NotNull
PseudoValue thrownValue)
- Specified by:
throwException
in interface ControlFlowBuilder
getEntryPoint
@NotNull
public Label getEntryPoint(@NotNull
KtElement labelElement)
- Specified by:
getEntryPoint
in interface ControlFlowBuilder
getExitPoint
@NotNull
public Label getExitPoint(@NotNull
KtElement labelElement)
- Specified by:
getExitPoint
in interface ControlFlowBuilder
getConditionEntryPoint
@NotNull
public Label getConditionEntryPoint(@NotNull
KtElement labelElement)
- Specified by:
getConditionEntryPoint
in interface ControlFlowBuilder
enterLoop
@NotNull
public LoopInfo enterLoop(@NotNull
KtLoopExpression expression)
- Specified by:
enterLoop
in interface ControlFlowBuilder
enterLoopBody
public void enterLoopBody(@NotNull
KtLoopExpression expression)
- Specified by:
enterLoopBody
in interface ControlFlowBuilder
exitLoopBody
public void exitLoopBody(@NotNull
KtLoopExpression expression)
- Specified by:
exitLoopBody
in interface ControlFlowBuilder
getCurrentLoop
@Nullable
public KtLoopExpression getCurrentLoop()
- Specified by:
getCurrentLoop
in interface ControlFlowBuilder
enterTryFinally
public void enterTryFinally(@NotNull
GenerationTrigger trigger)
- Specified by:
enterTryFinally
in interface ControlFlowBuilder
exitTryFinally
public void exitTryFinally()
- Specified by:
exitTryFinally
in interface ControlFlowBuilder
enterSubroutine
public void enterSubroutine(@NotNull
KtElement subroutine)
- Specified by:
enterSubroutine
in interface ControlFlowBuilder
exitSubroutine
@NotNull
public Pseudocode exitSubroutine(@NotNull
KtElement subroutine)
- Specified by:
exitSubroutine
in interface ControlFlowBuilder
getCurrentSubroutine
@NotNull
public KtElement getCurrentSubroutine()
- Specified by:
getCurrentSubroutine
in interface ControlFlowBuilder
getReturnSubroutine
@Nullable
public KtElement getReturnSubroutine()
- Specified by:
getReturnSubroutine
in interface ControlFlowBuilder
returnValue
public void returnValue(@NotNull
KtExpression returnExpression,
@NotNull
PseudoValue returnValue,
@NotNull
KtElement subroutine)
- Specified by:
returnValue
in interface ControlFlowBuilder
returnNoValue
public void returnNoValue(@NotNull
KtReturnExpression returnExpression,
@NotNull
KtElement subroutine)
- Specified by:
returnNoValue
in interface ControlFlowBuilder
write
public void write(@NotNull
KtElement assignment,
@NotNull
KtElement lValue,
@NotNull
PseudoValue rValue,
@NotNull
AccessTarget target,
@NotNull
java.util.Map<PseudoValue,ReceiverValue> receiverValues)
- Specified by:
write
in interface ControlFlowBuilder
declareParameter
public void declareParameter(@NotNull
KtParameter parameter)
- Specified by:
declareParameter
in interface ControlFlowBuilder
declareVariable
public void declareVariable(@NotNull
KtVariableDeclaration property)
- Specified by:
declareVariable
in interface ControlFlowBuilder
declareFunction
public void declareFunction(@NotNull
KtElement subroutine,
@NotNull
Pseudocode pseudocode)
- Specified by:
declareFunction
in interface ControlFlowBuilder
repeatPseudocode
public void repeatPseudocode(@NotNull
Label startLabel,
@NotNull
Label finishLabel)
- Specified by:
repeatPseudocode
in interface ControlFlowBuilder
mark
public void mark(@NotNull
KtElement element)
- Specified by:
mark
in interface ControlFlowBuilder
getBoundValue
@Nullable
public PseudoValue getBoundValue(@Nullable
KtElement element)
- Specified by:
getBoundValue
in interface ControlFlowBuilder
bindValue
public void bindValue(@NotNull
PseudoValue value,
@NotNull
KtElement element)
- Specified by:
bindValue
in interface ControlFlowBuilder
newValue
@NotNull
public PseudoValue newValue(@Nullable
KtElement element)
- Specified by:
newValue
in interface ControlFlowBuilder
enterLexicalScope
public void enterLexicalScope(@NotNull
KtElement element)
- Specified by:
enterLexicalScope
in interface ControlFlowBuilder
exitLexicalScope
public void exitLexicalScope(@NotNull
KtElement element)
- Specified by:
exitLexicalScope
in interface ControlFlowBuilder