Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52892 - trunk/libs/spirit/example/qi/mini_c
From: hartmut.kaiser_at_[hidden]
Date: 2009-05-10 21:58:12


Author: hkaiser
Date: 2009-05-10 21:58:12 EDT (Sun, 10 May 2009)
New Revision: 52892
URL: http://svn.boost.org/trac/boost/changeset/52892

Log:
Spirit: fixed mini_c: gcc name-shadowing errors
Text files modified:
   trunk/libs/spirit/example/qi/mini_c/mini_c.hpp | 32 ++++++++++++++++----------------
   trunk/libs/spirit/example/qi/mini_c/mini_cd.hpp | 12 ++++++------
   2 files changed, 22 insertions(+), 22 deletions(-)

Modified: trunk/libs/spirit/example/qi/mini_c/mini_c.hpp
==============================================================================
--- trunk/libs/spirit/example/qi/mini_c/mini_c.hpp (original)
+++ trunk/libs/spirit/example/qi/mini_c/mini_c.hpp 2009-05-10 21:58:12 EDT (Sun, 10 May 2009)
@@ -269,15 +269,15 @@
       , symbols<char, int>& vars
       , symbols<char, function_info>& functions);
 
- typedef white_space<Iterator> white_space;
+ typedef white_space<Iterator> white_space_;
 
- rule<Iterator, white_space>
+ rule<Iterator, white_space_>
         expr, equality_expr, relational_expr
       , logical_expr, additive_expr, multiplicative_expr
       , unary_expr, primary_expr, variable
     ;
 
- rule<Iterator, locals<function_info, int>, white_space> function_call;
+ rule<Iterator, locals<function_info, int>, white_space_> function_call;
 
     std::vector<int>& code;
     symbols<char, int>& vars;
@@ -293,7 +293,7 @@
 {
     statement(std::vector<int>& code, symbols<char, function_info>& functions);
 
- typedef white_space<Iterator> white_space;
+ typedef white_space<Iterator> white_space_;
 
     std::vector<int>& code;
     symbols<char, int> vars;
@@ -302,16 +302,16 @@
     bool has_return;
 
     expression<Iterator> expr;
- rule<Iterator, white_space>
+ rule<Iterator, white_space_>
         statement_, statement_list, var_decl, compound_statement
       , return_statement;
 
- rule<Iterator, locals<int>, white_space> if_statement;
- rule<Iterator, locals<int, int>, white_space> while_statement;
- rule<Iterator, std::string(), white_space> identifier;
- rule<Iterator, int(), white_space> var_ref;
- rule<Iterator, locals<int>, white_space> assignment;
- rule<Iterator, void(int), white_space> assignment_rhs;
+ rule<Iterator, locals<int>, white_space_> if_statement;
+ rule<Iterator, locals<int, int>, white_space_> while_statement;
+ rule<Iterator, std::string(), white_space_> identifier;
+ rule<Iterator, int(), white_space_> var_ref;
+ rule<Iterator, locals<int>, white_space_> assignment;
+ rule<Iterator, void(int), white_space_> assignment_rhs;
 
     function<var_adder> add_var;
     function<compile_op> op;
@@ -325,11 +325,11 @@
 {
     program(std::vector<int>& code);
 
- typedef white_space<Iterator> white_space;
+ typedef white_space<Iterator> white_space_;
 
     std::vector<int>& code;
- rule<Iterator, std::string(), white_space> identifier;
- rule<Iterator, white_space> start;
+ rule<Iterator, std::string(), white_space_> identifier;
+ rule<Iterator, white_space_> start;
 
     typedef
         locals<
@@ -339,9 +339,9 @@
     function_locals;
 
     symbols<char, function_info> functions;
- statement<Iterator> statement;
+ statement<Iterator> statement_;
 
- rule<Iterator, function_locals, white_space> function;
+ rule<Iterator, function_locals, white_space_> function;
     boost::phoenix::function<function_adder> add_function;
     boost::phoenix::function<function_state_reset> state_reset;
     boost::phoenix::function<compile_op> op;

Modified: trunk/libs/spirit/example/qi/mini_c/mini_cd.hpp
==============================================================================
--- trunk/libs/spirit/example/qi/mini_c/mini_cd.hpp (original)
+++ trunk/libs/spirit/example/qi/mini_c/mini_cd.hpp 2009-05-10 21:58:12 EDT (Sun, 10 May 2009)
@@ -16,14 +16,14 @@
 program<Iterator>::program(std::vector<int>& code)
   : program::base_type(start)
   , code(code)
- , statement(code, functions)
+ , statement_(code, functions)
   , add_function(function_adder(functions))
- , state_reset(function_state_reset(code, statement.vars, statement.nvars))
+ , state_reset(function_state_reset(code, statement_.vars, statement_.nvars))
   , op(code)
 {
- bool& has_return = statement.has_return;
- int& nvars = statement.nvars;
- boost::phoenix::function<var_adder>& add_var = statement.add_var;
+ bool& has_return = statement_.has_return;
+ int& nvars = statement_.nvars;
+ boost::phoenix::function<var_adder>& add_var = statement_.add_var;
 
     identifier %=
         raw[lexeme[alpha >> *(alnum | '_')]]
@@ -51,7 +51,7 @@
                                                     ),
                                                     op(op_stk_adj, 0) // adjust this later
                                                 ]
- > statement
+ > statement_
> lit('}') [state_reset(_b)]
         ;
 


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