#ifndef META_HS_SEMANTIC_HPP #define META_HS_SEMANTIC_HPP // Copyright Abel Sinkovics (abel@sinkovics.hu) 2012. // 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) #include #include #include #include #include #include #include #include namespace semantic { struct ref { typedef ref type; template struct apply : ast::ref {}; }; struct value { typedef value type; template struct apply : ast::value {}; }; struct lambda { typedef lambda type; template struct apply : ast::lambda {}; }; struct application { typedef application type; template struct apply : ast::application {}; }; class if_ { private: template struct lazy_if : boost::mpl::if_ {}; public: typedef if_ type; template struct apply : boost::mpl::apply_wrap2< application, typename boost::mpl::apply_wrap2< application, typename boost::mpl::apply_wrap2< application, ast::value >, typename boost::mpl::at_c::type >::type, typename boost::mpl::at_c::type >::type, typename boost::mpl::at_c::type > {}; }; struct binary_op { typedef binary_op type; template struct apply : boost::mpl::apply_wrap2< application, typename boost::mpl::apply_wrap2< application, typename boost::mpl::apply_wrap1< ref, typename boost::mpl::front::type >::type, Exp >::type, typename boost::mpl::back::type > {}; }; struct pair { typedef pair type; template struct apply : boost::mpl::pair< typename boost::mpl::front::type, ast::top_bound::type> > {}; }; } #endif