os/ossrv/ossrv_pub/boost_apis/boost/spirit/debug.hpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/spirit/debug.hpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,146 @@
     1.4 +/*=============================================================================
     1.5 +    Copyright (c) 2001-2003 Joel de Guzman
     1.6 +    Copyright (c) 2002-2003 Hartmut Kaiser
     1.7 +    http://spirit.sourceforge.net/
     1.8 +
     1.9 +    Use, modification and distribution is subject to the Boost Software
    1.10 +    License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
    1.11 +    http://www.boost.org/LICENSE_1_0.txt)
    1.12 +=============================================================================*/
    1.13 +#if !defined(BOOST_SPIRIT_DEBUG_MAIN_HPP)
    1.14 +#define BOOST_SPIRIT_DEBUG_MAIN_HPP
    1.15 +
    1.16 +///////////////////////////////////////////////////////////////////////////
    1.17 +#if defined(BOOST_SPIRIT_DEBUG)
    1.18 +
    1.19 +#include <boost/spirit/version.hpp>
    1.20 +
    1.21 +///////////////////////////////////////////////////////////////////////////////
    1.22 +//
    1.23 +//  Spirit.Debug includes and defines
    1.24 +//
    1.25 +///////////////////////////////////////////////////////////////////////////////
    1.26 +
    1.27 +    #include <iostream>
    1.28 +
    1.29 +    ///////////////////////////////////////////////////////////////////////////
    1.30 +    //
    1.31 +    //  The BOOST_SPIRIT_DEBUG_OUT defines the stream object, which should be used
    1.32 +    //  for debug diagnostics. This defaults to std::cout.
    1.33 +    //
    1.34 +    ///////////////////////////////////////////////////////////////////////////
    1.35 +    #if !defined(BOOST_SPIRIT_DEBUG_OUT)
    1.36 +    #define BOOST_SPIRIT_DEBUG_OUT std::cout
    1.37 +    #endif
    1.38 +
    1.39 +    ///////////////////////////////////////////////////////////////////////////
    1.40 +    //
    1.41 +    //  The BOOST_SPIRIT_DEBUG_PRINT_SOME constant defines the number of characters
    1.42 +    //  from the stream to be printed for diagnosis. This defaults to the first
    1.43 +    //  20 characters.
    1.44 +    //
    1.45 +    ///////////////////////////////////////////////////////////////////////////
    1.46 +    #if !defined(BOOST_SPIRIT_DEBUG_PRINT_SOME)
    1.47 +    #define BOOST_SPIRIT_DEBUG_PRINT_SOME 20
    1.48 +    #endif
    1.49 +
    1.50 +    ///////////////////////////////////////////////////////////////////////////
    1.51 +    //
    1.52 +    //  Additional BOOST_SPIRIT_DEBUG_FLAGS control the level of diagnostics printed
    1.53 +    //  Basic constants are defined in debug/minimal.hpp.
    1.54 +    //
    1.55 +    ///////////////////////////////////////////////////////////////////////////
    1.56 +    #define BOOST_SPIRIT_DEBUG_FLAGS_NODES        0x0001  // node diagnostics
    1.57 +    #define BOOST_SPIRIT_DEBUG_FLAGS_ESCAPE_CHAR  0x0002  // escape_char_parse diagnostics
    1.58 +    #define BOOST_SPIRIT_DEBUG_FLAGS_TREES        0x0004  // parse tree/ast diagnostics
    1.59 +    #define BOOST_SPIRIT_DEBUG_FLAGS_CLOSURES     0x0008  // closure diagnostics
    1.60 +    #define BOOST_SPIRIT_DEBUG_FLAGS_SLEX         0x8000  // slex diagnostics
    1.61 +
    1.62 +    #define BOOST_SPIRIT_DEBUG_FLAGS_MAX          0xFFFF  // print maximal diagnostics
    1.63 +
    1.64 +    #if !defined(BOOST_SPIRIT_DEBUG_FLAGS)
    1.65 +    #define BOOST_SPIRIT_DEBUG_FLAGS BOOST_SPIRIT_DEBUG_FLAGS_MAX
    1.66 +    #endif
    1.67 +
    1.68 +    ///////////////////////////////////////////////////////////////////////////
    1.69 +    //
    1.70 +    //  By default all nodes are traced (even those, not registered with
    1.71 +    //  BOOST_SPIRIT_DEBUG_RULE et.al. - see below). The following constant may be
    1.72 +    //  used to redefine this default.
    1.73 +    //
    1.74 +    ///////////////////////////////////////////////////////////////////////////
    1.75 +    #if !defined(BOOST_SPIRIT_DEBUG_TRACENODE)
    1.76 +    #define BOOST_SPIRIT_DEBUG_TRACENODE          (true)
    1.77 +    #endif // !defined(BOOST_SPIRIT_DEBUG_TRACENODE)
    1.78 +
    1.79 +    ///////////////////////////////////////////////////////////////////////////
    1.80 +    //
    1.81 +    //  Helper macros for giving rules and subrules a name accessible through
    1.82 +    //  parser_name() functions (see parser_names.hpp).
    1.83 +    //
    1.84 +    //  Additionally, the macros BOOST_SPIRIT_DEBUG_RULE, SPIRIT_DEBUG_NODE and
    1.85 +    //  BOOST_SPIRIT_DEBUG_GRAMMAR enable/disable the tracing of the 
    1.86 +    //  correspondingnode accordingly to the PP constant 
    1.87 +    //  BOOST_SPIRIT_DEBUG_TRACENODE.
    1.88 +    //
    1.89 +    //  The macros BOOST_SPIRIT_DEBUG_TRACE_RULE, BOOST_SPIRIT_DEBUG_TRACE_NODE 
    1.90 +    //  and BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR allow to specify a flag to define, 
    1.91 +    //  whether the corresponding node is to be traced or not.
    1.92 +    //
    1.93 +    ///////////////////////////////////////////////////////////////////////////
    1.94 +    #if !defined(BOOST_SPIRIT_DEBUG_RULE)
    1.95 +    #define BOOST_SPIRIT_DEBUG_RULE(r)    \
    1.96 +        ::boost::spirit::impl::get_node_registry().register_node(&r, #r, BOOST_SPIRIT_DEBUG_TRACENODE)
    1.97 +    #endif // !defined(BOOST_SPIRIT_DEBUG_RULE)
    1.98 +
    1.99 +    #if !defined(BOOST_SPIRIT_DEBUG_NODE)
   1.100 +    #define BOOST_SPIRIT_DEBUG_NODE(r)    \
   1.101 +        ::boost::spirit::impl::get_node_registry().register_node(&r, #r, BOOST_SPIRIT_DEBUG_TRACENODE)
   1.102 +    #endif // !defined(BOOST_SPIRIT_DEBUG_NODE)
   1.103 +
   1.104 +    #if !defined(BOOST_SPIRIT_DEBUG_GRAMMAR)
   1.105 +    #define BOOST_SPIRIT_DEBUG_GRAMMAR(r)    \
   1.106 +        ::boost::spirit::impl::get_node_registry().register_node(&r, #r, BOOST_SPIRIT_DEBUG_TRACENODE)
   1.107 +    #endif // !defined(BOOST_SPIRIT_DEBUG_GRAMMAR)
   1.108 +
   1.109 +    #if !defined(BOOST_SPIRIT_DEBUG_TRACE_RULE)
   1.110 +    #define BOOST_SPIRIT_DEBUG_TRACE_RULE(r, t)    \
   1.111 +        ::boost::spirit::impl::get_node_registry().register_node(&r, #r, (t))
   1.112 +    #endif // !defined(BOOST_SPIRIT_TRACE_RULE)
   1.113 +
   1.114 +    #if !defined(BOOST_SPIRIT_DEBUG_TRACE_NODE)
   1.115 +    #define BOOST_SPIRIT_DEBUG_TRACE_NODE(r, t)    \
   1.116 +        ::boost::spirit::impl::get_node_registry().register_node(&r, #r, (t))
   1.117 +    #endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_NODE)
   1.118 +
   1.119 +    #if !defined(BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR)
   1.120 +    #define BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR(r, t)    \
   1.121 +        ::boost::spirit::impl::get_node_registry().register_node(&r, #r, (t))
   1.122 +    #endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR)
   1.123 +
   1.124 +    #if !defined(BOOST_SPIRIT_DEBUG_TRACE_RULE_NAME)
   1.125 +    #define BOOST_SPIRIT_DEBUG_TRACE_RULE_NAME(r, n, t)    \
   1.126 +        ::boost::spirit::impl::get_node_registry().register_node(&r, (n), (t))
   1.127 +    #endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_RULE_NAME)
   1.128 +
   1.129 +    #if !defined(BOOST_SPIRIT_DEBUG_TRACE_NODE_NAME)
   1.130 +    #define BOOST_SPIRIT_DEBUG_TRACE_NODE_NAME(r, n, t)    \
   1.131 +        ::boost::spirit::impl::get_node_registry().register_node(&r, (n), (t))
   1.132 +    #endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_NODE_NAME)
   1.133 +
   1.134 +    #if !defined(BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR_NAME)
   1.135 +    #define BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR_NAME(r, n, t)    \
   1.136 +        ::boost::spirit::impl::get_node_registry().register_node(&r, (n), (t))
   1.137 +    #endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR_NAME)
   1.138 +
   1.139 +    //////////////////////////////////
   1.140 +    #include <boost/spirit/debug/debug_node.hpp>
   1.141 +
   1.142 +#else
   1.143 +    //////////////////////////////////
   1.144 +    #include <boost/spirit/debug/minimal.hpp>
   1.145 +
   1.146 +#endif // BOOST_SPIRIT_DEBUG
   1.147 +
   1.148 +#endif
   1.149 +