Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

cmt_regexp_node_set Class Reference

Inheritance diagram for cmt_regexp_node_set:

Inheritance graph
[legend]
Collaboration diagram for cmt_regexp_node_set:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 cmt_regexp_node_set ()
 cmt_regexp_node_set (cmt_regexp_node_set *father)
 ~cmt_regexp_node_set ()
cmt_regexp_node_setfather ()
void clear ()
void push (cmt_regexp_node *n)
cmt_regexp_nodepop ()
cmt_regexp_nodetop () const
int nodes () const
const cmt_regexp_nodenodeAt (int index) const
bool parentheses () const
void set_parentheses (bool value)
virtual void reduce ()
virtual void dump () const
void dump (const cmt_string &title) const

Protected Attributes

cmt_regexp_node_set_father
cmt_vector< cmt_regexp_node * > _nodes
bool _parentheses

Constructor & Destructor Documentation

cmt_regexp_node_set::cmt_regexp_node_set  ) 
 

Definition at line 845 of file cmt_regexp.cxx.

References _parentheses.

00845                                           : _father (0)
00846 {
00847   _parentheses = false;
00848 }

cmt_regexp_node_set::cmt_regexp_node_set cmt_regexp_node_set father  ) 
 

Definition at line 850 of file cmt_regexp.cxx.

References _parentheses, father(), and push().

00850                                                                      : _father (father)
00851 {
00852   if (father != 0) father->push (this);
00853   _parentheses = false;
00854 }

cmt_regexp_node_set::~cmt_regexp_node_set  ) 
 

Definition at line 856 of file cmt_regexp.cxx.

References clear().

00857 {
00858   clear ();
00859 }


Member Function Documentation

void cmt_regexp_node_set::clear  ) 
 

Definition at line 866 of file cmt_regexp.cxx.

References _nodes, cmt_vector< cmt_regexp_node * >::clear(), and cmt_vector< cmt_regexp_node * >::size().

Referenced by ~cmt_regexp_node_set().

00867 {
00868   int i;
00869   
00870   for (i = 0; i < _nodes.size (); i++)
00871     {
00872       cmt_regexp_node* n = _nodes[i];
00873       delete n;
00874     }
00875   _nodes.clear ();
00876 }

void cmt_regexp_node_set::dump const cmt_string title  )  const
 

Definition at line 935 of file cmt_regexp.cxx.

References _father, _nodes, _parentheses, cmt_regexp_node::dump(), cmt_vector< cmt_regexp_node * >::size(), tab(), and tab_level.

00936 {
00937   tab (); cout << "Set (" << this << ") father=" << _father << " pars=" << _parentheses << endl;
00938   for (int i = 0; i < _nodes.size (); i++)
00939     {
00940       cmt_regexp_node* n = _nodes[i];
00941       if (n != 0)
00942         {
00943           if (i > 0)
00944             {
00945               tab (); cout << title << endl;
00946             }
00947           tab_level++;
00948           n->dump ();
00949           tab_level--;
00950         }
00951     }
00952   tab (); cout << "EndSet (" << this << ")" << endl;
00953 }

void cmt_regexp_node_set::dump  )  const [virtual]
 

Reimplemented from cmt_regexp_node.

Reimplemented in cmt_and_node, and cmt_or_node.

Definition at line 930 of file cmt_regexp.cxx.

References tab().

Referenced by cmt_or_node::dump(), and cmt_and_node::dump().

00931 {
00932   tab (); cout << "regexp_node_set (" << this << ") " << endl;
00933 }

cmt_regexp_node_set * cmt_regexp_node_set::father  ) 
 

Definition at line 861 of file cmt_regexp.cxx.

References _father.

Referenced by cmt_regexp_node_set(), and cmt_regexp::set().

00862 {
00863   return (_father);
00864 }

const cmt_regexp_node * cmt_regexp_node_set::nodeAt int  index  )  const
 

Definition at line 911 of file cmt_regexp.cxx.

References _nodes.

00912 {
00913   return (_nodes[index]);
00914 }

int cmt_regexp_node_set::nodes  )  const
 

Definition at line 906 of file cmt_regexp.cxx.

References _nodes, and cmt_vector< cmt_regexp_node * >::size().

Referenced by cmt_and_node::fill(), and cmt_regexp::set().

00907 {
00908   return (_nodes.size ());
00909 }

bool cmt_regexp_node_set::parentheses  )  const
 

Definition at line 916 of file cmt_regexp.cxx.

References _parentheses.

Referenced by cmt_regexp::set().

00917 {
00918   return (_parentheses);
00919 }

cmt_regexp_node * cmt_regexp_node_set::pop  ) 
 

Definition at line 883 of file cmt_regexp.cxx.

References _nodes, cmt_regexp_node::null(), and cmt_vector< cmt_regexp_node * >::size().

Referenced by cmt_regexp::set().

00884 {
00885   if (_nodes.size () == 0) return (&cmt_regexp_node::null ());
00886   
00887   int index = _nodes.size () - 1;
00888   
00889   cmt_regexp_node* n = _nodes[index];
00890   _nodes.erase (index);
00891   
00892   return (n);
00893 }

void cmt_regexp_node_set::push cmt_regexp_node n  ) 
 

Definition at line 878 of file cmt_regexp.cxx.

References _nodes, and cmt_vector< cmt_regexp_node * >::push_back().

Referenced by cmt_regexp_node_set(), cmt_and_node::fill(), and cmt_regexp::set().

00879 {
00880   _nodes.push_back (n);
00881 }

void cmt_regexp_node_set::reduce  )  [virtual]
 

Reimplemented in cmt_and_node.

Definition at line 926 of file cmt_regexp.cxx.

Referenced by cmt_regexp::set().

00927 {
00928 }

void cmt_regexp_node_set::set_parentheses bool  value  ) 
 

Definition at line 921 of file cmt_regexp.cxx.

References _parentheses.

Referenced by cmt_regexp::set().

00922 {
00923   _parentheses = value;
00924 }

cmt_regexp_node * cmt_regexp_node_set::top  )  const
 

Definition at line 895 of file cmt_regexp.cxx.

References _nodes, cmt_regexp_node::null(), and cmt_vector< cmt_regexp_node * >::size().

Referenced by cmt_regexp::set().

00896 {
00897   if (_nodes.size () == 0) return (&cmt_regexp_node::null ());
00898   
00899   int index = _nodes.size () - 1;
00900   
00901   cmt_regexp_node* n = _nodes[index];
00902   
00903   return (n);
00904 }


Member Data Documentation

cmt_regexp_node_set* cmt_regexp_node_set::_father [protected]
 

Definition at line 181 of file cmt_regexp.cxx.

Referenced by dump(), and father().

cmt_vector<cmt_regexp_node*> cmt_regexp_node_set::_nodes [protected]
 

Definition at line 182 of file cmt_regexp.cxx.

Referenced by clear(), dump(), cmt_and_node::fill(), nodeAt(), nodes(), pop(), push(), and top().

bool cmt_regexp_node_set::_parentheses [protected]
 

Definition at line 183 of file cmt_regexp.cxx.

Referenced by cmt_regexp_node_set(), dump(), parentheses(), and set_parentheses().


The documentation for this class was generated from the following file:
Generated on Mon May 2 10:25:31 2005 for CMT by doxygen 1.3.5