|
pianod2
multisource multiuser scriptable networked music player
|
Evaluate a keyword in a command line. More...
#include <parsnip_evaluate.h>


Public Member Functions | |
| virtual Parsnip::Data | evaluateToken (ArgvCursor *cursor) const override |
| Store the current keyword as a string, if it's marked for recording. More... | |
| virtual Evaluator * | getNextEvaluator (const StringType &token) const override |
| Select an evaluator for the next element based on current token. More... | |
| virtual bool | operator== (const Evaluator &other) const override |
| Check if two evaluators are the same. More... | |
| virtual void | convertToOptionEvaluator () override |
| Make any changes to the parse tree to convert it to an options evaluator. More... | |
| virtual void | constructSchema (const DictionarySchema &scheme, const Schema::OptionSchemas &option_schemas, const SchemaIntegratorCallback &integrator) const override |
| Construct a schema from an evaluator tree. More... | |
| Evaluator ()=default | |
| Evaluator (Evaluator *original) | |
| Upgrade an evaluator. More... | |
Public Member Functions inherited from Parsnip::Evaluator | |
| Evaluator (Evaluator *original) | |
| Upgrade an evaluator. More... | |
| virtual | ~Evaluator ()=default |
| int | evaluate (ArgvCursor *cursor, Parsnip::Data &result_dict) |
| Evaluate a token in the command line, and recurse if there is more to go. More... | |
| bool | operator!= (const Evaluator &other) const |
Static Public Member Functions | |
| static bool | is_numeric (const std::string &value) |
| static std::string | tolower (std::string value) |
| static void | construct (EvaluatorRef &parser, const ArgvCursor &cursor, CommandId id, Parser *parent_parser, const std::string &name, std::string keywords) |
| Construct a keyword token handler. More... | |
Static Public Member Functions inherited from Parsnip::Evaluator | |
| static void | construct (EvaluatorRef &evaluator, const ArgvCursor &cursor, CommandId id, Parser *parent_parser) |
| Construct token handler from the token in a parsing definition. More... | |
Private Attributes | |
| EvaluatorRef | numeric_evaluator |
| std::unordered_map< StringType, EvaluatorRef > | tokens |
| bool | numbers_present {false} |
| True if some of the tokens are numeric. More... | |
Friends | |
| class | ValueEvaluator |
| class | OptionEvaluator |
Additional Inherited Members | |
Public Types inherited from Parsnip::Evaluator | |
| using | StringType = std::string |
| using | CommandId = int |
Protected Member Functions inherited from Parsnip::Evaluator | |
| Evaluator ()=default | |
| void | setCommandId (CommandId id) |
| Set the command ID in an evaluator. More... | |
Static Protected Member Functions inherited from Parsnip::Evaluator | |
| static void | set_name (EvaluatorRef &target, const std::string &name) |
| Assign a name by which to store values for value evaluators. More... | |
Protected Attributes inherited from Parsnip::Evaluator | |
| CommandId | command_id {NoCommand} |
| If this completes a command, the command ID. More... | |
| std::string | name |
| If not empty, the name by which this value shall be accessed. More... | |
Evaluate a keyword in a command line.
|
static |
Construct a keyword token handler.
Construct token handler accepting a list of literal strings from the parsing definition.
| parser | See Evaluator::construct |
| cursor | See Evaluator::construct |
| id | See Evaluator::construct |
| parent_parser | Passed through; see ValueEvaluator::construct. |
| name | The name by which to access the selected keyword. |
| keywords | The list of keywords, as an alternation string (a|b|c). |


|
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.
| 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. |
| NoSuchKey | A necessary option schema was not found. |
| SchemaConflict | Statement definitions generate schema inconsistencies. |
Implements Parsnip::Evaluator.

|
overridevirtual |
Make any changes to the parse tree to convert it to an options evaluator.
Implements Parsnip::Evaluator.

|
overridevirtual |
Store the current keyword as a string, if it's marked for recording.
Implements Parsnip::Evaluator.

|
default |
| Parsnip::Evaluator::Evaluator |
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.
|
overridevirtual |
Select an evaluator for the next element based on current token.
Implements Parsnip::Evaluator.

|
inlinestatic |

|
overridevirtual |
Check if two evaluators are the same.
Subclasses should override this to check their details.
| other | Another evaluator to which to compare. |
Reimplemented from Parsnip::Evaluator.
|
inlinestatic |

|
friend |
|
friend |
|
private |
True if some of the tokens are numeric.
|
private |
|
private |