Class parser

Class Documentation

class parser

Public Functions

parser() = default
inline parser(const char *s, size_t n, const Rules &rules, std::string_view start = {})
inline parser(const char *s, size_t n, std::string_view start = {})
inline parser(std::string_view sv, const Rules &rules, std::string_view start = {})
inline parser(std::string_view sv, std::string_view start = {})
inline operator bool() const
inline bool load_grammar(const char *s, size_t n, const Rules &rules, std::string_view start = {})
inline bool load_grammar(const char *s, size_t n, std::string_view start = {})
inline bool load_grammar(std::string_view sv, const Rules &rules, std::string_view start = {})
inline bool load_grammar(std::string_view sv, std::string_view start = {})
inline bool parse_n(const char *s, size_t n, const char *path = nullptr) const
inline bool parse_n(const char *s, size_t n, std::any &dt, const char *path = nullptr) const
template<typename T>
inline bool parse_n(const char *s, size_t n, T &val, const char *path = nullptr) const
template<typename T>
inline bool parse_n(const char *s, size_t n, std::any &dt, T &val, const char *path = nullptr) const
inline bool parse(std::string_view sv, const char *path = nullptr) const
inline bool parse(std::string_view sv, std::any &dt, const char *path = nullptr) const
template<typename T>
inline bool parse(std::string_view sv, T &val, const char *path = nullptr) const
template<typename T>
inline bool parse(std::string_view sv, std::any &dt, T &val, const char *path = nullptr) const
inline Definition &operator[](const char *s)
inline const Definition &operator[](const char *s) const
inline const Grammar &get_grammar() const
inline void disable_eoi_check()
inline void enable_left_recursion(bool enable = true)
inline void enable_packrat_parsing()
inline void enable_trace(TracerEnter tracer_enter, TracerLeave tracer_leave)
inline void enable_trace(TracerEnter tracer_enter, TracerLeave tracer_leave, TracerStartOrEnd tracer_start, TracerStartOrEnd tracer_end)
inline void set_verbose_trace(bool verbose_trace)
template<typename T = Ast>
inline parser &enable_ast()
template<typename T>
inline std::shared_ptr<T> optimize_ast(std::shared_ptr<T> ast, bool opt_mode = true) const
inline void set_logger(Log log)
inline void set_logger(std::function<void(size_t line, size_t col, const std::string &msg)> log)