diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2016-03-31 15:09:29 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2016-03-31 15:09:29 -0400 |
commit | 869912de45bfec53f8fd15c4f716b49ac2ca7aa4 (patch) | |
tree | 97934f62054ebb1f1c78812196f7c7bded1fc1b3 /src/third_party/boost-1.60.0/boost/spirit/home/classic/core/impl/parser.ipp | |
parent | 319e895cc28b4aade6fa843583e0fd2ea96cd7a0 (diff) | |
download | mongo-869912de45bfec53f8fd15c4f716b49ac2ca7aa4.tar.gz |
SERVER-17294 Boost 1.60
Diffstat (limited to 'src/third_party/boost-1.60.0/boost/spirit/home/classic/core/impl/parser.ipp')
-rw-r--r-- | src/third_party/boost-1.60.0/boost/spirit/home/classic/core/impl/parser.ipp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/third_party/boost-1.60.0/boost/spirit/home/classic/core/impl/parser.ipp b/src/third_party/boost-1.60.0/boost/spirit/home/classic/core/impl/parser.ipp new file mode 100644 index 00000000000..d5abe692faf --- /dev/null +++ b/src/third_party/boost-1.60.0/boost/spirit/home/classic/core/impl/parser.ipp @@ -0,0 +1,55 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + http://spirit.sourceforge.net/ + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_PARSER_IPP) +#define BOOST_SPIRIT_PARSER_IPP + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // Generic parse function implementation + // + /////////////////////////////////////////////////////////////////////////// + template <typename IteratorT, typename DerivedT> + inline parse_info<IteratorT> + parse( + IteratorT const& first_ + , IteratorT const& last + , parser<DerivedT> const& p) + { + IteratorT first = first_; + scanner<IteratorT, scanner_policies<> > scan(first, last); + match<nil_t> hit = p.derived().parse(scan); + return parse_info<IteratorT>( + first, hit, hit && (first == last), hit.length()); + } + + /////////////////////////////////////////////////////////////////////////// + // + // Parse function for null terminated strings implementation + // + /////////////////////////////////////////////////////////////////////////// + template <typename CharT, typename DerivedT> + inline parse_info<CharT const*> + parse(CharT const* str, parser<DerivedT> const& p) + { + CharT const* last = str; + while (*last) + last++; + return parse(str, last, p); + } + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit + +#endif + |