Public Member Functions | Private Attributes

IDNode Class Reference

A node on the tree representing a user identifier (ie variable name). More...

#include <nodes.h>

Inheritance diagram for IDNode:
SyntaxNode

List of all members.

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
SyntaxNodedeep_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

Detailed Description

A node on the tree representing a user identifier (ie variable name).


Constructor & Destructor Documentation

IDNode::IDNode ( const std::string &  name,
long  stochparent = 0 
)

Referenced by deep_copy().


Member Function Documentation

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]

Return the value of this node as a string.

Reimplemented from SyntaxNode.

References name.

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().


Member Data Documentation

std::string IDNode::name [private]

Referenced by deep_copy(), getValue(), id(), put(), and setName().


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