Main Page | Class Hierarchy | Class List | Directories | File List | Class Members

grammar_to_parser::basic_pattern_parser< E > Class Template Reference

#include <pattern_parser.h>

Inheritance diagram for grammar_to_parser::basic_pattern_parser< E >:

grammar_to_parser::basic_default_type_parser< E, std::basic_string< E > > grammar_to_parser::basic_object_parser< E, A > grammar_to_parser::basic_parser< E > List of all members.

Public Types

typedef std::basic_string< E > string_type

Public Member Functions

 basic_pattern_parser ()
 Default constructor.
 basic_pattern_parser (const std::basic_string< E > &pattern, int comparison_type=IGNORE_CASE|IGNORE_SPACE)
 basic_pattern_parser (const char *pattern, int comparison_type=IGNORE_CASE|IGNORE_SPACE)
 ~basic_pattern_parser ()
 Destructor.
virtual unsigned long parse (const E *buf, const unsigned long buf_length)
std::basic_istream< E > & parse (std::basic_istream< E > &is)
std::basic_string< E > widen (const char *pattern)

Protected Types

enum  comparison_type { IGNORE_SPACE = 1, IGNORE_CASE = 2 }

Protected Attributes

int comparison_type_
 Stores the type of comparison.

Private Member Functions

bool is_capital (const char cr)
bool is_space (const char cr)
bool compare (typename string_type::iterator &it, const E cr)

Detailed Description

template<typename E>
class grammar_to_parser::basic_pattern_parser< E >

Parse of pattern defined as string in constructor


Member Enumeration Documentation

template<typename E>
enum grammar_to_parser::basic_pattern_parser::comparison_type [protected]
 

Defines how pattern string will be compared with input buffer.

Enumeration values:
IGNORE_SPACE  White characters will be ignored in input.
IGNORE_CASE  Case insensitive compare.


Constructor & Destructor Documentation

template<typename E>
grammar_to_parser::basic_pattern_parser< E >::basic_pattern_parser const std::basic_string< E > &  pattern,
int  comparison_type = IGNORE_CASE | IGNORE_SPACE
[inline]
 

Constructor with definition of pattern as string parameter

Parameters:
pattern string pattern to be searched in input buffer during parsing
comparison_type specifies how string will be compared with input buffer


Member Function Documentation

template<typename E>
std::basic_istream< E > & grammar_to_parser::basic_pattern_parser< E >::parse std::basic_istream< E > &  is  )  [virtual]
 

The method succeedes if input is same as pattern passed to constructor

Implements grammar_to_parser::basic_parser< E >.

template<typename E>
unsigned long grammar_to_parser::basic_pattern_parser< E >::parse const E *  buf,
const unsigned long  buf_length
[virtual]
 

The method compares the pattern, passed as constructor parameter, with string stored in input buffer.

Parameters:
*buf the buffer containing input string
buf_length the length of buffer
Returns:
the size of parsed string, if succesfullt, otherwise zero

Implements grammar_to_parser::basic_parser< E >.


The documentation for this class was generated from the following file:
Generated on Sun Jul 2 18:39:47 2006 for grammar2parser.kdevelop by  doxygen 1.4.1