|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.expression.ExNode
The basis for all nodes in a parsed expression tree.
Field Summary | |
protected int |
_bindingCount
Number of variable bindings found within this node. |
protected ExNode[] |
_children
Our child nodes. |
protected ExDecoration |
_decoration
An application attachment. |
protected ExNode |
_parent
Our parent node in the tree. |
static java.lang.String |
code_id
|
protected static Trace |
trace
|
Constructor Summary | |
protected |
ExNode()
Make a new node. |
Method Summary | |
void |
addChild(ExNode node)
Append one new node to the existing child list. |
void |
addChildren(ExNode[] nodes)
Append a set of nodes to the existing child list. |
protected void |
addCommonAttributes(java.lang.StringBuffer b)
Called by default by toXml. |
void |
beginTrace(java.lang.StringBuffer b)
Called by ExState to format the start of a trace message for this node. |
static void |
clearOwner(ExNode node)
|
void |
endTrace(java.lang.StringBuffer b)
Called by ExState to format the end of a trace message for this node. |
ExValue |
eval(ExState state)
Default implementation of eval which takes care of tracing, breakpoints, and restoring the breakpoint stack upon exception. |
ExValue |
evalChild(ExState state,
int childIndex)
Evaluate one of our child nodes returning an ExValue. |
java.lang.Object |
evalChildToObject(ExState state,
int childIndex)
Evaluate one of our child nodes, returning an object. |
java.lang.String |
evalChildToString(ExState state,
int childIndex)
Evaluate one of our child nodes returning a string. |
protected abstract ExValue |
evalInternal(ExState state)
Abstract evaluation method all nodes must have. |
boolean |
evalToBoolean(ExState state)
Evaluate this node, and return a boolean. |
int |
evalToInt(ExState state)
Evaluate this node, and return an int. |
java.lang.Object |
evalToObject(ExState state)
Evaluate this node, and return an object value. |
java.lang.String |
evalToString(ExState state)
Evaluate this node, and return an string. |
int |
getBindingCount()
Get the number of variable bindings that appear within this node. |
ExNode |
getChild()
Gets the first child node, a convenience method for places that expect only one node. |
ExNode[] |
getChildren()
Get the child nodes. |
ExDecoration |
getDecoration()
Get the node decoration. |
abstract java.lang.String |
getFunctionName()
Nodes representing functions must have a name. |
ExDefvar |
getHiddenVariable()
Get the optional hidden variable. |
com.sun.idm.debugger.common.Location |
getLocation()
|
java.lang.Object |
getOwner()
|
ExNode |
getParent()
Get the parent node. |
boolean |
isLiteral()
Called by ExState to determine if this node contains literal text, and therefore does not need a newline after the start tag. |
protected void |
parseCommonAttributes(org.w3c.dom.Element el)
Called by default by parseXml. |
void |
parseXml(org.w3c.dom.Element el)
Default XML parsing method. |
void |
postProcess()
Traverses a node tree after initial parsing, resolving references to functions and variables, and performing any other optimizations that might be available. |
void |
removeChild(ExNode node)
Remove a child node. |
ExDefun |
resolveFunction(java.lang.String name)
Resolve a function reference. |
ExDefvar |
resolveVariable(java.lang.String name)
Resolve a variable reference. |
void |
setBindingCount(int c)
Set the number of variable bindings that appear within this node. |
void |
setChildren(ExNode[] nodes)
Set the child list for this node. |
void |
setDecoration(ExDecoration d)
Set the node decoration. |
void |
setEnvironment(ExEnvironment env)
Set the node environment. |
void |
setLocation(com.sun.idm.debugger.common.Location l)
|
static void |
setOwner(ExNode node,
java.lang.Object owner)
|
void |
setOwner(java.lang.Object owner)
|
void |
setParent(ExNode p)
Set the parent node. |
java.lang.String |
toXml()
Serialize a node to XML with header. |
void |
toXml(java.lang.StringBuffer b,
int indent)
Serialize the node back to XML. |
void |
toXml(java.lang.StringBuffer b,
int indent,
java.lang.String wrapper)
Serialize expression XML with a wrapper. |
void |
toXmlAttributes(java.lang.StringBuffer b)
Add attributes in the start tag of this node. |
void |
toXmlChildren(java.lang.StringBuffer b,
int indent)
Serialize children to an XML buffer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String code_id
protected static final Trace trace
protected ExNode _parent
protected ExNode[] _children
protected int _bindingCount
protected ExDecoration _decoration
Constructor Detail |
protected ExNode()
Method Detail |
protected abstract ExValue evalInternal(ExState state) throws WavesetException
WavesetException
public abstract java.lang.String getFunctionName()
public ExValue eval(ExState state) throws WavesetException
WavesetException
public void toXml(java.lang.StringBuffer b, int indent)
This may be overloaded by subclasses if they have attributes or special formatting needs.
public void toXml(java.lang.StringBuffer b, int indent, java.lang.String wrapper)
public void toXmlAttributes(java.lang.StringBuffer b)
protected final void addCommonAttributes(java.lang.StringBuffer b)
protected final void parseCommonAttributes(org.w3c.dom.Element el) throws WavesetException
WavesetException
public void toXmlChildren(java.lang.StringBuffer b, int indent)
public java.lang.String toXml()
public void parseXml(org.w3c.dom.Element el) throws WavesetException
WavesetException
public ExNode getParent()
public void setParent(ExNode p)
public java.lang.Object getOwner()
public void setOwner(java.lang.Object owner)
public int getBindingCount()
public void setBindingCount(int c)
public ExNode[] getChildren()
public ExDefvar getHiddenVariable()
public ExNode getChild()
public void setChildren(ExNode[] nodes)
public void addChildren(ExNode[] nodes)
public void addChild(ExNode node)
public void removeChild(ExNode node)
public ExDecoration getDecoration()
public void setDecoration(ExDecoration d)
public void setEnvironment(ExEnvironment env)
public void setLocation(com.sun.idm.debugger.common.Location l)
setLocation
in interface com.sun.idm.debugger.common.Locatable
public com.sun.idm.debugger.common.Location getLocation()
getLocation
in interface com.sun.idm.debugger.common.Locatable
public java.lang.String evalToString(ExState state) throws WavesetException
WavesetException
public boolean evalToBoolean(ExState state) throws WavesetException
WavesetException
public int evalToInt(ExState state) throws WavesetException
WavesetException
public java.lang.Object evalToObject(ExState state) throws WavesetException
WavesetException
public ExValue evalChild(ExState state, int childIndex) throws WavesetException
A convenience method for a common operation.
WavesetException
public java.lang.String evalChildToString(ExState state, int childIndex) throws WavesetException
A convenience method for a common operation.
WavesetException
public java.lang.Object evalChildToObject(ExState state, int childIndex) throws WavesetException
A convenience method for a common operation.
WavesetException
public ExDefun resolveFunction(java.lang.String name)
We do this by searching backwards through the node tree looking
for a
public ExDefvar resolveVariable(java.lang.String name)
public void postProcess()
This method can be overloaded in subclasses to do node specific post processing.
public boolean isLiteral()
public void beginTrace(java.lang.StringBuffer b)
public void endTrace(java.lang.StringBuffer b)
public static void setOwner(ExNode node, java.lang.Object owner)
public static void clearOwner(ExNode node)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |