Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 10:02:17

0001 //  Copyright (c) 2001-2011 Hartmut Kaiser
0002 //  Copyright (c)      2011 Thomas Heller
0003 // 
0004 //  Distributed under the Boost Software License, Version 1.0. (See accompanying 
0005 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 #ifndef BOOST_SPIRIT_LEX_LEXER_SUPPORT_FUNCTIONS_EXPRESSION_HPP
0008 #define BOOST_SPIRIT_LEX_LEXER_SUPPORT_FUNCTIONS_EXPRESSION_HPP
0009 
0010 #if defined(_MSC_VER)
0011 #pragma once
0012 #endif
0013 
0014 #include <boost/phoenix/core/expression.hpp>
0015 #include <boost/phoenix/core/v2_eval.hpp>
0016 #include <boost/proto/proto_fwd.hpp> // for transform placeholders
0017 
0018 namespace boost { namespace spirit { namespace lex
0019 {
0020     template <typename> struct less_type;
0021     struct more_type;
0022     template <typename, typename> struct lookahead_type;
0023 }}}
0024 
0025 ///////////////////////////////////////////////////////////////////////////////
0026 
0027 BOOST_PHOENIX_DEFINE_EXPRESSION(
0028     (boost)(spirit)(lex)(less)
0029   , (boost::phoenix::meta_grammar)
0030 )
0031 
0032 BOOST_PHOENIX_DEFINE_EXPRESSION(
0033     (boost)(spirit)(lex)(lookahead)
0034   , (boost::phoenix::meta_grammar)
0035     (boost::phoenix::meta_grammar)
0036 )
0037 
0038 namespace boost { namespace phoenix
0039 {
0040 
0041     namespace result_of
0042     {
0043         template <>
0044         struct is_nullary<custom_terminal<boost::spirit::lex::more_type> >
0045           : mpl::false_
0046         {};
0047     }
0048     
0049     template <typename Dummy>
0050     struct is_custom_terminal<boost::spirit::lex::more_type, Dummy> : mpl::true_ {};
0051     
0052     template <typename Dummy>
0053     struct custom_terminal<boost::spirit::lex::more_type, Dummy>
0054         : proto::call<
0055             v2_eval(
0056                 proto::make<boost::spirit::lex::more_type()>
0057               , proto::call<functional::env(proto::_state)>
0058             )
0059         >
0060     {};
0061 
0062 
0063     template <typename Dummy>
0064     struct is_nullary::when<spirit::lex::rule::less, Dummy>
0065       : proto::make<mpl::false_()>
0066     {};
0067 
0068     template <typename Dummy>
0069     struct default_actions::when<spirit::lex::rule::less, Dummy>
0070       : proto::call<
0071             v2_eval(
0072                 proto::make<
0073                     spirit::lex::less_type<proto::_child0>(proto::_child0)
0074                 >
0075               , _env
0076             )
0077         >
0078     {};
0079 
0080     template <typename Dummy>
0081     struct is_nullary::when<spirit::lex::rule::lookahead, Dummy>
0082       : proto::make<mpl::false_()>
0083     {};
0084 
0085     template <typename Dummy>
0086     struct default_actions::when<spirit::lex::rule::lookahead, Dummy>
0087       : proto::call<
0088             v2_eval(
0089                 proto::make<
0090                     spirit::lex::lookahead_type<
0091                         proto::_child0
0092                       , proto::_child1
0093                     >(
0094                         proto::_child0
0095                       , proto::_child1
0096                     )
0097                 >
0098               , _env
0099             )
0100         >
0101     {};
0102 }}
0103 
0104 #endif