trace.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_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 
325 
327  {
328  auto loc = handler.get_location(pos);
329  handler._writer.write_production_start(loc, _info.name);
330 
331  // All events for the production are after the initial event.
332  _previous_anchor.emplace(handler._anchor);
333  handler._anchor = loc.anchor();
334  }
336  {
337  auto loc = handler.get_location(pos);
338  handler._writer.write_finish(loc);
339  }
341  {
342  auto loc = handler.get_location(pos);
343  handler._writer.write_cancel(loc);
344 
345  // We've backtracked, so we need to restore the anchor.
346  handler._anchor = *_previous_anchor;
347  }
348 
350  {
351  auto loc = handler.get_location(pos);
352  handler._writer.write_production_start(loc, "operation chain");
353  return 0; // need to return something
354  }
355  template <typename Operation>
356  void on(_th& handler, parse_events::operation_chain_op, Operation, iterator pos)
357  {
358  auto loc = handler.get_location(pos);
359  handler._writer.write_operation(loc, lexy::production_name<Operation>());
360  }
362  {
363  auto loc = handler.get_location(pos);
364  handler._writer.write_finish(loc);
365  }
366 
367  template <typename TK>
368  void on(_th& handler, parse_events::token, TK kind, iterator begin, iterator end)
369  {
370  auto loc = handler.get_location(begin);
371  handler._writer.write_token(loc, token_kind<TokenKind>(kind),
373  }
375  {
376  auto loc = handler.get_location(begin);
377  handler._writer.write_backtrack(loc, lexeme_for<Input>(begin, end));
378  }
379 
380  template <typename Error>
381  void on(_th& handler, parse_events::error, const Error& error)
382  {
383  auto loc = handler.get_location(error.position());
384  handler._writer.write_error(loc, error);
385  }
386 
388  {
389  auto loc = handler.get_location(pos);
390  handler._writer.write_recovery_start(loc);
391  }
393  {
394  auto loc = handler.get_location(pos);
395  handler._writer.write_finish(loc);
396  }
398  {
399  auto loc = handler.get_location(pos);
400  handler._writer.write_cancel(loc);
401  }
402 
403  void on(_th& handler, parse_events::debug, iterator pos, const char* str)
404  {
405  auto loc = handler.get_location(pos);
406  handler._writer.write_debug(loc, str);
407  }
408 
409  private:
411  // The beginning of the previous production.
412  // If the current production gets canceled, it needs to be restored.
414  };
415 
416  template <typename Production, typename State>
418 
419  template <typename>
420  constexpr OutputIt get_result(bool) &&
421  {
422  return LEXY_MOV(_writer).finish();
423  }
424 
425 private:
427  {
428  return get_input_location(*_input, pos, _anchor);
429  }
430 
432 
433  const Input* _input;
435 };
436 
437 template <typename State, typename Input, typename OutputIt, typename TokenKind = void>
439 {
440  OutputIt _out;
442  State* _state = nullptr;
443 
445  using state = State;
446  using input = Input;
447 
448  template <typename>
449  using result_type = OutputIt;
450 
451  constexpr explicit trace_action(OutputIt out, visualization_options opts = {})
452  : _out(out), _opts(opts)
453  {}
454  template <typename U = State>
455  constexpr explicit trace_action(U& state, OutputIt out, visualization_options opts = {})
456  : _out(out), _opts(opts), _state(&state)
457  {}
458 
459  template <typename Production>
460  constexpr auto operator()(Production, const Input& input) const
461  {
462  auto reader = input.reader();
463  return lexy::do_action<Production, result_type>(handler(_out, input, _opts), _state,
464  reader);
465  }
466 };
467 
468 template <typename Production, typename TokenKind = void, typename OutputIt, typename Input>
469 OutputIt trace_to(OutputIt out, const Input& input, visualization_options opts = {})
470 {
471  return trace_action<void, Input, OutputIt, TokenKind>(out, opts)(Production{}, input);
472 }
473 template <typename Production, typename TokenKind = void, typename OutputIt, typename Input,
474  typename State>
475 OutputIt trace_to(OutputIt out, const Input& input, State& state, visualization_options opts = {})
476 {
477  return trace_action<State, Input, OutputIt, TokenKind>(state, out, opts)(Production{}, input);
478 }
479 template <typename Production, typename TokenKind = void, typename OutputIt, typename Input,
480  typename State>
481 OutputIt trace_to(OutputIt out, const Input& input, const State& state,
482  visualization_options opts = {})
483 {
484  return trace_action<const State, Input, OutputIt, TokenKind>(state, out, opts)(Production{},
485  input);
486 }
487 
488 template <typename Production, typename TokenKind = void, typename Input>
489 void trace(std::FILE* file, const Input& input, visualization_options opts = {})
490 {
491  trace_to<Production, TokenKind>(cfile_output_iterator{file}, input, opts);
492 }
493 template <typename Production, typename TokenKind = void, typename Input, typename State>
494 void trace(std::FILE* file, const Input& input, State& state, visualization_options opts = {})
495 {
496  trace_to<Production, TokenKind>(cfile_output_iterator{file}, input, state, opts);
497 }
498 template <typename Production, typename TokenKind = void, typename Input, typename State>
499 void trace(std::FILE* file, const Input& input, const State& state, visualization_options opts = {})
500 {
501  trace_to<Production, TokenKind>(cfile_output_iterator{file}, input, state, opts);
502 }
503 } // namespace lexy
504 
505 #endif // LEXY_ACTION_TRACE_HPP_INCLUDED
506 
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:29
lexy::_th::event_handler::on
void on(_th &handler, parse_events::debug, iterator pos, const char *str)
Definition: trace.hpp:403
lexy::parse_events::production_finish
Definition: dsl/base.hpp:34
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:326
lexy::trace_action::result_type
OutputIt result_type
Definition: trace.hpp:449
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:74
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:361
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:392
lexy::trace_action::trace_action
constexpr trace_action(U &state, OutputIt out, visualization_options opts={})
Definition: trace.hpp:455
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:138
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:165
lexy::lexeme::empty
constexpr bool empty() const noexcept
Definition: lexeme.hpp:40
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:374
lexy::visualization_options
Options that control visualization.
Definition: visualize.hpp:40
lexy::trace_action::_out
OutputIt _out
Definition: trace.hpp:440
lexy::_th::event_handler::_previous_anchor
_detail::lazy_init< input_location_anchor< Input > > _previous_anchor
Definition: trace.hpp:413
lexy::parse_events::grammar_finish
Definition: dsl/base.hpp:21
lexy::_th::event_handler::event_handler
constexpr event_handler(production_info info)
Definition: trace.hpp:320
LEXY_FWD
#define LEXY_FWD(...)
Definition: config.hpp:30
lexy::_th::event_handler::on
void on(_th &handler, parse_events::production_cancel, iterator pos)
Definition: trace.hpp:340
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:469
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:195
lexy::_th::event_handler::on
void on(_th &, parse_events::grammar_start, iterator)
Definition: trace.hpp:322
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:217
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:368
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::_th::event_handler::on
void on(_th &, parse_events::grammar_finish, lexy::input_reader< Input > &)
Definition: trace.hpp:323
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:349
input_location.hpp
lexy::parse_events::backtracked
Definition: dsl/base.hpp:63
lexy::_th::_anchor
input_location_anchor< Input > _anchor
Definition: trace.hpp:434
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:451
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:335
lexy::_detail::lazy_init
Definition: lazy_init.hpp:109
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:99
lexy::parse_events::error
Definition: dsl/base.hpp:68
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:446
lexy::trace_action::_opts
visualization_options _opts
Definition: trace.hpp:441
lexyd::rule_base
Definition: grammar.hpp:17
lexy::parse_events::grammar_start
Definition: dsl/base.hpp:17
lexy::parse_events::production_start
Definition: dsl/base.hpp:30
lexy::parse_events::recovery_finish
Definition: dsl/base.hpp:79
lexy::_th::get_location
input_location< Input > get_location(typename lexy::input_reader< Input >::iterator pos)
Definition: trace.hpp:426
LEXY_PARSER_FUNC
#define LEXY_PARSER_FUNC
Definition: dsl/base.hpp:108
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:48
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:253
lexy::parse_events::production_cancel
Definition: dsl/base.hpp:38
lexy::trace
void trace(std::FILE *file, const Input &input, visualization_options opts={})
Definition: trace.hpp:489
lexy::_th::event_handler::on
void on(_th &handler, parse_events::recovery_start, iterator pos)
Definition: trace.hpp:387
nttp_string.hpp
lexy::parse_events::token
Definition: dsl/base.hpp:57
lexy::token_kind::name
constexpr const char * name() const noexcept
Definition: token.hpp:171
lexy::lexeme
Definition: lexeme.hpp:16
lexy::_th::event_handler::on
void on(_th &handler, parse_events::recovery_cancel, iterator pos)
Definition: trace.hpp:397
lexy::_th::_writer
_detail::trace_writer< OutputIt, TokenKind > _writer
Definition: trace.hpp:431
lexy::trace_action::operator()
constexpr auto operator()(Production, const Input &input) const
Definition: trace.hpp:460
lexyd::_debug
Definition: trace.hpp:25
lexy::production_info
Definition: grammar.hpp:192
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:438
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:84
lexy::parse_events::grammar_cancel
Definition: dsl/base.hpp:25
lexy::_th::_input
const Input * _input
Definition: trace.hpp:433
lexy::_detail::trace_writer::prefix::event
@ event
lexy::parse_events::operation_chain_finish
Definition: dsl/base.hpp:52
lexyd
Definition: trace.hpp:22
lexy::_th::event_handler::_info
production_info _info
Definition: trace.hpp:410
lexy::input_location_anchor
Anchor for the location search.
Definition: input_location.hpp:17
lexy::trace_action::state
State state
Definition: trace.hpp:445
lexy::trace_action::_state
State * _state
Definition: trace.hpp:442
lexy::input_reader
decltype(LEXY_DECLVAL(Input).reader()) input_reader
Definition: input/base.hpp:106
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:381
lexy::trace_action::handler
_th< OutputIt, Input > handler
Definition: trace.hpp:444
lexy::_th::get_result
constexpr OutputIt get_result(bool) &&
Definition: trace.hpp:420
lexy::_th::event_handler::on
void on(_th &, parse_events::grammar_cancel, lexy::input_reader< Input > &)
Definition: trace.hpp:324
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:44
lexy::_th::event_handler::on
void on(_th &handler, parse_events::operation_chain_op, Operation, iterator pos)
Definition: trace.hpp:356


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