Iros
Loading...
Searching...
No Matches
parse.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
di/parser/basic/eof_parser.h
"
4
#include "
di/parser/combinator/sequence.h
"
5
#include "
di/parser/create_parser.h
"
6
#include "
di/parser/into_parser_context.h
"
7
8
namespace
di::parser
{
9
namespace
detail
{
10
template
<
typename
T>
11
struct
ParseFunction
{
12
template
<concepts::IntoParserContext U,
typename
Context = meta::AsParserContext<U>>
13
requires
(
concepts::Parsable<T, Context>
)
14
constexpr
auto
operator
()(U&& input)
const
{
15
auto
context =
into_parser_context
(util::forward<U>(input));
16
auto
parser
=
sequence
(
create_parser<T>
(context),
eof
());
17
return
parser
.parse(context);
18
}
19
};
20
}
21
22
template
<
typename
T>
23
constexpr
inline
auto
parse
=
detail::ParseFunction<T>
{};
24
}
25
26
namespace
di
{
27
using
parser::parse
;
28
}
di::concepts::Parsable
Definition
create_parser.h:33
create_parser.h
eof_parser.h
into_parser_context.h
di::parser::detail
Definition
zstring_parser.h:10
di::parser
Definition
zstring_parser.h:9
di::parser::create_parser
constexpr auto create_parser
Definition
create_parser.h:55
di::parser::into_parser_context
constexpr auto into_parser_context
Definition
into_parser_context.h:21
di::parser::eof
constexpr auto eof
Definition
eof_parser.h:27
di::parser::parse
constexpr auto parse
Definition
parse.h:23
di::parser::sequence
constexpr auto sequence
Definition
sequence.h:71
di
Definition
zstring_parser.h:9
sequence.h
di::parser::detail::ParseFunction
Definition
parse.h:11
libs
di
include
di
parser
parse.h
Generated by
1.13.0