Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71866 - in trunk/libs/spirit/example/qi/compiler_tutorial: . calc7 calc8 conjure mini_c
From: joel_at_[hidden]
Date: 2011-05-10 21:02:48


Author: djowel
Date: 2011-05-10 21:02:46 EDT (Tue, 10 May 2011)
New Revision: 71866
URL: http://svn.boost.org/trac/boost/changeset/71866

Log:
provided printing for nil
Text files modified:
   trunk/libs/spirit/example/qi/compiler_tutorial/calc5.cpp | 7 +++++++
   trunk/libs/spirit/example/qi/compiler_tutorial/calc6.cpp | 7 +++++++
   trunk/libs/spirit/example/qi/compiler_tutorial/calc7/compiler.hpp | 4 ++--
   trunk/libs/spirit/example/qi/compiler_tutorial/calc7/main.cpp | 4 ++++
   trunk/libs/spirit/example/qi/compiler_tutorial/calc8/compiler.hpp | 4 ++--
   trunk/libs/spirit/example/qi/compiler_tutorial/calc8/main.cpp | 4 ++++
   trunk/libs/spirit/example/qi/compiler_tutorial/conjure/compiler.hpp | 4 ++--
   trunk/libs/spirit/example/qi/compiler_tutorial/conjure/main.cpp | 4 ++++
   trunk/libs/spirit/example/qi/compiler_tutorial/mini_c/main.cpp | 4 ++++
   9 files changed, 36 insertions(+), 6 deletions(-)

Modified: trunk/libs/spirit/example/qi/compiler_tutorial/calc5.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/compiler_tutorial/calc5.cpp (original)
+++ trunk/libs/spirit/example/qi/compiler_tutorial/calc5.cpp 2011-05-10 21:02:46 EDT (Tue, 10 May 2011)
@@ -24,6 +24,10 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 ///////////////////////////////////////////////////////////////////////////////
+// Define this to enable debugging
+#define BOOST_SPIRIT_QI_DEBUG
+
+///////////////////////////////////////////////////////////////////////////////
 // Uncomment this if you want to enable debugging
 //#define BOOST_SPIRIT_QI_DEBUG
 ///////////////////////////////////////////////////////////////////////////////
@@ -77,6 +81,9 @@
         operand first;
         std::list<operation> rest;
     };
+
+ // print function for debugging
+ inline std::ostream& operator<<(std::ostream& out, nil) { out << "nil"; return out; }
 }}
 
 BOOST_FUSION_ADAPT_STRUCT(

Modified: trunk/libs/spirit/example/qi/compiler_tutorial/calc6.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/compiler_tutorial/calc6.cpp (original)
+++ trunk/libs/spirit/example/qi/compiler_tutorial/calc6.cpp 2011-05-10 21:02:46 EDT (Tue, 10 May 2011)
@@ -27,6 +27,10 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 ///////////////////////////////////////////////////////////////////////////////
+// Define this to enable debugging
+//#define BOOST_SPIRIT_QI_DEBUG
+
+///////////////////////////////////////////////////////////////////////////////
 // Uncomment this if you want to enable debugging
 //#define BOOST_SPIRIT_QI_DEBUG
 ///////////////////////////////////////////////////////////////////////////////
@@ -80,6 +84,9 @@
         operand first;
         std::list<operation> rest;
     };
+
+ // print function for debugging
+ inline std::ostream& operator<<(std::ostream& out, nil) { out << "nil"; return out; }
 }}
 
 BOOST_FUSION_ADAPT_STRUCT(

Modified: trunk/libs/spirit/example/qi/compiler_tutorial/calc7/compiler.hpp
==============================================================================
--- trunk/libs/spirit/example/qi/compiler_tutorial/calc7/compiler.hpp (original)
+++ trunk/libs/spirit/example/qi/compiler_tutorial/calc7/compiler.hpp 2011-05-10 21:02:46 EDT (Tue, 10 May 2011)
@@ -57,11 +57,11 @@
           : program(program)
         {
             using namespace boost::phoenix::arg_names;
- using boost::phoenix::cref;
+ namespace phx = boost::phoenix;
             using boost::phoenix::function;
 
             error_handler = function<ErrorHandler>(error_handler_)(
- "Error! ", _2, cref(error_handler_.iters)[_1]);
+ "Error! ", _2, phx::cref(error_handler_.iters)[_1]);
         }
 
         bool operator()(ast::nil) const { BOOST_ASSERT(0); return false; }

Modified: trunk/libs/spirit/example/qi/compiler_tutorial/calc7/main.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/compiler_tutorial/calc7/main.cpp (original)
+++ trunk/libs/spirit/example/qi/compiler_tutorial/calc7/main.cpp 2011-05-10 21:02:46 EDT (Tue, 10 May 2011)
@@ -18,6 +18,10 @@
 //
 ///////////////////////////////////////////////////////////////////////////////
 
+///////////////////////////////////////////////////////////////////////////////
+// Define this to enable debugging
+//#define BOOST_SPIRIT_QI_DEBUG
+
 #include "statement.hpp"
 #include "vm.hpp"
 #include "compiler.hpp"

Modified: trunk/libs/spirit/example/qi/compiler_tutorial/calc8/compiler.hpp
==============================================================================
--- trunk/libs/spirit/example/qi/compiler_tutorial/calc8/compiler.hpp (original)
+++ trunk/libs/spirit/example/qi/compiler_tutorial/calc8/compiler.hpp 2011-05-10 21:02:46 EDT (Tue, 10 May 2011)
@@ -58,11 +58,11 @@
           : program(program)
         {
             using namespace boost::phoenix::arg_names;
- using boost::phoenix::cref;
+ namespace phx = boost::phoenix;
             using boost::phoenix::function;
 
             error_handler = function<ErrorHandler>(error_handler_)(
- "Error! ", _2, cref(error_handler_.iters)[_1]);
+ "Error! ", _2, phx::cref(error_handler_.iters)[_1]);
         }
 
         bool operator()(ast::nil) const { BOOST_ASSERT(0); return false; }

Modified: trunk/libs/spirit/example/qi/compiler_tutorial/calc8/main.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/compiler_tutorial/calc8/main.cpp (original)
+++ trunk/libs/spirit/example/qi/compiler_tutorial/calc8/main.cpp 2011-05-10 21:02:46 EDT (Tue, 10 May 2011)
@@ -14,6 +14,10 @@
 //
 ///////////////////////////////////////////////////////////////////////////////
 
+///////////////////////////////////////////////////////////////////////////////
+// Define this to enable debugging
+//#define BOOST_SPIRIT_QI_DEBUG
+
 #include "statement.hpp"
 #include "vm.hpp"
 #include "compiler.hpp"

Modified: trunk/libs/spirit/example/qi/compiler_tutorial/conjure/compiler.hpp
==============================================================================
--- trunk/libs/spirit/example/qi/compiler_tutorial/conjure/compiler.hpp (original)
+++ trunk/libs/spirit/example/qi/compiler_tutorial/conjure/compiler.hpp 2011-05-10 21:02:46 EDT (Tue, 10 May 2011)
@@ -66,11 +66,11 @@
           : current(0)
         {
             using namespace boost::phoenix::arg_names;
- using boost::phoenix::cref;
+ namespace phx = boost::phoenix;
             using boost::phoenix::function;
 
             error_handler = function<ErrorHandler>(error_handler_)(
- "Error! ", _2, cref(error_handler_.iters)[_1]);
+ "Error! ", _2, phx::cref(error_handler_.iters)[_1]);
         }
 
         bool operator()(ast::nil) { BOOST_ASSERT(0); return false; }

Modified: trunk/libs/spirit/example/qi/compiler_tutorial/conjure/main.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/compiler_tutorial/conjure/main.cpp (original)
+++ trunk/libs/spirit/example/qi/compiler_tutorial/conjure/main.cpp 2011-05-10 21:02:46 EDT (Tue, 10 May 2011)
@@ -13,6 +13,10 @@
 //
 ///////////////////////////////////////////////////////////////////////////////
 
+///////////////////////////////////////////////////////////////////////////////
+// Define this to enable debugging
+//#define BOOST_SPIRIT_QI_DEBUG
+
 #include "function.hpp"
 #include "skipper.hpp"
 #include "vm.hpp"

Modified: trunk/libs/spirit/example/qi/compiler_tutorial/mini_c/main.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/compiler_tutorial/mini_c/main.cpp (original)
+++ trunk/libs/spirit/example/qi/compiler_tutorial/mini_c/main.cpp 2011-05-10 21:02:46 EDT (Tue, 10 May 2011)
@@ -13,6 +13,10 @@
 //
 ///////////////////////////////////////////////////////////////////////////////
 
+///////////////////////////////////////////////////////////////////////////////
+// Define this to enable debugging
+//#define BOOST_SPIRIT_QI_DEBUG
+
 #include "function.hpp"
 #include "skipper.hpp"
 #include "vm.hpp"


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk