cttl::policy_space< flag_follow_space > Struct Template Reference

Space policy specialization to skip white space characters ht, lf, vt, ff, cr, and space. More...

#include <policy.h>

Inheritance diagram for cttl::policy_space< flag_follow_space >:

cttl::policy_default cttl::policy_space< flag_greedy|flag_follow_space > cttl::policy_space< flag_greedy >

List of all members.

Static Public Member Functions

template<typename SubstrT >
static size_t match (SubstrT &substr_)
 Defines CTTL grammar production rule to evaluate grammar expression matching the white space.


Detailed Description

template<>
struct cttl::policy_space< flag_follow_space >

Space policy specialization to skip white space characters ht, lf, vt, ff, cr, and space.

Definition at line 469 of file policy.h.


Member Function Documentation

template<typename SubstrT >
static size_t cttl::policy_space< flag_follow_space >::match ( SubstrT &  substr_  )  [static]

Defines CTTL grammar production rule to evaluate grammar expression matching the white space.

Template Parameters:
SubstrT specifies type of the parseable substring, such as cttl::const_edge or cttl::edge.
Parameters:
substr_ references parseable substring.
Returns:
absolute position of the substring upper boundary after expression that matches white space is evaluated.
Postcondition:
The function must
  • always succeed
  • return a valid offset within the specified substring.
Remarks:
This implementation is ungreedy.

Reimplemented from cttl::policy_default.

Reimplemented in cttl::policy_space< flag_greedy|flag_follow_space >.

Definition at line 496 of file policy.h.

00497     {
00498         CTTL_TRACE_SILENT( true );
00499         typedef typename SubstrT::char_T char_T;
00500         size_t ungreedy_offset = substr_.first.offset();
00501         (
00502             true
00503             ^
00504             +(
00505                 symbol( char_T( ' ' ) )
00506                 |
00507                 symbol( char_T( '\n' ) )
00508                 |
00509                 symbol( char_T( '\r' ) )
00510                 |
00511                 symbol( char_T( '\t' ) )
00512                 |
00513                 symbol( char_T( '\v' ) )
00514                 |
00515                 symbol( char_T( '\f' ) )
00516             )
00517         ).match( substr_ );
00518         // policy_space is ungreedy:
00519         return ungreedy_offset;
00520     }


The documentation for this struct 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