$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r61155 - in trunk/libs/spirit/example/scheme: detail input output test test/parse_qiexpr
From: hartmut.kaiser_at_[hidden]
Date: 2010-04-09 09:40:54
Author: hkaiser
Date: 2010-04-09 09:40:53 EDT (Fri, 09 Apr 2010)
New Revision: 61155
URL: http://svn.boost.org/trac/boost/changeset/61155
Log:
Spirit: added beginnings of Qi parser
Added:
   trunk/libs/spirit/example/scheme/input/parse_qiexpr.hpp   (contents, props changed)
   trunk/libs/spirit/example/scheme/input/parse_qiexpr_impl.hpp   (contents, props changed)
   trunk/libs/spirit/example/scheme/input/qiexpr.hpp   (contents, props changed)
   trunk/libs/spirit/example/scheme/input/string.hpp   (contents, props changed)
   trunk/libs/spirit/example/scheme/test/parse_qiexpr/
   trunk/libs/spirit/example/scheme/test/parse_qiexpr/generate_sexpr_to_ostream.cpp   (contents, props changed)
   trunk/libs/spirit/example/scheme/test/parse_qiexpr/input.txt   (contents, props changed)
   trunk/libs/spirit/example/scheme/test/parse_qiexpr/parse_qi_test.cpp   (contents, props changed)
   trunk/libs/spirit/example/scheme/test/parse_qiexpr/parse_qiexpr.cpp   (contents, props changed)
Text files modified: 
   trunk/libs/spirit/example/scheme/detail/utree_detail3.hpp   |     6 ++-                                     
   trunk/libs/spirit/example/scheme/input/parse_sexpr_impl.hpp |     4 +-                                      
   trunk/libs/spirit/example/scheme/input/sexpr.hpp            |    80 ++------------------------------------- 
   trunk/libs/spirit/example/scheme/output/sexpr.hpp           |     4 ++                                      
   trunk/libs/spirit/example/scheme/test/sexpr_input_test.cpp  |     2                                         
   trunk/libs/spirit/example/scheme/test/sexpr_output_test.cpp |     4 +-                                      
   6 files changed, 18 insertions(+), 82 deletions(-)
Modified: trunk/libs/spirit/example/scheme/detail/utree_detail3.hpp
==============================================================================
--- trunk/libs/spirit/example/scheme/detail/utree_detail3.hpp	(original)
+++ trunk/libs/spirit/example/scheme/detail/utree_detail3.hpp	2010-04-09 09:40:53 EDT (Fri, 09 Apr 2010)
@@ -73,7 +73,8 @@
             typedef boost::iterator_range<utree::iterator> type;
             static type call(utree const& x) 
             { 
-                return type(utree::iterator(x.l.first), utree::iterator(0)); 
+                return type(utree::iterator(x.l.first)
+                  , utree::iterator(0, x.l.last)); 
             }
         };
 
@@ -83,7 +84,8 @@
             typedef boost::iterator_range<utree::const_iterator> type;
             static type call(utree const& x) 
             { 
-                return type(utree::const_iterator(x.l.first), utree::const_iterator(0)); 
+                return type(utree::const_iterator(x.l.first)
+                    , utree::const_iterator(0, x.l.last)); 
             }
         };
 
Added: trunk/libs/spirit/example/scheme/input/parse_qiexpr.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/spirit/example/scheme/input/parse_qiexpr.hpp	2010-04-09 09:40:53 EDT (Fri, 09 Apr 2010)
@@ -0,0 +1,19 @@
+//  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)
+#define BOOST_SPIRIT_PARSE_QIEXPR
+
+#include "../utree.hpp"
+
+namespace scheme { namespace input
+{
+    template <typename String>
+    bool parse_qiexpr(String const& str, utree& result);
+}}
+
+#endif
+
+
Added: trunk/libs/spirit/example/scheme/input/parse_qiexpr_impl.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/spirit/example/scheme/input/parse_qiexpr_impl.hpp	2010-04-09 09:40:53 EDT (Fri, 09 Apr 2010)
@@ -0,0 +1,33 @@
+//  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 <iostream>
+#include <boost/spirit/include/support_istream_iterator.hpp>
+#include <boost/spirit/include/qi_parse.hpp>
+
+#include "../input/qiexpr.hpp"
+#include "../input/parse_qiexpr.hpp"
+
+namespace scheme { namespace input
+{
+    ///////////////////////////////////////////////////////////////////////////
+    template <typename String>
+    bool parse_qiexpr(String const& str, utree& result)
+    {
+        typedef typename String::const_iterator iterator_type;
+
+        scheme::input::qiexpr<iterator_type> p;
+        scheme::input::qiexpr_white_space<iterator_type> ws;
+
+        return phrase_parse(str.begin(), str.end(), p, ws, result);
+    }
+}}
+
+#endif
+
+
Modified: trunk/libs/spirit/example/scheme/input/parse_sexpr_impl.hpp
==============================================================================
--- trunk/libs/spirit/example/scheme/input/parse_sexpr_impl.hpp	(original)
+++ trunk/libs/spirit/example/scheme/input/parse_sexpr_impl.hpp	2010-04-09 09:40:53 EDT (Fri, 09 Apr 2010)
@@ -27,7 +27,7 @@
         iterator_type last;
 
         scheme::input::sexpr<iterator_type> p;
-        scheme::input::white_space<iterator_type> ws;
+        scheme::input::sexpr_white_space<iterator_type> ws;
 
         return phrase_parse(first, last, p, ws, result);
     }
@@ -44,7 +44,7 @@
         iterator_type last;
 
         scheme::input::sexpr<iterator_type> p;
-        scheme::input::white_space<iterator_type> ws;
+        scheme::input::sexpr_white_space<iterator_type> ws;
 
         return phrase_parse(first, last, +p, ws, result);
     }
Added: trunk/libs/spirit/example/scheme/input/qiexpr.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/spirit/example/scheme/input/qiexpr.hpp	2010-04-09 09:40:53 EDT (Fri, 09 Apr 2010)
@@ -0,0 +1,127 @@
+//  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_QIEXPR)
+#define BOOST_SPIRIT_QIEXPR
+
+#include <string>
+
+#include <boost/cstdint.hpp>
+#include <boost/detail/iterator.hpp>
+#include <boost/spirit/include/qi.hpp>
+#include <boost/spirit/include/phoenix_core.hpp>
+#include <boost/spirit/include/phoenix_stl.hpp>
+
+#include "../utree.hpp"
+#include "../utree_operators.hpp"
+#include "string.hpp"
+
+namespace scheme { namespace input
+{
+    using boost::spirit::ascii::space;
+    using boost::spirit::qi::grammar;
+    using boost::spirit::qi::rule;
+    using boost::spirit::qi::symbols;
+    using boost::spirit::qi::eol;
+    using boost::spirit::qi::_val;
+    using boost::spirit::qi::_1;
+    using boost::phoenix::push_back;
+
+    ///////////////////////////////////////////////////////////////////////////
+    template <typename Iterator>
+    struct qiexpr_white_space : grammar<Iterator>
+    {
+        qiexpr_white_space() : qiexpr_white_space::base_type(start)
+        {
+            start =
+                    space                           // tab/space/cr/lf
+                |   "//" >> *(char_ - eol) >> eol   // comments
+                |   "/*" >> *(char_ - "*/") >> "*/"
+                ;
+
+//             start.name("ws"); debug(start);
+        }
+
+        rule<Iterator> start;
+    };
+
+    ///////////////////////////////////////////////////////////////////////////
+    // a list of names for all supported parser primitives taking no parameters
+    static char const* const primitives0[] = 
+    {
+        "char_"
+      , "long_long", "long_", "int_", "short_"
+      , "ulong_long", "ulong_", "uint_", "ushort_"
+      , "bool_", "true_", "false_"
+      , "long_double", "double_", "float_"
+      , 0
+    };
+
+    // a list of names for all supported parser primitives taking 1 parameter
+    static char const* const primitives1[] = 
+    {
+        "char_", "lit", "string"
+      , 0
+    };
+
+    // a list of names for all supported parser primitives taking 2 parameter
+    static char const* const primitives2[] = 
+    {
+        "char_"
+      , 0
+    };
+
+    ///////////////////////////////////////////////////////////////////////////
+    template <typename Iterator>
+    struct qiexpr : grammar<Iterator, qiexpr_white_space<Iterator>, utree()>
+    {
+        typedef typename boost::detail::iterator_traits<Iterator>::value_type 
+            char_type;
+
+        qiexpr() : qiexpr::base_type(start)
+        {
+            start = *expr;
+
+            expr =
+                    primitive2 >> '(' >> literal >> ',' >> literal >> ')'
+                |   primitive1 >> '(' >> literal >> ')'
+                |   primitive0        // taking no parameter
+                ;
+
+            literal = 
+                    string_lit            [ push_back(_val, _1) ]
+                |   string_lit.char_lit   [ push_back(_val, _1) ]
+                ;
+
+            // fill the symbol tables with all known primitive parser names
+            for (char const* const* p = primitives0; *p; ++p)
+            {
+                utree l;
+                l.push_back(utf8_symbol(*p));
+                primitive0.add(*p, l);
+            }
+
+            for (char const* const* p = primitives1; *p; ++p)
+            {
+                utree l;
+                l.push_back(utf8_symbol(*p));
+                primitive1.add(*p, l);
+            }
+
+            for (char const* const* p = primitives2; *p; ++p)
+            {
+                utree l;
+                l.push_back(utf8_symbol(*p));
+                primitive2.add(*p, l);
+            }
+        }
+
+        rule<Iterator, qiexpr_white_space<Iterator>, utree()> start, expr, literal;
+        symbols<char_type, utree> primitive0, primitive1, primitive2;
+        scheme::input::string<Iterator> string_lit;
+    };
+}}
+
+#endif
Modified: trunk/libs/spirit/example/scheme/input/sexpr.hpp
==============================================================================
--- trunk/libs/spirit/example/scheme/input/sexpr.hpp	(original)
+++ trunk/libs/spirit/example/scheme/input/sexpr.hpp	2010-04-09 09:40:53 EDT (Fri, 09 Apr 2010)
@@ -19,6 +19,7 @@
 
 #include "../utree.hpp"
 #include "../utree_operators.hpp"
+#include "string.hpp"
 
 namespace scheme { namespace input
 {
@@ -27,28 +28,23 @@
     using boost::spirit::qi::grammar;
     using boost::spirit::qi::rule;
     using boost::spirit::qi::eol;
-    using boost::spirit::qi::_val;
-    using boost::spirit::qi::_r1;
-    using boost::spirit::qi::_1;
     using boost::spirit::qi::uint_parser;
     using boost::spirit::qi::real_parser;
     using boost::spirit::qi::strict_real_policies;
-    using boost::spirit::qi::char_set;
     using boost::spirit::qi::int_;
     using boost::spirit::qi::hex;
     using boost::spirit::qi::oct;
     using boost::spirit::qi::bool_;
     using boost::spirit::qi::no_case;
     using boost::spirit::qi::lexeme;
-    using boost::spirit::qi::lit;
     using boost::phoenix::function;
 
     typedef boost::uint32_t uchar; // a unicode code point
 
     template <typename Iterator>
-    struct white_space : grammar<Iterator>
+    struct sexpr_white_space : grammar<Iterator>
     {
-        white_space() : white_space::base_type(start)
+        sexpr_white_space() : sexpr_white_space::base_type(start)
         {
             start =
                     space                           // tab/space/cr/lf
@@ -59,74 +55,8 @@
         rule<Iterator> start;
     };
 
-    namespace detail
-    {
-        struct push_utf8
-        {
-            template <typename S, typename C>
-            struct result { typedef void type; };
-
-            void operator()(std::string& utf8, uchar code_point) const
-            {
-                typedef std::back_insert_iterator<std::string> insert_iter;
-                insert_iter out_iter(utf8);
-                boost::utf8_output_iterator<insert_iter> utf8_iter(out_iter);
-                *utf8_iter++ = code_point;
-            }
-        };
-
-        struct push_esc
-        {
-            template <typename S, typename C>
-            struct result { typedef void type; };
-
-            void operator()(std::string& utf8, uchar c) const
-            {
-                switch (c)
-                {
-                    case 'b': utf8 += '\b';     break;
-                    case 't': utf8 += '\t';     break;
-                    case 'n': utf8 += '\n';     break;
-                    case 'f': utf8 += '\f';     break;
-                    case 'r': utf8 += '\r';     break;
-                    case '"': utf8 += '"';      break;
-                    case '\\': utf8 += '\\';    break;
-                }
-            }
-        };
-    }
-
-    template <typename Iterator>
-    struct string : grammar<Iterator, std::string()>
-    {
-        string() : string::base_type(start)
-        {
-            uint_parser<uchar, 16, 4, 4> hex4;
-            uint_parser<uchar, 16, 8, 8> hex8;
-            function<detail::push_utf8> push_utf8;
-            function<detail::push_esc> push_esc;
-
-            str_esc
-                =  '\\'
-                >>  (   ('u' >> hex4)               [push_utf8(_r1, _1)]
-                    |   ('U' >> hex8)               [push_utf8(_r1, _1)]
-                    |   char_("btnfr\\\"'")         [push_esc(_r1, _1)]
-                    )
-                ;
-
-            start
-                = '"'
-                >> *(str_esc(_val) | (~char_('"'))  [_val += _1])
-                >> '"'
-                ;
-        }
-
-        rule<Iterator, void(std::string&)> str_esc;
-        rule<Iterator, std::string()> start;
-    };
-
     template <typename Iterator>
-    struct sexpr : grammar<Iterator, white_space<Iterator>, utree()>
+    struct sexpr : grammar<Iterator, sexpr_white_space<Iterator>, utree()>
     {
         sexpr() : sexpr::base_type(start)
         {
@@ -156,7 +86,7 @@
             byte_str = lexeme[no_case['b'] >> +hex2];
         }
 
-        rule<Iterator, white_space<Iterator>, utree()> start, list;
+        rule<Iterator, sexpr_white_space<Iterator>, utree()> start, list;
         rule<Iterator, int()> integer;
         rule<Iterator, utree()> atom;
         rule<Iterator, utf8_symbol()> symbol;
Added: trunk/libs/spirit/example/scheme/input/string.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/spirit/example/scheme/input/string.hpp	2010-04-09 09:40:53 EDT (Fri, 09 Apr 2010)
@@ -0,0 +1,110 @@
+/*=============================================================================
+    Copyright (c) 2001-2010 Joel de Guzman
+
+    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_SEXPR_STRING)
+#define BOOST_SPIRIT_SEXPR_STRING
+
+#include <string>
+
+#include <boost/cstdint.hpp>
+#include <boost/spirit/include/qi.hpp>
+#include <boost/spirit/include/phoenix_core.hpp>
+#include <boost/spirit/include/phoenix_container.hpp>
+#include <boost/spirit/include/phoenix_statement.hpp>
+#include <boost/spirit/include/phoenix_operator.hpp>
+#include <boost/regex/pending/unicode_iterator.hpp>
+
+#include "../utree.hpp"
+#include "../utree_operators.hpp"
+
+namespace scheme { namespace input
+{
+    using boost::spirit::ascii::char_;
+    using boost::spirit::qi::grammar;
+    using boost::spirit::qi::rule;
+    using boost::spirit::qi::_val;
+    using boost::spirit::qi::_r1;
+    using boost::spirit::qi::_1;
+    using boost::spirit::qi::uint_parser;
+    using boost::phoenix::function;
+
+    typedef boost::uint32_t uchar; // a unicode code point
+
+    namespace detail
+    {
+        struct push_utf8
+        {
+            template <typename S, typename C>
+            struct result { typedef void type; };
+
+            void operator()(std::string& utf8, uchar code_point) const
+            {
+                typedef std::back_insert_iterator<std::string> insert_iter;
+                insert_iter out_iter(utf8);
+                boost::utf8_output_iterator<insert_iter> utf8_iter(out_iter);
+                *utf8_iter++ = code_point;
+            }
+        };
+
+        struct push_esc
+        {
+            template <typename S, typename C>
+            struct result { typedef void type; };
+
+            void operator()(std::string& utf8, uchar c) const
+            {
+                switch (c)
+                {
+                    case 'b': utf8 += '\b';     break;
+                    case 't': utf8 += '\t';     break;
+                    case 'n': utf8 += '\n';     break;
+                    case 'f': utf8 += '\f';     break;
+                    case 'r': utf8 += '\r';     break;
+                    case '"': utf8 += '"';      break;
+                    case '\\': utf8 += '\\';    break;
+                }
+            }
+        };
+    }
+
+    template <typename Iterator>
+    struct string : grammar<Iterator, std::string()>
+    {
+        string() : string::base_type(start)
+        {
+            uint_parser<uchar, 16, 4, 4> hex4;
+            uint_parser<uchar, 16, 8, 8> hex8;
+            function<detail::push_utf8> push_utf8;
+            function<detail::push_esc> push_esc;
+
+            char_esc
+                =  '\\'
+                >>  (   ('u' >> hex4)               [push_utf8(_r1, _1)]
+                    |   ('U' >> hex8)               [push_utf8(_r1, _1)]
+                    |   char_("btnfr\\\"'")         [push_esc(_r1, _1)]
+                    )
+                ;
+
+            char_lit
+                =  '\''
+                >> (char_esc(_val) | (~char_('\'')) [_val += _1])
+                >> '\''
+                ;
+
+            start
+                =  '"'
+                >> *(char_esc(_val) | (~char_('"')) [_val += _1])
+                >> '"'
+                ;
+        }
+
+        rule<Iterator, void(std::string&)> char_esc;
+        rule<Iterator, std::string()> char_lit;
+        rule<Iterator, std::string()> start;
+    };
+}}
+
+#endif
Modified: trunk/libs/spirit/example/scheme/output/sexpr.hpp
==============================================================================
--- trunk/libs/spirit/example/scheme/output/sexpr.hpp	(original)
+++ trunk/libs/spirit/example/scheme/output/sexpr.hpp	2010-04-09 09:40:53 EDT (Fri, 09 Apr 2010)
@@ -144,6 +144,7 @@
     using boost::spirit::karma::int_;
     using boost::spirit::karma::char_;
     using boost::spirit::karma::bool_;
+    using boost::spirit::karma::eps;
     using boost::spirit::karma::space_type;
     using boost::spirit::karma::uint_generator;
 
@@ -163,6 +164,7 @@
                       | symbol
                       | byte_str
                       | list
+                      | nil_
                       ;
 
             list      = '(' << *start << ')';
@@ -170,6 +172,7 @@
             string    = '"' << *char_ << '"';
             symbol    = *char_;
             byte_str  = 'b' << *hex2;
+            nil_      = eps;
         }
 
         typedef boost::iterator_range<utree::const_iterator> utree_list;
@@ -179,6 +182,7 @@
         rule<OutputIterator, utf8_symbol_range()> symbol;
         rule<OutputIterator, utf8_string_range()> string;
         rule<OutputIterator, binary_range()> byte_str;
+        rule<OutputIterator, nil()> nil_;
     };
 }}
 
Added: trunk/libs/spirit/example/scheme/test/parse_qiexpr/generate_sexpr_to_ostream.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/spirit/example/scheme/test/parse_qiexpr/generate_sexpr_to_ostream.cpp	2010-04-09 09:40:53 EDT (Fri, 09 Apr 2010)
@@ -0,0 +1,16 @@
+//  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)
+
+#include <fstream>
+
+#include "../../output/generate_sexpr.hpp"
+#include "../../output/generate_sexpr_impl.hpp"
+
+// explicit template instantiation for the function parse_sexpr 
+namespace scheme { namespace output
+{
+    template bool generate_sexpr(BOOST_TYPEOF(std::cout)&, utree const& result);
+}}
+
Added: trunk/libs/spirit/example/scheme/test/parse_qiexpr/input.txt
==============================================================================
--- (empty file)
+++ trunk/libs/spirit/example/scheme/test/parse_qiexpr/input.txt	2010-04-09 09:40:53 EDT (Fri, 09 Apr 2010)
@@ -0,0 +1,9 @@
+//  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)
+ 
+char_("abc")
+char_
+char_('a')
+char_('a', 'b')
Added: trunk/libs/spirit/example/scheme/test/parse_qiexpr/parse_qi_test.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/spirit/example/scheme/test/parse_qiexpr/parse_qi_test.cpp	2010-04-09 09:40:53 EDT (Fri, 09 Apr 2010)
@@ -0,0 +1,47 @@
+//  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)
+
+#include <boost/config/warning_disable.hpp>
+
+#define BOOST_SPIRIT_UNICODE
+
+#include <iostream>
+#include <fstream>
+#include <iterator>
+
+#include "../../input/parse_qiexpr.hpp"
+#include "../../output/generate_sexpr.hpp"
+
+///////////////////////////////////////////////////////////////////////////////
+//  Main program
+///////////////////////////////////////////////////////////////////////////////
+int main(int argc, char **argv)
+{
+    std::string str;
+    while (std::getline(std::cin, str))
+    {
+        if (str.empty() || str[0] == 'q' || str[0] == 'Q')
+            break;
+        str += '\n';
+
+        scheme::utree result;
+        if (scheme::input::parse_qiexpr(str, result))
+        {
+            if (scheme::output::generate_sexpr(std::cout, result))
+            {
+                std::cout << std::endl;
+            }
+            else
+            {
+                std::cout << "generate error" << std::endl;
+            }
+        }
+        else
+        {
+            std::cout << "parse error" << std::endl;
+        }
+    }
+    return 0;
+}
Added: trunk/libs/spirit/example/scheme/test/parse_qiexpr/parse_qiexpr.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/spirit/example/scheme/test/parse_qiexpr/parse_qiexpr.cpp	2010-04-09 09:40:53 EDT (Fri, 09 Apr 2010)
@@ -0,0 +1,16 @@
+//  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)
+
+#include <fstream>
+
+#include "../../input/parse_qiexpr.hpp"
+#include "../../input/parse_qiexpr_impl.hpp"
+
+// explicit template instantiation for the function parse_sexpr 
+namespace scheme { namespace input
+{
+    template bool parse_qiexpr(std::string const&, utree& result);
+}}
+
Modified: trunk/libs/spirit/example/scheme/test/sexpr_input_test.cpp
==============================================================================
--- trunk/libs/spirit/example/scheme/test/sexpr_input_test.cpp	(original)
+++ trunk/libs/spirit/example/scheme/test/sexpr_input_test.cpp	2010-04-09 09:40:53 EDT (Fri, 09 Apr 2010)
@@ -22,7 +22,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 int main(int argc, char **argv)
 {
-    char const* filename;
+    char const* filename = NULL;
     if (argc > 1)
     {
         filename = argv[1];
Modified: trunk/libs/spirit/example/scheme/test/sexpr_output_test.cpp
==============================================================================
--- trunk/libs/spirit/example/scheme/test/sexpr_output_test.cpp	(original)
+++ trunk/libs/spirit/example/scheme/test/sexpr_output_test.cpp	2010-04-09 09:40:53 EDT (Fri, 09 Apr 2010)
@@ -62,7 +62,7 @@
 
 int main(int argc, char **argv)
 {
-    char const* filename_in;
+    char const* filename_in = NULL;
     if (argc > 1)
     {
         filename_in = argv[1];
@@ -73,7 +73,7 @@
         return -1;
     }
 
-    char const* filename_out;
+    char const* filename_out = NULL;
     if (argc > 2)
     {
         filename_out = argv[2];