Boost logo

Boost-Commit :

From: joel_at_[hidden]
Date: 2008-04-24 18:13:59


Author: djowel
Date: 2008-04-24 18:13:58 EDT (Thu, 24 Apr 2008)
New Revision: 44756
URL: http://svn.boost.org/trac/boost/changeset/44756

Log:
use plain functions instead of bind
Text files modified:
   trunk/libs/spirit/example/qi/calc2.cpp | 20 ++++++++------------
   1 files changed, 8 insertions(+), 12 deletions(-)

Modified: trunk/libs/spirit/example/qi/calc2.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/calc2.cpp (original)
+++ trunk/libs/spirit/example/qi/calc2.cpp 2008-04-24 18:13:58 EDT (Thu, 24 Apr 2008)
@@ -7,15 +7,14 @@
 ///////////////////////////////////////////////////////////////////////////////
 //
 // A Calculator example demonstrating the grammar and semantic actions
-// using phoenix to "bind" plain functions. The parser prints code suitable
-// for a stack based virtual machine.
+// using plain functions. The parser prints code suitable for a stack
+// based virtual machine.
 //
 // [ JDG May 10, 2002 ] spirit1
 // [ JDG March 4, 2007 ] spirit2
 //
 ///////////////////////////////////////////////////////////////////////////////
 #include <boost/spirit/include/qi.hpp>
-#include <boost/spirit/include/phoenix_bind.hpp>
 
 #include <iostream>
 #include <string>
@@ -23,9 +22,6 @@
 using namespace boost::spirit;
 using namespace boost::spirit::qi;
 using namespace boost::spirit::ascii;
-using namespace boost::spirit::arg_names;
-
-using boost::phoenix::bind;
 
 ///////////////////////////////////////////////////////////////////////////////
 // Semantic actions
@@ -50,22 +46,22 @@
     {
         expression =
             term
- >> *( ('+' >> term [bind(&do_add)])
- | ('-' >> term [bind(&do_subt)])
+ >> *( ('+' >> term [&do_add])
+ | ('-' >> term [&do_subt])
                 )
             ;
 
         term =
             factor
- >> *( ('*' >> factor [bind(&do_mult)])
- | ('/' >> factor [bind(&do_div)])
+ >> *( ('*' >> factor [&do_mult])
+ | ('/' >> factor [&do_div])
                 )
             ;
 
         factor =
- uint_ [bind(&do_int, _1)]
+ uint_ [&do_int]
             | '(' >> expression >> ')'
- | ('-' >> factor [bind(&do_neg)])
+ | ('-' >> factor [&do_neg])
             | ('+' >> factor)
             ;
     }


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