comparison DEPENDENCIES/generic/include/boost/spirit/home/support/argument_expression.hpp @ 16:2665513ce2d3

Add boost headers
author Chris Cannam
date Tue, 05 Aug 2014 11:11:38 +0100
parents
children c530137014c0
comparison
equal deleted inserted replaced
15:663ca0da4350 16:2665513ce2d3
1 /*=============================================================================
2 Copyright (c) 2011 Thomas Heller
3 Copyright (c) 2001-2011 Hartmut Kaiser
4 Copyright (c) 2011 Thomas Heller
5
6 Distributed under the Boost Software License, Version 1.0. (See accompanying
7 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 ==============================================================================*/
9 #if !defined(BOOST_SPIRIT_ARGUMENT_MARCH_22_2011_0939PM)
10 #define BOOST_SPIRIT_ARGUMENT_MARCH_22_2011_0939PM
11
12 #include <boost/spirit/include/phoenix_core.hpp>
13
14 namespace boost { namespace spirit
15 {
16 template <int N>
17 struct argument;
18
19 template <typename Dummy>
20 struct attribute_context;
21
22 namespace expression
23 {
24 #ifndef BOOST_SPIRIT_USE_PHOENIX_V3
25 template <int N>
26 struct argument
27 {
28 typedef phoenix::actor<spirit::argument<N> > type;
29
30 static type make()
31 {
32 return spirit::argument<N>();
33 }
34 };
35
36 template <typename Dummy>
37 struct attribute_context
38 {
39 typedef phoenix::actor<spirit::attribute_context<Dummy> > type;
40
41 static type make()
42 {
43 return spirit::attribute_context<Dummy>();
44 }
45 };
46 #else
47 template <int N>
48 struct argument
49 : phoenix::expression::terminal<spirit::argument<N> >
50 {
51 typedef typename phoenix::expression::terminal<
52 spirit::argument<N>
53 >::type type;
54
55 static type make()
56 {
57 type const e = {{{}}};
58 return e;
59 }
60 };
61
62 template <typename Dummy>
63 struct attribute_context
64 : phoenix::expression::terminal<spirit::attribute_context<Dummy> >
65 {
66 typedef typename phoenix::expression::terminal<
67 spirit::attribute_context<Dummy>
68 >::type type;
69
70 static type make()
71 {
72 type const e = {{{}}};
73 return e;
74 }
75 };
76 #endif
77 }
78 }}
79
80 #ifdef BOOST_SPIRIT_USE_PHOENIX_V3
81 namespace boost { namespace phoenix
82 {
83 namespace result_of
84 {
85 template <typename Dummy>
86 struct is_nullary<custom_terminal<spirit::attribute_context<Dummy> > >
87 : mpl::false_
88 {};
89
90 template <int N>
91 struct is_nullary<custom_terminal<spirit::argument<N> > >
92 : mpl::false_
93 {};
94 }
95
96 template <typename Dummy>
97 struct is_custom_terminal<spirit::attribute_context<Dummy> >
98 : mpl::true_
99 {};
100
101 template <int N>
102 struct is_custom_terminal<spirit::argument<N> >
103 : mpl::true_
104 {};
105
106 template <typename Dummy>
107 struct custom_terminal<spirit::attribute_context<Dummy> >
108 : proto::call<
109 v2_eval(
110 proto::make<spirit::attribute_context<Dummy>()>
111 , proto::call<
112 functional::env(proto::_state)
113 >
114 )
115 >
116 {};
117
118 template <int N>
119 struct custom_terminal<spirit::argument<N> >
120 : proto::call<
121 v2_eval(
122 proto::make<spirit::argument<N>()>
123 , proto::call<
124 functional::env(proto::_state)
125 >
126 )
127 >
128 {};
129 }}
130 #endif // BOOST_SPIRIT_USE_PHOENIX_V3
131
132 #endif