diff options
author | Kevin Smith <git@kismith.co.uk> | 2013-01-12 18:41:34 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2013-01-13 10:36:26 (GMT) |
commit | f3bc816af1b0d61452de973963e453bf3b3f95a2 (patch) | |
tree | e895f8afa3580e6cff6f5ad2017d45bf147a17c2 /3rdParty/Boost/src/boost/spirit/home/lex/lexer_type.hpp | |
parent | 188fc285c6555eadd3c9d50ab8a94adcade78d89 (diff) | |
download | swift-f3bc816af1b0d61452de973963e453bf3b3f95a2.zip swift-f3bc816af1b0d61452de973963e453bf3b3f95a2.tar.bz2 |
Adding in the spirit Boost stuff
Change-Id: I4f127ce61667243b64081b0aa309028d5077045f
Diffstat (limited to '3rdParty/Boost/src/boost/spirit/home/lex/lexer_type.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/spirit/home/lex/lexer_type.hpp | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/3rdParty/Boost/src/boost/spirit/home/lex/lexer_type.hpp b/3rdParty/Boost/src/boost/spirit/home/lex/lexer_type.hpp new file mode 100644 index 0000000..e58bce0 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/lex/lexer_type.hpp @@ -0,0 +1,100 @@ +// Copyright (c) 2001-2011 Hartmut Kaiser +// Copyright (c) 2001-2011 Joel de Guzman +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(BOOST_SPIRIT_LEXER_TYPE_APR_20_2009_0759PM) +#define BOOST_SPIRIT_LEXER_TYPE_APR_20_2009_0759PM + +#if defined(_MSC_VER) +#pragma once +#endif + +#include <boost/mpl/has_xxx.hpp> +#include <boost/spirit/home/lex/domain.hpp> + +namespace boost { namespace spirit { namespace lex +{ + template <typename Derived> + struct lexer_type + { + struct lexer_id; + typedef Derived derived_type; + typedef lex::domain domain; + + // Requirement: l.collect(def, state, targetstate) -> void + // + // l: a lexer component + // def: token definition container + // state: lexer state this token definition needs to be added to + // targetstate: an optional lexer state the lexer should be switched + // into after matching this token + + Derived const& derived() const + { + return *static_cast<Derived const*>(this); + } + }; + + template <typename Derived> + struct primitive_lexer : lexer_type<Derived> + { + struct primitive_lexer_id; + }; + + template <typename Derived> + struct unary_lexer : lexer_type<Derived> + { + struct unary_lexer_id; + + // Requirement: l.subject -> subject lexer component + // + // l: a unary lexer component + + // Requirement: L::subject_type -> subject lexer component type + // + // L: a unary lexer component type + }; + + template <typename Derived> + struct nary_lexer : lexer_type<Derived> + { + struct nary_lexer_id; + + // Requirement: l.elements -> fusion sequence + // + // l: a composite lexer component + + // Requirement: L::elements_type -> fusion sequence + // + // L: a composite lexer component type + }; + +}}} + +namespace boost { namespace spirit { namespace traits // classification +{ + namespace detail + { + BOOST_MPL_HAS_XXX_TRAIT_DEF(lexer_id) + BOOST_MPL_HAS_XXX_TRAIT_DEF(primitive_lexer_id) + BOOST_MPL_HAS_XXX_TRAIT_DEF(unary_lexer_id) + BOOST_MPL_HAS_XXX_TRAIT_DEF(nary_lexer_id) + } + + template <typename T> + struct is_lexer : detail::has_lexer_id<T> {}; + + template <typename T> + struct is_primitive_lexer : detail::has_primitive_lexer_id<T> {}; + + template <typename T> + struct is_unary_lexer : detail::has_unary_lexer_id<T> {}; + + template <typename T> + struct is_nary_lexer : detail::has_nary_lexer_id<T> {}; + +}}} + +#endif |