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

#include <peglib.h>

Collaboration diagram for peg::Context:
[legend]

Public Member Functions

 Context (const char *path, const char *s, size_t l, size_t def_count, std::shared_ptr< Ope > whitespaceOpe, std::shared_ptr< Ope > wordOpe, bool enablePackratParsing, TracerEnter tracer_enter, TracerLeave tracer_leave, std::any trace_data, bool verbose_trace, Log log)
 ~Context ()
 Context (const Context &)=delete
 Context (Context &&)=delete
Context operator= (const Context &)=delete
template<typename T>
void packrat (const char *a_s, size_t def_id, size_t &len, std::any &val, T fn)
SemanticValuespush ()
void pop ()
SemanticValuespush_semantic_values_scope ()
void pop_semantic_values_scope ()
void push_args (std::vector< std::shared_ptr< Ope > > &&args)
void pop_args ()
const std::vector< std::shared_ptr< Ope > > & top_args () const
void push_capture_scope ()
void pop_capture_scope ()
void shift_capture_values ()
void set_error_pos (const char *a_s, const char *literal=nullptr)
void trace_enter (const Ope &ope, const char *a_s, size_t n, const SemanticValues &vs, std::any &dt)
void trace_leave (const Ope &ope, const char *a_s, size_t n, const SemanticValues &vs, std::any &dt, size_t len)
bool is_traceable (const Ope &ope) const
std::pair< size_t, size_t > line_info (const char *cur) const

Public Attributes

const char * path
const char * s
const size_t l
ErrorInfo error_info
bool recovered = false
std::vector< std::shared_ptr< SemanticValues > > value_stack
size_t value_stack_size = 0
std::vector< Definition * > rule_stack
std::vector< std::vector< std::shared_ptr< Ope > > > args_stack
size_t in_token_boundary_count = 0
std::shared_ptr< OpewhitespaceOpe
bool in_whitespace = false
std::shared_ptr< OpewordOpe
std::vector< std::map< std::string_view, std::string > > capture_scope_stack
size_t capture_scope_stack_size = 0
std::vector< bool > cut_stack
const size_t def_count
const bool enablePackratParsing
std::vector< bool > cache_registered
std::vector< bool > cache_success
std::map< std::pair< size_t, size_t >, std::tuple< size_t, std::any > > cache_values
TracerEnter tracer_enter
TracerLeave tracer_leave
std::any trace_data
const bool verbose_trace
Log log
size_t next_trace_id = 0
std::vector< size_t > trace_ids
bool ignore_trace_state = false
std::once_flag source_line_index_init_
std::vector< size_t > source_line_index

Constructor & Destructor Documentation

◆ Context() [1/3]

peg::Context::Context ( const char * path,
const char * s,
size_t l,
size_t def_count,
std::shared_ptr< Ope > whitespaceOpe,
std::shared_ptr< Ope > wordOpe,
bool enablePackratParsing,
TracerEnter tracer_enter,
TracerLeave tracer_leave,
std::any trace_data,
bool verbose_trace,
Log log )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~Context()

peg::Context::~Context ( )
inline
Here is the call graph for this function:

◆ Context() [2/3]

peg::Context::Context ( const Context & )
delete
Here is the call graph for this function:

◆ Context() [3/3]

peg::Context::Context ( Context && )
delete
Here is the call graph for this function:

Member Function Documentation

◆ is_traceable()

bool peg::Context::is_traceable ( const Ope & ope) const
inline
Here is the caller graph for this function:

◆ line_info()

std::pair< size_t, size_t > peg::Context::line_info ( const char * cur) const
inline

◆ operator=()

Context peg::Context::operator= ( const Context & )
delete
Here is the call graph for this function:

◆ packrat()

template<typename T>
void peg::Context::packrat ( const char * a_s,
size_t def_id,
size_t & len,
std::any & val,
T fn )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pop()

void peg::Context::pop ( )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pop_args()

void peg::Context::pop_args ( )
inline
Here is the caller graph for this function:

◆ pop_capture_scope()

void peg::Context::pop_capture_scope ( )
inline
Here is the caller graph for this function:

◆ pop_semantic_values_scope()

void peg::Context::pop_semantic_values_scope ( )
inline
Here is the caller graph for this function:

◆ push()

SemanticValues & peg::Context::push ( )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ push_args()

void peg::Context::push_args ( std::vector< std::shared_ptr< Ope > > && args)
inline
Here is the caller graph for this function:

◆ push_capture_scope()

void peg::Context::push_capture_scope ( )
inline
Here is the caller graph for this function:

◆ push_semantic_values_scope()

SemanticValues & peg::Context::push_semantic_values_scope ( )
inline
Here is the caller graph for this function:

◆ set_error_pos()

void peg::Context::set_error_pos ( const char * a_s,
const char * literal = nullptr )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shift_capture_values()

void peg::Context::shift_capture_values ( )
inline
Here is the caller graph for this function:

◆ top_args()

const std::vector< std::shared_ptr< Ope > > & peg::Context::top_args ( ) const
inline
Here is the caller graph for this function:

◆ trace_enter()

void peg::Context::trace_enter ( const Ope & ope,
const char * a_s,
size_t n,
const SemanticValues & vs,
std::any & dt )
inline
Here is the caller graph for this function:

◆ trace_leave()

void peg::Context::trace_leave ( const Ope & ope,
const char * a_s,
size_t n,
const SemanticValues & vs,
std::any & dt,
size_t len )
inline
Here is the caller graph for this function:

Member Data Documentation

◆ args_stack

std::vector<std::vector<std::shared_ptr<Ope> > > peg::Context::args_stack

◆ cache_registered

std::vector<bool> peg::Context::cache_registered

◆ cache_success

std::vector<bool> peg::Context::cache_success

◆ cache_values

std::map<std::pair<size_t, size_t>, std::tuple<size_t, std::any> > peg::Context::cache_values

◆ capture_scope_stack

std::vector<std::map<std::string_view, std::string> > peg::Context::capture_scope_stack

◆ capture_scope_stack_size

size_t peg::Context::capture_scope_stack_size = 0

◆ cut_stack

std::vector<bool> peg::Context::cut_stack

◆ def_count

const size_t peg::Context::def_count

◆ enablePackratParsing

const bool peg::Context::enablePackratParsing

◆ error_info

ErrorInfo peg::Context::error_info

◆ ignore_trace_state

bool peg::Context::ignore_trace_state = false

◆ in_token_boundary_count

size_t peg::Context::in_token_boundary_count = 0

◆ in_whitespace

bool peg::Context::in_whitespace = false

◆ l

const size_t peg::Context::l

◆ log

Log peg::Context::log

◆ next_trace_id

size_t peg::Context::next_trace_id = 0

◆ path

const char* peg::Context::path

◆ recovered

bool peg::Context::recovered = false

◆ rule_stack

std::vector<Definition *> peg::Context::rule_stack

◆ s

const char* peg::Context::s

◆ source_line_index

std::vector<size_t> peg::Context::source_line_index
mutable

◆ source_line_index_init_

std::once_flag peg::Context::source_line_index_init_
mutable

◆ trace_data

std::any peg::Context::trace_data

◆ trace_ids

std::vector<size_t> peg::Context::trace_ids

◆ tracer_enter

TracerEnter peg::Context::tracer_enter

◆ tracer_leave

TracerLeave peg::Context::tracer_leave

◆ value_stack

std::vector<std::shared_ptr<SemanticValues> > peg::Context::value_stack

◆ value_stack_size

size_t peg::Context::value_stack_size = 0

◆ verbose_trace

const bool peg::Context::verbose_trace

◆ whitespaceOpe

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

◆ wordOpe

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

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