com.waveset.expression
Class ExSet

java.lang.Object
  extended bycom.waveset.expression.ExNode
      extended bycom.waveset.expression.ExSet
All Implemented Interfaces:
com.sun.idm.debugger.common.Locatable
Direct Known Subclasses:
ExPutMap, ExSetList, ExSetVar

public class ExSet
extends ExNode

A node representing a variable or argument reference.

Hmm, we could make this an ExFunction if we thought hard enough.


Field Summary
protected  java.lang.String _elName
           
static java.lang.String code_id
           
 
Fields inherited from class com.waveset.expression.ExNode
_bindingCount, _children, _decoration, _parent, trace
 
Constructor Summary
ExSet()
          Make a set node.
ExSet(java.lang.String elName)
          Make a set node.
 
Method Summary
protected  ExValue evalInternal(ExState state)
          Evaluate the node.
 java.lang.String getFunctionName()
          Get the node function name.
 java.lang.String getName()
          Get the static reference name if we had one.
 void parseXml(org.w3c.dom.Element el)
          Parse the XML definition, and flesh out the object.
 void postProcess()
          Overload of the ExNode postProcess method that attempts to resolve static variable references.
 void setName(java.lang.String name)
          Should only be called by the editor.
 void toXmlAttributes(java.lang.StringBuffer b)
          Add our attributes to the default XML serialization.
 
Methods inherited from class com.waveset.expression.ExNode
addChild, addChildren, addCommonAttributes, beginTrace, clearOwner, endTrace, eval, evalChild, evalChildToObject, evalChildToString, evalToBoolean, evalToInt, evalToObject, evalToString, getBindingCount, getChild, getChildren, getDecoration, getHiddenVariable, getLocation, getOwner, getParent, isLiteral, parseCommonAttributes, 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

_elName

protected java.lang.String _elName
Constructor Detail

ExSet

public ExSet()
Make a set node.


ExSet

public ExSet(java.lang.String elName)
Make a set node.

Method Detail

setName

public void setName(java.lang.String name)
Should only be called by the editor.


parseXml

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

There are two forms, the first has two subexpression. The first subexpression is the name, and the second the value. The second form has the name specified in an attribute and a single subexpression for the value.

Specifying the name in the attribute is faster, since we can resolve it at "compile" time. Specifying the name as an expression allows it to be computed at runtime.

Overrides:
parseXml in class ExNode
Throws:
WavesetException

toXmlAttributes

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

Overrides:
toXmlAttributes in class ExNode

postProcess

public void postProcess()
Overload of the ExNode postProcess method that attempts to resolve static variable references.

Overrides:
postProcess in class ExNode

getFunctionName

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

Specified by:
getFunctionName in class ExNode

getName

public java.lang.String getName()
Get the static reference name if we had one.


evalInternal

protected ExValue evalInternal(ExState state)
                        throws WavesetException
Evaluate the node.

There is no logical return value here. Though we could return the value that was assigned?

If the name attribute was used, then we must resolve to a defvar.

If name is not used and the first argument is a string, we assume it is the name of a defvar.

If the name attribute is not used, and the first argument is a Map, the second argument is the key, and the third argument is the value.

Specified by:
evalInternal in class ExNode
Throws:
WavesetException