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

grammar_to_parser::basic_choice< E, A > Class Template Reference

#include <choice.h>

Inheritance diagram for grammar_to_parser::basic_choice< E, A >:

grammar_to_parser::basic_non_terminal< E, A > grammar_to_parser::basic_object_parser< E, A > grammar_to_parser::basic_parser< E > List of all members.

Public Types

typedef basic_parser< E
>::parser_list 
parser_list
typedef basic_parser< E
>::parser_list_iterator 
parser_list_iterator

Public Member Functions

 basic_choice ()
 Default constructor.
 basic_choice (const basic_choice &rhs)
 Copy constructor.
 basic_choice (const A &obj)
 Constructor taking a compound object.
virtual ~basic_choice ()
 Destructor.
virtual unsigned long parse (const E *buf, const unsigned long buf_length)
virtual unsigned long parse (const E *buf, const unsigned long buf_length, basic_parser_strategy< E > &strategy)
virtual std::basic_istream<
E > & 
parse (std::basic_istream< E > &is)

Detailed Description

template<typename E, typename A>
class grammar_to_parser::basic_choice< E, A >

Choice as special case of nonterminal_type - parsed if one of symbols is parsed - this template class can be replaced by universal_non_terminal<> and by definition of strategy parsing one of symbols


Member Function Documentation

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

The method tries to parse any of the symbols, stops when finds the first successive parser

Reimplemented from grammar_to_parser::basic_non_terminal< E, A >.

template<typename E, typename A>
unsigned long grammar_to_parser::basic_choice< E, A >::parse const E *  buf,
const unsigned long  buf_length,
basic_parser_strategy< E > &  strategy
[virtual]
 

The method calls the proper strategy method - parse_choice.

Reimplemented from grammar_to_parser::basic_non_terminal< E, A >.

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

The method tries to parse any of the symbols, stops when finds the first successive parser

Parameters:
*buf Buffer containing the word to be parsed
buf_length The length of word, size of buffer
Returns:
The length of succesfully parsed word

Reimplemented from grammar_to_parser::basic_non_terminal< E, A >.


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