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

policy_space< flag_cpp_comments > Struct Template Reference

#include <policy.h>

Inheritance diagram for policy_space< flag_cpp_comments >:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

template<>
struct cttl::policy_space< flag_cpp_comments >

Typical C++ white space, including C and C++ style comments.

Definition at line 598 of file policy.h.

Static 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, static]
 

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_cpp_comments >.

Definition at line 601 of file policy.h.

References cttl::rule().


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