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

grammar_to_parser::basic_list_parser< E, A, S > Class Template Reference

#include <list_parser.h>

Inheritance diagram for grammar_to_parser::basic_list_parser< E, A, S >:

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

Public Types

typedef std::list< A > parser_list

Public Member Functions

 basic_list_parser (int min_size, int max_size)
template<class R>
void get_list (std::list< R > &l)
unsigned long parse (const E *buf, const unsigned long buf_length)
std::basic_istream< E > & parse (std::basic_istream< E > &is)
std::basic_ostream< E > & format (std::basic_ostream< E > &os)

Protected Attributes

int m_min
int m_max

Private Types

typedef std::list< A > std_list_A
typedef std_list_A::iterator std_list_A_iterator
typedef basic_parser< E
>::parser_list 
parser_list
typedef basic_parser< E
>::parser_list_iterator 
parser_list_iterator

Detailed Description

template<class E, class A, class S = basic_terminal<E,'\n'>>
class grammar_to_parser::basic_list_parser< E, A, S >

Helper parser for parsing a list of parsers, where A is any parser. For example: basic_list_parser< char,terminal<'b'> > can be used to parse word "bb" or "bbbbb" etc. So it substitues grammar like: S=> bS | b (saves little effort and some classes declarations). E = input element (char, wchar_t ...) A = parser being stored in list S = separator parser


Member Function Documentation

template<class E, class A, class S = basic_terminal<E,'\n'>>
std::basic_ostream<E>& grammar_to_parser::basic_list_parser< E, A, S >::format std::basic_ostream< E > &  os  )  [inline, virtual]
 

Formats the parsed word back into output stream.

Implements grammar_to_parser::basic_parser< E >.

template<class E, class A, class S = basic_terminal<E,'\n'>>
std::basic_istream<E>& grammar_to_parser::basic_list_parser< E, A, S >::parse std::basic_istream< E > &  is  )  [inline, virtual]
 

The method continues with parsing, until A::parse doesn't fail.

Implements grammar_to_parser::basic_parser< E >.

template<class E, class A, class S = basic_terminal<E,'\n'>>
unsigned long grammar_to_parser::basic_list_parser< E, A, S >::parse const E *  buf,
const unsigned long  buf_length
[inline, virtual]
 

The method continues with parsing, until A::parse doesn't fail.

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:46 2006 for grammar2parser.kdevelop by  doxygen 1.4.1