pianod2
multisource multiuser scriptable networked music player
Private Member Functions | List of all members
Parsnip::TerminatorEvaluator Class Reference

An evaluator representing abrupt end of the command pattern. More...

#include <parsnip_evaluate.h>

Inheritance diagram for Parsnip::TerminatorEvaluator:
Inheritance graph
[legend]
Collaboration diagram for Parsnip::TerminatorEvaluator:
Collaboration graph
[legend]

Private Member Functions

virtual EvaluatorgetNextEvaluator (const StringType &value) const override
 An evaluator representing abrupt end of the command pattern. More...
 
virtual Parsnip::Data evaluateToken (ArgvCursor *cursor) const override
 Evaluate command line tokens. 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...
 

Additional Inherited Members

- Public Types inherited from Parsnip::Evaluator
using StringType = std::string
 
using CommandId = int
 
- 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...
 
virtual bool operator== (const Evaluator &) const
 Check if two evaluators are the same. More...
 
bool operator!= (const Evaluator &other) const
 
- 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...
 
- 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...
 

Detailed Description

An evaluator representing abrupt end of the command pattern.

Member Function Documentation

◆ constructSchema()

void Parsnip::TerminatorEvaluator::constructSchema ( const DictionarySchema schema,
const Schema::OptionSchemas option_schemas,
const SchemaIntegratorCallback integrator 
) const
overrideprivatevirtual

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
schemaThe schema, as constructed from the parse tree root.
option_schemasSchemas for option parsers that may be needed.
integratorAn integrator that merges various statement patterns into a complete schema.
Exceptions
NoSuchKeyA necessary option schema was not found.
SchemaConflictStatement definitions generate schema inconsistencies.

Implements Parsnip::Evaluator.

◆ convertToOptionEvaluator()

void Parsnip::TerminatorEvaluator::convertToOptionEvaluator ( )
overrideprivatevirtual

Make any changes to the parse tree to convert it to an options evaluator.

Implements Parsnip::Evaluator.

◆ evaluateToken()

Parsnip::Data Parsnip::TerminatorEvaluator::evaluateToken ( ArgvCursor cursor) const
overrideprivatevirtual

Evaluate command line tokens.

Parameters
cursorProvides tokens from the command line. Must be bumped forward as they are processed.
Returns
Parsnip data object containing evaluated token.

Implements Parsnip::Evaluator.

◆ getNextEvaluator()

Evaluator * Parsnip::TerminatorEvaluator::getNextEvaluator ( const StringType value) const
overrideprivatevirtual

An evaluator representing abrupt end of the command pattern.

Implements Parsnip::Evaluator.


The documentation for this class was generated from the following files: