21#ifndef MARKUP_PARSER_H
22#define MARKUP_PARSER_H
25#include <pegtl/contrib/parse_tree.hpp>
34using namespace tao::pegtl;
42 std::string asString()
const;
44 std::string typeString()
const;
46 wxString asWxString()
const;
48 bool isOverbar()
const {
return is_type<MARKUP::overbar>(); }
49 bool isSubscript()
const {
return is_type<MARKUP::subscript>(); }
69 seq< not_at< markup >,
70 utf8::not_one<'}'> > > > {};
72template<
typename ControlChar >
73struct braces : seq< seq< ControlChar,
76 sor< anyStringWithinBraces,
93struct grammar : until< tao::pegtl::eof, anything > {};
95template <
typename Rule>
107 in(
std::make_unique<string_input<>>( source,
"from_input" ) ),
113 mem_in(
std::make_unique<memory_input<>>( *source,
"from_input" ) )
116 std::unique_ptr<NODE> Parse();
119 std::unique_ptr<string_input<>>
in;
MARKUP_PARSER(const std::string *source)
std::unique_ptr< string_input<> > in
MARKUP_PARSER(const std::string &source)
std::unique_ptr< memory_input<> > mem_in
parse_tree::selector< Rule, parse_tree::store_content::on< anyStringWithinBraces, anyString >, parse_tree::discard_empty::on< superscript, subscript, overbar > > selector
bool isSuperscript() const
anyString = a run of characters that do not start a command sequence, or if they do,...
Finally, the full grammar.