feat():initial version
This commit is contained in:
36
install/boost_1_75_0/include/boost/metaparse/v1/accept.hpp
Normal file
36
install/boost_1_75_0/include/boost/metaparse/v1/accept.hpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef BOOST_METAPARSE_V1_ACCEPT_HPP
|
||||
#define BOOST_METAPARSE_V1_ACCEPT_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2014.
|
||||
// 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/fwd/accept.hpp>
|
||||
#include <boost/metaparse/v1/accept_tag.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class Result, class Remaining, class Pos>
|
||||
struct accept
|
||||
{
|
||||
typedef accept_tag tag;
|
||||
|
||||
typedef
|
||||
accept<Result, typename Remaining::type, typename Pos::type>
|
||||
type;
|
||||
|
||||
typedef Result result;
|
||||
typedef Remaining remaining;
|
||||
typedef Pos source_position;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
#ifndef BOOST_METAPARSE_V1_ACCEPT_TAG_HPP
|
||||
#define BOOST_METAPARSE_V1_ACCEPT_TAG_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/fwd/get_remaining.hpp>
|
||||
#include <boost/metaparse/v1/fwd/get_position.hpp>
|
||||
#include <boost/metaparse/v1/fwd/get_result.hpp>
|
||||
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
struct accept_tag { typedef accept_tag type; };
|
||||
|
||||
template <>
|
||||
struct get_position_impl<accept_tag>
|
||||
{
|
||||
template <class A>
|
||||
struct apply : A::source_position {};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct get_remaining_impl<accept_tag>
|
||||
{
|
||||
template <class A>
|
||||
struct apply : A::remaining {};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct get_result_impl<accept_tag>
|
||||
{
|
||||
template <class A>
|
||||
struct apply { typedef typename A::result type; };
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
#ifndef BOOST_METAPARSE_V1_ACCEPT_WHEN_HPP
|
||||
#define BOOST_METAPARSE_V1_ACCEPT_WHEN_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/get_result.hpp>
|
||||
#include <boost/metaparse/v1/reject.hpp>
|
||||
#include <boost/metaparse/v1/is_error.hpp>
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class P, class Pred, class Msg>
|
||||
struct accept_when
|
||||
{
|
||||
private:
|
||||
struct unchecked
|
||||
{
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
boost::mpl::eval_if<
|
||||
typename Pred::template apply<
|
||||
typename get_result<typename P::template apply<S, Pos> >::type
|
||||
>::type,
|
||||
typename P::template apply<S, Pos>,
|
||||
reject<Msg, Pos>
|
||||
>
|
||||
{};
|
||||
};
|
||||
public:
|
||||
typedef accept_when type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
boost::mpl::if_<
|
||||
is_error<typename P::template apply<S, Pos> >,
|
||||
P,
|
||||
unchecked
|
||||
>::type::template apply<
|
||||
S,
|
||||
Pos
|
||||
>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
25
install/boost_1_75_0/include/boost/metaparse/v1/alphanum.hpp
Normal file
25
install/boost_1_75_0/include/boost/metaparse/v1/alphanum.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef BOOST_METAPARSE_V1_ALPHANUM_HPP
|
||||
#define BOOST_METAPARSE_V1_ALPHANUM_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/one_of.hpp>
|
||||
#include <boost/metaparse/v1/digit.hpp>
|
||||
#include <boost/metaparse/v1/letter.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
typedef one_of<letter, digit> alphanum;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
51
install/boost_1_75_0/include/boost/metaparse/v1/always.hpp
Normal file
51
install/boost_1_75_0/include/boost/metaparse/v1/always.hpp
Normal file
@@ -0,0 +1,51 @@
|
||||
#ifndef BOOST_METAPARSE_V1_ALWAYS_HPP
|
||||
#define BOOST_METAPARSE_V1_ALWAYS_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/accept.hpp>
|
||||
#include <boost/metaparse/v1/is_error.hpp>
|
||||
#include <boost/metaparse/v1/get_remaining.hpp>
|
||||
#include <boost/metaparse/v1/get_position.hpp>
|
||||
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class P, class Result>
|
||||
struct always
|
||||
{
|
||||
private:
|
||||
template <class Res>
|
||||
struct apply_unchecked :
|
||||
accept<
|
||||
Result,
|
||||
typename get_remaining<Res>::type,
|
||||
typename get_position<Res>::type
|
||||
>
|
||||
{};
|
||||
public:
|
||||
typedef always type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
boost::mpl::eval_if<
|
||||
typename is_error<typename P::template apply<S, Pos> >::type,
|
||||
typename P::template apply<S, Pos>,
|
||||
apply_unchecked<typename P::template apply<S, Pos> >
|
||||
>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
25
install/boost_1_75_0/include/boost/metaparse/v1/always_c.hpp
Normal file
25
install/boost_1_75_0/include/boost/metaparse/v1/always_c.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef BOOST_METAPARSE_V1_ALWAYS_C_HPP
|
||||
#define BOOST_METAPARSE_V1_ALWAYS_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/always.hpp>
|
||||
#include <boost/metaparse/v1/lit_c.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <char C, class Result>
|
||||
struct always_c : always<lit_c<C>, Result> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
#ifndef BOOST_METAPARSE_V1_BUILD_PARSER_HPP
|
||||
#define BOOST_METAPARSE_V1_BUILD_PARSER_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/fwd/build_parser.hpp>
|
||||
#include <boost/metaparse/v1/start.hpp>
|
||||
#include <boost/metaparse/v1/get_result.hpp>
|
||||
#include <boost/metaparse/v1/get_position.hpp>
|
||||
#include <boost/metaparse/v1/get_message.hpp>
|
||||
#include <boost/metaparse/v1/get_line.hpp>
|
||||
#include <boost/metaparse/v1/get_col.hpp>
|
||||
#include <boost/metaparse/v1/is_error.hpp>
|
||||
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <int Line, int Col, class Msg>
|
||||
struct x__________________PARSING_FAILED__________________x
|
||||
{
|
||||
BOOST_STATIC_ASSERT(Line == Line + 1);
|
||||
};
|
||||
|
||||
template <class P, class S>
|
||||
struct parsing_failed :
|
||||
x__________________PARSING_FAILED__________________x<
|
||||
get_line<
|
||||
get_position<typename P::template apply<S, start> >
|
||||
>::type::value,
|
||||
get_col<
|
||||
get_position<typename P::template apply<S, start> >
|
||||
>::type::value,
|
||||
typename get_message<typename P::template apply<S, start> >::type
|
||||
>
|
||||
{};
|
||||
|
||||
template <class P>
|
||||
struct build_parser
|
||||
{
|
||||
typedef build_parser type;
|
||||
|
||||
template <class S>
|
||||
struct apply :
|
||||
boost::mpl::eval_if<
|
||||
typename is_error<typename P::template apply<S, start> >::type,
|
||||
parsing_failed<P, S>,
|
||||
get_result<typename P::template apply<S, start> >
|
||||
>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CHANGE_ERROR_MESSAGE_HPP
|
||||
#define BOOST_METAPARSE_V1_CHANGE_ERROR_MESSAGE_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/is_error.hpp>
|
||||
#include <boost/metaparse/v1/reject.hpp>
|
||||
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class P, class Msg>
|
||||
struct change_error_message
|
||||
{
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
boost::mpl::eval_if<
|
||||
typename is_error<typename P::template apply<S, Pos> >::type,
|
||||
reject<Msg, Pos>,
|
||||
typename P::template apply<S, Pos>
|
||||
>
|
||||
{};
|
||||
|
||||
typedef change_error_message type;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_FIRST_OF_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_FIRST_OF_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/cpp11/impl/nth_of_c.hpp>
|
||||
|
||||
#include <boost/metaparse/v1/fail.hpp>
|
||||
#include <boost/metaparse/v1/error/index_out_of_range.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class... Ps>
|
||||
struct first_of
|
||||
{
|
||||
typedef first_of type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply : impl::nth_of_c<0, S, Pos, Ps...> {};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct first_of<> : fail<error::index_out_of_range<0, -1, 0>> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_FWD_STRING_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_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)
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <char... Cs>
|
||||
struct string;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_ANY_OF_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_IMPL_ANY_OF_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/cpp11/impl/or_c.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <char... Cs>
|
||||
struct any_of_c
|
||||
{
|
||||
typedef any_of_c type;
|
||||
|
||||
template <class Chr>
|
||||
struct apply : or_c<(Chr::type::value == Cs)...> {};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_AT_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_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/v1/cpp11/fwd/string.hpp>
|
||||
|
||||
#include <boost/mpl/char.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S, int N>
|
||||
struct at_c;
|
||||
|
||||
template <char C, char... Cs, int N>
|
||||
struct at_c<string<C, Cs...>, N> : at_c<string<Cs...>, N - 1> {};
|
||||
|
||||
template <char C, char... Cs>
|
||||
struct at_c<string<C, Cs...>, 0> : boost::mpl::char_<C> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_CONCAT_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_IMPL_CONCAT_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/cpp11/fwd/string.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class A, class B>
|
||||
struct concat;
|
||||
|
||||
template <char... As, char... Bs>
|
||||
struct concat<string<As...>, string<Bs...>> : string<As..., Bs...> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_EMPTY_STRING_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_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 constexpr char value[1] = {0};
|
||||
};
|
||||
|
||||
template <class Ignore>
|
||||
constexpr char empty_string<Ignore>::value[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_EVAL_LATER_RESULT_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_IMPL_EVAL_LATER_RESULT_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/eval_if.hpp>
|
||||
#include <boost/mpl/less.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class R1, class R2>
|
||||
struct eval_later_result :
|
||||
boost::mpl::eval_if<
|
||||
typename boost::mpl::less<
|
||||
typename get_position<R2>::type,
|
||||
typename get_position<R1>::type
|
||||
>::type,
|
||||
R1,
|
||||
R2
|
||||
>
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_IS_NONE_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_IMPL_IS_NONE_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/cpp11/impl/is_none_c_impl.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <char... Cs>
|
||||
struct is_none_c
|
||||
{
|
||||
typedef is_none_c type;
|
||||
|
||||
template <class C>
|
||||
struct apply : is_none_c_impl<C::type::value, Cs...> {};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_IS_NONE_C_IMPL_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_IMPL_IS_NONE_C_IMPL_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/mpl/bool.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <char D, char... Cs>
|
||||
struct is_none_c_impl;
|
||||
|
||||
template <char D>
|
||||
struct is_none_c_impl<D> : boost::mpl::bool_<true> {};
|
||||
|
||||
template <char D, char... Cs>
|
||||
struct is_none_c_impl<D, D, Cs...> : boost::mpl::bool_<false> {};
|
||||
|
||||
template <char D, char C, char... Cs>
|
||||
struct is_none_c_impl<D, C, Cs...> : is_none_c_impl<D, Cs...> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_NTH_OF_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_IMPL_NTH_OF_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/cpp11/impl/nth_of_c_skip_remaining.hpp>
|
||||
|
||||
#include <boost/metaparse/v1/is_error.hpp>
|
||||
#include <boost/metaparse/v1/get_remaining.hpp>
|
||||
#include <boost/metaparse/v1/get_position.hpp>
|
||||
#include <boost/metaparse/v1/get_result.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <int N, class S, class Pos, class... Ps>
|
||||
struct nth_of_c;
|
||||
|
||||
template <int N, class S, class Pos, class P, class... Ps>
|
||||
struct nth_of_c<N, S, Pos, P, Ps...>
|
||||
{
|
||||
private:
|
||||
template <class NextResult>
|
||||
struct apply_unchecked :
|
||||
nth_of_c<
|
||||
N - 1,
|
||||
typename get_remaining<NextResult>::type,
|
||||
typename get_position<NextResult>::type,
|
||||
Ps...
|
||||
>
|
||||
{};
|
||||
|
||||
public:
|
||||
typedef
|
||||
typename std::conditional<
|
||||
is_error<typename P::template apply<S, Pos>>::type::value,
|
||||
typename P::template apply<S, Pos>,
|
||||
apply_unchecked<typename P::template apply<S, Pos>>
|
||||
>::type::type
|
||||
type;
|
||||
};
|
||||
|
||||
template <class P, class S, class Pos, class... Ps>
|
||||
struct nth_of_c<0, S, Pos, P, Ps...>
|
||||
{
|
||||
private:
|
||||
template <class NextResult>
|
||||
struct apply_unchecked :
|
||||
nth_of_c_skip_remaining<
|
||||
typename get_result<NextResult>::type,
|
||||
typename get_remaining<NextResult>::type,
|
||||
typename get_position<NextResult>::type,
|
||||
Ps...
|
||||
>
|
||||
{};
|
||||
|
||||
public:
|
||||
typedef
|
||||
typename std::conditional<
|
||||
is_error<typename P::template apply<S, Pos>>::type::value,
|
||||
typename P::template apply<S, Pos>,
|
||||
apply_unchecked<typename P::template apply<S, Pos>>
|
||||
>::type::type
|
||||
type;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_NTH_OF_C_SKIP_REMANING_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_IMPL_NTH_OF_C_SKIP_REMANING_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/get_remaining.hpp>
|
||||
#include <boost/metaparse/v1/get_position.hpp>
|
||||
#include <boost/metaparse/v1/return_.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class FinalResult, class S, class Pos, class... Ps>
|
||||
struct nth_of_c_skip_remaining;
|
||||
|
||||
template <class FinalResult, class S, class Pos>
|
||||
struct nth_of_c_skip_remaining<FinalResult, S, Pos> :
|
||||
return_<FinalResult>::template apply<S, Pos>
|
||||
{};
|
||||
|
||||
template <class FinalResult, class S, class Pos, class P, class... Ps>
|
||||
struct nth_of_c_skip_remaining<FinalResult, S, Pos, P, Ps...>
|
||||
{
|
||||
private:
|
||||
template <class NextResult>
|
||||
struct apply_unchecked :
|
||||
nth_of_c_skip_remaining<
|
||||
FinalResult,
|
||||
typename get_remaining<NextResult>::type,
|
||||
typename get_position<NextResult>::type,
|
||||
Ps...
|
||||
>
|
||||
{};
|
||||
public:
|
||||
typedef
|
||||
typename std::conditional<
|
||||
is_error<typename P::template apply<S, Pos>>::type::value,
|
||||
typename P::template apply<S, Pos>,
|
||||
apply_unchecked<typename P::template apply<S, Pos>>
|
||||
>::type::type
|
||||
type;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_OR_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_OR_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/mpl/bool.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <bool... Bs>
|
||||
struct or_c;
|
||||
|
||||
template <>
|
||||
struct or_c<> : boost::mpl::false_ {};
|
||||
|
||||
template <bool... Bs>
|
||||
struct or_c<true, Bs...> : boost::mpl::true_ {};
|
||||
|
||||
template <bool... Bs>
|
||||
struct or_c<false, Bs...> : or_c<Bs...> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_POP_BACK_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_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/cpp11/fwd/string.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/push_front_c.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/size.hpp>
|
||||
|
||||
#include <boost/mpl/clear.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S>
|
||||
struct pop_back;
|
||||
|
||||
template <char C>
|
||||
struct pop_back<string<C>> : boost::mpl::clear<string<C>> {};
|
||||
|
||||
template <char C, char... Cs>
|
||||
struct pop_back<string<C, Cs...>> :
|
||||
push_front_c<typename pop_back<string<Cs...>>::type, C>
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_POP_FRONT_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_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/cpp11/fwd/string.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S>
|
||||
struct pop_front;
|
||||
|
||||
template <char C, char... Cs>
|
||||
struct pop_front<string<C, Cs...>> : string<Cs...> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_PUSH_BACK_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_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/cpp11/fwd/string.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S, char C>
|
||||
struct push_back_c;
|
||||
|
||||
template <char... Cs, char C>
|
||||
struct push_back_c<string<Cs...>, C> : string<Cs..., C> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_PUSH_FRONT_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_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/cpp11/fwd/string.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S, char C>
|
||||
struct push_front_c;
|
||||
|
||||
template <char... Cs, char C>
|
||||
struct push_front_c<string<Cs...>, C> : string<C, Cs...> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_PUSH_FRONT_RESULT_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_IMPL_PUSH_FRONT_RESULT_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2018.
|
||||
// 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_result.hpp>
|
||||
|
||||
#include <boost/mpl/push_front.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class Value>
|
||||
struct push_front_result
|
||||
{
|
||||
typedef push_front_result type;
|
||||
|
||||
template <class Seq>
|
||||
struct apply :
|
||||
boost::mpl::push_front<Seq, typename get_result<Value>::type>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,34 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_SIZE_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_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/cpp11/fwd/string.hpp>
|
||||
|
||||
#include <boost/mpl/int.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <class S>
|
||||
struct size;
|
||||
|
||||
template <char... Cs>
|
||||
struct size<string<Cs...>> : boost::mpl::int_<sizeof...(Cs)> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,39 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_IMPL_STRING_AT_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_IMPL_STRING_AT_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2016.
|
||||
// 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>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <int MaxLen, int Len, class T>
|
||||
constexpr T string_at(const T (&s)[Len], int n)
|
||||
{
|
||||
// "MaxLen + 1" adds the \0 character of the string literal to the
|
||||
// limit
|
||||
static_assert(Len <= MaxLen + 1, "String literal is too long.");
|
||||
return n >= Len - 1 ? T() : s[n];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef BOOST_METAPARSE_V1_STRING_AT
|
||||
# error BOOST_METAPARSE_V1_STRING_AT already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_V1_STRING_AT \
|
||||
::boost::metaparse::v1::impl::string_at<BOOST_METAPARSE_LIMIT_STRING_SIZE>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_LAST_OF_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_LAST_OF_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/cpp11/impl/nth_of_c.hpp>
|
||||
|
||||
#include <boost/metaparse/v1/fail.hpp>
|
||||
#include <boost/metaparse/v1/error/index_out_of_range.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class... Ps>
|
||||
struct last_of
|
||||
{
|
||||
typedef last_of type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply : impl::nth_of_c<sizeof...(Ps) - 1, S, Pos, Ps...> {};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct last_of<> : fail<error::index_out_of_range<0, -1, 0>> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_NTH_OF_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_NTH_OF_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class K, class... Ps>
|
||||
struct nth_of : nth_of_c<K::type::value, Ps...> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_NTH_OF_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_NTH_OF_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/cpp11/impl/nth_of_c.hpp>
|
||||
|
||||
#include <boost/metaparse/v1/fail.hpp>
|
||||
#include <boost/metaparse/v1/error/index_out_of_range.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <int N, class... Ps>
|
||||
struct nth_of_c
|
||||
{
|
||||
typedef nth_of_c type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
std::conditional<
|
||||
(0 <= N && N < sizeof...(Ps)),
|
||||
impl::nth_of_c<N, S, Pos, Ps...>,
|
||||
typename fail<error::index_out_of_range<0, sizeof...(Ps) - 1, N>>
|
||||
::template apply<S, Pos>
|
||||
>::type
|
||||
{};
|
||||
};
|
||||
|
||||
template <int N>
|
||||
struct nth_of_c<N> : fail<error::index_out_of_range<0, -1, N>> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_ONE_CHAR_EXCEPT_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_ONE_CHAR_EXCEPT_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/cpp11/impl/is_none_c.hpp>
|
||||
#include <boost/metaparse/v1/one_char.hpp>
|
||||
#include <boost/metaparse/v1/accept_when.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class... Cs>
|
||||
struct one_char_except :
|
||||
accept_when<
|
||||
one_char,
|
||||
impl::is_none_c<Cs::type::value...>,
|
||||
error::unexpected_character
|
||||
>
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_ONE_CHAR_EXCEPT_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_ONE_CHAR_EXCEPT_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/cpp11/impl/is_none_c.hpp>
|
||||
#include <boost/metaparse/v1/accept_when.hpp>
|
||||
#include <boost/metaparse/v1/one_char.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <char... Cs>
|
||||
struct one_char_except_c :
|
||||
accept_when<
|
||||
one_char,
|
||||
impl::is_none_c<Cs...>,
|
||||
error::unexpected_character
|
||||
>
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_ONE_OF_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_ONE_OF_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/fail.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/eval_later_result.hpp>
|
||||
#include <boost/metaparse/v1/error/none_of_the_expected_cases_found.hpp>
|
||||
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class... Ps>
|
||||
struct one_of;
|
||||
|
||||
template <class P, class... Ps>
|
||||
struct one_of<P, Ps...>
|
||||
{
|
||||
typedef one_of type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
boost::mpl::eval_if<
|
||||
typename is_error<typename P::template apply<S, Pos>>::type,
|
||||
boost::mpl::eval_if<
|
||||
typename is_error<
|
||||
typename one_of<Ps...>::template apply<S, Pos>
|
||||
>::type,
|
||||
impl::eval_later_result<
|
||||
typename P::template apply<S, Pos>,
|
||||
typename one_of<Ps...>::template apply<S, Pos>
|
||||
>,
|
||||
typename one_of<Ps...>::template apply<S, Pos>
|
||||
>,
|
||||
typename P::template apply<S, Pos>
|
||||
>
|
||||
{};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct one_of<> : fail<error::none_of_the_expected_cases_found> {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_ONE_OF_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_ONE_OF_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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_char.hpp>
|
||||
#include <boost/metaparse/v1/accept_when.hpp>
|
||||
#include <boost/metaparse/v1/error/none_of_the_expected_cases_found.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/any_of_c.hpp>
|
||||
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <char... Cs>
|
||||
struct one_of_c :
|
||||
accept_when<
|
||||
one_char,
|
||||
impl::any_of_c<Cs...>,
|
||||
error::none_of_the_expected_cases_found
|
||||
>
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_REPEATED_ONE_OF_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_REPEATED_ONE_OF_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/repeated.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class... Ps>
|
||||
using repeated_one_of = repeated<one_of<Ps...>>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_REPEATED_ONE_OF1_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_REPEATED_ONE_OF1_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/repeated1.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class... Ps>
|
||||
using repeated_one_of1 = repeated1<one_of<Ps...>>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_SEQUENCE_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_SEQUENCE_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2018.
|
||||
// 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/cpp11/impl/push_front_result.hpp>
|
||||
|
||||
#include <boost/metaparse/v1/get_remaining.hpp>
|
||||
#include <boost/metaparse/v1/get_position.hpp>
|
||||
#include <boost/metaparse/v1/is_error.hpp>
|
||||
#include <boost/metaparse/v1/return_.hpp>
|
||||
#include <boost/metaparse/v1/transform.hpp>
|
||||
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/vector.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class... Ps>
|
||||
struct sequence;
|
||||
|
||||
template <>
|
||||
struct sequence<> : return_<boost::mpl::vector<>> {};
|
||||
|
||||
template <class P, class... Ps>
|
||||
struct sequence<P, Ps...>
|
||||
{
|
||||
private:
|
||||
template <class Res>
|
||||
struct apply_unchecked :
|
||||
transform<
|
||||
sequence<Ps...>,
|
||||
impl::push_front_result<Res>
|
||||
>::template apply<
|
||||
typename get_remaining<Res>::type,
|
||||
typename get_position<Res>::type
|
||||
>
|
||||
{};
|
||||
public:
|
||||
typedef sequence type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
boost::mpl::eval_if<
|
||||
typename is_error<typename P::template apply<S, Pos>>::type,
|
||||
typename P::template apply<S, Pos>,
|
||||
apply_unchecked<typename P::template apply<S, Pos>>
|
||||
>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
220
install/boost_1_75_0/include/boost/metaparse/v1/cpp11/string.hpp
Normal file
220
install/boost_1_75_0/include/boost/metaparse/v1/cpp11/string.hpp
Normal file
@@ -0,0 +1,220 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP11_STRING_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP11_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/cpp11/fwd/string.hpp>
|
||||
#include <boost/metaparse/v1/string_tag.hpp>
|
||||
#include <boost/metaparse/v1/impl/string_iterator.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/empty_string.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/size.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/pop_front.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/push_front_c.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/push_back_c.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/pop_back.hpp>
|
||||
#include <boost/metaparse/v1/cpp11/impl/string_at.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
/*
|
||||
* The string type
|
||||
*/
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <char... Cs>
|
||||
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 : std::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 <char... Cs>
|
||||
struct c_str<boost::metaparse::v1::string<Cs...>>
|
||||
{
|
||||
typedef c_str type;
|
||||
static constexpr char value[sizeof...(Cs) + 1] = {Cs..., 0};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct c_str<boost::metaparse::v1::string<>> :
|
||||
boost::metaparse::v1::impl::empty_string<>
|
||||
{};
|
||||
|
||||
template <char... Cs>
|
||||
constexpr char c_str<boost::metaparse::v1::string<Cs...>>::value[];
|
||||
}
|
||||
}
|
||||
|
||||
#if __clang__
|
||||
# if __has_extension(cxx_string_literal_templates)
|
||||
# define BOOST_METAPARSE_V1_STRING(...) ::boost::metaparse::string<__VA_ARGS__>
|
||||
# else
|
||||
# include <boost/metaparse/v1/cpp11/impl/string.hpp>
|
||||
# endif
|
||||
#else
|
||||
# include <boost/metaparse/v1/cpp11/impl/string.hpp>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP14_IMPL_ANY_OF_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP14_IMPL_ANY_OF_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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/mpl/bool.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
template <char... Cs>
|
||||
struct any_of_c
|
||||
{
|
||||
typedef any_of_c type;
|
||||
|
||||
static constexpr bool run(char c_)
|
||||
{
|
||||
const bool values[] = {(c_ == Cs)...};
|
||||
for (const bool* i = values; i != values + sizeof...(Cs); ++i)
|
||||
{
|
||||
if (*i)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
template <class Chr>
|
||||
struct apply : boost::mpl::bool_<any_of_c::run(Chr::type::value)> {};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct any_of_c<>
|
||||
{
|
||||
typedef any_of_c type;
|
||||
|
||||
template <class>
|
||||
struct apply : boost::mpl::false_ {};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
#ifndef BOOST_METAPARSE_V1_CPP14_ONE_OF_C_HPP
|
||||
#define BOOST_METAPARSE_V1_CPP14_ONE_OF_C_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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_char.hpp>
|
||||
#include <boost/metaparse/v1/accept_when.hpp>
|
||||
#include <boost/metaparse/v1/error/none_of_the_expected_cases_found.hpp>
|
||||
#include <boost/metaparse/v1/cpp14/impl/any_of_c.hpp>
|
||||
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <char... Cs>
|
||||
struct one_of_c :
|
||||
accept_when<
|
||||
one_char,
|
||||
impl::any_of_c<Cs...>,
|
||||
error::none_of_the_expected_cases_found
|
||||
>
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
install/boost_1_75_0/include/boost/metaparse/v1/cpp98/string.hpp
Normal file
272
install/boost_1_75_0/include/boost/metaparse/v1/cpp98/string.hpp
Normal file
@@ -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
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
#ifndef BOOST_METAPARSE_V1_DEBUG_PARSING_ERROR_HPP
|
||||
#define BOOST_METAPARSE_V1_DEBUG_PARSING_ERROR_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/fwd/build_parser.hpp>
|
||||
#include <boost/metaparse/v1/start.hpp>
|
||||
#include <boost/metaparse/v1/is_error.hpp>
|
||||
#include <boost/metaparse/v1/get_remaining.hpp>
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/string.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class P, class S>
|
||||
class debug_parsing_error
|
||||
{
|
||||
public:
|
||||
debug_parsing_error()
|
||||
{
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
using boost::mpl::c_str;
|
||||
|
||||
typedef display<typename P::template apply<S, start>::type> runner;
|
||||
|
||||
cout << "Compile-time parsing results" << endl;
|
||||
cout << "----------------------------" << endl;
|
||||
cout << "Input text:" << endl;
|
||||
cout << c_str<S>::type::value << endl;
|
||||
cout << endl;
|
||||
runner::run();
|
||||
|
||||
std::exit(0);
|
||||
}
|
||||
|
||||
typedef debug_parsing_error type;
|
||||
private:
|
||||
template <class Result>
|
||||
struct display_error
|
||||
{
|
||||
static void run()
|
||||
{
|
||||
typedef typename Result::type R;
|
||||
|
||||
std::cout
|
||||
<< "Parsing failed:" << std::endl
|
||||
<< "line " << get_line<typename R::source_position>::type::value
|
||||
<< ", col " << get_col<typename R::source_position>::type::value
|
||||
<< ": "
|
||||
<< R::message::type::get_value() << std::endl;
|
||||
}
|
||||
};
|
||||
|
||||
template <class Result>
|
||||
struct display_no_error
|
||||
{
|
||||
static void run()
|
||||
{
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
using boost::mpl::c_str;
|
||||
|
||||
typedef typename get_remaining<Result>::type remaining_string;
|
||||
|
||||
cout
|
||||
<< "Parsing was successful. Remaining string is:" << endl
|
||||
<< c_str<remaining_string>::type::value << endl;
|
||||
}
|
||||
};
|
||||
|
||||
template <class Result>
|
||||
struct display :
|
||||
boost::mpl::if_<
|
||||
typename is_error<Result>::type,
|
||||
display_error<Result>,
|
||||
display_no_error<Result>
|
||||
>::type
|
||||
{};
|
||||
};
|
||||
|
||||
// Special case to handle when DebugParsingError is used with build_parser
|
||||
// (it shouldn't be)
|
||||
template <class P, class S>
|
||||
class debug_parsing_error<build_parser<P>, S> :
|
||||
debug_parsing_error<P, S>
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef BOOST_METAPARSE_V1_DEFINE_ERROR_HPP
|
||||
#define BOOST_METAPARSE_V1_DEFINE_ERROR_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 <string>
|
||||
|
||||
#ifdef BOOST_METAPARSE_V1_DEFINE_ERROR
|
||||
# error BOOST_METAPARSE_V1_DEFINE_ERROR already defined
|
||||
#endif
|
||||
#define BOOST_METAPARSE_V1_DEFINE_ERROR(name, msg) \
|
||||
struct name \
|
||||
{ \
|
||||
typedef name type; \
|
||||
static std::string get_value() \
|
||||
{ \
|
||||
return msg; \
|
||||
} \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
34
install/boost_1_75_0/include/boost/metaparse/v1/digit.hpp
Normal file
34
install/boost_1_75_0/include/boost/metaparse/v1/digit.hpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef BOOST_METAPARSE_V1_DIGIT_HPP
|
||||
#define BOOST_METAPARSE_V1_DIGIT_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/error/digit_expected.hpp>
|
||||
#include <boost/metaparse/v1/accept_when.hpp>
|
||||
#include <boost/metaparse/v1/one_char.hpp>
|
||||
#include <boost/metaparse/v1/change_error_message.hpp>
|
||||
|
||||
#include <boost/metaparse/v1/util/is_digit.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
typedef
|
||||
accept_when<
|
||||
change_error_message<one_char, error::digit_expected>,
|
||||
util::is_digit<>,
|
||||
error::digit_expected
|
||||
>
|
||||
digit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef BOOST_METAPARSE_V1_DIGIT_VAL_HPP
|
||||
#define BOOST_METAPARSE_V1_DIGIT_VAL_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/digit.hpp>
|
||||
#include <boost/metaparse/v1/transform.hpp>
|
||||
|
||||
#include <boost/metaparse/v1/util/digit_to_int.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
typedef transform<digit, util::digit_to_int<> > digit_val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
42
install/boost_1_75_0/include/boost/metaparse/v1/empty.hpp
Normal file
42
install/boost_1_75_0/include/boost/metaparse/v1/empty.hpp
Normal file
@@ -0,0 +1,42 @@
|
||||
#ifndef BOOST_METAPARSE_V1_EMPTY_HPP
|
||||
#define BOOST_METAPARSE_V1_EMPTY_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2010 - 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/end_of_input_expected.hpp>
|
||||
#include <boost/metaparse/v1/reject.hpp>
|
||||
#include <boost/metaparse/v1/accept.hpp>
|
||||
#include <boost/metaparse/v1/define_error.hpp>
|
||||
|
||||
#include <boost/mpl/empty.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class Result>
|
||||
struct empty
|
||||
{
|
||||
typedef empty type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
boost::mpl::if_<
|
||||
boost::mpl::empty<S>,
|
||||
accept<Result, S, Pos>,
|
||||
reject<error::end_of_input_expected, Pos>
|
||||
>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#ifndef BOOST_METAPARSE_V1_ENTIRE_INPUT_HPP
|
||||
#define BOOST_METAPARSE_V1_ENTIRE_INPUT_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/first_of.hpp>
|
||||
#include <boost/metaparse/v1/empty.hpp>
|
||||
#include <boost/metaparse/v1/change_error_message.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class P, class Msg = error::end_of_input_expected>
|
||||
struct entire_input :
|
||||
first_of<P, change_error_message<empty<void>, Msg> >
|
||||
{};
|
||||
|
||||
template <class P>
|
||||
struct entire_input<P, error::end_of_input_expected> :
|
||||
first_of<P, empty<void> >
|
||||
{};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef BOOST_METAPARSE_V1_ERROR_DIGIT_EXPECTED_HPP
|
||||
#define BOOST_METAPARSE_V1_ERROR_DIGIT_EXPECTED_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/define_error.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace error
|
||||
{
|
||||
BOOST_METAPARSE_V1_DEFINE_ERROR(digit_expected, "Digit expected");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
#ifndef BOOST_METAPARSE_V1_END_OF_INPUT_EXPECTED_HPP
|
||||
#define BOOST_METAPARSE_V1_END_OF_INPUT_EXPECTED_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/define_error.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace error
|
||||
{
|
||||
BOOST_METAPARSE_V1_DEFINE_ERROR(
|
||||
end_of_input_expected,
|
||||
"End of input expected"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef BOOST_METAPARSE_V1_ERROR_EXPECTED_TO_FAIL_HPP
|
||||
#define BOOST_METAPARSE_V1_ERROR_EXPECTED_TO_FAIL_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/define_error.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace error
|
||||
{
|
||||
BOOST_METAPARSE_V1_DEFINE_ERROR(
|
||||
expected_to_fail,
|
||||
"Parser expected to fail"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
#ifndef BOOST_METAPARSE_V1_ERROR_INDEX_OUT_OF_RANGE_HPP
|
||||
#define BOOST_METAPARSE_V1_ERROR_INDEX_OUT_OF_RANGE_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 <iostream>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace error
|
||||
{
|
||||
template <int From, int To, int N>
|
||||
struct index_out_of_range
|
||||
{
|
||||
typedef index_out_of_range type;
|
||||
|
||||
static std::string get_value()
|
||||
{
|
||||
std::ostringstream s;
|
||||
s
|
||||
<< "index (" << N << ") out of range ["
|
||||
<< From << "-" << To << "]";
|
||||
return s.str();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef BOOST_METAPARSE_V1_ERROR_LETTER_EXPECTED_HPP
|
||||
#define BOOST_METAPARSE_V1_ERROR_LETTER_EXPECTED_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/define_error.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace error
|
||||
{
|
||||
BOOST_METAPARSE_V1_DEFINE_ERROR(letter_expected, "Letter expected");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#ifndef BOOST_METAPARSE_V1_ERROR_LITERAL_EXPECTED_HPP
|
||||
#define BOOST_METAPARSE_V1_ERROR_LITERAL_EXPECTED_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 <string>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace error
|
||||
{
|
||||
template <char C>
|
||||
struct literal_expected
|
||||
{
|
||||
typedef literal_expected type;
|
||||
|
||||
static std::string get_value()
|
||||
{
|
||||
return std::string("Expected: ") + C;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
#ifndef BOOST_METAPARSE_V1_ERROR_NONE_OF_THE_EXPECTED_CASES_FOUND_HPP
|
||||
#define BOOST_METAPARSE_V1_ERROR_NONE_OF_THE_EXPECTED_CASES_FOUND_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/define_error.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace error
|
||||
{
|
||||
BOOST_METAPARSE_V1_DEFINE_ERROR(
|
||||
none_of_the_expected_cases_found,
|
||||
"None of the expected cases found"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
#ifndef BOOST_METAPARSE_V1_ERROR_UNEXPECTED_CHARACTER_HPP
|
||||
#define BOOST_METAPARSE_V1_ERROR_UNEXPECTED_CHARACTER_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/define_error.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace error
|
||||
{
|
||||
BOOST_METAPARSE_V1_DEFINE_ERROR(
|
||||
unexpected_character,
|
||||
"Unexpected character"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef BOOST_METAPARSE_V1_ERROR_UNEXPECTED_END_OF_INPUT_HPP
|
||||
#define BOOST_METAPARSE_V1_ERROR_UNEXPECTED_END_OF_INPUT_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/define_error.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace error
|
||||
{
|
||||
BOOST_METAPARSE_V1_DEFINE_ERROR(
|
||||
unexpected_end_of_input,
|
||||
"Unexpected end of input"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
#ifndef BOOST_METAPARSE_V1_ERROR_UNPAIRED_HPP
|
||||
#define BOOST_METAPARSE_V1_ERROR_UNPAIRED_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/mpl/vector.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace error
|
||||
{
|
||||
template <int Line, int Col, class Msg = boost::mpl::na>
|
||||
struct unpaired
|
||||
{
|
||||
typedef unpaired type;
|
||||
|
||||
static std::string get_value()
|
||||
{
|
||||
std::ostringstream s;
|
||||
s << Msg::get_value() << " (see " << Line << ":" << Col << ")";
|
||||
return s.str();
|
||||
}
|
||||
};
|
||||
|
||||
template <int Line, int Col>
|
||||
struct unpaired<Line, Col, boost::mpl::na>
|
||||
{
|
||||
typedef unpaired type;
|
||||
|
||||
template <class Msg = boost::mpl::na>
|
||||
struct apply : unpaired<Line, Col, Msg> {};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef BOOST_METAPARSE_V1_ERROR_WHITESPACE_EXPECTED_HPP
|
||||
#define BOOST_METAPARSE_V1_ERROR_WHITESPACE_EXPECTED_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/define_error.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
namespace error
|
||||
{
|
||||
BOOST_METAPARSE_V1_DEFINE_ERROR(
|
||||
whitespace_expected,
|
||||
"Whitespace expected"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
40
install/boost_1_75_0/include/boost/metaparse/v1/except.hpp
Normal file
40
install/boost_1_75_0/include/boost/metaparse/v1/except.hpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef BOOST_METAPARSE_V1_EXCEPT_HPP
|
||||
#define BOOST_METAPARSE_V1_EXCEPT_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2009 - 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/is_error.hpp>
|
||||
#include <boost/metaparse/v1/accept.hpp>
|
||||
#include <boost/metaparse/v1/reject.hpp>
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class P, class Result, class ErrorMsg>
|
||||
struct except
|
||||
{
|
||||
typedef except type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
boost::mpl::if_<
|
||||
is_error<typename P::template apply<S, Pos> >,
|
||||
accept<Result, S, Pos>,
|
||||
reject<ErrorMsg, Pos>
|
||||
>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
30
install/boost_1_75_0/include/boost/metaparse/v1/fail.hpp
Normal file
30
install/boost_1_75_0/include/boost/metaparse/v1/fail.hpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef BOOST_METAPARSE_V1_FAIL_HPP
|
||||
#define BOOST_METAPARSE_V1_FAIL_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/reject.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class Msg>
|
||||
struct fail
|
||||
{
|
||||
typedef fail type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply : reject<Msg, Pos> {};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
#ifndef BOOST_METAPARSE_V1_FAIL_AT_FIRST_CHAR_EXPECTED_HPP
|
||||
#define BOOST_METAPARSE_V1_FAIL_AT_FIRST_CHAR_EXPECTED_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/impl/void_.hpp>
|
||||
#include <boost/metaparse/v1/accept.hpp>
|
||||
#include <boost/metaparse/v1/reject.hpp>
|
||||
#include <boost/metaparse/v1/is_error.hpp>
|
||||
#include <boost/metaparse/v1/get_position.hpp>
|
||||
|
||||
#include <boost/metaparse/v1/error/expected_to_fail.hpp>
|
||||
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/equal_to.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class P>
|
||||
struct fail_at_first_char_expected
|
||||
{
|
||||
private:
|
||||
template <class S, class Pos>
|
||||
struct apply_err :
|
||||
boost::mpl::eval_if<
|
||||
typename boost::mpl::equal_to<
|
||||
Pos,
|
||||
typename get_position<typename P::template apply<S, Pos> >::type
|
||||
>::type,
|
||||
accept<impl::void_, S, Pos>,
|
||||
typename P::template apply<S, Pos>
|
||||
>
|
||||
{};
|
||||
public:
|
||||
typedef fail_at_first_char_expected type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
boost::mpl::eval_if<
|
||||
typename is_error<typename P::template apply<S, Pos> >::type,
|
||||
apply_err<S, Pos>,
|
||||
reject<error::expected_to_fail, Pos>
|
||||
>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
42
install/boost_1_75_0/include/boost/metaparse/v1/fail_tag.hpp
Normal file
42
install/boost_1_75_0/include/boost/metaparse/v1/fail_tag.hpp
Normal file
@@ -0,0 +1,42 @@
|
||||
#ifndef BOOST_METAPARSE_V1_FAIL_TAG_HPP
|
||||
#define BOOST_METAPARSE_V1_FAIL_TAG_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2009 - 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/fwd/get_message.hpp>
|
||||
#include <boost/metaparse/v1/fwd/get_position.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
struct fail_tag { typedef fail_tag type; };
|
||||
|
||||
template <>
|
||||
struct get_message_impl<fail_tag>
|
||||
{
|
||||
template <class A>
|
||||
struct apply { typedef typename A::message type; };
|
||||
};
|
||||
|
||||
template <>
|
||||
struct get_position_impl<fail_tag>
|
||||
{
|
||||
template <class A>
|
||||
struct apply : A::source_position {};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
18
install/boost_1_75_0/include/boost/metaparse/v1/first_of.hpp
Normal file
18
install/boost_1_75_0/include/boost/metaparse/v1/first_of.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef BOOST_METAPARSE_V1_FIRST_OF_HPP
|
||||
#define BOOST_METAPARSE_V1_FIRST_OF_HPP
|
||||
|
||||
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
|
||||
// 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>
|
||||
|
||||
#if BOOST_METAPARSE_STD >= 2011
|
||||
# include <boost/metaparse/v1/cpp11/first_of.hpp>
|
||||
#else
|
||||
# include <boost/metaparse/v1/cpp98/first_of.hpp>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
65
install/boost_1_75_0/include/boost/metaparse/v1/foldl.hpp
Normal file
65
install/boost_1_75_0/include/boost/metaparse/v1/foldl.hpp
Normal file
@@ -0,0 +1,65 @@
|
||||
#ifndef BOOST_METAPARSE_V1_FOLDL_HPP
|
||||
#define BOOST_METAPARSE_V1_FOLDL_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/accept.hpp>
|
||||
#include <boost/metaparse/v1/is_error.hpp>
|
||||
#include <boost/metaparse/v1/get_position.hpp>
|
||||
#include <boost/metaparse/v1/get_result.hpp>
|
||||
#include <boost/metaparse/v1/get_remaining.hpp>
|
||||
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class P, class State, class ForwardOp>
|
||||
struct foldl
|
||||
{
|
||||
private:
|
||||
template <class Res>
|
||||
struct apply_unchecked :
|
||||
// foldl never returns error
|
||||
// I need to use apply_wrap, and not apply, because apply would
|
||||
// build a metafunction class from foldl<P, State, ForwardOp>
|
||||
// when ForwardOp is a lambda expression.
|
||||
foldl<
|
||||
P,
|
||||
typename ForwardOp::template apply<
|
||||
typename State::type,
|
||||
typename get_result<Res>::type
|
||||
>,
|
||||
ForwardOp
|
||||
>::template apply<
|
||||
typename get_remaining<Res>::type,
|
||||
typename get_position<Res>::type
|
||||
>
|
||||
{};
|
||||
|
||||
template <class S, class Pos>
|
||||
struct next_iteration : accept<typename State::type, S, Pos> {};
|
||||
public:
|
||||
typedef foldl type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
boost::mpl::eval_if<
|
||||
typename is_error<typename P::template apply<S, Pos> >::type,
|
||||
next_iteration<S, Pos>,
|
||||
apply_unchecked<typename P::template apply<S, Pos> >
|
||||
>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
38
install/boost_1_75_0/include/boost/metaparse/v1/foldl1.hpp
Normal file
38
install/boost_1_75_0/include/boost/metaparse/v1/foldl1.hpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef BOOST_METAPARSE_V1_FOLDL1_HPP
|
||||
#define BOOST_METAPARSE_V1_FOLDL1_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/foldl.hpp>
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class P, class State, class ForwardOp>
|
||||
struct foldl1
|
||||
{
|
||||
typedef foldl1 type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
boost::mpl::if_<
|
||||
is_error<typename P::template apply<S, Pos> >,
|
||||
P,
|
||||
foldl<P, State, ForwardOp>
|
||||
>::type::template apply<S, Pos>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
#ifndef BOOST_METAPARSE_V1_FOLDL_REJECT_INCOMPLETE_HPP
|
||||
#define BOOST_METAPARSE_V1_FOLDL_REJECT_INCOMPLETE_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/fail_at_first_char_expected.hpp>
|
||||
#include <boost/metaparse/v1/is_error.hpp>
|
||||
#include <boost/metaparse/v1/get_position.hpp>
|
||||
#include <boost/metaparse/v1/get_result.hpp>
|
||||
#include <boost/metaparse/v1/get_remaining.hpp>
|
||||
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/equal_to.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class P, class State, class ForwardOp>
|
||||
struct foldl_reject_incomplete
|
||||
{
|
||||
private:
|
||||
template <class Res>
|
||||
struct apply_unchecked :
|
||||
// I need to use apply_wrap, and not apply, because apply would
|
||||
// build a metafunction class from foldl<P, State, ForwardOp>
|
||||
// when ForwardOp is a lambda expression.
|
||||
foldl_reject_incomplete<
|
||||
P,
|
||||
typename ForwardOp::template apply<
|
||||
typename State::type,
|
||||
typename get_result<Res>::type
|
||||
>,
|
||||
ForwardOp
|
||||
>::template apply<
|
||||
typename get_remaining<Res>::type,
|
||||
typename get_position<Res>::type
|
||||
>
|
||||
{};
|
||||
|
||||
template <class S, class Pos>
|
||||
struct accept_state : accept<typename State::type, S, Pos> {};
|
||||
|
||||
template <class S, class Pos>
|
||||
struct end_of_folding :
|
||||
boost::mpl::eval_if<
|
||||
typename boost::mpl::equal_to<
|
||||
typename Pos::type,
|
||||
typename get_position<typename P::template apply<S, Pos> >::type
|
||||
>::type,
|
||||
accept_state<S, Pos>,
|
||||
typename P::template apply<S, Pos>
|
||||
>
|
||||
{};
|
||||
public:
|
||||
typedef foldl_reject_incomplete type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
boost::mpl::eval_if<
|
||||
typename is_error<typename P::template apply<S, Pos> >::type,
|
||||
end_of_folding<S, Pos>,
|
||||
apply_unchecked<typename P::template apply<S, Pos> >
|
||||
>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
#ifndef BOOST_METAPARSE_V1_FOLDL_REJECT_INCOMPLETE1_HPP
|
||||
#define BOOST_METAPARSE_V1_FOLDL_REJECT_INCOMPLETE1_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/foldl_reject_incomplete.hpp>
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class P, class State, class ForwardOp>
|
||||
struct foldl_reject_incomplete1
|
||||
{
|
||||
typedef foldl_reject_incomplete1 type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
boost::mpl::if_<
|
||||
is_error<typename P::template apply<S, Pos> >,
|
||||
P,
|
||||
foldl_reject_incomplete<P, State, ForwardOp>
|
||||
>::type::template apply<S, Pos>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
#ifndef BOOST_METAPARSE_V1_FOLDL_REJECT_INCOMPLETE_START_WITH_PARSER_HPP
|
||||
#define BOOST_METAPARSE_V1_FOLDL_REJECT_INCOMPLETE_START_WITH_PARSER_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/foldl_reject_incomplete.hpp>
|
||||
#include <boost/metaparse/v1/get_remaining.hpp>
|
||||
#include <boost/metaparse/v1/get_position.hpp>
|
||||
#include <boost/metaparse/v1/get_result.hpp>
|
||||
#include <boost/metaparse/v1/is_error.hpp>
|
||||
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class P, class StateP, class ForwardOp>
|
||||
class foldl_reject_incomplete_start_with_parser
|
||||
{
|
||||
private:
|
||||
template <class Res>
|
||||
struct apply_unchecked :
|
||||
foldl_reject_incomplete<
|
||||
P,
|
||||
typename get_result<Res>::type,
|
||||
ForwardOp
|
||||
>::template apply<
|
||||
typename get_remaining<Res>::type,
|
||||
typename get_position<Res>::type
|
||||
>
|
||||
{};
|
||||
public:
|
||||
typedef foldl_reject_incomplete_start_with_parser type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
boost::mpl::eval_if<
|
||||
typename is_error<typename StateP::template apply<S, Pos> >::type,
|
||||
typename StateP::template apply<S, Pos>,
|
||||
apply_unchecked<typename StateP::template apply<S, Pos> >
|
||||
>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
#ifndef BOOST_METAPARSE_V1_FOLDL_START_WITH_PARSER_HPP
|
||||
#define BOOST_METAPARSE_V1_FOLDL_START_WITH_PARSER_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/foldl.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace metaparse
|
||||
{
|
||||
namespace v1
|
||||
{
|
||||
template <class P, class StateP, class ForwardOp>
|
||||
class foldl_start_with_parser
|
||||
{
|
||||
private:
|
||||
template <class Res>
|
||||
struct apply_unchecked :
|
||||
foldl<P, typename get_result<Res>::type, ForwardOp>::template apply<
|
||||
typename get_remaining<Res>::type,
|
||||
typename get_position<Res>::type
|
||||
>
|
||||
{};
|
||||
public:
|
||||
typedef foldl_start_with_parser type;
|
||||
|
||||
template <class S, class Pos>
|
||||
struct apply :
|
||||
boost::mpl::eval_if<
|
||||
typename is_error<typename StateP::template apply<S, Pos> >::type,
|
||||
typename StateP::template apply<S, Pos>,
|
||||
apply_unchecked<typename StateP::template apply<S, Pos> >
|
||||
>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user