1 /*=============================================================================
2 Copyright (c) 2006 Tobias Schwinger
3 http://spirit.sourceforge.net/
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 =============================================================================*/
8 #if !defined(BOOST_SPIRIT_GRAMMAR_DEF_FWD_HPP)
9 #define BOOST_SPIRIT_GRAMMAR_DEF_FWD_HPP
11 #include <boost/spirit/home/classic/namespace.hpp>
12 #include <boost/spirit/home/classic/phoenix/tuples.hpp>
14 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
15 #include <boost/preprocessor/facilities/intercept.hpp>
17 #if !defined(BOOST_SPIRIT_GRAMMAR_STARTRULE_TYPE_LIMIT)
18 #define BOOST_SPIRIT_GRAMMAR_STARTRULE_TYPE_LIMIT PHOENIX_LIMIT
21 // Calculate an integer rounded up to the nearest integer dividable by 3
22 #if BOOST_SPIRIT_GRAMMAR_STARTRULE_TYPE_LIMIT > 12
23 #define BOOST_SPIRIT_GRAMMAR_STARTRULE_TYPE_LIMIT_A 15
24 #elif BOOST_SPIRIT_GRAMMAR_STARTRULE_TYPE_LIMIT > 9
25 #define BOOST_SPIRIT_GRAMMAR_STARTRULE_TYPE_LIMIT_A 12
26 #elif BOOST_SPIRIT_GRAMMAR_STARTRULE_TYPE_LIMIT > 6
27 #define BOOST_SPIRIT_GRAMMAR_STARTRULE_TYPE_LIMIT_A 9
28 #elif BOOST_SPIRIT_GRAMMAR_STARTRULE_TYPE_LIMIT > 3
29 #define BOOST_SPIRIT_GRAMMAR_STARTRULE_TYPE_LIMIT_A 6
31 #define BOOST_SPIRIT_GRAMMAR_STARTRULE_TYPE_LIMIT_A 3
34 namespace boost { namespace spirit {
36 BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
40 BOOST_PP_ENUM_BINARY_PARAMS(
41 BOOST_PP_DEC(BOOST_SPIRIT_GRAMMAR_STARTRULE_TYPE_LIMIT_A),
42 typename T, = ::phoenix::nil_t BOOST_PP_INTERCEPT
47 BOOST_SPIRIT_CLASSIC_NAMESPACE_END
49 }} // namespace BOOST_SPIRIT_CLASSIC_NS