Select Git revision
MeshLineEdgeBoundary.cpp
PugsParser.cpp 61.46 KiB
#include <PugsOStream.hpp>
#include <PugsParser.hpp>
#include <PugsAssert.hpp>
#include <fstream>
#include <unordered_map>
#include <variant>
#include <rang.hpp>
#include <pegtl.hpp>
#include <pegtl/analyze.hpp>
#include <pegtl/contrib/parse_tree.hpp>
#include <pegtl/contrib/parse_tree_to_dot.hpp>
using namespace TAO_PEGTL_NAMESPACE;
namespace language
{
// clang-format off
struct slashslash : TAO_PEGTL_STRING("//") {};
struct slashstar : TAO_PEGTL_STRING("/*") {};
struct starslash : TAO_PEGTL_STRING("*/") {};
struct comment
: sor< if_must< slashslash, until< eolf > >,
try_catch< slashstar, until< starslash> >,
// error management
if_must<at<slashstar>,raise<slashstar>, until< eof> > > {};
struct ignored : star< sor< space, comment> >{};
struct integer
: seq< opt< one< '+', '-' > >, plus< digit > >{};
struct INTEGER : seq< integer, ignored >{};
struct real
: seq< opt< one< '+',
'-' >
>,
sor< seq<
plus< digit >,
one < '.' >,
star< digit >
>,
seq<
one < '.' >,
plus< digit >
>
>,
opt<
seq<
one< 'E',
'e' >,
opt< one< '+',
'-' >
>,
plus<digit>
>
>
>{};
struct semicol : one< ';' >{};
struct REAL : seq< real, ignored >{};
struct B_set : TAO_PEGTL_KEYWORD("B") {};
struct R_set :TAO_PEGTL_KEYWORD("R") {};