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
16namespace boost { namespace spirit { namespace lex { namespace detail
17{
18#ifdef _MSC_VER
19# pragma warning(push)
20# pragma warning(disable: 4512) // assignment operator could not be generated.
21#endif
22 template <typename LexerDef, typename String>
23 struct sequence_collect_function
24 {
25 sequence_collect_function(LexerDef& def_, String const& state_
26 , String const& targetstate_)
27 : def(def_), state(state_), targetstate(targetstate_) {}
28
29 template <typename Component>
30 bool operator()(Component const& component) const
31 {
32 component.collect(def, state, targetstate);
33 return false; // execute for all sequence elements
34 }
35
36 LexerDef& def;
37 String const& state;
38 String const& targetstate;
39 };
40
41 template <typename LexerDef>
42 struct sequence_add_actions_function
43 {
44 sequence_add_actions_function(LexerDef& def_)
45 : def(def_) {}
46
47 template <typename Component>
48 bool operator()(Component const& component) const
49 {
50 component.add_actions(def);
51 return false; // execute for all sequence elements
52 }
53
54 LexerDef& def;
55 };
56#ifdef _MSC_VER
57# pragma warning(pop)
58#endif
59
60}}}}
61
62#endif
63

source code of boost/libs/spirit/include/boost/spirit/home/lex/detail/sequence_function.hpp