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(com.google.dart.compiler.backend.js.ast.JsStatement statement)
           
 AliasingContext aliasingContext()
           
 void associateExpressionToLazyValue(com.google.dart.compiler.backend.js.ast.JsExpression expression, TemporaryConstVariable temporaryConstVariable)
           
 BindingContext bindingContext()
           
 TranslationContext contextWithScope(com.google.dart.compiler.backend.js.ast.JsFunction fun)
           
 TemporaryVariable declareTemporary(com.google.dart.compiler.backend.js.ast.JsExpression initExpression)
           
 DynamicContext dynamicContext()
           
 com.google.dart.compiler.backend.js.ast.JsExpression getAliasForDescriptor(DeclarationDescriptor descriptor)
           
 com.google.dart.compiler.backend.js.ast.JsBlock getBlockForDescriptor(DeclarationDescriptor descriptor)
           
 com.google.dart.compiler.backend.js.ast.JsFunction getFunctionObject(CallableDescriptor descriptor)
           
 com.google.dart.compiler.backend.js.ast.JsName getNameForDescriptor(DeclarationDescriptor descriptor)
           
 com.google.dart.compiler.backend.js.ast.JsName getNameForElement(com.intellij.psi.PsiElement element)
           
 TemporaryConstVariable getOrDeclareTemporaryConstVariable(com.google.dart.compiler.backend.js.ast.JsExpression expression)
           
 com.google.dart.compiler.backend.js.ast.JsNameRef getQualifierForDescriptor(DeclarationDescriptor descriptor)
           
 com.google.dart.compiler.backend.js.ast.JsScope getScopeForDescriptor(DeclarationDescriptor descriptor)
           
 com.google.dart.compiler.backend.js.ast.JsExpression getThisObject(DeclarationDescriptor descriptor)
           
 TranslationContext innerBlock(com.google.dart.compiler.backend.js.ast.JsBlock block)
           
 TranslationContext innerContextWithAliasesForExpressions(java.util.Map<JetExpression,com.google.dart.compiler.backend.js.ast.JsName> aliases)
           
 TranslationContext innerContextWithDescriptorsAliased(java.util.Map<DeclarationDescriptor,com.google.dart.compiler.backend.js.ast.JsExpression> aliases)
           
 TranslationContext innerContextWithThisAliased(DeclarationDescriptor correspondingDescriptor, com.google.dart.compiler.backend.js.ast.JsNameRef alias)
           
 Intrinsics intrinsics()
           
 boolean isEcma5()
           
 LiteralFunctionTranslator literalFunctionTranslator()
           
 Namer namer()
           
 com.google.dart.compiler.backend.js.ast.JsStringLiteral nameToLiteral(Named named)
           
 TranslationContext newDeclaration(DeclarationDescriptor descriptor)
           
 TranslationContext newFunctionBody(com.google.dart.compiler.backend.js.ast.JsFunction fun, AliasingContext aliasingContext, UsageTracker usageTracker)
           
 com.google.dart.compiler.backend.js.ast.JsProgram program()
           
static TranslationContext rootContext(StaticContext staticContext, com.google.dart.compiler.backend.js.ast.JsFunction rootFunction)
           
 com.google.dart.compiler.backend.js.ast.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,
                                                     com.google.dart.compiler.backend.js.ast.JsFunction rootFunction)

isEcma5

public boolean isEcma5()

usageTracker

public UsageTracker usageTracker()

dynamicContext

public DynamicContext dynamicContext()

contextWithScope

@NotNull
public TranslationContext contextWithScope(@NotNull
                                                   com.google.dart.compiler.backend.js.ast.JsFunction fun)

newFunctionBody

@NotNull
public TranslationContext newFunctionBody(@NotNull
                                                  com.google.dart.compiler.backend.js.ast.JsFunction fun,
                                                  @Nullable
                                                  AliasingContext aliasingContext,
                                                  @Nullable
                                                  UsageTracker usageTracker)

innerBlock

@NotNull
public TranslationContext innerBlock(@NotNull
                                             com.google.dart.compiler.backend.js.ast.JsBlock block)

newDeclaration

@NotNull
public TranslationContext newDeclaration(@NotNull
                                                 DeclarationDescriptor descriptor)

innerContextWithThisAliased

@NotNull
public TranslationContext innerContextWithThisAliased(@NotNull
                                                              DeclarationDescriptor correspondingDescriptor,
                                                              @NotNull
                                                              com.google.dart.compiler.backend.js.ast.JsNameRef alias)

innerContextWithAliasesForExpressions

@NotNull
public TranslationContext innerContextWithAliasesForExpressions(@NotNull
                                                                        java.util.Map<JetExpression,com.google.dart.compiler.backend.js.ast.JsName> aliases)

innerContextWithDescriptorsAliased

@NotNull
public TranslationContext innerContextWithDescriptorsAliased(@NotNull
                                                                     java.util.Map<DeclarationDescriptor,com.google.dart.compiler.backend.js.ast.JsExpression> aliases)

getBlockForDescriptor

@NotNull
public com.google.dart.compiler.backend.js.ast.JsBlock getBlockForDescriptor(@NotNull
                                                                                     DeclarationDescriptor descriptor)

bindingContext

@NotNull
public BindingContext bindingContext()

getScopeForDescriptor

@NotNull
public com.google.dart.compiler.backend.js.ast.JsScope getScopeForDescriptor(@NotNull
                                                                                     DeclarationDescriptor descriptor)

getNameForElement

@NotNull
public com.google.dart.compiler.backend.js.ast.JsName getNameForElement(@NotNull
                                                                                com.intellij.psi.PsiElement element)

getNameForDescriptor

@NotNull
public com.google.dart.compiler.backend.js.ast.JsName getNameForDescriptor(@NotNull
                                                                                   DeclarationDescriptor descriptor)

nameToLiteral

@NotNull
public com.google.dart.compiler.backend.js.ast.JsStringLiteral nameToLiteral(@NotNull
                                                                                     Named named)

getQualifierForDescriptor

@Nullable
public com.google.dart.compiler.backend.js.ast.JsNameRef getQualifierForDescriptor(@NotNull
                                                                                            DeclarationDescriptor descriptor)

declareTemporary

@NotNull
public TemporaryVariable declareTemporary(@Nullable
                                                  com.google.dart.compiler.backend.js.ast.JsExpression initExpression)

getOrDeclareTemporaryConstVariable

@NotNull
public TemporaryConstVariable getOrDeclareTemporaryConstVariable(@NotNull
                                                                         com.google.dart.compiler.backend.js.ast.JsExpression expression)

associateExpressionToLazyValue

public void associateExpressionToLazyValue(com.google.dart.compiler.backend.js.ast.JsExpression expression,
                                           TemporaryConstVariable temporaryConstVariable)

namer

@NotNull
public Namer namer()

intrinsics

@NotNull
public Intrinsics intrinsics()

program

@NotNull
public com.google.dart.compiler.backend.js.ast.JsProgram program()

scope

@NotNull
public com.google.dart.compiler.backend.js.ast.JsScope scope()

aliasingContext

@NotNull
public AliasingContext aliasingContext()

literalFunctionTranslator

@NotNull
public LiteralFunctionTranslator literalFunctionTranslator()

getFunctionObject

@NotNull
public com.google.dart.compiler.backend.js.ast.JsFunction getFunctionObject(@NotNull
                                                                                    CallableDescriptor descriptor)

addStatementToCurrentBlock

public void addStatementToCurrentBlock(@NotNull
                                       com.google.dart.compiler.backend.js.ast.JsStatement statement)

getAliasForDescriptor

public com.google.dart.compiler.backend.js.ast.JsExpression getAliasForDescriptor(@NotNull
                                                                                  DeclarationDescriptor descriptor)

getThisObject

@NotNull
public com.google.dart.compiler.backend.js.ast.JsExpression getThisObject(@NotNull
                                                                                  DeclarationDescriptor descriptor)