|
pianod2
multisource multiuser scriptable networked music player
|
A class for parsing command lines. More...
#include <parsnip_command.h>

Classes | |
| struct | Definition |
| struct | Result |
Public Types | |
| using | CommandId = int |
| using | StringType = std::string |
| using | Definitions = std::vector< Definition > |
Public Member Functions | |
| Parser ()=default | |
| Parser (const Definitions &defs) | |
| Construct a parser and initialize it with some statements. More... | |
| virtual | ~Parser ()=default |
| void | addOptionParser (const std::string &name, const OptionParserRef &add) |
| Register an options parser for use. More... | |
| void | addStatements (const Definitions &defs) |
| Add statements to the parser. More... | |
| Result | evaluate (const StringType &command) const |
| Evaluate a command. More... | |
| bool | operator== (const Parser &) const |
| Check if a parser is identical to another parser. More... | |
| bool | operator!= (const Parser &other) const |
Private Types | |
| using | OptionParsers = std::unordered_map< std::string, OptionParserRef > |
Private Attributes | |
| EvaluatorRef | evaluator |
| OptionParsers | option_parsers |
Friends | |
| class | OptionEvaluator |
| class | SchemaSet |
A class for parsing command lines.
| using Parsnip::Parser::CommandId = int |
| using Parsnip::Parser::Definitions = std::vector<Definition> |
|
private |
| using Parsnip::Parser::StringType = std::string |
|
default |
| Parsnip::Parser::Parser | ( | const Definitions & | defs | ) |
Construct a parser and initialize it with some statements.
| defs | The statement definitions. |

|
virtualdefault |
| void Parsnip::Parser::addOptionParser | ( | const std::string & | name, |
| const OptionParserRef & | add | ||
| ) |
Register an options parser for use.
| name | The option parser's name. |
| add | The option parser to register. |


| void Parsnip::Parser::addStatements | ( | const Definitions & | defs | ) |
Add statements to the parser.
| defs | The statement definitions. |


| Parser::Result Parsnip::Parser::evaluate | ( | const StringType & | command | ) | const |
Evaluate a command.
| command | the command. |
| Exceptions | representing various command errors. |

|
inline |
| bool Parsnip::Parser::operator== | ( | const Parser & | other | ) | const |
Check if a parser is identical to another parser.
|
friend |
|
friend |
|
private |
|
private |