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

Field Summary
static int BASE_LINENO_PROP
           
static int BOTH
           
static int BREAK_PROP
           
static int CASEARRAY_PROP
           
static int CASES_PROP
           
static int CODEOFFSET_PROP
           
static int CONTINUE_PROP
           
static int DEBUGSOURCE_PROP
           
static int DEFAULT_PROP
           
static int DIRECTCALL_PROP
           
static int END_LINENO_PROP
           
static int ENUM_PROP
           
static int FINALLY_PROP
           
static int FIXUPS_PROP
           
static int FUNCTION_PROP
           
static int ISNUMBER_PROP
           
static int LABEL_PROP
           
static int LASTUSE_PROP
           
static int LEFT
           
static int LOCAL_PROP
           
static int LOCALCOUNT_PROP
           
static int REGEXP_PROP
           
static int RIGHT
           
static int SOURCE_PROP
           
static int SOURCENAME_PROP
           
static int SPECIAL_PROP_PROP
           
static int SPECIALCALL_PROP
           
static int TARGET_PROP
           
static int TARGETBLOCK_PROP
           
static int TEMP_PROP
           
static int TYPE_PROP
           
static int USES_PROP
           
static int VARIABLE_PROP
           
static int VARS_PROP
           
 
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)
           
 
Method Summary
 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 cloneNode()
           
 Node getChildBefore(Node child)
           
 java.lang.Object getDatum()
           
 double getDouble()
           
 int getExistingIntProp(int propType)
           
 Node getFirst()
           
 Node getFirstChild()
           
 int getInt()
           
 int getIntProp(int propType, int defaultValue)
           
 Node getLastChild()
           
 Node getLastSibling()
           
 long getLong()
           
 Node getNext()
           
 Node getNextSibling()
           
 java.lang.Number getNumber()
           
 PreorderNodeIterator getPreorderIterator()
           
 java.lang.Object getProp(int propType)
           
 java.lang.String getString()
           
 int getType()
           
 boolean hasChildren()
           
 void putIntProp(int propType, int prop)
           
 void putProp(int propType, java.lang.Object prop)
           
 void removeChild(Node child)
           
 void removeProp(int propType)
           
 void replaceChild(Node child, Node newChild)
           
 void replaceChildAfter(Node prevChild, Node newChild)
           
 void setDatum(java.lang.Object datum)
           
 void setType(int type)
           
 java.lang.String toString()
           
 java.lang.String toStringTree()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

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)
Method Detail

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()