A node on the tree representing a user identifier (ie variable name). More...
#include <nodes.h>
Public Member Functions | |
IDNode (const std::string &name, long stochparent=0) | |
std::string | getValue () const |
Return the value of this node as a string. | |
void | findIDREF (std::list< ModelComp * > &lmc) |
void | findIDREF (std::list< SyntaxNode * > *lnd) |
Find all the IDREF nodes at or below the current node. | |
void | findOpCode (int oc, std::list< SyntaxNode * > *lnd) |
Find all nodes of opCode oc at or below the current node. | |
std::ostream & | put (std::ostream &s) const |
SyntaxNode * | deep_copy () |
Creates a deep copy of the nodes: SyntaxNodes pointed to are recreated as well. | |
void | setName (const std::string &id) |
std::string | id () const |
void | setStochParent (long parent) |
long | getStochParent () const |
Private Attributes | |
std::string | name |
long | stochparent |
A node on the tree representing a user identifier (ie variable name).
IDNode::IDNode | ( | const std::string & | name, | |
long | stochparent = 0 | |||
) |
Referenced by deep_copy().
SyntaxNode* IDNode::deep_copy | ( | ) | [inline, virtual] |
Creates a deep copy of the nodes: SyntaxNodes pointed to are recreated as well.
Non-SyntaxNode objects pointed to are not recreated, here just pointers are copied (->ref in the case of a SyntaxNodeIDREF object). The int/double entries pointed to by INT_VAL/FLOAT_VAL SyntaxNodes *are* recreated.
Reimplemented from SyntaxNode.
References IDNode(), name, and stochparent.
void IDNode::findIDREF | ( | std::list< ModelComp * > & | lmc | ) | [inline] |
void IDNode::findIDREF | ( | std::list< SyntaxNode * > * | lnd | ) | [inline, virtual] |
Find all the IDREF nodes at or below the current node.
Reimplemented from SyntaxNode.
void IDNode::findOpCode | ( | int | oc, | |
std::list< SyntaxNode * > * | lnd | |||
) | [virtual] |
Find all nodes of opCode oc at or below the current node.
Reimplemented from SyntaxNode.
References ID.
long IDNode::getStochParent | ( | ) | const [inline] |
References stochparent.
Referenced by find_var_ref_in_context(), and yyparse().
std::string IDNode::getValue | ( | ) | const [inline, virtual] |
std::string IDNode::id | ( | ) | const [inline] |
std::ostream& IDNode::put | ( | std::ostream & | s | ) | const [inline, virtual] |
Reimplemented from SyntaxNode.
References name.
void IDNode::setName | ( | const std::string & | id | ) | [inline] |
References name.
Referenced by StochModelComp::transcribeToModelComp().
void IDNode::setStochParent | ( | long | parent | ) | [inline] |
References stochparent.
Referenced by yyparse().
std::string IDNode::name [private] |
Referenced by deep_copy(), getValue(), id(), put(), and setName().
long IDNode::stochparent [private] |
Referenced by deep_copy(), getStochParent(), and setStochParent().