comparison DEPENDENCIES/generic/include/boost/spirit/home/phoenix/operator/bitwise.hpp @ 16:2665513ce2d3

Add boost headers
author Chris Cannam
date Tue, 05 Aug 2014 11:11:38 +0100
parents
children
comparison
equal deleted inserted replaced
15:663ca0da4350 16:2665513ce2d3
1 /*=============================================================================
2 Copyright (c) 2001-2007 Joel de Guzman
3
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 #ifndef PHOENIX_OPERATOR_BITWISE_HPP
8 #define PHOENIX_OPERATOR_BITWISE_HPP
9
10 #include <boost/spirit/home/phoenix/core/composite.hpp>
11 #include <boost/spirit/home/phoenix/core/compose.hpp>
12 #include <boost/spirit/home/phoenix/detail/type_deduction.hpp>
13 #include <boost/spirit/home/phoenix/operator/detail/unary_eval.hpp>
14 #include <boost/spirit/home/phoenix/operator/detail/unary_compose.hpp>
15 #include <boost/spirit/home/phoenix/operator/detail/binary_eval.hpp>
16 #include <boost/spirit/home/phoenix/operator/detail/binary_compose.hpp>
17
18 #ifdef BOOST_MSVC
19 # pragma warning(push)
20 # pragma warning(disable : 4800)
21 #endif
22
23 namespace boost { namespace phoenix
24 {
25 struct invert_eval;
26
27 struct and_assign_eval;
28 struct or_assign_eval;
29 struct xor_assign_eval;
30 struct shift_left_assign_eval;
31 struct shift_right_assign_eval;
32
33 struct and_eval;
34 struct or_eval;
35 struct xor_eval;
36 struct shift_left_eval;
37 struct shift_right_eval;
38
39 BOOST_UNARY_RESULT_OF(~x, result_of_invert)
40
41 BOOST_BINARY_RESULT_OF(x &= y, result_of_and_assign)
42 BOOST_BINARY_RESULT_OF(x |= y, result_of_or_assign)
43 BOOST_BINARY_RESULT_OF(x ^= y, result_of_xor_assign)
44 BOOST_BINARY_RESULT_OF(x <<= y, result_of_shift_left_assign)
45 BOOST_BINARY_RESULT_OF(x >>= y, result_of_shift_right_assign)
46
47 BOOST_BINARY_RESULT_OF(x & y, result_of_and)
48 BOOST_BINARY_RESULT_OF(x | y, result_of_or)
49 BOOST_BINARY_RESULT_OF(x ^ y, result_of_xor)
50 BOOST_BINARY_RESULT_OF(x << y, result_of_shift_left)
51 BOOST_BINARY_RESULT_OF(x >> y, result_of_shift_right)
52
53 #define x a0.eval(env)
54 #define y a1.eval(env)
55
56 PHOENIX_UNARY_EVAL(invert_eval, result_of_invert, ~x)
57 PHOENIX_UNARY_COMPOSE(invert_eval, ~)
58
59 PHOENIX_BINARY_EVAL(and_assign_eval, result_of_and_assign, x &= y)
60 PHOENIX_BINARY_EVAL(or_assign_eval, result_of_or_assign, x |= y)
61 PHOENIX_BINARY_EVAL(xor_assign_eval, result_of_xor_assign, x ^= y)
62 PHOENIX_BINARY_EVAL(shift_left_assign_eval, result_of_shift_left_assign, x <<= y)
63 PHOENIX_BINARY_EVAL(shift_right_assign_eval, result_of_shift_right_assign, x >>= y)
64
65 PHOENIX_BINARY_EVAL(and_eval, result_of_and, x & y)
66 PHOENIX_BINARY_EVAL(or_eval, result_of_or, x | y)
67 PHOENIX_BINARY_EVAL(xor_eval, result_of_xor, x ^ y)
68 PHOENIX_BINARY_EVAL(shift_left_eval, result_of_shift_left, x << y)
69 PHOENIX_BINARY_EVAL(shift_right_eval, result_of_shift_right, x >> y)
70
71 PHOENIX_BINARY_COMPOSE(and_assign_eval, &=)
72 PHOENIX_BINARY_COMPOSE(or_assign_eval, |=)
73 PHOENIX_BINARY_COMPOSE(xor_assign_eval, ^=)
74 PHOENIX_BINARY_COMPOSE(shift_left_assign_eval, <<=)
75 PHOENIX_BINARY_COMPOSE(shift_right_assign_eval, >>=)
76
77 PHOENIX_BINARY_COMPOSE(and_eval, &)
78 PHOENIX_BINARY_COMPOSE(or_eval, |)
79 PHOENIX_BINARY_COMPOSE(xor_eval, ^)
80 PHOENIX_BINARY_COMPOSE(shift_left_eval, <<)
81 PHOENIX_BINARY_COMPOSE(shift_right_eval, >>)
82
83 #undef x
84 #undef y
85 }}
86
87 #if defined(BOOST_MSVC)
88 # pragma warning(pop)
89 #endif
90
91 #endif