RetroArch
Classes | Namespaces | Typedefs | Functions | Variables
peglib.h File Reference
#include <algorithm>
#include <cassert>
#include <cstring>
#include <functional>
#include <initializer_list>
#include <iostream>
#include <limits>
#include <map>
#include <memory>
#include <mutex>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
Include dependency graph for peglib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  peg::any
 
struct  peg::any::placeholder
 
struct  peg::any::holder< T >
 
struct  peg::scope_exit< EF >
 
struct  peg::SemanticValues
 
class  peg::Action
 
struct  peg::Action::TypeAdaptor< R >
 
struct  peg::Action::TypeAdaptor_c< R >
 
struct  peg::parse_error
 
class  peg::Context
 
class  peg::Ope
 
class  peg::Sequence
 
class  peg::PrioritizedChoice
 
class  peg::ZeroOrMore
 
class  peg::OneOrMore
 
class  peg::Option
 
class  peg::AndPredicate
 
class  peg::NotPredicate
 
class  peg::LiteralString
 
class  peg::CharacterClass
 
class  peg::Character
 
class  peg::AnyCharacter
 
class  peg::Capture
 
class  peg::TokenBoundary
 
class  peg::Ignore
 
class  peg::WeakHolder
 
class  peg::Holder
 
class  peg::DefinitionReference
 
class  peg::Whitespace
 
struct  peg::Ope::Visitor
 
struct  peg::AssignIDToDefinition
 
struct  peg::IsToken
 
class  peg::Definition
 
struct  peg::Definition::Result
 
class  peg::ParserGenerator
 
struct  peg::ParserGenerator::Data
 
struct  peg::ParserGenerator::DetectLeftRecursion
 
struct  peg::AstBase< Annotation >
 
struct  peg::AstOptimizer
 
struct  peg::EmptyType
 
class  peg::parser
 
struct  peg::match
 
struct  peg::match::Item
 
class  peg::peg_token_iterator
 
struct  peg::peg_token_range
 

Namespaces

 peg
 
 peg::udl
 

Typedefs

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

Functions

template<typename EF >
auto peg::make_scope_exit (EF &&exit_function) -> scope_exit< EF >
 
std::pair< size_t, size_t > peg::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 peg::call (F fn, Args &&... args)
 
bool peg::success (size_t len)
 
bool peg::fail (size_t len)
 
template<typename... Args>
std::shared_ptr< Ope > peg::seq (Args &&...args)
 
template<typename... Args>
std::shared_ptr< Ope > peg::cho (Args &&...args)
 
std::shared_ptr< Ope > peg::zom (const std::shared_ptr< Ope > &ope)
 
std::shared_ptr< Ope > peg::oom (const std::shared_ptr< Ope > &ope)
 
std::shared_ptr< Ope > peg::opt (const std::shared_ptr< Ope > &ope)
 
std::shared_ptr< Ope > peg::apd (const std::shared_ptr< Ope > &ope)
 
std::shared_ptr< Ope > peg::npd (const std::shared_ptr< Ope > &ope)
 
std::shared_ptr< Ope > peg::lit (const std::string &lit)
 
std::shared_ptr< Ope > peg::cls (const std::string &chars)
 
std::shared_ptr< Ope > peg::chr (char dt)
 
std::shared_ptr< Ope > peg::dot ()
 
std::shared_ptr< Ope > peg::cap (const std::shared_ptr< Ope > &ope, MatchAction ma, size_t n, const std::string &s)
 
std::shared_ptr< Ope > peg::cap (const std::shared_ptr< Ope > &ope, MatchAction ma)
 
std::shared_ptr< Ope > peg::tok (const std::shared_ptr< Ope > &ope)
 
std::shared_ptr< Ope > peg::ign (const std::shared_ptr< Ope > &ope)
 
std::shared_ptr< Ope > peg::ref (const std::unordered_map< std::string, Definition > &grammar, const std::string &name, const char *s)
 
std::shared_ptr< Ope > peg::wsp (const std::shared_ptr< Ope > &ope)
 
constexpr unsigned int peg::str2tag (const char *str, int h=0)
 
constexpr unsigned int peg::udl::operator"" _ (const char *s, size_t)
 
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)
 
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)
 
template<typename T >
static std::shared_ptr< Tpeg::optimize_ast (std::shared_ptr< T > ast, const std::vector< std::string > &filters={})
 
bool peg::peg_match (const char *syntax, const char *s, match &m)
 
bool peg::peg_match (const char *syntax, const char *s)
 
bool peg::peg_search (parser &pg, const char *s, size_t n, match &m)
 
bool peg::peg_search (parser &pg, const char *s, match &m)
 
bool peg::peg_search (const char *syntax, const char *s, size_t n, match &m)
 
bool peg::peg_search (const char *syntax, const char *s, match &m)
 
template<class _Elem , class _Traits , typename Annotation >
std::basic_ios< _Elem, _Traits > & operator<< (std::basic_ios< _Elem, _Traits > &ios, peg::AstBase< Annotation > &node)
 

Variables

voidpeg::enabler
 
static const char * peg::WHITESPACE_DEFINITION_NAME = "%whitespace"
 
const int peg::AstDefaultTag = -1
 

Function Documentation

◆ operator<<()

template<class _Elem , class _Traits , typename Annotation >
std::basic_ios<_Elem, _Traits>& operator<< ( std::basic_ios< _Elem, _Traits > &  ios,
peg::AstBase< Annotation > &  node 
)