| 1 | /*============================================================================= |
|---|
| 2 | Copyright (c) 2001-2003 Joel de Guzman |
|---|
| 3 | Copyright (c) 2002-2003 Hartmut Kaiser |
|---|
| 4 | http://spirit.sourceforge.net/ |
|---|
| 5 | |
|---|
| 6 | Use, modification and distribution is subject to the Boost Software |
|---|
| 7 | License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
|---|
| 8 | http://www.boost.org/LICENSE_1_0.txt) |
|---|
| 9 | =============================================================================*/ |
|---|
| 10 | #if !defined(BOOST_SPIRIT_PARSER_NAMES_IPP) |
|---|
| 11 | #define BOOST_SPIRIT_PARSER_NAMES_IPP |
|---|
| 12 | |
|---|
| 13 | #if defined(BOOST_SPIRIT_DEBUG) |
|---|
| 14 | |
|---|
| 15 | #include <string> |
|---|
| 16 | #include <iostream> |
|---|
| 17 | #include <map> |
|---|
| 18 | |
|---|
| 19 | #include <boost/config.hpp> |
|---|
| 20 | #ifdef BOOST_NO_STRINGSTREAM |
|---|
| 21 | #include <strstream> |
|---|
| 22 | #define BOOST_SPIRIT_SSTREAM std::strstream |
|---|
| 23 | std::string BOOST_SPIRIT_GETSTRING(std::strstream& ss) |
|---|
| 24 | { |
|---|
| 25 | ss << ends; |
|---|
| 26 | std::string rval = ss.str(); |
|---|
| 27 | ss.freeze(false); |
|---|
| 28 | return rval; |
|---|
| 29 | } |
|---|
| 30 | #else |
|---|
| 31 | #include <sstream> |
|---|
| 32 | #define BOOST_SPIRIT_GETSTRING(ss) ss.str() |
|---|
| 33 | #define BOOST_SPIRIT_SSTREAM std::stringstream |
|---|
| 34 | #endif |
|---|
| 35 | |
|---|
| 36 | namespace boost { namespace spirit { |
|---|
| 37 | |
|---|
| 38 | /////////////////////////////////////////////////////////////////////////////// |
|---|
| 39 | // from actions.hpp |
|---|
| 40 | template <typename ParserT, typename ActionT> |
|---|
| 41 | inline std::string |
|---|
| 42 | parser_name(action<ParserT, ActionT> const& p) |
|---|
| 43 | { |
|---|
| 44 | return std::string("action") |
|---|
| 45 | + std::string("[") |
|---|
| 46 | + parser_name(p.subject()) |
|---|
| 47 | + std::string("]"); |
|---|
| 48 | } |
|---|
| 49 | |
|---|
| 50 | /////////////////////////////////////////////////////////////////////////////// |
|---|
| 51 | // from directives.hpp |
|---|
| 52 | template <typename ParserT> |
|---|
| 53 | inline std::string |
|---|
| 54 | parser_name(contiguous<ParserT> const& p) |
|---|
| 55 | { |
|---|
| 56 | return std::string("contiguous") |
|---|
| 57 | + std::string("[") |
|---|
| 58 | + parser_name(p.subject()) |
|---|
| 59 | + std::string("]"); |
|---|
| 60 | } |
|---|
| 61 | |
|---|
| 62 | template <typename ParserT> |
|---|
| 63 | inline std::string |
|---|
| 64 | parser_name(inhibit_case<ParserT> const& p) |
|---|
| 65 | { |
|---|
| 66 | return std::string("inhibit_case") |
|---|
| 67 | + std::string("[") |
|---|
| 68 | + parser_name(p.subject()) |
|---|
| 69 | + std::string("]"); |
|---|
| 70 | } |
|---|
| 71 | |
|---|
| 72 | template <typename A, typename B> |
|---|
| 73 | inline std::string |
|---|
| 74 | parser_name(longest_alternative<A, B> const& p) |
|---|
| 75 | { |
|---|
| 76 | return std::string("longest_alternative") |
|---|
| 77 | + std::string("[") |
|---|
| 78 | + parser_name(p.left()) + std::string(", ") + parser_name(p.right()) |
|---|
| 79 | + std::string("]"); |
|---|
| 80 | } |
|---|
| 81 | |
|---|
| 82 | template <typename A, typename B> |
|---|
| 83 | inline std::string |
|---|
| 84 | parser_name(shortest_alternative<A, B> const& p) |
|---|
| 85 | { |
|---|
| 86 | return std::string("shortest_alternative") |
|---|
| 87 | + std::string("[") |
|---|
| 88 | + parser_name(p.left()) + std::string(", ") + parser_name(p.right()) |
|---|
| 89 | + std::string("]"); |
|---|
| 90 | } |
|---|
| 91 | |
|---|
| 92 | /////////////////////////////////////////////////////////////////////////////// |
|---|
| 93 | // from numerics.hpp |
|---|
| 94 | template <typename T, int Radix, unsigned MinDigits, int MaxDigits> |
|---|
| 95 | inline std::string |
|---|
| 96 | parser_name(uint_parser<T, Radix, MinDigits, MaxDigits> const& p) |
|---|
| 97 | { |
|---|
| 98 | BOOST_SPIRIT_SSTREAM stream; |
|---|
| 99 | stream << Radix << ", " << MinDigits << ", " << MaxDigits; |
|---|
| 100 | return std::string("uint_parser<") |
|---|
| 101 | + BOOST_SPIRIT_GETSTRING(stream) |
|---|
| 102 | + std::string(">"); |
|---|
| 103 | } |
|---|
| 104 | |
|---|
| 105 | template <typename T, int Radix, unsigned MinDigits, int MaxDigits> |
|---|
| 106 | inline std::string |
|---|
| 107 | parser_name(int_parser<T, Radix, MinDigits, MaxDigits> const& p) |
|---|
| 108 | { |
|---|
| 109 | BOOST_SPIRIT_SSTREAM stream; |
|---|
| 110 | stream << Radix << ", " << MinDigits << ", " << MaxDigits; |
|---|
| 111 | return std::string("int_parser<") |
|---|
| 112 | + BOOST_SPIRIT_GETSTRING(stream) |
|---|
| 113 | + std::string(">"); |
|---|
| 114 | } |
|---|
| 115 | |
|---|
| 116 | template <typename T, typename RealPoliciesT> |
|---|
| 117 | inline std::string |
|---|
| 118 | parser_name(real_parser<T, RealPoliciesT> const& p) |
|---|
| 119 | { |
|---|
| 120 | return std::string("real_parser"); |
|---|
| 121 | } |
|---|
| 122 | |
|---|
| 123 | /////////////////////////////////////////////////////////////////////////////// |
|---|
| 124 | // from operators.hpp |
|---|
| 125 | template <typename A, typename B> |
|---|
| 126 | inline std::string |
|---|
| 127 | parser_name(sequence<A, B> const& p) |
|---|
| 128 | { |
|---|
| 129 | return std::string("sequence") |
|---|
| 130 | + std::string("[") |
|---|
| 131 | + parser_name(p.left()) + std::string(", ") + parser_name(p.right()) |
|---|
| 132 | + std::string("]"); |
|---|
| 133 | } |
|---|
| 134 | |
|---|
| 135 | template <typename A, typename B> |
|---|
| 136 | inline std::string |
|---|
| 137 | parser_name(sequential_or<A, B> const& p) |
|---|
| 138 | { |
|---|
| 139 | return std::string("sequential_or") |
|---|
| 140 | + std::string("[") |
|---|
| 141 | + parser_name(p.left()) + std::string(", ") + parser_name(p.right()) |
|---|
| 142 | + std::string("]"); |
|---|
| 143 | } |
|---|
| 144 | |
|---|
| 145 | template <typename A, typename B> |
|---|
| 146 | inline std::string |
|---|
| 147 | parser_name(alternative<A, B> const& p) |
|---|
| 148 | { |
|---|
| 149 | return std::string("alternative") |
|---|
| 150 | + std::string("[") |
|---|
| 151 | + parser_name(p.left()) + std::string(", ") + parser_name(p.right()) |
|---|
| 152 | + std::string("]"); |
|---|
| 153 | } |
|---|
| 154 | |
|---|
| 155 | template <typename A, typename B> |
|---|
| 156 | inline std::string |
|---|
| 157 | parser_name(intersection<A, B> const& p) |
|---|
| 158 | { |
|---|
| 159 | return std::string("intersection") |
|---|
| 160 | + std::string("[") |
|---|
| 161 | + parser_name(p.left()) + std::string(", ") + parser_name(p.right()) |
|---|
| 162 | + std::string("]"); |
|---|
| 163 | } |
|---|
| 164 | |
|---|
| 165 | template <typename A, typename B> |
|---|
| 166 | inline std::string |
|---|
| 167 | parser_name(difference<A, B> const& p) |
|---|
| 168 | { |
|---|
| 169 | return std::string("difference") |
|---|
| 170 | + std::string("[") |
|---|
| 171 | + parser_name(p.left()) + std::string(", ") + parser_name(p.right()) |
|---|
| 172 | + std::string("]"); |
|---|
| 173 | } |
|---|
| 174 | |
|---|
| 175 | template <typename A, typename B> |
|---|
| 176 | inline std::string |
|---|
| 177 | parser_name(exclusive_or<A, B> const& p) |
|---|
| 178 | { |
|---|
| 179 | return std::string("exclusive_or") |
|---|
| 180 | + std::string("[") |
|---|
| 181 | + parser_name(p.left()) + std::string(", ") + parser_name(p.right()) |
|---|
| 182 | + std::string("]"); |
|---|
| 183 | } |
|---|
| 184 | |
|---|
| 185 | template <typename S> |
|---|
| 186 | inline std::string |
|---|
| 187 | parser_name(optional<S> const& p) |
|---|
| 188 | { |
|---|
| 189 | return std::string("optional") |
|---|
| 190 | + std::string("[") |
|---|
| 191 | + parser_name(p.subject()) |
|---|
| 192 | + std::string("]"); |
|---|
| 193 | } |
|---|
| 194 | |
|---|
| 195 | template <typename S> |
|---|
| 196 | inline std::string |
|---|
| 197 | parser_name(kleene_star<S> const& p) |
|---|
| 198 | { |
|---|
| 199 | return std::string("kleene_star") |
|---|
| 200 | + std::string("[") |
|---|
| 201 | + parser_name(p.subject()) |
|---|
| 202 | + std::string("]"); |
|---|
| 203 | } |
|---|
| 204 | |
|---|
| 205 | template <typename S> |
|---|
| 206 | inline std::string |
|---|
| 207 | parser_name(positive<S> const& p) |
|---|
| 208 | { |
|---|
| 209 | return std::string("positive") |
|---|
| 210 | + std::string("[") |
|---|
| 211 | + parser_name(p.subject()) |
|---|
| 212 | + std::string("]"); |
|---|
| 213 | } |
|---|
| 214 | |
|---|
| 215 | /////////////////////////////////////////////////////////////////////////////// |
|---|
| 216 | // from parser.hpp |
|---|
| 217 | template <typename DerivedT> |
|---|
| 218 | inline std::string |
|---|
| 219 | parser_name(parser<DerivedT> const& p) |
|---|
| 220 | { |
|---|
| 221 | return std::string("parser"); |
|---|
| 222 | } |
|---|
| 223 | |
|---|
| 224 | /////////////////////////////////////////////////////////////////////////////// |
|---|
| 225 | // from primitives.hpp |
|---|
| 226 | template <typename DerivedT> |
|---|
| 227 | inline std::string |
|---|
| 228 | parser_name(char_parser<DerivedT> const &p) |
|---|
| 229 | { |
|---|
| 230 | return std::string("char_parser"); |
|---|
| 231 | } |
|---|
| 232 | |
|---|
| 233 | template <typename CharT> |
|---|
| 234 | inline std::string |
|---|
| 235 | parser_name(chlit<CharT> const &p) |
|---|
| 236 | { |
|---|
| 237 | return std::string("chlit(\'") |
|---|
| 238 | + std::string(1, p.ch) |
|---|
| 239 | + std::string("\')"); |
|---|
| 240 | } |
|---|
| 241 | |
|---|
| 242 | template <typename CharT> |
|---|
| 243 | inline std::string |
|---|
| 244 | parser_name(range<CharT> const &p) |
|---|
| 245 | { |
|---|
| 246 | return std::string("range(") |
|---|
| 247 | + std::string(1, p.first) + std::string(", ") + std::string(1, p.last) |
|---|
| 248 | + std::string(")"); |
|---|
| 249 | } |
|---|
| 250 | |
|---|
| 251 | template <typename IteratorT> |
|---|
| 252 | inline std::string |
|---|
| 253 | parser_name(chseq<IteratorT> const &p) |
|---|
| 254 | { |
|---|
| 255 | return std::string("chseq(\"") |
|---|
| 256 | + std::string(p.first, p.last) |
|---|
| 257 | + std::string("\")"); |
|---|
| 258 | } |
|---|
| 259 | |
|---|
| 260 | template <typename IteratorT> |
|---|
| 261 | inline std::string |
|---|
| 262 | parser_name(strlit<IteratorT> const &p) |
|---|
| 263 | { |
|---|
| 264 | return std::string("strlit(\"") |
|---|
| 265 | + std::string(p.seq.first, p.seq.last) |
|---|
| 266 | + std::string("\")"); |
|---|
| 267 | } |
|---|
| 268 | |
|---|
| 269 | inline std::string |
|---|
| 270 | parser_name(nothing_parser const&) |
|---|
| 271 | { |
|---|
| 272 | return std::string("nothing"); |
|---|
| 273 | } |
|---|
| 274 | |
|---|
| 275 | inline std::string |
|---|
| 276 | parser_name(epsilon_parser const&) |
|---|
| 277 | { |
|---|
| 278 | return std::string("epsilon"); |
|---|
| 279 | } |
|---|
| 280 | |
|---|
| 281 | inline std::string |
|---|
| 282 | parser_name(anychar_parser const&) |
|---|
| 283 | { |
|---|
| 284 | return std::string("anychar"); |
|---|
| 285 | } |
|---|
| 286 | |
|---|
| 287 | inline std::string |
|---|
| 288 | parser_name(alnum_parser const&) |
|---|
| 289 | { |
|---|
| 290 | return std::string("alnum"); |
|---|
| 291 | } |
|---|
| 292 | |
|---|
| 293 | inline std::string |
|---|
| 294 | parser_name(alpha_parser const&) |
|---|
| 295 | { |
|---|
| 296 | return std::string("alpha"); |
|---|
| 297 | } |
|---|
| 298 | |
|---|
| 299 | inline std::string |
|---|
| 300 | parser_name(cntrl_parser const&) |
|---|
| 301 | { |
|---|
| 302 | return std::string("cntrl"); |
|---|
| 303 | } |
|---|
| 304 | |
|---|
| 305 | inline std::string |
|---|
| 306 | parser_name(digit_parser const&) |
|---|
| 307 | { |
|---|
| 308 | return std::string("digit"); |
|---|
| 309 | } |
|---|
| 310 | |
|---|
| 311 | inline std::string |
|---|
| 312 | parser_name(graph_parser const&) |
|---|
| 313 | { |
|---|
| 314 | return std::string("graph"); |
|---|
| 315 | } |
|---|
| 316 | |
|---|
| 317 | inline std::string |
|---|
| 318 | parser_name(lower_parser const&) |
|---|
| 319 | { |
|---|
| 320 | return std::string("lower"); |
|---|
| 321 | } |
|---|
| 322 | |
|---|
| 323 | inline std::string |
|---|
| 324 | parser_name(print_parser const&) |
|---|
| 325 | { |
|---|
| 326 | return std::string("print"); |
|---|
| 327 | } |
|---|
| 328 | |
|---|
| 329 | inline std::string |
|---|
| 330 | parser_name(punct_parser const&) |
|---|
| 331 | { |
|---|
| 332 | return std::string("punct"); |
|---|
| 333 | } |
|---|
| 334 | |
|---|
| 335 | inline std::string |
|---|
| 336 | parser_name(blank_parser const&) |
|---|
| 337 | { |
|---|
| 338 | return std::string("blank"); |
|---|
| 339 | } |
|---|
| 340 | |
|---|
| 341 | inline std::string |
|---|
| 342 | parser_name(space_parser const&) |
|---|
| 343 | { |
|---|
| 344 | return std::string("space"); |
|---|
| 345 | } |
|---|
| 346 | |
|---|
| 347 | inline std::string |
|---|
| 348 | parser_name(upper_parser const&) |
|---|
| 349 | { |
|---|
| 350 | return std::string("upper"); |
|---|
| 351 | } |
|---|
| 352 | |
|---|
| 353 | inline std::string |
|---|
| 354 | parser_name(xdigit_parser const&) |
|---|
| 355 | { |
|---|
| 356 | return std::string("xdigit"); |
|---|
| 357 | } |
|---|
| 358 | |
|---|
| 359 | inline std::string |
|---|
| 360 | parser_name(eol_parser const&) |
|---|
| 361 | { |
|---|
| 362 | return std::string("eol"); |
|---|
| 363 | } |
|---|
| 364 | |
|---|
| 365 | inline std::string |
|---|
| 366 | parser_name(end_parser const&) |
|---|
| 367 | { |
|---|
| 368 | return std::string("end"); |
|---|
| 369 | } |
|---|
| 370 | |
|---|
| 371 | /////////////////////////////////////////////////////////////////////////////// |
|---|
| 372 | // from rule.hpp |
|---|
| 373 | namespace impl { |
|---|
| 374 | struct node_registry |
|---|
| 375 | { |
|---|
| 376 | typedef std::pair<std::string, bool> rule_info; |
|---|
| 377 | typedef std::map<void const *, rule_info> rule_infos; |
|---|
| 378 | |
|---|
| 379 | std::string find_node(void const *r) |
|---|
| 380 | { |
|---|
| 381 | rule_infos::const_iterator cit = infos.find(r); |
|---|
| 382 | if (cit != infos.end()) |
|---|
| 383 | return (*cit).second.first; |
|---|
| 384 | return std::string("<unknown>"); |
|---|
| 385 | } |
|---|
| 386 | |
|---|
| 387 | bool trace_node(void const *r) |
|---|
| 388 | { |
|---|
| 389 | rule_infos::const_iterator cit = infos.find(r); |
|---|
| 390 | if (cit != infos.end()) |
|---|
| 391 | return (*cit).second.second; |
|---|
| 392 | return BOOST_SPIRIT_DEBUG_TRACENODE; |
|---|
| 393 | } |
|---|
| 394 | |
|---|
| 395 | bool register_node(void const *r, char const *name_to_register, |
|---|
| 396 | bool trace_node) |
|---|
| 397 | { |
|---|
| 398 | if (infos.find(r) != infos.end()) |
|---|
| 399 | return false; |
|---|
| 400 | |
|---|
| 401 | return infos.insert(rule_infos::value_type(r, |
|---|
| 402 | rule_info(std::string(name_to_register), trace_node)) |
|---|
| 403 | ).second; |
|---|
| 404 | } |
|---|
| 405 | |
|---|
| 406 | bool unregister_node(void const *r) |
|---|
| 407 | { |
|---|
| 408 | if (infos.find(r) == infos.end()) |
|---|
| 409 | return false; |
|---|
| 410 | return (1 == infos.erase(r)); |
|---|
| 411 | } |
|---|
| 412 | |
|---|
| 413 | private: |
|---|
| 414 | rule_infos infos; |
|---|
| 415 | }; |
|---|
| 416 | |
|---|
| 417 | inline node_registry & |
|---|
| 418 | get_node_registry() |
|---|
| 419 | { |
|---|
| 420 | static node_registry node_infos; |
|---|
| 421 | return node_infos; |
|---|
| 422 | } |
|---|
| 423 | } // namespace impl |
|---|
| 424 | |
|---|
| 425 | template< |
|---|
| 426 | typename DerivedT, typename EmbedT, |
|---|
| 427 | typename T0, typename T1, typename T2 |
|---|
| 428 | > |
|---|
| 429 | inline std::string |
|---|
| 430 | parser_name(impl::rule_base<DerivedT, EmbedT, T0, T1, T2> const& p) |
|---|
| 431 | { |
|---|
| 432 | return std::string("rule_base") |
|---|
| 433 | + std::string("(") |
|---|
| 434 | + impl::get_node_registry().find_node(&p) |
|---|
| 435 | + std::string(")"); |
|---|
| 436 | } |
|---|
| 437 | |
|---|
| 438 | template<typename T0, typename T1, typename T2> |
|---|
| 439 | inline std::string |
|---|
| 440 | parser_name(rule<T0, T1, T2> const& p) |
|---|
| 441 | { |
|---|
| 442 | return std::string("rule") |
|---|
| 443 | + std::string("(") |
|---|
| 444 | + impl::get_node_registry().find_node(&p) |
|---|
| 445 | + std::string(")"); |
|---|
| 446 | } |
|---|
| 447 | |
|---|
| 448 | /////////////////////////////////////////////////////////////////////////////// |
|---|
| 449 | // from subrule.hpp |
|---|
| 450 | template <typename FirstT, typename RestT> |
|---|
| 451 | inline std::string |
|---|
| 452 | parser_name(subrule_list<FirstT, RestT> const &p) |
|---|
| 453 | { |
|---|
| 454 | return std::string("subrule_list") |
|---|
| 455 | + std::string("(") |
|---|
| 456 | + impl::get_node_registry().find_node(&p) |
|---|
| 457 | + std::string(")"); |
|---|
| 458 | } |
|---|
| 459 | |
|---|
| 460 | template <int ID, typename DefT, typename ContextT> |
|---|
| 461 | inline std::string |
|---|
| 462 | parser_name(subrule_parser<ID, DefT, ContextT> const &p) |
|---|
| 463 | { |
|---|
| 464 | return std::string("subrule_parser") |
|---|
| 465 | + std::string("(") |
|---|
| 466 | + impl::get_node_registry().find_node(&p) |
|---|
| 467 | + std::string(")"); |
|---|
| 468 | } |
|---|
| 469 | |
|---|
| 470 | template <int ID, typename ContextT> |
|---|
| 471 | inline std::string |
|---|
| 472 | parser_name(subrule<ID, ContextT> const &p) |
|---|
| 473 | { |
|---|
| 474 | BOOST_SPIRIT_SSTREAM stream; |
|---|
| 475 | stream << ID; |
|---|
| 476 | return std::string("subrule<") |
|---|
| 477 | + BOOST_SPIRIT_GETSTRING(stream) |
|---|
| 478 | + std::string(">(") |
|---|
| 479 | + impl::get_node_registry().find_node(&p) |
|---|
| 480 | + std::string(")"); |
|---|
| 481 | } |
|---|
| 482 | |
|---|
| 483 | /////////////////////////////////////////////////////////////////////////////// |
|---|
| 484 | // from grammar.hpp |
|---|
| 485 | template <typename DerivedT, typename ContextT> |
|---|
| 486 | inline std::string |
|---|
| 487 | parser_name(grammar<DerivedT, ContextT> const& p) |
|---|
| 488 | { |
|---|
| 489 | return std::string("grammar") |
|---|
| 490 | + std::string("(") |
|---|
| 491 | + impl::get_node_registry().find_node(&p) |
|---|
| 492 | + std::string(")"); |
|---|
| 493 | } |
|---|
| 494 | |
|---|
| 495 | /////////////////////////////////////////////////////////////////////////////// |
|---|
| 496 | // decide, if a node is to be traced or not |
|---|
| 497 | template< |
|---|
| 498 | typename DerivedT, typename EmbedT, |
|---|
| 499 | typename T0, typename T1, typename T2 |
|---|
| 500 | > |
|---|
| 501 | inline bool |
|---|
| 502 | trace_parser(impl::rule_base<DerivedT, EmbedT, T0, T1, T2> |
|---|
| 503 | const& p) |
|---|
| 504 | { |
|---|
| 505 | return impl::get_node_registry().trace_node(&p); |
|---|
| 506 | } |
|---|
| 507 | |
|---|
| 508 | template<typename T0, typename T1, typename T2> |
|---|
| 509 | inline bool |
|---|
| 510 | trace_parser(rule<T0, T1, T2> const& p) |
|---|
| 511 | { |
|---|
| 512 | return impl::get_node_registry().trace_node(&p); |
|---|
| 513 | } |
|---|
| 514 | |
|---|
| 515 | template <typename DerivedT, typename ContextT> |
|---|
| 516 | inline bool |
|---|
| 517 | trace_parser(grammar<DerivedT, ContextT> const& p) |
|---|
| 518 | { |
|---|
| 519 | return impl::get_node_registry().trace_node(&p); |
|---|
| 520 | } |
|---|
| 521 | |
|---|
| 522 | template <typename DerivedT, int N, typename ContextT> |
|---|
| 523 | inline bool |
|---|
| 524 | trace_parser(impl::entry_grammar<DerivedT, N, ContextT> const& p) |
|---|
| 525 | { |
|---|
| 526 | return impl::get_node_registry().trace_node(&p); |
|---|
| 527 | } |
|---|
| 528 | |
|---|
| 529 | template <int ID, typename ContextT> |
|---|
| 530 | bool |
|---|
| 531 | trace_parser(subrule<ID, ContextT> const& p) |
|---|
| 532 | { |
|---|
| 533 | return impl::get_node_registry().trace_node(&p); |
|---|
| 534 | } |
|---|
| 535 | |
|---|
| 536 | template <typename ParserT, typename ActorTupleT> |
|---|
| 537 | bool |
|---|
| 538 | trace_parser(init_closure_parser<ParserT, ActorTupleT> const& p) |
|---|
| 539 | { |
|---|
| 540 | return impl::get_node_registry().trace_node(&p); |
|---|
| 541 | } |
|---|
| 542 | |
|---|
| 543 | /////////////////////////////////////////////////////////////////////////////// |
|---|
| 544 | }} // namespace boost::spirit |
|---|
| 545 | |
|---|
| 546 | #undef BOOST_SPIRIT_SSTREAM |
|---|
| 547 | #undef BOOST_SPIRIT_GETSTRING |
|---|
| 548 | |
|---|
| 549 | #endif // defined(BOOST_SPIRIT_DEBUG) |
|---|
| 550 | |
|---|
| 551 | #endif // !defined(BOOST_SPIRIT_PARSER_NAMES_IPP) |
|---|