Public Member Functions | Public Attributes

OpNode Class Reference

Represents an operator. More...

#include <nodes.h>

Inheritance diagram for OpNode:
SyntaxNode

List of all members.

Public Member Functions

 OpNode (int opCode, SyntaxNode *op1, SyntaxNode *op2=NULL)
std::ostream & put (std::ostream &s) const
OpNodedeep_copy ()
 Creates a deep copy of the nodes: SyntaxNodes pointed to are recreated as well.
OpNodeclone ()
 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

SyntaxNodeleft
SyntaxNoderight

Detailed Description

Represents an operator.


Constructor & Destructor Documentation

OpNode::OpNode ( int  opCode,
SyntaxNode op1,
SyntaxNode op2 = NULL 
)

References left, and right.

Referenced by clone(), and deep_copy().


Member Function Documentation

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]

Reimplemented from SyntaxNode.

References ASSIGN, DEFINED, EQ, GE, GT, IN, LE, left, LT, NE, SyntaxNode::opCode, POWER, and right.


Member Data Documentation


The documentation for this class was generated from the following files: