Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

ReNode Class Reference

#include <re_node.hh>

Inheritance diagram for ReNode:

Inheritance graph
[legend]
Collaboration diagram for ReNode:

Collaboration graph
[legend]
List of all members.

Public Methods

 ReNode (const Position &pos_)
virtual ~ReNode ()
virtual ReNode* clone ()=0
virtual bool isLeaf ()
virtual int getChildCount ()=0
virtual ReNode& operator[] (int index)=0
virtual bool dfTraverse (ReNodeAlgo &algo)
const PositiongetPos () const
virtual void dump (ostream &os) const=0

Private Attributes

Position pos

Detailed Description

This is the regular expression nodes' interface. Such nodes are usually build by a IreNodeBuilder implementation. This interface only specifies the basic tree structure operations.

Definition at line 50 of file re_node.hh.


Constructor & Destructor Documentation

ReNode::ReNode ( const Position & pos_ ) [inline]
 

Definition at line 54 of file re_node.hh.

ReNode::~ReNode ( ) [inline, virtual]
 

Definition at line 58 of file re_node.hh.


Member Function Documentation

ReNode * ReNode::clone ( ) [pure virtual]
 

Creates a copy of the regexp parse tree rooted in this node.

Reimplemented in ReCatNode, ReOrNode, ReStarNode, ReCharNode, ReEotNode, and ReLambdaNode.

Referenced by ReStarNode::clone(), ReOrNode::clone(), ReCatNode::clone(), DfaReNodeBuilder::createPlusNode(), and ScannerSpec::updateStates().

bool ReNode::isLeaf ( ) [inline, virtual]
 

Returns true if this node is a leaf node.

Definition at line 68 of file re_node.hh.

int ReNode::getChildCount ( ) [pure virtual]
 

Returns the number of child nodes of this node.

Reimplemented in ReCatNode, ReOrNode, ReStarNode, ReCharNode, ReEotNode, and ReLambdaNode.

Referenced by dfTraverse(), and isLeaf().

ReNode & ReNode::operator[] ( int index ) [pure virtual]
 

Returns the index'th child of this node.

Precondition:
0 <= index <= getChildCount()

Reimplemented in ReCatNode, ReOrNode, ReStarNode, ReCharNode, ReEotNode, and ReLambdaNode.

bool ReNode::dfTraverse ( ReNodeAlgo & algo ) [virtual]
 

Generic depth-first traversal method. At each node, the () operator of the ReNodeAlgo object is invoked, with *this as argument. The traversal continues as long as the () operator returns true.

Definition at line 39 of file re_node.cc.

const Position & ReNode::getPos ( ) const [inline]
 

Definition at line 90 of file re_node.hh.

Referenced by ReLambdaNode::clone(), ReEotNode::clone(), ReCharNode::clone(), ReStarNode::clone(), ReOrNode::clone(), ReCatNode::clone(), and DfaSourceRe::dump().

void ReNode::dump ( ostream & os ) const [pure virtual]
 

Reimplemented in DfaSourceRe, ReCatNode, ReOrNode, ReStarNode, ReCharNode, ReEotNode, and ReLambdaNode.

Referenced by TokenDesc::dump().


Member Data Documentation

Position ReNode::pos [private]
 

Reimplemented in ReCharNode, ReEotNode, and ReLambdaNode.

Definition at line 100 of file re_node.hh.


The documentation for this class was generated from the following files:
Generated at Tue Jul 9 21:08:21 2002 for CppCC by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001