#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_text_ref_first (StringT const *str_ptr_) | |
Constructs and initializes the object. |
StringT | specifies type of the encapsulated string. |
Definition at line 2724 of file xtl_primary.h.
cttl_impl::xtl_text_ref_first< StringT >::xtl_text_ref_first | ( | StringT const * | str_ptr_ | ) |
size_t cttl_impl::xtl_text_ref_first< StringT >::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. |
edge_
parameter, is consumed accordingly to the size of the matched symbol: // 1. The ending position of the matched symbol is set: edge_.first.offset( end_offset ); // 2. Starting position of the matched symbol is returned: return begin_offset;
SubstrT::string_T::npos
, indicating that the evaluation algorithm has failed. Definition at line 2826 of file xtl_primary.h.
02827 { 02828 typename SubstrT::string_T const& str = edge_.parent(); 02829 size_t new_offset = str.find_first_of( m_any_text, edge_.first.offset() ); 02830 if ( new_offset != SubstrT::string_T::npos ) { 02831 // successful find 02832 // set find ending position: at least one character 02833 // in this entity is present 02834 edge_.first.offset( new_offset + 1 ); 02835 CTTL_TRACE_TEXT_RESULT( true, 'F', m_any_text.c_str() ); 02836 return new_offset; 02837 } 02838 02839 CTTL_TRACE_TEXT_RESULT( false, 'F', m_any_text.c_str() ); 02840 return SubstrT::string_T::npos; 02841 }
size_t cttl_impl::xtl_text_ref_first< StringT >::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. |
edge_
parameter, is consumed accordingly to the size of the matched symbol: // 1. The ending position of the matched symbol is set: edge_.first.offset( end_offset ); // 2. Starting position of the matched symbol is returned: return begin_offset;
SubstrT::string_T::npos
, indicating that the evaluation algorithm has failed. Definition at line 2777 of file xtl_primary.h.
02778 { 02779 typename SubstrT::string_T const& str = edge_.parent(); 02780 if ( m_any_text.find( str[ edge_.first.offset() ] ) != SubstrT::string_T::npos ) { 02781 // successful match 02782 // set match starting position 02783 size_t match_offset = edge_.first.offset(); 02784 // ending position: at least one character 02785 // in this entity is present 02786 edge_.first.offset( edge_.first.offset() + 1 ); 02787 CTTL_TRACE_TEXT_RESULT( true, 'F', m_any_text.c_str() ); 02788 return match_offset; 02789 } 02790 02791 CTTL_TRACE_TEXT_RESULT( false, 'F', m_any_text.c_str() ); 02792 return SubstrT::string_T::npos; 02793 }