Chris@16: // Copyright (c) 2001-2011 Hartmut Kaiser Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. (See accompanying Chris@16: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #if !defined(SPIRIT_LEX_SEQUENCE_MAR_28_2007_0610PM) Chris@16: #define SPIRIT_LEX_SEQUENCE_MAR_28_2007_0610PM Chris@16: Chris@16: #if defined(_MSC_VER) Chris@16: #pragma once Chris@16: #endif Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost { namespace spirit Chris@16: { Chris@16: /////////////////////////////////////////////////////////////////////////// Chris@16: // Enablers Chris@16: /////////////////////////////////////////////////////////////////////////// Chris@16: template <> Chris@16: struct use_operator // enables | Chris@16: : mpl::true_ {}; Chris@16: Chris@16: template <> Chris@16: struct flatten_tree // flattens | Chris@16: : mpl::true_ {}; Chris@16: Chris@16: }} Chris@16: Chris@16: namespace boost { namespace spirit { namespace lex Chris@16: { Chris@16: template Chris@16: struct sequence : nary_lexer > Chris@16: { Chris@16: sequence(Elements const& elements) Chris@16: : elements(elements) {} Chris@16: Chris@16: template Chris@16: void collect(LexerDef& lexdef, String const& state Chris@16: , String const& targetstate) const Chris@16: { Chris@16: typedef detail::sequence_collect_function Chris@16: collect_function_type; Chris@16: collect_function_type f (lexdef, state, targetstate); Chris@16: fusion::any(elements, f); Chris@16: } Chris@16: Chris@16: template Chris@16: void add_actions(LexerDef& lexdef) const Chris@16: { Chris@16: detail::sequence_add_actions_function f (lexdef); Chris@16: fusion::any(elements, f); Chris@16: } Chris@16: Chris@16: Elements elements; Chris@16: }; Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////// Chris@16: // Lexer generator: make_xxx function (objects) Chris@16: /////////////////////////////////////////////////////////////////////////// Chris@16: template Chris@16: struct make_composite Chris@16: : make_nary_composite Chris@16: {}; Chris@16: Chris@16: }}} // namespace boost::spirit::lex Chris@16: Chris@16: #endif