pianod2
multisource multiuser scriptable networked music player
Public Member Functions | Protected Attributes | Friends | List of all members
Parsnip::RemainderEvaluator Class Reference

An evaluator that represents the rest of the command line. More...

#include <parsnip_evaluate.h>

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

Public Member Functions

virtual EvaluatorgetNextEvaluator (const StringType &value) const override
 An evaluator that represents the rest of the command line. 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...
 
 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
 

Protected Attributes

EvaluatorRef terminating_evaluator
 
- 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...
 

Friends

class Evaluator
 
class RemainingValuesEvaluator
 
class ValueEvaluator
 

Additional Inherited Members

- Public Types inherited from Parsnip::Evaluator
using StringType = std::string
 
using CommandId = int
 
- 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...
 
virtual Parsnip::Data evaluateToken (class ArgvCursor *cursor) const =0
 Evaluate command line tokens. More...
 
virtual void constructSchema (const DictionarySchema &schema, const Schema::OptionSchemas &option_schemas, const SchemaIntegratorCallback &integrator) const =0
 Construct a schema from an evaluator tree. 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...
 

Detailed Description

An evaluator that represents the rest of the command line.

Member Function Documentation

◆ convertToOptionEvaluator()

void Parsnip::RemainderEvaluator::convertToOptionEvaluator ( )
overridevirtual

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

Implements Parsnip::Evaluator.

Here is the call graph for this function:

◆ Evaluator() [1/2]

Parsnip::Evaluator::Evaluator
default

◆ Evaluator() [2/2]

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.

◆ getNextEvaluator()

Evaluator * Parsnip::RemainderEvaluator::getNextEvaluator ( const StringType value) const
overridevirtual

An evaluator that represents the rest of the command line.

Implements Parsnip::Evaluator.

◆ operator==()

bool Parsnip::RemainderEvaluator::operator== ( const Evaluator other) const
overridevirtual

Check if two evaluators are the same.

Subclasses should override this to check their details.

Parameters
otherAnother evaluator to which to compare.

Reimplemented from Parsnip::Evaluator.

Reimplemented in Parsnip::OptionEvaluator.

Friends And Related Function Documentation

◆ Evaluator

friend class Evaluator
friend

◆ RemainingValuesEvaluator

friend class RemainingValuesEvaluator
friend

◆ ValueEvaluator

friend class ValueEvaluator
friend

Member Data Documentation

◆ terminating_evaluator

EvaluatorRef Parsnip::RemainderEvaluator::terminating_evaluator
protected

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