// Copyright (c) 2001-2010 Hartmut Kaiser // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #if !defined(BOOST_SPIRIT_PARSE_QIEXPR_IMPL) #define BOOST_SPIRIT_PARSE_QIEXPR_IMPL #include #include #include #include #include namespace scheme { namespace input { /////////////////////////////////////////////////////////////////////////// template bool parse_qi_expr(String const& str, utree& result) { typedef typename String::const_iterator iterator_type; scheme::qi::qiexpr_parser p; scheme::qi::qiexpr_white_space ws; iterator_type begin = str.begin(); iterator_type end = str.end(); return phrase_parse(begin, end, p, ws, result) && begin == end; } /////////////////////////////////////////////////////////////////////////// template bool parse_qi_rule(String const& str, utree& result) { typedef typename String::const_iterator iterator_type; scheme::qi::qiexpr_parser p; scheme::qi::qiexpr_white_space ws; iterator_type begin = str.begin(); iterator_type end = str.end(); return phrase_parse(begin, end, p.rule_, ws, result) && begin == end; } /////////////////////////////////////////////////////////////////////////// template bool parse_qi_grammar(String const& str, utree& result) { typedef typename String::const_iterator iterator_type; scheme::qi::qiexpr_parser p; scheme::qi::qiexpr_white_space ws; iterator_type begin = str.begin(); iterator_type end = str.end(); return phrase_parse(begin, end, p.grammar_, ws, result) && begin == end; } }} #endif