Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-19 09:47:53

0001 /*=============================================================================
0002     Copyright (c) 2011 Thomas Heller
0003     Copyright (c) 2001-2011 Hartmut Kaiser
0004     Copyright (c)      2011 Thomas Heller
0005 
0006     Distributed under the Boost Software License, Version 1.0. (See accompanying
0007     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0008 ==============================================================================*/
0009 #if !defined(BOOST_SPIRIT_ARGUMENT_MARCH_22_2011_0939PM)
0010 #define BOOST_SPIRIT_ARGUMENT_MARCH_22_2011_0939PM
0011 
0012 #include <boost/phoenix/core/terminal.hpp>
0013 #include <boost/phoenix/core/v2_eval.hpp>
0014 #include <boost/proto/proto_fwd.hpp> // for transform placeholders
0015 
0016 namespace boost { namespace spirit
0017 {
0018     template <int N>
0019     struct argument;
0020 
0021     template <typename Dummy>
0022     struct attribute_context;
0023 
0024     namespace expression
0025     {
0026         template <int N>
0027         struct argument
0028           : phoenix::expression::terminal<spirit::argument<N> >
0029         {
0030             typedef typename phoenix::expression::terminal<
0031                 spirit::argument<N> 
0032             >::type type;
0033 
0034             static type make()
0035             {
0036                 type const e = {{{}}};
0037                 return e;
0038             }
0039         };
0040         
0041         template <typename Dummy>
0042         struct attribute_context
0043           : phoenix::expression::terminal<spirit::attribute_context<Dummy> >
0044         {
0045             typedef typename phoenix::expression::terminal<
0046                 spirit::attribute_context<Dummy> 
0047             >::type type;
0048 
0049             static type make()
0050             {
0051                 type const e = {{{}}};
0052                 return e;
0053             }
0054         };
0055     }
0056 }}
0057 
0058 namespace boost { namespace phoenix
0059 {
0060     namespace result_of
0061     {
0062         template <typename Dummy>
0063         struct is_nullary<custom_terminal<spirit::attribute_context<Dummy> > >
0064           : mpl::false_
0065         {};
0066 
0067         template <int N>
0068         struct is_nullary<custom_terminal<spirit::argument<N> > >
0069           : mpl::false_
0070         {};
0071     }
0072 
0073     template <typename Dummy>
0074     struct is_custom_terminal<spirit::attribute_context<Dummy> >
0075       : mpl::true_
0076     {};
0077 
0078     template <int N>
0079     struct is_custom_terminal<spirit::argument<N> >
0080       : mpl::true_
0081     {};
0082 
0083     template <typename Dummy>
0084     struct custom_terminal<spirit::attribute_context<Dummy> >
0085       : proto::call<
0086             v2_eval(
0087                 proto::make<spirit::attribute_context<Dummy>()>
0088               , proto::call<
0089                     functional::env(proto::_state)
0090                 >
0091             )
0092         >
0093     {};
0094 
0095     template <int N>
0096     struct custom_terminal<spirit::argument<N> >
0097       : proto::call<
0098             v2_eval(
0099                 proto::make<spirit::argument<N>()>
0100               , proto::call<
0101                     functional::env(proto::_state)
0102                 >
0103             )
0104         >
0105     {};
0106 }}
0107 
0108 #endif