Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

policy_space< flag_follow_space > Struct Template Reference

#include <policy.h>

Inheritance diagram for policy_space< flag_follow_space >:

Inheritance graph
[legend]
Collaboration diagram for policy_space< flag_follow_space >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<>
struct cttl::policy_space< flag_follow_space >

This policy instructs cttl lexer to automatically skip white space characters ht, lf, vt, ff, cr, and space.

Definition at line 418 of file policy.h.

Public Member Functions

template<typename UniverseT>
size_t match (UniverseT &universe_)
 Defines production rule function to evaluate grammar expression describing white space.


Member Function Documentation

size_t match UniverseT &  universe_  )  [inline]
 

Defines production rule function to evaluate grammar expression describing white space.

UniverseT
Template parameter specifying type of the parseable universe. Can be either cttl::const_edge or cttl::edge.
Parameters:
universe_ reference to the parseable universe.
Returns:
absolute position of the universe upper boundary after white space expression has been evaluated.
Postcondition:
The match() function must always succeed and supposed to return a valid offset within specified universe of discourse.
Remarks:
Default policy supports strict grammar evaluation of the user input. The implementation of method match is empty, therefore, it does no white space recognition. During grammar evaluation, the lexer implementation invokes match() function of the white space policy class, giving it a chance to modify upper boundary of the universe accordingly to the definition of white space. If match() function returns position before the white space, its behavior is described as non-greedy white space evaluation. On the other hand, if the function returns position immediately after the white space, the behavior is greedy. Non-greedy evaluations consume white space symbols, but offer capability to backtrack to the original position if necessary. The greedy version, on the other hand, consumes white space and suggests newly modified offset for future backtracking attempts.

Reimplemented from policy_default.

Reimplemented in policy_space< flag_greedy|flag_follow_space >.

Definition at line 421 of file policy.h.

References cttl::symbol().


The documentation for this struct was generated from the following file:
Generated on Thu Nov 2 17:45:05 2006 for Common Text Transformation Library by  doxygen 1.3.9.1