Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67900 - trunk/libs/spirit/example/qi
From: joel_at_[hidden]
Date: 2011-01-09 20:08:48


Author: djowel
Date: 2011-01-09 20:08:46 EST (Sun, 09 Jan 2011)
New Revision: 67900
URL: http://svn.boost.org/trac/boost/changeset/67900

Log:
updated to use rule pointers for efficiency
Text files modified:
   trunk/libs/spirit/example/qi/nabialek.cpp | 14 +++++++-------
   1 files changed, 7 insertions(+), 7 deletions(-)

Modified: trunk/libs/spirit/example/qi/nabialek.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/nabialek.cpp (original)
+++ trunk/libs/spirit/example/qi/nabialek.cpp 2011-01-09 20:08:46 EST (Sun, 09 Jan 2011)
@@ -30,7 +30,7 @@
     ///////////////////////////////////////////////////////////////////////////////
     template <typename Iterator>
     struct nabialek_trick : qi::grammar<
- Iterator, ascii::space_type, qi::locals<qi::rule<Iterator, ascii::space_type> > >
+ Iterator, ascii::space_type, qi::locals<qi::rule<Iterator, ascii::space_type>*> >
     {
         nabialek_trick() : nabialek_trick::base_type(start)
         {
@@ -45,16 +45,16 @@
             two = id >> ',' >> id;
 
             keyword.add
- ("one", one)
- ("two", two)
+ ("one", &one)
+ ("two", &two)
                 ;
-
- start = *(keyword[_a = _1] >> lazy(_a));
+
+ start = *(keyword[_a = _1] >> lazy(*_a));
         }
 
         qi::rule<Iterator, ascii::space_type> id, one, two;
- qi::rule<Iterator, ascii::space_type, qi::locals<qi::rule<Iterator, ascii::space_type> > > start;
- qi::symbols<char, qi::rule<Iterator, ascii::space_type> > keyword;
+ qi::rule<Iterator, ascii::space_type, qi::locals<qi::rule<Iterator, ascii::space_type>*> > start;
+ qi::symbols<char, qi::rule<Iterator, ascii::space_type>*> keyword;
     };
 }
 


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