diff options
author | Kevin Smith <git@kismith.co.uk> | 2013-01-12 18:41:34 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2013-01-13 10:36:26 (GMT) |
commit | f3bc816af1b0d61452de973963e453bf3b3f95a2 (patch) | |
tree | e895f8afa3580e6cff6f5ad2017d45bf147a17c2 /3rdParty/Boost/src/boost/spirit/home/lex/lexer/support_functions_expression.hpp | |
parent | 188fc285c6555eadd3c9d50ab8a94adcade78d89 (diff) | |
download | swift-f3bc816af1b0d61452de973963e453bf3b3f95a2.zip swift-f3bc816af1b0d61452de973963e453bf3b3f95a2.tar.bz2 |
Adding in the spirit Boost stuff
Change-Id: I4f127ce61667243b64081b0aa309028d5077045f
Diffstat (limited to '3rdParty/Boost/src/boost/spirit/home/lex/lexer/support_functions_expression.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/spirit/home/lex/lexer/support_functions_expression.hpp | 135 |
1 files changed, 135 insertions, 0 deletions
diff --git a/3rdParty/Boost/src/boost/spirit/home/lex/lexer/support_functions_expression.hpp b/3rdParty/Boost/src/boost/spirit/home/lex/lexer/support_functions_expression.hpp new file mode 100644 index 0000000..613a4a4 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/lex/lexer/support_functions_expression.hpp @@ -0,0 +1,135 @@ +// Copyright (c) 2001-2011 Hartmut Kaiser +// Copyright (c) 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) + +#if !defined(SPIRIT_LEX_SUPPORT_FUNCTIONS_EXPRESSION_MAR_22_2011_0711PM) +#define SPIRIT_LEX_SUPPORT_FUNCTIONS_EXPRESSION_MAR_22_2011_0711PM + +#if defined(_MSC_VER) +#pragma once +#endif + +#include <boost/spirit/include/phoenix_core.hpp> + +namespace boost { namespace spirit { namespace lex +{ + template <typename> struct less_type; + struct more_type; + template <typename, typename> struct lookahead_type; +}}} + +/////////////////////////////////////////////////////////////////////////////// +#ifndef BOOST_SPIRIT_USE_PHOENIX_V3 + +namespace boost { namespace spirit { namespace lex +{ + namespace expression + { + template <typename Eval> + struct less + { + typedef phoenix::actor<lex::less_type<Eval> > type; + + static type make(Eval const & eval) + { + return lex::less_type<Eval>(eval); + } + }; + + template <typename IdType, typename State> + struct lookahead + { + typedef phoenix::actor<lex::lookahead_type<IdType, State> > type; + + static type make(IdType const & id_type, State const & state) + { + return lex::lookahead_type<IdType, State>(id_type, state); + } + }; + } +}}} + +#else // BOOST_SPIRIT_USE_PHOENIX_V3 + +BOOST_PHOENIX_DEFINE_EXPRESSION( + (boost)(spirit)(lex)(less) + , (boost::phoenix::meta_grammar) +) + +BOOST_PHOENIX_DEFINE_EXPRESSION( + (boost)(spirit)(lex)(lookahead) + , (boost::phoenix::meta_grammar) + (boost::phoenix::meta_grammar) +) + +namespace boost { namespace phoenix +{ + + namespace result_of + { + template <> + struct is_nullary<custom_terminal<boost::spirit::lex::more_type> > + : mpl::false_ + {}; + } + + template <typename Dummy> + struct is_custom_terminal<boost::spirit::lex::more_type, Dummy> : mpl::true_ {}; + + template <typename Dummy> + struct custom_terminal<boost::spirit::lex::more_type, Dummy> + : proto::call< + v2_eval( + proto::make<boost::spirit::lex::more_type()> + , proto::call<functional::env(proto::_state)> + ) + > + {}; + + + template <typename Dummy> + struct is_nullary::when<spirit::lex::rule::less, Dummy> + : proto::make<mpl::false_()> + {}; + + template <typename Dummy> + struct default_actions::when<spirit::lex::rule::less, Dummy> + : proto::call< + v2_eval( + proto::make< + spirit::lex::less_type<proto::_child0>(proto::_child0) + > + , _env + ) + > + {}; + + template <typename Dummy> + struct is_nullary::when<spirit::lex::rule::lookahead, Dummy> + : proto::make<mpl::false_()> + {}; + + template <typename Dummy> + struct default_actions::when<spirit::lex::rule::lookahead, Dummy> + : proto::call< + v2_eval( + proto::make< + spirit::lex::lookahead_type< + proto::_child0 + , proto::_child1 + >( + proto::_child0 + , proto::_child1 + ) + > + , _env + ) + > + {}; +}} + +#endif // BOOST_SPIRIT_USE_PHOENIX_V3 + +#endif |