update boost

This commit is contained in:
2023-11-24 12:56:13 -06:00
parent cfc99971af
commit 19d727037a
9260 changed files with 849256 additions and 299957 deletions

View File

@@ -77,6 +77,10 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
friend class FunctorData<Iterator, SupportsActors, SupportsState
, token_value_type>;
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
// Helper template allowing to assign a value on exit
template <typename T>
struct assign_on_exit
@@ -91,11 +95,10 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
T& dst_;
T const& src_;
private:
// silence MSVC warning C4512: assignment operator could not be generated
assign_on_exit& operator= (assign_on_exit const&);
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
public:
functor() {}

View File

@@ -17,10 +17,15 @@
#include <boost/spirit/home/lex/lexer/lexertl/iterator_tokenizer.hpp>
#include <boost/spirit/home/lex/lexer/lexertl/semantic_action_data.hpp>
#include <boost/spirit/home/lex/lexer/lexertl/wrap_action.hpp>
#include <boost/spirit/home/support/assert_msg.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/optional.hpp>
#include <iterator> // for std::iterator_traits
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace spirit { namespace lex { namespace lexertl
{
namespace detail
@@ -66,15 +71,12 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
template <typename Char>
void set_state_name (Char const*)
{
// some (random) versions of gcc instantiate this function even if it's not
// needed leading to false static asserts
#if !defined(__GNUC__)
// If you see a compile time assertion below you're probably
// using a token type not supporting lexer states (the 3rd
// template parameter of the token is mpl::false_), but your
// code uses state changes anyways.
BOOST_STATIC_ASSERT(false);
#endif
BOOST_SPIRIT_ASSERT_FAIL(Char,
tried_to_set_state_of_stateless_token, ());
}
char_type const* get_state_name() const { return rules_.initial(); }
std::size_t get_state_id (char_type const*) const
@@ -192,10 +194,6 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
boost::lexer::basic_rules<char_type> const& rules_;
bool bol_; // helper storing whether last character was \n
private:
// silence MSVC warning C4512: assignment operator could not be generated
data& operator= (data const&);
};
///////////////////////////////////////////////////////////////////////
@@ -265,10 +263,6 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
protected:
std::size_t state_;
private:
// silence MSVC warning C4512: assignment operator could not be generated
data& operator= (data const&);
};
///////////////////////////////////////////////////////////////////////
@@ -300,7 +294,7 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
template <typename IterData>
data (IterData const& data_, Iterator& first, Iterator const& last)
: base_type(data_, first, last)
, actions_(data_.actions_), hold_()
, actions_(data_.actions_), hold_(), end_()
, value_(iterator_range<Iterator>(last, last))
, has_value_(false), has_hold_(false) {}
@@ -401,10 +395,6 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
mutable TokenValue value_; // token value to use
mutable bool has_value_; // 'true' if value_ is valid
bool has_hold_; // 'true' if hold_ is valid
private:
// silence MSVC warning C4512: assignment operator could not be generated
data& operator= (data const&);
};
///////////////////////////////////////////////////////////////////////
@@ -541,13 +531,12 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
mutable token_value_type value_; // token value to use
mutable bool has_value_; // 'true' if value_ is valid
bool has_hold_; // 'true' if hold_ is valid
private:
// silence MSVC warning C4512: assignment operator could not be generated
data& operator= (data const&);
};
}
}}}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#endif

View File

@@ -18,8 +18,9 @@
#include <boost/spirit/home/support/detail/lexer/state_machine.hpp>
#include <boost/spirit/home/support/detail/lexer/debug.hpp>
#include <boost/spirit/home/lex/lexer/lexertl/static_version.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/scoped_array.hpp>
#include <cstring>
#include <locale>
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit { namespace lex { namespace lexertl
@@ -755,7 +756,7 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
for (/**/; t_ < transitions_; ++t_)
{
Char const *ptr_ = iter_->token._charset.c_str();
Char const *end_ = ptr_ + iter_->token._charset.size();
Char const *end2_ = ptr_ + iter_->token._charset.size();
Char start_char_ = 0;
Char curr_char_ = 0;
bool range_ = false;
@@ -763,7 +764,7 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
os_ << "\n if (";
while (ptr_ != end_)
while (ptr_ != end2_)
{
curr_char_ = *ptr_++;
@@ -903,7 +904,14 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
guard.replace(p, 1, L<Char>("_"));
p = guard.find_first_of(L<Char>(": "), p);
}
boost::to_upper(guard);
{ // to_upper(guard)
typedef std::ctype<Char> facet_t;
facet_t const& facet = std::use_facet<facet_t>(std::locale());
typedef typename std::basic_string<Char>::iterator iter_t;
for (iter_t iter = guard.begin(),
last = guard.end(); iter != last; ++iter)
*iter = facet.toupper(*iter);
}
os_ << "#if !defined(BOOST_SPIRIT_LEXER_NEXT_TOKEN_" << guard << ")\n";
os_ << "#define BOOST_SPIRIT_LEXER_NEXT_TOKEN_" << guard << "\n\n";

View File

@@ -101,7 +101,7 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
return unique_functor_type::set_state(*this, state);
}
// get the curent state for the underlying lexer object
// get the current state for the underlying lexer object
std::size_t get_state()
{
return unique_functor_type::get_state(*this);

View File

@@ -25,8 +25,6 @@
#include <boost/spirit/home/support/detail/lexer/debug.hpp>
#endif
#include <boost/foreach.hpp>
#include <iterator> // for std::iterator_traits
namespace boost { namespace spirit { namespace lex { namespace lexertl
@@ -172,6 +170,10 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
typedef iterator<Functor> iterator_type;
private:
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
// this type is purely used for the iterator_type construction below
struct iterator_data_type
{
@@ -187,11 +189,10 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
boost::lexer::basic_state_machine<char_type> const& state_machine_;
boost::lexer::basic_rules<char_type> const& rules_;
semantic_actions_type const& actions_;
private:
// silence MSVC warning C4512: assignment operator could not be generated
iterator_data_type& operator= (iterator_data_type const&);
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
public:
// Return the start iterator usable for iterating over the generated
@@ -303,13 +304,14 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
if (state == all_states_id) {
// add the action to all known states
typedef typename
basic_rules_type::string_size_t_map::value_type
state_type;
basic_rules_type::string_size_t_map::const_iterator
state_iterator;
std::size_t states = rules_.statemap().size();
BOOST_FOREACH(state_type const& s, rules_.statemap()) {
for (state_iterator it = rules_.statemap().begin(),
end = rules_.statemap().end(); it != end; ++it) {
for (std::size_t j = 0; j < states; ++j)
actions_.add_action(unique_id + j, s.second, wrapper_type::call(act));
actions_.add_action(unique_id + j, it->second, wrapper_type::call(act));
}
}
else {

View File

@@ -33,7 +33,7 @@
#include <boost/mpl/if.hpp>
#include <boost/mpl/or.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/range/iterator_range_core.hpp>
#include <boost/static_assert.hpp>
#if defined(BOOST_SPIRIT_DEBUG)
@@ -858,8 +858,8 @@ namespace boost { namespace spirit { namespace traits
, lex::lexertl::position_token<Iterator, lex::omit, HasState, Idtype> >
{
static void
call(lex::lexertl::position_token<Iterator, lex::omit, HasState, Idtype> const& t
, Attribute& attr)
call(lex::lexertl::position_token<Iterator, lex::omit, HasState, Idtype> const&
, Attribute&)
{
// do nothing
}

View File

@@ -16,22 +16,35 @@
#include <boost/spirit/home/lex/lexer/lexertl/iterator_tokenizer.hpp>
#include <boost/spirit/home/lex/lexer/lexertl/semantic_action_data.hpp>
#include <boost/spirit/home/lex/lexer/lexertl/wrap_action.hpp>
#include <boost/spirit/home/support/assert_msg.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <iterator> // for std::iterator_traits
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace spirit { namespace lex { namespace lexertl
{
namespace detail
{
///////////////////////////////////////////////////////////////////////
template <typename Char>
inline bool zstr_compare(Char const* s1, Char const* s2)
{
for (; *s1 || *s2; ++s1, ++s2)
if (*s1 != *s2)
return false;
return true;
}
template <typename Char, typename F>
inline std::size_t get_state_id(Char const* state, F f
, std::size_t numstates)
{
for (std::size_t i = 0; i < numstates; ++i)
{
if (boost::algorithm::equals(f(i), state))
if (zstr_compare(f(i), state))
return i;
}
return boost::lexer::npos;
@@ -80,15 +93,12 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
template <typename Char>
void set_state_name (Char const*)
{
// some (random) versions of gcc instantiate this function even if it's not
// needed leading to false static asserts
#if !defined(__GNUC__)
// If you see a compile time assertion below you're probably
// using a token type not supporting lexer states (the 3rd
// template parameter of the token is mpl::false_), but your
// code uses state changes anyways.
BOOST_STATIC_ASSERT(false);
#endif
BOOST_SPIRIT_ASSERT_FAIL(Char,
tried_to_set_state_of_stateless_token, ());
}
char_type const* get_state_name() const
{
@@ -185,7 +195,7 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
std::size_t get_state() const { return 0; }
void set_state(std::size_t) {}
void set_end(Iterator const& it) {}
void set_end(Iterator const&) {}
Iterator& get_first() { return first_; }
Iterator const& get_first() const { return first_; }
@@ -208,10 +218,6 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
get_state_name_type get_state_name_;
bool bol_; // helper storing whether last character was \n
private:
// silence MSVC warning C4512: assignment operator could not be generated
static_data& operator= (static_data const&);
};
///////////////////////////////////////////////////////////////////////
@@ -283,10 +289,6 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
protected:
std::size_t state_;
std::size_t num_states_;
private:
// silence MSVC warning C4512: assignment operator could not be generated
static_data& operator= (static_data const&);
};
///////////////////////////////////////////////////////////////////////
@@ -422,10 +424,6 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
mutable TokenValue value_; // token value to use
mutable bool has_value_; // 'true' if value_ is valid
bool has_hold_; // 'true' if hold_ is valid
private:
// silence MSVC warning C4512: assignment operator could not be generated
static_data& operator= (static_data const&);
};
///////////////////////////////////////////////////////////////////////
@@ -562,12 +560,11 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
mutable token_value_type value_; // token value to use
mutable bool has_value_; // 'true' if value_ is valid
bool has_hold_; // 'true' if hold_ is valid
private:
// silence MSVC warning C4512: assignment operator could not be generated
static_data& operator= (static_data const&);
};
}
}}}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#endif

View File

@@ -130,6 +130,10 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
typedef iterator<Functor> iterator_type;
private:
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
// this type is purely used for the iterator_type construction below
struct iterator_data_type
{
@@ -150,11 +154,10 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
get_state_name_type get_state_name_;
std::size_t num_states_;
bool bol_;
private:
// silence MSVC warning C4512: assignment operator could not be generated
iterator_data_type& operator= (iterator_data_type const&);
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
typedef LexerTables tables_type;
@@ -230,7 +233,7 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
actions_.add_action(unique_id, state, wrapper_type::call(act));
}
bool init_dfa(bool minimize = false) const { return true; }
bool init_dfa(bool /*minimize*/ = false) const { return true; }
private:
typename Functor::semantic_actions_type actions_;

View File

@@ -32,9 +32,9 @@
#include <boost/mpl/vector.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/or.hpp>
#include <boost/type_traits/integral_promotion.hpp>
#include <boost/range/iterator_range_core.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/type_traits/make_unsigned.hpp>
#include <boost/static_assert.hpp>
#if defined(BOOST_SPIRIT_DEBUG)
@@ -127,12 +127,13 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
typedef mpl::false_ has_state;
typedef Idtype id_type;
typedef unused_type token_value_type;
typedef typename make_unsigned<id_type>::type uid_type;
// default constructed tokens correspond to EOI tokens
token() : id_(id_type(boost::lexer::npos)) {}
token() : id_(boost::lexer::npos) {}
// construct an invalid token
explicit token(int) : id_(id_type(0)) {}
explicit token(int) : id_(0) {}
token(id_type id, std::size_t) : id_(id) {}
@@ -155,17 +156,17 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
// this default conversion operator is needed to allow the direct
// usage of tokens in conjunction with the primitive parsers defined
// in Qi
operator id_type() const { return static_cast<id_type>(id_); }
operator id_type() const { return id_type(uid_type(id_)); }
// Retrieve or set the token id of this token instance.
id_type id() const { return static_cast<id_type>(id_); }
void id(id_type newid) { id_ = newid; }
id_type id() const { return id_type(uid_type(id_)); }
void id(id_type newid) { id_ = uid_type(newid); }
std::size_t state() const { return 0; } // always '0' (INITIAL state)
bool is_valid() const
{
return 0 != id_ && id_type(boost::lexer::npos) != id_;
return 0 != id_ && boost::lexer::npos != id_;
}
#if defined(BOOST_SPIRIT_DEBUG)
@@ -187,7 +188,7 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl
#endif
protected:
typename boost::integral_promotion<id_type>::type id_; // token id, 0 if nothing has been matched
std::size_t id_; // token id, 0 if nothing has been matched
};
#if defined(BOOST_SPIRIT_DEBUG)
@@ -579,8 +580,8 @@ namespace boost { namespace spirit { namespace traits
, lex::lexertl::token<Iterator, lex::omit, HasState, Idtype> >
{
static void
call(lex::lexertl::token<Iterator, lex::omit, HasState, Idtype> const& t
, Attribute& attr)
call(lex::lexertl::token<Iterator, lex::omit, HasState, Idtype> const&
, Attribute&)
{
// do nothing
}

View File

@@ -13,12 +13,10 @@
#pragma once
#endif
#include <boost/spirit/include/phoenix_core.hpp>
#include <boost/spirit/include/phoenix_bind.hpp>
#include <boost/spirit/include/phoenix_scope.hpp>
#include <boost/spirit/home/support/attributes.hpp>
#include <boost/spirit/home/lex/lexer/pass_flags.hpp>
#include <boost/phoenix/core/argument.hpp>
#include <boost/phoenix/bind.hpp>
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit { namespace lex { namespace lexertl