com.waveset.expression
Class ExCall

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

public class ExCall
extends ExNode

The node representation for a <call> expression.

A call may be be made to either a local function declared with a <defun> expression, or to an external function. External functions are resolved and processed by the ExState object. When external functions are used, the ExState is normally an application specific subclass that knows how to resolve the functions being called.


Field Summary
static java.lang.String code_id
           
 
Fields inherited from class com.waveset.expression.ExNode
_bindingCount, _children, _decoration, _parent, trace
 
Constructor Summary
ExCall()
          Build a call node.
 
Method Summary
protected  ExValue evalInternal(ExState state)
          Evalute the function call node.
 ExDefun getDefun()
          Get the resolved function
 java.lang.String getFunctionName()
          Return our function name.
 java.lang.String getName()
          Get the name of the reference.
 void parseXml(org.w3c.dom.Element el)
          Parse the XML representation, and flesh out the object.
 void postProcess()
          Overload of the ExNode postProcess method.
 void setName(java.lang.String name)
           
 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
Constructor Detail

ExCall

public ExCall()
Build a call node.

Method Detail

setName

public void setName(java.lang.String name)

getFunctionName

public java.lang.String getFunctionName()
Return our 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 our attributes to the default XML serialization.

Overrides:
toXmlAttributes in class ExNode

postProcess

public void postProcess()
Overload of the ExNode postProcess method.

Here we try to resolve our function reference. This may fail for awhile if we're incrementally building up the environment, and the hasn't been added yet. It may end up being unresolved, which will then be treated as an external function reference and passed on to the ExState for handling.

Overrides:
postProcess in class ExNode

getName

public java.lang.String getName()
Get the name of the reference.


getDefun

public ExDefun getDefun()
Get the resolved function


evalInternal

protected ExValue evalInternal(ExState state)
                        throws WavesetException
Evalute the function call node.

If this is resolved to a ExDefun, we call it and return its value. If is isn't resolved, we ask the ExState object to handle it.

Specified by:
evalInternal in class ExNode
Throws:
WavesetException