|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectptolemy.data.expr.ASTPtRootNode
ptolemy.data.expr.ASTPtFunctionDefinitionNode
public class ASTPtFunctionDefinitionNode
The parse tree created from function definitions of the form:
function (x) x + 5which defines a function of one argument. The above is assumed to have arguments declared of type general. Monomorphic type-safe functions can be declared using syntax like:
function (x:int) x+5This declares that the function only takes integer arguments. The return type (in this case integer, since the result of adding 5 to an integer is an integer) is inferred automatically. FIXME: check argument name duplication
ASTPtRootNode,
PtParser,
Token
| Red (cxh) |
| Yellow (nsmyth) |
| Field Summary | |
|---|---|
protected java.util.ArrayList |
_argList
|
protected Type[] |
_argTypes
|
| Fields inherited from class ptolemy.data.expr.ASTPtRootNode |
|---|
_children, _id, _isConstant, _parent, _ptToken, _ptType |
| Constructor Summary | |
|---|---|
ASTPtFunctionDefinitionNode(int id)
|
|
ASTPtFunctionDefinitionNode(PtParser p,
int id)
|
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Clone the parse tree node by invoking the clone() method of the base class. |
java.util.List |
getArgumentNameList()
Return the list of argument names. |
Type[] |
getArgumentTypes()
Return the type of the arguments, or null if type inference has not occurred yet. |
ASTPtRootNode |
getExpressionTree()
Return the parse tree of the expression for this function. |
boolean |
isCongruent(ASTPtRootNode node,
java.util.Map renaming)
Return true if this node is (hierarchically) congruent to the given node, under the given renaming of bound identifiers. |
void |
jjtClose()
Close this node. |
void |
visit(ParseTreeVisitor visitor)
Traverse this node with the given visitor. |
| Methods inherited from class ptolemy.data.expr.ASTPtRootNode |
|---|
displayParseTree, evaluateParseTree, getToken, getType, isConstant, isEvaluated, jjtAddChild, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, setConstant, setToken, setType, toString, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.util.ArrayList _argList
protected Type[] _argTypes
| Constructor Detail |
|---|
public ASTPtFunctionDefinitionNode(int id)
public ASTPtFunctionDefinitionNode(PtParser p,
int id)
| Method Detail |
|---|
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class ASTPtRootNodejava.lang.CloneNotSupportedException - If the superclass clone()
method throws it.public java.util.List getArgumentNameList()
public Type[] getArgumentTypes()
public ASTPtRootNode getExpressionTree()
public boolean isCongruent(ASTPtRootNode node,
java.util.Map renaming)
isCongruent in class ASTPtRootNodenode - The node to compare to.renaming - A map from String to String that gives a
renaming from identifiers in this node to identifiers in the
given node.public void jjtClose()
jjtClose in interface NodejjtClose in class ASTPtRootNode
public void visit(ParseTreeVisitor visitor)
throws IllegalActionException
visit in class ASTPtRootNodeIllegalActionException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||