1
/*=============================================================================
3
Copyright (c) 2002-2003 Hartmut Kaiser
4
http://spirit.sourceforge.net/
6
Permission to copy, use, modify, sell and distribute this software is
7
granted provided this copyright notice appears in all copies. This
8
software is provided "as is" without express or implied warranty, and
9
with no claim as to its suitability for any purpose.
10
=============================================================================*/
11
#if !defined(BOOST_SPIRIT_FUNDAMENTAL_HPP)
12
#define BOOST_SPIRIT_FUNDAMENTAL_HPP
14
///////////////////////////////////////////////////////////////////////////////
15
#include "boost/spirit/core/meta/impl/fundamental.ipp"
17
///////////////////////////////////////////////////////////////////////////////
18
namespace boost { namespace spirit {
20
///////////////////////////////////////////////////////////////////////////////
22
// Helper template for counting the number of nodes contained in a
24
// All parser_category type parsers are counted as nodes.
26
///////////////////////////////////////////////////////////////////////////////
27
#if defined(BOOST_MSVC) && (BOOST_MSVC <= 1300)
29
template <typename ParserT>
32
typedef typename ParserT::parser_category_t parser_category_t;
33
typedef impl::nodes<parser_category_t> nodes_t;
35
typedef typename impl::count_wrapper<nodes_t>
36
::template result_<ParserT, mpl::int_<0> > count_t;
38
BOOST_STATIC_CONSTANT(int, value = count_t::value);
43
template <typename ParserT>
46
typedef typename ParserT::parser_category_t parser_category_t;
47
typedef typename impl::nodes<parser_category_t>
48
::template count<ParserT, mpl::int_<0> > count_t;
50
BOOST_STATIC_CONSTANT(int, value = count_t::value);
55
///////////////////////////////////////////////////////////////////////////////
57
// Helper template for counting the number of leaf nodes contained in a
59
// Only plain_parser_category type parsers are counted as leaf nodes.
61
///////////////////////////////////////////////////////////////////////////////
62
#if defined(BOOST_MSVC) && (BOOST_MSVC <= 1300)
64
template <typename ParserT>
67
typedef typename ParserT::parser_category_t parser_category_t;
68
typedef impl::leafs<parser_category_t> nodes_t;
70
typedef typename impl::count_wrapper<nodes_t>
71
::template result_<ParserT, mpl::int_<0> > count_t;
73
BOOST_STATIC_CONSTANT(int, value = count_t::value);
78
template <typename ParserT>
81
typedef typename ParserT::parser_category_t parser_category_t;
82
typedef typename impl::leafs<parser_category_t>
83
::template count<ParserT, mpl::int_<0> > count_t;
85
BOOST_STATIC_CONSTANT(int, value = count_t::value);
90
///////////////////////////////////////////////////////////////////////////////
91
}} // namespace boost::spirit
93
#endif // !defined(BOOST_SPIRIT_FUNDAMENTAL_HPP)