dsl/scan.hpp
Go to the documentation of this file.
1 // Copyright (C) 2020-2024 Jonathan Müller and lexy contributors
2 // SPDX-License-Identifier: BSL-1.0
3 
4 #ifndef LEXY_DSL_SCAN_HPP_INCLUDED
5 #define LEXY_DSL_SCAN_HPP_INCLUDED
6 
8 #include <lexy/dsl/base.hpp>
9 #include <lexy/dsl/parse_as.hpp>
10 #include <lexy/error.hpp>
11 #include <lexy/lexeme.hpp>
12 
13 //=== rule forward declaration ===//
14 namespace lexyd
15 {
16 template <typename Production>
17 struct _prd;
18 template <typename Rule, typename Tag>
19 struct _peek;
20 template <typename Token>
21 struct _cap;
22 template <typename Rule>
23 struct _capr;
24 template <typename T, typename Base>
25 struct _int_dsl;
26 
27 struct _scan;
28 } // namespace lexyd
29 
30 namespace lexy::_detail
31 {
32 template <typename Derived, typename Reader>
33 class scanner;
34 }
35 
36 //=== scan_result ===//
37 namespace lexy
38 {
39 constexpr struct scan_failed_t
40 {
41 } scan_failed;
42 
43 template <typename T>
45 {
46 public:
47  using value_type = T;
48 
49  constexpr scan_result() = default;
50  constexpr scan_result(scan_failed_t) {}
51 
52  template <typename U = T, typename = std::enable_if_t<std::is_constructible_v<T, U>>>
53  constexpr scan_result(U&& value)
54  {
55  _value.emplace(LEXY_MOV(value));
56  }
57 
58  constexpr explicit operator bool() const noexcept
59  {
60  return has_value();
61  }
62  constexpr bool has_value() const noexcept
63  {
64  return static_cast<bool>(_value);
65  }
66 
67  constexpr decltype(auto) value() const& noexcept
68  {
69  return *_value;
70  }
71  constexpr decltype(auto) value() && noexcept
72  {
73  return LEXY_MOV(*_value);
74  }
75 
76  template <typename U = T>
77  constexpr decltype(auto) value_or(U&& fallback) const& noexcept
78  {
79  return _value ? *_value : LEXY_FWD(fallback);
80  }
81  template <typename U = T>
82  constexpr decltype(auto) value_or(U&& fallback) && noexcept
83  {
84  return _value ? LEXY_MOV(*_value) : LEXY_FWD(fallback);
85  }
86 
87 private:
89 
91 
92  template <typename Derived, typename Reader>
93  friend class _detail::scanner;
94 };
95 template <>
97 {
98 public:
99  using value_type = void;
100 
101  constexpr scan_result() = default;
103  constexpr scan_result(bool has_value)
104  {
105  if (has_value)
106  _value.emplace();
107  }
108 
109  constexpr explicit operator bool() const noexcept
110  {
111  return has_value();
112  }
113  constexpr bool has_value() const noexcept
114  {
115  return static_cast<bool>(_value);
116  }
117 
118 private:
120 
122 
123  template <typename Derived, typename Reader>
124  friend class _detail::scanner;
125 };
126 
127 template <typename T>
129 template <typename T>
131 } // namespace lexy
132 
133 //=== scanner implementation ===//
134 namespace lexy::_detail
135 {
136 template <typename Reader>
138 {
139  Reader _impl;
140 
141  constexpr auto reader() const&
142  {
143  return _impl;
144  }
145 };
146 
148 {
149  template <typename Context, typename Reader, typename T>
150  LEXY_PARSER_FUNC static bool parse(Context&, Reader&, lazy_init<T>* dest, T&& value)
151  {
152  dest->emplace(LEXY_MOV(value));
153  return true;
154  }
155 
156  template <typename Context, typename Reader>
157  LEXY_PARSER_FUNC static bool parse(Context&, Reader&, lazy_init<void>* dest)
158  {
159  dest->emplace();
160  return true;
161  }
162 };
163 
164 // The common interface of all scanner types.
165 template <typename Derived, typename Reader>
166 class scanner
167 {
168 public:
169  using encoding = typename Reader::encoding;
170 
171  constexpr scanner(const scanner&) noexcept = delete;
172  constexpr scanner& operator=(const scanner&) noexcept = delete;
173 
174  //=== status ===//
175  constexpr explicit operator bool() const noexcept
176  {
177  return _state == _state_normal;
178  }
179 
180  constexpr bool is_at_eof() const
181  {
182  return _reader.peek() == Reader::encoding::eof();
183  }
184 
185  constexpr auto position() const noexcept -> typename Reader::iterator
186  {
187  return _reader.position();
188  }
189  constexpr auto current() const noexcept -> typename Reader::marker
190  {
191  return _reader.current();
192  }
193 
194  constexpr auto remaining_input() const noexcept
195  {
197  }
198 
199  //=== parsing ===//
200  template <typename T, typename Rule, typename = std::enable_if_t<lexy::is_rule<Rule>>>
201  constexpr void parse(scan_result<T>& result, Rule)
202  {
203  if (_state == _state_failed)
204  return;
205 
207  auto success
208  = parser::parse(static_cast<Derived&>(*this).context(), _reader, &result._value);
209  if (!success)
211  }
212 
213  template <typename Production, typename = lexy::production_rule<Production>>
214  constexpr auto parse(Production = {})
215  {
216  using context_t = LEXY_DECAY_DECLTYPE(static_cast<Derived&>(*this).context());
217  using value_type =
218  typename lexy::production_value_callback<Production,
219  typename context_t::state_type>::return_type;
220 
222  parse(result, lexyd::_prd<Production>{});
223  return result;
224  }
225 
226  template <typename Rule, typename = std::enable_if_t<lexy::is_rule<Rule>>>
227  constexpr void parse(Rule rule)
228  {
229  scan_result<void> result;
230  parse(result, rule);
231  }
232 
233  //=== branch parsing ===//
234  template <typename T, typename Rule, typename = std::enable_if_t<lexy::is_rule<Rule>>>
235  constexpr bool branch(scan_result<T>& result, Rule)
236  {
237  LEXY_REQUIRE_BRANCH_RULE(Rule, "branch");
238  if (_state == _state_failed)
239  return false;
240 
241  auto& context = static_cast<Derived&>(*this).context();
243  if (!parser.try_parse(context.control_block, _reader))
244  {
245  parser.cancel(context);
246  return false; // branch wasn't token
247  }
248 
249  auto success = parser.template finish<lexy::_detail::scan_final_parser>(context, _reader,
250  &result._value);
251  if (!success)
253  return true; // branch was taken
254  }
255 
256  template <typename Production, typename T, typename = lexy::production_rule<Production>>
257  constexpr bool branch(scan_result<T>& result, Production = {})
258  {
259  return branch(result, lexyd::_prd<Production>{});
260  }
261 
262  template <typename Rule, typename = std::enable_if_t<lexy::is_rule<Rule>>>
263  constexpr bool branch(Rule rule)
264  {
265  scan_result<void> result;
266  return branch(result, rule);
267  }
268 
269  //=== error handling ===//
271  {
272  public:
275 
276  constexpr void cancel() &&
277  {
278  auto& context = static_cast<Derived&>(*_self).context();
279  context.on(parse_events::recovery_cancel{}, _self->_reader.position());
281  }
282 
283  constexpr void finish() &&
284  {
285  auto& context = static_cast<Derived&>(*_self).context();
286  context.on(parse_events::recovery_finish{}, _self->_reader.position());
288  }
289 
290  private:
291  constexpr explicit error_recovery_guard(scanner& self) noexcept : _self(&self)
292  {
293  auto& context = static_cast<Derived&>(*_self).context();
294  context.on(parse_events::recovery_start{}, _self->_reader.position());
296  }
297 
299  friend scanner;
300  };
301 
302  constexpr auto error_recovery()
303  {
305  return error_recovery_guard(*this);
306  }
307 
308  template <typename TokenRule>
309  constexpr bool discard(TokenRule rule)
310  {
311  static_assert(lexy::is_token_rule<TokenRule>);
312  if (_state == _state_failed)
313  return false;
314 
315  auto begin = _reader.position();
316  auto result = lexy::try_match_token(rule, _reader);
317  auto end = _reader.position();
318 
319  auto& context = static_cast<Derived&>(*this).context();
321 
322  return result;
323  }
324 
325  template <typename Tag, typename... Args>
326  constexpr void error(Tag, Args&&... args)
327  {
328  auto& context = static_cast<Derived&>(*this).context();
329  context.on(parse_events::error{}, lexy::error<Reader, Tag>(LEXY_FWD(args)...));
330  }
331 
332  template <typename... Args>
333  constexpr void error(const char* msg, Args&&... args)
334  {
335  auto& context = static_cast<Derived&>(*this).context();
336  context.on(parse_events::error{}, lexy::error<Reader, void>(LEXY_FWD(args)..., msg));
337  }
338 
339  template <typename Tag, typename... Args>
340  constexpr void fatal_error(Tag tag, Args&&... args)
341  {
342  error(tag, LEXY_FWD(args)...);
344  }
345 
346  template <typename... Args>
347  constexpr void fatal_error(const char* msg, Args&&... args)
348  {
349  error(msg, LEXY_FWD(args)...);
351  }
352 
353  //=== convenience ===//
354  template <typename T, typename Rule, typename = std::enable_if_t<lexy::is_rule<Rule>>>
355  constexpr auto parse(Rule rule)
356  {
357  scan_result<T> result;
358  parse(result, rule);
359  return result;
360  }
361 
362  template <typename Rule>
363  constexpr bool peek(Rule)
364  {
365  static_assert(lexy::is_rule<Rule>);
366  return branch(dsl::_peek<Rule, void>{});
367  }
368 
369  template <typename T, typename Base, typename Digits>
370  constexpr auto integer(Digits digits)
371  {
372  scan_result<T> result;
374  return result;
375  }
376  template <typename T, typename Digits>
377  constexpr auto integer(Digits digits)
378  {
379  scan_result<T> result;
381  return result;
382  }
383 
384  template <typename Token>
385  constexpr auto capture(Token)
386  {
388  parse(result, lexyd::_cap<Token>{});
389  return result;
390  }
391  template <typename Production>
393  {
396  return result;
397  }
398 
399 protected:
400  constexpr explicit scanner(const Reader& reader) noexcept
402  {}
403 
404  constexpr Reader& reader() noexcept
405  {
406  return _reader;
407  }
408 
409 private:
410  Reader _reader;
411 
412  enum
413  {
415  _state_failed, // after a failure
416  _state_recovery, // recovery guard active
417  } _state;
418 };
419 } // namespace lexy::_detail
420 
421 //=== dsl::scan ===//
422 namespace lexy
423 {
424 template <typename Context, typename Reader>
425 class rule_scanner : public _detail::scanner<rule_scanner<Context, Reader>, Reader>
426 {
427 public:
428  using production = typename Context::production;
429 
430  constexpr std::size_t recursion_depth() const noexcept
431  {
432  auto& cb = _context->control_block();
433  return static_cast<std::size_t>(cb.cur_depth);
434  }
435 
436  constexpr auto begin() const noexcept -> typename Reader::iterator
437  {
438  return _begin;
439  }
440 
441 private:
442  constexpr explicit rule_scanner(Context& context, Reader reader)
443  : _detail::scanner<rule_scanner<Context, Reader>, Reader>(reader), _context(&context),
445  {}
446 
447  constexpr Context& context() noexcept
448  {
449  return *_context;
450  }
451 
452  Context* _context;
453  typename Reader::iterator _begin;
454 
456  friend lexyd::_scan;
457 };
458 } // namespace lexy
459 
460 namespace lexyd
461 {
462 template <typename Context, typename Scanner, typename StatePtr, typename... Args>
463 using _detect_scan_state = decltype(Context::production::scan(LEXY_DECLVAL(Scanner&), *StatePtr(),
464  LEXY_DECLVAL(Args)...));
465 
466 struct _scan : rule_base
467 {
468  template <typename NextParser>
469  struct p
470  {
471  template <typename Scanner, typename Context, typename Reader, typename... Args>
472  LEXY_PARSER_FUNC static bool _parse(Scanner& scanner, Context& context, Reader& reader,
473  Args&&... args)
474  {
475  typename Context::production::scan_result result = [&] {
476  if constexpr (lexy::_detail::is_detected<
477  _detect_scan_state, Context, decltype(scanner),
478  decltype(context.control_block->parse_state), Args&&...>)
479  return Context::production::scan(scanner, *context.control_block->parse_state,
480  LEXY_FWD(args)...);
481  else
482  return Context::production::scan(scanner, LEXY_FWD(args)...);
483  }();
484  reader.reset(scanner.current());
485  if (!result)
486  return false;
487 
488  if constexpr (std::is_void_v<typename decltype(result)::value_type>)
489  return NextParser::parse(context, reader);
490  else
491  return NextParser::parse(context, reader, LEXY_MOV(result).value());
492  }
493 
494  template <typename Context, typename Reader, typename... Args>
495  LEXY_PARSER_FUNC static bool parse(Context& context, Reader& reader, Args&&... args)
496  {
497  lexy::rule_scanner scanner(context, reader);
498  return _parse(scanner, context, reader, LEXY_FWD(args)...);
499  }
500  };
501 };
502 
503 inline constexpr auto scan = _scan{};
504 } // namespace lexyd
505 
506 namespace lexy
507 {
508 template <typename T>
510 {
512 
513  static constexpr auto rule = dsl::scan;
514  static constexpr auto value = lexy::forward<T>;
515 };
516 } // namespace lexy
517 
518 #endif // LEXY_DSL_SCAN_HPP_INCLUDED
519 
lexy::scan_result< void >
Definition: dsl/scan.hpp:96
lexy::scan_result< void >::_value
_detail::lazy_init< void > _value
Definition: dsl/scan.hpp:121
LEXY_MOV
#define LEXY_MOV(...)
Definition: config.hpp:29
lexy::scan_result< void >::scan_result
constexpr scan_result(_detail::lazy_init< void > &&value)
Definition: dsl/scan.hpp:119
lexy::_detail::scanner::branch
constexpr bool branch(scan_result< T > &result, Production={})
Definition: dsl/scan.hpp:257
lexy::_detail::scanner::branch
constexpr bool branch(Rule rule)
Definition: dsl/scan.hpp:263
lexy::parse_events::recovery_start
Definition: dsl/base.hpp:74
lexy::scan_production::value
static constexpr auto value
Definition: dsl/scan.hpp:514
lexy::_detail::scanner::branch
constexpr bool branch(scan_result< T > &result, Rule)
Definition: dsl/scan.hpp:235
lexy::scan_result::scan_result
constexpr scan_result(U &&value)
Definition: dsl/scan.hpp:53
lexy::_detail::is_detected
constexpr bool is_detected
Definition: detect.hpp:28
lexy::scan_result
Definition: dsl/scan.hpp:44
lexy::_detail::scanner< rule_scanner< Context, Reader >, Reader >::encoding
typename Reader::encoding encoding
Definition: dsl/scan.hpp:169
lexyd::_scan::p::_parse
static LEXY_PARSER_FUNC bool _parse(Scanner &scanner, Context &context, Reader &reader, Args &&... args)
Definition: dsl/scan.hpp:472
lexy::scan_result< void >::scan_result
constexpr scan_result(bool has_value)
Definition: dsl/scan.hpp:103
lexy::_detail::scanner::_reader
Reader _reader
Definition: dsl/scan.hpp:410
lexy::_detail::scanner::remaining_input
constexpr auto remaining_input() const noexcept
Definition: dsl/scan.hpp:194
lexy::_detail::scanner::peek
constexpr bool peek(Rule)
Definition: dsl/scan.hpp:363
lexy::branch_parser_for
typename BranchRule::template bp< Reader > branch_parser_for
Definition: dsl/base.hpp:116
lexy::_detail::scanner::error_recovery
constexpr auto error_recovery()
Definition: dsl/scan.hpp:302
lexy::scan_result
scan_result(_detail::lazy_init< T > &&) -> scan_result< T >
lexy::rule_scanner::begin
constexpr auto begin() const noexcept -> typename Reader::iterator
Definition: dsl/scan.hpp:436
LEXY_FWD
#define LEXY_FWD(...)
Definition: config.hpp:30
lexy::rule_scanner
Definition: dsl/scan.hpp:425
lexy::_detail::scanner::parse
constexpr auto parse(Production={})
Definition: dsl/scan.hpp:214
lexy::_detail::scanner::error
constexpr void error(const char *msg, Args &&... args)
Definition: dsl/scan.hpp:333
lexyd::_prd
Definition: capture.hpp:123
lexyd::_detect_scan_state
decltype(Context::production::scan(LEXY_DECLVAL(Scanner &), *StatePtr(), LEXY_DECLVAL(Args)...)) _detect_scan_state
Definition: dsl/scan.hpp:464
lexy::rule_scanner::rule_scanner
constexpr rule_scanner(Context &context, Reader reader)
Definition: dsl/scan.hpp:442
lexy::rule_scanner::production
typename Context::production production
Definition: dsl/scan.hpp:428
lexy::scan_result
scan_result(T &&) -> scan_result< std::decay_t< T >>
lexyd::_scan::p::parse
static LEXY_PARSER_FUNC bool parse(Context &context, Reader &reader, Args &&... args)
Definition: dsl/scan.hpp:495
lexy::_detail::scanner::integer
constexpr auto integer(Digits digits)
Definition: dsl/scan.hpp:370
lexy
Definition: any_ref.hpp:12
lexy::_detail::scanner::capture
constexpr auto capture(lexyd::_prd< Production >)
Definition: dsl/scan.hpp:392
LEXY_PRECONDITION
#define LEXY_PRECONDITION(Expr)
Definition: assert.hpp:36
cx::end
constexpr auto end(const C &c) -> decltype(c.end())
Definition: wildcards.hpp:686
lexy::_detail::scanner::parse
constexpr void parse(Rule rule)
Definition: dsl/scan.hpp:227
lexy::_detail::scanner::_state_recovery
@ _state_recovery
Definition: dsl/scan.hpp:416
detail::void
j template void())
Definition: json.hpp:4893
LEXY_REQUIRE_BRANCH_RULE
#define LEXY_REQUIRE_BRANCH_RULE(Rule, Name)
Definition: grammar.hpp:73
lexy::error
Generic failure.
Definition: error.hpp:14
lexy::_detail::scanner::error_recovery_guard
Definition: dsl/scan.hpp:270
lexy::scan_failed
constexpr struct lexy::scan_failed_t scan_failed
lexy::_detail::scanner::parse
constexpr void parse(scan_result< T > &result, Rule)
Definition: dsl/scan.hpp:201
lexyd::_scan
Definition: dsl/scan.hpp:466
forward.hpp
lexy::parse
constexpr auto parse(const Input &input, const ErrorCallback &callback)
Parses the production into a value, invoking the callback on error.
Definition: parse.hpp:171
lexy::error< Reader, void >
Type erased generic failure.
Definition: error.hpp:18
lexy::_detail::scanner_input::_impl
Reader _impl
Definition: dsl/scan.hpp:139
lexy::_detail::lazy_init::emplace
constexpr T & emplace(Args &&... args)
Definition: lazy_init.hpp:117
lexy::production_value_callback
Definition: grammar.hpp:296
lexy::_detail::lazy_init
Definition: lazy_init.hpp:109
lexy::scan_production::rule
static constexpr auto rule
Definition: dsl/scan.hpp:513
lexy::parse_events::error
Definition: dsl/base.hpp:68
lexy::_detail::scanner_input::reader
constexpr auto reader() const &
Definition: dsl/scan.hpp:141
lexy::try_match_token
constexpr LEXY_FORCE_INLINE auto try_match_token(TokenRule, Reader &reader)
Definition: dsl/base.hpp:245
lexeme.hpp
lexy::_detail::scanner::is_at_eof
constexpr bool is_at_eof() const
Definition: dsl/scan.hpp:180
lexy::scan_production
Definition: dsl/scan.hpp:509
lexy::scan_result< void >::scan_result
constexpr scan_result(scan_failed_t)
Definition: dsl/scan.hpp:102
lexy::_detail::scanner::integer
constexpr auto integer(Digits digits)
Definition: dsl/scan.hpp:377
lexy::_detail::scanner::capture
constexpr auto capture(Token)
Definition: dsl/scan.hpp:385
lexy::rule_scanner::_begin
Reader::iterator _begin
Definition: dsl/scan.hpp:453
lexy::_detail::scanner::error_recovery_guard::_self
scanner * _self
Definition: dsl/scan.hpp:298
lexy::_detail::scanner::operator=
constexpr scanner & operator=(const scanner &) noexcept=delete
LEXY_DECAY_DECLTYPE
#define LEXY_DECAY_DECLTYPE(...)
Definition: config.hpp:34
lexyd::rule_base
Definition: grammar.hpp:17
lexyd::scan
constexpr auto scan
Definition: dsl/scan.hpp:503
lexy::_detail::scanner::parse
constexpr auto parse(Rule rule)
Definition: dsl/scan.hpp:355
lexyd::digits
constexpr auto digits
Matches a non-empty list of digits.
Definition: digit.hpp:539
lexy::_detail::scanner::error_recovery_guard::error_recovery_guard
error_recovery_guard(const error_recovery_guard &)=delete
lexy::error_token_kind
@ error_token_kind
Definition: grammar.hpp:86
lexy::parse_events::recovery_finish
Definition: dsl/base.hpp:79
lexy::_detail::scanner::current
constexpr auto current() const noexcept -> typename Reader::marker
Definition: dsl/scan.hpp:189
parse_as.hpp
lexy::_detail::scanner::scanner
constexpr scanner(const scanner &) noexcept=delete
LEXY_PARSER_FUNC
#define LEXY_PARSER_FUNC
Definition: dsl/base.hpp:108
lexy::scanner
Definition: action/scan.hpp:31
cx::begin
constexpr auto begin(const C &c) -> decltype(c.begin())
Definition: wildcards.hpp:661
lexy::scan_failed_t
Definition: dsl/scan.hpp:39
lexy::scan_result::has_value
constexpr bool has_value() const noexcept
Definition: dsl/scan.hpp:62
lexy::scan_result::scan_result
constexpr scan_result()=default
base.hpp
lexy::_detail::lazy_init< void >
Definition: lazy_init.hpp:217
lexy::_detail::scanner::discard
constexpr bool discard(TokenRule rule)
Definition: dsl/scan.hpp:309
lexy::_detail
Definition: any_ref.hpp:12
lexy::scan_result::value_type
T value_type
Definition: dsl/scan.hpp:47
lexyd::_int_dsl
Definition: dsl/integer.hpp:490
lexy::rule_scanner::context
constexpr Context & context() noexcept
Definition: dsl/scan.hpp:447
lexyd::_scan::p
Definition: dsl/scan.hpp:469
lexy::parse_events::token
Definition: dsl/base.hpp:57
lexy::_detail::scanner::error
constexpr void error(Tag, Args &&... args)
Definition: dsl/scan.hpp:326
lexy::_detail::cp_error::success
@ success
lexy::_detail::scanner::fatal_error
constexpr void fatal_error(Tag tag, Args &&... args)
Definition: dsl/scan.hpp:340
lexy::_detail::scanner::scanner
constexpr scanner(const Reader &reader) noexcept
Definition: dsl/scan.hpp:400
lexyd::_capr
Definition: capture.hpp:66
lexy::_detail::scanner::reader
constexpr Reader & reader() noexcept
Definition: dsl/scan.hpp:404
lexy::_detail::scanner::error_recovery_guard::operator=
error_recovery_guard & operator=(const error_recovery_guard &)=delete
lexy::parser_for
typename Rule::template p< NextParser > parser_for
Definition: dsl/base.hpp:113
lexy::_detail::scan_final_parser::parse
static LEXY_PARSER_FUNC bool parse(Context &, Reader &, lazy_init< T > *dest, T &&value)
Definition: dsl/scan.hpp:150
lexy::_detail::scanner::error_recovery_guard::cancel
constexpr void cancel() &&
Definition: dsl/scan.hpp:276
lexy::scan_result::value_or
constexpr decltype(auto) value_or(U &&fallback) const &noexcept
Definition: dsl/scan.hpp:77
lexyd::_cap
Definition: capture.hpp:14
lexy::_detail::scan_final_parser::parse
static LEXY_PARSER_FUNC bool parse(Context &, Reader &, lazy_init< void > *dest)
Definition: dsl/scan.hpp:157
lexy::_detail::scanner::position
constexpr auto position() const noexcept -> typename Reader::iterator
Definition: dsl/scan.hpp:185
lexy::_detail::scanner::_state_failed
@ _state_failed
Definition: dsl/scan.hpp:415
lexy::_detail::scan_final_parser
Definition: dsl/scan.hpp:147
lexy::rule_scanner::recursion_depth
constexpr std::size_t recursion_depth() const noexcept
Definition: dsl/scan.hpp:430
lexy::scan_result< void >::value_type
void value_type
Definition: dsl/scan.hpp:99
LEXY_DECLVAL
#define LEXY_DECLVAL(...)
Definition: config.hpp:32
lexy::scan_result::scan_result
constexpr scan_result(_detail::lazy_init< T > &&value)
Definition: dsl/scan.hpp:88
lexy::parse_events::recovery_cancel
Definition: dsl/base.hpp:84
lexy::_detail::lazy_init< void >::emplace
constexpr void emplace()
Definition: lazy_init.hpp:224
lexy::_detail::scanner
Definition: dsl/scan.hpp:33
lexy::_detail::scanner::error_recovery_guard::error_recovery_guard
constexpr error_recovery_guard(scanner &self) noexcept
Definition: dsl/scan.hpp:291
lexy::scan_result< void >::has_value
constexpr bool has_value() const noexcept
Definition: dsl/scan.hpp:113
lexy::_detail::scanner::_state
enum lexy::_detail::scanner::@5 _state
lexy::_detail::scanner::error_recovery_guard::finish
constexpr void finish() &&
Definition: dsl/scan.hpp:283
lexyd
Definition: trace.hpp:22
lexy::_detail::scanner_input
Definition: dsl/scan.hpp:137
lexyd::eof
constexpr auto eof
Matches EOF.
Definition: eof.hpp:72
lexy::scan_result::scan_result
constexpr scan_result(scan_failed_t)
Definition: dsl/scan.hpp:50
lexy::_detail::scanner::error_recovery_guard::scanner
friend scanner
Definition: dsl/scan.hpp:299
lexy::_detail::scanner::_state_normal
@ _state_normal
Definition: dsl/scan.hpp:414
lexy::_detail::scanner::fatal_error
constexpr void fatal_error(const char *msg, Args &&... args)
Definition: dsl/scan.hpp:347
lexy::scan_result::value
constexpr decltype(auto) value() const &noexcept
Definition: dsl/scan.hpp:67
lexy::scan_result::_value
_detail::lazy_init< T > _value
Definition: dsl/scan.hpp:90
lexy::rule_scanner::_context
Context * _context
Definition: dsl/scan.hpp:452
error.hpp


behaviortree_cpp_v4
Author(s): Davide Faconti
autogenerated on Fri Dec 13 2024 03:19:17