Evaluate remainder with a different parser.
More...
#include <parsnip_evaluate.h>
|
| static std::vector< OptionEvaluator * > | construct (EvaluatorRef &evaluator, std::string option_parser_type, bool iterative, const Parser *parent_parser) |
| | Construct an evaluator (or validate the existing validator) that parsers the remainder with an option parser.
|
| |
| static void | construct (EvaluatorRef &evaluator, const ArgvCursor &cursor, CommandId id, Parser *parent_parser) |
| | Construct token handler from the token in a parsing definition.
|
| |
|
|
using | StringType = std::string |
| |
|
using | CommandId = int |
| |
| static void | set_name (EvaluatorRef &target, const std::string &name) |
| | Assign a name by which to store values for value evaluators.
|
| |
Protected Attributes inherited from Parsnip::RemainderEvaluator |
|
EvaluatorRef | terminating_evaluator |
| |
|
CommandId | command_id {NoCommand} |
| | If this completes a command, the command ID.
|
| |
|
std::string | name |
| | If not empty, the name by which this value shall be accessed.
|
| |
Evaluate remainder with a different parser.
◆ construct()
| std::vector< OptionEvaluator * > Parsnip::OptionEvaluator::construct |
( |
EvaluatorRef & |
evaluator, |
|
|
std::string |
option_parser_type, |
|
|
bool |
iterative, |
|
|
const Parser * |
parent_parser |
|
) |
| |
|
static |
Construct an evaluator (or validate the existing validator) that parsers the remainder with an option parser.
- Parameters
-
| evaluator | The evaluator being constructed. |
| option_parser_type | The name of the option parser to use. |
| iterative | If true, option parser should iterate. |
| parent_parser | The containing parser, with previously-defined option parsers to utilize. |
◆ constructSchema()
| void Parsnip::OptionEvaluator::constructSchema |
( |
const DictionarySchema & |
schema, |
|
|
const Schema::OptionSchemas & |
option_schemas, |
|
|
const SchemaIntegratorCallback & |
integrator |
|
) |
| const |
|
overridevirtual |
Construct a schema from an evaluator tree.
This function depth-first searches the evaluation tree, calling the integrator function at leaf nodes and other valid statement endpoints.
- Parameters
-
| schema | The schema, as constructed from the parse tree root. |
| option_schemas | Schemas for option parsers that may be needed. |
| integrator | An integrator that merges various statement patterns into a complete schema. |
- Exceptions
-
| NoSuchKey | A necessary option schema was not found. |
| SchemaConflict | Statement definitions generate schema inconsistencies. |
Implements Parsnip::Evaluator.
◆ evaluateToken()
Evaluate command line tokens.
- Parameters
-
| cursor | Provides tokens from the command line. Must be bumped forward as they are processed. |
- Returns
- Parsnip data object containing evaluated token.
Implements Parsnip::Evaluator.
◆ operator==()
| bool Parsnip::OptionEvaluator::operator== |
( |
const Evaluator & |
other | ) |
const |
|
overridevirtual |
Check if two evaluators are the same.
Subclasses should override this to check their details.
- Parameters
-
| other | Another evaluator to which to compare. |
Reimplemented from Parsnip::RemainderEvaluator.
The documentation for this class was generated from the following files: