cttl_impl::xtl_char_begin< CharT > Class Template Reference

Implements behavior of begin(char), upper boundary of single character literal lexeme inside CTTL grammar expression. More...

#include <xtl_primary.h>

Inheritance diagram for cttl_impl::xtl_char_begin< CharT >:

cttl_impl::xtl_primary< xtl_char_begin< CharT > >

List of all members.

Public Member Functions

template<typename SubstrT >
size_t internal_find (SubstrT &edge_)
 Implements search evaluation grammar evaluation algorithm.
template<typename SubstrT >
size_t internal_match (SubstrT &edge_)
 Implements match evaluation grammar evaluation algorithm.
 xtl_char_begin (CharT char_)
 Constructs and initializes the object.


Detailed Description

template<typename CharT>
class cttl_impl::xtl_char_begin< CharT >

Implements behavior of begin(char), upper boundary of single character literal lexeme inside CTTL grammar expression.

Template Parameters:
CharT specifies character type.

Definition at line 844 of file xtl_primary.h.


Constructor & Destructor Documentation

template<typename CharT >
cttl_impl::xtl_char_begin< CharT >::xtl_char_begin ( CharT  char_  ) 

Constructs and initializes the object.

Definition at line 854 of file xtl_primary.h.

00855     : m_char( char_ )
00856     {
00857         }


Member Function Documentation

template<typename CharT >
template<typename SubstrT >
size_t cttl_impl::xtl_char_begin< CharT >::internal_find ( SubstrT &  edge_  ) 

Implements search evaluation grammar evaluation algorithm.

Template Parameters:
SubstrT specifies type of the parseable substring. Can be either cttl::const_edge or cttl::edge.
Parameters:
edge_ reference to the parseable substring.
Returns:
evaluation result: if algorithm succeeds, it returns absolute offset corresponding to the upper boundary of the matched symbol. Otherwise, it returns SubstrT::string_T::npos, indicating that the evaluation algorithm has failed.

Definition at line 912 of file xtl_primary.h.

00913     {
00914         size_t new_offset = edge_.parent().find( m_char, edge_.first.offset() );
00915         if ( new_offset != SubstrT::string_T::npos ) {
00916             // successful find
00917             // set find ending position
00918             edge_.first.offset( new_offset );
00919             CTTL_TRACE_TEXT_RESULT( true, m_char, "begin( char )" );
00920             return new_offset;
00921         }
00922 
00923         CTTL_TRACE_TEXT_RESULT( false, m_char, "begin( char )" );
00924         return SubstrT::string_T::npos;
00925     }

template<typename CharT >
template<typename SubstrT >
size_t cttl_impl::xtl_char_begin< CharT >::internal_match ( SubstrT &  edge_  ) 

Implements match evaluation grammar evaluation algorithm.

Template Parameters:
SubstrT specifies type of the parseable substring. Can be either cttl::const_edge or cttl::edge.
Parameters:
edge_ reference to the parseable substring.
Returns:
evaluation result: if algorithm succeeds, it returns absolute offset corresponding to the upper boundary of the matched symbol. Otherwise, it returns SubstrT::string_T::npos, indicating that the evaluation algorithm has failed.

Definition at line 880 of file xtl_primary.h.

00881     {
00882         if ( edge_.parent()[ edge_.first.offset() ] == m_char ) {
00883             // successful match
00884             CTTL_TRACE_TEXT_RESULT( true, m_char, "begin( char )" );
00885             // set match starting position
00886             return edge_.first.offset();
00887         }
00888 
00889         CTTL_TRACE_TEXT_RESULT( false, m_char, "begin( char )" );
00890         return SubstrT::string_T::npos;
00891     }


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

Generated on Sun Aug 23 13:43:45 2009 for Common Text Transformation Library by  doxygen 1.5.9