21#ifndef MARKUP_PARSER_H
22#define MARKUP_PARSER_H
25#include <pegtl/contrib/parse_tree.hpp>
34using namespace tao::pegtl;
49 bool isOverbar()
const {
return is_type<MARKUP::overbar>(); }
50 bool isSubscript()
const {
return is_type<MARKUP::subscript>(); }
52 bool isURL()
const {
return is_type<MARKUP::url>(); }
72 seq< not_at< markup >,
73 utf8::not_one<'}'> > > > {};
75struct url : seq< sor< string<'h', 't', 't', 'p', ':', '/', '/'>,
76 string<'h', 't', 't', 'p', 's', ':', '/', '/'> >,
77 plus< utf8::not_one<' '> > > {};
79template<
typename ControlChar >
80struct braces : seq< seq< ControlChar,
83 sor< anyStringWithinBraces,
101struct grammar : until< tao::pegtl::eof, anything > {};
103template <
typename Rule>
116 in(
std::make_unique<string_input<>>( source,
"from_input" ) ),
122 mem_in(
std::make_unique<memory_input<>>( *source,
"from_input" ) )
125 std::unique_ptr<NODE> Parse();
128 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, url, anyString >, parse_tree::discard_empty::on< superscript, subscript, overbar > > selector
std::string asString() const
bool isSuperscript() const
wxString asWxString() const
std::string typeString() const
anyString = a run of characters that do not start a command sequence, or if they do,...
Finally, the full grammar.