|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.expression.ExNode
com.waveset.expression.ExDefun
The node representation for a <defun> expression, which defines a callable function.
Once defined, the function may be called with a <call> expression.
Field Summary | |
static java.lang.String |
code_id
|
static java.lang.String |
ELEMENT
Name of the XML element. |
Fields inherited from class com.waveset.expression.ExNode |
_bindingCount, _children, _decoration, _parent, trace |
Constructor Summary | |
ExDefun()
Build a defun node. |
Method Summary | |
ExValue |
call(ExState state,
ExNode[] arglist)
Call a function. |
ExValue |
eval(ExState state)
Override ExNode.eval since we don't want the breakpoint to occur here. |
protected ExValue |
evalInternal(ExState state)
This implementation does nothing - everything is done within call |
int |
getArgCount()
Gets the number of function arguments referenced in the body of this function. |
java.lang.String |
getFunctionName()
Gets the node function name. |
java.lang.String |
getName()
Gets the name of the function being defined. |
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 |
setArgCount(int c)
Sets the number of function arguments referenced in the body of the function. |
void |
setName(java.lang.String name)
Set the name. |
void |
toXmlAttributes(java.lang.StringBuffer b)
Add attributes to the default 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, 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 |
public static final java.lang.String code_id
public static final java.lang.String ELEMENT
Constructor Detail |
public ExDefun()
Method Detail |
public java.lang.String getFunctionName()
getFunctionName
in class ExNode
public java.lang.String getName()
public int getArgCount()
public void setArgCount(int c)
public void setName(java.lang.String name)
public void parseXml(org.w3c.dom.Element el) throws WavesetException
parseXml
in class ExNode
WavesetException
public void toXmlAttributes(java.lang.StringBuffer b)
toXmlAttributes
in class ExNode
public void postProcess()
Here we initialize the argCount field, since this will be
set as we encounter expressions while traversing
our body.
postProcess
in class ExNode
public ExValue eval(ExState state) throws WavesetException
The return value of defun is null. It has the side effect of registering the function in the environment.
Actually, the definition happens as a side effect of the postProcess() walk, not during the evaluation of the definition node.
eval
in class ExNode
WavesetException
protected ExValue evalInternal(ExState state) throws WavesetException
evalInternal
in class ExNode
WavesetException
public ExValue call(ExState state, ExNode[] arglist) throws WavesetException
This is called in response to the evaluation of an ExCall node, here is where we evaluation the body of the function.
WavesetException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |