RetroArch
Namespaces | Classes | Typedefs | Functions | Variables
peg Namespace Reference

Namespaces

 udl
 

Classes

class  Action
 
class  AndPredicate
 
class  any
 
class  AnyCharacter
 
struct  AssignIDToDefinition
 
struct  AstBase
 
struct  AstOptimizer
 
class  Capture
 
class  Character
 
class  CharacterClass
 
class  Context
 
class  Definition
 
class  DefinitionReference
 
struct  EmptyType
 
class  Holder
 
class  Ignore
 
struct  IsToken
 
class  LiteralString
 
struct  match
 
class  NotPredicate
 
class  OneOrMore
 
class  Ope
 
class  Option
 
struct  parse_error
 
class  parser
 
class  ParserGenerator
 
class  peg_token_iterator
 
struct  peg_token_range
 
class  PrioritizedChoice
 
struct  scope_exit
 
struct  SemanticValues
 
class  Sequence
 
class  TokenBoundary
 
class  WeakHolder
 
class  Whitespace
 
class  ZeroOrMore
 

Typedefs

typedef std::function< void(const char *s, size_t n, size_t id, const std::string &name)> MatchAction
 
typedef std::function< void(const char *name, const char *s, size_t n, const SemanticValues &sv, const Context &c, const any &dt)> Tracer
 
typedef std::function< size_t(const char *s, size_t n, SemanticValues &sv, any &dt)> Parser
 
typedef std::unordered_map< std::string, DefinitionGrammar
 
typedef std::function< void(size_t, size_t, const std::string &)> Log
 
typedef AstBase< EmptyTypeAst
 

Functions

template<typename EF >
auto make_scope_exit (EF &&exit_function) -> scope_exit< EF >
 
std::pair< size_t, size_t > line_info (const char *start, const char *cur)
 
template<typename R , typename F , typename std::enable_if< std::is_void< R >::value >::type *& = enabler, typename... Args>
any call (F fn, Args &&... args)
 
bool success (size_t len)
 
bool fail (size_t len)
 
template<typename... Args>
std::shared_ptr< Opeseq (Args &&...args)
 
template<typename... Args>
std::shared_ptr< Opecho (Args &&...args)
 
std::shared_ptr< Opezom (const std::shared_ptr< Ope > &ope)
 
std::shared_ptr< Opeoom (const std::shared_ptr< Ope > &ope)
 
std::shared_ptr< Opeopt (const std::shared_ptr< Ope > &ope)
 
std::shared_ptr< Opeapd (const std::shared_ptr< Ope > &ope)
 
std::shared_ptr< Openpd (const std::shared_ptr< Ope > &ope)
 
std::shared_ptr< Opelit (const std::string &lit)
 
std::shared_ptr< Opecls (const std::string &chars)
 
std::shared_ptr< Opechr (char dt)
 
std::shared_ptr< Opedot ()
 
std::shared_ptr< Opecap (const std::shared_ptr< Ope > &ope, MatchAction ma, size_t n, const std::string &s)
 
std::shared_ptr< Opecap (const std::shared_ptr< Ope > &ope, MatchAction ma)
 
std::shared_ptr< Opetok (const std::shared_ptr< Ope > &ope)
 
std::shared_ptr< Opeign (const std::shared_ptr< Ope > &ope)
 
std::shared_ptr< Operef (const std::unordered_map< std::string, Definition > &grammar, const std::string &name, const char *s)
 
std::shared_ptr< Opewsp (const std::shared_ptr< Ope > &ope)
 
constexpr unsigned int str2tag (const char *str, int h=0)
 
template<typename T >
void ast_to_s_core (const std::shared_ptr< T > &ptr, std::string &s, int level, std::function< std::string(const T &ast, int level)> fn)
 
template<typename T >
std::string ast_to_s (const std::shared_ptr< T > &ptr, std::function< std::string(const T &ast, int level)> fn=nullptr)
 
template<typename T >
static std::shared_ptr< Toptimize_ast (std::shared_ptr< T > ast, const std::vector< std::string > &filters={})
 
bool peg_match (const char *syntax, const char *s, match &m)
 
bool peg_match (const char *syntax, const char *s)
 
bool peg_search (parser &pg, const char *s, size_t n, match &m)
 
bool peg_search (parser &pg, const char *s, match &m)
 
bool peg_search (const char *syntax, const char *s, size_t n, match &m)
 
bool peg_search (const char *syntax, const char *s, match &m)
 

Variables

voidenabler
 
static const char * WHITESPACE_DEFINITION_NAME = "%whitespace"
 
const int AstDefaultTag = -1
 

Typedef Documentation

◆ Ast

◆ Grammar

typedef std::unordered_map<std::string, Definition> peg::Grammar

◆ Log

typedef std::function<void (size_t, size_t, const std::string&)> peg::Log

◆ MatchAction

typedef std::function<void (const char* s, size_t n, size_t id, const std::string& name)> peg::MatchAction

◆ Parser

typedef std::function<size_t (const char* s, size_t n, SemanticValues& sv, any& dt)> peg::Parser

◆ Tracer

typedef std::function<void (const char* name, const char* s, size_t n, const SemanticValues& sv, const Context& c, const any& dt)> peg::Tracer

Function Documentation

◆ apd()

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

◆ ast_to_s()

template<typename T >
std::string peg::ast_to_s ( const std::shared_ptr< T > &  ptr,
std::function< std::string(const T &ast, int level)>  fn = nullptr 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ast_to_s_core()

template<typename T >
void peg::ast_to_s_core ( const std::shared_ptr< T > &  ptr,
std::string s,
int  level,
std::function< std::string(const T &ast, int level)>  fn 
)
Here is the caller graph for this function:

◆ call()

template<typename R , typename F , typename std::enable_if< std::is_void< R >::value >::type *& = enabler, typename... Args>
any peg::call ( F  fn,
Args &&...  args 
)
Here is the caller graph for this function:

◆ cap() [1/2]

std::shared_ptr<Ope> peg::cap ( const std::shared_ptr< Ope > &  ope,
MatchAction  ma,
size_t  n,
const std::string s 
)
inline

◆ cap() [2/2]

std::shared_ptr<Ope> peg::cap ( const std::shared_ptr< Ope > &  ope,
MatchAction  ma 
)
inline

◆ cho()

template<typename... Args>
std::shared_ptr<Ope> peg::cho ( Args &&...  args)
Here is the caller graph for this function:

◆ chr()

std::shared_ptr<Ope> peg::chr ( char  dt)
inline
Here is the caller graph for this function:

◆ cls()

std::shared_ptr<Ope> peg::cls ( const std::string chars)
inline
Here is the caller graph for this function:

◆ dot()

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

◆ fail()

bool peg::fail ( size_t  len)
inline
Here is the caller graph for this function:

◆ ign()

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

◆ line_info()

std::pair<size_t, size_t> peg::line_info ( const char *  start,
const char *  cur 
)
inline
Here is the caller graph for this function:

◆ lit()

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

◆ make_scope_exit()

template<typename EF >
auto peg::make_scope_exit ( EF &&  exit_function) -> scope_exit<EF>
Here is the caller graph for this function:

◆ npd()

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

◆ oom()

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

◆ opt()

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

◆ optimize_ast()

template<typename T >
static std::shared_ptr<T> peg::optimize_ast ( std::shared_ptr< T ast,
const std::vector< std::string > &  filters = {} 
)
static

◆ peg_match() [1/2]

bool peg::peg_match ( const char *  syntax,
const char *  s,
match m 
)
inline
Here is the call graph for this function:

◆ peg_match() [2/2]

bool peg::peg_match ( const char *  syntax,
const char *  s 
)
inline
Here is the call graph for this function:

◆ peg_search() [1/4]

bool peg::peg_search ( parser pg,
const char *  s,
size_t  n,
match m 
)
inline
Here is the call graph for this function:

◆ peg_search() [2/4]

bool peg::peg_search ( parser pg,
const char *  s,
match m 
)
inline
Here is the call graph for this function:

◆ peg_search() [3/4]

bool peg::peg_search ( const char *  syntax,
const char *  s,
size_t  n,
match m 
)
inline
Here is the call graph for this function:

◆ peg_search() [4/4]

bool peg::peg_search ( const char *  syntax,
const char *  s,
match m 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ref()

std::shared_ptr<Ope> peg::ref ( const std::unordered_map< std::string, Definition > &  grammar,
const std::string name,
const char *  s 
)
inline
Here is the caller graph for this function:

◆ seq()

template<typename... Args>
std::shared_ptr<Ope> peg::seq ( Args &&...  args)
Here is the caller graph for this function:

◆ str2tag()

constexpr unsigned int peg::str2tag ( const char *  str,
int  h = 0 
)
inline
Here is the caller graph for this function:

◆ success()

bool peg::success ( size_t  len)
inline
Here is the caller graph for this function:

◆ tok()

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

◆ wsp()

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

◆ zom()

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

Variable Documentation

◆ AstDefaultTag

const int peg::AstDefaultTag = -1

◆ enabler

void* peg::enabler

◆ WHITESPACE_DEFINITION_NAME

const char* peg::WHITESPACE_DEFINITION_NAME = "%whitespace"
static