update boost
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
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(CONVERT_TRIGRAPHS_HK050403_INCLUDED)
|
||||
#define CONVERT_TRIGRAPHS_HK050403_INCLUDED
|
||||
#if !defined(BOOST_CONVERT_TRIGRAPHS_HK050403_INCLUDED)
|
||||
#define BOOST_CONVERT_TRIGRAPHS_HK050403_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/cpplexer/cpplexer_exceptions.hpp>
|
||||
@@ -134,6 +134,6 @@ convert_trigraphs(StringT const &value)
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CONVERT_TRIGRAPHS_HK050403_INCLUDED)
|
||||
#endif // !defined(BOOST_CONVERT_TRIGRAPHS_HK050403_INCLUDED)
|
||||
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_LEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED)
|
||||
#define CPP_LEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED
|
||||
#if !defined(BOOST_CPP_LEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED)
|
||||
#define BOOST_CPP_LEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/util/file_position.hpp>
|
||||
@@ -70,4 +70,4 @@ struct lex_input_interface
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_LEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_LEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED)
|
||||
|
||||
@@ -53,9 +53,9 @@ template <
|
||||
>
|
||||
struct BOOST_WAVE_NEW_LEXER_DECL new_lexer_gen
|
||||
{
|
||||
// The NewLexer function allows the opaque generation of a new lexer object.
|
||||
// It is coupled to the token type to allow to decouple the lexer/token
|
||||
// configurations at compile time.
|
||||
// The NewLexer function allows the opaque generation of a new lexer object.
|
||||
// It is coupled to the token type to allow to decouple the lexer/token
|
||||
// configurations at compile time.
|
||||
static lex_input_interface<TokenT> *
|
||||
new_lexer(IteratorT const &first, IteratorT const &last,
|
||||
PositionT const &pos, boost::wave::language_support language);
|
||||
@@ -80,9 +80,9 @@ struct lex_input_interface_generator
|
||||
lex_input_interface_generator() {}
|
||||
~lex_input_interface_generator() {}
|
||||
|
||||
// The new_lexer function allows the opaque generation of a new lexer object.
|
||||
// It is coupled to the token type to allow to distinguish different
|
||||
// lexer/token configurations at compile time.
|
||||
// The new_lexer function allows the opaque generation of a new lexer object.
|
||||
// It is coupled to the token type to allow to distinguish different
|
||||
// lexer/token configurations at compile time.
|
||||
template <typename IteratorT>
|
||||
static lex_input_interface<TokenT> *
|
||||
new_lexer(IteratorT const &first, IteratorT const &last,
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_LEX_ITERATOR_HPP_AF0C37E3_CBD8_4F33_A225_51CF576FA61F_INCLUDED)
|
||||
#define CPP_LEX_ITERATOR_HPP_AF0C37E3_CBD8_4F33_A225_51CF576FA61F_INCLUDED
|
||||
#if !defined(BOOST_CPP_LEX_ITERATOR_HPP_AF0C37E3_CBD8_4F33_A225_51CF576FA61F_INCLUDED)
|
||||
#define BOOST_CPP_LEX_ITERATOR_HPP_AF0C37E3_CBD8_4F33_A225_51CF576FA61F_INCLUDED
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
{ return *this; } // nothing to do here
|
||||
#endif
|
||||
|
||||
// interface to the iterator_policies::split_functor_input policy
|
||||
// interface to the iterator_policies::split_functor_input policy
|
||||
typedef TokenT result_type;
|
||||
typedef lex_iterator_functor_shim unique;
|
||||
typedef lex_input_interface<TokenT>* shared;
|
||||
@@ -200,15 +200,15 @@ public:
|
||||
{
|
||||
typedef typename TokenT::position_type position_type;
|
||||
|
||||
// set the new position in the current token
|
||||
token_type const& currtoken = this->base_type::dereference(*this);
|
||||
position_type currpos = currtoken.get_position();
|
||||
// set the new position in the current token
|
||||
token_type const& currtoken = this->base_type::dereference(*this);
|
||||
position_type currpos = currtoken.get_position();
|
||||
|
||||
currpos.set_file(pos.get_file());
|
||||
currpos.set_line(pos.get_line());
|
||||
const_cast<token_type&>(currtoken).set_position(currpos);
|
||||
|
||||
// set the new position for future tokens as well
|
||||
// set the new position for future tokens as well
|
||||
if (token_type::string_type::npos !=
|
||||
currtoken.get_value().find_first_of('\n'))
|
||||
{
|
||||
@@ -240,4 +240,4 @@ public:
|
||||
|
||||
#undef BOOST_WAVE_EOF_PREFIX
|
||||
|
||||
#endif // !defined(CPP_LEX_ITERATOR_HPP_AF0C37E3_CBD8_4F33_A225_51CF576FA61F_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_LEX_ITERATOR_HPP_AF0C37E3_CBD8_4F33_A225_51CF576FA61F_INCLUDED)
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_TOKEN_HPP_53A13BD2_FBAA_444B_9B8B_FCB225C2BBA8_INCLUDED)
|
||||
#define CPP_TOKEN_HPP_53A13BD2_FBAA_444B_9B8B_FCB225C2BBA8_INCLUDED
|
||||
#if !defined(BOOST_CPP_TOKEN_HPP_53A13BD2_FBAA_444B_9B8B_FCB225C2BBA8_INCLUDED)
|
||||
#define BOOST_CPP_TOKEN_HPP_53A13BD2_FBAA_444B_9B8B_FCB225C2BBA8_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#if BOOST_WAVE_SERIALIZATION != 0
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/pool/singleton_pool.hpp>
|
||||
#include <boost/detail/atomic_count.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
// this must occur after all of the includes and before any code appears
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
@@ -54,12 +55,14 @@ public:
|
||||
: id(T_UNKNOWN), refcnt(1)
|
||||
{}
|
||||
|
||||
token_data(token_id id_, string_type const &value_, position_type const &pos_)
|
||||
: id(id_), value(value_), pos(pos_), refcnt(1)
|
||||
token_data(token_id id_, string_type const &value_,
|
||||
position_type const &pos_,
|
||||
optional<position_type> const & expand_pos_ = boost::none)
|
||||
: id(id_), value(value_), pos(pos_), expand_pos(expand_pos_), refcnt(1)
|
||||
{}
|
||||
|
||||
token_data(token_data const& rhs)
|
||||
: id(rhs.id), value(rhs.value), pos(rhs.pos), refcnt(1)
|
||||
: id(rhs.id), value(rhs.value), pos(rhs.pos), expand_pos(rhs.expand_pos), refcnt(1)
|
||||
{}
|
||||
|
||||
~token_data()
|
||||
@@ -69,14 +72,22 @@ public:
|
||||
std::size_t release() { return --refcnt; }
|
||||
std::size_t get_refcnt() const { return refcnt; }
|
||||
|
||||
// accessors
|
||||
// accessors
|
||||
operator token_id() const { return id; }
|
||||
string_type const &get_value() const { return value; }
|
||||
position_type const &get_position() const { return pos; }
|
||||
position_type const &get_expand_position() const
|
||||
{
|
||||
if (expand_pos)
|
||||
return *expand_pos;
|
||||
else
|
||||
return pos;
|
||||
}
|
||||
|
||||
void set_token_id (token_id id_) { id = id_; }
|
||||
void set_value (string_type const &value_) { value = value_; }
|
||||
void set_position (position_type const &pos_) { pos = pos_; }
|
||||
void set_expand_position (position_type const & pos_) { expand_pos = pos_; }
|
||||
|
||||
friend bool operator== (token_data const& lhs, token_data const& rhs)
|
||||
{
|
||||
@@ -105,7 +116,7 @@ public:
|
||||
static void operator delete(void *p, std::size_t size);
|
||||
|
||||
#if defined(BOOST_SPIRIT_DEBUG)
|
||||
// debug support
|
||||
// debug support
|
||||
void print (std::ostream &stream) const
|
||||
{
|
||||
stream << get_token_name(id) << "(";
|
||||
@@ -138,6 +149,7 @@ private:
|
||||
token_id id; // the token id
|
||||
string_type value; // the text, which was parsed into this token
|
||||
position_type pos; // the original file position
|
||||
boost::optional<position_type> expand_pos; // where this token was expanded
|
||||
boost::detail::atomic_count refcnt;
|
||||
};
|
||||
|
||||
@@ -237,16 +249,18 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
// accessors
|
||||
// accessors
|
||||
operator token_id() const { return 0 != data ? token_id(*data) : T_EOI; }
|
||||
string_type const &get_value() const { return data->get_value(); }
|
||||
position_type const &get_position() const { return data->get_position(); }
|
||||
position_type const &get_expand_position() const { return data->get_expand_position(); }
|
||||
bool is_eoi() const { return 0 == data || token_id(*data) == T_EOI; }
|
||||
bool is_valid() const { return 0 != data && token_id(*data) != T_UNKNOWN; }
|
||||
|
||||
void set_token_id (token_id id_) { make_unique(); data->set_token_id(id_); }
|
||||
void set_value (string_type const &value_) { make_unique(); data->set_value(value_); }
|
||||
void set_position (position_type const &pos_) { make_unique(); data->set_position(pos_); }
|
||||
void set_expand_position (position_type const &pos_) { make_unique(); data->set_expand_position(pos_); }
|
||||
|
||||
friend bool operator== (lex_token const& lhs, lex_token const& rhs)
|
||||
{
|
||||
@@ -259,7 +273,7 @@ public:
|
||||
|
||||
// debug support
|
||||
#if BOOST_WAVE_DUMP_PARSE_TREE != 0
|
||||
// access functions for the tree_to_xml functionality
|
||||
// access functions for the tree_to_xml functionality
|
||||
static int get_token_id(lex_token const &t)
|
||||
{ return token_id(t); }
|
||||
static string_type get_token_value(lex_token const &t)
|
||||
@@ -267,7 +281,7 @@ public:
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_SPIRIT_DEBUG)
|
||||
// debug support
|
||||
// debug support
|
||||
void print (std::ostream &stream) const
|
||||
{
|
||||
data->print(stream);
|
||||
@@ -332,4 +346,4 @@ operator<< (std::ostream &stream, lex_token<PositionT> const &object)
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_TOKEN_HPP_53A13BD2_FBAA_444B_9B8B_FCB225C2BBA8_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_TOKEN_HPP_53A13BD2_FBAA_444B_9B8B_FCB225C2BBA8_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPPLEXER_EXCEPTIONS_HPP_1A09DE1A_6D1F_4091_AF7F_5F13AB0D31AB_INCLUDED)
|
||||
#define CPPLEXER_EXCEPTIONS_HPP_1A09DE1A_6D1F_4091_AF7F_5F13AB0D31AB_INCLUDED
|
||||
#if !defined(BOOST_CPPLEXER_EXCEPTIONS_HPP_1A09DE1A_6D1F_4091_AF7F_5F13AB0D31AB_INCLUDED)
|
||||
#define BOOST_CPPLEXER_EXCEPTIONS_HPP_1A09DE1A_6D1F_4091_AF7F_5F13AB0D31AB_INCLUDED
|
||||
|
||||
#include <exception>
|
||||
#include <string>
|
||||
@@ -32,30 +32,30 @@
|
||||
#include <strstream>
|
||||
#define BOOST_WAVE_LEXER_THROW(cls, code, msg, line, column, name) \
|
||||
{ \
|
||||
using namespace boost::wave; \
|
||||
std::strstream stream; \
|
||||
using namespace boost::wave; \
|
||||
std::strstream stream; \
|
||||
stream << cls::severity_text(cls::code) << ": " \
|
||||
<< cls::error_text(cls::code); \
|
||||
if ((msg)[0] != 0) stream << ": " << (msg); \
|
||||
stream << std::ends; \
|
||||
std::string throwmsg = stream.str(); stream.freeze(false); \
|
||||
boost::throw_exception(cls(throwmsg.c_str(), cls::code, line, column, \
|
||||
name)); \
|
||||
<< cls::error_text(cls::code); \
|
||||
if ((msg)[0] != 0) stream << ": " << (msg); \
|
||||
stream << std::ends; \
|
||||
std::string throwmsg = stream.str(); stream.freeze(false); \
|
||||
boost::throw_exception(cls(throwmsg.c_str(), cls::code, line, column, \
|
||||
name)); \
|
||||
} \
|
||||
/**/
|
||||
#else
|
||||
#include <sstream>
|
||||
#define BOOST_WAVE_LEXER_THROW(cls, code, msg, line, column, name) \
|
||||
{ \
|
||||
using namespace boost::wave; \
|
||||
std::stringstream stream; \
|
||||
stream << cls::severity_text(cls::code) << ": " \
|
||||
<< cls::error_text(cls::code); \
|
||||
if ((msg)[0] != 0) stream << ": " << (msg); \
|
||||
stream << std::ends; \
|
||||
boost::throw_exception(cls(stream.str().c_str(), cls::code, line, column, \
|
||||
name)); \
|
||||
} \
|
||||
#define BOOST_WAVE_LEXER_THROW(cls, code, msg, line, column, name) \
|
||||
{ \
|
||||
using namespace boost::wave; \
|
||||
std::stringstream stream; \
|
||||
stream << cls::severity_text(cls::code) << ": " \
|
||||
<< cls::error_text(cls::code); \
|
||||
if ((msg)[0] != 0) stream << ": " << (msg); \
|
||||
stream << std::ends; \
|
||||
boost::throw_exception(cls(stream.str().c_str(), cls::code, line, column, \
|
||||
name)); \
|
||||
} \
|
||||
/**/
|
||||
#endif // BOOST_NO_STRINGSTREAM
|
||||
#endif // BOOST_WAVE_LEXER_THROW
|
||||
@@ -63,34 +63,34 @@
|
||||
#if !defined(BOOST_WAVE_LEXER_THROW_VAR)
|
||||
#ifdef BOOST_NO_STRINGSTREAM
|
||||
#include <strstream>
|
||||
#define BOOST_WAVE_LEXER_THROW_VAR(cls, codearg, msg, line, column, name) \
|
||||
{ \
|
||||
using namespace boost::wave; \
|
||||
cls::error_code code = static_cast<cls::error_code>(codearg); \
|
||||
std::strstream stream; \
|
||||
stream << cls::severity_text(code) << ": " \
|
||||
<< cls::error_text(code); \
|
||||
if ((msg)[0] != 0) stream << ": " << (msg); \
|
||||
stream << std::ends; \
|
||||
std::string throwmsg = stream.str(); stream.freeze(false); \
|
||||
boost::throw_exception(cls(throwmsg.c_str(), code, line, column, \
|
||||
name)); \
|
||||
} \
|
||||
#define BOOST_WAVE_LEXER_THROW_VAR(cls, codearg, msg, line, column, name) \
|
||||
{ \
|
||||
using namespace boost::wave; \
|
||||
cls::error_code code = static_cast<cls::error_code>(codearg); \
|
||||
std::strstream stream; \
|
||||
stream << cls::severity_text(code) << ": " \
|
||||
<< cls::error_text(code); \
|
||||
if ((msg)[0] != 0) stream << ": " << (msg); \
|
||||
stream << std::ends; \
|
||||
std::string throwmsg = stream.str(); stream.freeze(false); \
|
||||
boost::throw_exception(cls(throwmsg.c_str(), code, line, column, \
|
||||
name)); \
|
||||
} \
|
||||
/**/
|
||||
#else
|
||||
#include <sstream>
|
||||
#define BOOST_WAVE_LEXER_THROW_VAR(cls, codearg, msg, line, column, name) \
|
||||
{ \
|
||||
using namespace boost::wave; \
|
||||
cls::error_code code = static_cast<cls::error_code>(codearg); \
|
||||
std::stringstream stream; \
|
||||
stream << cls::severity_text(code) << ": " \
|
||||
<< cls::error_text(code); \
|
||||
if ((msg)[0] != 0) stream << ": " << (msg); \
|
||||
stream << std::ends; \
|
||||
boost::throw_exception(cls(stream.str().c_str(), code, line, column, \
|
||||
name)); \
|
||||
} \
|
||||
#define BOOST_WAVE_LEXER_THROW_VAR(cls, codearg, msg, line, column, name) \
|
||||
{ \
|
||||
using namespace boost::wave; \
|
||||
cls::error_code code = static_cast<cls::error_code>(codearg); \
|
||||
std::stringstream stream; \
|
||||
stream << cls::severity_text(code) << ": " \
|
||||
<< cls::error_text(code); \
|
||||
if ((msg)[0] != 0) stream << ": " << (msg); \
|
||||
stream << std::ends; \
|
||||
boost::throw_exception(cls(stream.str().c_str(), code, line, column, \
|
||||
name)); \
|
||||
} \
|
||||
/**/
|
||||
#endif // BOOST_NO_STRINGSTREAM
|
||||
#endif // BOOST_WAVE_LEXER_THROW
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
}
|
||||
~cpplexer_exception() throw() {}
|
||||
|
||||
virtual char const *what() const throw() = 0; // to be overloaded
|
||||
char const *what() const throw() BOOST_OVERRIDE = 0; // to be overloaded
|
||||
virtual char const *description() const throw() = 0;
|
||||
virtual int get_errorcode() const throw() = 0;
|
||||
virtual int get_severity() const throw() = 0;
|
||||
@@ -186,23 +186,23 @@ public:
|
||||
}
|
||||
~lexing_exception() throw() {}
|
||||
|
||||
virtual char const *what() const throw()
|
||||
char const *what() const throw() BOOST_OVERRIDE
|
||||
{
|
||||
return "boost::wave::lexing_exception";
|
||||
}
|
||||
virtual char const *description() const throw()
|
||||
char const *description() const throw() BOOST_OVERRIDE
|
||||
{
|
||||
return buffer;
|
||||
}
|
||||
virtual int get_severity() const throw()
|
||||
int get_severity() const throw() BOOST_OVERRIDE
|
||||
{
|
||||
return level;
|
||||
}
|
||||
virtual int get_errorcode() const throw()
|
||||
int get_errorcode() const throw() BOOST_OVERRIDE
|
||||
{
|
||||
return code;
|
||||
}
|
||||
virtual bool is_recoverable() const throw()
|
||||
bool is_recoverable() const throw() BOOST_OVERRIDE
|
||||
{
|
||||
switch (get_errorcode()) {
|
||||
case lexing_exception::universal_char_invalid:
|
||||
@@ -287,4 +287,4 @@ is_recoverable(lexing_exception const& e)
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPPLEXER_EXCEPTIONS_HPP_1A09DE1A_6D1F_4091_AF7F_5F13AB0D31AB_INCLUDED)
|
||||
#endif // !defined(BOOST_CPPLEXER_EXCEPTIONS_HPP_1A09DE1A_6D1F_4091_AF7F_5F13AB0D31AB_INCLUDED)
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
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(DETECT_INCLUDE_GUARDS_HK060304_INCLUDED)
|
||||
#define DETECT_INCLUDE_GUARDS_HK060304_INCLUDED
|
||||
#if !defined(BOOST_DETECT_INCLUDE_GUARDS_HK060304_INCLUDED)
|
||||
#define BOOST_DETECT_INCLUDE_GUARDS_HK060304_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/token_ids.hpp>
|
||||
@@ -260,4 +260,4 @@ include_guards<Token>::state_5(Token& t)
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !DETECT_INCLUDE_GUARDS_HK060304_INCLUDED
|
||||
#endif // !BOOST_DETECT_INCLUDE_GUARDS_HK060304_INCLUDED
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(AQ_HPP_A21D9145_B643_44C0_81E7_DB346DD67EE1_INCLUDED)
|
||||
#define AQ_HPP_A21D9145_B643_44C0_81E7_DB346DD67EE1_INCLUDED
|
||||
#if !defined(BOOST_AQ_HPP_A21D9145_B643_44C0_81E7_DB346DD67EE1_INCLUDED)
|
||||
#define BOOST_AQ_HPP_A21D9145_B643_44C0_81E7_DB346DD67EE1_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <cstdlib>
|
||||
@@ -61,4 +61,4 @@ BOOST_WAVE_DECL void aq_terminate(aq_queue q);
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(AQ_HPP_A21D9145_B643_44C0_81E7_DB346DD67EE1_INCLUDED)
|
||||
#endif // !defined(BOOST_AQ_HPP_A21D9145_B643_44C0_81E7_DB346DD67EE1_INCLUDED)
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_RE_HPP_B76C4F5E_63E9_4B8A_9975_EC32FA6BF027_INCLUDED)
|
||||
#define CPP_RE_HPP_B76C4F5E_63E9_4B8A_9975_EC32FA6BF027_INCLUDED
|
||||
#if !defined(BOOST_CPP_RE_HPP_B76C4F5E_63E9_4B8A_9975_EC32FA6BF027_INCLUDED)
|
||||
#define BOOST_CPP_RE_HPP_B76C4F5E_63E9_4B8A_9975_EC32FA6BF027_INCLUDED
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
} \
|
||||
/**/
|
||||
|
||||
#include <iostream>
|
||||
#include <iosfwd>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define BOOST_WAVE_UPDATE_CURSOR() \
|
||||
@@ -181,7 +181,10 @@ uchar *fill(Scanner<Iterator> *s, uchar *cursor)
|
||||
{
|
||||
if (NULL == s->lim)
|
||||
s->lim = s->top;
|
||||
memmove(s->bot, s->tok, s->lim - s->tok);
|
||||
size_t length = s->lim - s->tok;
|
||||
if(length > 0){
|
||||
memmove(s->bot, s->tok, length);
|
||||
}
|
||||
s->tok = s->cur = s->bot;
|
||||
s->ptr -= cnt;
|
||||
cursor -= cnt;
|
||||
@@ -202,7 +205,10 @@ uchar *fill(Scanner<Iterator> *s, uchar *cursor)
|
||||
return cursor;
|
||||
}
|
||||
|
||||
memmove(buf, s->tok, s->lim - s->tok);
|
||||
size_t length = s->lim - s->tok;
|
||||
if(length > 0){
|
||||
memmove(buf, s->tok, length);
|
||||
}
|
||||
s->tok = s->cur = buf;
|
||||
s->ptr = &buf[s->ptr - s->bot];
|
||||
cursor = &buf[cursor - s->bot];
|
||||
@@ -407,4 +413,4 @@ boost::wave::token_id scan(Scanner<Iterator> *s)
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_RE_HPP_B76C4F5E_63E9_4B8A_9975_EC32FA6BF027_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_RE_HPP_B76C4F5E_63E9_4B8A_9975_EC32FA6BF027_INCLUDED)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -10,8 +10,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_RE2C_LEXER_HPP_B81A2629_D5B1_4944_A97D_60254182B9A8_INCLUDED)
|
||||
#define CPP_RE2C_LEXER_HPP_B81A2629_D5B1_4944_A97D_60254182B9A8_INCLUDED
|
||||
#if !defined(BOOST_CPP_RE2C_LEXER_HPP_B81A2629_D5B1_4944_A97D_60254182B9A8_INCLUDED)
|
||||
#define BOOST_CPP_RE2C_LEXER_HPP_B81A2629_D5B1_4944_A97D_60254182B9A8_INCLUDED
|
||||
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/spirit/include/classic_core.hpp>
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/language_support.hpp>
|
||||
@@ -88,7 +87,7 @@ public:
|
||||
}
|
||||
#endif
|
||||
|
||||
// error reporting from the re2c generated lexer
|
||||
// error reporting from the re2c generated lexer
|
||||
static int report_error(Scanner<IteratorT> const* s, int code, char const *, ...);
|
||||
|
||||
private:
|
||||
@@ -153,6 +152,14 @@ lexer<IteratorT, PositionT, TokenT>::lexer(IteratorT const &first,
|
||||
#else
|
||||
scanner.act_in_cpp0x_mode = false;
|
||||
#endif
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_CPP2A != 0
|
||||
scanner.act_in_cpp2a_mode = boost::wave::need_cpp2a(language_);
|
||||
scanner.act_in_cpp0x_mode = boost::wave::need_cpp2a(language_)
|
||||
|| boost::wave::need_cpp0x(language_);
|
||||
#else
|
||||
scanner.act_in_cpp2a_mode = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
template <typename IteratorT, typename PositionT, typename TokenT>
|
||||
@@ -196,7 +203,6 @@ lexer<IteratorT, PositionT, TokenT>::get(TokenT& result)
|
||||
impl::validate_literal(value, actline, scanner.column, filename);
|
||||
break;
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0
|
||||
case T_PP_HHEADER:
|
||||
case T_PP_QHEADER:
|
||||
case T_PP_INCLUDE:
|
||||
@@ -205,13 +211,14 @@ lexer<IteratorT, PositionT, TokenT>::get(TokenT& result)
|
||||
value = string_type((char const *)scanner.tok,
|
||||
scanner.cur-scanner.tok);
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0
|
||||
// Skip '#' and whitespace and see whether we find an 'include_next' here.
|
||||
typename string_type::size_type start = value.find("include");
|
||||
if (value.compare(start, 12, "include_next", 12) == 0)
|
||||
id = token_id(id | AltTokenType);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
case T_LONGINTLIT: // supported in C++11, C99 and long_long mode
|
||||
value = string_type((char const *)scanner.tok,
|
||||
@@ -240,8 +247,8 @@ lexer<IteratorT, PositionT, TokenT>::get(TokenT& result)
|
||||
break;
|
||||
|
||||
case T_EOF:
|
||||
// T_EOF is returned as a valid token, the next call will return T_EOI,
|
||||
// i.e. the actual end of input
|
||||
// T_EOF is returned as a valid token, the next call will return T_EOI,
|
||||
// i.e. the actual end of input
|
||||
at_eof = true;
|
||||
value.clear();
|
||||
break;
|
||||
@@ -317,7 +324,7 @@ lexer<IteratorT, PositionT, TokenT>::report_error(Scanner<IteratorT> const *s, i
|
||||
|
||||
BOOST_WAVE_LEXER_THROW_VAR(lexing_exception, errcode, buffer, s->line,
|
||||
s->column, s->file_name);
|
||||
// BOOST_UNREACHABLE_RETURN(0);
|
||||
// BOOST_UNREACHABLE_RETURN(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -342,11 +349,11 @@ public:
|
||||
{}
|
||||
virtual ~lex_functor() {}
|
||||
|
||||
// get the next token from the input stream
|
||||
token_type& get(token_type& result) { return re2c_lexer.get(result); }
|
||||
void set_position(PositionT const &pos) { re2c_lexer.set_position(pos); }
|
||||
// get the next token from the input stream
|
||||
token_type& get(token_type& result) BOOST_OVERRIDE { return re2c_lexer.get(result); }
|
||||
void set_position(PositionT const &pos) BOOST_OVERRIDE { re2c_lexer.set_position(pos); }
|
||||
#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0
|
||||
bool has_include_guards(std::string& guard_name) const
|
||||
bool has_include_guards(std::string& guard_name) const BOOST_OVERRIDE
|
||||
{ return re2c_lexer.has_include_guards(guard_name); }
|
||||
#endif
|
||||
|
||||
@@ -420,4 +427,4 @@ new_lexer_gen<IteratorT, PositionT, TokenT>::new_lexer(IteratorT const &first,
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_RE2C_LEXER_HPP_B81A2629_D5B1_4944_A97D_60254182B9A8_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_RE2C_LEXER_HPP_B81A2629_D5B1_4944_A97D_60254182B9A8_INCLUDED)
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(SCANNER_HPP_F4FB01EB_E75C_4537_A146_D34B9895EF37_INCLUDED)
|
||||
#define SCANNER_HPP_F4FB01EB_E75C_4537_A146_D34B9895EF37_INCLUDED
|
||||
#if !defined(BOOST_SCANNER_HPP_F4FB01EB_E75C_4537_A146_D34B9895EF37_INCLUDED)
|
||||
#define BOOST_SCANNER_HPP_F4FB01EB_E75C_4537_A146_D34B9895EF37_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/cpplexer/re2clex/aq.hpp>
|
||||
@@ -74,6 +74,7 @@ struct Scanner {
|
||||
bool enable_import_keyword; /* recognize import as a keyword */
|
||||
bool single_line_only; /* don't report missing eol's in C++ comments */
|
||||
bool act_in_cpp0x_mode; /* lexer works in C++11 mode */
|
||||
bool act_in_cpp2a_mode; /* lexer works in C++20 mode */
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -87,4 +88,4 @@ struct Scanner {
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(SCANNER_HPP_F4FB01EB_E75C_4537_A146_D34B9895EF37_INCLUDED)
|
||||
#endif // !defined(BOOST_SCANNER_HPP_F4FB01EB_E75C_4537_A146_D34B9895EF37_INCLUDED)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(TOKEN_CACHE_HPP_4D2320B7_1D56_4113_A114_397E70FA438C_INCLUDED)
|
||||
#define TOKEN_CACHE_HPP_4D2320B7_1D56_4113_A114_397E70FA438C_INCLUDED
|
||||
#if !defined(BOOST_TOKEN_CACHE_HPP_4D2320B7_1D56_4113_A114_397E70FA438C_INCLUDED)
|
||||
#define BOOST_TOKEN_CACHE_HPP_4D2320B7_1D56_4113_A114_397E70FA438C_INCLUDED
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -69,4 +69,4 @@ private:
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(TOKEN_CACHE_HPP_4D2320B7_1D56_4113_A114_397E70FA438C_INCLUDED)
|
||||
#endif // !defined(BOOST_TOKEN_CACHE_HPP_4D2320B7_1D56_4113_A114_397E70FA438C_INCLUDED)
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
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(VALIDATE_UNIVERSAL_CHAR_HPP_55F1B811_CD76_4C72_8344_CBC69CF3B339_INCLUDED)
|
||||
#define VALIDATE_UNIVERSAL_CHAR_HPP_55F1B811_CD76_4C72_8344_CBC69CF3B339_INCLUDED
|
||||
#if !defined(BOOST_VALIDATE_UNIVERSAL_CHAR_HPP_55F1B811_CD76_4C72_8344_CBC69CF3B339_INCLUDED)
|
||||
#define BOOST_VALIDATE_UNIVERSAL_CHAR_HPP_55F1B811_CD76_4C72_8344_CBC69CF3B339_INCLUDED
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
@@ -72,15 +72,15 @@ in_range(unsigned long ch, unsigned long l, unsigned long u)
|
||||
inline universal_char_type
|
||||
classify_universal_char (unsigned long ch)
|
||||
{
|
||||
// test for invalid characters
|
||||
// test for invalid characters
|
||||
if (ch <= 0x0020 || in_range(ch, 0x007f, 0x009f))
|
||||
return universal_char_type_invalid;
|
||||
|
||||
// test for characters in the range of the base character set
|
||||
// test for characters in the range of the base character set
|
||||
if (in_range(ch, 0x0021, 0x005f) || in_range(ch, 0x0061, 0x007e))
|
||||
return universal_char_type_base_charset;
|
||||
|
||||
// test for additional valid character values (see C++ Standard: Annex E)
|
||||
// test for additional valid character values (see C++ Standard: Annex E)
|
||||
if (in_range(ch, 0x00c0, 0x00d6) || in_range(ch, 0x00d8, 0x00f6) ||
|
||||
in_range(ch, 0x00f8, 0x01f5) || in_range(ch, 0x01fa, 0x0217) ||
|
||||
in_range(ch, 0x0250, 0x02a8) || in_range(ch, 0x1e00, 0x1e9a) ||
|
||||
@@ -227,16 +227,16 @@ validate_identifier_name (StringT const &name, std::size_t line,
|
||||
typename StringT::size_type pos = name.find_first_of('\\');
|
||||
|
||||
while (StringT::npos != pos) {
|
||||
// the identifier name contains a backslash (must be universal char)
|
||||
// the identifier name contains a backslash (must be universal char)
|
||||
BOOST_ASSERT('u' == name[pos+1] || 'U' == name[pos+1]);
|
||||
|
||||
StringT uchar_val(name.substr(pos+2, ('u' == name[pos+1]) ? 4 : 8));
|
||||
universal_char_type type =
|
||||
classify_universal_char(strtoul(uchar_val.c_str(), 0, 16));
|
||||
StringT uchar_val(name.substr(pos + 2, ('u' == name[pos + 1]) ? 4 : 8));
|
||||
universal_char_type type =
|
||||
classify_universal_char(strtoul(uchar_val.c_str(), 0, 16));
|
||||
|
||||
if (universal_char_type_valid != type) {
|
||||
// an invalid char was found, so throw an exception
|
||||
StringT error_uchar(name.substr(pos, ('u' == name[pos+1]) ? 6 : 10));
|
||||
// an invalid char was found, so throw an exception
|
||||
StringT error_uchar(name.substr(pos, ('u' == name[pos + 1]) ? 6 : 10));
|
||||
|
||||
if (universal_char_type_invalid == type) {
|
||||
BOOST_WAVE_LEXER_THROW(lexing_exception, universal_char_invalid,
|
||||
@@ -252,7 +252,7 @@ typename StringT::size_type pos = name.find_first_of('\\');
|
||||
}
|
||||
}
|
||||
|
||||
// find next universal char (if appropriate)
|
||||
// find next universal char (if appropriate)
|
||||
pos = name.find_first_of('\\', pos+2);
|
||||
}
|
||||
}
|
||||
@@ -277,20 +277,20 @@ validate_literal (StringT const &name, std::size_t line, std::size_t column,
|
||||
{
|
||||
using namespace std; // some systems have strtoul in namespace std::
|
||||
|
||||
typename StringT::size_type pos = name.find_first_of('\\');
|
||||
typename StringT::size_type pos = name.find_first_of('\\');
|
||||
|
||||
while (StringT::npos != pos) {
|
||||
// the literal contains a backslash (may be universal char)
|
||||
// the literal contains a backslash (may be universal char)
|
||||
if ('u' == name[pos+1] || 'U' == name[pos+1]) {
|
||||
StringT uchar_val(name.substr(pos+2, ('u' == name[pos+1]) ? 4 : 8));
|
||||
universal_char_type type =
|
||||
classify_universal_char(strtoul(uchar_val.c_str(), 0, 16));
|
||||
StringT uchar_val(name.substr(pos + 2, ('u' == name[pos + 1]) ? 4 : 8));
|
||||
universal_char_type type =
|
||||
classify_universal_char(strtoul(uchar_val.c_str(), 0, 16));
|
||||
|
||||
if (universal_char_type_valid != type &&
|
||||
universal_char_type_not_allowed_for_identifiers != type)
|
||||
{
|
||||
// an invalid char was found, so throw an exception
|
||||
StringT error_uchar(name.substr(pos, ('u' == name[pos+1]) ? 6 : 10));
|
||||
// an invalid char was found, so throw an exception
|
||||
StringT error_uchar(name.substr(pos, ('u' == name[pos + 1]) ? 6 : 10));
|
||||
|
||||
if (universal_char_type_invalid == type) {
|
||||
BOOST_WAVE_LEXER_THROW(lexing_exception, universal_char_invalid,
|
||||
@@ -303,7 +303,7 @@ typename StringT::size_type pos = name.find_first_of('\\');
|
||||
}
|
||||
}
|
||||
|
||||
// find next universal char (if appropriate)
|
||||
// find next universal char (if appropriate)
|
||||
pos = name.find_first_of('\\', pos+2);
|
||||
}
|
||||
}
|
||||
@@ -319,4 +319,4 @@ typename StringT::size_type pos = name.find_first_of('\\');
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(VALIDATE_UNIVERSAL_CHAR_HPP_55F1B811_CD76_4C72_8344_CBC69CF3B339_INCLUDED)
|
||||
#endif // !defined(BOOST_VALIDATE_UNIVERSAL_CHAR_HPP_55F1B811_CD76_4C72_8344_CBC69CF3B339_INCLUDED)
|
||||
|
||||
Reference in New Issue
Block a user