os/ossrv/ossrv_pub/boost_apis/boost/spirit/meta/fundamental.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/meta/fundamental.hpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,52 @@
     1.4 +/*=============================================================================
     1.5 +    Copyright (c) 2002-2003 Hartmut Kaiser
     1.6 +    http://spirit.sourceforge.net/
     1.7 +
     1.8 +    Use, modification and distribution is subject to the Boost Software
     1.9 +    License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
    1.10 +    http://www.boost.org/LICENSE_1_0.txt)
    1.11 +=============================================================================*/
    1.12 +#if !defined(BOOST_SPIRIT_FUNDAMENTAL_HPP)
    1.13 +#define BOOST_SPIRIT_FUNDAMENTAL_HPP
    1.14 +
    1.15 +#include <boost/spirit/meta/impl/fundamental.ipp>
    1.16 +
    1.17 +namespace boost { namespace spirit 
    1.18 +{
    1.19 +    ///////////////////////////////////////////////////////////////////////////
    1.20 +    //
    1.21 +    //  Helper template for counting the number of nodes contained in a
    1.22 +    //  given parser type.
    1.23 +    //  All parser_category type parsers are counted as nodes.
    1.24 +    //
    1.25 +    ///////////////////////////////////////////////////////////////////////////
    1.26 +    template <typename ParserT>
    1.27 +    struct node_count {
    1.28 +
    1.29 +        typedef typename ParserT::parser_category_t parser_category_t;
    1.30 +        typedef typename impl::nodes<parser_category_t>
    1.31 +            ::template count<ParserT, mpl::int_<0> > count_t;
    1.32 +
    1.33 +        BOOST_STATIC_CONSTANT(int, value = count_t::value);
    1.34 +    };
    1.35 +
    1.36 +    ///////////////////////////////////////////////////////////////////////////
    1.37 +    //
    1.38 +    //  Helper template for counting the number of leaf nodes contained in a
    1.39 +    //  given parser type.
    1.40 +    //  Only plain_parser_category type parsers are counted as leaf nodes.
    1.41 +    //
    1.42 +    ///////////////////////////////////////////////////////////////////////////
    1.43 +    template <typename ParserT>
    1.44 +    struct leaf_count {
    1.45 +
    1.46 +        typedef typename ParserT::parser_category_t parser_category_t;
    1.47 +        typedef typename impl::leafs<parser_category_t>
    1.48 +            ::template count<ParserT, mpl::int_<0> > count_t;
    1.49 +
    1.50 +        BOOST_STATIC_CONSTANT(int, value = count_t::value);
    1.51 +    };
    1.52 +
    1.53 +}} // namespace boost::spirit
    1.54 +
    1.55 +#endif // !defined(BOOST_SPIRIT_FUNDAMENTAL_HPP)