org.jetbrains.k2js.translate.context
Class TranslationContext

java.lang.Object
  extended by org.jetbrains.k2js.translate.context.TranslationContext

public class TranslationContext
extends java.lang.Object

All the info about the state of the translation process.


Method Summary
 void addStatementToCurrentBlock(JsStatement statement)
           
 AliasingContext aliasingContext()
           
 void associateExpressionToLazyValue(JsExpression expression, TemporaryConstVariable temporaryConstVariable)
           
 BindingContext bindingContext()
           
 TranslationContext contextWithScope(JsFunction fun)
           
 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)
           
 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)
           
 JsNameRef getQualifierForDescriptor(DeclarationDescriptor descriptor)
           
 JsScope getScopeForDescriptor(DeclarationDescriptor descriptor)
           
 JsExpression getThisObject(ReceiverParameterDescriptor descriptor)
           
 TranslationContext innerBlock(JsBlock block)
           
 TranslationContext innerContextWithAliased(DeclarationDescriptor correspondingDescriptor, JsExpression alias)
           
 TranslationContext innerContextWithAliasesForExpressions(java.util.Map<JetExpression,JsExpression> aliases)
           
 TranslationContext innerContextWithDescriptorsAliased(java.util.Map<DeclarationDescriptor,JsExpression> aliases)
           
 Intrinsics intrinsics()
           
 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
 

Method Detail

rootContext

@NotNull
public static TranslationContext rootContext(@NotNull
                                                     StaticContext staticContext,
                                                     JsFunction rootFunction)

usageTracker

@Nullable
public UsageTracker usageTracker()

dynamicContext

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)

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<JetExpression,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()

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 JsNameRef 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()

program

@NotNull
public JsProgram program()

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)

getAliasForDescriptor

@Nullable
public JsExpression getAliasForDescriptor(@NotNull
                                                   DeclarationDescriptor descriptor)

getThisObject

@NotNull
public JsExpression getThisObject(@NotNull
                                          ReceiverParameterDescriptor descriptor)

define

@NotNull
public JsNameRef define(DeclarationDescriptor descriptor,
                                JsExpression expression)