org.jetbrains.k2js.translate.utils
Class JsAstUtils

java.lang.Object
  extended by org.jetbrains.k2js.translate.utils.JsAstUtils

public final class JsAstUtils
extends java.lang.Object


Field Summary
static com.google.dart.compiler.backend.js.ast.JsNameRef CREATE_OBJECT
           
 
Method Summary
static com.google.dart.compiler.backend.js.ast.JsBinaryOperation addAssign(com.google.dart.compiler.backend.js.ast.JsExpression left, com.google.dart.compiler.backend.js.ast.JsExpression right)
           
static com.google.dart.compiler.backend.js.ast.JsBinaryOperation and(com.google.dart.compiler.backend.js.ast.JsExpression op1, com.google.dart.compiler.backend.js.ast.JsExpression op2)
           
static com.google.dart.compiler.backend.js.ast.JsExpression assignment(com.google.dart.compiler.backend.js.ast.JsExpression left, com.google.dart.compiler.backend.js.ast.JsExpression right)
           
static com.google.dart.compiler.backend.js.ast.JsBlock convertToBlock(com.google.dart.compiler.backend.js.ast.JsNode jsNode)
           
static com.google.dart.compiler.backend.js.ast.JsExpression convertToExpression(com.google.dart.compiler.backend.js.ast.JsNode jsNode)
           
static com.google.dart.compiler.backend.js.ast.JsStatement convertToStatement(com.google.dart.compiler.backend.js.ast.JsNode jsNode)
           
static com.google.dart.compiler.backend.js.ast.JsObjectLiteral createDataDescriptor(com.google.dart.compiler.backend.js.ast.JsExpression value)
           
static com.google.dart.compiler.backend.js.ast.JsObjectLiteral createDataDescriptor(com.google.dart.compiler.backend.js.ast.JsExpression value, boolean writable)
           
static com.google.dart.compiler.backend.js.ast.JsFunction createFunctionWithEmptyBody(com.google.dart.compiler.backend.js.ast.JsScope parent)
           
static com.google.dart.compiler.backend.js.ast.JsFunction createPackage(java.util.List<com.google.dart.compiler.backend.js.ast.JsStatement> to, com.google.dart.compiler.backend.js.ast.JsScope scope)
           
static com.google.dart.compiler.backend.js.ast.JsObjectLiteral createPropertyDataDescriptor(FunctionDescriptor descriptor, com.google.dart.compiler.backend.js.ast.JsExpression value)
           
static com.google.dart.compiler.backend.js.ast.JsObjectLiteral createPropertyDataDescriptor(PropertyDescriptor descriptor, com.google.dart.compiler.backend.js.ast.JsExpression value)
           
static com.google.dart.compiler.backend.js.ast.JsInvocation defineProperty(java.lang.String name, com.google.dart.compiler.backend.js.ast.JsObjectLiteral value, TranslationContext context)
           
static com.google.dart.compiler.backend.js.ast.JsInvocation definePropertyDataDescriptor(PropertyDescriptor descriptor, com.google.dart.compiler.backend.js.ast.JsExpression value, TranslationContext context)
           
static com.google.dart.compiler.backend.js.ast.JsStatement defineSimpleProperty(java.lang.String name, com.google.dart.compiler.backend.js.ast.JsExpression value, TranslationContext context)
           
static com.google.dart.compiler.backend.js.ast.JsBinaryOperation equality(com.google.dart.compiler.backend.js.ast.JsExpression arg1, com.google.dart.compiler.backend.js.ast.JsExpression arg2)
           
static com.google.dart.compiler.backend.js.ast.JsFor generateForExpression(com.google.dart.compiler.backend.js.ast.JsVars initExpression, com.google.dart.compiler.backend.js.ast.JsExpression condition, com.google.dart.compiler.backend.js.ast.JsExpression incrementExpression, com.google.dart.compiler.backend.js.ast.JsStatement body)
           
static com.google.dart.compiler.backend.js.ast.JsBinaryOperation inequality(com.google.dart.compiler.backend.js.ast.JsExpression arg1, com.google.dart.compiler.backend.js.ast.JsExpression arg2)
           
static com.google.dart.compiler.backend.js.ast.JsBinaryOperation lessThanEq(com.google.dart.compiler.backend.js.ast.JsExpression arg1, com.google.dart.compiler.backend.js.ast.JsExpression arg2)
           
static com.google.dart.compiler.backend.js.ast.JsPrefixOperation negated(com.google.dart.compiler.backend.js.ast.JsExpression expression)
           
static com.google.dart.compiler.backend.js.ast.JsExpression newSequence(java.util.List<com.google.dart.compiler.backend.js.ast.JsExpression> expressions)
           
static com.google.dart.compiler.backend.js.ast.JsVars newVar(com.google.dart.compiler.backend.js.ast.JsName name, com.google.dart.compiler.backend.js.ast.JsExpression expr)
           
static com.google.dart.compiler.backend.js.ast.JsPrefixOperation not(com.google.dart.compiler.backend.js.ast.JsExpression expression)
           
static com.google.dart.compiler.backend.js.ast.JsBinaryOperation or(com.google.dart.compiler.backend.js.ast.JsExpression op1, com.google.dart.compiler.backend.js.ast.JsExpression op2)
           
static void setArguments(com.google.dart.compiler.backend.js.ast.HasArguments invocation, com.google.dart.compiler.backend.js.ast.JsExpression... arguments)
           
static void setArguments(com.google.dart.compiler.backend.js.ast.HasArguments invocation, java.util.List<com.google.dart.compiler.backend.js.ast.JsExpression> newArgs)
           
static void setArguments(com.google.dart.compiler.backend.js.ast.JsInvocation invocation, java.util.List<com.google.dart.compiler.backend.js.ast.JsExpression> newArgs)
           
static void setParameters(com.google.dart.compiler.backend.js.ast.JsFunction function, java.util.List<com.google.dart.compiler.backend.js.ast.JsParameter> newParams)
           
static void setQualifier(com.google.dart.compiler.backend.js.ast.JsExpression selector, com.google.dart.compiler.backend.js.ast.JsExpression receiver)
           
static com.google.dart.compiler.backend.js.ast.JsBinaryOperation subtract(com.google.dart.compiler.backend.js.ast.JsExpression left, com.google.dart.compiler.backend.js.ast.JsExpression right)
           
static com.google.dart.compiler.backend.js.ast.JsBinaryOperation sum(com.google.dart.compiler.backend.js.ast.JsExpression left, com.google.dart.compiler.backend.js.ast.JsExpression right)
           
static java.util.List<com.google.dart.compiler.backend.js.ast.JsExpression> toStringLiteralList(java.util.List<java.lang.String> strings, com.google.dart.compiler.backend.js.ast.JsProgram program)
           
static com.google.dart.compiler.backend.js.ast.JsBinaryOperation typeof(com.google.dart.compiler.backend.js.ast.JsExpression expression, com.google.dart.compiler.backend.js.ast.JsStringLiteral string)
           
static com.google.dart.compiler.backend.js.ast.JsObjectLiteral wrapValue(com.google.dart.compiler.backend.js.ast.JsExpression label, com.google.dart.compiler.backend.js.ast.JsExpression value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CREATE_OBJECT

public static final com.google.dart.compiler.backend.js.ast.JsNameRef CREATE_OBJECT
Method Detail

convertToStatement

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsStatement convertToStatement(@NotNull
                                                                                             com.google.dart.compiler.backend.js.ast.JsNode jsNode)

convertToBlock

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsBlock convertToBlock(@NotNull
                                                                                     com.google.dart.compiler.backend.js.ast.JsNode jsNode)

convertToExpression

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsExpression convertToExpression(@NotNull
                                                                                               com.google.dart.compiler.backend.js.ast.JsNode jsNode)

negated

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsPrefixOperation negated(@NotNull
                                                                                        com.google.dart.compiler.backend.js.ast.JsExpression expression)

and

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsBinaryOperation and(@NotNull
                                                                                    com.google.dart.compiler.backend.js.ast.JsExpression op1,
                                                                                    @NotNull
                                                                                    com.google.dart.compiler.backend.js.ast.JsExpression op2)

or

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsBinaryOperation or(@NotNull
                                                                                   com.google.dart.compiler.backend.js.ast.JsExpression op1,
                                                                                   @NotNull
                                                                                   com.google.dart.compiler.backend.js.ast.JsExpression op2)

setQualifier

public static void setQualifier(@NotNull
                                com.google.dart.compiler.backend.js.ast.JsExpression selector,
                                @Nullable
                                com.google.dart.compiler.backend.js.ast.JsExpression receiver)

equality

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsBinaryOperation equality(@NotNull
                                                                                         com.google.dart.compiler.backend.js.ast.JsExpression arg1,
                                                                                         @NotNull
                                                                                         com.google.dart.compiler.backend.js.ast.JsExpression arg2)

inequality

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsBinaryOperation inequality(@NotNull
                                                                                           com.google.dart.compiler.backend.js.ast.JsExpression arg1,
                                                                                           @NotNull
                                                                                           com.google.dart.compiler.backend.js.ast.JsExpression arg2)

lessThanEq

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsBinaryOperation lessThanEq(@NotNull
                                                                                           com.google.dart.compiler.backend.js.ast.JsExpression arg1,
                                                                                           @NotNull
                                                                                           com.google.dart.compiler.backend.js.ast.JsExpression arg2)

assignment

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsExpression assignment(@NotNull
                                                                                      com.google.dart.compiler.backend.js.ast.JsExpression left,
                                                                                      @NotNull
                                                                                      com.google.dart.compiler.backend.js.ast.JsExpression right)

sum

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsBinaryOperation sum(@NotNull
                                                                                    com.google.dart.compiler.backend.js.ast.JsExpression left,
                                                                                    @NotNull
                                                                                    com.google.dart.compiler.backend.js.ast.JsExpression right)

addAssign

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsBinaryOperation addAssign(@NotNull
                                                                                          com.google.dart.compiler.backend.js.ast.JsExpression left,
                                                                                          @NotNull
                                                                                          com.google.dart.compiler.backend.js.ast.JsExpression right)

subtract

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsBinaryOperation subtract(@NotNull
                                                                                         com.google.dart.compiler.backend.js.ast.JsExpression left,
                                                                                         @NotNull
                                                                                         com.google.dart.compiler.backend.js.ast.JsExpression right)

not

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsPrefixOperation not(@NotNull
                                                                                    com.google.dart.compiler.backend.js.ast.JsExpression expression)

typeof

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsBinaryOperation typeof(@NotNull
                                                                                       com.google.dart.compiler.backend.js.ast.JsExpression expression,
                                                                                       @NotNull
                                                                                       com.google.dart.compiler.backend.js.ast.JsStringLiteral string)

generateForExpression

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsFor generateForExpression(@NotNull
                                                                                          com.google.dart.compiler.backend.js.ast.JsVars initExpression,
                                                                                          @NotNull
                                                                                          com.google.dart.compiler.backend.js.ast.JsExpression condition,
                                                                                          @NotNull
                                                                                          com.google.dart.compiler.backend.js.ast.JsExpression incrementExpression,
                                                                                          @NotNull
                                                                                          com.google.dart.compiler.backend.js.ast.JsStatement body)

newVar

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsVars newVar(@NotNull
                                                                            com.google.dart.compiler.backend.js.ast.JsName name,
                                                                            @Nullable
                                                                            com.google.dart.compiler.backend.js.ast.JsExpression expr)

setArguments

public static void setArguments(@NotNull
                                com.google.dart.compiler.backend.js.ast.JsInvocation invocation,
                                @NotNull
                                java.util.List<com.google.dart.compiler.backend.js.ast.JsExpression> newArgs)

setArguments

public static void setArguments(@NotNull
                                com.google.dart.compiler.backend.js.ast.HasArguments invocation,
                                @NotNull
                                java.util.List<com.google.dart.compiler.backend.js.ast.JsExpression> newArgs)

setArguments

public static void setArguments(@NotNull
                                com.google.dart.compiler.backend.js.ast.HasArguments invocation,
                                com.google.dart.compiler.backend.js.ast.JsExpression... arguments)

setParameters

public static void setParameters(@NotNull
                                 com.google.dart.compiler.backend.js.ast.JsFunction function,
                                 @NotNull
                                 java.util.List<com.google.dart.compiler.backend.js.ast.JsParameter> newParams)

newSequence

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsExpression newSequence(@NotNull
                                                                                       java.util.List<com.google.dart.compiler.backend.js.ast.JsExpression> expressions)

createFunctionWithEmptyBody

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsFunction createFunctionWithEmptyBody(@NotNull
                                                                                                     com.google.dart.compiler.backend.js.ast.JsScope parent)

toStringLiteralList

@NotNull
public static java.util.List<com.google.dart.compiler.backend.js.ast.JsExpression> toStringLiteralList(@NotNull
                                                                                                               java.util.List<java.lang.String> strings,
                                                                                                               @NotNull
                                                                                                               com.google.dart.compiler.backend.js.ast.JsProgram program)

definePropertyDataDescriptor

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsInvocation definePropertyDataDescriptor(@NotNull
                                                                                                        PropertyDescriptor descriptor,
                                                                                                        @NotNull
                                                                                                        com.google.dart.compiler.backend.js.ast.JsExpression value,
                                                                                                        @NotNull
                                                                                                        TranslationContext context)

defineProperty

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsInvocation defineProperty(@NotNull
                                                                                          java.lang.String name,
                                                                                          @NotNull
                                                                                          com.google.dart.compiler.backend.js.ast.JsObjectLiteral value,
                                                                                          @NotNull
                                                                                          TranslationContext context)

defineSimpleProperty

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsStatement defineSimpleProperty(@NotNull
                                                                                               java.lang.String name,
                                                                                               @NotNull
                                                                                               com.google.dart.compiler.backend.js.ast.JsExpression value,
                                                                                               @NotNull
                                                                                               TranslationContext context)

createPropertyDataDescriptor

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsObjectLiteral createPropertyDataDescriptor(@NotNull
                                                                                                           FunctionDescriptor descriptor,
                                                                                                           @NotNull
                                                                                                           com.google.dart.compiler.backend.js.ast.JsExpression value)

createDataDescriptor

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsObjectLiteral createDataDescriptor(@NotNull
                                                                                                   com.google.dart.compiler.backend.js.ast.JsExpression value)

createDataDescriptor

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsObjectLiteral createDataDescriptor(@NotNull
                                                                                                   com.google.dart.compiler.backend.js.ast.JsExpression value,
                                                                                                   boolean writable)

createPropertyDataDescriptor

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsObjectLiteral createPropertyDataDescriptor(@NotNull
                                                                                                           PropertyDescriptor descriptor,
                                                                                                           @NotNull
                                                                                                           com.google.dart.compiler.backend.js.ast.JsExpression value)

createPackage

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsFunction createPackage(@NotNull
                                                                                       java.util.List<com.google.dart.compiler.backend.js.ast.JsStatement> to,
                                                                                       @NotNull
                                                                                       com.google.dart.compiler.backend.js.ast.JsScope scope)

wrapValue

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsObjectLiteral wrapValue(@NotNull
                                                                                        com.google.dart.compiler.backend.js.ast.JsExpression label,
                                                                                        @NotNull
                                                                                        com.google.dart.compiler.backend.js.ast.JsExpression value)