Go to the documentation of this file.
4 #ifndef LEXY_DSL_CAPTURE_HPP_INCLUDED
5 #define LEXY_DSL_CAPTURE_HPP_INCLUDED
13 template <
typename Token>
16 template <
typename Reader>
19 typename Reader::marker
end;
21 constexpr
auto try_parse(
const void*,
const Reader& reader)
24 auto result = parser.try_parse(reader);
29 template <
typename Context>
33 template <
typename NextParser,
typename Context,
typename... Args>
36 auto begin = reader.position();
47 template <
typename NextParser>
50 template <
typename Context,
typename Reader,
typename... Args>
53 auto begin = reader.position();
54 if (!Token::token_parse(context, reader))
56 auto end = reader.position();
65 template <
typename Rule>
68 template <
typename NextParser,
typename... PrevArgs>
71 template <
typename Context,
typename Reader,
typename... Args>
73 PrevArgs&&... prev_args,
typename Reader::iterator
begin,
82 template <
typename Reader>
87 template <
typename ControlBlock>
88 constexpr
auto try_parse(
const ControlBlock* cb,
const Reader& reader)
90 return rule.try_parse(cb, reader);
93 template <
typename Context>
94 constexpr
void cancel(Context& context)
99 template <
typename NextParser,
typename Context,
typename... Args>
103 using continuation =
_pc<NextParser, Args...>;
104 return rule.template finish<continuation>(context, reader,
LEXY_FWD(args)...,
109 template <
typename NextParser>
112 template <
typename Context,
typename Reader,
typename... Args>
122 template <
typename Production>
126 template <
typename Token>
129 static_assert(lexy::is_token_rule<Token>);
134 template <
typename Production>
137 static_assert(lexy::is_token_production<Production>);
142 #endif // LEXY_DSL_CAPTURE_HPP_INCLUDED
lexy::branch_parser_for< Rule, Reader > rule
static LEXY_PARSER_FUNC bool parse(Context &context, Reader &reader, Args &&... args)
constexpr void cancel(Context &context)
typename BranchRule::template bp< Reader > branch_parser_for
constexpr auto try_parse(const void *, const Reader &reader)
constexpr void cancel(Context &)
constexpr auto end(const C &c) -> decltype(c.end())
constexpr auto parse(const Input &input, const ErrorCallback &callback)
Parses the production into a value, invoking the callback on error.
constexpr auto try_parse(const ControlBlock *cb, const Reader &reader)
static LEXY_PARSER_FUNC bool parse(Context &context, Reader &reader, PrevArgs &&... prev_args, typename Reader::iterator begin, Args &&... args)
static LEXY_PARSER_FUNC bool parse(Context &context, Reader &reader, Args &&... args)
LEXY_PARSER_FUNC auto finish(Context &context, Reader &reader, Args &&... args)
constexpr auto begin(const C &c) -> decltype(c.begin())
typename Rule::template p< NextParser > parser_for
LEXY_PARSER_FUNC auto finish(Context &context, Reader &reader, Args &&... args)
typename TokenRule::template tp< Reader > token_parser_for
constexpr auto capture(Token)
Captures whatever the token matches as a lexeme; does not include trailing whitespace.
decltype(_copy_base_impl< Rule >()) _copy_base