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

xtl_primary Struct Template Reference

#include <xtl_primary.h>

Inheritance diagram for xtl_primary:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<typename DerivedT>
struct cttl_impl::xtl_primary< DerivedT >

Implements grammar evaluation methods of terminal symbol lexeme implementation classes.

Remarks:
Derived objects must implement functions
        template< typename UniverseT >
        size_t internal_match( UniverseT& edge_ );

        template< typename UniverseT >
        size_t internal_find( UniverseT& edge_ );
Postcondition:
If either internal_match(), or internal_find() succeed, they should:
    // 1. Set ending position of the matched symbol:
    edge_.first.offset( end_offset );

    // 2. Return starting position of the matched symbol:
    return begin_offset;

Definition at line 109 of file xtl_primary.h.

Public Member Functions

template<typename UniverseT>
size_t match (UniverseT &edge_)
 Implements grammar evaluation method for symbol match algorithm, starting at the upper boundary of the parseable universe.
template<typename UniverseT>
size_t find (UniverseT &edge_)
 Implements grammar evaluation method for symbol search algorithm, starting at the upper boundary of the parseable universe.
template<typename UniverseT>
size_t bang_find (UniverseT &edge_)
 Implements grammar evaluation method for repeatable search algorithm, starting at the upper boundary of the parseable universe.

Protected Member Functions

int primary_length (size_t upper_offset_, size_t lower_offset_) const
 Calculates length of the matched symbol.


Member Function Documentation

size_t bang_find UniverseT &  edge_  )  [inline]
 

Implements grammar evaluation method for repeatable search algorithm, starting at the upper boundary of the parseable universe.

UniverseT
Template parameter specifying type of the parseable universe. Can be either cttl::const_edge or cttl::edge.
Parameters:
edge_ reference to the parseable universe.
Postcondition:
If method succeeds, the universe, specified by the edge_ parameter, gets consumed accordingly to the size of the matched symbol.
Returns:
evaluation result: if method succeeds, it returns absolute offset corresponding to the upper boundary of the matched symbol. Otherwise, it returns UniverseT::string_T::npos, indicating that the evaluation method has failed.
Remarks:
CTTL lexeme delegates implementation of its bang_find() to find().

Reimplemented in xtl_char_symbol.

Definition at line 321 of file xtl_primary.h.

size_t find UniverseT &  edge_  )  [inline]
 

Implements grammar evaluation method for symbol search algorithm, starting at the upper boundary of the parseable universe.

UniverseT
Template parameter specifying type of the parseable universe. Can be either cttl::const_edge or cttl::edge.
Parameters:
edge_ reference to the parseable universe.
Postcondition:
If method succeeds, the universe, specified by the edge_ parameter, gets consumed accordingly to the size of the matched symbol.
Returns:
evaluation result: if method succeeds, it returns absolute offset corresponding to the upper boundary of the matched symbol. Otherwise, it returns UniverseT::string_T::npos, indicating that the evaluation method has failed.

Reimplemented in xtl_char_symbol.

Definition at line 219 of file xtl_primary.h.

size_t match UniverseT &  edge_  )  [inline]
 

Implements grammar evaluation method for symbol match algorithm, starting at the upper boundary of the parseable universe.

UniverseT
Template parameter specifying type of the parseable universe. Can be either cttl::const_edge or cttl::edge.
Parameters:
edge_ reference to the parseable universe.
Postcondition:
If method succeeds, the universe, specified by the edge_ parameter, gets consumed accordingly to the size of the matched symbol.
Returns:
evaluation result: if method succeeds, it returns absolute offset corresponding to the upper boundary of the matched symbol. Otherwise, it returns UniverseT::string_T::npos, indicating that the evaluation method has failed.

Reimplemented in xtl_iswhat_end, xtl_iswwhat_end, xtl_text_end, and xtl_text_ref_end.

Definition at line 136 of file xtl_primary.h.

int primary_length size_t  upper_offset_,
size_t  lower_offset_
const [inline, protected]
 

Calculates length of the matched symbol.

Parameters:
upper_offset_ points to upper boundary of the matched symbol.
lower_offset_ points to lower boundary of the matched symbol.
Returns:
length of the symbol.

Definition at line 339 of file xtl_primary.h.


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