public class Node extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
Node.AncestorIterable
Iterator to go up the ancestor tree.
|
static class |
Node.SideEffectFlags
A helper class for getting and setting the side-effect flags.
|
static class |
Node.TypeDeclarationNode
Represents a node in the type declaration AST.
|
Modifier and Type | Field and Description |
---|---|
static int |
ACCESS_MODIFIER |
static int |
ADDED_BLOCK |
static int |
ANALYZED_DURING_GTI |
static int |
ARROW_FN |
static int |
CHANGE_TIME |
static int |
COLUMN_BITS
COLUMN_BITS represents how many of the lower-order bits of
sourcePosition are reserved for storing the column number.
|
static int |
COLUMN_MASK
COLUMN_MASK stores a value where bits storing the column number
are set, and bits storing the line are not set.
|
static int |
COMPUTED_PROP_GETTER |
static int |
COMPUTED_PROP_METHOD |
static int |
COMPUTED_PROP_SETTER |
static int |
COMPUTED_PROP_VARIABLE |
static int |
CONSTANT_PROPERTY_DEF |
static int |
CONSTRUCT_SIGNATURE |
static int |
COOKED_STRING |
static int |
DECLARED_TYPE_EXPR |
static int |
DECR_FLAG |
static int |
DIRECT_EVAL |
static int |
DIRECTIVES |
static int |
EXPORT_ALL_FROM |
static int |
EXPORT_DEFAULT |
static int |
FLAG_ARGUMENTS_UNMODIFIED |
static int |
FLAG_GLOBAL_STATE_UNMODIFIED |
static int |
FLAG_LOCAL_RESULTS |
static int |
FLAG_NO_THROWS |
static int |
FLAG_THIS_UNMODIFIED |
static int |
FREE_CALL |
static int |
GENERATOR_FN |
static int |
GENERATOR_MARKER |
static int |
GENERATOR_SAFE |
static int |
GENERIC_TYPE_LIST |
static int |
IMPLEMENTS |
static int |
INCRDECR_PROP |
static int |
INFERRED_FUNCTION |
static int |
INPUT_ID |
static int |
IS_CONSTANT_NAME |
static int |
IS_CONSTANT_VAR |
static int |
IS_NAMESPACE |
static int |
JSDOC_INFO_PROP |
static int |
LENGTH |
static int |
MAX_COLUMN_NUMBER
MAX_COLUMN_NUMBER represents the maximum column number that can
be represented.
|
static int |
NO_SIDE_EFFECTS |
static int |
OPT_ARG_NAME |
static int |
OPT_ES6_TYPED |
static int |
ORIGINALNAME_PROP |
static int |
POST_FLAG |
static int |
QUOTED_PROP |
static int |
RAW_STRING_VALUE |
static int |
REFLECTED_OBJECT |
static int |
SIDE_EFFECT_FLAGS |
static int |
SIDE_EFFECTS_ALL |
static int |
SIDE_EFFECTS_FLAGS_MASK |
static int |
SLASH_V |
static int |
STATIC_MEMBER |
static int |
STATIC_SOURCE_FILE |
static int |
SYNTHETIC_BLOCK_PROP |
static int |
TYPE_BEFORE_CAST |
static int |
VAR_ARGS_NAME |
static int |
YIELD_FOR |
Constructor and Description |
---|
Node(int nodeType) |
Node(int nodeType,
int lineno,
int charno) |
Node(int nodeType,
Node child) |
Node(int nodeType,
Node[] children) |
Node(int nodeType,
Node[] children,
int lineno,
int charno) |
Node(int nodeType,
Node child,
int lineno,
int charno) |
Node(int nodeType,
Node left,
Node right) |
Node(int nodeType,
Node left,
Node right,
int lineno,
int charno) |
Node(int nodeType,
Node left,
Node mid,
Node right) |
Node(int nodeType,
Node left,
Node mid,
Node right,
int lineno,
int charno) |
Node(int nodeType,
Node left,
Node mid,
Node mid2,
Node right) |
Node(int nodeType,
Node left,
Node mid,
Node mid2,
Node right,
int lineno,
int charno) |
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 |
addChildrenAfter(Node children,
Node node)
Add all children after 'node'.
|
void |
addChildrenToBack(Node children) |
void |
addChildrenToFront(Node children) |
void |
addChildToBack(Node child) |
void |
addChildToFront(Node child) |
void |
appendStringTree(Appendable appendable) |
String |
checkTreeEquals(Node actual)
Checks if the subtree under this node is the same as another subtree.
|
String |
checkTreeEqualsIncludingJsDoc(Node actual)
Checks if the subtree under this node is the same as another subtree.
|
Iterable<Node> |
children()
Return an iterable object that iterates over this node's children.
|
Node |
cloneNode() |
Node |
clonePropsFrom(Node other)
Clone the properties from the provided node without copying
the property object.
|
Node |
cloneTree() |
Node |
copyInformationFrom(Node other)
Copies source file and name information from the other
node given to the current node.
|
Node |
copyInformationFromForTree(Node other)
Copies source file and name information from the other node to the
entire tree rooted at this node.
|
void |
detachChildren()
Removes all children from this node and isolates the children from each
other.
|
Node |
detachFromParent()
Removes this node from its parent.
|
protected static int |
extractCharno(int lineCharNo)
Extracts the character number and character number from a merged line
char number (see
mergeLineCharNo(int, int) ). |
protected static int |
extractLineno(int lineCharNo)
Extracts the line number and character number from a merged line char
number (see
mergeLineCharNo(int, int) ). |
Node |
getAncestor(int level)
Gets the ancestor node relative to this.
|
Node.AncestorIterable |
getAncestors()
Iterates all of the node's ancestors excluding itself.
|
boolean |
getBooleanProp(int propType) |
int |
getChangeTime()
Returns the time of the last change for this node
|
int |
getCharno() |
Node |
getChildAtIndex(int i) |
Node |
getChildBefore(Node child) |
int |
getChildCount() |
Node.TypeDeclarationNode |
getDeclaredTypeExpression()
Returns the syntactical type specified on this node.
|
Set<String> |
getDirectives()
Returns the set of ES5 directives for this node.
|
double |
getDouble()
Can only be called when getType() == TokenStream.NUMBER
|
int |
getExistingIntProp(int propType) |
Node |
getFirstChild() |
int |
getIndexOfChild(Node child) |
InputId |
getInputId() |
int |
getIntProp(int propType)
Returns the integer value for the property, or 0 if the property
is not defined.
|
JSDocInfo |
getJSDocInfo()
Get the
JSDocInfo attached to this node. |
JSType |
getJSType()
Returns the compiled inferred type on this node.
|
JSType |
getJSTypeBeforeCast()
Returns the type of this node before casting.
|
Node |
getLastChild() |
Node |
getLastSibling() |
int |
getLength() |
int |
getLineno() |
Node |
getNext() |
Node |
getParent() |
Object |
getProp(int propType) |
String |
getQualifiedName()
This function takes a set of GETPROP nodes and produces a string that is
each property separated by dots.
|
int |
getSideEffectFlags()
Returns the side effects flags for this node.
|
String |
getSourceFileName() |
int |
getSourceOffset() |
int |
getSourcePosition() |
StaticSourceFile |
getStaticSourceFile()
Returns the source file associated with this input.
|
String |
getString()
Can only be called when node has String context.
|
int |
getType() |
TypeI |
getTypeI() |
boolean |
hasChild(Node child) |
boolean |
hasChildren() |
boolean |
hasMoreThanOneChild()
Check for more than one child more efficiently than by iterating over all
the children as is done with Node.getChildCount().
|
boolean |
hasOneChild()
Check for one child more efficiently than by iterating over all the
children as is done with Node.getChildCount().
|
boolean |
hasProps() |
boolean |
isAdd()
AST type check methods
|
boolean |
isAddedBlock()
Returns whether this is an added block that should not be considered
a real source block.
|
boolean |
isAnd() |
boolean |
isArrayLit() |
boolean |
isArrayPattern() |
boolean |
isArrowFunction()
Returns whether this node is a arrow function node.
|
boolean |
isAssign() |
boolean |
isAssignAdd() |
boolean |
isBlock() |
boolean |
isBreak() |
boolean |
isCall() |
boolean |
isCase() |
boolean |
isCast() |
boolean |
isCatch() |
boolean |
isClass() |
boolean |
isClassMembers() |
boolean |
isComma() |
boolean |
isComputedProp() |
boolean |
isConst() |
boolean |
isContinue() |
boolean |
isDebugger() |
boolean |
isDec() |
boolean |
isDefaultCase() |
boolean |
isDefaultValue() |
boolean |
isDelProp() |
boolean |
isDestructuringPattern() |
boolean |
isDo() |
boolean |
isEmpty() |
boolean |
isEquivalentTo(Node node)
Returns true if this node is equivalent semantically to another
|
boolean |
isEquivalentToShallow(Node node)
Checks equivalence without going into child nodes
|
boolean |
isEquivalentToTyped(Node node)
Returns true if this node is equivalent semantically to another and
the types are equivalent.
|
boolean |
isExport() |
boolean |
isExprResult() |
boolean |
isFalse() |
boolean |
isFor() |
boolean |
isForOf() |
boolean |
isFromExterns() |
boolean |
isFunction() |
boolean |
isGeneratorFunction()
Returns whether this node is a generator function node.
|
boolean |
isGeneratorMarker()
Returns whether this node is a marker used in the translation of generators.
|
boolean |
isGeneratorSafe()
Used when translating ES6 generators.
|
boolean |
isGetElem() |
boolean |
isGetProp() |
boolean |
isGetterDef() |
boolean |
isHook() |
boolean |
isIf() |
boolean |
isImport() |
boolean |
isIn() |
boolean |
isInc() |
boolean |
isIndexSignature() |
boolean |
isInstanceOf() |
boolean |
isInterfaceMembers() |
boolean |
isLabel() |
boolean |
isLabelName() |
boolean |
isLet() |
boolean |
isLocalResultCall()
Returns true if this node is a function or constructor call that
returns a primitive or a local object (an object that has no other
references).
|
boolean |
isMemberFunctionDef() |
boolean |
isMemberVariableDef() |
boolean |
isName() |
boolean |
isNE() |
boolean |
isNew() |
boolean |
isNoSideEffectsCall()
Returns true if this node is a function or constructor call that
has no side effects.
|
boolean |
isNot() |
boolean |
isNull() |
boolean |
isNumber() |
boolean |
isObjectLit() |
boolean |
isObjectPattern() |
boolean |
isOnlyModifiesArgumentsCall() |
boolean |
isOnlyModifiesThisCall() |
boolean |
isOptionalArg()
Returns whether this node is an optional argument node.
|
boolean |
isOr() |
boolean |
isParamList() |
boolean |
isQualifiedName()
Returns whether a node corresponds to a simple or a qualified name, such as
x or a.b.c or this.a . |
boolean |
isQuotedString()
This should only be called for STRING nodes children of OBJECTLIT.
|
boolean |
isRecordType() |
boolean |
isRegExp() |
boolean |
isRest() |
boolean |
isReturn() |
boolean |
isScript() |
boolean |
isSetterDef() |
boolean |
isSpread() |
boolean |
isStaticMember()
Returns whether this node is a static member node.
|
boolean |
isString() |
boolean |
isStringKey() |
boolean |
isSuper() |
boolean |
isSwitch() |
boolean |
isSyntheticBlock()
Returns whether this is a synthetic block that should not be considered
a real source block.
|
boolean |
isTaggedTemplateLit() |
boolean |
isTemplateLit() |
boolean |
isTemplateLitSub() |
boolean |
isThis() |
boolean |
isThrow() |
boolean |
isTrue() |
boolean |
isTry() |
boolean |
isTypeOf() |
boolean |
isUnscopedQualifiedName()
Returns whether a node corresponds to a simple or a qualified name without
a "this" reference, such as
a.b.c , but not this.a
. |
boolean |
isValidAssignmentTarget() |
boolean |
isVar() |
boolean |
isVarArgs()
Returns whether this node is a variable length argument node.
|
boolean |
isVoid() |
boolean |
isWhile() |
boolean |
isWith() |
boolean |
isYield() |
boolean |
isYieldFor()
Returns whether this node is a generator node.
|
boolean |
matchesQualifiedName(Node n)
Returns whether a node matches a simple or a qualified name, such as
x or a.b.c or this.a . |
boolean |
matchesQualifiedName(String name)
Returns whether a node matches a simple or a qualified name, such as
x or a.b.c or this.a . |
boolean |
mayMutateArguments()
Returns true if this is a new/call that may mutate its arguments.
|
boolean |
mayMutateGlobalStateOrThrow()
Returns true if this is a new/call that may mutate global state or throw.
|
protected static int |
mergeLineCharNo(int lineno,
int charno)
Merges the line number and character number in one integer.
|
static Node |
newNumber(double number) |
static Node |
newNumber(double number,
int lineno,
int charno) |
static Node |
newString(int type,
String str) |
static Node |
newString(int type,
String str,
int lineno,
int charno) |
static Node |
newString(String str) |
static Node |
newString(String str,
int lineno,
int charno) |
void |
putBooleanProp(int propType,
boolean value) |
void |
putIntProp(int propType,
int value) |
void |
putProp(int propType,
Object value) |
void |
removeChild(Node child)
Detach a child from its parent and siblings.
|
Node |
removeChildAfter(Node prev) |
Node |
removeChildren() |
Node |
removeFirstChild()
Removes the first child of Node.
|
void |
removeProp(int propType) |
void |
replaceChild(Node child,
Node newChild)
Detaches child from Node and replaces it with newChild.
|
void |
replaceChildAfter(Node prevChild,
Node newChild) |
void |
setChangeTime(int time)
This node was last changed at
time |
void |
setCharno(int charno) |
void |
setDeclaredTypeExpression(Node.TypeDeclarationNode typeExpression)
Sets the syntactical type specified on this node.
|
void |
setDirectives(Set<String> val)
Sets the ES5 directives on this node.
|
void |
setDouble(double value)
Can only be called when getType() == Token.NUMBER
|
void |
setGeneratorMarker(boolean isGeneratorMarker)
Sets whether this node is a marker used in the translation of generators.
|
void |
setGeneratorSafe(boolean isGeneratorSafe) |
void |
setInputId(InputId inputId) |
void |
setIsAddedBlock(boolean val)
Sets whether this is an added block that should not be considered
a real source block.
|
void |
setIsArrowFunction(boolean isArrow)
Sets whether this node is a arrow function node.
|
void |
setIsGeneratorFunction(boolean isGenerator)
Sets whether this node is a generator node.
|
void |
setIsSyntheticBlock(boolean val)
Sets whether this is a synthetic block that should not be considered
a real source block.
|
Node |
setJSDocInfo(JSDocInfo info)
Sets the
JSDocInfo attached to this node. |
void |
setJSType(JSType jsType) |
void |
setLength(int length) |
void |
setLineno(int lineno) |
void |
setOptionalArg(boolean optionalArg)
Sets whether this node is an optional argument node.
|
void |
setQuotedString()
This should only be called for STRING nodes children of OBJECTLIT.
|
void |
setSideEffectFlags(int flags)
Marks this function or constructor call's side effect flags.
|
void |
setSideEffectFlags(Node.SideEffectFlags flags) |
void |
setSourceEncodedPosition(int sourcePosition) |
void |
setSourceEncodedPositionForTree(int sourcePosition) |
void |
setSourceFileForTesting(String name)
Sets the source file to a non-extern file of the given name.
|
void |
setStaticMember(boolean isStatic)
Sets whether this node is a static member node.
|
void |
setStaticSourceFile(StaticSourceFile file) |
void |
setString(String value)
Can only be called for a Token.STRING or Token.NAME.
|
void |
setType(int type) |
void |
setTypeI(TypeI type) |
void |
setVarArgs(boolean varArgs)
Sets whether this node is a variable length argument node.
|
void |
setYieldFor(boolean isGenerator)
Sets whether this node is a generator node.
|
Iterable<Node> |
siblings()
Return an iterable object that iterates over this node's siblings,
including this Node.
|
Node |
srcref(Node other) |
Node |
srcrefTree(Node other) |
String |
toString() |
String |
toString(boolean printSource,
boolean printAnnotations,
boolean printType) |
String |
toStringTree() |
Node |
useSourceInfoFrom(Node other)
Overwrite all the source information in this node with
that of
other . |
Node |
useSourceInfoFromForTree(Node other)
Overwrite all the source information in this node and its subtree with
that of
other . |
Node |
useSourceInfoIfMissingFrom(Node other)
Overwrite all the source information in this node with
that of
other iff the source info is missing. |
Node |
useSourceInfoIfMissingFromForTree(Node other)
Overwrite all the source information in this node and its subtree with
that of
other iff the source info is missing. |
public static final int JSDOC_INFO_PROP
public static final int VAR_ARGS_NAME
public static final int INCRDECR_PROP
public static final int QUOTED_PROP
public static final int OPT_ARG_NAME
public static final int SYNTHETIC_BLOCK_PROP
public static final int ADDED_BLOCK
public static final int ORIGINALNAME_PROP
public static final int SIDE_EFFECT_FLAGS
public static final int IS_CONSTANT_NAME
public static final int IS_NAMESPACE
public static final int DIRECTIVES
public static final int DIRECT_EVAL
public static final int FREE_CALL
public static final int STATIC_SOURCE_FILE
public static final int LENGTH
public static final int INPUT_ID
public static final int SLASH_V
public static final int INFERRED_FUNCTION
public static final int CHANGE_TIME
public static final int REFLECTED_OBJECT
public static final int STATIC_MEMBER
public static final int GENERATOR_FN
public static final int ARROW_FN
public static final int YIELD_FOR
public static final int EXPORT_DEFAULT
public static final int EXPORT_ALL_FROM
public static final int IS_CONSTANT_VAR
public static final int GENERATOR_MARKER
public static final int GENERATOR_SAFE
public static final int COOKED_STRING
public static final int RAW_STRING_VALUE
public static final int COMPUTED_PROP_METHOD
public static final int COMPUTED_PROP_GETTER
public static final int COMPUTED_PROP_SETTER
public static final int COMPUTED_PROP_VARIABLE
public static final int ANALYZED_DURING_GTI
public static final int CONSTANT_PROPERTY_DEF
public static final int DECLARED_TYPE_EXPR
public static final int TYPE_BEFORE_CAST
public static final int OPT_ES6_TYPED
public static final int GENERIC_TYPE_LIST
public static final int IMPLEMENTS
public static final int CONSTRUCT_SIGNATURE
public static final int ACCESS_MODIFIER
public static final int DECR_FLAG
public static final int POST_FLAG
public static final int COLUMN_BITS
public static final int MAX_COLUMN_NUMBER
public static final int COLUMN_MASK
public static final int FLAG_GLOBAL_STATE_UNMODIFIED
public static final int FLAG_THIS_UNMODIFIED
public static final int FLAG_ARGUMENTS_UNMODIFIED
public static final int FLAG_NO_THROWS
public static final int FLAG_LOCAL_RESULTS
public static final int SIDE_EFFECTS_FLAGS_MASK
public static final int SIDE_EFFECTS_ALL
public static final int NO_SIDE_EFFECTS
public Node(int nodeType)
public Node(int nodeType, Node child)
public Node(int nodeType, int lineno, int charno)
public Node(int nodeType, Node child, int lineno, int charno)
public Node(int nodeType, Node[] children, int lineno, int charno)
public Node(int nodeType, Node[] children)
public static Node newNumber(double number)
public static Node newNumber(double number, int lineno, int charno)
public int getType()
public void setType(int type)
public boolean hasChildren()
public Node getFirstChild()
public Node getLastChild()
public Node getNext()
public Node getChildAtIndex(int i)
public int getIndexOfChild(Node child)
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 addChildrenAfter(Node children, Node node)
public void removeChild(Node child)
public void replaceChild(Node child, Node newChild)
public Node clonePropsFrom(Node other)
other
- The node to clone properties from.public void removeProp(int propType)
public boolean hasProps()
public Object getProp(int propType)
public boolean getBooleanProp(int propType)
public int getIntProp(int propType)
public int getExistingIntProp(int propType)
public void putProp(int propType, Object value)
public void putBooleanProp(int propType, boolean value)
public void putIntProp(int propType, int value)
public void setDeclaredTypeExpression(Node.TypeDeclarationNode typeExpression)
typeExpression
- public Node.TypeDeclarationNode getDeclaredTypeExpression()
getJSType()
which returns the compiler-inferred type.public JSType getJSTypeBeforeCast()
public double getDouble() throws UnsupportedOperationException
UnsupportedOperationException
public void setDouble(double value) throws UnsupportedOperationException
value
- value to set.UnsupportedOperationException
public String getString() throws UnsupportedOperationException
UnsupportedOperationException
public void setString(String value) throws UnsupportedOperationException
value
- the value to set.UnsupportedOperationException
public String toString(boolean printSource, boolean printAnnotations, boolean printType)
public String toStringTree()
public void appendStringTree(Appendable appendable) throws IOException
IOException
public void setStaticSourceFile(StaticSourceFile file)
public void setSourceFileForTesting(String name)
public String getSourceFileName()
public StaticSourceFile getStaticSourceFile()
public void setInputId(InputId inputId)
inputId
- public InputId getInputId()
public boolean isFromExterns()
public int getLength()
public void setLength(int length)
public int getLineno()
public int getCharno()
public int getSourceOffset()
public int getSourcePosition()
public void setLineno(int lineno)
public void setCharno(int charno)
public void setSourceEncodedPosition(int sourcePosition)
public void setSourceEncodedPositionForTree(int sourcePosition)
protected static int mergeLineCharNo(int lineno, int charno)
212-1
it is
adjusted to 212-1
.protected static int extractLineno(int lineCharNo)
mergeLineCharNo(int, int)
).protected static int extractCharno(int lineCharNo)
mergeLineCharNo(int, int)
).public Iterable<Node> children()
Return an iterable object that iterates over this node's children.
The iterator does not support the optional operation
Iterator.remove()
.
To iterate over a node's children, one can write
Node n = ...; for (Node child : n.children()) { ...
public Iterable<Node> siblings()
Return an iterable object that iterates over this node's siblings,
including this Node. The iterator does not support the optional
operation Iterator.remove()
.
To iterate over a node's siblings including itself, one can write
Node n = ...; for (Node sibling : n.siblings()) { ...
public Node getParent()
public Node getAncestor(int level)
level
- 0 = this, 1 = the parent, etc.public Node.AncestorIterable getAncestors()
public boolean hasOneChild()
public boolean hasMoreThanOneChild()
public int getChildCount()
public boolean hasChild(Node child)
public String checkTreeEquals(Node actual)
this
as the "expected" node and
actual
as the "actual" node.public String checkTreeEqualsIncludingJsDoc(Node actual)
this
as the "expected" node and
actual
as the "actual" node.Object.equals(Object)
public boolean isEquivalentTo(Node node)
public boolean isEquivalentToShallow(Node node)
public boolean isEquivalentToTyped(Node node)
public String getQualifiedName()
public boolean isQualifiedName()
x
or a.b.c
or this.a
.public boolean matchesQualifiedName(String name)
x
or a.b.c
or this.a
.public boolean matchesQualifiedName(Node n)
x
or a.b.c
or this.a
.public boolean isUnscopedQualifiedName()
a.b.c
, but not this.a
.public boolean isValidAssignmentTarget()
public Node detachFromParent()
public Node removeFirstChild()
public Node removeChildren()
public void detachChildren()
public Node cloneNode()
public Node cloneTree()
public Node copyInformationFrom(Node other)
public Node copyInformationFromForTree(Node other)
public Node useSourceInfoFrom(Node other)
other
.public Node useSourceInfoFromForTree(Node other)
other
.public Node useSourceInfoIfMissingFrom(Node other)
other
iff the source info is missing.public Node useSourceInfoIfMissingFromForTree(Node other)
other
iff the source info is missing.public JSType getJSType()
getDeclaredTypeExpression()
which returns the syntactically
specified type.public void setJSType(JSType jsType)
public TypeI getTypeI()
public void setTypeI(TypeI type)
public JSDocInfo getJSDocInfo()
JSDocInfo
attached to this node.null
if no JSDoc is attached to this
nodepublic void setChangeTime(int time)
time
public int getChangeTime()
public void setVarArgs(boolean varArgs)
Token.NAME
nodes
used to define a Token.FUNCTION
's argument list.public boolean isVarArgs()
Token.NAME
nodes
used to define a Token.FUNCTION
's argument list.public void setOptionalArg(boolean optionalArg)
Token.NAME
nodes
used to define a Token.FUNCTION
's argument list.public boolean isOptionalArg()
Token.NAME
nodes
used to define a Token.FUNCTION
's argument list.public void setIsSyntheticBlock(boolean val)
public boolean isSyntheticBlock()
public void setIsAddedBlock(boolean val)
public boolean isAddedBlock()
public void setStaticMember(boolean isStatic)
Token.GETTER_DEF
,
Token.SETTER_DEF
or Token.MEMBER_FUNCTION_DEF
nodes contained
within Token.CLASS
.public boolean isStaticMember()
Token.GETTER_DEF
,
Token.SETTER_DEF
or Token.MEMBER_FUNCTION_DEF
nodes contained
within Token.CLASS
.public void setIsGeneratorFunction(boolean isGenerator)
Token.FUNCTION
or
Token.MEMBER_FUNCTION_DEF
nodes.public boolean isGeneratorFunction()
public void setGeneratorMarker(boolean isGeneratorMarker)
public boolean isGeneratorMarker()
public void setGeneratorSafe(boolean isGeneratorSafe)
isGeneratorSafe()
public boolean isGeneratorSafe()
public void setIsArrowFunction(boolean isArrow)
Token.FUNCTION
public boolean isArrowFunction()
public void setYieldFor(boolean isGenerator)
Token.FUNCTION
or
Token.MEMBER_FUNCTION_DEF
nodes.public boolean isYieldFor()
Token.FUNCTION
or
Token.MEMBER_FUNCTION_DEF
nodes.public void setSideEffectFlags(int flags)
Token.CALL
and
Token.NEW
nodes.public void setSideEffectFlags(Node.SideEffectFlags flags)
public int getSideEffectFlags()
public boolean isOnlyModifiesThisCall()
public boolean isOnlyModifiesArgumentsCall()
public boolean isNoSideEffectsCall()
public boolean isLocalResultCall()
public boolean mayMutateArguments()
public boolean mayMutateGlobalStateOrThrow()
public boolean isQuotedString()
public void setQuotedString()
public boolean isAdd()
public boolean isAnd()
public boolean isArrayLit()
public boolean isArrayPattern()
public boolean isAssign()
public boolean isAssignAdd()
public boolean isBlock()
public boolean isBreak()
public boolean isCall()
public boolean isCase()
public boolean isCast()
public boolean isCatch()
public boolean isClass()
public boolean isClassMembers()
public boolean isComma()
public boolean isComputedProp()
public boolean isContinue()
public boolean isConst()
public boolean isDebugger()
public boolean isDec()
public boolean isDefaultCase()
public boolean isDefaultValue()
public boolean isDelProp()
public boolean isDestructuringPattern()
public boolean isDo()
public boolean isEmpty()
public boolean isExport()
public boolean isExprResult()
public boolean isFalse()
public boolean isFor()
public boolean isForOf()
public boolean isFunction()
public boolean isGetterDef()
public boolean isGetElem()
public boolean isGetProp()
public boolean isHook()
public boolean isIf()
public boolean isImport()
public boolean isIn()
public boolean isInc()
public boolean isInstanceOf()
public boolean isInterfaceMembers()
public boolean isRecordType()
public boolean isIndexSignature()
public boolean isLabel()
public boolean isLabelName()
public boolean isLet()
public boolean isMemberFunctionDef()
public boolean isMemberVariableDef()
public boolean isName()
public boolean isNE()
public boolean isNew()
public boolean isNot()
public boolean isNull()
public boolean isNumber()
public boolean isObjectLit()
public boolean isObjectPattern()
public boolean isOr()
public boolean isParamList()
public boolean isRegExp()
public boolean isRest()
public boolean isReturn()
public boolean isScript()
public boolean isSetterDef()
public boolean isSpread()
public boolean isString()
public boolean isStringKey()
public boolean isSuper()
public boolean isSwitch()
public boolean isTaggedTemplateLit()
public boolean isTemplateLit()
public boolean isTemplateLitSub()
public boolean isThis()
public boolean isThrow()
public boolean isTrue()
public boolean isTry()
public boolean isTypeOf()
public boolean isVar()
public boolean isVoid()
public boolean isWhile()
public boolean isWith()
public boolean isYield()
Copyright © 2009-2015 Google. All Rights Reserved.