update boost
This commit is contained in:
@@ -4,26 +4,18 @@
|
||||
// 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(SPIRIT_ENDIAN_MAR_21_2009_0349PM)
|
||||
#define SPIRIT_ENDIAN_MAR_21_2009_0349PM
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_ENDIAN_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_ENDIAN_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/version.hpp>
|
||||
|
||||
// We need to treat the endian number types as PODs
|
||||
#if !defined(BOOST_ENDIAN_FORCE_PODNESS)
|
||||
#define BOOST_ENDIAN_FORCE_PODNESS 1
|
||||
#endif
|
||||
|
||||
// If Boost has the endian library, use it, otherwise use an adapted version
|
||||
// included with Spirit
|
||||
// #if BOOST_VERSION >= 105100
|
||||
// #include <boost/endian/integers.hpp>
|
||||
// #else
|
||||
#include <boost/spirit/home/support/detail/endian/endian.hpp>
|
||||
// #endif
|
||||
#include <boost/endian/arithmetic.hpp>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
// boost/integer/cover_operators.hpp ----------------------------------------//
|
||||
|
||||
// Copyright Darin Adler 2000
|
||||
// Copyright Beman Dawes 2008
|
||||
|
||||
// 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 the class being covered has a non-explicit conversion to an integer type
|
||||
// then a smaller number of cover operations are needed. Define the macro
|
||||
// BOOST_MINIMAL_INTEGER_COVER_OPERATORS to indicate this.
|
||||
|
||||
// Define BOOST_NO_IO_COVER_OPERATORS if I/O cover operations are not desired.
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_SPIRIT_INTEGER_COVER_OPERATORS_HPP
|
||||
#define BOOST_SPIRIT_INTEGER_COVER_OPERATORS_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
# ifndef BOOST_MINIMAL_INTEGER_COVER_OPERATORS
|
||||
# include <boost/operators.hpp>
|
||||
# endif
|
||||
|
||||
#include <iosfwd>
|
||||
|
||||
namespace boost { namespace spirit
|
||||
{
|
||||
namespace endian
|
||||
{
|
||||
|
||||
// A class that adds integer operators to an integer cover class
|
||||
|
||||
template <typename T, typename IntegerType>
|
||||
class cover_operators
|
||||
# ifndef BOOST_MINIMAL_INTEGER_COVER_OPERATORS
|
||||
: boost::operators<T>
|
||||
# endif
|
||||
{
|
||||
// The other operations take advantage of the type conversion that's
|
||||
// built into unary +.
|
||||
|
||||
// Unary operations.
|
||||
friend IntegerType operator+(const T& x) { return x; }
|
||||
# ifndef BOOST_MINIMAL_INTEGER_COVER_OPERATORS
|
||||
friend IntegerType operator-(const T& x) { return -+x; }
|
||||
friend IntegerType operator~(const T& x) { return ~+x; }
|
||||
friend IntegerType operator!(const T& x) { return !+x; }
|
||||
|
||||
// The basic ordering operations.
|
||||
friend bool operator==(const T& x, IntegerType y) { return +x == y; }
|
||||
friend bool operator<(const T& x, IntegerType y) { return +x < y; }
|
||||
# endif
|
||||
|
||||
// The basic arithmetic operations.
|
||||
friend T& operator+=(T& x, IntegerType y) { return x = +x + y; }
|
||||
friend T& operator-=(T& x, IntegerType y) { return x = +x - y; }
|
||||
friend T& operator*=(T& x, IntegerType y) { return x = +x * y; }
|
||||
friend T& operator/=(T& x, IntegerType y) { return x = +x / y; }
|
||||
friend T& operator%=(T& x, IntegerType y) { return x = +x % y; }
|
||||
friend T& operator&=(T& x, IntegerType y) { return x = +x & y; }
|
||||
friend T& operator|=(T& x, IntegerType y) { return x = +x | y; }
|
||||
friend T& operator^=(T& x, IntegerType y) { return x = +x ^ y; }
|
||||
friend T& operator<<=(T& x, IntegerType y) { return x = +x << y; }
|
||||
friend T& operator>>=(T& x, IntegerType y) { return x = +x >> y; }
|
||||
|
||||
// A few binary arithmetic operations not covered by operators base class.
|
||||
friend IntegerType operator<<(const T& x, IntegerType y) { return +x << y; }
|
||||
friend IntegerType operator>>(const T& x, IntegerType y) { return +x >> y; }
|
||||
|
||||
// Auto-increment and auto-decrement can be defined in terms of the
|
||||
// arithmetic operations.
|
||||
friend T& operator++(T& x) { return x += 1; }
|
||||
friend T& operator--(T& x) { return x -= 1; }
|
||||
|
||||
# ifdef BOOST_MINIMAL_INTEGER_COVER_OPERATORS
|
||||
friend T operator++(T& x, int)
|
||||
{
|
||||
T tmp(x);
|
||||
x += 1;
|
||||
return tmp;
|
||||
}
|
||||
friend T operator--(T& x, int)
|
||||
{
|
||||
T tmp(x);
|
||||
x -= 1;
|
||||
return tmp;
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifndef BOOST_NO_IO_COVER_OPERATORS
|
||||
// TODO: stream I/O needs to be templatized on the stream type, so will
|
||||
// work with wide streams, etc.
|
||||
|
||||
// Stream input and output.
|
||||
friend std::ostream& operator<<(std::ostream& s, const T& x)
|
||||
{ return s << +x; }
|
||||
friend std::istream& operator>>(std::istream& s, T& x)
|
||||
{
|
||||
IntegerType i;
|
||||
if (s >> i)
|
||||
x = i;
|
||||
return s;
|
||||
}
|
||||
# endif
|
||||
};
|
||||
} // namespace endian
|
||||
}} // namespace boost::spirit
|
||||
|
||||
#endif // BOOST_SPIRIT_INTEGER_COVER_OPERATORS_HPP
|
||||
@@ -1,566 +0,0 @@
|
||||
// Boost endian.hpp header file -------------------------------------------------------//
|
||||
|
||||
// (C) Copyright Darin Adler 2000
|
||||
// (C) Copyright Beman Dawes 2006, 2009
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
// See library home page at http://www.boost.org/libs/endian
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
// Original design developed by Darin Adler based on classes developed by Mark
|
||||
// Borgerding. Four original class templates were combined into a single endian
|
||||
// class template by Beman Dawes, who also added the unrolled_byte_loops sign
|
||||
// partial specialization to correctly extend the sign when cover integer size
|
||||
// differs from endian representation size.
|
||||
|
||||
// TODO: When a compiler supporting constexpr becomes available, try possible uses.
|
||||
|
||||
#ifndef BOOST_SPIRIT_ENDIAN_HPP
|
||||
#define BOOST_SPIRIT_ENDIAN_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_ENDIAN_LOG
|
||||
# include <iostream>
|
||||
#endif
|
||||
|
||||
#if defined(__BORLANDC__) || defined( __CODEGEARC__)
|
||||
# pragma pack(push, 1)
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/predef/other/endian.h>
|
||||
#ifndef BOOST_MINIMAL_INTEGER_COVER_OPERATORS
|
||||
#define BOOST_MINIMAL_INTEGER_COVER_OPERATORS
|
||||
#endif
|
||||
#ifndef BOOST_NO_IO_COVER_OPERATORS
|
||||
#define BOOST_NO_IO_COVER_OPERATORS
|
||||
#endif
|
||||
#include <boost/spirit/home/support/detail/endian/cover_operators.hpp>
|
||||
#undef BOOST_NO_IO_COVER_OPERATORS
|
||||
#undef BOOST_MINIMAL_INTEGER_COVER_OPERATORS
|
||||
#include <boost/type_traits/is_signed.hpp>
|
||||
#include <boost/type_traits/make_unsigned.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/spirit/home/support/detail/scoped_enum_emulation.hpp>
|
||||
#include <iosfwd>
|
||||
#include <climits>
|
||||
|
||||
# if CHAR_BIT != 8
|
||||
# error Platforms with CHAR_BIT != 8 are not supported
|
||||
# endif
|
||||
|
||||
# define BOOST_SPIRIT_ENDIAN_DEFAULT_CONSTRUCT {} // C++03
|
||||
|
||||
# if defined(BOOST_ENDIAN_NO_CTORS) || defined(BOOST_ENDIAN_FORCE_PODNESS)
|
||||
# define BOOST_SPIRIT_ENDIAN_NO_CTORS
|
||||
# endif
|
||||
|
||||
|
||||
namespace boost { namespace spirit
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
// Unrolled loops for loading and storing streams of bytes.
|
||||
|
||||
template <typename T, std::size_t n_bytes,
|
||||
bool sign=boost::is_signed<T>::value >
|
||||
struct unrolled_byte_loops
|
||||
{
|
||||
typedef unrolled_byte_loops<T, n_bytes - 1, sign> next;
|
||||
|
||||
static typename boost::make_unsigned<T>::type load_big(const unsigned char* bytes)
|
||||
{ return *(bytes - 1) | (next::load_big(bytes - 1) << 8); }
|
||||
static typename boost::make_unsigned<T>::type load_little(const unsigned char* bytes)
|
||||
{ return *bytes | (next::load_little(bytes + 1) << 8); }
|
||||
|
||||
static void store_big(char* bytes, T value)
|
||||
{
|
||||
*(bytes - 1) = static_cast<char>(value);
|
||||
next::store_big(bytes - 1, value >> 8);
|
||||
}
|
||||
static void store_little(char* bytes, T value)
|
||||
{
|
||||
*bytes = static_cast<char>(value);
|
||||
next::store_little(bytes + 1, value >> 8);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct unrolled_byte_loops<T, 1, false>
|
||||
{
|
||||
static T load_big(const unsigned char* bytes)
|
||||
{ return *(bytes - 1); }
|
||||
static T load_little(const unsigned char* bytes)
|
||||
{ return *bytes; }
|
||||
static void store_big(char* bytes, T value)
|
||||
{ *(bytes - 1) = static_cast<char>(value); }
|
||||
static void store_little(char* bytes, T value)
|
||||
{ *bytes = static_cast<char>(value); }
|
||||
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct unrolled_byte_loops<T, 1, true>
|
||||
{
|
||||
static typename boost::make_unsigned<T>::type load_big(const unsigned char* bytes)
|
||||
{ return *(bytes - 1); }
|
||||
static typename boost::make_unsigned<T>::type load_little(const unsigned char* bytes)
|
||||
{ return *bytes; }
|
||||
static void store_big(char* bytes, T value)
|
||||
{ *(bytes - 1) = static_cast<char>(value); }
|
||||
static void store_little(char* bytes, T value)
|
||||
{ *bytes = static_cast<char>(value); }
|
||||
};
|
||||
|
||||
template <typename T, std::size_t n_bytes>
|
||||
inline
|
||||
T load_big_endian(const void* bytes)
|
||||
{
|
||||
return static_cast<T>(unrolled_byte_loops<T, n_bytes>::load_big
|
||||
(static_cast<const unsigned char*>(bytes) + n_bytes));
|
||||
}
|
||||
|
||||
template <>
|
||||
inline
|
||||
float load_big_endian<float, 4>(const void* bytes)
|
||||
{
|
||||
const unsigned char *b = reinterpret_cast<const unsigned char *>(
|
||||
bytes);
|
||||
b += 3;
|
||||
|
||||
float value;
|
||||
unsigned char *v = reinterpret_cast<unsigned char *>(&value);
|
||||
|
||||
for(std::size_t i = 0; i < 4; ++i)
|
||||
{
|
||||
*v++ = *b--;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline
|
||||
double load_big_endian<double, 8>(const void* bytes)
|
||||
{
|
||||
const unsigned char *b = reinterpret_cast<const unsigned char *>(
|
||||
bytes);
|
||||
b += 7;
|
||||
|
||||
double value;
|
||||
unsigned char *v = reinterpret_cast<unsigned char *>(&value);
|
||||
|
||||
for(std::size_t i = 0; i < 8; ++i)
|
||||
{
|
||||
*v++ = *b--;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
template <typename T, std::size_t n_bytes>
|
||||
inline
|
||||
T load_little_endian(const void* bytes)
|
||||
{
|
||||
return static_cast<T>(unrolled_byte_loops<T, n_bytes>::load_little
|
||||
(static_cast<const unsigned char*>(bytes)));
|
||||
}
|
||||
|
||||
template <>
|
||||
inline
|
||||
float load_little_endian<float, 4>(const void* bytes)
|
||||
{
|
||||
const unsigned char *b = reinterpret_cast<const unsigned char *>(
|
||||
bytes);
|
||||
|
||||
float value;
|
||||
unsigned char *v = reinterpret_cast<unsigned char *>(&value);
|
||||
|
||||
for(std::size_t i = 0; i < 4; ++i)
|
||||
{
|
||||
*v++ = *b++;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline
|
||||
double load_little_endian<double, 8>(const void* bytes)
|
||||
{
|
||||
const unsigned char *b = reinterpret_cast<const unsigned char *>(
|
||||
bytes);
|
||||
|
||||
double value;
|
||||
unsigned char *v = reinterpret_cast<unsigned char *>(&value);
|
||||
|
||||
for(std::size_t i = 0; i < 8; ++i)
|
||||
{
|
||||
*v++ = *b++;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
template <typename T, std::size_t n_bytes>
|
||||
inline
|
||||
void store_big_endian(void* bytes, T value)
|
||||
{
|
||||
unrolled_byte_loops<T, n_bytes>::store_big
|
||||
(static_cast<char*>(bytes) + n_bytes, value);
|
||||
}
|
||||
|
||||
template <>
|
||||
inline
|
||||
void store_big_endian<float, 4>(void* bytes, float value)
|
||||
{
|
||||
unsigned char *b = reinterpret_cast<unsigned char *>(bytes);
|
||||
b += 3;
|
||||
|
||||
const unsigned char *v = reinterpret_cast<const unsigned char *>(
|
||||
&value);
|
||||
|
||||
for(std::size_t i = 0; i < 4; ++i)
|
||||
{
|
||||
*b-- = *v++;
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
inline
|
||||
void store_big_endian<double, 8>(void* bytes, double value)
|
||||
{
|
||||
unsigned char *b = reinterpret_cast<unsigned char *>(bytes);
|
||||
b += 7;
|
||||
|
||||
const unsigned char *v = reinterpret_cast<const unsigned char *>(
|
||||
&value);
|
||||
|
||||
for(std::size_t i = 0; i < 8; ++i)
|
||||
{
|
||||
*b-- = *v++;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T, std::size_t n_bytes>
|
||||
inline
|
||||
void store_little_endian(void* bytes, T value)
|
||||
{
|
||||
unrolled_byte_loops<T, n_bytes>::store_little
|
||||
(static_cast<char*>(bytes), value);
|
||||
}
|
||||
|
||||
template <>
|
||||
inline
|
||||
void store_little_endian<float, 4>(void* bytes, float value)
|
||||
{
|
||||
unsigned char *b = reinterpret_cast<unsigned char *>(bytes);
|
||||
|
||||
const unsigned char *v = reinterpret_cast<const unsigned char *>(
|
||||
&value);
|
||||
|
||||
for(std::size_t i = 0; i < 4; ++i)
|
||||
{
|
||||
*b++ = *v++;
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
inline
|
||||
void store_little_endian<double, 8>(void* bytes, double value)
|
||||
{
|
||||
unsigned char *b = reinterpret_cast<unsigned char *>(bytes);
|
||||
|
||||
const unsigned char *v = reinterpret_cast<const unsigned char *>(
|
||||
&value);
|
||||
|
||||
for(std::size_t i = 0; i < 8; ++i)
|
||||
{
|
||||
*b++ = *v++;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
namespace endian
|
||||
{
|
||||
|
||||
# ifdef BOOST_ENDIAN_LOG
|
||||
bool endian_log(true);
|
||||
# endif
|
||||
|
||||
|
||||
// endian class template and specializations ---------------------------------------//
|
||||
|
||||
BOOST_SCOPED_ENUM_START(endianness) { big, little, native }; BOOST_SCOPED_ENUM_END
|
||||
BOOST_SCOPED_ENUM_START(alignment) { unaligned, aligned }; BOOST_SCOPED_ENUM_END
|
||||
|
||||
template <BOOST_SCOPED_ENUM(endianness) E, typename T, std::size_t n_bits,
|
||||
BOOST_SCOPED_ENUM(alignment) A = alignment::unaligned>
|
||||
class endian;
|
||||
|
||||
// Specializations that represent unaligned bytes.
|
||||
// Taking an integer type as a parameter provides a nice way to pass both
|
||||
// the size and signedness of the desired integer and get the appropriate
|
||||
// corresponding integer type for the interface.
|
||||
|
||||
// unaligned big endian specialization
|
||||
template <typename T, std::size_t n_bits>
|
||||
class endian< endianness::big, T, n_bits, alignment::unaligned >
|
||||
: cover_operators< endian< endianness::big, T, n_bits >, T >
|
||||
{
|
||||
BOOST_STATIC_ASSERT( (n_bits/8)*8 == n_bits );
|
||||
public:
|
||||
typedef T value_type;
|
||||
# ifndef BOOST_SPIRIT_ENDIAN_NO_CTORS
|
||||
endian() BOOST_SPIRIT_ENDIAN_DEFAULT_CONSTRUCT
|
||||
explicit endian(T val)
|
||||
{
|
||||
# ifdef BOOST_ENDIAN_LOG
|
||||
if ( endian_log )
|
||||
std::clog << "big, unaligned, " << n_bits << "-bits, construct(" << val << ")\n";
|
||||
# endif
|
||||
detail::store_big_endian<T, n_bits/8>(m_value, val);
|
||||
}
|
||||
# endif
|
||||
endian & operator=(T val) { detail::store_big_endian<T, n_bits/8>(m_value, val); return *this; }
|
||||
operator T() const
|
||||
{
|
||||
# ifdef BOOST_ENDIAN_LOG
|
||||
if ( endian_log )
|
||||
std::clog << "big, unaligned, " << n_bits << "-bits, convert(" << detail::load_big_endian<T, n_bits/8>(m_value) << ")\n";
|
||||
# endif
|
||||
return detail::load_big_endian<T, n_bits/8>(m_value);
|
||||
}
|
||||
private:
|
||||
char m_value[n_bits/8];
|
||||
};
|
||||
|
||||
// unaligned little endian specialization
|
||||
template <typename T, std::size_t n_bits>
|
||||
class endian< endianness::little, T, n_bits, alignment::unaligned >
|
||||
: cover_operators< endian< endianness::little, T, n_bits >, T >
|
||||
{
|
||||
BOOST_STATIC_ASSERT( (n_bits/8)*8 == n_bits );
|
||||
public:
|
||||
typedef T value_type;
|
||||
# ifndef BOOST_SPIRIT_ENDIAN_NO_CTORS
|
||||
endian() BOOST_SPIRIT_ENDIAN_DEFAULT_CONSTRUCT
|
||||
explicit endian(T val)
|
||||
{
|
||||
# ifdef BOOST_ENDIAN_LOG
|
||||
if ( endian_log )
|
||||
std::clog << "little, unaligned, " << n_bits << "-bits, construct(" << val << ")\n";
|
||||
# endif
|
||||
detail::store_little_endian<T, n_bits/8>(m_value, val);
|
||||
}
|
||||
# endif
|
||||
endian & operator=(T val) { detail::store_little_endian<T, n_bits/8>(m_value, val); return *this; }
|
||||
operator T() const
|
||||
{
|
||||
# ifdef BOOST_ENDIAN_LOG
|
||||
if ( endian_log )
|
||||
std::clog << "little, unaligned, " << n_bits << "-bits, convert(" << detail::load_little_endian<T, n_bits/8>(m_value) << ")\n";
|
||||
# endif
|
||||
return detail::load_little_endian<T, n_bits/8>(m_value);
|
||||
}
|
||||
private:
|
||||
char m_value[n_bits/8];
|
||||
};
|
||||
|
||||
// unaligned native endian specialization
|
||||
template <typename T, std::size_t n_bits>
|
||||
class endian< endianness::native, T, n_bits, alignment::unaligned >
|
||||
: cover_operators< endian< endianness::native, T, n_bits >, T >
|
||||
{
|
||||
BOOST_STATIC_ASSERT( (n_bits/8)*8 == n_bits );
|
||||
public:
|
||||
typedef T value_type;
|
||||
# ifndef BOOST_SPIRIT_ENDIAN_NO_CTORS
|
||||
endian() BOOST_SPIRIT_ENDIAN_DEFAULT_CONSTRUCT
|
||||
# if BOOST_ENDIAN_BIG_BYTE
|
||||
explicit endian(T val) { detail::store_big_endian<T, n_bits/8>(m_value, val); }
|
||||
# else
|
||||
explicit endian(T val) { detail::store_little_endian<T, n_bits/8>(m_value, val); }
|
||||
# endif
|
||||
# endif
|
||||
# if BOOST_ENDIAN_BIG_BYTE
|
||||
endian & operator=(T val) { detail::store_big_endian<T, n_bits/8>(m_value, val); return *this; }
|
||||
operator T() const { return detail::load_big_endian<T, n_bits/8>(m_value); }
|
||||
# else
|
||||
endian & operator=(T val) { detail::store_little_endian<T, n_bits/8>(m_value, val); return *this; }
|
||||
operator T() const { return detail::load_little_endian<T, n_bits/8>(m_value); }
|
||||
# endif
|
||||
private:
|
||||
char m_value[n_bits/8];
|
||||
};
|
||||
|
||||
// Specializations that mimic built-in integer types.
|
||||
// These typically have the same alignment as the underlying types.
|
||||
|
||||
// aligned big endian specialization
|
||||
template <typename T, std::size_t n_bits>
|
||||
class endian< endianness::big, T, n_bits, alignment::aligned >
|
||||
: cover_operators< endian< endianness::big, T, n_bits, alignment::aligned >, T >
|
||||
{
|
||||
BOOST_STATIC_ASSERT( (n_bits/8)*8 == n_bits );
|
||||
BOOST_STATIC_ASSERT( sizeof(T) == n_bits/8 );
|
||||
public:
|
||||
typedef T value_type;
|
||||
# ifndef BOOST_SPIRIT_ENDIAN_NO_CTORS
|
||||
endian() BOOST_SPIRIT_ENDIAN_DEFAULT_CONSTRUCT
|
||||
# if BOOST_ENDIAN_BIG_BYTE
|
||||
endian(T val) : m_value(val) { }
|
||||
# else
|
||||
explicit endian(T val) { detail::store_big_endian<T, sizeof(T)>(&m_value, val); }
|
||||
# endif
|
||||
# endif
|
||||
# if BOOST_ENDIAN_BIG_BYTE
|
||||
endian & operator=(T val) { m_value = val; return *this; }
|
||||
operator T() const { return m_value; }
|
||||
# else
|
||||
endian & operator=(T val) { detail::store_big_endian<T, sizeof(T)>(&m_value, val); return *this; }
|
||||
operator T() const { return detail::load_big_endian<T, sizeof(T)>(&m_value); }
|
||||
# endif
|
||||
private:
|
||||
T m_value;
|
||||
};
|
||||
|
||||
// aligned little endian specialization
|
||||
template <typename T, std::size_t n_bits>
|
||||
class endian< endianness::little, T, n_bits, alignment::aligned >
|
||||
: cover_operators< endian< endianness::little, T, n_bits, alignment::aligned >, T >
|
||||
{
|
||||
BOOST_STATIC_ASSERT( (n_bits/8)*8 == n_bits );
|
||||
BOOST_STATIC_ASSERT( sizeof(T) == n_bits/8 );
|
||||
public:
|
||||
typedef T value_type;
|
||||
# ifndef BOOST_SPIRIT_ENDIAN_NO_CTORS
|
||||
endian() BOOST_SPIRIT_ENDIAN_DEFAULT_CONSTRUCT
|
||||
# if BOOST_ENDIAN_LITTLE_BYTE
|
||||
endian(T val) : m_value(val) { }
|
||||
# else
|
||||
explicit endian(T val) { detail::store_little_endian<T, sizeof(T)>(&m_value, val); }
|
||||
# endif
|
||||
# endif
|
||||
# if BOOST_ENDIAN_LITTLE_BYTE
|
||||
endian & operator=(T val) { m_value = val; return *this; }
|
||||
operator T() const { return m_value; }
|
||||
#else
|
||||
endian & operator=(T val) { detail::store_little_endian<T, sizeof(T)>(&m_value, val); return *this; }
|
||||
operator T() const { return detail::load_little_endian<T, sizeof(T)>(&m_value); }
|
||||
#endif
|
||||
private:
|
||||
T m_value;
|
||||
};
|
||||
|
||||
// naming convention typedefs ------------------------------------------------------//
|
||||
|
||||
// unaligned big endian signed integer types
|
||||
typedef endian< endianness::big, int_least8_t, 8 > big8_t;
|
||||
typedef endian< endianness::big, int_least16_t, 16 > big16_t;
|
||||
typedef endian< endianness::big, int_least32_t, 24 > big24_t;
|
||||
typedef endian< endianness::big, int_least32_t, 32 > big32_t;
|
||||
typedef endian< endianness::big, int_least64_t, 40 > big40_t;
|
||||
typedef endian< endianness::big, int_least64_t, 48 > big48_t;
|
||||
typedef endian< endianness::big, int_least64_t, 56 > big56_t;
|
||||
typedef endian< endianness::big, int_least64_t, 64 > big64_t;
|
||||
|
||||
// unaligned big endian unsigned integer types
|
||||
typedef endian< endianness::big, uint_least8_t, 8 > ubig8_t;
|
||||
typedef endian< endianness::big, uint_least16_t, 16 > ubig16_t;
|
||||
typedef endian< endianness::big, uint_least32_t, 24 > ubig24_t;
|
||||
typedef endian< endianness::big, uint_least32_t, 32 > ubig32_t;
|
||||
typedef endian< endianness::big, uint_least64_t, 40 > ubig40_t;
|
||||
typedef endian< endianness::big, uint_least64_t, 48 > ubig48_t;
|
||||
typedef endian< endianness::big, uint_least64_t, 56 > ubig56_t;
|
||||
typedef endian< endianness::big, uint_least64_t, 64 > ubig64_t;
|
||||
|
||||
// unaligned little endian signed integer types
|
||||
typedef endian< endianness::little, int_least8_t, 8 > little8_t;
|
||||
typedef endian< endianness::little, int_least16_t, 16 > little16_t;
|
||||
typedef endian< endianness::little, int_least32_t, 24 > little24_t;
|
||||
typedef endian< endianness::little, int_least32_t, 32 > little32_t;
|
||||
typedef endian< endianness::little, int_least64_t, 40 > little40_t;
|
||||
typedef endian< endianness::little, int_least64_t, 48 > little48_t;
|
||||
typedef endian< endianness::little, int_least64_t, 56 > little56_t;
|
||||
typedef endian< endianness::little, int_least64_t, 64 > little64_t;
|
||||
|
||||
// unaligned little endian unsigned integer types
|
||||
typedef endian< endianness::little, uint_least8_t, 8 > ulittle8_t;
|
||||
typedef endian< endianness::little, uint_least16_t, 16 > ulittle16_t;
|
||||
typedef endian< endianness::little, uint_least32_t, 24 > ulittle24_t;
|
||||
typedef endian< endianness::little, uint_least32_t, 32 > ulittle32_t;
|
||||
typedef endian< endianness::little, uint_least64_t, 40 > ulittle40_t;
|
||||
typedef endian< endianness::little, uint_least64_t, 48 > ulittle48_t;
|
||||
typedef endian< endianness::little, uint_least64_t, 56 > ulittle56_t;
|
||||
typedef endian< endianness::little, uint_least64_t, 64 > ulittle64_t;
|
||||
|
||||
// unaligned native endian signed integer types
|
||||
typedef endian< endianness::native, int_least8_t, 8 > native8_t;
|
||||
typedef endian< endianness::native, int_least16_t, 16 > native16_t;
|
||||
typedef endian< endianness::native, int_least32_t, 24 > native24_t;
|
||||
typedef endian< endianness::native, int_least32_t, 32 > native32_t;
|
||||
typedef endian< endianness::native, int_least64_t, 40 > native40_t;
|
||||
typedef endian< endianness::native, int_least64_t, 48 > native48_t;
|
||||
typedef endian< endianness::native, int_least64_t, 56 > native56_t;
|
||||
typedef endian< endianness::native, int_least64_t, 64 > native64_t;
|
||||
|
||||
// unaligned native endian unsigned integer types
|
||||
typedef endian< endianness::native, uint_least8_t, 8 > unative8_t;
|
||||
typedef endian< endianness::native, uint_least16_t, 16 > unative16_t;
|
||||
typedef endian< endianness::native, uint_least32_t, 24 > unative24_t;
|
||||
typedef endian< endianness::native, uint_least32_t, 32 > unative32_t;
|
||||
typedef endian< endianness::native, uint_least64_t, 40 > unative40_t;
|
||||
typedef endian< endianness::native, uint_least64_t, 48 > unative48_t;
|
||||
typedef endian< endianness::native, uint_least64_t, 56 > unative56_t;
|
||||
typedef endian< endianness::native, uint_least64_t, 64 > unative64_t;
|
||||
|
||||
// These types only present if platform has exact size integers:
|
||||
// aligned big endian signed integer types
|
||||
// aligned big endian unsigned integer types
|
||||
// aligned little endian signed integer types
|
||||
// aligned little endian unsigned integer types
|
||||
|
||||
// aligned native endian typedefs are not provided because
|
||||
// <cstdint> types are superior for this use case
|
||||
|
||||
#ifdef INT16_MAX
|
||||
typedef endian< endianness::big, int16_t, 16, alignment::aligned > aligned_big16_t;
|
||||
typedef endian< endianness::big, uint16_t, 16, alignment::aligned > aligned_ubig16_t;
|
||||
typedef endian< endianness::little, int16_t, 16, alignment::aligned > aligned_little16_t;
|
||||
typedef endian< endianness::little, uint16_t, 16, alignment::aligned > aligned_ulittle16_t;
|
||||
#endif
|
||||
|
||||
#ifdef INT32_MAX
|
||||
typedef endian< endianness::big, int32_t, 32, alignment::aligned > aligned_big32_t;
|
||||
typedef endian< endianness::big, uint32_t, 32, alignment::aligned > aligned_ubig32_t;
|
||||
typedef endian< endianness::little, int32_t, 32, alignment::aligned > aligned_little32_t;
|
||||
typedef endian< endianness::little, uint32_t, 32, alignment::aligned > aligned_ulittle32_t;
|
||||
#endif
|
||||
|
||||
#ifdef INT64_MAX
|
||||
typedef endian< endianness::big, int64_t, 64, alignment::aligned > aligned_big64_t;
|
||||
typedef endian< endianness::big, uint64_t, 64, alignment::aligned > aligned_ubig64_t;
|
||||
typedef endian< endianness::little, int64_t, 64, alignment::aligned > aligned_little64_t;
|
||||
typedef endian< endianness::little, uint64_t, 64, alignment::aligned > aligned_ulittle64_t;
|
||||
#endif
|
||||
|
||||
} // namespace endian
|
||||
}} // namespace boost::spirit
|
||||
|
||||
#undef BOOST_SPIRIT_ENDIAN_DEFAULT_CONSTRUCT
|
||||
#undef BOOST_SPIRIT_ENDIAN_NO_CTORS
|
||||
|
||||
#if defined(__BORLANDC__) || defined( __CODEGEARC__)
|
||||
# pragma pack(pop)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_SPIRIT_ENDIAN_HPP
|
||||
@@ -25,12 +25,12 @@
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/detail/sp_typeinfo.hpp>
|
||||
#include <boost/core/typeinfo.hpp>
|
||||
|
||||
#include <stdexcept>
|
||||
#include <typeinfo>
|
||||
#include <algorithm>
|
||||
#include <iosfwd>
|
||||
#include <stdexcept>
|
||||
#include <typeinfo>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
|
||||
@@ -45,11 +45,14 @@ namespace boost { namespace spirit
|
||||
struct bad_any_cast
|
||||
: std::bad_cast
|
||||
{
|
||||
bad_any_cast(boost::detail::sp_typeinfo const& src, boost::detail::sp_typeinfo const& dest)
|
||||
bad_any_cast(boost::core::typeinfo const& src, boost::core::typeinfo const& dest)
|
||||
: from(src.name()), to(dest.name())
|
||||
{}
|
||||
|
||||
virtual const char* what() const BOOST_NOEXCEPT_OR_NOTHROW { return "bad any cast"; }
|
||||
const char* what() const BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE
|
||||
{
|
||||
return "bad any cast";
|
||||
}
|
||||
|
||||
const char* from;
|
||||
const char* to;
|
||||
@@ -61,7 +64,7 @@ namespace boost { namespace spirit
|
||||
template <typename Char>
|
||||
struct fxn_ptr_table
|
||||
{
|
||||
boost::detail::sp_typeinfo const& (*get_type)();
|
||||
boost::core::typeinfo const& (*get_type)();
|
||||
void (*static_delete)(void**);
|
||||
void (*destruct)(void**);
|
||||
void (*clone)(void* const*, void**);
|
||||
@@ -80,9 +83,9 @@ namespace boost { namespace spirit
|
||||
template<typename T, typename Char>
|
||||
struct type
|
||||
{
|
||||
static boost::detail::sp_typeinfo const& get_type()
|
||||
static boost::core::typeinfo const& get_type()
|
||||
{
|
||||
return BOOST_SP_TYPEID(T);
|
||||
return BOOST_CORE_TYPEID(T);
|
||||
}
|
||||
static void static_delete(void** x)
|
||||
{
|
||||
@@ -123,39 +126,39 @@ namespace boost { namespace spirit
|
||||
template<typename T, typename Char>
|
||||
struct type
|
||||
{
|
||||
static boost::detail::sp_typeinfo const& get_type()
|
||||
static boost::core::typeinfo const& get_type()
|
||||
{
|
||||
return BOOST_SP_TYPEID(T);
|
||||
return BOOST_CORE_TYPEID(T);
|
||||
}
|
||||
static void static_delete(void** x)
|
||||
{
|
||||
// destruct and free memory
|
||||
delete (*reinterpret_cast<T**>(x));
|
||||
delete static_cast<T*>(*x);
|
||||
}
|
||||
static void destruct(void** x)
|
||||
{
|
||||
// destruct only, we'll reuse memory
|
||||
(*reinterpret_cast<T**>(x))->~T();
|
||||
static_cast<T*>(*x)->~T();
|
||||
}
|
||||
static void clone(void* const* src, void** dest)
|
||||
{
|
||||
*dest = new T(**reinterpret_cast<T* const*>(src));
|
||||
*dest = new T(*static_cast<T const*>(*src));
|
||||
}
|
||||
static void move(void* const* src, void** dest)
|
||||
{
|
||||
**reinterpret_cast<T**>(dest) =
|
||||
**reinterpret_cast<T* const*>(src);
|
||||
*static_cast<T*>(*dest) =
|
||||
*static_cast<T const*>(*src);
|
||||
}
|
||||
static std::basic_istream<Char>&
|
||||
stream_in(std::basic_istream<Char>& i, void** obj)
|
||||
{
|
||||
i >> **reinterpret_cast<T**>(obj);
|
||||
i >> *static_cast<T*>(*obj);
|
||||
return i;
|
||||
}
|
||||
static std::basic_ostream<Char>&
|
||||
stream_out(std::basic_ostream<Char>& o, void* const* obj)
|
||||
{
|
||||
o << **reinterpret_cast<T* const*>(obj);
|
||||
o << *static_cast<T const*>(*obj);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
@@ -341,7 +344,7 @@ namespace boost { namespace spirit
|
||||
return *this;
|
||||
}
|
||||
|
||||
boost::detail::sp_typeinfo const& type() const
|
||||
boost::core::typeinfo const& type() const
|
||||
{
|
||||
return table->get_type();
|
||||
}
|
||||
@@ -349,8 +352,8 @@ namespace boost { namespace spirit
|
||||
template <typename T>
|
||||
T const& cast() const
|
||||
{
|
||||
if (type() != BOOST_SP_TYPEID(T))
|
||||
throw bad_any_cast(type(), BOOST_SP_TYPEID(T));
|
||||
if (type() != BOOST_CORE_TYPEID(T))
|
||||
throw bad_any_cast(type(), BOOST_CORE_TYPEID(T));
|
||||
|
||||
return spirit::detail::get_table<T>::is_small::value ?
|
||||
*reinterpret_cast<T const*>(&object) :
|
||||
@@ -413,7 +416,7 @@ namespace boost { namespace spirit
|
||||
template <typename T, typename Char>
|
||||
inline T* any_cast (basic_hold_any<Char>* operand)
|
||||
{
|
||||
if (operand && operand->type() == BOOST_SP_TYPEID(T)) {
|
||||
if (operand && operand->type() == BOOST_CORE_TYPEID(T)) {
|
||||
return spirit::detail::get_table<T>::is_small::value ?
|
||||
reinterpret_cast<T*>(&operand->object) :
|
||||
reinterpret_cast<T*>(operand->object);
|
||||
@@ -435,7 +438,7 @@ namespace boost { namespace spirit
|
||||
|
||||
nonref* result = any_cast<nonref>(&operand);
|
||||
if(!result)
|
||||
boost::throw_exception(bad_any_cast(operand.type(), BOOST_SP_TYPEID(T)));
|
||||
boost::throw_exception(bad_any_cast(operand.type(), BOOST_CORE_TYPEID(T)));
|
||||
return *result;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_CHAR_TRAITS_H
|
||||
#define BOOST_LEXER_CHAR_TRAITS_H
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_CHAR_TRAITS_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_CHAR_TRAITS_HPP
|
||||
|
||||
// Make sure wchar_t is defined
|
||||
#include <string>
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_CONSTS_H
|
||||
#define BOOST_LEXER_CONSTS_H
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_CONSTS_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_CONSTS_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/integer_traits.hpp>
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_PTR_LIST_HPP
|
||||
#define BOOST_LEXER_PTR_LIST_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_CONTAINERS_PTR_LIST_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_CONTAINERS_PTR_LIST_HPP
|
||||
|
||||
#include <list>
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_PTR_VECTOR_HPP
|
||||
#define BOOST_LEXER_PTR_VECTOR_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_CONTAINERS_PTR_VECTOR_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_CONTAINERS_PTR_VECTOR_HPP
|
||||
|
||||
#include "../size_t.hpp"
|
||||
#include <vector>
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_CHAR_STATE_MACHINE_HPP
|
||||
#define BOOST_LEXER_CHAR_STATE_MACHINE_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_CONVERSION_CHAR_STATE_MACHINE_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_CONVERSION_CHAR_STATE_MACHINE_HPP
|
||||
|
||||
#include "../consts.hpp"
|
||||
#include <map>
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_DEBUG_HPP
|
||||
#define BOOST_LEXER_DEBUG_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_DEBUG_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_DEBUG_HPP
|
||||
|
||||
#include <map>
|
||||
#include <ostream>
|
||||
#include "rules.hpp"
|
||||
#include "size_t.hpp"
|
||||
#include "state_machine.hpp"
|
||||
#include "string_token.hpp"
|
||||
#include <ios>
|
||||
#include <vector>
|
||||
|
||||
namespace boost
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_FILE_INPUT
|
||||
#define BOOST_LEXER_FILE_INPUT
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_FILE_INPUT_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_FILE_INPUT_HPP
|
||||
|
||||
#include "char_traits.hpp"
|
||||
// memcpy
|
||||
#include <cstring>
|
||||
#include <fstream>
|
||||
#include "size_t.hpp"
|
||||
#include "state_machine.hpp"
|
||||
#include <iosfwd>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
@@ -130,7 +130,7 @@ public:
|
||||
|
||||
friend class iterator;
|
||||
|
||||
// Make it explict that we are NOT taking a copy of state_machine_!
|
||||
// Make it explicit that we are NOT taking a copy of state_machine_!
|
||||
basic_file_input (const basic_state_machine<CharT> *state_machine_,
|
||||
std::basic_ifstream<CharT> *is_,
|
||||
const std::streamsize buffer_size_ = 4096,
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_GENERATE_CPP_HPP
|
||||
#define BOOST_LEXER_GENERATE_CPP_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_GENERATE_CPP_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_GENERATE_CPP_HPP
|
||||
|
||||
#include "char_traits.hpp"
|
||||
#include "consts.hpp"
|
||||
#include "internals.hpp"
|
||||
#include <iostream>
|
||||
#include "runtime_error.hpp"
|
||||
#include "size_t.hpp"
|
||||
#include "state_machine.hpp"
|
||||
#include <iosfwd>
|
||||
#include <vector>
|
||||
|
||||
namespace boost
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef LEXERTL_GENERATE_RE2C_HPP
|
||||
#define LEXERTL_GENERATE_RE2C_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_GENERATE_RE2C_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_GENERATE_RE2C_HPP
|
||||
|
||||
#include "char_traits.hpp"
|
||||
#include "consts.hpp"
|
||||
#include "internals.hpp"
|
||||
#include <iostream>
|
||||
#include "runtime_error.hpp"
|
||||
#include "size_t.hpp"
|
||||
#include "state_machine.hpp"
|
||||
#include <iosfwd>
|
||||
#include <vector>
|
||||
|
||||
namespace boost
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_GENERATOR_HPP
|
||||
#define BOOST_LEXER_GENERATOR_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_GENERATOR_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_GENERATOR_HPP
|
||||
|
||||
#include "char_traits.hpp"
|
||||
// memcmp()
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_INPUT
|
||||
#define BOOST_LEXER_INPUT
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_INPUT_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_INPUT_HPP
|
||||
|
||||
#include "char_traits.hpp"
|
||||
#include "size_t.hpp"
|
||||
@@ -479,7 +479,7 @@ public:
|
||||
|
||||
friend class iterator;
|
||||
|
||||
// Make it explict that we are NOT taking a copy of state_machine_!
|
||||
// Make it explicit that we are NOT taking a copy of state_machine_!
|
||||
basic_input (const basic_state_machine<typename Traits::char_type>
|
||||
*state_machine_, const FwdIter &begin_, const FwdIter &end_) :
|
||||
_state_machine (state_machine_),
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_INTERNALS_HPP
|
||||
#define BOOST_LEXER_INTERNALS_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_INTERNALS_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_INTERNALS_HPP
|
||||
|
||||
#include "containers/ptr_vector.hpp"
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_PARSER_HPP
|
||||
#define BOOST_LEXER_PARSER_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARSER_PARSER_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARSER_PARSER_HPP
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include "tree/end_node.hpp"
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "tree/sequence_node.hpp"
|
||||
#include "../size_t.hpp"
|
||||
#include "tokeniser/re_tokeniser.hpp"
|
||||
#include <sstream>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_NUM_TOKEN_HPP
|
||||
#define BOOST_LEXER_NUM_TOKEN_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARSER_TOKENISER_NUM_TOKEN_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARSER_TOKENISER_NUM_TOKEN_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include "../../consts.hpp" // null_token
|
||||
@@ -45,30 +45,6 @@ struct basic_num_token
|
||||
*_macro = 0;
|
||||
}
|
||||
|
||||
basic_num_token &operator = (const basic_num_token &rhs_)
|
||||
{
|
||||
_type = rhs_._type;
|
||||
_id = rhs_._id;
|
||||
_min = rhs_._min;
|
||||
_comma = rhs_._comma;
|
||||
_max = rhs_._max;
|
||||
|
||||
if (_type == MACRO)
|
||||
{
|
||||
const CharT *read_ = rhs_._macro;
|
||||
CharT *write_ = _macro;
|
||||
|
||||
while (*read_)
|
||||
{
|
||||
*write_++ = *read_++;
|
||||
}
|
||||
|
||||
*write_ = 0;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
void set (const type type_)
|
||||
{
|
||||
_type = type_;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_RE_TOKENISER_HPP
|
||||
#define BOOST_LEXER_RE_TOKENISER_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARSER_TOKENISER_RE_TOKENISER_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARSER_TOKENISER_RE_TOKENISER_HPP
|
||||
|
||||
// memcpy()
|
||||
#include <cstring>
|
||||
|
||||
@@ -3,14 +3,15 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_RE_TOKENISER_HELPER_H
|
||||
#define BOOST_LEXER_RE_TOKENISER_HELPER_H
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARSER_TOKENISER_RE_TOKENISER_HELPER_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARSER_TOKENISER_RE_TOKENISER_HELPER_HPP
|
||||
|
||||
#include "../../char_traits.hpp"
|
||||
// strlen()
|
||||
#include <cstring>
|
||||
#include "../../size_t.hpp"
|
||||
#include "re_tokeniser_state.hpp"
|
||||
#include <sstream>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
@@ -523,21 +524,21 @@ private:
|
||||
|
||||
for (; start_ <= end_; ++start_)
|
||||
{
|
||||
CharT ch_ = static_cast<CharT> (start_);
|
||||
CharT ch_i = static_cast<CharT> (start_);
|
||||
|
||||
if ((state_._flags & icase) &&
|
||||
(std::isupper (ch_, state_._locale) ||
|
||||
std::islower (ch_, state_._locale)))
|
||||
(std::isupper (ch_i, state_._locale) ||
|
||||
std::islower (ch_i, state_._locale)))
|
||||
{
|
||||
CharT upper_ = std::toupper (ch_, state_._locale);
|
||||
CharT lower_ = std::tolower (ch_, state_._locale);
|
||||
CharT upper_ = std::toupper (ch_i, state_._locale);
|
||||
CharT lower_ = std::tolower (ch_i, state_._locale);
|
||||
|
||||
chars_ += (upper_);
|
||||
chars_ += (lower_);
|
||||
}
|
||||
else
|
||||
{
|
||||
chars_ += (ch_);
|
||||
chars_ += (ch_i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_RE_TOKENISER_STATE_HPP
|
||||
#define BOOST_LEXER_RE_TOKENISER_STATE_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARSER_TOKENISER_RE_TOKENISER_STATE_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARSER_TOKENISER_RE_TOKENISER_STATE_HPP
|
||||
|
||||
#include "../../consts.hpp"
|
||||
#include <locale>
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_END_NODE_HPP
|
||||
#define BOOST_LEXER_END_NODE_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARSER_TREE_END_NODE_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARSER_TREE_END_NODE_HPP
|
||||
|
||||
#include "node.hpp"
|
||||
#include "../../size_t.hpp"
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_ITERATION_NODE_HPP
|
||||
#define BOOST_LEXER_ITERATION_NODE_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARSER_TREE_ITERATION_NODE_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARSER_TREE_ITERATION_NODE_HPP
|
||||
|
||||
#include "node.hpp"
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_LEAF_NODE_HPP
|
||||
#define BOOST_LEXER_LEAF_NODE_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARSER_TREE_LEAF_NODE_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARSER_TREE_LEAF_NODE_HPP
|
||||
|
||||
#include "../../consts.hpp" // null_token
|
||||
#include "node.hpp"
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_NODE_HPP
|
||||
#define BOOST_LEXER_NODE_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARSER_TREE_NODE_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARSER_TREE_NODE_HPP
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include "../../containers/ptr_vector.hpp"
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_SELECTION_NODE_HPP
|
||||
#define BOOST_LEXER_SELECTION_NODE_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARSER_TREE_SELECTION_NODE_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARSER_TREE_SELECTION_NODE_HPP
|
||||
|
||||
#include "node.hpp"
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_SEQUENCE_NODE_HPP
|
||||
#define BOOST_LEXER_SEQUENCE_NODE_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARSER_TREE_SEQUENCE_NODE_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARSER_TREE_SEQUENCE_NODE_HPP
|
||||
|
||||
#include "node.hpp"
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_CHARSET_HPP
|
||||
#define BOOST_LEXER_CHARSET_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARTITION_CHARSET_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARTITION_CHARSET_HPP
|
||||
|
||||
#include <set>
|
||||
#include "../size_t.hpp"
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_EQUIVSET_HPP
|
||||
#define BOOST_LEXER_EQUIVSET_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARTITION_EQUIVSET_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_PARTITION_EQUIVSET_HPP
|
||||
|
||||
#include <algorithm>
|
||||
#include "../parser/tree/node.hpp"
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_RULES_HPP
|
||||
#define BOOST_LEXER_RULES_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_RULES_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_RULES_HPP
|
||||
|
||||
#include "consts.hpp"
|
||||
#include <deque>
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_RUNTIME_ERROR_HPP
|
||||
#define BOOST_LEXER_RUNTIME_ERROR_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_RUNTIME_ERROR_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_RUNTIME_ERROR_HPP
|
||||
|
||||
#include <boost/config.hpp> // for BOOST_SYMBOL_VISIBLE
|
||||
#include <stdexcept>
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_SIZE_T_H
|
||||
#define BOOST_LEXER_SIZE_T_H
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_SIZE_T_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_SIZE_T_HPP
|
||||
|
||||
#include <stddef.h> // ptrdiff_t
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_STATE_MACHINE_HPP
|
||||
#define BOOST_LEXER_STATE_MACHINE_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_STATE_MACHINE_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_STATE_MACHINE_HPP
|
||||
|
||||
#include <algorithm>
|
||||
#include "conversion/char_state_machine.hpp"
|
||||
|
||||
@@ -3,12 +3,13 @@
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_LEXER_STRING_TOKEN_HPP
|
||||
#define BOOST_LEXER_STRING_TOKEN_HPP
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_STRING_TOKEN_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_LEXER_STRING_TOKEN_HPP
|
||||
|
||||
#include <algorithm>
|
||||
#include "size_t.hpp"
|
||||
#include "consts.hpp" // num_chars, num_wchar_ts
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <limits>
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/spirit/include/phoenix_limits.hpp> // needs to be included before proto
|
||||
#include <boost/proto/proto.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/fusion/include/cons.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
@@ -4,12 +4,8 @@
|
||||
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)
|
||||
==============================================================================*/
|
||||
#include <boost/version.hpp>
|
||||
|
||||
// This is the same as the one in fusion in Boost 1.41. This is provided
|
||||
// for compatibility with Boost 1.40 and below.
|
||||
|
||||
#if (BOOST_VERSION > 104000)
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_MAKE_VECTOR_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_MAKE_VECTOR_HPP
|
||||
|
||||
#include <boost/fusion/include/make_vector.hpp>
|
||||
|
||||
@@ -22,93 +18,4 @@ namespace boost { namespace spirit { namespace detail
|
||||
using fusion::make_vector;
|
||||
}}}
|
||||
|
||||
#else
|
||||
|
||||
#ifndef BOOST_PP_IS_ITERATING
|
||||
#if !defined(SPIRIT_MAKE_VECTOR_07162005_0243)
|
||||
#define SPIRIT_MAKE_VECTOR_07162005_0243
|
||||
|
||||
#include <boost/preprocessor/iterate.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/support/detail/as_fusion_element.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct void_;
|
||||
}}
|
||||
|
||||
namespace boost { namespace spirit { namespace detail
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template <
|
||||
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
|
||||
FUSION_MAX_VECTOR_SIZE, typename T, fusion::void_)
|
||||
, typename Extra = fusion::void_
|
||||
>
|
||||
struct make_vector;
|
||||
|
||||
template <>
|
||||
struct make_vector<>
|
||||
{
|
||||
typedef fusion::vector0 type;
|
||||
};
|
||||
}
|
||||
|
||||
inline fusion::vector0
|
||||
make_vector()
|
||||
{
|
||||
return fusion::vector0();
|
||||
}
|
||||
|
||||
#define BOOST_FUSION_AS_FUSION_ELEMENT(z, n, data) \
|
||||
typename fusion::detail::as_fusion_element<BOOST_PP_CAT(T, n)>::type
|
||||
|
||||
#define BOOST_PP_FILENAME_1 <boost/spirit/home/support/detail/make_vector.hpp>
|
||||
#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_VECTOR_SIZE)
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#undef BOOST_FUSION_AS_FUSION_ELEMENT
|
||||
|
||||
}}}
|
||||
|
||||
#endif
|
||||
#else // defined(BOOST_PP_IS_ITERATING)
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Preprocessor vertical repetition code
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define N BOOST_PP_ITERATION()
|
||||
|
||||
namespace result_of
|
||||
{
|
||||
template <BOOST_PP_ENUM_PARAMS(N, typename T)>
|
||||
#if defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS)
|
||||
#define TEXT(z, n, text) , text
|
||||
struct make_vector< BOOST_PP_ENUM_PARAMS(N, T) BOOST_PP_REPEAT_FROM_TO(BOOST_PP_DEC(N), FUSION_MAX_VECTOR_SIZE, TEXT, fusion::void_) >
|
||||
#undef TEXT
|
||||
#else
|
||||
struct make_vector<BOOST_PP_ENUM_PARAMS(N, T)>
|
||||
#endif
|
||||
{
|
||||
typedef BOOST_PP_CAT(fusion::vector, N)<BOOST_PP_ENUM(N, BOOST_FUSION_AS_FUSION_ELEMENT, _)> type;
|
||||
};
|
||||
}
|
||||
|
||||
template <BOOST_PP_ENUM_PARAMS(N, typename T)>
|
||||
inline BOOST_PP_CAT(fusion::vector, N)<BOOST_PP_ENUM(N, BOOST_FUSION_AS_FUSION_ELEMENT, _)>
|
||||
make_vector(BOOST_PP_ENUM_BINARY_PARAMS(N, T, const& _))
|
||||
{
|
||||
return BOOST_PP_CAT(fusion::vector, N)<BOOST_PP_ENUM(N, BOOST_FUSION_AS_FUSION_ELEMENT, _)>(
|
||||
BOOST_PP_ENUM_PARAMS(N, _));
|
||||
}
|
||||
|
||||
#undef N
|
||||
#endif // defined(BOOST_PP_IS_ITERATING)
|
||||
#endif // (BOOST_VERSION > 103800)
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
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(SPIRIT_POW10_DECEMBER_26_2008_1118AM)
|
||||
#define SPIRIT_POW10_DECEMBER_26_2008_1118AM
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_POW10_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_POW10_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
|
||||
@@ -14,7 +14,9 @@
|
||||
#include <boost/version.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if BOOST_VERSION >= 104000
|
||||
#if BOOST_VERSION >= 105600
|
||||
# include <boost/core/scoped_enum.hpp>
|
||||
#elif BOOST_VERSION >= 104000
|
||||
# include <boost/detail/scoped_enum_emulation.hpp>
|
||||
#else
|
||||
# if !defined(BOOST_NO_CXX11_SCOPED_ENUMS)
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2001-2011 Hartmut Kaiser
|
||||
http://spirit.sourceforge.net/
|
||||
|
||||
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(SPIRIT_SIGN_MAR_11_2009_0734PM)
|
||||
#define SPIRIT_SIGN_MAR_11_2009_0734PM
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/math/special_functions/sign.hpp>
|
||||
|
||||
namespace boost { namespace spirit { namespace detail
|
||||
{
|
||||
template<typename T>
|
||||
inline bool (signbit)(T x)
|
||||
{
|
||||
return (boost::math::signbit)(x) ? true : false;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline T (changesign)(T x)
|
||||
{
|
||||
return (boost::math::changesign)(x);
|
||||
}
|
||||
|
||||
}}}
|
||||
|
||||
#endif
|
||||
@@ -4,8 +4,8 @@
|
||||
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(SPIRIT_WHAT_FUNCTION_APRIL_22_2007_0236PM)
|
||||
#define SPIRIT_WHAT_FUNCTION_APRIL_22_2007_0236PM
|
||||
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_WHAT_FUNCTION_HPP
|
||||
#define BOOST_SPIRIT_SUPPORT_DETAIL_WHAT_FUNCTION_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
@@ -17,6 +17,10 @@
|
||||
|
||||
namespace boost { namespace spirit { namespace detail
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4512) // assignment operator could not be generated.
|
||||
#endif
|
||||
template <typename Context>
|
||||
struct what_function
|
||||
{
|
||||
@@ -30,7 +34,7 @@ namespace boost { namespace spirit { namespace detail
|
||||
void operator()(Component const& component) const
|
||||
{
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
|
||||
component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
|
||||
(void)component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
|
||||
#endif
|
||||
boost::get<std::list<info> >(what.value).
|
||||
push_back(component.what(context));
|
||||
@@ -38,11 +42,10 @@ namespace boost { namespace spirit { namespace detail
|
||||
|
||||
info& what;
|
||||
Context& context;
|
||||
|
||||
private:
|
||||
// silence MSVC warning C4512: assignment operator could not be generated
|
||||
what_function& operator= (what_function const&);
|
||||
};
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
}}}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user