Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
peg::Definition Class Reference

#include <peglib.h>

Collaboration diagram for peg::Definition:
[legend]

Classes

struct  Result

Public Member Functions

 Definition ()
 Definition (const Definition &rhs)
 Definition (const std::shared_ptr< Ope > &ope)
 operator std::shared_ptr< Ope > ()
Definitionoperator<= (const std::shared_ptr< Ope > &ope)
Result parse (const char *s, size_t n, const char *path=nullptr, Log log=nullptr) const
Result parse (const char *s, const char *path=nullptr, Log log=nullptr) const
Result parse (const char *s, size_t n, std::any &dt, const char *path=nullptr, Log log=nullptr) const
Result parse (const char *s, std::any &dt, const char *path=nullptr, Log log=nullptr) const
template<typename T>
Result parse_and_get_value (const char *s, size_t n, T &val, const char *path=nullptr, Log log=nullptr) const
template<typename T>
Result parse_and_get_value (const char *s, T &val, const char *path=nullptr, Log log=nullptr) const
template<typename T>
Result parse_and_get_value (const char *s, size_t n, std::any &dt, T &val, const char *path=nullptr, Log log=nullptr) const
template<typename T>
Result parse_and_get_value (const char *s, std::any &dt, T &val, const char *path=nullptr, Log log=nullptr) const
void operator= (Action a)
template<typename T>
Definitionoperator, (T fn)
Definitionoperator~ ()
void accept (Ope::Visitor &v)
std::shared_ptr< Opeget_core_operator () const
bool is_token () const

Public Attributes

std::string name
const char * s_ = nullptr
std::pair< size_t, size_t > line_ = {1, 1}
std::function< bool(const SemanticValues &vs, const std::any &dt, std::string &msg)> predicate
size_t id = 0
Action action
std::function< void(const Context &c, const char *s, size_t n, std::any &dt)> enter
std::function< void(const Context &c, const char *s, size_t n, size_t matchlen, std::any &value, std::any &dt)> leave
bool ignoreSemanticValue = false
std::shared_ptr< OpewhitespaceOpe
std::shared_ptr< OpewordOpe
bool enablePackratParsing = false
bool is_macro = false
std::vector< std::string > params
bool disable_action = false
TracerEnter tracer_enter
TracerLeave tracer_leave
bool verbose_trace = false
TracerStartOrEnd tracer_start
TracerStartOrEnd tracer_end
std::string error_message
bool no_ast_opt = false
bool eoi_check = true

Private Member Functions

Definitionoperator= (const Definition &rhs)
Definitionoperator= (Definition &&rhs)
void initialize_definition_ids () const
Result parse_core (const char *s, size_t n, SemanticValues &vs, std::any &dt, const char *path, Log log) const

Private Attributes

std::shared_ptr< Holderholder_
std::once_flag is_token_init_
bool is_token_ = false
std::once_flag assign_id_to_definition_init_
std::once_flag definition_ids_init_
std::unordered_map< void *, size_t > definition_ids_

Friends

class Reference
class ParserGenerator

Constructor & Destructor Documentation

◆ Definition() [1/3]

peg::Definition::Definition ( )
inline
Here is the caller graph for this function:

◆ Definition() [2/3]

peg::Definition::Definition ( const Definition & rhs)
inline
Here is the call graph for this function:

◆ Definition() [3/3]

peg::Definition::Definition ( const std::shared_ptr< Ope > & ope)
inline

Member Function Documentation

◆ accept()

void peg::Definition::accept ( Ope::Visitor & v)
inline
Here is the caller graph for this function:

◆ get_core_operator()

std::shared_ptr< Ope > peg::Definition::get_core_operator ( ) const
inline
Here is the caller graph for this function:

◆ initialize_definition_ids()

void peg::Definition::initialize_definition_ids ( ) const
inlineprivate
Here is the caller graph for this function:

◆ is_token()

bool peg::Definition::is_token ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator std::shared_ptr< Ope >()

peg::Definition::operator std::shared_ptr< Ope > ( )
inline

◆ operator,()

template<typename T>
Definition & peg::Definition::operator, ( T fn)
inline
Here is the call graph for this function:

◆ operator<=()

Definition & peg::Definition::operator<= ( const std::shared_ptr< Ope > & ope)
inline
Here is the call graph for this function:

◆ operator=() [1/3]

void peg::Definition::operator= ( Action a)
inline
Here is the caller graph for this function:

◆ operator=() [2/3]

Definition & peg::Definition::operator= ( const Definition & rhs)
private
Here is the call graph for this function:

◆ operator=() [3/3]

Definition & peg::Definition::operator= ( Definition && rhs)
private
Here is the call graph for this function:

◆ operator~()

Definition & peg::Definition::operator~ ( )
inline
Here is the call graph for this function:

◆ parse() [1/4]

Result peg::Definition::parse ( const char * s,
const char * path = nullptr,
Log log = nullptr ) const
inline
Here is the call graph for this function:

◆ parse() [2/4]

Result peg::Definition::parse ( const char * s,
size_t n,
const char * path = nullptr,
Log log = nullptr ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse() [3/4]

Result peg::Definition::parse ( const char * s,
size_t n,
std::any & dt,
const char * path = nullptr,
Log log = nullptr ) const
inline
Here is the call graph for this function:

◆ parse() [4/4]

Result peg::Definition::parse ( const char * s,
std::any & dt,
const char * path = nullptr,
Log log = nullptr ) const
inline
Here is the call graph for this function:

◆ parse_and_get_value() [1/4]

template<typename T>
Result peg::Definition::parse_and_get_value ( const char * s,
size_t n,
std::any & dt,
T & val,
const char * path = nullptr,
Log log = nullptr ) const
inline
Here is the call graph for this function:

◆ parse_and_get_value() [2/4]

template<typename T>
Result peg::Definition::parse_and_get_value ( const char * s,
size_t n,
T & val,
const char * path = nullptr,
Log log = nullptr ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_and_get_value() [3/4]

template<typename T>
Result peg::Definition::parse_and_get_value ( const char * s,
std::any & dt,
T & val,
const char * path = nullptr,
Log log = nullptr ) const
inline
Here is the call graph for this function:

◆ parse_and_get_value() [4/4]

template<typename T>
Result peg::Definition::parse_and_get_value ( const char * s,
T & val,
const char * path = nullptr,
Log log = nullptr ) const
inline
Here is the call graph for this function:

◆ parse_core()

Result peg::Definition::parse_core ( const char * s,
size_t n,
SemanticValues & vs,
std::any & dt,
const char * path,
Log log ) const
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ParserGenerator

friend class ParserGenerator
friend

◆ Reference

friend class Reference
friend

Member Data Documentation

◆ action

Action peg::Definition::action

◆ assign_id_to_definition_init_

std::once_flag peg::Definition::assign_id_to_definition_init_
mutableprivate

◆ definition_ids_

std::unordered_map<void *, size_t> peg::Definition::definition_ids_
mutableprivate

◆ definition_ids_init_

std::once_flag peg::Definition::definition_ids_init_
mutableprivate

◆ disable_action

bool peg::Definition::disable_action = false

◆ enablePackratParsing

bool peg::Definition::enablePackratParsing = false

◆ enter

std::function<void(const Context &c, const char *s, size_t n, std::any &dt)> peg::Definition::enter

◆ eoi_check

bool peg::Definition::eoi_check = true

◆ error_message

std::string peg::Definition::error_message

◆ holder_

std::shared_ptr<Holder> peg::Definition::holder_
private

◆ id

size_t peg::Definition::id = 0

◆ ignoreSemanticValue

bool peg::Definition::ignoreSemanticValue = false

◆ is_macro

bool peg::Definition::is_macro = false

◆ is_token_

bool peg::Definition::is_token_ = false
mutableprivate

◆ is_token_init_

std::once_flag peg::Definition::is_token_init_
mutableprivate

◆ leave

std::function<void(const Context &c, const char *s, size_t n, size_t matchlen, std::any &value, std::any &dt)> peg::Definition::leave

◆ line_

std::pair<size_t, size_t> peg::Definition::line_ = {1, 1}

◆ name

std::string peg::Definition::name

◆ no_ast_opt

bool peg::Definition::no_ast_opt = false

◆ params

std::vector<std::string> peg::Definition::params

◆ predicate

std::function<bool(const SemanticValues &vs, const std::any &dt, std::string &msg)> peg::Definition::predicate

◆ s_

const char* peg::Definition::s_ = nullptr

◆ tracer_end

TracerStartOrEnd peg::Definition::tracer_end

◆ tracer_enter

TracerEnter peg::Definition::tracer_enter

◆ tracer_leave

TracerLeave peg::Definition::tracer_leave

◆ tracer_start

TracerStartOrEnd peg::Definition::tracer_start

◆ verbose_trace

bool peg::Definition::verbose_trace = false

◆ whitespaceOpe

std::shared_ptr<Ope> peg::Definition::whitespaceOpe

◆ wordOpe

std::shared_ptr<Ope> peg::Definition::wordOpe

The documentation for this class was generated from the following file:
  • libcockatrice_utility/libcockatrice/utility/peglib.h