|
xorp
|
A lex/yacc wrapper which parses a configuration and returns nodes. More...
#include <parser.hh>
Public Types | |
| typedef vector< Node * > | Nodes |
Public Member Functions | |
| Nodes * | parse (const Term::BLOCKS &block, const string &text) |
| string | last_error () |
| This should be called if parse returns null. | |
| int | parse (const string &str) const |
| bool | add_command (Command *command) |
| bool | add_argtype (ArgumentParser *arg) |
Private Member Functions | |
| ArgumentParser * | get_argument_parser (const string &name) const |
| int | split_into_words (const string &str, vector< string > &words) const |
Private Attributes | |
| string | _last_error |
| char | _separator |
| map< string, Command * > | _templates |
| map< string, ArgumentParser * > | _argtypes |
A lex/yacc wrapper which parses a configuration and returns nodes.
This class parses a raw user configuration and returns a vector of nodes.
Each node will normally relate to a single statement. The vector of nodes reflects all the statements present.
| string Parser::last_error | ( | ) |
| Parser::Nodes * Parser::parse | ( | const Term::BLOCKS & | block, |
| const string & | text | ||
| ) |
| block | the term block which is being parsed [action/src/dest]. |
| text | Configuration to parse. |