$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r61283 - in trunk/libs/spirit/example/scheme: . input test test/scheme test/sexpr
From: joel_at_[hidden]
Date: 2010-04-14 22:00:38
Author: djowel
Date: 2010-04-14 22:00:35 EDT (Wed, 14 Apr 2010)
New Revision: 61283
URL: http://svn.boost.org/trac/boost/changeset/61283
Log:
organizing folders
Added:
   trunk/libs/spirit/example/scheme/test/scheme/
   trunk/libs/spirit/example/scheme/test/scheme/factorial.scm   (contents, props changed)
   trunk/libs/spirit/example/scheme/test/scheme/scheme_test1.cpp   (contents, props changed)
   trunk/libs/spirit/example/scheme/test/scheme/scheme_test1.scm   (contents, props changed)
   trunk/libs/spirit/example/scheme/test/scheme/scheme_test2.cpp   (contents, props changed)
   trunk/libs/spirit/example/scheme/test/scheme/scheme_test3.cpp   (contents, props changed)
   trunk/libs/spirit/example/scheme/test/sexpr/
   trunk/libs/spirit/example/scheme/test/sexpr/out.txt   (contents, props changed)
   trunk/libs/spirit/example/scheme/test/sexpr/sexpr_input_test.cpp   (contents, props changed)
   trunk/libs/spirit/example/scheme/test/sexpr/sexpr_output_test.cpp   (contents, props changed)
   trunk/libs/spirit/example/scheme/test/sexpr/sexpr_test.txt   (contents, props changed)
Removed:
   trunk/libs/spirit/example/scheme/test/factorial.scm
   trunk/libs/spirit/example/scheme/test/out.txt
   trunk/libs/spirit/example/scheme/test/scheme_test1.cpp
   trunk/libs/spirit/example/scheme/test/scheme_test1.scm
   trunk/libs/spirit/example/scheme/test/scheme_test2.cpp
   trunk/libs/spirit/example/scheme/test/scheme_test3.cpp
   trunk/libs/spirit/example/scheme/test/sexpr_input_test.cpp
   trunk/libs/spirit/example/scheme/test/sexpr_output_test.cpp
   trunk/libs/spirit/example/scheme/test/sexpr_test.txt
Text files modified: 
   trunk/libs/spirit/example/scheme/input/parse_sexpr_impl.hpp |     6 ++----                                  
   trunk/libs/spirit/example/scheme/scheme_compiler.hpp        |     1 +                                       
   trunk/libs/spirit/example/scheme/scheme_interpreter.hpp     |     1 +                                       
   trunk/libs/spirit/example/scheme/scheme_intrinsics.hpp      |     1 +                                       
   4 files changed, 5 insertions(+), 4 deletions(-)
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-14 22:00:35 EDT (Wed, 14 Apr 2010)
@@ -19,7 +19,7 @@
 {
     ///////////////////////////////////////////////////////////////////////////
     template <typename Char>
-    inline bool parse_sexpr(std::basic_istream<Char>& is, utree& result)
+    bool parse_sexpr(std::basic_istream<Char>& is, utree& result)
     {
         // no white space skipping in the stream!
         is.unsetf(std::ios::skipws);
@@ -37,7 +37,7 @@
 
     ///////////////////////////////////////////////////////////////////////////
     template <typename Char>
-    inline bool parse_sexpr_list(std::basic_istream<Char>& is, utree& result)
+    bool parse_sexpr_list(std::basic_istream<Char>& is, utree& result)
     {
         // no white space skipping in the stream!
         is.unsetf(std::ios::skipws);
@@ -55,7 +55,6 @@
 
     ///////////////////////////////////////////////////////////////////////////
     template <typename Range>
-    inline
     typename boost::disable_if<boost::is_base_of<std::ios_base, Range>, bool>::type
     parse_sexpr(Range const& rng, utree& result)
     {
@@ -69,7 +68,6 @@
     }
 
     template <typename Range>
-    inline
     typename boost::disable_if<boost::is_base_of<std::ios_base, Range>, bool>::type
     parse_sexpr_list(Range const& rng, utree& result)
     {
Modified: trunk/libs/spirit/example/scheme/scheme_compiler.hpp
==============================================================================
--- trunk/libs/spirit/example/scheme/scheme_compiler.hpp	(original)
+++ trunk/libs/spirit/example/scheme/scheme_compiler.hpp	2010-04-14 22:00:35 EDT (Wed, 14 Apr 2010)
@@ -13,6 +13,7 @@
 
 #include "scheme_intrinsics.hpp"
 #include "scheme_interpreter.hpp"
+#include "input/parse_sexpr.hpp"
 
 namespace scheme
 {
Modified: trunk/libs/spirit/example/scheme/scheme_interpreter.hpp
==============================================================================
--- trunk/libs/spirit/example/scheme/scheme_interpreter.hpp	(original)
+++ trunk/libs/spirit/example/scheme/scheme_interpreter.hpp	2010-04-14 22:00:35 EDT (Wed, 14 Apr 2010)
@@ -13,6 +13,7 @@
 #include <boost/array.hpp>
 #include <boost/scoped_array.hpp>
 #include <boost/preprocessor/repetition/enum_params.hpp>
+#include "utree.hpp"
 
 #define SCHEME_COMPOSITE_LIMIT 10
 
Modified: trunk/libs/spirit/example/scheme/scheme_intrinsics.hpp
==============================================================================
--- trunk/libs/spirit/example/scheme/scheme_intrinsics.hpp	(original)
+++ trunk/libs/spirit/example/scheme/scheme_intrinsics.hpp	2010-04-14 22:00:35 EDT (Wed, 14 Apr 2010)
@@ -8,6 +8,7 @@
 #define BOOST_SPIRIT_SCHEME_INTRINSICS
 
 #include "scheme_interpreter.hpp"
+#include "utree_operators.hpp"
 
 namespace scheme
 {
Deleted: trunk/libs/spirit/example/scheme/test/factorial.scm
==============================================================================
--- trunk/libs/spirit/example/scheme/test/factorial.scm	2010-04-14 22:00:35 EDT (Wed, 14 Apr 2010)
+++ (empty file)
@@ -1,4 +0,0 @@
-; The hello-world for interpreters ;-)
-(define (factorial n)
-  (if (<= n 0) 1
-    (* n (factorial (- n 1)))))
Deleted: trunk/libs/spirit/example/scheme/test/out.txt
==============================================================================
--- trunk/libs/spirit/example/scheme/test/out.txt	2010-04-14 22:00:35 EDT (Wed, 14 Apr 2010)
+++ (empty file)
@@ -1,2 +0,0 @@
-success: (123.45 true false 255 63 "this is a ⬠string" "Τη γλÏÏÏα μοÏ
 ÎδÏÏαν ελληνική" b0123456789abcdef123456789abcdef (92 ("another string" apple Sîne)))
-
Added: trunk/libs/spirit/example/scheme/test/scheme/factorial.scm
==============================================================================
--- (empty file)
+++ trunk/libs/spirit/example/scheme/test/scheme/factorial.scm	2010-04-14 22:00:35 EDT (Wed, 14 Apr 2010)
@@ -0,0 +1,4 @@
+; The hello-world for interpreters ;-)
+(define (factorial n)
+  (if (<= n 0) 1
+    (* n (factorial (- n 1)))))
Added: trunk/libs/spirit/example/scheme/test/scheme/scheme_test1.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/spirit/example/scheme/test/scheme/scheme_test1.cpp	2010-04-14 22:00:35 EDT (Wed, 14 Apr 2010)
@@ -0,0 +1,112 @@
+/*=============================================================================
+    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)
+=============================================================================*/
+#include <boost/config/warning_disable.hpp>
+
+#include "../../input/parse_sexpr_impl.hpp"
+#include "../../scheme_compiler.hpp"
+#include "../../utree_io.hpp"
+#include <iostream>
+#include <fstream>
+
+///////////////////////////////////////////////////////////////////////////////
+//  Main program
+///////////////////////////////////////////////////////////////////////////////
+int main(int argc, char **argv)
+{
+    { // testing the c++ side
+
+        using scheme::if_;
+        using scheme::plus;
+        using scheme::times;
+        using scheme::minus;
+        using scheme::lte;
+        using scheme::_1;
+        using scheme::_2;
+        using scheme::lambda;
+
+        std::cout << "result: " << plus(11, 22, 33)         () << std::endl;
+        std::cout << "result: " << plus(11, 22, _1)         (33) << std::endl;
+        std::cout << "result: " << plus(11, _1, _2)         (22, 33) << std::endl;
+        std::cout << "result: " << plus(11, plus(_1, _2))   (22, 33) << std::endl;
+
+        lambda factorial;
+        factorial = if_(lte(_1, 0), 1, times(_1, factorial(minus(_1, 1))));
+
+        std::cout << "result: " << factorial(_1)            (10) << std::endl;
+    }
+
+    char const* filename = NULL;
+    if (argc > 1)
+    {
+        filename = argv[1];
+    }
+    else
+    {
+        std::cerr << "Error: No input file provided." << std::endl;
+        return 1;
+    }
+
+    std::ifstream in(filename, std::ios_base::in);
+
+    if (!in)
+    {
+        std::cerr << "Error: Could not open input file: "
+            << filename << std::endl;
+        return 1;
+    }
+
+    // Ignore the BOM marking the beginning of a UTF-8 file in Windows
+    char c = in.peek();
+    if (c == '\xef')
+    {
+        char s[3];
+        in >> s[0] >> s[1] >> s[2];
+        s[3] = '\0';
+        if (s != std::string("\xef\xbb\xbf"))
+        {
+            std::cerr << "Error: Unexpected characters from input file: "
+                << filename << std::endl;
+            return 1;
+        }
+    }
+
+    scheme::utree program;
+    if (scheme::input::parse_sexpr_list(in, program))
+    {
+        std::cout << "success: " << std::endl;
+        scheme::environment env;
+        scheme::build_basic_environment(env);
+        scheme::actor_list fragments;
+        scheme::actor_list flist;
+        compile_all(program, env, flist, fragments);
+
+        scheme::actor_list::iterator i = flist.begin();
+
+        std::cout << "the 1st is the define dbl:" << std::endl;
+        std::cout << "(dbl 555): " << (*i++)(555) << std::endl;
+        std::cout << "the 2nd is the define len:" << std::endl;
+        std::cout << "len: " << (*i++)() << std::endl;
+        std::cout << "the 3rd is a function call:" << std::endl;
+        std::cout << "(dbl len): " << (*i++)() << std::endl;
+        std::cout << "the 4th is the define factorial:" << std::endl;
+        std::cout << "(factorial 5): " << (*i++)(5) << std::endl;
+        std::cout << "the 5th is a function call:" << std::endl;
+        std::cout << "(factorial 10): " << (*i++)() << std::endl;
+        std::cout << "the 6th is the define fib:" << std::endl;
+        std::cout << "(fib 5): " << (*i++)(5) << std::endl;
+        std::cout << "the 7th is a function call:" << std::endl;
+        std::cout << "(fib 10): " << (*i++)() << std::endl;
+    }
+    else
+    {
+        std::cout << "parse error" << std::endl;
+    }
+
+    return 0;
+}
+
+
Added: trunk/libs/spirit/example/scheme/test/scheme/scheme_test1.scm
==============================================================================
--- (empty file)
+++ trunk/libs/spirit/example/scheme/test/scheme/scheme_test1.scm	2010-04-14 22:00:35 EDT (Wed, 14 Apr 2010)
@@ -0,0 +1,24 @@
+; These tests demostrate the functionality of the scheme
+; compiler/interpreter
+
+(define (dbl x) (+ x x))
+
+(define len 123)
+
+(dbl len) ; 246
+
+; The hello-world for interpreters ;-)
+(define (factorial n)
+  (if (<= n 0) 1
+    (* n (factorial (- n 1)))))
+
+(factorial 10) ; 3628800
+
+; Fibonacci using lambda
+(define fib
+  (lambda (n)
+    (if (< n 2)
+        n
+        (+ (fib (- n 1)) (fib (- n 2))))))
+
+(fib 10) ; 55
\ No newline at end of file
Added: trunk/libs/spirit/example/scheme/test/scheme/scheme_test2.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/spirit/example/scheme/test/scheme/scheme_test2.cpp	2010-04-14 22:00:35 EDT (Wed, 14 Apr 2010)
@@ -0,0 +1,53 @@
+/*=============================================================================
+    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)
+=============================================================================*/
+#include <boost/config/warning_disable.hpp>
+
+#include "../../scheme_compiler.hpp"
+#include "../../utree_io.hpp"
+#include <iostream>
+#include <fstream>
+
+///////////////////////////////////////////////////////////////////////////////
+//  Main program
+///////////////////////////////////////////////////////////////////////////////
+int main()
+{
+    char const* filename = "factorial.scm";
+    std::ifstream in(filename, std::ios_base::in);
+
+    if (!in)
+    {
+        std::cerr << "Error: Could not open input file: "
+            << filename << std::endl;
+        return 1;
+    }
+
+    // Ignore the BOM marking the beginning of a UTF-8 file in Windows
+    char c = in.peek();
+    if (c == '\xef')
+    {
+        char s[3];
+        in >> s[0] >> s[1] >> s[2];
+        s[3] = '\0';
+        if (s != std::string("\xef\xbb\xbf"))
+        {
+            std::cerr << "Error: Unexpected characters from input file: "
+                << filename << std::endl;
+            return 1;
+        }
+    }
+
+    using scheme::interpreter;
+    using scheme::_1;
+
+    scheme::interpreter factorial(in);
+    std::cout << factorial(10) << std::endl;
+
+    return 0;
+}
+
+
Added: trunk/libs/spirit/example/scheme/test/scheme/scheme_test3.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/spirit/example/scheme/test/scheme/scheme_test3.cpp	2010-04-14 22:00:35 EDT (Wed, 14 Apr 2010)
@@ -0,0 +1,28 @@
+/*=============================================================================
+    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)
+=============================================================================*/
+#include <boost/config/warning_disable.hpp>
+
+#include "../../scheme_compiler.hpp"
+#include "../../utree_io.hpp"
+
+///////////////////////////////////////////////////////////////////////////////
+//  Main program
+///////////////////////////////////////////////////////////////////////////////
+int main()
+{
+    using scheme::interpreter;
+    using scheme::_1;
+    using scheme::utree;
+
+    utree src = "(define (factorial n) (if (<= n 0) 1 (* n (factorial (- n 1)))))";
+    scheme::interpreter factorial(src);
+    std::cout << factorial(10) << std::endl;
+
+    return 0;
+}
+
+
Deleted: trunk/libs/spirit/example/scheme/test/scheme_test1.cpp
==============================================================================
--- trunk/libs/spirit/example/scheme/test/scheme_test1.cpp	2010-04-14 22:00:35 EDT (Wed, 14 Apr 2010)
+++ (empty file)
@@ -1,119 +0,0 @@
-/*=============================================================================
-    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)
-=============================================================================*/
-#include <boost/config/warning_disable.hpp>
-
-#include "../input/sexpr.hpp"
-#include "../input/parse_sexpr_impl.hpp"
-#include "../scheme_compiler.hpp"
-#include "../utree_io.hpp"
-#include <iostream>
-#include <fstream>
-
-inline std::ostream& println(std::ostream& out, scheme::utree const& val)
-{
-    out << val << std::endl;
-    return out;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//  Main program
-///////////////////////////////////////////////////////////////////////////////
-int main(int argc, char **argv)
-{
-    { // testing the c++ side
-
-        using scheme::if_;
-        using scheme::plus;
-        using scheme::times;
-        using scheme::minus;
-        using scheme::lte;
-        using scheme::_1;
-        using scheme::_2;
-        using scheme::lambda;
-
-        std::cout << "result: " << plus(11, 22, 33)         () << std::endl;
-        std::cout << "result: " << plus(11, 22, _1)         (33) << std::endl;
-        std::cout << "result: " << plus(11, _1, _2)         (22, 33) << std::endl;
-        std::cout << "result: " << plus(11, plus(_1, _2))   (22, 33) << std::endl;
-
-        lambda factorial;
-        factorial = if_(lte(_1, 0), 1, times(_1, factorial(minus(_1, 1))));
-
-        std::cout << "result: " << factorial(_1)            (10) << std::endl;
-    }
-
-    char const* filename = NULL;
-    if (argc > 1)
-    {
-        filename = argv[1];
-    }
-    else
-    {
-        std::cerr << "Error: No input file provided." << std::endl;
-        return 1;
-    }
-
-    std::ifstream in(filename, std::ios_base::in);
-
-    if (!in)
-    {
-        std::cerr << "Error: Could not open input file: "
-            << filename << std::endl;
-        return 1;
-    }
-
-    // Ignore the BOM marking the beginning of a UTF-8 file in Windows
-    char c = in.peek();
-    if (c == '\xef')
-    {
-        char s[3];
-        in >> s[0] >> s[1] >> s[2];
-        s[3] = '\0';
-        if (s != std::string("\xef\xbb\xbf"))
-        {
-            std::cerr << "Error: Unexpected characters from input file: "
-                << filename << std::endl;
-            return 1;
-        }
-    }
-
-    scheme::utree program;
-    if (scheme::input::parse_sexpr_list(in, program))
-    {
-        std::cout << "success: " << std::endl;
-        scheme::environment env;
-        scheme::build_basic_environment(env);
-        scheme::actor_list fragments;
-        scheme::actor_list flist;
-        compile_all(program, env, flist, fragments);
-
-        scheme::actor_list::iterator i = flist.begin();
-
-        std::cout << "the 1st is the define dbl:" << std::endl;
-        std::cout << "(dbl 555): " << (*i++)(555) << std::endl;
-        std::cout << "the 2nd is the define len:" << std::endl;
-        std::cout << "len: " << (*i++)() << std::endl;
-        std::cout << "the 3rd is a function call:" << std::endl;
-        std::cout << "(dbl len): " << (*i++)() << std::endl;
-        std::cout << "the 4th is the define factorial:" << std::endl;
-        std::cout << "(factorial 5): " << (*i++)(5) << std::endl;
-        std::cout << "the 5th is a function call:" << std::endl;
-        std::cout << "(factorial 10): " << (*i++)() << std::endl;
-        std::cout << "the 6th is the define fib:" << std::endl;
-        std::cout << "(fib 5): " << (*i++)(5) << std::endl;
-        std::cout << "the 7th is a function call:" << std::endl;
-        std::cout << "(fib 10): " << (*i++)() << std::endl;
-    }
-    else
-    {
-        std::cout << "parse error" << std::endl;
-    }
-
-    return 0;
-}
-
-
Deleted: trunk/libs/spirit/example/scheme/test/scheme_test1.scm
==============================================================================
--- trunk/libs/spirit/example/scheme/test/scheme_test1.scm	2010-04-14 22:00:35 EDT (Wed, 14 Apr 2010)
+++ (empty file)
@@ -1,24 +0,0 @@
-; These tests demostrate the functionality of the scheme
-; compiler/interpreter
-
-(define (dbl x) (+ x x))
-
-(define len 123)
-
-(dbl len) ; 246
-
-; The hello-world for interpreters ;-)
-(define (factorial n)
-  (if (<= n 0) 1
-    (* n (factorial (- n 1)))))
-
-(factorial 10) ; 3628800
-
-; Fibonacci using lambda
-(define fib
-  (lambda (n)
-    (if (< n 2)
-        n
-        (+ (fib (- n 1)) (fib (- n 2))))))
-
-(fib 10) ; 55
\ No newline at end of file
Deleted: trunk/libs/spirit/example/scheme/test/scheme_test2.cpp
==============================================================================
--- trunk/libs/spirit/example/scheme/test/scheme_test2.cpp	2010-04-14 22:00:35 EDT (Wed, 14 Apr 2010)
+++ (empty file)
@@ -1,55 +0,0 @@
-/*=============================================================================
-    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)
-=============================================================================*/
-#include <boost/config/warning_disable.hpp>
-
-#include "../input/sexpr.hpp"
-#include "../input/parse_sexpr_impl.hpp"
-#include "../scheme_compiler.hpp"
-#include "../utree_io.hpp"
-#include <iostream>
-#include <fstream>
-
-///////////////////////////////////////////////////////////////////////////////
-//  Main program
-///////////////////////////////////////////////////////////////////////////////
-int main()
-{
-    char const* filename = "factorial.scm";
-    std::ifstream in(filename, std::ios_base::in);
-
-    if (!in)
-    {
-        std::cerr << "Error: Could not open input file: "
-            << filename << std::endl;
-        return 1;
-    }
-
-    // Ignore the BOM marking the beginning of a UTF-8 file in Windows
-    char c = in.peek();
-    if (c == '\xef')
-    {
-        char s[3];
-        in >> s[0] >> s[1] >> s[2];
-        s[3] = '\0';
-        if (s != std::string("\xef\xbb\xbf"))
-        {
-            std::cerr << "Error: Unexpected characters from input file: "
-                << filename << std::endl;
-            return 1;
-        }
-    }
-
-    using scheme::interpreter;
-    using scheme::_1;
-
-    scheme::interpreter factorial(in);
-    std::cout << factorial(10) << std::endl;
-
-    return 0;
-}
-
-
Deleted: trunk/libs/spirit/example/scheme/test/scheme_test3.cpp
==============================================================================
--- trunk/libs/spirit/example/scheme/test/scheme_test3.cpp	2010-04-14 22:00:35 EDT (Wed, 14 Apr 2010)
+++ (empty file)
@@ -1,30 +0,0 @@
-/*=============================================================================
-    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)
-=============================================================================*/
-#include <boost/config/warning_disable.hpp>
-
-#include "../input/sexpr.hpp"
-#include "../input/parse_sexpr_impl.hpp"
-#include "../scheme_compiler.hpp"
-#include "../utree_io.hpp"
-
-///////////////////////////////////////////////////////////////////////////////
-//  Main program
-///////////////////////////////////////////////////////////////////////////////
-int main()
-{
-    using scheme::interpreter;
-    using scheme::_1;
-    using scheme::utree;
-
-    utree src = "(define (factorial n) (if (<= n 0) 1 (* n (factorial (- n 1)))))";
-    scheme::interpreter factorial(src);
-    std::cout << factorial(10) << std::endl;
-
-    return 0;
-}
-
-
Added: trunk/libs/spirit/example/scheme/test/sexpr/out.txt
==============================================================================
--- (empty file)
+++ trunk/libs/spirit/example/scheme/test/sexpr/out.txt	2010-04-14 22:00:35 EDT (Wed, 14 Apr 2010)
@@ -0,0 +1,2 @@
+success: (123.45 true false 255 63 "this is a ⬠string" "Τη γλÏÏÏα μοÏ
 ÎδÏÏαν ελληνική" b0123456789abcdef123456789abcdef (92 ("another string" apple Sîne)))
+
Added: trunk/libs/spirit/example/scheme/test/sexpr/sexpr_input_test.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/spirit/example/scheme/test/sexpr/sexpr_input_test.cpp	2010-04-14 22:00:35 EDT (Wed, 14 Apr 2010)
@@ -0,0 +1,76 @@
+/*=============================================================================
+    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)
+=============================================================================*/
+#include <boost/config/warning_disable.hpp>
+
+#include "../../input/sexpr.hpp"
+#include "../../input/parse_sexpr_impl.hpp"
+#include "../../utree_io.hpp"
+#include <iostream>
+#include <fstream>
+
+inline std::ostream& println(std::ostream& out, scheme::utree const& val)
+{
+    out << val << std::endl;
+    return out;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+//  Main program
+///////////////////////////////////////////////////////////////////////////////
+int main(int argc, char **argv)
+{
+    char const* filename = NULL;
+    if (argc > 1)
+    {
+        filename = argv[1];
+    }
+    else
+    {
+        std::cerr << "Error: No input file provided." << std::endl;
+        return 1;
+    }
+
+    std::ifstream in(filename, std::ios_base::in);
+
+    if (!in)
+    {
+        std::cerr << "Error: Could not open input file: "
+            << filename << std::endl;
+        return 1;
+    }
+
+    // Ignore the BOM marking the beginning of a UTF-8 file in Windows
+    char c = in.peek();
+    if (c == '\xef')
+    {
+        char s[3];
+        in >> s[0] >> s[1] >> s[2];
+        s[3] = '\0';
+        if (s != std::string("\xef\xbb\xbf"))
+        {
+            std::cerr << "Error: Unexpected characters from input file: "
+                << filename << std::endl;
+            return 1;
+        }
+    }
+
+    scheme::utree result;
+    if (scheme::input::parse_sexpr(in, result))
+    {
+        std::cout << "success: ";
+        println(std::cout, result);
+        std::cout << std::endl;
+    }
+    else
+    {
+        std::cout << "parse error" << std::endl;
+    }
+
+    return 0;
+}
+
+
Added: trunk/libs/spirit/example/scheme/test/sexpr/sexpr_output_test.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/spirit/example/scheme/test/sexpr/sexpr_output_test.cpp	2010-04-14 22:00:35 EDT (Wed, 14 Apr 2010)
@@ -0,0 +1,105 @@
+//  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_sexpr_impl.hpp"
+#include "../../output/generate_sexpr_impl.hpp"
+
+namespace client
+{
+    bool parse_sexpr_from_file(char const* filename, scheme::utree& result)
+    {
+        std::ifstream in(filename, std::ios_base::in);
+
+        if (!in)
+        {
+            std::cerr << "Error: Could not open input file: "
+                << filename << std::endl;
+            exit(-1);
+        }
+
+        // Ignore the BOM marking the beginning of a UTF-8 file in Windows
+        char c = in.peek();
+        if (c == '\xef')
+        {
+            char s[3];
+            in >> s[0] >> s[1] >> s[2];
+            s[3] = '\0';
+            if (s != std::string("\xef\xbb\xbf"))
+            {
+                std::cerr << "Error: Unexpected characters from input file: "
+                    << filename << std::endl;
+                exit(-1);
+            }
+        }
+
+        return scheme::input::parse_sexpr(in, result);
+    }
+
+    bool generate_sexpr_to_file(scheme::utree const& tree, char const* filename)
+    {
+        std::ofstream out(filename);
+
+        if (!out)
+        {
+            std::cerr << "Error: Could not open output file: "
+                << filename << std::endl;
+            exit(-1);
+        }
+
+        return scheme::output::generate_sexpr(out, tree);
+    }
+}
+
+int main(int argc, char **argv)
+{
+    char const* filename_in = NULL;
+    if (argc > 1)
+    {
+        filename_in = argv[1];
+    }
+    else
+    {
+        std::cerr << "Error: No input file provided." << std::endl;
+        return -1;
+    }
+
+    char const* filename_out = NULL;
+    if (argc > 2)
+    {
+        filename_out = argv[2];
+    }
+    else
+    {
+        std::cerr << "Error: No output file provided." << std::endl;
+        return -1;
+    }
+
+    scheme::utree result;
+    if (client::parse_sexpr_from_file(filename_in, result))
+    {
+        if (client::generate_sexpr_to_file(result, filename_out))
+        {
+            std::cout << "success!" << 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/sexpr/sexpr_test.txt
==============================================================================
--- (empty file)
+++ trunk/libs/spirit/example/scheme/test/sexpr/sexpr_test.txt	2010-04-14 22:00:35 EDT (Wed, 14 Apr 2010)
@@ -0,0 +1,13 @@
+(
+    123.45
+    true
+    false
+    0xFF
+    077
+    "this is a \u20AC string"           ; A UTF-8 string
+    "Τη γλÏÏÏα μοÏ
 ÎδÏÏαν ελληνική"     ; Another UTF-8 string
+	b0123456789ABCDEF0123456789abcdef	; A binary stream
+    (
+        92 ("another string" apple Sîne)
+    )
+)
\ No newline at end of file
Deleted: trunk/libs/spirit/example/scheme/test/sexpr_input_test.cpp
==============================================================================
--- trunk/libs/spirit/example/scheme/test/sexpr_input_test.cpp	2010-04-14 22:00:35 EDT (Wed, 14 Apr 2010)
+++ (empty file)
@@ -1,75 +0,0 @@
-/*=============================================================================
-    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)
-=============================================================================*/
-#include <boost/config/warning_disable.hpp>
-
-#include "../input/sexpr.hpp"
-#include "../input/parse_sexpr_impl.hpp"
-#include <iostream>
-#include <fstream>
-
-inline std::ostream& println(std::ostream& out, scheme::utree const& val)
-{
-    out << val << std::endl;
-    return out;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//  Main program
-///////////////////////////////////////////////////////////////////////////////
-int main(int argc, char **argv)
-{
-    char const* filename = NULL;
-    if (argc > 1)
-    {
-        filename = argv[1];
-    }
-    else
-    {
-        std::cerr << "Error: No input file provided." << std::endl;
-        return 1;
-    }
-
-    std::ifstream in(filename, std::ios_base::in);
-
-    if (!in)
-    {
-        std::cerr << "Error: Could not open input file: "
-            << filename << std::endl;
-        return 1;
-    }
-
-    // Ignore the BOM marking the beginning of a UTF-8 file in Windows
-    char c = in.peek();
-    if (c == '\xef')
-    {
-        char s[3];
-        in >> s[0] >> s[1] >> s[2];
-        s[3] = '\0';
-        if (s != std::string("\xef\xbb\xbf"))
-        {
-            std::cerr << "Error: Unexpected characters from input file: "
-                << filename << std::endl;
-            return 1;
-        }
-    }
-
-    scheme::utree result;
-    if (scheme::input::parse_sexpr(in, result))
-    {
-        std::cout << "success: ";
-        println(std::cout, result);
-        std::cout << std::endl;
-    }
-    else
-    {
-        std::cout << "parse error" << std::endl;
-    }
-
-    return 0;
-}
-
-
Deleted: trunk/libs/spirit/example/scheme/test/sexpr_output_test.cpp
==============================================================================
--- trunk/libs/spirit/example/scheme/test/sexpr_output_test.cpp	2010-04-14 22:00:35 EDT (Wed, 14 Apr 2010)
+++ (empty file)
@@ -1,105 +0,0 @@
-//  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_sexpr_impl.hpp"
-#include "../output/generate_sexpr_impl.hpp"
-
-namespace client
-{
-    bool parse_sexpr_from_file(char const* filename, scheme::utree& result)
-    {
-        std::ifstream in(filename, std::ios_base::in);
-
-        if (!in)
-        {
-            std::cerr << "Error: Could not open input file: "
-                << filename << std::endl;
-            exit(-1);
-        }
-
-        // Ignore the BOM marking the beginning of a UTF-8 file in Windows
-        char c = in.peek();
-        if (c == '\xef')
-        {
-            char s[3];
-            in >> s[0] >> s[1] >> s[2];
-            s[3] = '\0';
-            if (s != std::string("\xef\xbb\xbf"))
-            {
-                std::cerr << "Error: Unexpected characters from input file: "
-                    << filename << std::endl;
-                exit(-1);
-            }
-        }
-
-        return scheme::input::parse_sexpr(in, result);
-    }
-
-    bool generate_sexpr_to_file(scheme::utree const& tree, char const* filename)
-    {
-        std::ofstream out(filename);
-
-        if (!out)
-        {
-            std::cerr << "Error: Could not open output file: "
-                << filename << std::endl;
-            exit(-1);
-        }
-
-        return scheme::output::generate_sexpr(out, tree);
-    }
-}
-
-int main(int argc, char **argv)
-{
-    char const* filename_in = NULL;
-    if (argc > 1)
-    {
-        filename_in = argv[1];
-    }
-    else
-    {
-        std::cerr << "Error: No input file provided." << std::endl;
-        return -1;
-    }
-
-    char const* filename_out = NULL;
-    if (argc > 2)
-    {
-        filename_out = argv[2];
-    }
-    else
-    {
-        std::cerr << "Error: No output file provided." << std::endl;
-        return -1;
-    }
-
-    scheme::utree result;
-    if (client::parse_sexpr_from_file(filename_in, result))
-    {
-        if (client::generate_sexpr_to_file(result, filename_out))
-        {
-            std::cout << "success!" << std::endl;
-        }
-        else
-        {
-            std::cout << "generate error" << std::endl;
-        }
-    }
-    else
-    {
-        std::cout << "parse error" << std::endl;
-    }
-
-    return 0;
-}
Deleted: trunk/libs/spirit/example/scheme/test/sexpr_test.txt
==============================================================================
--- trunk/libs/spirit/example/scheme/test/sexpr_test.txt	2010-04-14 22:00:35 EDT (Wed, 14 Apr 2010)
+++ (empty file)
@@ -1,13 +0,0 @@
-(
-    123.45
-    true
-    false
-    0xFF
-    077
-    "this is a \u20AC string"           ; A UTF-8 string
-    "Τη γλÏÏÏα μοÏ
 ÎδÏÏαν ελληνική"     ; Another UTF-8 string
-	b0123456789ABCDEF0123456789abcdef	; A binary stream
-    (
-        92 ("another string" apple Sîne)
-    )
-)
\ No newline at end of file