1 // Copyright (c) 2001-2011 Hartmut Kaiser 2 // 3 // Distributed under the Boost Software License, Version 1.0. (See accompanying 4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 6 #if !defined(BOOST_SPIRIT_LEX_SEQUENCE_FUNCTION_FEB_28_2007_0249PM) 7 #define BOOST_SPIRIT_LEX_SEQUENCE_FUNCTION_FEB_28_2007_0249PM 8 9 #if defined(_MSC_VER) 10 #pragma once 11 #endif 12 13 #include <boost/spirit/home/lex/domain.hpp> 14 #include <boost/spirit/home/support/unused.hpp> 15 16 namespace boost { namespace spirit { namespace lex { namespace detail 17 { 18 template <typename LexerDef, typename String> 19 struct sequence_collect_function 20 { sequence_collect_functionboost::spirit::lex::detail::sequence_collect_function21 sequence_collect_function(LexerDef& def_, String const& state_ 22 , String const& targetstate_) 23 : def(def_), state(state_), targetstate(targetstate_) {} 24 25 template <typename Component> operator ()boost::spirit::lex::detail::sequence_collect_function26 bool operator()(Component const& component) const 27 { 28 component.collect(def, state, targetstate); 29 return false; // execute for all sequence elements 30 } 31 32 LexerDef& def; 33 String const& state; 34 String const& targetstate; 35 36 // silence MSVC warning C4512: assignment operator could not be generated 37 BOOST_DELETED_FUNCTION(sequence_collect_function& operator= (sequence_collect_function const&)) 38 }; 39 40 template <typename LexerDef> 41 struct sequence_add_actions_function 42 { sequence_add_actions_functionboost::spirit::lex::detail::sequence_add_actions_function43 sequence_add_actions_function(LexerDef& def_) 44 : def(def_) {} 45 46 template <typename Component> operator ()boost::spirit::lex::detail::sequence_add_actions_function47 bool operator()(Component const& component) const 48 { 49 component.add_actions(def); 50 return false; // execute for all sequence elements 51 } 52 53 LexerDef& def; 54 55 // silence MSVC warning C4512: assignment operator could not be generated 56 BOOST_DELETED_FUNCTION(sequence_add_actions_function& operator= (sequence_add_actions_function const&)) 57 }; 58 59 }}}} 60 61 #endif 62