Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69379 - trunk/libs/spirit/example/qi/compiler_tutorial/calc7
From: joel_at_[hidden]
Date: 2011-02-28 05:15:05


Author: djowel
Date: 2011-02-28 05:15:00 EST (Mon, 28 Feb 2011)
New Revision: 69379
URL: http://svn.boost.org/trac/boost/changeset/69379

Log:
Minor tweaks
Text files modified:
   trunk/libs/spirit/example/qi/compiler_tutorial/calc7/annotation.hpp | 4 +++-
   trunk/libs/spirit/example/qi/compiler_tutorial/calc7/compiler.hpp | 3 +--
   trunk/libs/spirit/example/qi/compiler_tutorial/calc7/main.cpp | 4 ++--
   trunk/libs/spirit/example/qi/compiler_tutorial/calc7/statement.hpp | 7 -------
   4 files changed, 6 insertions(+), 12 deletions(-)

Modified: trunk/libs/spirit/example/qi/compiler_tutorial/calc7/annotation.hpp
==============================================================================
--- trunk/libs/spirit/example/qi/compiler_tutorial/calc7/annotation.hpp (original)
+++ trunk/libs/spirit/example/qi/compiler_tutorial/calc7/annotation.hpp 2011-02-28 05:15:00 EST (Mon, 28 Feb 2011)
@@ -35,14 +35,16 @@
             int id;
             set_id(int id) : id(id) {}
 
+ // This will catch all nodes inheriting from ast::tagged
             void operator()(ast::tagged& x) const
             {
                 x.id = id;
             }
 
+ // This will catch all nodes except those inheriting from ast::tagged
             void operator()(...) const
             {
- // no need for tags
+ // (no-op) no need for tags
             }
         };
 

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-02-28 05:15:00 EST (Mon, 28 Feb 2011)
@@ -55,8 +55,7 @@
         compiler(client::program& program, IterList const& iters, Iterator last)
           : program(program)
         {
- using boost::phoenix::arg_names::_1;
- using boost::phoenix::arg_names::_2;
+ using namespace boost::phoenix::arg_names;
             using boost::phoenix::cref;
             error_handler = client::error_handler("Error! ", _2, cref(iters)[_1], last);
         }

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-02-28 05:15:00 EST (Mon, 28 Feb 2011)
@@ -62,7 +62,7 @@
     if (success && iter == end)
         success = compile(ast);
     else
- std::cout << "Parsing failed\n";
+ std::cout << "Parse failure\n";
 
     if (success)
     {
@@ -74,7 +74,7 @@
     }
     else
     {
- std::cout << "Compiling failed\n";
+ std::cout << "Compile failure\n";
     }
 
     std::cout << "-------------------------\n\n";

Modified: trunk/libs/spirit/example/qi/compiler_tutorial/calc7/statement.hpp
==============================================================================
--- trunk/libs/spirit/example/qi/compiler_tutorial/calc7/statement.hpp (original)
+++ trunk/libs/spirit/example/qi/compiler_tutorial/calc7/statement.hpp 2011-02-28 05:15:00 EST (Mon, 28 Feb 2011)
@@ -24,13 +24,6 @@
         qi::rule<Iterator, ast::variable_declaration(), ascii::space_type> variable_declaration;
         qi::rule<Iterator, ast::assignment(), ascii::space_type> assignment;
         qi::rule<Iterator, std::string(), ascii::space_type> identifier;
-
-
- //~ variable_declaration;
- //~ qi::rule<Iterator, std::string(), ascii::space_type> identifier;
- //~ qi::rule<Iterator, int(), ascii::space_type> var_ref;
- //~ qi::rule<Iterator, qi::locals<int>, ascii::space_type> assignment;
- //~ qi::rule<Iterator, void(int), ascii::space_type> assignment_rhs;
     };
 }
 


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