Imported Upstream version 1.51.0
[platform/upstream/boost.git] / libs / spirit / example / scheme / example / generate_qiexpr / generate_sexpr_to_ostream.cpp
1 //  Copyright (c) 2001-2010 Hartmut Kaiser
2 // 
3 //  Distributed under the Boost Software License, Version 1.0. (See accompanying 
4 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6 #include <output/generate_sexpr.hpp>
7 #include <output/generate_sexpr_impl.hpp>
8
9 #include <fstream>
10
11 ///////////////////////////////////////////////////////////////////////////////
12 // explicit template instantiation for the function parse_sexpr 
13 namespace scheme { namespace output
14 {
15     template bool generate_sexpr(BOOST_TYPEOF(std::cout)&, utree const& result);
16     template bool generate_sexpr_list(BOOST_TYPEOF(std::cout)&, utree const& result);
17     template bool generate_sexpr(std::string& str, utree const& result);
18     template bool generate_sexpr_list(std::string& str, utree const& result);
19 }}
20
21 ///////////////////////////////////////////////////////////////////////////////
22 // this is needed if grammar debugging is on
23 namespace boost { namespace spirit { namespace traits
24 {
25     void print_attribute(std::ostream& out, boost::spirit::utree const& val)
26     {
27         scheme::output::generate_sexpr(out, val);
28     }
29 }}}