/*============================================================================== Copyright (c) 2005-2010 Joel de Guzman Copyright (c) 2010-2011 Thomas Heller Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ #ifndef BOOST_PHOENIX_SCOPE_LOCAL_VARIABLE_HPP #define BOOST_PHOENIX_SCOPE_LOCAL_VARIABLE_HPP #include #include #include #include #include #include #include #include namespace boost { namespace phoenix { namespace detail { } namespace expression { template struct local_variable : expression::terminal > { typedef typename expression::terminal >::type type; static type make() { type const e = {}; return e; } }; } namespace rule { struct local_variable : expression::local_variable {}; struct local_var_def : proto::assign {}; } namespace result_of { template struct is_nullary > > : mpl::false_ {}; } namespace detail { struct scope_is_nullary_actions { template struct when : boost::phoenix::is_nullary::when {}; }; template struct scope_is_nullary_actions::when : proto::or_< proto::when , proto::otherwise< is_nullary::when > > {}; struct local_var_not_found { }; } template struct is_custom_terminal > : mpl::true_ {}; template struct custom_terminal > { template struct result; template struct result : result {}; template struct result { typedef typename remove_reference< typename result_of::env::type >::type env_type; typedef typename detail::apply_local, env_type>::type type; }; template typename result::type operator()(Local, Context const & ctx) { typedef typename remove_reference< typename result_of::env::type >::type env_type; typedef typename detail::apply_local, env_type>::type return_type; static const int index_value = detail::get_index >::value; typedef detail::eval_local eval_local; return eval_local::template get( phoenix::env(ctx)); } }; namespace local_names { typedef expression::local_variable::type _a_type; typedef expression::local_variable::type _b_type; typedef expression::local_variable::type _c_type; typedef expression::local_variable::type _d_type; typedef expression::local_variable::type _e_type; typedef expression::local_variable::type _f_type; typedef expression::local_variable::type _g_type; typedef expression::local_variable::type _h_type; typedef expression::local_variable::type _i_type; typedef expression::local_variable::type _j_type; typedef expression::local_variable::type _k_type; typedef expression::local_variable::type _l_type; typedef expression::local_variable::type _m_type; typedef expression::local_variable::type _n_type; typedef expression::local_variable::type _o_type; typedef expression::local_variable::type _p_type; typedef expression::local_variable::type _q_type; typedef expression::local_variable::type _r_type; typedef expression::local_variable::type _s_type; typedef expression::local_variable::type _t_type; typedef expression::local_variable::type _u_type; typedef expression::local_variable::type _v_type; typedef expression::local_variable::type _w_type; typedef expression::local_variable::type _x_type; typedef expression::local_variable::type _y_type; typedef expression::local_variable::type _z_type; #ifndef BOOST_PHOENIX_NO_PREDEFINED_TERMINALS _a_type const _a = {{{}}}; _b_type const _b = {{{}}}; _c_type const _c = {{{}}}; _d_type const _d = {{{}}}; _e_type const _e = {{{}}}; _f_type const _f = {{{}}}; _g_type const _g = {{{}}}; _h_type const _h = {{{}}}; _i_type const _i = {{{}}}; _j_type const _j = {{{}}}; _k_type const _k = {{{}}}; _l_type const _l = {{{}}}; _m_type const _m = {{{}}}; _n_type const _n = {{{}}}; _o_type const _o = {{{}}}; _p_type const _p = {{{}}}; _q_type const _q = {{{}}}; _r_type const _r = {{{}}}; _s_type const _s = {{{}}}; _t_type const _t = {{{}}}; _u_type const _u = {{{}}}; _v_type const _v = {{{}}}; _w_type const _w = {{{}}}; _x_type const _x = {{{}}}; _y_type const _y = {{{}}}; _z_type const _z = {{{}}}; #endif } }} #endif