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

cmt_char_node Class Reference

Inheritance diagram for cmt_char_node:

Inheritance graph
[legend]
Collaboration diagram for cmt_char_node:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 cmt_char_node (char c)
const cmt_regexp::iterator match (const cmt_string &text, int pos) const
bool is_char () const
 operator char ()
void dump () const

Private Attributes

char _c

Constructor & Destructor Documentation

cmt_char_node::cmt_char_node char  c  ) 
 

Definition at line 312 of file cmt_regexp.cxx.

References _c.

00313 {
00314   _c = c;
00315 }


Member Function Documentation

void cmt_char_node::dump  )  const [virtual]
 

Reimplemented from cmt_regexp_node.

Definition at line 345 of file cmt_regexp.cxx.

References _c, and tab().

00346 {
00347   tab (); cout << "char>(" << this << ") c=" << _c << endl;
00348 }

bool cmt_char_node::is_char  )  const [virtual]
 

Reimplemented from cmt_regexp_node.

Definition at line 335 of file cmt_regexp.cxx.

00336 {
00337   return (true);
00338 }

const cmt_regexp::iterator cmt_char_node::match const cmt_string text,
int  pos
const [virtual]
 

Reimplemented from cmt_regexp_node.

Definition at line 317 of file cmt_regexp.cxx.

References _c, cmt_regexp::iterator::null(), and cmt_string::size().

00319 {
00320   if ((pos < 0) || (pos > text.size ())) 
00321     {
00322       return (cmt_regexp::iterator::null ());
00323     }
00324 
00325   char c = text[pos];
00326 
00327   if (c == _c)
00328     {
00329       return (cmt_regexp::iterator (pos, 1));
00330     }
00331   
00332   return (cmt_regexp::iterator::null ());
00333 }

cmt_char_node::operator char  ) 
 

Definition at line 340 of file cmt_regexp.cxx.

References _c.

00341 {
00342   return (_c);
00343 }


Member Data Documentation

char cmt_char_node::_c [private]
 

Definition at line 63 of file cmt_regexp.cxx.

Referenced by cmt_char_node(), dump(), match(), and operator char().


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