Modifier and Type | Class and Description |
---|---|
class |
Node.NodeIterator
Iterates over the children of this Node.
|
Modifier and Type | Field and Description |
---|---|
static int |
ATTRIBUTE_FLAG |
static int |
BOTH |
static int |
CASEARRAY_PROP |
static int |
CATCH_SCOPE_PROP |
static int |
CONTROL_BLOCK_PROP |
static int |
DECR_FLAG |
static int |
DESCENDANTS_FLAG |
static int |
DESTRUCTURING_ARRAY_LENGTH |
static int |
DESTRUCTURING_NAMES |
static int |
DESTRUCTURING_PARAMS |
static int |
DESTRUCTURING_SHORTHAND |
static int |
DIRECTCALL_PROP |
static int |
END_DROPS_OFF |
static int |
END_RETURNS |
static int |
END_RETURNS_VALUE |
static int |
END_UNREACHED
These flags enumerate the possible ways a statement/function can
terminate.
|
static int |
END_YIELDS |
static int |
EXPRESSION_CLOSURE_PROP |
static int |
FUNCTION_PROP |
static int |
GENERATOR_END_PROP |
static int |
INCRDECR_PROP |
static int |
ISNUMBER_PROP |
static int |
JSDOC_PROP |
static int |
LABEL_ID_PROP |
static int |
LAST_PROP |
static int |
LEFT |
static int |
LOCAL_BLOCK_PROP |
static int |
LOCAL_PROP |
static int |
MEMBER_TYPE_PROP |
static int |
NAME_PROP |
static int |
NON_SPECIALCALL |
static int |
OBJECT_IDS_PROP |
static int |
PARENTHESIZED_PROP |
static int |
POST_FLAG |
static int |
PROPERTY_FLAG |
static int |
REGEXP_PROP |
static int |
RIGHT |
static int |
SKIP_INDEXES_PROP |
static int |
SPECIALCALL_EVAL |
static int |
SPECIALCALL_PROP |
static int |
SPECIALCALL_WITH |
static int |
TARGETBLOCK_PROP |
static int |
VARIABLE_PROP |
Constructor and Description |
---|
Node(int nodeType) |
Node(int nodeType,
int line) |
Node(int nodeType,
Node child) |
Node(int nodeType,
Node child,
int line) |
Node(int nodeType,
Node left,
Node right) |
Node(int nodeType,
Node left,
Node right,
int line) |
Node(int nodeType,
Node left,
Node mid,
Node right) |
Node(int nodeType,
Node left,
Node mid,
Node right,
int line) |
Modifier and Type | Method and Description |
---|---|
void |
addChildAfter(Node newChild,
Node node)
Add 'child' after 'node'.
|
void |
addChildBefore(Node newChild,
Node node)
Add 'child' before 'node'.
|
void |
addChildrenToBack(Node children) |
void |
addChildrenToFront(Node children) |
void |
addChildToBack(Node child) |
void |
addChildToFront(Node child) |
Node |
getChildBefore(Node child) |
double |
getDouble()
Can only be called when getType() == Token.NUMBER
|
int |
getExistingIntProp(int propType) |
Node |
getFirstChild() |
int |
getIntProp(int propType,
int defaultValue) |
java.lang.String |
getJsDoc()
Gets the JsDoc comment string attached to this node.
|
Comment |
getJsDocNode()
Gets the JsDoc Comment object attached to this node.
|
Node |
getLastChild() |
Node |
getLastSibling() |
int |
getLineno()
Return the line number recorded for this node.
|
Node |
getNext() |
java.lang.Object |
getProp(int propType) |
Scope |
getScope()
Can only be called when node has String context.
|
java.lang.String |
getString()
Can only be called when node has String context.
|
int |
getType() |
boolean |
hasChildren() |
boolean |
hasConsistentReturnUsage()
Checks that every return usage in a function body is consistent with the
requirements of strict-mode.
|
boolean |
hasSideEffects() |
java.util.Iterator<Node> |
iterator()
Returns an
Iterator over the node's children. |
int |
labelId() |
void |
labelId(int labelId) |
static Node |
newNumber(double number) |
static Node |
newString(int type,
java.lang.String str) |
static Node |
newString(java.lang.String str) |
static Node |
newTarget() |
void |
putIntProp(int propType,
int prop) |
void |
putProp(int propType,
java.lang.Object prop) |
void |
removeChild(Node child) |
void |
removeChildren() |
void |
removeProp(int propType) |
void |
replaceChild(Node child,
Node newChild) |
void |
replaceChildAfter(Node prevChild,
Node newChild) |
void |
resetTargets()
Recursively unlabel every TARGET or YIELD node in the tree.
|
void |
setDouble(double number) |
void |
setJsDocNode(Comment jsdocNode)
Sets the JsDoc comment string attached to this node.
|
void |
setLineno(int lineno) |
void |
setScope(Scope s)
Can only be called when node has String context.
|
void |
setString(java.lang.String s)
Can only be called when node has String context.
|
Node |
setType(int type)
Sets the node type and returns this node.
|
java.lang.String |
toString() |
java.lang.String |
toStringTree(ScriptNode treeTop) |
public static final int FUNCTION_PROP
public static final int LOCAL_PROP
public static final int LOCAL_BLOCK_PROP
public static final int REGEXP_PROP
public static final int CASEARRAY_PROP
public static final int TARGETBLOCK_PROP
public static final int VARIABLE_PROP
public static final int ISNUMBER_PROP
public static final int DIRECTCALL_PROP
public static final int SPECIALCALL_PROP
public static final int SKIP_INDEXES_PROP
public static final int OBJECT_IDS_PROP
public static final int INCRDECR_PROP
public static final int CATCH_SCOPE_PROP
public static final int LABEL_ID_PROP
public static final int MEMBER_TYPE_PROP
public static final int NAME_PROP
public static final int CONTROL_BLOCK_PROP
public static final int PARENTHESIZED_PROP
public static final int GENERATOR_END_PROP
public static final int DESTRUCTURING_ARRAY_LENGTH
public static final int DESTRUCTURING_NAMES
public static final int DESTRUCTURING_PARAMS
public static final int JSDOC_PROP
public static final int EXPRESSION_CLOSURE_PROP
public static final int DESTRUCTURING_SHORTHAND
public static final int LAST_PROP
public static final int BOTH
public static final int LEFT
public static final int RIGHT
public static final int NON_SPECIALCALL
public static final int SPECIALCALL_EVAL
public static final int SPECIALCALL_WITH
public static final int DECR_FLAG
public static final int POST_FLAG
public static final int PROPERTY_FLAG
public static final int ATTRIBUTE_FLAG
public static final int DESCENDANTS_FLAG
public static final int END_UNREACHED
public static final int END_DROPS_OFF
public static final int END_RETURNS
public static final int END_RETURNS_VALUE
public static final int END_YIELDS
public Node(int nodeType)
public Node(int nodeType, Node child)
public Node(int nodeType, int line)
public Node(int nodeType, Node child, int line)
public static Node newNumber(double number)
public static Node newString(java.lang.String str)
public static Node newString(int type, java.lang.String str)
public int getType()
public Node setType(int type)
public java.lang.String getJsDoc()
null
if no JsDoc is attached to
this nodepublic Comment getJsDocNode()
null
if no JsDoc is attached to
this nodepublic void setJsDocNode(Comment jsdocNode)
public boolean hasChildren()
public Node getFirstChild()
public Node getLastChild()
public Node getNext()
public Node getLastSibling()
public void addChildToFront(Node child)
public void addChildToBack(Node child)
public void addChildrenToFront(Node children)
public void addChildrenToBack(Node children)
public void removeChild(Node child)
public void removeChildren()
public java.util.Iterator<Node> iterator()
Iterator
over the node's children.iterator
in interface java.lang.Iterable<Node>
public void removeProp(int propType)
public java.lang.Object getProp(int propType)
public int getIntProp(int propType, int defaultValue)
public int getExistingIntProp(int propType)
public void putProp(int propType, java.lang.Object prop)
public void putIntProp(int propType, int prop)
public int getLineno()
public void setLineno(int lineno)
public final double getDouble()
public final void setDouble(double number)
public final java.lang.String getString()
public final void setString(java.lang.String s)
public Scope getScope()
public void setScope(Scope s)
public static Node newTarget()
public final int labelId()
public void labelId(int labelId)
public boolean hasConsistentReturnUsage()
public boolean hasSideEffects()
public void resetTargets()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringTree(ScriptNode treeTop)
Copyright © 2010 - 2020 Adobe. All Rights Reserved