|
Public Types |
typedef std::list< basic_parser<
E > * > | parser_list |
typedef parser_list::iterator | parser_list_iterator |
typedef e_symbol_type | symbol_type |
enum | e_symbol_type { terminal_type,
non_terminal_type,
choice_type,
undefined_type
} |
| Enum defines only three basic types (+ undefined).
|
Public Member Functions |
| basic_parser (const char *name, symbol_type type=terminal_type) |
| The default constructor.
|
| basic_parser (const basic_parser &rhs) |
| The copy constructor.
|
virtual | ~basic_parser () |
| The destructor.
|
symbol_type | get_symbol_type () |
| Strategy specific method - returns the type of symbol.
|
virtual bool | is_valid () const =0 |
| Used for owned objects manipulation, redefined in basic_object_parser.
|
virtual void | invalidate ()=0 |
| Used for owned objects manipulation, redefined in basic_object_parser.
|
virtual unsigned long | parse (const E *buf, const unsigned long buf_length)=0 |
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)=0 |
virtual std::basic_ostream<
E > & | format (std::basic_ostream< E > &os)=0 |
| Used for formatting the class to output stream.
|
unsigned long | parsed_size () const |
| Returns the size of buffer succesfully parsed last time.
|
unsigned long | formatted_size () const |
| Returns the size of data succesfully formatted into output.
|
bool | is_parsed () const |
| Identifies whether last call to parse() was succesfull or not.
|
bool | is_formatted () const |
| Identifies whether formatting was succesfull by call to format().
|
virtual void | push_parsers (std::list< basic_parser< E > * > &the_parser_list) |
bool | change_parsed_flag (const bool the_parsed_flag=true) |
virtual const char * | get_name () |
virtual bool | try_next () |
virtual void | set_to_begin () |
Protected Member Functions |
virtual void | prepare_for_parsing () |
virtual void | trace_on_fly () |
virtual void | prepare_for_formatting () |
bool | change_formatted_flag (const bool the_formatted_flag=true) |
unsigned long | change_parsed_size (const unsigned long the_parsed_size) |
unsigned long | change_formatted_size (const unsigned long the_formatted_size) |
void | set_name (const char *name) |
Protected Attributes |
bool | m_is_parsed |
| Flag identifyng the result of last call to parse() method.
|
bool | m_is_formatted |
| Flag identifyng the result of last call to format() method.
|
unsigned long | m_parsed_size |
| The size of succesfully parsed data, can be zero, if parse() failed.
|
unsigned long | m_formatted_size |
| The size of succesfully formatted data, can be zero, if format() failed.
|
const char * | m_name |
| Used for trace and/or debugging.
|
symbol_type | m_type |
| The type of grammar symbol.
|