1 // Copyright (c) 2001-2011 Hartmut Kaiser
2 // Copyright (c) 2011 Thomas Heller
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)
7 #ifndef BOOST_SPIRIT_LEX_LEXER_SUPPORT_FUNCTIONS_EXPRESSION_HPP
8 #define BOOST_SPIRIT_LEX_LEXER_SUPPORT_FUNCTIONS_EXPRESSION_HPP
14 #include <boost/phoenix/core/expression.hpp>
15 #include <boost/phoenix/core/v2_eval.hpp>
16 #include <boost/proto/proto_fwd.hpp> // for transform placeholders
18 namespace boost { namespace spirit { namespace lex
20 template <typename> struct less_type;
22 template <typename, typename> struct lookahead_type;
25 ///////////////////////////////////////////////////////////////////////////////
27 BOOST_PHOENIX_DEFINE_EXPRESSION(
28 (boost)(spirit)(lex)(less)
29 , (boost::phoenix::meta_grammar)
32 BOOST_PHOENIX_DEFINE_EXPRESSION(
33 (boost)(spirit)(lex)(lookahead)
34 , (boost::phoenix::meta_grammar)
35 (boost::phoenix::meta_grammar)
38 namespace boost { namespace phoenix
44 struct is_nullary<custom_terminal<boost::spirit::lex::more_type> >
49 template <typename Dummy>
50 struct is_custom_terminal<boost::spirit::lex::more_type, Dummy> : mpl::true_ {};
52 template <typename Dummy>
53 struct custom_terminal<boost::spirit::lex::more_type, Dummy>
56 proto::make<boost::spirit::lex::more_type()>
57 , proto::call<functional::env(proto::_state)>
63 template <typename Dummy>
64 struct is_nullary::when<spirit::lex::rule::less, Dummy>
65 : proto::make<mpl::false_()>
68 template <typename Dummy>
69 struct default_actions::when<spirit::lex::rule::less, Dummy>
73 spirit::lex::less_type<proto::_child0>(proto::_child0)
80 template <typename Dummy>
81 struct is_nullary::when<spirit::lex::rule::lookahead, Dummy>
82 : proto::make<mpl::false_()>
85 template <typename Dummy>
86 struct default_actions::when<spirit::lex::rule::lookahead, Dummy>
90 spirit::lex::lookahead_type<