summaryrefslogtreecommitdiff
path: root/boost/spirit/home/lex/lexer
diff options
context:
space:
mode:
Diffstat (limited to 'boost/spirit/home/lex/lexer')
-rw-r--r--boost/spirit/home/lex/lexer/lexer.hpp2
-rw-r--r--boost/spirit/home/lex/lexer/lexertl/functor_data.hpp2
-rw-r--r--boost/spirit/home/lex/lexer/lexertl/generate_static.hpp3
-rw-r--r--boost/spirit/home/lex/lexer/lexertl/iterator.hpp30
-rw-r--r--boost/spirit/home/lex/lexer/lexertl/position_token.hpp8
-rw-r--r--boost/spirit/home/lex/lexer/lexertl/token.hpp6
-rw-r--r--boost/spirit/home/lex/lexer/support_functions.hpp6
-rw-r--r--boost/spirit/home/lex/lexer/support_functions_expression.hpp33
8 files changed, 39 insertions, 51 deletions
diff --git a/boost/spirit/home/lex/lexer/lexer.hpp b/boost/spirit/home/lex/lexer/lexer.hpp
index 93412ce8ff..e733533a41 100644
--- a/boost/spirit/home/lex/lexer/lexer.hpp
+++ b/boost/spirit/home/lex/lexer/lexer.hpp
@@ -285,7 +285,7 @@ namespace boost { namespace spirit { namespace lex
lexer_def_& operator= (lexer_def_ const&);
};
-#if defined(BOOST_NO_RVALUE_REFERENCES)
+#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
// allow to assign a token definition expression
template <typename LexerDef, typename Expr>
inline lexer_def_<LexerDef>&
diff --git a/boost/spirit/home/lex/lexer/lexertl/functor_data.hpp b/boost/spirit/home/lex/lexer/lexertl/functor_data.hpp
index 207b374772..dfad49b67a 100644
--- a/boost/spirit/home/lex/lexer/lexertl/functor_data.hpp
+++ b/boost/spirit/home/lex/lexer/lexertl/functor_data.hpp
@@ -300,7 +300,7 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
data (IterData const& data_, Iterator& first, Iterator const& last)
: base_type(data_, first, last)
, actions_(data_.actions_), hold_()
- , value_(iterator_range<Iterator>(first, last))
+ , value_(iterator_range<Iterator>(last, last))
, has_value_(false), has_hold_(false) {}
// invoke attached semantic actions, if defined
diff --git a/boost/spirit/home/lex/lexer/lexertl/generate_static.hpp b/boost/spirit/home/lex/lexer/lexertl/generate_static.hpp
index ea9799cc79..72b8014611 100644
--- a/boost/spirit/home/lex/lexer/lexertl/generate_static.hpp
+++ b/boost/spirit/home/lex/lexer/lexertl/generate_static.hpp
@@ -20,6 +20,7 @@
#include <boost/spirit/home/lex/lexer/lexertl/static_version.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp>
+#include <boost/scoped_array.hpp>
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit { namespace lex { namespace lexertl
@@ -50,7 +51,7 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
{
using namespace std; // some systems have size_t in ns std
size_t len = strlen(source);
- std::auto_ptr<wchar_t> result (new wchar_t[len+1]);
+ boost::scoped_array<wchar_t> result (new wchar_t[len+1]);
result.get()[len] = '\0';
// working with wide character streams is supported only if the
diff --git a/boost/spirit/home/lex/lexer/lexertl/iterator.hpp b/boost/spirit/home/lex/lexer/lexertl/iterator.hpp
index f2793ba802..1b057203c4 100644
--- a/boost/spirit/home/lex/lexer/lexertl/iterator.hpp
+++ b/boost/spirit/home/lex/lexer/lexertl/iterator.hpp
@@ -10,6 +10,7 @@
#pragma once
#endif
+#include <boost/spirit/home/support/multi_pass_wrapper.hpp>
#if defined(BOOST_SPIRIT_DEBUG)
#include <boost/spirit/home/support/iterators/detail/buf_id_check_policy.hpp>
#else
@@ -115,7 +116,34 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
: 0;
}
};
+}}
-}}}}
+namespace traits
+{
+ template <typename Functor>
+ struct is_multi_pass<spirit::lex::lexertl::iterator<Functor> >
+ : mpl::true_ {};
+
+ template <typename Functor>
+ void clear_queue(spirit::lex::lexertl::iterator<Functor> & mp
+ , BOOST_SCOPED_ENUM(traits::clear_mode) mode)
+ {
+ mp.clear_queue(mode);
+ }
+
+ template <typename Functor>
+ void inhibit_clear_queue(spirit::lex::lexertl::iterator<Functor>& mp, bool flag)
+ {
+ mp.inhibit_clear_queue(flag);
+ }
+
+ template <typename Functor>
+ bool inhibit_clear_queue(spirit::lex::lexertl::iterator<Functor>& mp)
+ {
+ return mp.inhibit_clear_queue();
+ }
+}
+
+}}
#endif
diff --git a/boost/spirit/home/lex/lexer/lexertl/position_token.hpp b/boost/spirit/home/lex/lexer/lexertl/position_token.hpp
index 025cf55d6a..7bf13db12f 100644
--- a/boost/spirit/home/lex/lexer/lexertl/position_token.hpp
+++ b/boost/spirit/home/lex/lexer/lexertl/position_token.hpp
@@ -35,9 +35,7 @@
#include <boost/mpl/or.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/range/iterator_range.hpp>
-#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
#include <boost/static_assert.hpp>
-#endif
#if defined(BOOST_SPIRIT_DEBUG)
#include <iosfwd>
@@ -387,7 +385,7 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
token_value_type& value() { return value_; }
token_value_type const& value() const { return value_; }
- bool has_value() const { return value_; }
+ bool has_value() const { return !!value_; }
#if BOOST_WORKAROUND(BOOST_MSVC, == 1600)
// workaround for MSVC10 which has problems copying a default
@@ -529,15 +527,13 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
: position_token<Iterator, lex::omit, HasState, Idtype>
{
private: // precondition assertions
-#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
BOOST_STATIC_ASSERT((mpl::is_sequence<AttributeTypes>::value ||
is_same<AttributeTypes, lex::omit>::value));
-#endif
typedef position_token<Iterator, lex::omit, HasState, Idtype>
base_type;
protected:
- // If no additional token value types are given, the the token will
+ // If no additional token value types are given, the token will
// hold no token value at all as the base class already has the
// iterator pair of the matched range in the underlying input sequence.
// Otherwise the token value is stored as a variant and will
diff --git a/boost/spirit/home/lex/lexer/lexertl/token.hpp b/boost/spirit/home/lex/lexer/lexertl/token.hpp
index 90961af156..9f4bdb3872 100644
--- a/boost/spirit/home/lex/lexer/lexertl/token.hpp
+++ b/boost/spirit/home/lex/lexer/lexertl/token.hpp
@@ -35,9 +35,7 @@
#include <boost/mpl/or.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/range/iterator_range.hpp>
-#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
#include <boost/static_assert.hpp>
-#endif
#if defined(BOOST_SPIRIT_DEBUG)
#include <iosfwd>
@@ -330,14 +328,12 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
struct token : token<Iterator, lex::omit, HasState, Idtype>
{
private: // precondition assertions
-#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
BOOST_STATIC_ASSERT((mpl::is_sequence<AttributeTypes>::value ||
is_same<AttributeTypes, lex::omit>::value));
-#endif
typedef token<Iterator, lex::omit, HasState, Idtype> base_type;
protected:
- // If no additional token value types are given, the the token will
+ // If no additional token value types are given, the token will
// hold the plain pair of iterators pointing to the matched range
// in the underlying input sequence. Otherwise the token value is
// stored as a variant and will again hold the pair of iterators but
diff --git a/boost/spirit/home/lex/lexer/support_functions.hpp b/boost/spirit/home/lex/lexer/support_functions.hpp
index f3987c636a..8467560f67 100644
--- a/boost/spirit/home/lex/lexer/support_functions.hpp
+++ b/boost/spirit/home/lex/lexer/support_functions.hpp
@@ -47,11 +47,11 @@ namespace boost { namespace spirit { namespace lex
template <typename Env>
struct result
{
- typedef typename
- remove_const<
+ typedef typename remove_reference<
+ typename remove_const<
typename mpl::at_c<typename Env::args_type, 4>::type
>::type
- context_type;
+ >::type context_type;
typedef typename context_type::base_iterator_type type;
};
diff --git a/boost/spirit/home/lex/lexer/support_functions_expression.hpp b/boost/spirit/home/lex/lexer/support_functions_expression.hpp
index 613a4a4704..3c7572d8d6 100644
--- a/boost/spirit/home/lex/lexer/support_functions_expression.hpp
+++ b/boost/spirit/home/lex/lexer/support_functions_expression.hpp
@@ -21,37 +21,6 @@ namespace boost { namespace spirit { namespace lex
}}}
///////////////////////////////////////////////////////////////////////////////
-#ifndef BOOST_SPIRIT_USE_PHOENIX_V3
-
-namespace boost { namespace spirit { namespace lex
-{
- namespace expression
- {
- template <typename Eval>
- struct less
- {
- typedef phoenix::actor<lex::less_type<Eval> > type;
-
- static type make(Eval const & eval)
- {
- return lex::less_type<Eval>(eval);
- }
- };
-
- template <typename IdType, typename State>
- struct lookahead
- {
- typedef phoenix::actor<lex::lookahead_type<IdType, State> > type;
-
- static type make(IdType const & id_type, State const & state)
- {
- return lex::lookahead_type<IdType, State>(id_type, state);
- }
- };
- }
-}}}
-
-#else // BOOST_SPIRIT_USE_PHOENIX_V3
BOOST_PHOENIX_DEFINE_EXPRESSION(
(boost)(spirit)(lex)(less)
@@ -130,6 +99,4 @@ namespace boost { namespace phoenix
{};
}}
-#endif // BOOST_SPIRIT_USE_PHOENIX_V3
-
#endif