File indexing completed on 2025-01-31 10:02:17
0001
0002
0003
0004
0005
0006 #ifndef BOOST_SPIRIT_LEX_LEXER_SEQUENCE_HPP
0007 #define BOOST_SPIRIT_LEX_LEXER_SEQUENCE_HPP
0008
0009 #if defined(_MSC_VER)
0010 #pragma once
0011 #endif
0012
0013 #include <boost/spirit/home/lex/domain.hpp>
0014 #include <boost/spirit/home/lex/lexer_type.hpp>
0015 #include <boost/spirit/home/lex/meta_compiler.hpp>
0016 #include <boost/spirit/home/lex/detail/sequence_function.hpp>
0017 #include <boost/fusion/include/any.hpp>
0018 #include <boost/proto/operators.hpp>
0019 #include <boost/proto/tags.hpp>
0020
0021 namespace boost { namespace spirit
0022 {
0023
0024
0025
0026 template <>
0027 struct use_operator<lex::domain, proto::tag::bitwise_or>
0028 : mpl::true_ {};
0029
0030 template <>
0031 struct flatten_tree<lex::domain, proto::tag::bitwise_or>
0032 : mpl::true_ {};
0033
0034 }}
0035
0036 namespace boost { namespace spirit { namespace lex
0037 {
0038 template <typename Elements>
0039 struct sequence : nary_lexer<sequence<Elements> >
0040 {
0041 sequence(Elements const& elements)
0042 : elements(elements) {}
0043
0044 template <typename LexerDef, typename String>
0045 void collect(LexerDef& lexdef, String const& state
0046 , String const& targetstate) const
0047 {
0048 typedef detail::sequence_collect_function<LexerDef, String>
0049 collect_function_type;
0050 collect_function_type f (lexdef, state, targetstate);
0051 fusion::any(elements, f);
0052 }
0053
0054 template <typename LexerDef>
0055 void add_actions(LexerDef& lexdef) const
0056 {
0057 detail::sequence_add_actions_function<LexerDef> f (lexdef);
0058 fusion::any(elements, f);
0059 }
0060
0061 Elements elements;
0062 };
0063
0064
0065
0066
0067 template <typename Elements, typename Modifiers>
0068 struct make_composite<proto::tag::bitwise_or, Elements, Modifiers>
0069 : make_nary_composite<Elements, sequence>
0070 {};
0071
0072 }}}
0073
0074 #endif