Evaluate a value/fill-in field.
More...
#include <parsnip_evaluate.h>
|
| static void | construct (EvaluatorRef &parser, const ArgvCursor &cursor, CommandId id, Parser *parent_parser, std::string name, std::string keywords) |
| | Construct a value/fill-in token handler.
|
| |
| static void | construct (EvaluatorRef &evaluator, const ArgvCursor &cursor, CommandId id, Parser *parent_parser) |
| | Construct token handler from the token in a parsing definition.
|
| |
|
|
EvaluatorRef | next_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.
|
| |
|
|
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.
|
| |
Evaluate a value/fill-in field.
◆ construct()
| void Parsnip::ValueEvaluator::construct |
( |
EvaluatorRef & |
parser, |
|
|
const ArgvCursor & |
cursor, |
|
|
CommandId |
id, |
|
|
Parser * |
parent_parser, |
|
|
std::string |
name, |
|
|
std::string |
format |
|
) |
| |
|
static |
Construct a value/fill-in token handler.
Construct token handler accepting a fixed list of values from the parsing definition.
- Parameters
-
| parser | See Evaluator::construct |
| cursor | See Evaluator::construct |
| id | See Evaluator::construct |
| parent_parser | The containing parser, with previously constructed option parsers that may be referenced. |
| name | The name by which to access the selected keyword. |
| format | Format and range details for numbers. Construct a value/fill-in token handler |
◆ constructSchema()
| void Parsnip::ValueEvaluator::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.
◆ convertToOptionEvaluator()
| void Parsnip::ValueEvaluator::convertToOptionEvaluator |
( |
| ) |
|
|
overridevirtual |
Make any changes to the parse tree to convert it to an options evaluator.
Implements Parsnip::Evaluator.
◆ Evaluator()
| Parsnip::Evaluator::Evaluator |
( |
Evaluator * |
original | ) |
|
Upgrade an evaluator.
The original must be a TerminatorEvaluator; other type should never be upgraded. Herein we initialize the new evaluator with the relevant bits.
◆ getNextEvaluator()
| Evaluator * Parsnip::ValueEvaluator::getNextEvaluator |
( |
const StringType & |
token | ) |
const |
|
overrideprotectedvirtual |
Determine if and how to evaluate additional command line tokens.
- Parameters
-
| token | The current token being evaluated. |
- Returns
- The evaluator for the next token, or nullptr if evaluation is complete.
Implements Parsnip::Evaluator.
◆ operator==()
| bool Parsnip::ValueEvaluator::operator== |
( |
const Evaluator & |
other | ) |
const |
|
overridevirtual |
The documentation for this class was generated from the following files: