com.waveset.expression
Class ExBlock

java.lang.Object
  extended bycom.waveset.expression.ExNode
      extended bycom.waveset.expression.ExBlock
All Implemented Interfaces:
com.sun.idm.debugger.common.Locatable

public class ExBlock
extends ExNode

The node representation for a <block> expression.

A block expression simply wraps one or more subexpressions. The value of a block expression, is the value of the last subexpression.


Field Summary
static java.lang.String code_id
           
 
Fields inherited from class com.waveset.expression.ExNode
_bindingCount, _children, _decoration, _parent, trace
 
Constructor Summary
ExBlock()
          Build a block node.
 
Method Summary
 ExValue eval(ExState state)
          Override ExNode.eval so that we can setup tracing for the block prior to the call to trace the block (so that the block is included in the trace).
protected  ExValue evalInternal(ExState state)
          Evaluate a block node.
 java.lang.String getFunctionName()
          Return the node function name.
 java.lang.String getName()
          Gets the block name.
 boolean isTrace()
           
 void parseXml(org.w3c.dom.Element el)
          Parse the XML representation, and flesh out the object.
 void setName(java.lang.String n)
          Sets the block name.
 void setTrace(boolean b)
           
 void toXmlAttributes(java.lang.StringBuffer b)
          Add attributes to our XML serialization.
 
Methods inherited from class com.waveset.expression.ExNode
addChild, addChildren, addCommonAttributes, beginTrace, clearOwner, endTrace, evalChild, evalChildToObject, evalChildToString, evalToBoolean, evalToInt, evalToObject, evalToString, getBindingCount, getChild, getChildren, getDecoration, getHiddenVariable, getLocation, getOwner, getParent, isLiteral, parseCommonAttributes, postProcess, removeChild, resolveFunction, resolveVariable, setBindingCount, setChildren, setDecoration, setEnvironment, setLocation, setOwner, setOwner, setParent, toXml, toXml, toXml, toXmlChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values
Constructor Detail

ExBlock

public ExBlock()
Build a block node.

Method Detail

getFunctionName

public java.lang.String getFunctionName()
Return the node function name.

Specified by:
getFunctionName in class ExNode

parseXml

public void parseXml(org.w3c.dom.Element el)
              throws WavesetException
Parse the XML representation, and flesh out the object.

Overrides:
parseXml in class ExNode
Throws:
WavesetException

toXmlAttributes

public void toXmlAttributes(java.lang.StringBuffer b)
Add attributes to our XML serialization.

Overrides:
toXmlAttributes in class ExNode

setName

public void setName(java.lang.String n)
Sets the block name.


getName

public java.lang.String getName()
Gets the block name.


isTrace

public boolean isTrace()

setTrace

public void setTrace(boolean b)

eval

public ExValue eval(ExState state)
             throws WavesetException
Override ExNode.eval so that we can setup tracing for the block prior to the call to trace the block (so that the block is included in the trace). Allow trace to be turned on with an attribute for the statements within this block. We don't allow trace to be turned off, since we don't want absense of the trace attribute to disable global trace settings, since most blocks won't have it. If necessary, instead of treating this as a boolean, we could make it tri-state: default, on, and forced-off.

Overrides:
eval in class ExNode
Throws:
WavesetException

evalInternal

protected ExValue evalInternal(ExState state)
                        throws WavesetException
Evaluate a block node. The value of the node is the value of the last subexpression within the block.

Specified by:
evalInternal in class ExNode
Throws:
WavesetException