#include <xtl_primary.h>
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. |
CharT | specifies character type. |
Definition at line 844 of file xtl_primary.h.
cttl_impl::xtl_char_begin< CharT >::xtl_char_begin | ( | CharT | char_ | ) |
size_t cttl_impl::xtl_char_begin< CharT >::internal_find | ( | SubstrT & | edge_ | ) |
Implements search evaluation grammar evaluation algorithm.
SubstrT | specifies type of the parseable substring. Can be either cttl::const_edge or cttl::edge . |
edge_ | reference to the parseable substring. |
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 }
size_t cttl_impl::xtl_char_begin< CharT >::internal_match | ( | SubstrT & | edge_ | ) |
Implements match evaluation grammar evaluation algorithm.
SubstrT | specifies type of the parseable substring. Can be either cttl::const_edge or cttl::edge . |
edge_ | reference to the parseable substring. |
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 }