Added missed boost headers files

This commit is contained in:
Viacheslav Demydiuk
2024-11-14 14:16:28 +02:00
parent 19d9cb23d3
commit b89f00d310
12 changed files with 1677 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
// Boost.Bimap
//
// Copyright (c) 2006-2007 Matias Capeletto
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
/// \file detail/debug/static_error.hpp
/// \brief Formatted compile time error
#ifndef BOOST_BIMAP_DETAIL_DEBUG_STATIC_ERROR_HPP
#define BOOST_BIMAP_DETAIL_DEBUG_STATIC_ERROR_HPP
#if defined(_MSC_VER)
#pragma once
#endif
#include <boost/config.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/preprocessor/cat.hpp>
// Easier way to call BOOST_MPL_ASSERT_MSG in class scope to generate
// a static error.
/*===========================================================================*/
#define BOOST_BIMAP_STATIC_ERROR(MESSAGE,VARIABLES) \
BOOST_MPL_ASSERT_MSG(false, \
BOOST_PP_CAT(BIMAP_STATIC_ERROR__,MESSAGE), \
VARIABLES)
/*===========================================================================*/
#endif // BOOST_BIMAP_DETAIL_DEBUG_STATIC_ERROR_HPP
+93
View File
@@ -0,0 +1,93 @@
/*
Copyright Rene Rivera 2008-2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_PREDEF_ARCHITECTURE_X86_32_H
#define BOOST_PREDEF_ARCHITECTURE_X86_32_H
#include <boost/predef/version_number.h>
#include <boost/predef/make.h>
/* tag::reference[]
= `BOOST_ARCH_X86_32`
http://en.wikipedia.org/wiki/X86[Intel x86] architecture:
If available versions [3-6] are specifically detected.
[options="header"]
|===
| {predef_symbol} | {predef_version}
| `i386` | {predef_detection}
| `+__i386__+` | {predef_detection}
| `+__i486__+` | {predef_detection}
| `+__i586__+` | {predef_detection}
| `+__i686__+` | {predef_detection}
| `+__i386+` | {predef_detection}
| `+_M_IX86+` | {predef_detection}
| `+_X86_+` | {predef_detection}
| `+__THW_INTEL__+` | {predef_detection}
| `+__I86__+` | {predef_detection}
| `+__INTEL__+` | {predef_detection}
| `+__I86__+` | V.0.0
| `+_M_IX86+` | V.0.0
| `+__i686__+` | 6.0.0
| `+__i586__+` | 5.0.0
| `+__i486__+` | 4.0.0
| `+__i386__+` | 3.0.0
|===
*/ // end::reference[]
#define BOOST_ARCH_X86_32 BOOST_VERSION_NUMBER_NOT_AVAILABLE
#if defined(i386) || defined(__i386__) || \
defined(__i486__) || defined(__i586__) || \
defined(__i686__) || defined(__i386) || \
defined(_M_IX86) || defined(_X86_) || \
defined(__THW_INTEL__) || defined(__I86__) || \
defined(__INTEL__)
# undef BOOST_ARCH_X86_32
# if !defined(BOOST_ARCH_X86_32) && defined(__I86__)
# define BOOST_ARCH_X86_32 BOOST_VERSION_NUMBER(__I86__,0,0)
# endif
# if !defined(BOOST_ARCH_X86_32) && defined(_M_IX86)
# define BOOST_ARCH_X86_32 BOOST_PREDEF_MAKE_10_VV00(_M_IX86)
# endif
# if !defined(BOOST_ARCH_X86_32) && defined(__i686__)
# define BOOST_ARCH_X86_32 BOOST_VERSION_NUMBER(6,0,0)
# endif
# if !defined(BOOST_ARCH_X86_32) && defined(__i586__)
# define BOOST_ARCH_X86_32 BOOST_VERSION_NUMBER(5,0,0)
# endif
# if !defined(BOOST_ARCH_X86_32) && defined(__i486__)
# define BOOST_ARCH_X86_32 BOOST_VERSION_NUMBER(4,0,0)
# endif
# if !defined(BOOST_ARCH_X86_32) && defined(__i386__)
# define BOOST_ARCH_X86_32 BOOST_VERSION_NUMBER(3,0,0)
# endif
# if !defined(BOOST_ARCH_X86_32)
# define BOOST_ARCH_X86_32 BOOST_VERSION_NUMBER_AVAILABLE
# endif
#endif
#if BOOST_ARCH_X86_32
# define BOOST_ARCH_X86_32_AVAILABLE
#endif
#if BOOST_ARCH_X86_32
# undef BOOST_ARCH_WORD_BITS_32
# define BOOST_ARCH_WORD_BITS_32 BOOST_VERSION_NUMBER_AVAILABLE
#endif
#define BOOST_ARCH_X86_32_NAME "Intel x86-32"
#include <boost/predef/architecture/x86.h>
#endif
#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_X86_32,BOOST_ARCH_X86_32_NAME)
+56
View File
@@ -0,0 +1,56 @@
/*
Copyright Rene Rivera 2008-2021
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_PREDEF_ARCHITECTURE_X86_64_H
#define BOOST_PREDEF_ARCHITECTURE_X86_64_H
#include <boost/predef/version_number.h>
#include <boost/predef/make.h>
/* tag::reference[]
= `BOOST_ARCH_X86_64`
https://en.wikipedia.org/wiki/X86-64[X86-64] architecture.
[options="header"]
|===
| {predef_symbol} | {predef_version}
| `+__x86_64+` | {predef_detection}
| `+__x86_64__+` | {predef_detection}
| `+__amd64__+` | {predef_detection}
| `+__amd64+` | {predef_detection}
| `+_M_X64+` | {predef_detection}
|===
*/ // end::reference[]
#define BOOST_ARCH_X86_64 BOOST_VERSION_NUMBER_NOT_AVAILABLE
#if defined(__x86_64) || defined(__x86_64__) || \
defined(__amd64__) || defined(__amd64) || \
defined(_M_X64)
# undef BOOST_ARCH_X86_64
# define BOOST_ARCH_X86_64 BOOST_VERSION_NUMBER_AVAILABLE
#endif
#if BOOST_ARCH_X86_64
# define BOOST_ARCH_X86_64_AVAILABLE
#endif
#if BOOST_ARCH_X86_64
# undef BOOST_ARCH_WORD_BITS_64
# define BOOST_ARCH_WORD_BITS_64 BOOST_VERSION_NUMBER_AVAILABLE
#endif
#define BOOST_ARCH_X86_64_NAME "Intel x86-64"
#include <boost/predef/architecture/x86.h>
#endif
#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_X86_64,BOOST_ARCH_X86_64_NAME)
+135
View File
@@ -0,0 +1,135 @@
/*
Copyright Charly Chevalier 2015
Copyright Joel Falcou 2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_VERSIONS_H
#define BOOST_PREDEF_HARDWARE_SIMD_X86_VERSIONS_H
#include <boost/predef/version_number.h>
/* tag::reference[]
= `BOOST_HW_SIMD_X86_*_VERSION`
Those defines represent x86 SIMD extensions versions.
NOTE: You *MUST* compare them with the predef `BOOST_HW_SIMD_X86`.
*/ // end::reference[]
// ---------------------------------
/* tag::reference[]
= `BOOST_HW_SIMD_X86_MMX_VERSION`
The https://en.wikipedia.org/wiki/MMX_(instruction_set)[MMX] x86 extension
version number.
Version number is: *0.99.0*.
*/ // end::reference[]
#define BOOST_HW_SIMD_X86_MMX_VERSION BOOST_VERSION_NUMBER(0, 99, 0)
/* tag::reference[]
= `BOOST_HW_SIMD_X86_SSE_VERSION`
The https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions[SSE] x86 extension
version number.
Version number is: *1.0.0*.
*/ // end::reference[]
#define BOOST_HW_SIMD_X86_SSE_VERSION BOOST_VERSION_NUMBER(1, 0, 0)
/* tag::reference[]
= `BOOST_HW_SIMD_X86_SSE2_VERSION`
The https://en.wikipedia.org/wiki/SSE2[SSE2] x86 extension version number.
Version number is: *2.0.0*.
*/ // end::reference[]
#define BOOST_HW_SIMD_X86_SSE2_VERSION BOOST_VERSION_NUMBER(2, 0, 0)
/* tag::reference[]
= `BOOST_HW_SIMD_X86_SSE3_VERSION`
The https://en.wikipedia.org/wiki/SSE3[SSE3] x86 extension version number.
Version number is: *3.0.0*.
*/ // end::reference[]
#define BOOST_HW_SIMD_X86_SSE3_VERSION BOOST_VERSION_NUMBER(3, 0, 0)
/* tag::reference[]
= `BOOST_HW_SIMD_X86_SSSE3_VERSION`
The https://en.wikipedia.org/wiki/SSSE3[SSSE3] x86 extension version number.
Version number is: *3.1.0*.
*/ // end::reference[]
#define BOOST_HW_SIMD_X86_SSSE3_VERSION BOOST_VERSION_NUMBER(3, 1, 0)
/* tag::reference[]
= `BOOST_HW_SIMD_X86_SSE4_1_VERSION`
The https://en.wikipedia.org/wiki/SSE4#SSE4.1[SSE4_1] x86 extension version
number.
Version number is: *4.1.0*.
*/ // end::reference[]
#define BOOST_HW_SIMD_X86_SSE4_1_VERSION BOOST_VERSION_NUMBER(4, 1, 0)
/* tag::reference[]
= `BOOST_HW_SIMD_X86_SSE4_2_VERSION`
The https://en.wikipedia.org/wiki/SSE4##SSE4.2[SSE4_2] x86 extension version
number.
Version number is: *4.2.0*.
*/ // end::reference[]
#define BOOST_HW_SIMD_X86_SSE4_2_VERSION BOOST_VERSION_NUMBER(4, 2, 0)
/* tag::reference[]
= `BOOST_HW_SIMD_X86_AVX_VERSION`
The https://en.wikipedia.org/wiki/Advanced_Vector_Extensions[AVX] x86
extension version number.
Version number is: *5.0.0*.
*/ // end::reference[]
#define BOOST_HW_SIMD_X86_AVX_VERSION BOOST_VERSION_NUMBER(5, 0, 0)
/* tag::reference[]
= `BOOST_HW_SIMD_X86_FMA3_VERSION`
The https://en.wikipedia.org/wiki/FMA_instruction_set[FMA3] x86 extension
version number.
Version number is: *5.2.0*.
*/ // end::reference[]
#define BOOST_HW_SIMD_X86_FMA3_VERSION BOOST_VERSION_NUMBER(5, 2, 0)
/* tag::reference[]
= `BOOST_HW_SIMD_X86_AVX2_VERSION`
The https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#Advanced_Vector_Extensions_2[AVX2]
x86 extension version number.
Version number is: *5.3.0*.
*/ // end::reference[]
#define BOOST_HW_SIMD_X86_AVX2_VERSION BOOST_VERSION_NUMBER(5, 3, 0)
/* tag::reference[]
= `BOOST_HW_SIMD_X86_MIC_VERSION`
The https://en.wikipedia.org/wiki/Xeon_Phi[MIC] (Xeon Phi) x86 extension
version number.
Version number is: *9.0.0*.
*/ // end::reference[]
#define BOOST_HW_SIMD_X86_MIC_VERSION BOOST_VERSION_NUMBER(9, 0, 0)
/* tag::reference[]
*/ // end::reference[]
#endif
+44
View File
@@ -0,0 +1,44 @@
# /* Copyright (C) 2001
# * Housemarque Oy
# * http://www.housemarque.com
# *
# * Distributed under the Boost Software License, Version 1.0. (See
# * accompanying file LICENSE_1_0.txt or copy at
# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_DEBUG_ASSERT_HPP
# define BOOST_PREPROCESSOR_DEBUG_ASSERT_HPP
#
# include <boost/preprocessor/config/config.hpp>
# include <boost/preprocessor/control/expr_iif.hpp>
# include <boost/preprocessor/control/iif.hpp>
# include <boost/preprocessor/logical/not.hpp>
# include <boost/preprocessor/tuple/eat.hpp>
#
# /* BOOST_PP_ASSERT */
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
# define BOOST_PP_ASSERT BOOST_PP_ASSERT_D
# else
# define BOOST_PP_ASSERT(cond) BOOST_PP_ASSERT_D(cond)
# endif
#
# define BOOST_PP_ASSERT_D(cond) BOOST_PP_IIF(BOOST_PP_NOT(cond), BOOST_PP_ASSERT_ERROR, BOOST_PP_TUPLE_EAT_1)(...)
# define BOOST_PP_ASSERT_ERROR(x, y, z)
#
# /* BOOST_PP_ASSERT_MSG */
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
# define BOOST_PP_ASSERT_MSG BOOST_PP_ASSERT_MSG_D
# else
# define BOOST_PP_ASSERT_MSG(cond, msg) BOOST_PP_ASSERT_MSG_D(cond, msg)
# endif
#
# define BOOST_PP_ASSERT_MSG_D(cond, msg) BOOST_PP_EXPR_IIF(BOOST_PP_NOT(cond), msg)
#
# endif
+33
View File
@@ -0,0 +1,33 @@
# /* **************************************************************************
# * *
# * (C) Copyright Paul Mensonides 2002.
# * Distributed under the Boost Software License, Version 1.0. (See
# * accompanying file LICENSE_1_0.txt or copy at
# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_DEBUG_ERROR_HPP
# define BOOST_PREPROCESSOR_DEBUG_ERROR_HPP
#
# include <boost/preprocessor/cat.hpp>
# include <boost/preprocessor/config/config.hpp>
#
# /* BOOST_PP_ERROR */
#
# if BOOST_PP_CONFIG_ERRORS
# define BOOST_PP_ERROR(code) BOOST_PP_CAT(BOOST_PP_ERROR_, code)
# endif
#
# define BOOST_PP_ERROR_0x0000 BOOST_PP_ERROR(0x0000, BOOST_PP_INDEX_OUT_OF_BOUNDS)
# define BOOST_PP_ERROR_0x0001 BOOST_PP_ERROR(0x0001, BOOST_PP_WHILE_OVERFLOW)
# define BOOST_PP_ERROR_0x0002 BOOST_PP_ERROR(0x0002, BOOST_PP_FOR_OVERFLOW)
# define BOOST_PP_ERROR_0x0003 BOOST_PP_ERROR(0x0003, BOOST_PP_REPEAT_OVERFLOW)
# define BOOST_PP_ERROR_0x0004 BOOST_PP_ERROR(0x0004, BOOST_PP_LIST_FOLD_OVERFLOW)
# define BOOST_PP_ERROR_0x0005 BOOST_PP_ERROR(0x0005, BOOST_PP_SEQ_FOLD_OVERFLOW)
# define BOOST_PP_ERROR_0x0006 BOOST_PP_ERROR(0x0006, BOOST_PP_ARITHMETIC_OVERFLOW)
# define BOOST_PP_ERROR_0x0007 BOOST_PP_ERROR(0x0007, BOOST_PP_DIVISION_BY_ZERO)
#
# endif
+35
View File
@@ -0,0 +1,35 @@
# /* **************************************************************************
# * *
# * (C) Copyright Paul Mensonides 2002.
# * Distributed under the Boost Software License, Version 1.0. (See
# * accompanying file LICENSE_1_0.txt or copy at
# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_DEBUG_LINE_HPP
# define BOOST_PREPROCESSOR_DEBUG_LINE_HPP
#
# include <boost/preprocessor/cat.hpp>
# include <boost/preprocessor/config/config.hpp>
# include <boost/preprocessor/iteration/iterate.hpp>
# include <boost/preprocessor/stringize.hpp>
#
# /* BOOST_PP_LINE */
#
# if BOOST_PP_CONFIG_EXTENDED_LINE_INFO
# define BOOST_PP_LINE(line, file) line BOOST_PP_CAT(BOOST_PP_LINE_, BOOST_PP_IS_ITERATING)(file)
# define BOOST_PP_LINE_BOOST_PP_IS_ITERATING(file) #file
# define BOOST_PP_LINE_1(file) BOOST_PP_STRINGIZE(file BOOST_PP_CAT(BOOST_PP_LINE_I_, BOOST_PP_ITERATION_DEPTH())())
# define BOOST_PP_LINE_I_1() [BOOST_PP_FRAME_ITERATION(1)]
# define BOOST_PP_LINE_I_2() BOOST_PP_LINE_I_1()[BOOST_PP_FRAME_ITERATION(2)]
# define BOOST_PP_LINE_I_3() BOOST_PP_LINE_I_2()[BOOST_PP_FRAME_ITERATION(3)]
# define BOOST_PP_LINE_I_4() BOOST_PP_LINE_I_3()[BOOST_PP_FRAME_ITERATION(4)]
# define BOOST_PP_LINE_I_5() BOOST_PP_LINE_I_4()[BOOST_PP_FRAME_ITERATION(5)]
# else
# define BOOST_PP_LINE(line, file) line __FILE__
# endif
#
# endif
+319
View File
@@ -0,0 +1,319 @@
/*=============================================================================
Copyright (c) 2001-2003 Joel de Guzman
Copyright (c) 2002-2003 Hartmut Kaiser
Copyright (c) 2003 Gustavo Guerra
http://spirit.sourceforge.net/
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#if !defined(BOOST_SPIRIT_DEBUG_NODE_HPP)
#define BOOST_SPIRIT_DEBUG_NODE_HPP
#if !defined(BOOST_SPIRIT_DEBUG_MAIN_HPP)
#error "You must include boost/spirit/debug.hpp, not boost/spirit/debug/debug_node.hpp"
#endif
#if defined(BOOST_SPIRIT_DEBUG)
#include <string>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/and.hpp>
#include <boost/spirit/home/classic/namespace.hpp>
#include <boost/spirit/home/classic/core/primitives/primitives.hpp> // for iscntrl_
namespace boost { namespace spirit {
BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
///////////////////////////////////////////////////////////////////////////////
//
// Debug helper classes for rules, which ensure maximum non-intrusiveness of
// the Spirit debug support
//
///////////////////////////////////////////////////////////////////////////////
namespace impl {
struct token_printer_aux_for_chars
{
template<typename CharT>
static void print(std::ostream& o, CharT c)
{
if (c == static_cast<CharT>('\a'))
o << "\\a";
else if (c == static_cast<CharT>('\b'))
o << "\\b";
else if (c == static_cast<CharT>('\f'))
o << "\\f";
else if (c == static_cast<CharT>('\n'))
o << "\\n";
else if (c == static_cast<CharT>('\r'))
o << "\\r";
else if (c == static_cast<CharT>('\t'))
o << "\\t";
else if (c == static_cast<CharT>('\v'))
o << "\\v";
else if (iscntrl_(c))
o << "\\" << static_cast<int>(c);
else
o << static_cast<char>(c);
}
};
// for token types where the comparison with char constants wouldn't work
struct token_printer_aux_for_other_types
{
template<typename CharT>
static void print(std::ostream& o, CharT c)
{
o << c;
}
};
template <typename CharT>
struct token_printer_aux
: mpl::if_<
mpl::and_<
is_convertible<CharT, char>,
is_convertible<char, CharT> >,
token_printer_aux_for_chars,
token_printer_aux_for_other_types
>::type
{
};
template<typename CharT>
inline void token_printer(std::ostream& o, CharT c)
{
#if !defined(BOOST_SPIRIT_DEBUG_TOKEN_PRINTER)
token_printer_aux<CharT>::print(o, c);
#else
BOOST_SPIRIT_DEBUG_TOKEN_PRINTER(o, c);
#endif
}
///////////////////////////////////////////////////////////////////////////////
//
// Dump infos about the parsing state of a rule
//
///////////////////////////////////////////////////////////////////////////////
#if BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES
template <typename IteratorT>
inline void
print_node_info(bool hit, int level, bool close, std::string const& name,
IteratorT first, IteratorT last)
{
if (!name.empty())
{
for (int i = 0; i < level; ++i)
BOOST_SPIRIT_DEBUG_OUT << " ";
if (close)
{
if (hit)
BOOST_SPIRIT_DEBUG_OUT << "/";
else
BOOST_SPIRIT_DEBUG_OUT << "#";
}
BOOST_SPIRIT_DEBUG_OUT << name << ":\t\"";
IteratorT iter = first;
IteratorT ilast = last;
for (int j = 0; j < BOOST_SPIRIT_DEBUG_PRINT_SOME; ++j)
{
if (iter == ilast)
break;
token_printer(BOOST_SPIRIT_DEBUG_OUT, *iter);
++iter;
}
BOOST_SPIRIT_DEBUG_OUT << "\"\n";
}
}
#endif // BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES
#if BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_CLOSURES
template <typename ResultT>
inline ResultT &
print_closure_info(ResultT &hit, int level, std::string const& name)
{
if (!name.empty())
{
for (int i = 0; i < level-1; ++i)
BOOST_SPIRIT_DEBUG_OUT << " ";
// for now, print out the return value only
BOOST_SPIRIT_DEBUG_OUT << "^" << name << ":\t";
if (hit.has_valid_attribute())
BOOST_SPIRIT_DEBUG_OUT << hit.value();
else
BOOST_SPIRIT_DEBUG_OUT << "undefined attribute";
BOOST_SPIRIT_DEBUG_OUT << "\n";
}
return hit;
}
#endif // BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_CLOSURES
}
///////////////////////////////////////////////////////////////////////////////
//
// Implementation note: The parser_context_linker, parser_scanner_linker and
// closure_context_linker classes are wrapped by a PP constant to allow
// redefinition of this classes outside of Spirit
//
///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_SPIRIT_PARSER_CONTEXT_LINKER_DEFINED)
#define BOOST_SPIRIT_PARSER_CONTEXT_LINKER_DEFINED
///////////////////////////////////////////////////////////////////////////
//
// parser_context_linker is a debug wrapper for the ContextT template
// parameter of the rule<>, subrule<> and the grammar<> classes
//
///////////////////////////////////////////////////////////////////////////
template<typename ContextT>
struct parser_context_linker : public ContextT
{
typedef ContextT base_t;
template <typename ParserT>
parser_context_linker(ParserT const& p)
: ContextT(p) {}
template <typename ParserT, typename ScannerT>
void pre_parse(ParserT const& p, ScannerT &scan)
{
this->base_t::pre_parse(p, scan);
#if BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES
if (trace_parser(p.derived())) {
impl::print_node_info(
false,
scan.get_level(),
false,
parser_name(p.derived()),
scan.first,
scan.last);
}
scan.get_level()++;
#endif // BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES
}
template <typename ResultT, typename ParserT, typename ScannerT>
ResultT& post_parse(ResultT& hit, ParserT const& p, ScannerT &scan)
{
#if BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES
--scan.get_level();
if (trace_parser(p.derived())) {
impl::print_node_info(
hit,
scan.get_level(),
true,
parser_name(p.derived()),
scan.first,
scan.last);
}
#endif // BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES
return this->base_t::post_parse(hit, p, scan);
}
};
#endif // !defined(BOOST_SPIRIT_PARSER_CONTEXT_LINKER_DEFINED)
#if !defined(BOOST_SPIRIT_PARSER_SCANNER_LINKER_DEFINED)
#define BOOST_SPIRIT_PARSER_SCANNER_LINKER_DEFINED
///////////////////////////////////////////////////////////////////////////////
// This class is to avoid linker problems and to ensure a real singleton
// 'level' variable
struct debug_support
{
int& get_level()
{
static int level = 0;
return level;
}
};
template<typename ScannerT>
struct parser_scanner_linker : public ScannerT
{
parser_scanner_linker(ScannerT const &scan_) : ScannerT(scan_)
{}
int &get_level()
{ return debug.get_level(); }
private: debug_support debug;
};
#endif // !defined(BOOST_SPIRIT_PARSER_SCANNER_LINKER_DEFINED)
#if !defined(BOOST_SPIRIT_CLOSURE_CONTEXT_LINKER_DEFINED)
#define BOOST_SPIRIT_CLOSURE_CONTEXT_LINKER_DEFINED
///////////////////////////////////////////////////////////////////////////
//
// closure_context_linker is a debug wrapper for the closure template
// parameter of the rule<>, subrule<> and grammar classes
//
///////////////////////////////////////////////////////////////////////////
template<typename ContextT>
struct closure_context_linker : public parser_context_linker<ContextT>
{
typedef parser_context_linker<ContextT> base_t;
template <typename ParserT>
closure_context_linker(ParserT const& p)
: parser_context_linker<ContextT>(p) {}
template <typename ParserT, typename ScannerT>
void pre_parse(ParserT const& p, ScannerT &scan)
{ this->base_t::pre_parse(p, scan); }
template <typename ResultT, typename ParserT, typename ScannerT>
ResultT&
post_parse(ResultT& hit, ParserT const& p, ScannerT &scan)
{
#if BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_CLOSURES
if (hit && trace_parser(p.derived())) {
// for now, print out the return value only
return impl::print_closure_info(
this->base_t::post_parse(hit, p, scan),
scan.get_level(),
parser_name(p.derived())
);
}
#endif // BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_CLOSURES
return this->base_t::post_parse(hit, p, scan);
}
};
#endif // !defined(BOOST_SPIRIT_CLOSURE_CONTEXT_LINKER_DEFINED)
BOOST_SPIRIT_CLASSIC_NAMESPACE_END
}} // namespace BOOST_SPIRIT_CLASSIC_NS
#endif // defined(BOOST_SPIRIT_DEBUG)
#endif // !defined(BOOST_SPIRIT_DEBUG_NODE_HPP)
+555
View File
@@ -0,0 +1,555 @@
/*=============================================================================
Copyright (c) 2001-2003 Joel de Guzman
Copyright (c) 2002-2003 Hartmut Kaiser
http://spirit.sourceforge.net/
Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#if !defined(BOOST_SPIRIT_PARSER_NAMES_IPP)
#define BOOST_SPIRIT_PARSER_NAMES_IPP
#if defined(BOOST_SPIRIT_DEBUG)
#include <string>
#include <iostream>
#include <map>
#include <boost/config.hpp>
#ifdef BOOST_NO_STRINGSTREAM
#include <strstream>
#define BOOST_SPIRIT_SSTREAM std::strstream
std::string BOOST_SPIRIT_GETSTRING(std::strstream& ss)
{
ss << ends;
std::string rval = ss.str();
ss.freeze(false);
return rval;
}
#else
#include <sstream>
#define BOOST_SPIRIT_GETSTRING(ss) ss.str()
#define BOOST_SPIRIT_SSTREAM std::stringstream
#endif
namespace boost { namespace spirit {
BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
///////////////////////////////////////////////////////////////////////////////
// from actions.hpp
template <typename ParserT, typename ActionT>
inline std::string
parser_name(action<ParserT, ActionT> const& p)
{
return std::string("action")
+ std::string("[")
+ parser_name(p.subject())
+ std::string("]");
}
///////////////////////////////////////////////////////////////////////////////
// from directives.hpp
template <typename ParserT>
inline std::string
parser_name(contiguous<ParserT> const& p)
{
return std::string("contiguous")
+ std::string("[")
+ parser_name(p.subject())
+ std::string("]");
}
template <typename ParserT>
inline std::string
parser_name(inhibit_case<ParserT> const& p)
{
return std::string("inhibit_case")
+ std::string("[")
+ parser_name(p.subject())
+ std::string("]");
}
template <typename A, typename B>
inline std::string
parser_name(longest_alternative<A, B> const& p)
{
return std::string("longest_alternative")
+ std::string("[")
+ parser_name(p.left()) + std::string(", ") + parser_name(p.right())
+ std::string("]");
}
template <typename A, typename B>
inline std::string
parser_name(shortest_alternative<A, B> const& p)
{
return std::string("shortest_alternative")
+ std::string("[")
+ parser_name(p.left()) + std::string(", ") + parser_name(p.right())
+ std::string("]");
}
///////////////////////////////////////////////////////////////////////////////
// from numerics.hpp
template <typename T, int Radix, unsigned MinDigits, int MaxDigits>
inline std::string
parser_name(uint_parser<T, Radix, MinDigits, MaxDigits> const& /*p*/)
{
BOOST_SPIRIT_SSTREAM stream;
stream << Radix << ", " << MinDigits << ", " << MaxDigits;
return std::string("uint_parser<")
+ BOOST_SPIRIT_GETSTRING(stream)
+ std::string(">");
}
template <typename T, int Radix, unsigned MinDigits, int MaxDigits>
inline std::string
parser_name(int_parser<T, Radix, MinDigits, MaxDigits> const& /*p*/)
{
BOOST_SPIRIT_SSTREAM stream;
stream << Radix << ", " << MinDigits << ", " << MaxDigits;
return std::string("int_parser<")
+ BOOST_SPIRIT_GETSTRING(stream)
+ std::string(">");
}
template <typename T, typename RealPoliciesT>
inline std::string
parser_name(real_parser<T, RealPoliciesT> const& /*p*/)
{
return std::string("real_parser");
}
///////////////////////////////////////////////////////////////////////////////
// from operators.hpp
template <typename A, typename B>
inline std::string
parser_name(sequence<A, B> const& p)
{
return std::string("sequence")
+ std::string("[")
+ parser_name(p.left()) + std::string(", ") + parser_name(p.right())
+ std::string("]");
}
template <typename A, typename B>
inline std::string
parser_name(sequential_or<A, B> const& p)
{
return std::string("sequential_or")
+ std::string("[")
+ parser_name(p.left()) + std::string(", ") + parser_name(p.right())
+ std::string("]");
}
template <typename A, typename B>
inline std::string
parser_name(alternative<A, B> const& p)
{
return std::string("alternative")
+ std::string("[")
+ parser_name(p.left()) + std::string(", ") + parser_name(p.right())
+ std::string("]");
}
template <typename A, typename B>
inline std::string
parser_name(intersection<A, B> const& p)
{
return std::string("intersection")
+ std::string("[")
+ parser_name(p.left()) + std::string(", ") + parser_name(p.right())
+ std::string("]");
}
template <typename A, typename B>
inline std::string
parser_name(difference<A, B> const& p)
{
return std::string("difference")
+ std::string("[")
+ parser_name(p.left()) + std::string(", ") + parser_name(p.right())
+ std::string("]");
}
template <typename A, typename B>
inline std::string
parser_name(exclusive_or<A, B> const& p)
{
return std::string("exclusive_or")
+ std::string("[")
+ parser_name(p.left()) + std::string(", ") + parser_name(p.right())
+ std::string("]");
}
template <typename S>
inline std::string
parser_name(optional<S> const& p)
{
return std::string("optional")
+ std::string("[")
+ parser_name(p.subject())
+ std::string("]");
}
template <typename S>
inline std::string
parser_name(kleene_star<S> const& p)
{
return std::string("kleene_star")
+ std::string("[")
+ parser_name(p.subject())
+ std::string("]");
}
template <typename S>
inline std::string
parser_name(positive<S> const& p)
{
return std::string("positive")
+ std::string("[")
+ parser_name(p.subject())
+ std::string("]");
}
///////////////////////////////////////////////////////////////////////////////
// from parser.hpp
template <typename DerivedT>
inline std::string
parser_name(parser<DerivedT> const& /*p*/)
{
return std::string("parser");
}
///////////////////////////////////////////////////////////////////////////////
// from primitives.hpp
template <typename DerivedT>
inline std::string
parser_name(char_parser<DerivedT> const &/*p*/)
{
return std::string("char_parser");
}
template <typename CharT>
inline std::string
parser_name(chlit<CharT> const &p)
{
return std::string("chlit(\'")
+ std::string(1, p.ch)
+ std::string("\')");
}
template <typename CharT>
inline std::string
parser_name(range<CharT> const &p)
{
return std::string("range(")
+ std::string(1, p.first) + std::string(", ") + std::string(1, p.last)
+ std::string(")");
}
template <typename IteratorT>
inline std::string
parser_name(chseq<IteratorT> const &p)
{
return std::string("chseq(\"")
+ std::string(p.first, p.last)
+ std::string("\")");
}
template <typename IteratorT>
inline std::string
parser_name(strlit<IteratorT> const &p)
{
return std::string("strlit(\"")
+ std::string(p.seq.first, p.seq.last)
+ std::string("\")");
}
inline std::string
parser_name(nothing_parser const&)
{
return std::string("nothing");
}
inline std::string
parser_name(epsilon_parser const&)
{
return std::string("epsilon");
}
inline std::string
parser_name(anychar_parser const&)
{
return std::string("anychar");
}
inline std::string
parser_name(alnum_parser const&)
{
return std::string("alnum");
}
inline std::string
parser_name(alpha_parser const&)
{
return std::string("alpha");
}
inline std::string
parser_name(cntrl_parser const&)
{
return std::string("cntrl");
}
inline std::string
parser_name(digit_parser const&)
{
return std::string("digit");
}
inline std::string
parser_name(graph_parser const&)
{
return std::string("graph");
}
inline std::string
parser_name(lower_parser const&)
{
return std::string("lower");
}
inline std::string
parser_name(print_parser const&)
{
return std::string("print");
}
inline std::string
parser_name(punct_parser const&)
{
return std::string("punct");
}
inline std::string
parser_name(blank_parser const&)
{
return std::string("blank");
}
inline std::string
parser_name(space_parser const&)
{
return std::string("space");
}
inline std::string
parser_name(upper_parser const&)
{
return std::string("upper");
}
inline std::string
parser_name(xdigit_parser const&)
{
return std::string("xdigit");
}
inline std::string
parser_name(eol_parser const&)
{
return std::string("eol");
}
inline std::string
parser_name(end_parser const&)
{
return std::string("end");
}
///////////////////////////////////////////////////////////////////////////////
// from rule.hpp
namespace impl {
struct node_registry
{
typedef std::pair<std::string, bool> rule_info;
typedef std::map<void const *, rule_info> rule_infos;
std::string find_node(void const *r)
{
rule_infos::const_iterator cit = infos.find(r);
if (cit != infos.end())
return (*cit).second.first;
return std::string("<unknown>");
}
bool trace_node(void const *r)
{
rule_infos::const_iterator cit = infos.find(r);
if (cit != infos.end())
return (*cit).second.second;
return BOOST_SPIRIT_DEBUG_TRACENODE;
}
bool register_node(void const *r, char const *name_to_register,
bool trace_node)
{
if (infos.find(r) != infos.end())
return false;
return infos.insert(rule_infos::value_type(r,
rule_info(std::string(name_to_register), trace_node))
).second;
}
bool unregister_node(void const *r)
{
if (infos.find(r) == infos.end())
return false;
return (1 == infos.erase(r));
}
private:
rule_infos infos;
};
inline node_registry &
get_node_registry()
{
static node_registry node_infos;
return node_infos;
}
} // namespace impl
template<
typename DerivedT, typename EmbedT,
typename T0, typename T1, typename T2
>
inline std::string
parser_name(impl::rule_base<DerivedT, EmbedT, T0, T1, T2> const& p)
{
return std::string("rule_base")
+ std::string("(")
+ impl::get_node_registry().find_node(&p)
+ std::string(")");
}
template<typename T0, typename T1, typename T2>
inline std::string
parser_name(rule<T0, T1, T2> const& p)
{
return std::string("rule")
+ std::string("(")
+ impl::get_node_registry().find_node(&p)
+ std::string(")");
}
///////////////////////////////////////////////////////////////////////////////
// from subrule.hpp
template <typename FirstT, typename RestT>
inline std::string
parser_name(subrule_list<FirstT, RestT> const &p)
{
return std::string("subrule_list")
+ std::string("(")
+ impl::get_node_registry().find_node(&p)
+ std::string(")");
}
template <int ID, typename DefT, typename ContextT>
inline std::string
parser_name(subrule_parser<ID, DefT, ContextT> const &p)
{
return std::string("subrule_parser")
+ std::string("(")
+ impl::get_node_registry().find_node(&p)
+ std::string(")");
}
template <int ID, typename ContextT>
inline std::string
parser_name(subrule<ID, ContextT> const &p)
{
BOOST_SPIRIT_SSTREAM stream;
stream << ID;
return std::string("subrule<")
+ BOOST_SPIRIT_GETSTRING(stream)
+ std::string(">(")
+ impl::get_node_registry().find_node(&p)
+ std::string(")");
}
///////////////////////////////////////////////////////////////////////////////
// from grammar.hpp
template <typename DerivedT, typename ContextT>
inline std::string
parser_name(grammar<DerivedT, ContextT> const& p)
{
return std::string("grammar")
+ std::string("(")
+ impl::get_node_registry().find_node(&p)
+ std::string(")");
}
///////////////////////////////////////////////////////////////////////////////
// decide, if a node is to be traced or not
template<
typename DerivedT, typename EmbedT,
typename T0, typename T1, typename T2
>
inline bool
trace_parser(impl::rule_base<DerivedT, EmbedT, T0, T1, T2>
const& p)
{
return impl::get_node_registry().trace_node(&p);
}
template<typename T0, typename T1, typename T2>
inline bool
trace_parser(rule<T0, T1, T2> const& p)
{
return impl::get_node_registry().trace_node(&p);
}
template <typename DerivedT, typename ContextT>
inline bool
trace_parser(grammar<DerivedT, ContextT> const& p)
{
return impl::get_node_registry().trace_node(&p);
}
template <typename DerivedT, int N, typename ContextT>
inline bool
trace_parser(impl::entry_grammar<DerivedT, N, ContextT> const& p)
{
return impl::get_node_registry().trace_node(&p);
}
template <int ID, typename ContextT>
bool
trace_parser(subrule<ID, ContextT> const& p)
{
return impl::get_node_registry().trace_node(&p);
}
template <typename ParserT, typename ActorTupleT>
bool
trace_parser(init_closure_parser<ParserT, ActorTupleT> const& p)
{
return impl::get_node_registry().trace_node(&p);
}
///////////////////////////////////////////////////////////////////////////////
BOOST_SPIRIT_CLASSIC_NAMESPACE_END
}} // namespace boost::spirit
#undef BOOST_SPIRIT_SSTREAM
#undef BOOST_SPIRIT_GETSTRING
#endif // defined(BOOST_SPIRIT_DEBUG)
#endif // !defined(BOOST_SPIRIT_PARSER_NAMES_IPP)
+81
View File
@@ -0,0 +1,81 @@
/*=============================================================================
Copyright (c) 2001-2003 Joel de Guzman
Copyright (c) 2002-2003 Hartmut Kaiser
http://spirit.sourceforge.net/
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#if !defined(BOOST_SPIRIT_MINIMAL_DEBUG_HPP)
#define BOOST_SPIRIT_MINIMAL_DEBUG_HPP
#if !defined(BOOST_SPIRIT_DEBUG_MAIN_HPP)
#error "You must include boost/spirit/debug.hpp, not boost/spirit/debug/minimal.hpp"
#endif
///////////////////////////////////////////////////////////////////////////////
//
// Minimum debugging tools support
//
///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_SPIRIT_DEBUG_OUT)
#define BOOST_SPIRIT_DEBUG_OUT std::cout
#endif
///////////////////////////////////////////////////////////////////////////
//
// BOOST_SPIRIT_DEBUG_FLAGS controls the level of diagnostics printed
//
///////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_SPIRIT_DEBUG_FLAGS_NONE)
#define BOOST_SPIRIT_DEBUG_FLAGS_NONE 0x0000 // no diagnostics at all
#endif
#if !defined(BOOST_SPIRIT_DEBUG_FLAGS_MAX)
#define BOOST_SPIRIT_DEBUG_FLAGS_MAX 0xFFFF // print maximal diagnostics
#endif
#if !defined(BOOST_SPIRIT_DEBUG_FLAGS)
#define BOOST_SPIRIT_DEBUG_FLAGS BOOST_SPIRIT_DEBUG_FLAGS_MAX
#endif
#if !defined(BOOST_SPIRIT_DEBUG_PRINT_SOME)
#define BOOST_SPIRIT_DEBUG_PRINT_SOME 20
#endif
#if !defined(BOOST_SPIRIT_DEBUG_RULE)
#define BOOST_SPIRIT_DEBUG_RULE(r)
#endif // !defined(BOOST_SPIRIT_DEBUG_RULE)
#if !defined(BOOST_SPIRIT_DEBUG_NODE)
#define BOOST_SPIRIT_DEBUG_NODE(r)
#endif // !defined(BOOST_SPIRIT_DEBUG_NODE)
#if !defined(BOOST_SPIRIT_DEBUG_GRAMMAR)
#define BOOST_SPIRIT_DEBUG_GRAMMAR(r)
#endif // !defined(BOOST_SPIRIT_DEBUG_GRAMMAR)
#if !defined(BOOST_SPIRIT_DEBUG_TRACE_RULE)
#define BOOST_SPIRIT_DEBUG_TRACE_RULE(r, t)
#endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_RULE)
#if !defined(BOOST_SPIRIT_DEBUG_TRACE_NODE)
#define BOOST_SPIRIT_DEBUG_TRACE_NODE(r, t)
#endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_NODE)
#if !defined(BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR)
#define BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR(r, t)
#endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR)
#if !defined(BOOST_SPIRIT_DEBUG_TRACE_RULE_NAME)
#define BOOST_SPIRIT_DEBUG_TRACE_RULE_NAME(r, n, t)
#endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_RULE_NAME)
#if !defined(BOOST_SPIRIT_DEBUG_TRACE_NODE_NAME)
#define BOOST_SPIRIT_DEBUG_TRACE_NODE_NAME(r, n, t)
#endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_NODE_NAME)
#if !defined(BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR_NAME)
#define BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR_NAME(r, n, t)
#endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR_NAME)
#endif // !defined(BOOST_SPIRIT_MINIMAL_DEBUG_HPP)
+254
View File
@@ -0,0 +1,254 @@
/*=============================================================================
Copyright (c) 2001-2003 Joel de Guzman
Copyright (c) 2002-2003 Hartmut Kaiser
http://spirit.sourceforge.net/
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#if !defined(BOOST_SPIRIT_PARSER_NAMES_HPP)
#define BOOST_SPIRIT_PARSER_NAMES_HPP
#if defined(BOOST_SPIRIT_DEBUG)
//////////////////////////////////
#include <boost/spirit/home/classic/namespace.hpp>
#include <boost/spirit/home/classic/core.hpp>
namespace boost { namespace spirit {
BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
///////////////////////////////////////////////////////////////////////////////
//
// Declaration of helper functions, which return the name of a concrete
// parser instance. The functions are specialized on the parser types. The
// functions declared in this file are for the predefined parser types from
// the Spirit core library only, so additional functions might be provided as
// needed.
//
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// from actions.hpp
template <typename ParserT, typename ActionT>
std::string
parser_name(action<ParserT, ActionT> const& p);
///////////////////////////////////////////////////////////////////////////////
// from directives.hpp
template <typename ParserT>
std::string
parser_name(contiguous<ParserT> const& p);
template <typename ParserT>
std::string
parser_name(inhibit_case<ParserT> const& p);
template <typename A, typename B>
std::string
parser_name(longest_alternative<A, B> const& p);
template <typename A, typename B>
std::string
parser_name(shortest_alternative<A, B> const& p);
///////////////////////////////////////////////////////////////////////////////
// from grammar.hpp
template <typename DerivedT, typename ContextT>
std::string
parser_name(grammar<DerivedT, ContextT> const& p);
///////////////////////////////////////////////////////////////////////////////
// from numerics.hpp
template <typename T, int Radix, unsigned MinDigits, int MaxDigits>
std::string
parser_name(uint_parser<T, Radix, MinDigits, MaxDigits> const& p);
template <typename T, int Radix, unsigned MinDigits, int MaxDigits>
std::string
parser_name(int_parser<T, Radix, MinDigits, MaxDigits> const& p);
template <typename T, typename RealPoliciesT>
std::string
parser_name(real_parser<T, RealPoliciesT> const& p);
///////////////////////////////////////////////////////////////////////////////
// from operators.hpp
template <typename A, typename B>
std::string
parser_name(sequence<A, B> const& p);
template <typename A, typename B>
std::string
parser_name(sequential_or<A, B> const& p);
template <typename A, typename B>
std::string
parser_name(alternative<A, B> const& p);
template <typename A, typename B>
std::string
parser_name(intersection<A, B> const& p);
template <typename A, typename B>
std::string
parser_name(difference<A, B> const& p);
template <typename A, typename B>
std::string
parser_name(exclusive_or<A, B> const& p);
template <typename S>
std::string
parser_name(optional<S> const& p);
template <typename S>
std::string
parser_name(kleene_star<S> const& p);
template <typename S>
std::string
parser_name(positive<S> const& p);
///////////////////////////////////////////////////////////////////////////////
// from parser.hpp
template <typename DerivedT>
std::string
parser_name(parser<DerivedT> const& p);
///////////////////////////////////////////////////////////////////////////////
// from primitives.hpp
template <typename DerivedT>
std::string
parser_name(char_parser<DerivedT> const &p);
template <typename CharT>
std::string
parser_name(chlit<CharT> const &p);
template <typename CharT>
std::string
parser_name(range<CharT> const &p);
template <typename IteratorT>
std::string
parser_name(chseq<IteratorT> const &p);
template <typename IteratorT>
std::string
parser_name(strlit<IteratorT> const &p);
std::string
parser_name(nothing_parser const &p);
std::string
parser_name(epsilon_parser const &p);
std::string
parser_name(anychar_parser const &p);
std::string
parser_name(alnum_parser const &p);
std::string
parser_name(alpha_parser const &p);
std::string
parser_name(cntrl_parser const &p);
std::string
parser_name(digit_parser const &p);
std::string
parser_name(graph_parser const &p);
std::string
parser_name(lower_parser const &p);
std::string
parser_name(print_parser const &p);
std::string
parser_name(punct_parser const &p);
std::string
parser_name(blank_parser const &p);
std::string
parser_name(space_parser const &p);
std::string
parser_name(upper_parser const &p);
std::string
parser_name(xdigit_parser const &p);
std::string
parser_name(eol_parser const &p);
std::string
parser_name(end_parser const &p);
///////////////////////////////////////////////////////////////////////////////
// from rule.hpp
template<typename T0, typename T1, typename T2>
std::string
parser_name(rule<T0, T1, T2> const& p);
///////////////////////////////////////////////////////////////////////////////
// from subrule.hpp
template <typename FirstT, typename RestT>
std::string
parser_name(subrule_list<FirstT, RestT> const &p);
template <int ID, typename DefT, typename ContextT>
std::string
parser_name(subrule_parser<ID, DefT, ContextT> const &p);
template <int ID, typename ContextT>
std::string
parser_name(subrule<ID, ContextT> const &p);
///////////////////////////////////////////////////////////////////////////////
// from chset.hpp
///////////////////////////////////////////////////////////////////////////////
//
// Decide, if a node is to be traced or not
//
///////////////////////////////////////////////////////////////////////////////
template<
typename DerivedT, typename EmbedT,
typename T0, typename T1, typename T2
>
bool
trace_parser(impl::rule_base<DerivedT, EmbedT, T0, T1, T2>
const& p);
template <typename DerivedT, typename ContextT>
bool
trace_parser(grammar<DerivedT, ContextT> const& p);
template <int ID, typename ContextT>
bool
trace_parser(subrule<ID, ContextT> const& p);
template <typename ParserT, typename ActorTupleT>
struct init_closure_parser;
template <typename ParserT, typename ActorTupleT>
bool
trace_parser(init_closure_parser<ParserT, ActorTupleT> const& p);
///////////////////////////////////////////////////////////////////////////////
BOOST_SPIRIT_CLASSIC_NAMESPACE_END
}} // namespace BOOST_SPIRIT_CLASSIC_NS
//////////////////////////////////
#include <boost/spirit/home/classic/debug/impl/parser_names.ipp>
#endif // defined(BOOST_SPIRIT_DEBUG)
#endif // !defined(BOOST_SPIRIT_PARSER_NAMES_HPP)
+37
View File
@@ -0,0 +1,37 @@
/*=============================================================================
Copyright (c) 2006 Tobias Schwinger
http://spirit.sourceforge.net/
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#if !defined(BOOST_SPIRIT_DEBUG_TYPEOF_HPP)
#define BOOST_SPIRIT_DEBUG_TYPEOF_HPP
#include <boost/typeof/typeof.hpp>
#include <boost/spirit/home/classic/namespace.hpp>
#include <boost/spirit/home/classic/core/typeof.hpp>
namespace boost { namespace spirit {
BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
// debug_node.hpp
template<typename ContextT> struct parser_context_linker;
template<typename ScannerT> struct scanner_context_linker;
template<typename ContextT> struct closure_context_linker;
BOOST_SPIRIT_CLASSIC_NAMESPACE_END
}} // namespace BOOST_SPIRIT_CLASSIC_NS
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
// debug_node.hpp
BOOST_TYPEOF_REGISTER_TEMPLATE(BOOST_SPIRIT_CLASSIC_NS::parser_context_linker,1)
BOOST_TYPEOF_REGISTER_TEMPLATE(BOOST_SPIRIT_CLASSIC_NS::scanner_context_linker,1)
BOOST_TYPEOF_REGISTER_TEMPLATE(BOOST_SPIRIT_CLASSIC_NS::closure_context_linker,1)
#endif