A class for parsing command lines.
More...
#include <parsnip_command.h>
|
using | CommandId = int |
|
using | StringType = std::string |
|
using | Definitions = std::vector< Definition > |
|
|
| Parser (const Definitions &defs) |
| Construct a parser and initialize it with some statements. More...
|
|
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.
|
|
bool | operator!= (const Parser &other) const |
|
|
class | OptionEvaluator |
|
class | SchemaSet |
|
A class for parsing command lines.
◆ Parser()
Parsnip::Parser::Parser |
( |
const Definitions & |
defs | ) |
|
Construct a parser and initialize it with some statements.
- Parameters
-
defs | The statement definitions. |
◆ addOptionParser()
void Parsnip::Parser::addOptionParser |
( |
const std::string & |
name, |
|
|
const OptionParserRef & |
add |
|
) |
| |
Register an options parser for use.
- Parameters
-
name | The option parser's name. |
add | The option parser to register. |
◆ addStatements()
void Parsnip::Parser::addStatements |
( |
const Definitions & |
defs | ) |
|
Add statements to the parser.
- Parameters
-
defs | The statement definitions. |
◆ evaluate()
Parser::Result Parsnip::Parser::evaluate |
( |
const StringType & |
command | ) |
const |
Evaluate a command.
- Parameters
-
- Returns
- A result, which contains the command ID and extracted parameters.
- Exceptions
-
Exceptions | representing various command errors. |
The documentation for this class was generated from the following files: