PageRenderTime 77ms CodeModel.GetById 67ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/spirit/home/phoenix/statement/detail/catch_eval.hpp

http://hadesmem.googlecode.com/
C++ Header | 79 lines | 54 code | 18 blank | 7 comment | 2 complexity | aaa00c2f34e8ba6c9d6032786d0dc7ca MD5 | raw file
 1/*=============================================================================
 2    Copyright (c) 2005-2007 Dan Marsden
 3    Copyright (c) 2005-2007 Joel de Guzman
 4
 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#ifndef BOOST_PP_IS_ITERATING
 9#ifndef PHOENIX_STATEMENT_DETAIL_CATCH_EVAL_HPP
10#define PHOENIX_STATEMENT_DETAIL_CATCH_EVAL_HPP
11
12#include <boost/spirit/home/phoenix/core/limits.hpp>
13#include <boost/preprocessor/iteration/iterate.hpp>
14#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
15#include <boost/preprocessor/repetition/enum_params_with_defaults.hpp>
16#include <boost/preprocessor/repetition/enum_params.hpp>
17#include <boost/preprocessor/repetition/enum_binary_params.hpp>
18#include <boost/preprocessor/repetition/repeat.hpp>
19#include <boost/preprocessor/dec.hpp>
20#include <boost/preprocessor/cat.hpp>
21#include <boost/mpl/void.hpp>
22
23namespace boost { namespace phoenix {
24    class catch_eval
25    {
26    public:
27        template<typename Env, typename TryBody, 
28                 BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(PHOENIX_CATCH_LIMIT, typename CatchBody, mpl::void_)>
29        struct result
30        {
31            typedef void type;
32        };
33
34#define BOOST_PP_ITERATION_PARAMS_1                                                        \
35        (3, (1, PHOENIX_CATCH_LIMIT, "boost/spirit/home/phoenix/statement/detail/catch_eval.hpp"))
36
37#include BOOST_PP_ITERATE()
38
39    };
40}}
41
42#endif
43
44#elif BOOST_PP_ITERATION_DEPTH() == 1
45
46#define PHOENIX_ITERATION BOOST_PP_ITERATION()
47
48        template<typename Rt, typename Env, typename TryBody,
49                 BOOST_PP_ENUM_PARAMS(PHOENIX_ITERATION, typename CatchBody)>
50        static void eval(
51            const Env& env, TryBody& tryBody,
52            BOOST_PP_ENUM_BINARY_PARAMS(PHOENIX_ITERATION, CatchBody, catchBody))
53        {
54            try
55            {
56                tryBody.eval(env);
57            }
58
59#define BOOST_PP_ITERATION_PARAMS_2                                                                         \
60        (3, (0, BOOST_PP_DEC(PHOENIX_ITERATION), "boost/spirit/home/phoenix/statement/detail/catch_eval.hpp"))
61
62#include BOOST_PP_ITERATE()
63
64        }
65
66#undef PHOENIX_ITERATION
67
68#elif BOOST_PP_ITERATION_DEPTH() == 2
69
70#define PHOENIX_ITERATION BOOST_PP_ITERATION()
71
72        catch(typename BOOST_PP_CAT(CatchBody, PHOENIX_ITERATION)::exception_type&)
73        {                                                         
74            BOOST_PP_CAT(catchBody, PHOENIX_ITERATION).eval(env);
75        }
76
77#undef PHOENIX_ITERATION
78
79#endif