![]() |
|
|||
File indexing completed on 2025-02-27 09:55:04
0001 /*============================================================================= 0002 Copyright (c) 2002-2003 Hartmut Kaiser 0003 http://spirit.sourceforge.net/ 0004 0005 Distributed under the Boost Software License, Version 1.0. (See accompanying 0006 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 0007 =============================================================================*/ 0008 #if !defined(BOOST_SPIRIT_FUNDAMENTAL_HPP) 0009 #define BOOST_SPIRIT_FUNDAMENTAL_HPP 0010 0011 #include <boost/spirit/home/classic/namespace.hpp> 0012 #include <boost/spirit/home/classic/meta/impl/fundamental.ipp> 0013 0014 namespace boost { namespace spirit { 0015 0016 BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN 0017 0018 /////////////////////////////////////////////////////////////////////////// 0019 // 0020 // Helper template for counting the number of nodes contained in a 0021 // given parser type. 0022 // All parser_category type parsers are counted as nodes. 0023 // 0024 /////////////////////////////////////////////////////////////////////////// 0025 template <typename ParserT> 0026 struct node_count { 0027 0028 typedef typename ParserT::parser_category_t parser_category_t; 0029 typedef typename impl::nodes<parser_category_t> 0030 ::template count<ParserT, mpl::int_<0> > count_t; 0031 0032 BOOST_STATIC_CONSTANT(int, value = count_t::value); 0033 }; 0034 0035 /////////////////////////////////////////////////////////////////////////// 0036 // 0037 // Helper template for counting the number of leaf nodes contained in a 0038 // given parser type. 0039 // Only plain_parser_category type parsers are counted as leaf nodes. 0040 // 0041 /////////////////////////////////////////////////////////////////////////// 0042 template <typename ParserT> 0043 struct leaf_count { 0044 0045 typedef typename ParserT::parser_category_t parser_category_t; 0046 typedef typename impl::leafs<parser_category_t> 0047 ::template count<ParserT, mpl::int_<0> > count_t; 0048 0049 BOOST_STATIC_CONSTANT(int, value = count_t::value); 0050 }; 0051 0052 BOOST_SPIRIT_CLASSIC_NAMESPACE_END 0053 0054 }} // namespace BOOST_SPIRIT_CLASSIC_NS 0055 0056 #endif // !defined(BOOST_SPIRIT_FUNDAMENTAL_HPP)
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |