/*============================================================================= 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 inline parse_info parse( IteratorT const& first_ , IteratorT const& last , parser const& p) { IteratorT first = first_; scanner > scan(first, last); match hit = p.derived().parse(scan); return parse_info( first, hit, hit && (first == last), hit.length()); } /////////////////////////////////////////////////////////////////////////// // // Parse function for null terminated strings implementation // /////////////////////////////////////////////////////////////////////////// template inline parse_info parse(CharT const* str, parser const& p) { CharT const* last = str; while (*last) last++; return parse(str, last, p); } BOOST_SPIRIT_CLASSIC_NAMESPACE_END }} // namespace boost::spirit #endif