trace.hpp
Go to the documentation of this file.
1 // Copyright (C) 2020-2023 Jonathan Müller and lexy contributors
2 // SPDX-License-Identifier: BSL-1.0
3 
4 #ifndef LEXY_ACTION_TRACE_HPP_INCLUDED
5 #define LEXY_ACTION_TRACE_HPP_INCLUDED
6 
8 #include <lexy/action/base.hpp>
10 #include <lexy/token.hpp>
11 #include <lexy/visualize.hpp>
12 
13 //=== debug event ===//
15 {
18 struct debug
19 {};
20 } // namespace lexy::parse_events
21 
22 namespace lexyd
23 {
24 template <typename CharT, CharT... C>
25 struct _debug : rule_base
26 {
27  template <typename NextParser>
28  struct p
29  {
30  template <typename Context, typename Reader, typename... Args>
31  LEXY_PARSER_FUNC static bool parse(Context& context, Reader& reader, Args&&... args)
32  {
33  constexpr auto str = lexy::_detail::type_string<CharT, C...>::template c_str<>;
34  context.on(_ev::debug{}, reader.position(), str);
35  return NextParser::parse(context, reader, LEXY_FWD(args)...);
36  }
37  };
38 };
39 
40 #if LEXY_HAS_NTTP
41 template <lexy::_detail::string_literal Str>
42 constexpr auto debug = lexy::_detail::to_type_string<_debug, Str>{};
43 #endif
44 
45 #define LEXY_DEBUG(Str) \
46  LEXY_NTTP_STRING(::lexyd::_debug, Str) {}
47 } // namespace lexyd
48 
49 //=== trace ====//
50 namespace lexy::_detail
51 {
52 template <typename OutputIt, typename TokenKind>
54 {
55 public:
56  explicit trace_writer(OutputIt out, visualization_options opts)
57  : _out(out), _opts(opts), _cur_depth(0)
58  {}
59 
60  template <typename Location>
61  void write_production_start(const Location& loc, const char* name)
62  {
64  {
66 
67  _out = _detail::write_color<_detail::color::bold>(_out, _opts);
68  _out = _detail::write_str(_out, name);
69  _out = _detail::write_color<_detail::color::reset>(_out, _opts);
70 
72  {
73  // Print an ellipsis instead of children.
74  _out = _detail::write_str(_out, ": ");
76  }
77  else
78  {
79  // Prepare for children.
81  }
82  }
83 
84  ++_cur_depth;
85  }
86 
87  template <typename Location, typename Reader>
88  void write_token(const Location& loc, lexy::token_kind<TokenKind> kind,
90  {
92  return;
93 
95 
96  _out = _detail::write_color<_detail::color::bold>(_out, _opts);
97  _out = _detail::write_str(_out, kind.name());
98  _out = _detail::write_color<_detail::color::reset>(_out, _opts);
99 
100  if (!lexeme.empty())
101  {
102  _out = _detail::write_str(_out, ": ");
104  }
105  }
106 
107  template <typename Location, typename Reader>
108  void write_backtrack(const Location& loc, lexy::lexeme<Reader> lexeme)
109  {
111  return;
112 
114 
115  _out = _detail::write_color<_detail::color::yellow, _detail::color::bold>(_out, _opts);
116  _out = _detail::write_str(_out, "backtracked");
117  _out = _detail::write_color<_detail::color::reset>(_out, _opts);
118 
119  _out = _detail::write_str(_out, ": ");
120 
121  _out = _detail::write_color<_detail::color::yellow>(_out, _opts);
123  _out = _detail::write_color<_detail::color::reset>(_out, _opts);
124  }
125 
126  template <typename Location, typename Reader, typename Tag>
127  void write_error(const Location& loc, const lexy::error<Reader, Tag>& error)
128  {
130  return;
131 
133 
134  _out = _detail::write_color<_detail::color::red, _detail::color::bold>(_out, _opts);
135  _out = _detail::write_str(_out, "error");
136  _out = _detail::write_color<_detail::color::reset>(_out, _opts);
137 
138  _out = _detail::write_color<_detail::color::red>(_out, _opts);
139  _out = _detail::write_str(_out, ": ");
140 
141  if constexpr (std::is_same_v<Tag, lexy::expected_literal>)
142  {
143  auto string = _detail::make_literal_lexeme<typename Reader::encoding>(error.string(),
144  error.length());
145 
146  _out = _detail::write_str(_out, "expected '");
147  _out = visualize_to(_out, string, _opts);
148  _out = _detail::write_str(_out, "'");
149  }
150  else if constexpr (std::is_same_v<Tag, lexy::expected_keyword>)
151  {
152  auto string = _detail::make_literal_lexeme<typename Reader::encoding>(error.string(),
153  error.length());
154 
155  _out = _detail::write_str(_out, "expected keyword '");
156  _out = visualize_to(_out, string, _opts);
157  _out = _detail::write_str(_out, "'");
158  }
159  else if constexpr (std::is_same_v<Tag, lexy::expected_char_class>)
160  {
161  _out = _detail::write_str(_out, "expected ");
162  _out = _detail::write_str(_out, error.name());
163  }
164  else
165  {
166  _out = _detail::write_str(_out, error.message());
167  }
168 
169  _out = _detail::write_color<_detail::color::reset>(_out, _opts);
170  }
171 
172  template <typename Location>
173  void write_recovery_start(const Location& loc)
174  {
176  {
178 
179  _out = _detail::write_color<_detail::color::yellow, _detail::color::bold>(_out, _opts);
180  _out = _detail::write_str(_out, "error recovery");
181  _out = _detail::write_color<_detail::color::reset>(_out, _opts);
182 
183  _out = _detail::write_color<_detail::color::yellow>(_out, _opts);
184  _out = _detail::write_str(_out, ":");
185  _out = _detail::write_color<_detail::color::reset>(_out, _opts);
186 
188  {
189  // Print an ellipsis instead of children.
190  _out = _detail::write_str(_out, " ");
192  }
193  }
194  ++_cur_depth;
195  }
196 
197  template <typename Location>
198  void write_operation(const Location& loc, const char* name)
199  {
201  return;
202 
204 
205  _out = _detail::write_color<_detail::color::bold>(_out, _opts);
206  _out = _detail::write_str(_out, "operation");
207  _out = _detail::write_color<_detail::color::reset>(_out, _opts);
208 
209  _out = _detail::write_str(_out, ": ");
210  _out = _detail::write_str(_out, name);
211  }
212 
213  template <typename Location>
214  void write_debug(const Location& loc, const char* str)
215  {
217  return;
218 
220 
221  _out = _detail::write_color<_detail::color::blue, _detail::color::bold>(_out, _opts);
222  _out = _detail::write_str(_out, "debug");
223  _out = _detail::write_color<_detail::color::reset>(_out, _opts);
224 
225  _out = _detail::write_color<_detail::color::blue>(_out, _opts);
226  _out = _detail::write_str(_out, ": ");
227  _out = _detail::write_str(_out, str);
228  _out = _detail::write_color<_detail::color::reset>(_out, _opts);
229  }
230 
231  template <typename Location>
232  void write_finish(const Location& loc)
233  {
236  --_cur_depth;
237  }
238  template <typename Location>
239  void write_cancel(const Location& loc)
240  {
243  --_cur_depth;
244  }
245 
246  OutputIt finish() &&
247  {
248  *_out++ = '\n';
249  return _out;
250  }
251 
252 private:
253  enum class prefix
254  {
255  event,
256  cancel,
257  finish,
258  };
259 
260  template <typename Location>
261  void write_prefix(const Location& loc, prefix p)
262  {
263  const auto use_unicode = _opts.is_set(visualize_use_unicode);
264 
265  if (_cur_depth > 0)
266  *_out++ = '\n';
267 
268  _out = _detail::write_color<_detail::color::faint>(_out, _opts);
269  _out = _detail::write_format(_out, "%2u:%3u", loc.line_nr(), loc.column_nr());
270  _out = _detail::write_str(_out, ": ");
271  _out = _detail::write_color<_detail::color::reset>(_out, _opts);
272 
273  if (_cur_depth > 0)
274  {
275  for (auto i = 0u; i != _cur_depth - 1; ++i)
276  _out = _detail::write_str(_out, use_unicode ? u8"│ " : u8" ");
277 
278  switch (p)
279  {
280  case prefix::event:
281  _out = _detail::write_str(_out, use_unicode ? u8"├──" : u8"- ");
282  break;
283  case prefix::cancel:
284  _out = _detail::write_str(_out, use_unicode ? u8"â””" : u8"-");
285  _out = _detail::write_color<_detail::color::yellow>(_out, _opts);
286  _out = _detail::write_str(_out, use_unicode ? u8"╳" : u8"x");
287  _out = _detail::write_color<_detail::color::reset>(_out, _opts);
288  break;
289  case prefix::finish:
290  _out = _detail::write_str(_out, use_unicode ? u8"â”´" : u8"- finish");
291  break;
292  }
293  }
294  }
295 
296  OutputIt _out;
298 
299  std::size_t _cur_depth;
300 };
301 } // namespace lexy::_detail
302 
303 namespace lexy
304 {
305 template <typename OutputIt, typename Input, typename TokenKind = void>
306 class _th
307 {
308 public:
309  explicit _th(OutputIt out, const Input& input, visualization_options opts = {}) noexcept
310  : _writer(out, opts), _input(&input), _anchor(input)
311  {
313  }
314 
316  {
318 
319  public:
320  constexpr event_handler(production_info info) : _info(info) {}
321 
323  {
324  auto loc = handler.get_location(pos);
325  handler._writer.write_production_start(loc, _info.name);
326 
327  // All events for the production are after the initial event.
328  _previous_anchor.emplace(handler._anchor);
329  handler._anchor = loc.anchor();
330  }
332  {
333  auto loc = handler.get_location(pos);
334  handler._writer.write_finish(loc);
335  }
337  {
338  auto loc = handler.get_location(pos);
339  handler._writer.write_cancel(loc);
340 
341  // We've backtracked, so we need to restore the anchor.
342  handler._anchor = *_previous_anchor;
343  }
344 
346  {
347  auto loc = handler.get_location(pos);
348  handler._writer.write_production_start(loc, "operation chain");
349  return 0; // need to return something
350  }
351  template <typename Operation>
352  void on(_th& handler, parse_events::operation_chain_op, Operation, iterator pos)
353  {
354  auto loc = handler.get_location(pos);
355  handler._writer.write_operation(loc, lexy::production_name<Operation>());
356  }
358  {
359  auto loc = handler.get_location(pos);
360  handler._writer.write_finish(loc);
361  }
362 
363  template <typename TK>
364  void on(_th& handler, parse_events::token, TK kind, iterator begin, iterator end)
365  {
366  auto loc = handler.get_location(begin);
367  handler._writer.write_token(loc, token_kind<TokenKind>(kind),
369  }
371  {
372  auto loc = handler.get_location(begin);
373  handler._writer.write_backtrack(loc, lexeme_for<Input>(begin, end));
374  }
375 
376  template <typename Error>
377  void on(_th& handler, parse_events::error, const Error& error)
378  {
379  auto loc = handler.get_location(error.position());
380  handler._writer.write_error(loc, error);
381  }
382 
384  {
385  auto loc = handler.get_location(pos);
386  handler._writer.write_recovery_start(loc);
387  }
389  {
390  auto loc = handler.get_location(pos);
391  handler._writer.write_finish(loc);
392  }
394  {
395  auto loc = handler.get_location(pos);
396  handler._writer.write_cancel(loc);
397  }
398 
399  void on(_th& handler, parse_events::debug, iterator pos, const char* str)
400  {
401  auto loc = handler.get_location(pos);
402  handler._writer.write_debug(loc, str);
403  }
404 
405  private:
407  // The beginning of the previous production.
408  // If the current production gets canceled, it needs to be restored.
410  };
411 
412  template <typename Production, typename State>
414 
415  template <typename>
416  constexpr OutputIt get_result(bool) &&
417  {
418  return LEXY_MOV(_writer).finish();
419  }
420 
421 private:
423  {
424  return get_input_location(*_input, pos, _anchor);
425  }
426 
428 
429  const Input* _input;
431 };
432 
433 template <typename State, typename Input, typename OutputIt, typename TokenKind = void>
435 {
436  OutputIt _out;
438  State* _state = nullptr;
439 
441  using state = State;
442  using input = Input;
443 
444  template <typename>
445  using result_type = OutputIt;
446 
447  constexpr explicit trace_action(OutputIt out, visualization_options opts = {})
448  : _out(out), _opts(opts)
449  {}
450  template <typename U = State>
451  constexpr explicit trace_action(U& state, OutputIt out, visualization_options opts = {})
452  : _out(out), _opts(opts), _state(&state)
453  {}
454 
455  template <typename Production>
456  constexpr auto operator()(Production, const Input& input) const
457  {
458  auto reader = input.reader();
459  return lexy::do_action<Production, result_type>(handler(_out, input, _opts), _state,
460  reader);
461  }
462 };
463 
464 template <typename Production, typename TokenKind = void, typename OutputIt, typename Input>
465 OutputIt trace_to(OutputIt out, const Input& input, visualization_options opts = {})
466 {
467  return trace_action<void, Input, OutputIt, TokenKind>(out, opts)(Production{}, input);
468 }
469 template <typename Production, typename TokenKind = void, typename OutputIt, typename Input,
470  typename State>
471 OutputIt trace_to(OutputIt out, const Input& input, State& state, visualization_options opts = {})
472 {
473  return trace_action<State, Input, OutputIt, TokenKind>(state, out, opts)(Production{}, input);
474 }
475 template <typename Production, typename TokenKind = void, typename OutputIt, typename Input,
476  typename State>
477 OutputIt trace_to(OutputIt out, const Input& input, const State& state,
478  visualization_options opts = {})
479 {
480  return trace_action<const State, Input, OutputIt, TokenKind>(state, out, opts)(Production{},
481  input);
482 }
483 
484 template <typename Production, typename TokenKind = void, typename Input>
485 void trace(std::FILE* file, const Input& input, visualization_options opts = {})
486 {
487  trace_to<Production, TokenKind>(cfile_output_iterator{file}, input, opts);
488 }
489 template <typename Production, typename TokenKind = void, typename Input, typename State>
490 void trace(std::FILE* file, const Input& input, State& state, visualization_options opts = {})
491 {
492  trace_to<Production, TokenKind>(cfile_output_iterator{file}, input, state, opts);
493 }
494 template <typename Production, typename TokenKind = void, typename Input, typename State>
495 void trace(std::FILE* file, const Input& input, const State& state, visualization_options opts = {})
496 {
497  trace_to<Production, TokenKind>(cfile_output_iterator{file}, input, state, opts);
498 }
499 } // namespace lexy
500 
501 #endif // LEXY_ACTION_TRACE_HPP_INCLUDED
502 
lexy::_detail::write_ellipsis
constexpr OutIt write_ellipsis(OutIt out, visualization_options opts)
Definition: visualize.hpp:165
LEXY_MOV
#define LEXY_MOV(...)
Definition: config.hpp:21
lexy::_th::event_handler::on
void on(_th &handler, parse_events::debug, iterator pos, const char *str)
Definition: trace.hpp:399
lexy::parse_events::production_finish
Definition: dsl/base.hpp:21
lexy::_th::_th
_th(OutputIt out, const Input &input, visualization_options opts={}) noexcept
Definition: trace.hpp:309
lexy::_th::event_handler::on
void on(_th &handler, parse_events::production_start, iterator pos)
Definition: trace.hpp:322
lexy::trace_action::result_type
OutputIt result_type
Definition: trace.hpp:445
lexyd::_debug::p::parse
static LEXY_PARSER_FUNC bool parse(Context &context, Reader &reader, Args &&... args)
Definition: trace.hpp:31
lexy::parse_events::recovery_start
Definition: dsl/base.hpp:61
lexy::visualize_use_color
@ visualize_use_color
Visualization can use ANSI color escape sequences.
Definition: visualize.hpp:23
lexy::_th::event_handler::on
void on(_th &handler, parse_events::operation_chain_finish, int, iterator pos)
Definition: trace.hpp:357
lexy::_detail::write_format
constexpr OutIt write_format(OutIt out, const char *fmt, const Args &... args)
Definition: visualize.hpp:109
lexy::_th::event_handler::on
void on(_th &handler, parse_events::recovery_finish, iterator pos)
Definition: trace.hpp:388
lexy::trace_action::trace_action
constexpr trace_action(U &state, OutputIt out, visualization_options opts={})
Definition: trace.hpp:451
lexy::_th::event_handler::iterator
typename lexy::input_reader< Input >::iterator iterator
Definition: trace.hpp:317
lexy::input_location
A location in the input.
Definition: input_location.hpp:122
lexy::_detail::write_str
constexpr OutIt write_str(OutIt out, const char *str)
Definition: visualize.hpp:94
lexy::_detail::trace_writer::trace_writer
trace_writer(OutputIt out, visualization_options opts)
Definition: trace.hpp:56
lexy::_detail::trace_writer< OutputIt, void >::prefix
prefix
Definition: trace.hpp:253
lexy::_th
Definition: trace.hpp:306
lexy::parse_events
Definition: trace.hpp:14
lexy::visualization_options::max_tree_depth
unsigned char max_tree_depth
Definition: visualize.hpp:49
lexy::token_kind::ignore_if_empty
constexpr bool ignore_if_empty() const noexcept
Definition: token.hpp:168
lexy::lexeme::empty
constexpr bool empty() const noexcept
Definition: lexeme.hpp:33
lexy::_th::event_handler
Definition: trace.hpp:315
lexy::_th::event_handler::on
void on(_th &handler, parse_events::backtracked, iterator begin, iterator end)
Definition: trace.hpp:370
lexy::visualization_options
Options that control visualization.
Definition: visualize.hpp:40
lexy::trace_action::_out
OutputIt _out
Definition: trace.hpp:436
lexy::_th::event_handler::_previous_anchor
_detail::lazy_init< input_location_anchor< Input > > _previous_anchor
Definition: trace.hpp:409
lexy::_th::event_handler::event_handler
constexpr event_handler(production_info info)
Definition: trace.hpp:320
LEXY_FWD
#define LEXY_FWD(...)
Definition: config.hpp:22
lexy::_th::event_handler::on
void on(_th &handler, parse_events::production_cancel, iterator pos)
Definition: trace.hpp:336
lexy::visualization_options::is_set
constexpr bool is_set(visualization_flags f) const noexcept
Definition: visualize.hpp:57
token.hpp
lexy::trace_to
OutputIt trace_to(OutputIt out, const Input &input, visualization_options opts={})
Definition: trace.hpp:465
lexy::_detail::trace_writer
Definition: trace.hpp:53
lexy::visualization_options::reset
constexpr visualization_options reset(visualization_flags f) const noexcept
Definition: visualize.hpp:62
lexy::_detail::type_string
Definition: nttp_string.hpp:15
lexy::_detail::trace_writer::write_production_start
void write_production_start(const Location &loc, const char *name)
Definition: trace.hpp:61
lexy::production_info::name
const char * name
Definition: grammar.hpp:181
lexy::get_input_location
constexpr auto get_input_location(const Input &input, typename lexy::input_reader< Input >::iterator position, input_location_anchor< Input > anchor) -> input_location< Input, Counting >
The location for a position in the input; search starts at the anchor.
Definition: input_location.hpp:198
lexy::_detail::trace_writer::write_cancel
void write_cancel(const Location &loc)
Definition: trace.hpp:239
lexy::_detail::trace_writer::finish
OutputIt finish() &&
Definition: trace.hpp:246
lexy
Definition: any_ref.hpp:12
LEXY_PRECONDITION
#define LEXY_PRECONDITION(Expr)
Definition: assert.hpp:36
lexy::_th::event_handler::on
void on(_th &handler, parse_events::token, TK kind, iterator begin, iterator end)
Definition: trace.hpp:364
cx::end
constexpr auto end(const C &c) -> decltype(c.end())
Definition: wildcards.hpp:686
detail::void
j template void())
Definition: json.hpp:4893
lexy::_detail::trace_writer::write_recovery_start
void write_recovery_start(const Location &loc)
Definition: trace.hpp:173
lexy::_detail::trace_writer::prefix::finish
@ finish
lexy::visualization_options::max_tree_depth_limit
static constexpr unsigned char max_tree_depth_limit
Definition: visualize.hpp:42
lexy::error
Generic failure.
Definition: error.hpp:14
lexy::visualize_to
OutputIt visualize_to(OutputIt out, lexy::code_point cp, visualization_options opts={})
Definition: visualize.hpp:194
lexy::_th::event_handler::on
int on(_th &handler, parse_events::operation_chain_start, iterator pos)
Definition: trace.hpp:345
input_location.hpp
lexy::parse_events::backtracked
Definition: dsl/base.hpp:50
lexy::_th::_anchor
input_location_anchor< Input > _anchor
Definition: trace.hpp:430
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::trace_action::trace_action
constexpr trace_action(OutputIt out, visualization_options opts={})
Definition: trace.hpp:447
lexy::_detail::trace_writer::write_backtrack
void write_backtrack(const Location &loc, lexy::lexeme< Reader > lexeme)
Definition: trace.hpp:108
lexy::_th::event_handler::on
void on(_th &handler, parse_events::production_finish, iterator pos)
Definition: trace.hpp:331
lexy::_detail::lazy_init
Definition: lazy_init.hpp:97
lexy::_detail::trace_writer::write_debug
void write_debug(const Location &loc, const char *str)
Definition: trace.hpp:214
lexy::token_kind
What sort of token it is.
Definition: token.hpp:102
lexy::parse_events::error
Definition: dsl/base.hpp:55
visualize.hpp
lexy::_detail::trace_writer::write_prefix
void write_prefix(const Location &loc, prefix p)
Definition: trace.hpp:261
lexy::_detail::trace_writer::write_error
void write_error(const Location &loc, const lexy::error< Reader, Tag > &error)
Definition: trace.hpp:127
lexy::trace_action::input
Input input
Definition: trace.hpp:442
lexy::trace_action::_opts
visualization_options _opts
Definition: trace.hpp:437
lexyd::rule_base
Definition: grammar.hpp:17
lexy::parse_events::production_start
Definition: dsl/base.hpp:17
lexy::parse_events::recovery_finish
Definition: dsl/base.hpp:66
lexy::_th::get_location
input_location< Input > get_location(typename lexy::input_reader< Input >::iterator pos)
Definition: trace.hpp:422
LEXY_PARSER_FUNC
#define LEXY_PARSER_FUNC
Definition: dsl/base.hpp:95
lexyd::_debug::p
Definition: trace.hpp:28
cx::begin
constexpr auto begin(const C &c) -> decltype(c.begin())
Definition: wildcards.hpp:661
lexy::parse_events::operation_chain_op
Definition: dsl/base.hpp:35
lexy::_detail::trace_writer::_opts
visualization_options _opts
Definition: trace.hpp:297
lexy::_detail::trace_writer::write_finish
void write_finish(const Location &loc)
Definition: trace.hpp:232
lexy::_detail::trace_writer::prefix::cancel
@ cancel
lexy::parse_events::debug
Definition: trace.hpp:18
lexy::_detail
Definition: any_ref.hpp:12
lexy::_detail::void_value_callback
Definition: action/base.hpp:246
lexy::parse_events::production_cancel
Definition: dsl/base.hpp:25
lexy::trace
void trace(std::FILE *file, const Input &input, visualization_options opts={})
Definition: trace.hpp:485
lexy::_th::event_handler::on
void on(_th &handler, parse_events::recovery_start, iterator pos)
Definition: trace.hpp:383
nttp_string.hpp
lexy::parse_events::token
Definition: dsl/base.hpp:44
lexy::token_kind::name
constexpr const char * name() const noexcept
Definition: token.hpp:174
lexy::lexeme
Definition: lexeme.hpp:16
lexy::_th::event_handler::on
void on(_th &handler, parse_events::recovery_cancel, iterator pos)
Definition: trace.hpp:393
lexy::_th::_writer
_detail::trace_writer< OutputIt, TokenKind > _writer
Definition: trace.hpp:427
lexy::trace_action::operator()
constexpr auto operator()(Production, const Input &input) const
Definition: trace.hpp:456
lexyd::_debug
Definition: trace.hpp:25
lexy::production_info
Definition: grammar.hpp:178
lexy::_detail::trace_writer::write_operation
void write_operation(const Location &loc, const char *name)
Definition: trace.hpp:198
lexy::trace_action
Definition: trace.hpp:434
lexy::visualize_space
@ visualize_space
Visualize space ' ' as visible character/symbol.
Definition: visualize.hpp:31
base.hpp
lexy::_detail::trace_writer::write_token
void write_token(const Location &loc, lexy::token_kind< TokenKind > kind, lexy::lexeme< Reader > lexeme)
Definition: trace.hpp:88
lexy::visualize_use_unicode
@ visualize_use_unicode
Visualization can use unicode characters.
Definition: visualize.hpp:21
lexy::parse_events::recovery_cancel
Definition: dsl/base.hpp:71
lexy::_th::_input
const Input * _input
Definition: trace.hpp:429
lexy::_detail::trace_writer::prefix::event
@ event
lexy::parse_events::operation_chain_finish
Definition: dsl/base.hpp:39
lexyd
Definition: trace.hpp:22
lexy::_th::event_handler::_info
production_info _info
Definition: trace.hpp:406
lexy::input_location_anchor
Anchor for the location search.
Definition: input_location.hpp:17
lexy::trace_action::state
State state
Definition: trace.hpp:441
lexy::trace_action::_state
State * _state
Definition: trace.hpp:438
lexy::input_reader
decltype(LEXY_DECLVAL(Input).reader()) input_reader
Definition: input/base.hpp:92
lexyd::p
constexpr auto p
Parses the production.
Definition: production.hpp:127
lexy::_th::event_handler::on
void on(_th &handler, parse_events::error, const Error &error)
Definition: trace.hpp:377
lexy::trace_action::handler
_th< OutputIt, Input > handler
Definition: trace.hpp:440
lexy::_th::get_result
constexpr OutputIt get_result(bool) &&
Definition: trace.hpp:416
lexy::_detail::trace_writer::_cur_depth
std::size_t _cur_depth
Definition: trace.hpp:299
lexy::_detail::trace_writer::_out
OutputIt _out
Definition: trace.hpp:296
lexy::parse_events::operation_chain_start
Definition: dsl/base.hpp:31
lexy::_th::event_handler::on
void on(_th &handler, parse_events::operation_chain_op, Operation, iterator pos)
Definition: trace.hpp:352


behaviortree_cpp_v4
Author(s): Davide Faconti
autogenerated on Fri Jun 28 2024 02:20:08