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

cmt_regexp::iterator Class Reference

#include <cmt_regexp.h>

List of all members.

Public Member Functions

 iterator ()
 iterator (int pos, int length)
 iterator (const iterator &other)
int operator!= (const iterator &other) const
int operator== (const iterator &other) const
int operator< (const iterator &other) const
cmt_string operator() (const cmt_string &text) const

Static Public Member Functions

const iterator null ()

Public Attributes

int _pos
int _length


Constructor & Destructor Documentation

cmt_regexp::iterator::iterator  ) 
 

Definition at line 1635 of file cmt_regexp.cxx.

References _length, and _pos.

01636 {
01637   _pos = 0;
01638   _length = 0;
01639 }

cmt_regexp::iterator::iterator int  pos,
int  length
 

Definition at line 1641 of file cmt_regexp.cxx.

References _length, and _pos.

01642 {
01643   _pos = pos;
01644   _length = length;
01645 }

cmt_regexp::iterator::iterator const iterator other  ) 
 

Definition at line 1647 of file cmt_regexp.cxx.

References _length, and _pos.

01648 {
01649   _pos = other._pos;
01650   _length = other._length;
01651 }


Member Function Documentation

const cmt_regexp::iterator cmt_regexp::iterator::null  )  [static]
 

Definition at line 1628 of file cmt_regexp.cxx.

Referenced by cmt_regexp::end(), cmt_or_node::match(), cmt_and_node::match(), cmt_end_node::match(), cmt_begin_node::match(), cmt_one_more::match(), cmt_zero_more::match(), cmt_zero_one::match(), cmt_any_node::match(), cmt_not_char_list_node::match(), cmt_char_list_node::match(), cmt_string_node::match(), cmt_char_node::match(), and cmt_regexp_node::match().

01629 {
01630   static const iterator null_instance (-1, -1);
01631   
01632   return (null_instance);
01633 }

int cmt_regexp::iterator::operator!= const iterator other  )  const
 

Definition at line 1653 of file cmt_regexp.cxx.

References _length, and _pos.

01654 {
01655   return ((this->_pos != other._pos) ||
01656           (this->_length != other._length));
01657 }

cmt_string cmt_regexp::iterator::operator() const cmt_string text  )  const
 

Definition at line 1673 of file cmt_regexp.cxx.

References _length, _pos, and cmt_string::substr().

01674 {
01675   if (_pos == -1) return ("");
01676   if (_length <= 0) return ("");
01677 
01678   return (text.substr (_pos, _length));
01679 }

int cmt_regexp::iterator::operator< const iterator other  )  const
 

Definition at line 1665 of file cmt_regexp.cxx.

References _pos.

01666 {
01667   if (_pos == -1) return (0);
01668   if (other._pos == -1) return (0);
01669 
01670   return (_pos < other._pos);
01671 }

int cmt_regexp::iterator::operator== const iterator other  )  const
 

Definition at line 1659 of file cmt_regexp.cxx.

References _length, and _pos.

01660 {
01661   return ((this->_pos == other._pos) &&
01662           (this->_length == other._length));
01663 }


Member Data Documentation

int cmt_regexp::iterator::_length
 

Definition at line 42 of file cmt_regexp.h.

Referenced by MacroBuilder::build(), SetBuilder::build(), iterator(), cmt_or_node::match(), cmt_and_node::match(), cmt_one_more::match(), cmt_zero_more::match(), cmt_zero_one::match(), operator!=(), operator()(), operator==(), CmtModel::strict_expand(), and CmtModel::test_regexp().

int cmt_regexp::iterator::_pos
 

Definition at line 41 of file cmt_regexp.h.

Referenced by MacroBuilder::build(), SetBuilder::build(), iterator(), cmt_and_node::match(), operator!=(), operator()(), operator<(), operator==(), CmtModel::strict_expand(), and CmtModel::test_regexp().


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