org.jetbrains.kotlin.js.translate.context
Class TranslationContext
java.lang.Object
org.jetbrains.kotlin.js.translate.context.TranslationContext
public class TranslationContext
- extends java.lang.Object
All the info about the state of the translation process.
Method Summary |
void |
addStatementsToCurrentBlockFrom(JsBlock block)
|
void |
addStatementsToCurrentBlockFrom(TranslationContext context)
|
void |
addStatementToCurrentBlock(JsStatement statement)
|
AliasingContext |
aliasingContext()
|
void |
associateExpressionToLazyValue(JsExpression expression,
TemporaryConstVariable temporaryConstVariable)
|
BindingContext |
bindingContext()
|
BindingTrace |
bindingTrace()
|
TranslationContext |
contextWithScope(JsFunction fun)
|
boolean |
currentBlockIsEmpty()
|
JsName |
declarePropertyOrPropertyAccessorName(DeclarationDescriptor descriptor,
java.lang.String name,
boolean fresh)
|
TemporaryVariable |
declareTemporary(JsExpression initExpression)
|
JsNameRef |
define(DeclarationDescriptor descriptor,
JsExpression expression)
|
DynamicContext |
dynamicContext()
|
JsExpression |
getAliasForDescriptor(DeclarationDescriptor descriptor)
|
JsBlock |
getBlockForDescriptor(DeclarationDescriptor descriptor)
|
Config |
getConfig()
|
JsBlock |
getCurrentBlock()
|
JsExpression |
getDispatchReceiver(ReceiverParameterDescriptor descriptor)
|
JsExpression |
getEmptyExpression()
|
JsFunction |
getFunctionObject(CallableDescriptor descriptor)
|
JsName |
getNameForDescriptor(DeclarationDescriptor descriptor)
|
JsName |
getNameForElement(com.intellij.psi.PsiElement element)
|
JsName |
getNameForPackage(FqName fqName)
|
TemporaryConstVariable |
getOrDeclareTemporaryConstVariable(JsExpression expression)
|
JsNameRef |
getQualifiedReference(DeclarationDescriptor descriptor)
|
JsNameRef |
getQualifiedReference(FqName packageFqName)
|
JsExpression |
getQualifierForDescriptor(DeclarationDescriptor descriptor)
|
ReflectionTypes |
getReflectionTypes()
|
JsScope |
getScopeForDescriptor(DeclarationDescriptor descriptor)
|
TranslationContext |
innerBlock()
|
TranslationContext |
innerBlock(JsBlock block)
|
TranslationContext |
innerContextWithAliased(DeclarationDescriptor correspondingDescriptor,
JsExpression alias)
|
TranslationContext |
innerContextWithAliasesForExpressions(java.util.Map<KtExpression,JsExpression> aliases)
|
TranslationContext |
innerContextWithDescriptorsAliased(java.util.Map<DeclarationDescriptor,JsExpression> aliases)
|
Intrinsics |
intrinsics()
|
void |
moveVarsFrom(TranslationContext context)
|
Namer |
namer()
|
TranslationContext |
newDeclaration(DeclarationDescriptor descriptor,
DefinitionPlace place)
|
TranslationContext |
newFunctionBody(JsFunction fun,
AliasingContext aliasingContext)
|
TranslationContext |
newFunctionBodyWithUsageTracker(JsFunction fun,
MemberDescriptor descriptor)
|
JsProgram |
program()
|
static TranslationContext |
rootContext(StaticContext staticContext,
JsFunction rootFunction)
|
JsScope |
scope()
|
UsageTracker |
usageTracker()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
rootContext
@NotNull
public static TranslationContext rootContext(@NotNull
StaticContext staticContext,
JsFunction rootFunction)
usageTracker
@Nullable
public UsageTracker usageTracker()
dynamicContext
@NotNull
public DynamicContext dynamicContext()
contextWithScope
@NotNull
public TranslationContext contextWithScope(@NotNull
JsFunction fun)
newFunctionBody
@NotNull
public TranslationContext newFunctionBody(@NotNull
JsFunction fun,
@Nullable
AliasingContext aliasingContext)
newFunctionBodyWithUsageTracker
@NotNull
public TranslationContext newFunctionBodyWithUsageTracker(@NotNull
JsFunction fun,
@NotNull
MemberDescriptor descriptor)
innerBlock
@NotNull
public TranslationContext innerBlock(@NotNull
JsBlock block)
innerBlock
@NotNull
public TranslationContext innerBlock()
newDeclaration
@NotNull
public TranslationContext newDeclaration(@NotNull
DeclarationDescriptor descriptor,
@Nullable
DefinitionPlace place)
innerContextWithAliased
@NotNull
public TranslationContext innerContextWithAliased(@NotNull
DeclarationDescriptor correspondingDescriptor,
@NotNull
JsExpression alias)
innerContextWithAliasesForExpressions
@NotNull
public TranslationContext innerContextWithAliasesForExpressions(@NotNull
java.util.Map<KtExpression,JsExpression> aliases)
innerContextWithDescriptorsAliased
@NotNull
public TranslationContext innerContextWithDescriptorsAliased(@NotNull
java.util.Map<DeclarationDescriptor,JsExpression> aliases)
getBlockForDescriptor
@NotNull
public JsBlock getBlockForDescriptor(@NotNull
DeclarationDescriptor descriptor)
bindingContext
@NotNull
public BindingContext bindingContext()
bindingTrace
@NotNull
public BindingTrace bindingTrace()
getScopeForDescriptor
@NotNull
public JsScope getScopeForDescriptor(@NotNull
DeclarationDescriptor descriptor)
getNameForElement
@NotNull
public JsName getNameForElement(@NotNull
com.intellij.psi.PsiElement element)
getNameForDescriptor
@NotNull
public JsName getNameForDescriptor(@NotNull
DeclarationDescriptor descriptor)
getNameForPackage
@NotNull
public JsName getNameForPackage(@NotNull
FqName fqName)
declarePropertyOrPropertyAccessorName
@NotNull
public JsName declarePropertyOrPropertyAccessorName(@NotNull
DeclarationDescriptor descriptor,
@NotNull
java.lang.String name,
boolean fresh)
getQualifiedReference
@NotNull
public JsNameRef getQualifiedReference(@NotNull
DeclarationDescriptor descriptor)
getQualifiedReference
@NotNull
public JsNameRef getQualifiedReference(@NotNull
FqName packageFqName)
getQualifierForDescriptor
@Nullable
public JsExpression getQualifierForDescriptor(@NotNull
DeclarationDescriptor descriptor)
declareTemporary
@NotNull
public TemporaryVariable declareTemporary(@Nullable
JsExpression initExpression)
getOrDeclareTemporaryConstVariable
@NotNull
public TemporaryConstVariable getOrDeclareTemporaryConstVariable(@NotNull
JsExpression expression)
associateExpressionToLazyValue
public void associateExpressionToLazyValue(JsExpression expression,
TemporaryConstVariable temporaryConstVariable)
namer
@NotNull
public Namer namer()
intrinsics
@NotNull
public Intrinsics intrinsics()
getReflectionTypes
@NotNull
public ReflectionTypes getReflectionTypes()
program
@NotNull
public JsProgram program()
getConfig
@NotNull
public Config getConfig()
scope
@NotNull
public JsScope scope()
aliasingContext
@NotNull
public AliasingContext aliasingContext()
getFunctionObject
@NotNull
public JsFunction getFunctionObject(@NotNull
CallableDescriptor descriptor)
addStatementToCurrentBlock
public void addStatementToCurrentBlock(@NotNull
JsStatement statement)
addStatementsToCurrentBlockFrom
public void addStatementsToCurrentBlockFrom(@NotNull
TranslationContext context)
addStatementsToCurrentBlockFrom
public void addStatementsToCurrentBlockFrom(@NotNull
JsBlock block)
currentBlockIsEmpty
public boolean currentBlockIsEmpty()
moveVarsFrom
public void moveVarsFrom(@NotNull
TranslationContext context)
getCurrentBlock
@NotNull
public JsBlock getCurrentBlock()
getEmptyExpression
@NotNull
public JsExpression getEmptyExpression()
getAliasForDescriptor
@Nullable
public JsExpression getAliasForDescriptor(@NotNull
DeclarationDescriptor descriptor)
getDispatchReceiver
@NotNull
public JsExpression getDispatchReceiver(@NotNull
ReceiverParameterDescriptor descriptor)
define
@NotNull
public JsNameRef define(DeclarationDescriptor descriptor,
JsExpression expression)