org.mozilla.javascript
Class Node
java.lang.Object
|
+--org.mozilla.javascript.Node
- All Implemented Interfaces:
- java.lang.Cloneable
- Direct Known Subclasses:
- FunctionNode
- public class Node
- extends java.lang.Object
- implements java.lang.Cloneable
This class implements the root of the intermediate representation.
- Author:
- Norris Boyd, Mike McCabe
Constructor Summary |
Node(int nodeType)
|
Node(int nodeType,
double value)
|
Node(int nodeType,
int value)
|
Node(int nodeType,
Node child)
|
Node(int nodeType,
Node child,
int value)
|
Node(int nodeType,
Node left,
Node right)
|
Node(int nodeType,
Node left,
Node mid,
Node right)
|
Node(int nodeType,
Node left,
Node right,
java.lang.Object datum)
|
Node(int nodeType,
Node child,
java.lang.Object datum)
|
Node(int nodeType,
java.lang.String str)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TARGET_PROP
public static final int TARGET_PROP
BREAK_PROP
public static final int BREAK_PROP
CONTINUE_PROP
public static final int CONTINUE_PROP
ENUM_PROP
public static final int ENUM_PROP
FUNCTION_PROP
public static final int FUNCTION_PROP
TEMP_PROP
public static final int TEMP_PROP
LOCAL_PROP
public static final int LOCAL_PROP
CODEOFFSET_PROP
public static final int CODEOFFSET_PROP
FIXUPS_PROP
public static final int FIXUPS_PROP
VARS_PROP
public static final int VARS_PROP
USES_PROP
public static final int USES_PROP
REGEXP_PROP
public static final int REGEXP_PROP
CASES_PROP
public static final int CASES_PROP
DEFAULT_PROP
public static final int DEFAULT_PROP
CASEARRAY_PROP
public static final int CASEARRAY_PROP
SOURCENAME_PROP
public static final int SOURCENAME_PROP
SOURCE_PROP
public static final int SOURCE_PROP
TYPE_PROP
public static final int TYPE_PROP
SPECIAL_PROP_PROP
public static final int SPECIAL_PROP_PROP
LABEL_PROP
public static final int LABEL_PROP
FINALLY_PROP
public static final int FINALLY_PROP
LOCALCOUNT_PROP
public static final int LOCALCOUNT_PROP
TARGETBLOCK_PROP
public static final int TARGETBLOCK_PROP
VARIABLE_PROP
public static final int VARIABLE_PROP
LASTUSE_PROP
public static final int LASTUSE_PROP
ISNUMBER_PROP
public static final int ISNUMBER_PROP
DIRECTCALL_PROP
public static final int DIRECTCALL_PROP
BASE_LINENO_PROP
public static final int BASE_LINENO_PROP
END_LINENO_PROP
public static final int END_LINENO_PROP
SPECIALCALL_PROP
public static final int SPECIALCALL_PROP
DEBUGSOURCE_PROP
public static final int DEBUGSOURCE_PROP
BOTH
public static final int BOTH
LEFT
public static final int LEFT
RIGHT
public static final int RIGHT
Node
public Node(int nodeType)
Node
public Node(int nodeType,
Node child)
Node
public Node(int nodeType,
Node left,
Node right)
Node
public Node(int nodeType,
Node left,
Node mid,
Node right)
Node
public Node(int nodeType,
int value)
Node
public Node(int nodeType,
double value)
Node
public Node(int nodeType,
java.lang.String str)
Node
public Node(int nodeType,
Node child,
int value)
Node
public Node(int nodeType,
Node child,
java.lang.Object datum)
Node
public Node(int nodeType,
Node left,
Node right,
java.lang.Object datum)
getType
public int getType()
setType
public void setType(int type)
hasChildren
public boolean hasChildren()
getFirstChild
public Node getFirstChild()
getLastChild
public Node getLastChild()
getNextSibling
public Node getNextSibling()
getChildBefore
public Node getChildBefore(Node child)
getLastSibling
public Node getLastSibling()
getPreorderIterator
public PreorderNodeIterator getPreorderIterator()
addChildToFront
public void addChildToFront(Node child)
addChildToBack
public void addChildToBack(Node child)
addChildrenToFront
public void addChildrenToFront(Node children)
addChildrenToBack
public void addChildrenToBack(Node children)
addChildBefore
public void addChildBefore(Node newChild,
Node node)
- Add 'child' before 'node'.
addChildAfter
public void addChildAfter(Node newChild,
Node node)
- Add 'child' after 'node'.
removeChild
public void removeChild(Node child)
replaceChild
public void replaceChild(Node child,
Node newChild)
replaceChildAfter
public void replaceChildAfter(Node prevChild,
Node newChild)
getProp
public java.lang.Object getProp(int propType)
getIntProp
public int getIntProp(int propType,
int defaultValue)
getExistingIntProp
public int getExistingIntProp(int propType)
putProp
public void putProp(int propType,
java.lang.Object prop)
putIntProp
public void putIntProp(int propType,
int prop)
removeProp
public void removeProp(int propType)
getDatum
public java.lang.Object getDatum()
setDatum
public void setDatum(java.lang.Object datum)
getNumber
public java.lang.Number getNumber()
getInt
public int getInt()
getDouble
public double getDouble()
getLong
public long getLong()
getString
public java.lang.String getString()
cloneNode
public Node cloneNode()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
toStringTree
public java.lang.String toStringTree()
getFirst
public Node getFirst()
getNext
public Node getNext()