mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-06 15:37:52 +00:00
Added thirdparty: boost library
This commit is contained in:
+35
@@ -0,0 +1,35 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_FIRST_OF_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_FIRST_OF_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2009 - 2010.
|
||||
// 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/metaparse/v1/cpp98/nth_of_c.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <
|
||||
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
|
||||
BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE,
|
||||
class P,
|
||||
boost::mpl::na
|
||||
)
|
||||
>
|
||||
struct first_of :
|
||||
nth_of_c<
|
||||
0,
|
||||
BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE, P)
|
||||
>
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_FWD_STRING_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_FWD_STRING_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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/metaparse/limit_string_size.hpp>
|
||||
#include <boost/metaparse/v1/impl/no_char.hpp>
|
||||
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <
|
||||
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
|
||||
BOOST_METAPARSE_LIMIT_STRING_SIZE,
|
||||
int C,
|
||||
BOOST_NO_CHAR
|
||||
)
|
||||
>
|
||||
struct string;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_IMPL_AT_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_IMPL_AT_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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/metaparse/config.hpp>
|
||||
#include <boost/metaparse/v1/cpp98/fwd/string.hpp>
|
||||
|
||||
#include <boost/mpl/char.hpp>
|
||||
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S, int N>
|
||||
struct at_c;
|
||||
|
||||
#ifdef BOOST_METAPARSE_STRING_CASE
|
||||
# error BOOST_METAPARSE_STRING_CASE is already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_STRING_CASE(z, n, unused) \
|
||||
template < \
|
||||
BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, int C) \
|
||||
> \
|
||||
struct \
|
||||
at_c< \
|
||||
string< \
|
||||
BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, C) \
|
||||
>, \
|
||||
n \
|
||||
> : \
|
||||
boost::mpl::char_<BOOST_PP_CAT(C, n)> \
|
||||
{};
|
||||
|
||||
BOOST_PP_REPEAT(
|
||||
BOOST_METAPARSE_LIMIT_STRING_SIZE,
|
||||
BOOST_METAPARSE_STRING_CASE,
|
||||
~
|
||||
)
|
||||
|
||||
#undef BOOST_METAPARSE_STRING_CASE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_IMPL_EMPTY_STRING_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_IMPL_EMPTY_STRING_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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)
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class Ignore = int>
|
||||
struct empty_string
|
||||
{
|
||||
typedef empty_string type;
|
||||
|
||||
static const char value[1];
|
||||
};
|
||||
|
||||
template <class Ignore>
|
||||
const char empty_string<Ignore>::value[1] = {0};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_IMPL_IS_NONE_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_IMPL_IS_NONE_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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/metaparse/limit_one_char_except_size.hpp>
|
||||
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class Stub = int>
|
||||
struct is_none0
|
||||
{
|
||||
template <class C>
|
||||
struct apply : boost::mpl::true_ {};
|
||||
};
|
||||
|
||||
#ifdef BOOST_METAPARSE_DEFINE_IS_NONE
|
||||
# error BOOST_METAPARSE_DEFINE_IS_NONE already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_DEFINE_IS_NONE(z, n, unused) \
|
||||
template <BOOST_PP_ENUM_PARAMS(n, class T)> \
|
||||
struct BOOST_PP_CAT(is_none, n) \
|
||||
{ \
|
||||
template <class C> \
|
||||
struct apply : \
|
||||
boost::mpl::eval_if< \
|
||||
boost::mpl::bool_< \
|
||||
C::type::value \
|
||||
== BOOST_PP_CAT(T, BOOST_PP_DEC(n))::type::value \
|
||||
>, \
|
||||
boost::mpl::false_, \
|
||||
typename BOOST_PP_CAT(is_none, BOOST_PP_DEC(n))< \
|
||||
BOOST_PP_ENUM_PARAMS(BOOST_PP_DEC(n), T) \
|
||||
>::template apply<C> \
|
||||
> \
|
||||
{}; \
|
||||
};
|
||||
|
||||
BOOST_PP_REPEAT_FROM_TO(
|
||||
1,
|
||||
BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE,
|
||||
BOOST_METAPARSE_DEFINE_IS_NONE,
|
||||
~
|
||||
)
|
||||
|
||||
#undef BOOST_METAPARSE_DEFINE_IS_NONE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_IMPL_LATER_RESULT_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_IMPL_LATER_RESULT_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2015.
|
||||
// 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/metaparse/v1/get_position.hpp>
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/less.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class R1, class R2>
|
||||
struct later_result :
|
||||
boost::mpl::if_<
|
||||
typename boost::mpl::less<
|
||||
typename get_position<R2>::type,
|
||||
typename get_position<R1>::type
|
||||
>::type,
|
||||
R1,
|
||||
R2
|
||||
>
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_IMPL_NTH_OF_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_IMPL_NTH_OF_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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/metaparse/v1/cpp98/impl/nth_of_c_impl.hpp>
|
||||
#include <boost/metaparse/v1/error/index_out_of_range.hpp>
|
||||
#include <boost/metaparse/v1/fail.hpp>
|
||||
#include <boost/metaparse/limit_sequence_size.hpp>
|
||||
|
||||
#include <boost/mpl/list.hpp>
|
||||
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
#ifdef BOOST_METAPARSE_NTH_OF_CASE
|
||||
# error BOOST_METAPARSE_NTH_OF_CASE already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_NTH_OF_CASE(z, n, unused) \
|
||||
template < \
|
||||
int K BOOST_PP_COMMA_IF(n) \
|
||||
BOOST_PP_ENUM_PARAMS(n, class P) \
|
||||
> \
|
||||
struct BOOST_PP_CAT(nth_of_c, n) : \
|
||||
boost::mpl::if_< \
|
||||
boost::mpl::bool_<(0 <= K && K < n)>, \
|
||||
nth_of_c_impl< \
|
||||
K, \
|
||||
boost::mpl::list<BOOST_PP_ENUM_PARAMS(n, P)> \
|
||||
>, \
|
||||
fail<error::index_out_of_range<0, n - 1, K> > \
|
||||
>::type \
|
||||
{};
|
||||
|
||||
BOOST_PP_REPEAT(
|
||||
BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE,
|
||||
BOOST_METAPARSE_NTH_OF_CASE,
|
||||
~
|
||||
)
|
||||
|
||||
#undef BOOST_METAPARSE_NTH_OF_CASE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_IMPL_NTH_OF_C_IMPL_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_IMPL_NTH_OF_C_IMPL_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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/metaparse/v1/cpp98/impl/skip_seq.hpp>
|
||||
|
||||
#include <boost/mpl/front.hpp>
|
||||
#include <boost/mpl/pop_front.hpp>
|
||||
#include <boost/mpl/fold.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <int N, class Seq>
|
||||
struct nth_of_c_impl
|
||||
{
|
||||
private:
|
||||
template <class NextResult>
|
||||
struct apply_unchecked :
|
||||
nth_of_c_impl<
|
||||
N - 1,
|
||||
typename boost::mpl::pop_front<Seq>::type
|
||||
>::template apply<
|
||||
typename get_remaining<NextResult>::type,
|
||||
typename get_position<NextResult>::type
|
||||
>
|
||||
{};
|
||||
public:
|
||||
typedef nth_of_c_impl type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
boost::mpl::eval_if<
|
||||
typename is_error<
|
||||
typename boost::mpl::front<Seq>::type::template apply<S, Pos>
|
||||
>::type,
|
||||
typename boost::mpl::front<Seq>::type::template apply<S, Pos>,
|
||||
apply_unchecked<
|
||||
typename boost::mpl::front<Seq>::type::template apply<S, Pos>
|
||||
>
|
||||
>
|
||||
{};
|
||||
};
|
||||
|
||||
template <class Seq>
|
||||
struct nth_of_c_impl<0, Seq>
|
||||
{
|
||||
typedef nth_of_c_impl type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
boost::mpl::fold<
|
||||
typename boost::mpl::pop_front<Seq>::type,
|
||||
typename boost::mpl::front<Seq>::type::template apply<
|
||||
S,
|
||||
Pos
|
||||
>::type,
|
||||
skip_seq
|
||||
>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_IMPL_ONE_CHAR_EXCEPT_NOT_USED_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_IMPL_ONE_CHAR_EXCEPT_NOT_USED_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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)
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
struct one_char_except_not_used {};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
#ifndef BOOST_METAPARSE_V1_IMPL_ONE_OF_HPP
|
||||
#define BOOST_METAPARSE_V1_IMPL_ONE_OF_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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/metaparse/v1/error/none_of_the_expected_cases_found.hpp>
|
||||
#include <boost/metaparse/v1/fail.hpp>
|
||||
|
||||
#include <boost/metaparse/v1/cpp98/impl/one_of_fwd_op.hpp>
|
||||
|
||||
#include <boost/mpl/fold.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class Parsers>
|
||||
struct one_of
|
||||
{
|
||||
typedef one_of type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
boost::mpl::fold<
|
||||
Parsers,
|
||||
fail<error::none_of_the_expected_cases_found>::apply<S, Pos>,
|
||||
one_of_fwd_op<S, Pos>
|
||||
>::type
|
||||
{};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
#ifndef BOOST_METAPARSE_V1_IMPL_ONE_OF_FWD_OP_HPP
|
||||
#define BOOST_METAPARSE_V1_IMPL_ONE_OF_FWD_OP_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2015.
|
||||
// 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/metaparse/v1/is_error.hpp>
|
||||
#include <boost/metaparse/v1/cpp98/impl/later_result.hpp>
|
||||
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S, class Pos>
|
||||
struct one_of_fwd_op
|
||||
{
|
||||
typedef one_of_fwd_op type;
|
||||
|
||||
template <class State, class P>
|
||||
struct apply :
|
||||
boost::mpl::eval_if<
|
||||
typename is_error<State>::type,
|
||||
boost::mpl::eval_if<
|
||||
typename is_error<typename P::template apply<S, Pos> >::type,
|
||||
later_result<State, typename P::template apply<S, Pos> >,
|
||||
typename P::template apply<S, Pos>
|
||||
>,
|
||||
State
|
||||
>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_IMPL_POP_BACK_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_IMPL_POP_BACK_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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/metaparse/v1/cpp98/fwd/string.hpp>
|
||||
#include <boost/metaparse/v1/cpp98/impl/push_front_c.hpp>
|
||||
#include <boost/metaparse/v1/cpp98/impl/size.hpp>
|
||||
#include <boost/metaparse/v1/cpp98/impl/update_c.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S>
|
||||
struct pop_back;
|
||||
|
||||
template <class S>
|
||||
struct pop_back :
|
||||
update_c<
|
||||
typename S::type,
|
||||
size<typename S::type>::type::value - 1,
|
||||
BOOST_NO_CHAR
|
||||
>
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_IMPL_POP_FRONT_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_IMPL_POP_FRONT_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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/metaparse/v1/cpp98/fwd/string.hpp>
|
||||
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S>
|
||||
struct pop_front;
|
||||
|
||||
#ifdef BOOST_METAPARSE_POP_FRONT
|
||||
# error BOOST_METAPARSE_POP_FRONT already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_POP_FRONT(z, n, unused) \
|
||||
BOOST_PP_COMMA_IF(BOOST_PP_DEC(n)) BOOST_PP_CAT(C, n)
|
||||
|
||||
template < \
|
||||
BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, int C) \
|
||||
>
|
||||
struct
|
||||
pop_front<
|
||||
string<BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, C)>
|
||||
> :
|
||||
string<
|
||||
BOOST_PP_REPEAT_FROM_TO(
|
||||
1,
|
||||
BOOST_METAPARSE_LIMIT_STRING_SIZE,
|
||||
BOOST_METAPARSE_POP_FRONT,
|
||||
~
|
||||
),
|
||||
BOOST_NO_CHAR
|
||||
>
|
||||
{};
|
||||
|
||||
#undef BOOST_METAPARSE_POP_FRONT
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_IMPL_PUSH_BACK_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_IMPL_PUSH_BACK_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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/metaparse/v1/cpp98/fwd/string.hpp>
|
||||
#include <boost/metaparse/v1/cpp98/impl/update_c.hpp>
|
||||
#include <boost/metaparse/v1/cpp98/impl/size.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S, char C>
|
||||
struct push_back_c;
|
||||
|
||||
template <class S, char C>
|
||||
struct push_back_c :
|
||||
update_c<typename S::type, size<typename S::type>::type::value, C>
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_IMPL_PUSH_FRONT_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_IMPL_PUSH_FRONT_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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/metaparse/v1/cpp98/fwd/string.hpp>
|
||||
|
||||
#include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S, char C>
|
||||
struct push_front_c;
|
||||
|
||||
template <
|
||||
BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, int C),
|
||||
char Ch
|
||||
>
|
||||
struct push_front_c<
|
||||
string<BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, C)>,
|
||||
Ch
|
||||
> :
|
||||
string<
|
||||
Ch,
|
||||
BOOST_PP_ENUM_PARAMS(
|
||||
BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_STRING_SIZE),
|
||||
C
|
||||
)
|
||||
>
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_IMPL_SEQUENCE_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_IMPL_SEQUENCE_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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/metaparse/v1/cpp98/impl/sequence_impl.hpp>
|
||||
#include <boost/metaparse/limit_sequence_size.hpp>
|
||||
|
||||
#include <boost/mpl/vector.hpp>
|
||||
|
||||
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
#ifdef BOOST_METAPARSE_SEQUENCE_CASE
|
||||
# error BOOST_METAPARSE_SEQUENCE_CASE already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_SEQUENCE_CASE(z, n, unused) \
|
||||
template <BOOST_PP_ENUM_PARAMS(n, class P)> \
|
||||
struct BOOST_PP_CAT(sequence, n) \
|
||||
{ \
|
||||
typedef BOOST_PP_CAT(sequence, n) type; \
|
||||
\
|
||||
template <class S, class Pos> \
|
||||
struct apply : \
|
||||
sequence_impl< \
|
||||
boost::mpl::vector<BOOST_PP_ENUM_PARAMS(n, P)>, \
|
||||
S, \
|
||||
Pos \
|
||||
> \
|
||||
{}; \
|
||||
};
|
||||
|
||||
BOOST_PP_REPEAT_FROM_TO(
|
||||
1,
|
||||
BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE,
|
||||
BOOST_METAPARSE_SEQUENCE_CASE,
|
||||
~
|
||||
)
|
||||
|
||||
#undef BOOST_METAPARSE_SEQUENCE_CASE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_IMPL_SEQUENCE_IMPL_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_IMPL_SEQUENCE_IMPL_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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/metaparse/v1/impl/apply_parser.hpp>
|
||||
#include <boost/metaparse/v1/accept.hpp>
|
||||
|
||||
#include <boost/mpl/deque.hpp>
|
||||
#include <boost/mpl/fold.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class Ps, class S, class Pos>
|
||||
struct sequence_impl :
|
||||
boost::mpl::fold<
|
||||
Ps,
|
||||
accept<boost::mpl::deque<>, S, Pos>,
|
||||
apply_parser
|
||||
>
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_IMPL_SIZE_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_IMPL_SIZE_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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/metaparse/v1/cpp98/fwd/string.hpp>
|
||||
|
||||
#include <boost/mpl/int.hpp>
|
||||
|
||||
#include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/tuple/eat.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S>
|
||||
struct size;
|
||||
|
||||
#ifdef BOOST_METAPARSE_STRING_CASE
|
||||
# error BOOST_METAPARSE_STRING_CASE
|
||||
#endif
|
||||
#define BOOST_METAPARSE_STRING_CASE(z, n, unused) \
|
||||
template <BOOST_PP_ENUM_PARAMS(n, int C)> \
|
||||
struct \
|
||||
size< \
|
||||
string< \
|
||||
BOOST_PP_ENUM_PARAMS(n, C) BOOST_PP_COMMA_IF(n) \
|
||||
BOOST_PP_ENUM( \
|
||||
BOOST_PP_SUB(BOOST_METAPARSE_LIMIT_STRING_SIZE, n), \
|
||||
BOOST_NO_CHAR BOOST_PP_TUPLE_EAT(3), \
|
||||
~ \
|
||||
) \
|
||||
> \
|
||||
> : \
|
||||
boost::mpl::int_<n> \
|
||||
{};
|
||||
|
||||
BOOST_PP_REPEAT(
|
||||
BOOST_METAPARSE_LIMIT_STRING_SIZE,
|
||||
BOOST_METAPARSE_STRING_CASE,
|
||||
~
|
||||
)
|
||||
|
||||
#undef BOOST_METAPARSE_STRING_CASE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_IMPL_SKIP_SEQ_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_IMPL_SKIP_SEQ_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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/metaparse/v1/is_error.hpp>
|
||||
#include <boost/metaparse/v1/accept.hpp>
|
||||
#include <boost/metaparse/v1/get_remaining.hpp>
|
||||
#include <boost/metaparse/v1/get_position.hpp>
|
||||
#include <boost/metaparse/v1/get_result.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
struct skip_seq
|
||||
{
|
||||
private:
|
||||
template <class ParsingResult, class NewResultValue>
|
||||
struct change_result :
|
||||
accept<
|
||||
NewResultValue,
|
||||
typename get_remaining<ParsingResult>::type,
|
||||
typename get_position<ParsingResult>::type
|
||||
>
|
||||
{};
|
||||
|
||||
template <class Result, class P>
|
||||
struct apply_unchecked :
|
||||
boost::mpl::eval_if<
|
||||
typename is_error<
|
||||
typename P::template apply<
|
||||
typename get_remaining<Result>::type,
|
||||
typename get_position<Result>::type
|
||||
>
|
||||
>::type,
|
||||
typename P::template apply<
|
||||
typename get_remaining<Result>::type,
|
||||
typename get_position<Result>::type
|
||||
>,
|
||||
change_result<
|
||||
typename P::template apply<
|
||||
typename get_remaining<Result>::type,
|
||||
typename get_position<Result>::type
|
||||
>,
|
||||
typename get_result<Result>::type
|
||||
>
|
||||
>
|
||||
{};
|
||||
|
||||
public:
|
||||
template <class Result, class P>
|
||||
struct apply :
|
||||
boost::mpl::eval_if<
|
||||
is_error<Result>,
|
||||
Result,
|
||||
apply_unchecked<Result, P>
|
||||
>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_IMPL_UPDATE_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_IMPL_UPDATE_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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/metaparse/v1/cpp98/fwd/string.hpp>
|
||||
|
||||
#include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
#include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S, int N, int C>
|
||||
struct update_c;
|
||||
|
||||
#ifdef BOOST_METAPARSE_ARGN
|
||||
# error BOOST_METAPARSE_ARGN already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_ARGN(z, n, unused) , BOOST_PP_CAT(C, n)
|
||||
|
||||
#ifdef BOOST_METAPARSE_UPDATE
|
||||
# error BOOST_METAPARSE_UPDATE already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_UPDATE(z, n, unused) \
|
||||
template < \
|
||||
BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, int C), \
|
||||
int Ch \
|
||||
> \
|
||||
struct update_c< \
|
||||
string<BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, C)>,\
|
||||
n, \
|
||||
Ch \
|
||||
> : \
|
||||
string< \
|
||||
BOOST_PP_ENUM_PARAMS(n, C) BOOST_PP_COMMA_IF(n) \
|
||||
Ch \
|
||||
BOOST_PP_REPEAT_FROM_TO( \
|
||||
BOOST_PP_INC(n), \
|
||||
BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_STRING_SIZE), \
|
||||
BOOST_METAPARSE_ARGN, \
|
||||
~ \
|
||||
) \
|
||||
> \
|
||||
{};
|
||||
|
||||
BOOST_PP_REPEAT(
|
||||
BOOST_METAPARSE_LIMIT_STRING_SIZE,
|
||||
BOOST_METAPARSE_UPDATE,
|
||||
~
|
||||
)
|
||||
|
||||
#undef BOOST_METAPARSE_UPDATE
|
||||
#undef BOOST_METAPARSE_ARGN
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_LAST_OF_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_LAST_OF_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2009 - 2010.
|
||||
// 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/metaparse/v1/cpp98/nth_of_c.hpp>
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
#include <boost/preprocessor/tuple/eat.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <
|
||||
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
|
||||
BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE,
|
||||
class P,
|
||||
boost::mpl::na
|
||||
)
|
||||
>
|
||||
struct last_of;
|
||||
|
||||
#ifdef BOOST_METAPARSE_LAST_OF_N
|
||||
# error BOOST_METAPARSE_LAST_OF_N already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_LAST_OF_N(z, n, unused) \
|
||||
template <BOOST_PP_ENUM_PARAMS(n, class P)> \
|
||||
struct last_of< \
|
||||
BOOST_PP_ENUM_PARAMS(n, P) \
|
||||
BOOST_PP_COMMA_IF(n) \
|
||||
BOOST_PP_ENUM( \
|
||||
BOOST_PP_SUB(BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE, n), \
|
||||
boost::mpl::na BOOST_PP_TUPLE_EAT(3), \
|
||||
~ \
|
||||
) \
|
||||
> : \
|
||||
impl::BOOST_PP_CAT(nth_of_c, n)< \
|
||||
n - 1 BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, P) \
|
||||
> \
|
||||
{};
|
||||
|
||||
BOOST_PP_REPEAT(
|
||||
BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE,
|
||||
BOOST_METAPARSE_LAST_OF_N,
|
||||
~
|
||||
)
|
||||
|
||||
#undef BOOST_METAPARSE_LAST_OF_N
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_NTH_OF_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_NTH_OF_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2010.
|
||||
// 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/metaparse/v1/nth_of_c.hpp>
|
||||
#include <boost/metaparse/limit_sequence_size.hpp>
|
||||
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <
|
||||
class K,
|
||||
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
|
||||
BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE,
|
||||
class P,
|
||||
boost::mpl::na
|
||||
)
|
||||
>
|
||||
struct nth_of :
|
||||
nth_of_c<
|
||||
K::type::value,
|
||||
BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE, P)
|
||||
>
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_NTH_OF_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_NTH_OF_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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/metaparse/v1/cpp98/impl/nth_of_c.hpp>
|
||||
#include <boost/metaparse/limit_sequence_size.hpp>
|
||||
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
#include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/tuple/eat.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <
|
||||
int N,
|
||||
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
|
||||
BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE,
|
||||
class P,
|
||||
boost::mpl::na
|
||||
)
|
||||
>
|
||||
struct nth_of_c;
|
||||
|
||||
#ifdef BOOST_METAPARSE_NTH_OF_N
|
||||
# error BOOST_METAPARSE_NTH_OF_N already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_NTH_OF_N(z, n, unused) \
|
||||
template <int K BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, class P)> \
|
||||
struct nth_of_c< \
|
||||
K, \
|
||||
BOOST_PP_ENUM_PARAMS(n, P) \
|
||||
BOOST_PP_COMMA_IF(n) \
|
||||
BOOST_PP_ENUM( \
|
||||
BOOST_PP_SUB(BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE, n), \
|
||||
boost::mpl::na BOOST_PP_TUPLE_EAT(3), \
|
||||
~ \
|
||||
) \
|
||||
> : \
|
||||
impl::BOOST_PP_CAT(nth_of_c, n)< \
|
||||
K BOOST_PP_COMMA_IF(n) \
|
||||
BOOST_PP_ENUM_PARAMS(n, P) \
|
||||
> \
|
||||
{};
|
||||
|
||||
BOOST_PP_REPEAT(
|
||||
BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE,
|
||||
BOOST_METAPARSE_NTH_OF_N,
|
||||
~
|
||||
)
|
||||
|
||||
#undef BOOST_METAPARSE_NTH_OF_N
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_ONE_CHAR_EXCEPT_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_ONE_CHAR_EXCEPT_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2011.
|
||||
// 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/metaparse/v1/error/unexpected_character.hpp>
|
||||
#include <boost/metaparse/v1/cpp98/impl/is_none.hpp>
|
||||
#include <boost/metaparse/v1/cpp98/impl/one_char_except_not_used.hpp>
|
||||
#include <boost/metaparse/v1/one_char.hpp>
|
||||
#include <boost/metaparse/v1/accept_when.hpp>
|
||||
#include <boost/metaparse/limit_one_char_except_size.hpp>
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
#include <boost/preprocessor/arithmetic/mul.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
#include <boost/preprocessor/tuple/eat.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <
|
||||
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
|
||||
BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE,
|
||||
class C,
|
||||
impl::one_char_except_not_used
|
||||
)
|
||||
>
|
||||
struct one_char_except;
|
||||
|
||||
#ifdef MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE
|
||||
# error MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE already defined
|
||||
#endif
|
||||
#define MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE(z, n, unused) \
|
||||
template <BOOST_PP_ENUM_PARAMS(n, class T)> \
|
||||
struct one_char_except< \
|
||||
BOOST_PP_ENUM_PARAMS(n, T) \
|
||||
BOOST_PP_COMMA_IF( \
|
||||
BOOST_PP_MUL( \
|
||||
n, \
|
||||
BOOST_PP_SUB( \
|
||||
BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE), \
|
||||
n \
|
||||
) \
|
||||
) \
|
||||
) \
|
||||
BOOST_PP_ENUM( \
|
||||
BOOST_PP_SUB( \
|
||||
BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE), \
|
||||
n \
|
||||
), \
|
||||
impl::one_char_except_not_used BOOST_PP_TUPLE_EAT(3), \
|
||||
~ \
|
||||
) \
|
||||
> :\
|
||||
accept_when< \
|
||||
one_char, \
|
||||
impl::BOOST_PP_CAT(is_none, n)<BOOST_PP_ENUM_PARAMS(n, T)>, \
|
||||
error::unexpected_character \
|
||||
> \
|
||||
{};
|
||||
|
||||
BOOST_PP_REPEAT(
|
||||
BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE,
|
||||
MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE,
|
||||
~
|
||||
)
|
||||
|
||||
#undef MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_ONE_CHAR_EXCEPT_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_ONE_CHAR_EXCEPT_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2011.
|
||||
// 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/metaparse/limit_one_char_except_size.hpp>
|
||||
#include <boost/metaparse/v1/error/unexpected_character.hpp>
|
||||
#include <boost/metaparse/v1/cpp98/impl/is_none.hpp>
|
||||
#include <boost/metaparse/v1/accept_when.hpp>
|
||||
#include <boost/metaparse/v1/one_char.hpp>
|
||||
|
||||
#include <boost/mpl/char.hpp>
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
#include <boost/preprocessor/arithmetic/mul.hpp>
|
||||
#include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
#include <boost/preprocessor/tuple/eat.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <
|
||||
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
|
||||
BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE,
|
||||
int C,
|
||||
1024
|
||||
)
|
||||
>
|
||||
struct one_char_except_c;
|
||||
|
||||
#ifdef BOOST_METAPARSE_WRAP
|
||||
# error BOOST_METAPARSE_WRAP already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_WRAP(z, n, unused) \
|
||||
boost::mpl::char_<BOOST_PP_CAT(C, n)>
|
||||
|
||||
#ifdef MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE
|
||||
# error MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE already defined
|
||||
#endif
|
||||
#define MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE(z, n, unused) \
|
||||
template <BOOST_PP_ENUM_PARAMS(n, int C)> \
|
||||
struct one_char_except_c< \
|
||||
BOOST_PP_ENUM_PARAMS(n, C) \
|
||||
BOOST_PP_COMMA_IF( \
|
||||
BOOST_PP_MUL( \
|
||||
n, \
|
||||
BOOST_PP_SUB( \
|
||||
BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE), \
|
||||
n \
|
||||
)\
|
||||
) \
|
||||
) \
|
||||
BOOST_PP_ENUM( \
|
||||
BOOST_PP_SUB( \
|
||||
BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE), \
|
||||
n \
|
||||
), \
|
||||
1024 BOOST_PP_TUPLE_EAT(3), \
|
||||
~ \
|
||||
) \
|
||||
> : \
|
||||
accept_when< \
|
||||
one_char, \
|
||||
impl::BOOST_PP_CAT(is_none, n)< \
|
||||
BOOST_PP_ENUM(n, BOOST_METAPARSE_WRAP, ~) \
|
||||
>, \
|
||||
error::unexpected_character \
|
||||
> \
|
||||
{};
|
||||
|
||||
BOOST_PP_REPEAT(
|
||||
BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE,
|
||||
MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE,
|
||||
~
|
||||
)
|
||||
|
||||
#undef MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE
|
||||
#undef BOOST_METAPARSE_WRAP
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_ONE_OF_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_ONE_OF_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2009 - 2010.
|
||||
// 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/metaparse/v1/cpp98/impl/one_of.hpp>
|
||||
#include <boost/metaparse/limit_one_of_size.hpp>
|
||||
|
||||
#include <boost/mpl/vector.hpp>
|
||||
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <
|
||||
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
|
||||
BOOST_METAPARSE_LIMIT_ONE_OF_SIZE,
|
||||
class P,
|
||||
boost::mpl::na
|
||||
)
|
||||
>
|
||||
struct one_of :
|
||||
impl::one_of<
|
||||
boost::mpl::vector<
|
||||
BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_ONE_OF_SIZE, P)
|
||||
>
|
||||
>
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_ONE_OF_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_ONE_OF_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
|
||||
// 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/metaparse/v1/one_of.hpp>
|
||||
#include <boost/metaparse/v1/lit_c.hpp>
|
||||
#include <boost/metaparse/limit_one_of_size.hpp>
|
||||
|
||||
#include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/tuple/eat.hpp>
|
||||
|
||||
#include <climits>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
#ifdef BOOST_NO_SCALAR_VALUE
|
||||
# error BOOST_NO_SCALAR_VALUE already defined
|
||||
#endif
|
||||
#define BOOST_NO_SCALAR_VALUE LONG_MAX
|
||||
|
||||
template <
|
||||
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
|
||||
BOOST_METAPARSE_LIMIT_ONE_OF_SIZE,
|
||||
long C,
|
||||
BOOST_NO_SCALAR_VALUE
|
||||
)
|
||||
>
|
||||
struct one_of_c;
|
||||
|
||||
#ifdef BOOST_METAPARSE_ONE_OF_C_LIT
|
||||
# error BOOST_METAPARSE_ONE_OF_C_LIT already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_ONE_OF_C_LIT(z, n, unused) lit_c<BOOST_PP_CAT(C, n)>
|
||||
|
||||
#ifdef BOOST_METAPARSE_ONE_OF_C_CASE
|
||||
# error BOOST_METAPARSE_ONE_OF_C_CASE already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_ONE_OF_C_CASE(z, n, unused) \
|
||||
template <BOOST_PP_ENUM_PARAMS(n, long C)> \
|
||||
struct \
|
||||
one_of_c< \
|
||||
BOOST_PP_ENUM_PARAMS(n, C) \
|
||||
BOOST_PP_COMMA_IF(n) \
|
||||
BOOST_PP_ENUM( \
|
||||
BOOST_PP_SUB(BOOST_METAPARSE_LIMIT_ONE_OF_SIZE, n), \
|
||||
BOOST_NO_SCALAR_VALUE BOOST_PP_TUPLE_EAT(3), \
|
||||
~ \
|
||||
) \
|
||||
> : \
|
||||
one_of< BOOST_PP_ENUM(n, BOOST_METAPARSE_ONE_OF_C_LIT, ~) > \
|
||||
{};
|
||||
|
||||
BOOST_PP_REPEAT(
|
||||
BOOST_METAPARSE_LIMIT_ONE_OF_SIZE,
|
||||
BOOST_METAPARSE_ONE_OF_C_CASE,
|
||||
~
|
||||
)
|
||||
|
||||
#undef BOOST_METAPARSE_ONE_OF_C_CASE
|
||||
#undef BOOST_METAPARSE_ONE_OF_C_LIT
|
||||
#undef BOOST_NO_SCALAR_VALUE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_REPEATED_ONE_OF_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_REPEATED_ONE_OF_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2010.
|
||||
// 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/metaparse/limit_one_of_size.hpp>
|
||||
#include <boost/metaparse/v1/cpp98/impl/one_of.hpp>
|
||||
#include <boost/metaparse/v1/repeated.hpp>
|
||||
|
||||
#include <boost/mpl/vector.hpp>
|
||||
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <
|
||||
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
|
||||
BOOST_METAPARSE_LIMIT_ONE_OF_SIZE,
|
||||
class P,
|
||||
boost::mpl::na
|
||||
)
|
||||
>
|
||||
struct repeated_one_of :
|
||||
repeated<
|
||||
impl::one_of<
|
||||
boost::mpl::vector<
|
||||
BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_ONE_OF_SIZE, P)
|
||||
>
|
||||
>
|
||||
>
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_REPEATED_ONE_OF1_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_REPEATED_ONE_OF1_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2010.
|
||||
// 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/metaparse/limit_one_of_size.hpp>
|
||||
#include <boost/metaparse/v1/cpp98/impl/one_of.hpp>
|
||||
#include <boost/metaparse/v1/repeated1.hpp>
|
||||
|
||||
#include <boost/mpl/vector.hpp>
|
||||
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <
|
||||
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
|
||||
BOOST_METAPARSE_LIMIT_ONE_OF_SIZE,
|
||||
class P,
|
||||
boost::mpl::na
|
||||
)
|
||||
>
|
||||
struct repeated_one_of1 :
|
||||
repeated1<
|
||||
impl::one_of<
|
||||
boost::mpl::vector<
|
||||
BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_ONE_OF_SIZE, P)
|
||||
>
|
||||
>
|
||||
>
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_SEQUENCE_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_SEQUENCE_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2009 - 2010.
|
||||
// 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/metaparse/v1/cpp98/impl/sequence.hpp>
|
||||
|
||||
#include <boost/preprocessor/comma_if.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
#include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/tuple/eat.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <
|
||||
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
|
||||
BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE,
|
||||
class P,
|
||||
boost::mpl::na
|
||||
)
|
||||
>
|
||||
struct sequence;
|
||||
|
||||
#ifdef BOOST_METAPARSE_SEQUENCE_N
|
||||
# error BOOST_METAPARSE_SEQUENCE_N already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_SEQUENCE_N(z, n, unused) \
|
||||
template <BOOST_PP_ENUM_PARAMS(n, class P)> \
|
||||
struct sequence< \
|
||||
BOOST_PP_ENUM_PARAMS(n, P) \
|
||||
BOOST_PP_COMMA_IF(n) \
|
||||
BOOST_PP_ENUM( \
|
||||
BOOST_PP_SUB(BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE, n), \
|
||||
boost::mpl::na BOOST_PP_TUPLE_EAT(3), \
|
||||
~ \
|
||||
) \
|
||||
> : impl::BOOST_PP_CAT(sequence, n)<BOOST_PP_ENUM_PARAMS(n, P)> \
|
||||
{};
|
||||
|
||||
BOOST_PP_REPEAT_FROM_TO(
|
||||
1,
|
||||
BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE,
|
||||
BOOST_METAPARSE_SEQUENCE_N,
|
||||
~
|
||||
)
|
||||
|
||||
#undef BOOST_METAPARSE_SEQUENCE_N
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+272
@@ -0,0 +1,272 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP98_STRING_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP98_STRING_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2012.
|
||||
// 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/metaparse/v1/cpp98/fwd/string.hpp>
|
||||
#include <boost/metaparse/v1/string_tag.hpp>
|
||||
#include <boost/metaparse/v1/impl/string_iterator.hpp>
|
||||
#include <boost/metaparse/v1/cpp98/impl/empty_string.hpp>
|
||||
#include <boost/metaparse/v1/cpp98/impl/size.hpp>
|
||||
#include <boost/metaparse/v1/cpp98/impl/pop_front.hpp>
|
||||
#include <boost/metaparse/v1/cpp98/impl/push_front_c.hpp>
|
||||
#include <boost/metaparse/v1/cpp98/impl/push_back_c.hpp>
|
||||
#include <boost/metaparse/v1/cpp98/impl/pop_back.hpp>
|
||||
|
||||
#include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
|
||||
#include <boost/preprocessor/tuple/eat.hpp>
|
||||
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
/*
|
||||
* The string type
|
||||
*/
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, int C)>
|
||||
struct string
|
||||
{
|
||||
typedef string type;
|
||||
typedef string_tag tag;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Boost.MPL overloads
|
||||
*/
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace mpl
|
||||
{
|
||||
// push_back
|
||||
template <class S>
|
||||
struct push_back_impl;
|
||||
|
||||
template <>
|
||||
struct push_back_impl<boost::metaparse::v1::string_tag>
|
||||
{
|
||||
typedef push_back_impl type;
|
||||
|
||||
template <class S, class C>
|
||||
struct apply :
|
||||
boost::metaparse::v1::impl::push_back_c<
|
||||
typename S::type,
|
||||
C::type::value
|
||||
>
|
||||
{};
|
||||
};
|
||||
|
||||
// pop_back
|
||||
template <class S>
|
||||
struct pop_back_impl;
|
||||
|
||||
template <>
|
||||
struct pop_back_impl<boost::metaparse::v1::string_tag>
|
||||
{
|
||||
typedef pop_back_impl type;
|
||||
|
||||
template <class S>
|
||||
struct apply : boost::metaparse::v1::impl::pop_back<S> {};
|
||||
};
|
||||
|
||||
// push_front
|
||||
template <class S>
|
||||
struct push_front_impl;
|
||||
|
||||
template <>
|
||||
struct push_front_impl<boost::metaparse::v1::string_tag>
|
||||
{
|
||||
typedef push_front_impl type;
|
||||
|
||||
template <class S, class C>
|
||||
struct apply :
|
||||
boost::metaparse::v1::impl::push_front_c<
|
||||
typename S::type,
|
||||
C::type::value
|
||||
>
|
||||
{};
|
||||
};
|
||||
|
||||
// pop_front
|
||||
template <class S>
|
||||
struct pop_front_impl;
|
||||
|
||||
template <>
|
||||
struct pop_front_impl<boost::metaparse::v1::string_tag>
|
||||
{
|
||||
typedef pop_front_impl type;
|
||||
|
||||
template <class S>
|
||||
struct apply : boost::metaparse::v1::impl::pop_front<S> {};
|
||||
};
|
||||
|
||||
// clear
|
||||
template <class S>
|
||||
struct clear_impl;
|
||||
|
||||
template <>
|
||||
struct clear_impl<boost::metaparse::v1::string_tag>
|
||||
{
|
||||
typedef clear_impl type;
|
||||
|
||||
template <class S>
|
||||
struct apply : boost::metaparse::v1::string<> {};
|
||||
};
|
||||
|
||||
// begin
|
||||
template <class S>
|
||||
struct begin_impl;
|
||||
|
||||
template <>
|
||||
struct begin_impl<boost::metaparse::v1::string_tag>
|
||||
{
|
||||
typedef begin_impl type;
|
||||
|
||||
template <class S>
|
||||
struct apply :
|
||||
boost::metaparse::v1::impl::string_iterator<typename S::type, 0>
|
||||
{};
|
||||
};
|
||||
|
||||
// end
|
||||
template <class S>
|
||||
struct end_impl;
|
||||
|
||||
template <>
|
||||
struct end_impl<boost::metaparse::v1::string_tag>
|
||||
{
|
||||
typedef end_impl type;
|
||||
|
||||
template <class S>
|
||||
struct apply :
|
||||
boost::metaparse::v1::impl::string_iterator<
|
||||
typename S::type,
|
||||
boost::metaparse::v1::impl::size<typename S::type>::type::value
|
||||
>
|
||||
{};
|
||||
};
|
||||
|
||||
// equal_to
|
||||
template <class A, class B>
|
||||
struct equal_to_impl;
|
||||
|
||||
template <>
|
||||
struct equal_to_impl<
|
||||
boost::metaparse::v1::string_tag,
|
||||
boost::metaparse::v1::string_tag
|
||||
>
|
||||
{
|
||||
typedef equal_to_impl type;
|
||||
|
||||
template <class A, class B>
|
||||
struct apply : boost::is_same<typename A::type, typename B::type> {};
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct equal_to_impl<boost::metaparse::v1::string_tag, T>
|
||||
{
|
||||
typedef equal_to_impl type;
|
||||
|
||||
template <class, class>
|
||||
struct apply : false_ {};
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct equal_to_impl<T, boost::metaparse::v1::string_tag> :
|
||||
equal_to_impl<boost::metaparse::v1::string_tag, T>
|
||||
{};
|
||||
|
||||
// c_str
|
||||
template <class S>
|
||||
struct c_str;
|
||||
|
||||
template <BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, int C)>
|
||||
struct c_str<
|
||||
boost::metaparse::v1::string<
|
||||
BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, C)
|
||||
>
|
||||
>
|
||||
{
|
||||
typedef c_str type;
|
||||
static const char value[BOOST_METAPARSE_LIMIT_STRING_SIZE + 1];
|
||||
};
|
||||
|
||||
template <BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, int C)>
|
||||
const char
|
||||
c_str<
|
||||
boost::metaparse::v1::string<
|
||||
BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, C)
|
||||
>
|
||||
>::value[BOOST_METAPARSE_LIMIT_STRING_SIZE + 1]
|
||||
= {BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, C), 0};
|
||||
|
||||
template <>
|
||||
struct c_str<boost::metaparse::v1::string<> > :
|
||||
boost::metaparse::v1::impl::empty_string<>
|
||||
{
|
||||
typedef c_str type;
|
||||
};
|
||||
|
||||
#ifdef BOOST_METAPARSE_STRING_CASE
|
||||
# error BOOST_METAPARSE_STRING_CASE is already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_STRING_CASE(z, n, unused) \
|
||||
template <BOOST_PP_ENUM_PARAMS(n, int C)> \
|
||||
struct \
|
||||
c_str< \
|
||||
boost::metaparse::v1::string< \
|
||||
BOOST_PP_ENUM_PARAMS(n, C) BOOST_PP_COMMA_IF(n) \
|
||||
BOOST_PP_ENUM( \
|
||||
BOOST_PP_SUB(BOOST_METAPARSE_LIMIT_STRING_SIZE, n), \
|
||||
BOOST_NO_CHAR BOOST_PP_TUPLE_EAT(3), \
|
||||
~ \
|
||||
) \
|
||||
> \
|
||||
> \
|
||||
{ \
|
||||
typedef c_str type; \
|
||||
static const char value[n + 1]; \
|
||||
}; \
|
||||
\
|
||||
template <BOOST_PP_ENUM_PARAMS(n, int C)> \
|
||||
const char c_str< \
|
||||
boost::metaparse::v1::string< \
|
||||
BOOST_PP_ENUM_PARAMS(n, C) BOOST_PP_COMMA_IF(n) \
|
||||
BOOST_PP_ENUM( \
|
||||
BOOST_PP_SUB(BOOST_METAPARSE_LIMIT_STRING_SIZE, n), \
|
||||
BOOST_NO_CHAR BOOST_PP_TUPLE_EAT(3), \
|
||||
~ \
|
||||
) \
|
||||
> \
|
||||
>::value[n + 1] = {BOOST_PP_ENUM_PARAMS(n, C) BOOST_PP_COMMA_IF(n) 0};
|
||||
|
||||
BOOST_PP_REPEAT_FROM_TO(
|
||||
1,
|
||||
BOOST_METAPARSE_LIMIT_STRING_SIZE,
|
||||
BOOST_METAPARSE_STRING_CASE,
|
||||
~
|
||||
)
|
||||
|
||||
#undef BOOST_METAPARSE_STRING_CASE
|
||||
}
|
||||
}
|
||||
|
||||
#define BOOST_METAPARSE_V1_CONFIG_NO_BOOST_METAPARSE_STRING 1
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user