org.jetbrains.k2js.translate.utils
Class JsAstUtils
java.lang.Object
org.jetbrains.k2js.translate.utils.JsAstUtils
public final class JsAstUtils
- extends java.lang.Object
Method Summary |
static JsBinaryOperation |
addAssign(JsExpression left,
JsExpression right)
|
static JsBinaryOperation |
and(JsExpression op1,
JsExpression op2)
|
static JsExpression |
assignment(JsExpression left,
JsExpression right)
|
static JsBlock |
convertToBlock(JsNode jsNode)
|
static JsExpression |
convertToExpression(JsNode jsNode)
|
static JsStatement |
convertToStatement(JsNode jsNode)
|
static JsObjectLiteral |
createDataDescriptor(JsExpression value,
boolean writable,
boolean enumerable)
|
static JsFunction |
createFunctionWithEmptyBody(JsScope parent)
|
static JsFunction |
createPackage(java.util.List<JsStatement> to,
JsScope scope)
|
static JsInvocation |
defineProperty(java.lang.String name,
JsObjectLiteral value,
TranslationContext context)
|
static JsStatement |
defineSimpleProperty(java.lang.String name,
JsExpression value)
|
static JsBinaryOperation |
equality(JsExpression arg1,
JsExpression arg2)
|
static JsBinaryOperation |
inequality(JsExpression arg1,
JsExpression arg2)
|
static JsBinaryOperation |
lessThanEq(JsExpression arg1,
JsExpression arg2)
|
static JsPrefixOperation |
negated(JsExpression expression)
|
static JsExpression |
newSequence(java.util.List<JsExpression> expressions)
|
static JsVars |
newVar(JsName name,
JsExpression expr)
|
static JsPrefixOperation |
not(JsExpression expression)
|
static JsBinaryOperation |
or(JsExpression op1,
JsExpression op2)
|
static void |
replaceRootReference(JsNameRef fullQualifier,
JsExpression newQualifier)
|
static void |
setArguments(HasArguments invocation,
JsExpression... arguments)
|
static void |
setArguments(HasArguments invocation,
java.util.List<JsExpression> newArgs)
|
static void |
setParameters(JsFunction function,
java.util.List<JsParameter> newParams)
|
static void |
setQualifier(JsExpression selector,
JsExpression receiver)
|
static JsBinaryOperation |
subtract(JsExpression left,
JsExpression right)
|
static JsBinaryOperation |
sum(JsExpression left,
JsExpression right)
|
static java.util.List<JsExpression> |
toStringLiteralList(java.util.List<java.lang.String> strings,
JsProgram program)
|
static JsBinaryOperation |
typeof(JsExpression expression,
JsStringLiteral string)
|
static JsObjectLiteral |
wrapValue(JsExpression label,
JsExpression value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CREATE_OBJECT
public static final JsNameRef CREATE_OBJECT
LENDS_JS_DOC_TAG
public static final java.lang.String LENDS_JS_DOC_TAG
- See Also:
- Constant Field Values
convertToStatement
@NotNull
public static JsStatement convertToStatement(@NotNull
JsNode jsNode)
convertToBlock
@NotNull
public static JsBlock convertToBlock(@NotNull
JsNode jsNode)
convertToExpression
@NotNull
public static JsExpression convertToExpression(@NotNull
JsNode jsNode)
negated
@NotNull
public static JsPrefixOperation negated(@NotNull
JsExpression expression)
and
@NotNull
public static JsBinaryOperation and(@NotNull
JsExpression op1,
@NotNull
JsExpression op2)
or
@NotNull
public static JsBinaryOperation or(@NotNull
JsExpression op1,
@NotNull
JsExpression op2)
setQualifier
public static void setQualifier(@NotNull
JsExpression selector,
@Nullable
JsExpression receiver)
equality
@NotNull
public static JsBinaryOperation equality(@NotNull
JsExpression arg1,
@NotNull
JsExpression arg2)
inequality
@NotNull
public static JsBinaryOperation inequality(@NotNull
JsExpression arg1,
@NotNull
JsExpression arg2)
lessThanEq
@NotNull
public static JsBinaryOperation lessThanEq(@NotNull
JsExpression arg1,
@NotNull
JsExpression arg2)
assignment
@NotNull
public static JsExpression assignment(@NotNull
JsExpression left,
@NotNull
JsExpression right)
sum
@NotNull
public static JsBinaryOperation sum(@NotNull
JsExpression left,
@NotNull
JsExpression right)
addAssign
@NotNull
public static JsBinaryOperation addAssign(@NotNull
JsExpression left,
@NotNull
JsExpression right)
subtract
@NotNull
public static JsBinaryOperation subtract(@NotNull
JsExpression left,
@NotNull
JsExpression right)
not
@NotNull
public static JsPrefixOperation not(@NotNull
JsExpression expression)
typeof
@NotNull
public static JsBinaryOperation typeof(@NotNull
JsExpression expression,
@NotNull
JsStringLiteral string)
newVar
@NotNull
public static JsVars newVar(@NotNull
JsName name,
@Nullable
JsExpression expr)
setArguments
public static void setArguments(@NotNull
HasArguments invocation,
@NotNull
java.util.List<JsExpression> newArgs)
setArguments
public static void setArguments(@NotNull
HasArguments invocation,
JsExpression... arguments)
setParameters
public static void setParameters(@NotNull
JsFunction function,
@NotNull
java.util.List<JsParameter> newParams)
newSequence
@NotNull
public static JsExpression newSequence(@NotNull
java.util.List<JsExpression> expressions)
createFunctionWithEmptyBody
@NotNull
public static JsFunction createFunctionWithEmptyBody(@NotNull
JsScope parent)
toStringLiteralList
@NotNull
public static java.util.List<JsExpression> toStringLiteralList(@NotNull
java.util.List<java.lang.String> strings,
@NotNull
JsProgram program)
defineProperty
@NotNull
public static JsInvocation defineProperty(@NotNull
java.lang.String name,
@NotNull
JsObjectLiteral value,
@NotNull
TranslationContext context)
defineSimpleProperty
@NotNull
public static JsStatement defineSimpleProperty(@NotNull
java.lang.String name,
@NotNull
JsExpression value)
createDataDescriptor
@NotNull
public static JsObjectLiteral createDataDescriptor(@NotNull
JsExpression value,
boolean writable,
boolean enumerable)
createPackage
@NotNull
public static JsFunction createPackage(@NotNull
java.util.List<JsStatement> to,
@NotNull
JsScope scope)
wrapValue
@NotNull
public static JsObjectLiteral wrapValue(@NotNull
JsExpression label,
@NotNull
JsExpression value)
replaceRootReference
public static void replaceRootReference(@NotNull
JsNameRef fullQualifier,
@NotNull
JsExpression newQualifier)