org.mozilla.javascript

Class Node

public class Node extends Object

This class implements the root of the intermediate representation.

Author: Norris Boyd Mike McCabe

Nested Class Summary
static classNode.Jump
Field Summary
static intATTRIBUTE_FLAG
static intBOTH
static intCASEARRAY_PROP
static intCATCH_SCOPE_PROP
static intDECR_FLAG
static intDESCENDANTS_FLAG
static intDIRECTCALL_PROP
static intFUNCTION_PROP
static intINCRDECR_PROP
static intISNUMBER_PROP
static intLABEL_ID_PROP
static intLAST_PROP
static intLEFT
static intLOCAL_BLOCK_PROP
static intLOCAL_PROP
static intMEMBER_TYPE_PROP
static intNAME_PROP
static intNON_SPECIALCALL
static intOBJECT_IDS_PROP
static intPOST_FLAG
static intPROPERTY_FLAG
static intREGEXP_PROP
static intRIGHT
static intSKIP_INDEXES_PROP
static intSPECIALCALL_EVAL
static intSPECIALCALL_PROP
static intSPECIALCALL_WITH
static intTARGETBLOCK_PROP
static intVARIABLE_PROP
Constructor Summary
Node(int nodeType)
Node(int nodeType, Node child)
Node(int nodeType, Node left, Node right)
Node(int nodeType, Node left, Node mid, Node right)
Node(int nodeType, int line)
Node(int nodeType, Node child, int line)
Node(int nodeType, Node left, Node right, int line)
Node(int nodeType, Node left, Node mid, Node right, int line)
Method Summary
voidaddChildAfter(Node newChild, Node node)
Add 'child' after 'node'.
voidaddChildBefore(Node newChild, Node node)
Add 'child' before 'node'.
voidaddChildrenToBack(Node children)
voidaddChildrenToFront(Node children)
voidaddChildToBack(Node child)
voidaddChildToFront(Node child)
NodegetChildBefore(Node child)
doublegetDouble()
Can only be called when getType() == Token.NUMBER
intgetExistingIntProp(int propType)
NodegetFirstChild()
intgetIntProp(int propType, int defaultValue)
NodegetLastChild()
NodegetLastSibling()
intgetLineno()
NodegetNext()
ObjectgetProp(int propType)
StringgetString()
Can only be called when node has String context.
intgetType()
booleanhasChildren()
intlabelId()
voidlabelId(int labelId)
static NodenewNumber(double number)
static NodenewString(String str)
static NodenewString(int type, String str)
static NodenewTarget()
voidputIntProp(int propType, int prop)
voidputProp(int propType, Object prop)
voidremoveChild(Node child)
voidremoveProp(int propType)
voidreplaceChild(Node child, Node newChild)
voidreplaceChildAfter(Node prevChild, Node newChild)
voidsetDouble(double number)
voidsetString(String s)
Can only be called when node has String context.
voidsetType(int type)
StringtoString()
StringtoStringTree(ScriptOrFnNode treeTop)

Field Detail

ATTRIBUTE_FLAG

public static final int ATTRIBUTE_FLAG

BOTH

public static final int BOTH

CASEARRAY_PROP

public static final int CASEARRAY_PROP

CATCH_SCOPE_PROP

public static final int CATCH_SCOPE_PROP

DECR_FLAG

public static final int DECR_FLAG

DESCENDANTS_FLAG

public static final int DESCENDANTS_FLAG

DIRECTCALL_PROP

public static final int DIRECTCALL_PROP

FUNCTION_PROP

public static final int FUNCTION_PROP

INCRDECR_PROP

public static final int INCRDECR_PROP

ISNUMBER_PROP

public static final int ISNUMBER_PROP

LABEL_ID_PROP

public static final int LABEL_ID_PROP

LAST_PROP

public static final int LAST_PROP

LEFT

public static final int LEFT

LOCAL_BLOCK_PROP

public static final int LOCAL_BLOCK_PROP

LOCAL_PROP

public static final int LOCAL_PROP

MEMBER_TYPE_PROP

public static final int MEMBER_TYPE_PROP

NAME_PROP

public static final int NAME_PROP

NON_SPECIALCALL

public static final int NON_SPECIALCALL

OBJECT_IDS_PROP

public static final int OBJECT_IDS_PROP

POST_FLAG

public static final int POST_FLAG

PROPERTY_FLAG

public static final int PROPERTY_FLAG

REGEXP_PROP

public static final int REGEXP_PROP

RIGHT

public static final int RIGHT

SKIP_INDEXES_PROP

public static final int SKIP_INDEXES_PROP

SPECIALCALL_EVAL

public static final int SPECIALCALL_EVAL

SPECIALCALL_PROP

public static final int SPECIALCALL_PROP

SPECIALCALL_WITH

public static final int SPECIALCALL_WITH

TARGETBLOCK_PROP

public static final int TARGETBLOCK_PROP

VARIABLE_PROP

public static final int VARIABLE_PROP

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

Node

public Node(int nodeType, Node child, int line)

Node

public Node(int nodeType, Node left, Node right, int line)

Node

public Node(int nodeType, Node left, Node mid, Node right, int line)

Method Detail

addChildAfter

public void addChildAfter(Node newChild, Node node)
Add 'child' after 'node'.

addChildBefore

public void addChildBefore(Node newChild, Node node)
Add 'child' before 'node'.

addChildrenToBack

public void addChildrenToBack(Node children)

addChildrenToFront

public void addChildrenToFront(Node children)

addChildToBack

public void addChildToBack(Node child)

addChildToFront

public void addChildToFront(Node child)

getChildBefore

public Node getChildBefore(Node child)

getDouble

public final double getDouble()
Can only be called when getType() == Token.NUMBER

getExistingIntProp

public int getExistingIntProp(int propType)

getFirstChild

public Node getFirstChild()

getIntProp

public int getIntProp(int propType, int defaultValue)

getLastChild

public Node getLastChild()

getLastSibling

public Node getLastSibling()

getLineno

public int getLineno()

getNext

public Node getNext()

getProp

public Object getProp(int propType)

getString

public final String getString()
Can only be called when node has String context.

getType

public int getType()

hasChildren

public boolean hasChildren()

labelId

public final int labelId()

labelId

public void labelId(int labelId)

newNumber

public static Node newNumber(double number)

newString

public static Node newString(String str)

newString

public static Node newString(int type, String str)

newTarget

public static Node newTarget()

putIntProp

public void putIntProp(int propType, int prop)

putProp

public void putProp(int propType, Object prop)

removeChild

public void removeChild(Node child)

removeProp

public void removeProp(int propType)

replaceChild

public void replaceChild(Node child, Node newChild)

replaceChildAfter

public void replaceChildAfter(Node prevChild, Node newChild)

setDouble

public final void setDouble(double number)

setString

public final void setString(String s)
Can only be called when node has String context.

setType

public void setType(int type)

toString

public String toString()

toStringTree

public String toStringTree(ScriptOrFnNode treeTop)