Represents an operator. More...
#include <nodes.h>
Public Member Functions | |
OpNode (int opCode, SyntaxNode *op1, SyntaxNode *op2=NULL) | |
std::ostream & | put (std::ostream &s) const |
OpNode * | deep_copy () |
Creates a deep copy of the nodes: SyntaxNodes pointed to are recreated as well. | |
OpNode * | clone () |
Creates a copy of the node, reusing the pointer in the current node. | |
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. | |
Public Attributes | |
SyntaxNode * | left |
SyntaxNode * | right |
Represents an operator.
OpNode::OpNode | ( | int | opCode, | |
SyntaxNode * | op1, | |||
SyntaxNode * | op2 = NULL | |||
) |
Referenced by clone(), and deep_copy().
OpNode * OpNode::clone | ( | ) | [virtual] |
Creates a copy of the node, reusing the pointer in the current node.
Reimplemented from SyntaxNode.
References left, SyntaxNode::opCode, OpNode(), and right.
OpNode * OpNode::deep_copy | ( | ) | [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 SyntaxNode::deep_copy(), left, SyntaxNode::opCode, OpNode(), and right.
void OpNode::findIDREF | ( | std::list< SyntaxNode * > * | lnd | ) | [inline, virtual] |
Find all the IDREF nodes at or below the current node.
Reimplemented from SyntaxNode.
References SyntaxNode::findIDREF(), left, and right.
void OpNode::findIDREF | ( | std::list< ModelComp * > & | lmc | ) | [inline] |
References SyntaxNode::findIDREF(), left, and right.
void OpNode::findOpCode | ( | int | oc, | |
std::list< SyntaxNode * > * | lnd | |||
) | [inline, virtual] |
Find all nodes of opCode oc at or below the current node.
Reimplemented from SyntaxNode.
References SyntaxNode::findOpCode(), left, and right.
ostream & OpNode::put | ( | std::ostream & | s | ) | const [virtual] |
Referenced by clone(), deep_copy(), findIDREF(), findOpCode(), OpNode(), and put().
Referenced by clone(), deep_copy(), findIDREF(), findOpCode(), OpNode(), and put().