Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66504 - in trunk: boost/spirit/home/classic/core boost/spirit/home/classic/dynamic boost/spirit/home/classic/phoenix boost/spirit/home/classic/tree boost/spirit/home/support/detail/lexer/parser boost/spirit/home/support/detail/lexer/parser/tree libs/spirit/classic/example/fundamental libs/spirit/classic/example/fundamental/distinct libs/spirit/classic/example/fundamental/more_calculators libs/spirit/classic/example/intermediate libs/spirit/classic/example/techniques libs/spirit/classic/example/techniques/no_rules libs/spirit/example/qi libs/spirit/test/qi
From: hartmut.kaiser_at_[hidden]
Date: 2010-11-11 19:37:01


Author: hkaiser
Date: 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
New Revision: 66504
URL: http://svn.boost.org/trac/boost/changeset/66504

Log:
Spirit: adjusting code to pass new assert inspect rule
Text files modified:
   trunk/boost/spirit/home/classic/core/assert.hpp | 6 +++---
   trunk/boost/spirit/home/classic/dynamic/rule_alias.hpp | 2 +-
   trunk/boost/spirit/home/classic/phoenix/closures.hpp | 4 ++--
   trunk/boost/spirit/home/classic/tree/common.hpp | 5 +++--
   trunk/boost/spirit/home/support/detail/lexer/parser/parser.hpp | 30 +++++++++++++++---------------
   trunk/boost/spirit/home/support/detail/lexer/parser/tree/node.hpp | 4 ++--
   trunk/libs/spirit/classic/example/fundamental/ast_calc.cpp | 20 ++++++++++----------
   trunk/libs/spirit/classic/example/fundamental/distinct/distinct_parser.cpp | 8 ++++----
   trunk/libs/spirit/classic/example/fundamental/distinct/distinct_parser_dynamic.cpp | 8 ++++----
   trunk/libs/spirit/classic/example/fundamental/error_handling.cpp | 4 ++--
   trunk/libs/spirit/classic/example/fundamental/more_calculators/ast_calc2.cpp | 19 ++++++++++---------
   trunk/libs/spirit/classic/example/fundamental/no_actions.cpp | 6 +++---
   trunk/libs/spirit/classic/example/fundamental/parse_tree_calc1.cpp | 13 +++++++------
   trunk/libs/spirit/classic/example/intermediate/lazy_parser.cpp | 6 +++---
   trunk/libs/spirit/classic/example/techniques/epsilon.cpp | 6 +++---
   trunk/libs/spirit/classic/example/techniques/multiple_scanners.cpp | 3 ++-
   trunk/libs/spirit/classic/example/techniques/no_rules/no_rule1.cpp | 3 ++-
   trunk/libs/spirit/classic/example/techniques/no_rules/no_rule2.cpp | 3 ++-
   trunk/libs/spirit/classic/example/techniques/no_rules/no_rule3.cpp | 3 ++-
   trunk/libs/spirit/classic/example/techniques/right_recursion.cpp | 17 +++++++++--------
   trunk/libs/spirit/classic/example/techniques/typeof.cpp | 3 ++-
   trunk/libs/spirit/example/qi/reference.cpp | 5 +++++
   trunk/libs/spirit/test/qi/alternative.cpp | 11 ++++++-----
   23 files changed, 102 insertions(+), 87 deletions(-)

Modified: trunk/boost/spirit/home/classic/core/assert.hpp
==============================================================================
--- trunk/boost/spirit/home/classic/core/assert.hpp (original)
+++ trunk/boost/spirit/home/classic/core/assert.hpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -17,7 +17,7 @@
 // BOOST_SPIRIT_ASSERT is used throughout the framework. It can be
 // overridden by the user. If BOOST_SPIRIT_ASSERT_EXCEPTION is defined,
 // then that will be thrown, otherwise, BOOST_SPIRIT_ASSERT simply turns
-// into a plain assert()
+// into a plain BOOST_ASSERT()
 //
 ///////////////////////////////////////////////////////////////////////////////
 #if !defined(BOOST_SPIRIT_ASSERT)
@@ -30,8 +30,8 @@
         BOOST_SPIRIT_ASSERT_EXCEPTION(f "(" #l "): " #x)); } while(0)
     #define BOOST_SPIRIT_ASSERT(x) BOOST_SPIRIT_ASSERT_AUX(__FILE__, __LINE__, x)
 #else
- #include <cassert>
- #define BOOST_SPIRIT_ASSERT(x) assert(x)
+ #include <boost/assert.hpp>
+ #define BOOST_SPIRIT_ASSERT(x) BOOST_ASSERT(x)
 #endif
 #endif // !defined(BOOST_SPIRIT_ASSERT)
 

Modified: trunk/boost/spirit/home/classic/dynamic/rule_alias.hpp
==============================================================================
--- trunk/boost/spirit/home/classic/dynamic/rule_alias.hpp (original)
+++ trunk/boost/spirit/home/classic/dynamic/rule_alias.hpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -60,7 +60,7 @@
         ParserT const&
         get() const
         {
- assert(ptr != 0);
+ BOOST_ASSERT(ptr != 0);
             return *ptr;
         }
     

Modified: trunk/boost/spirit/home/classic/phoenix/closures.hpp
==============================================================================
--- trunk/boost/spirit/home/classic/phoenix/closures.hpp (original)
+++ trunk/boost/spirit/home/classic/phoenix/closures.hpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -11,7 +11,7 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 #include <boost/spirit/home/classic/phoenix/actor.hpp>
-#include <cassert>
+#include <boost/assert.hpp>
 
 #ifdef PHOENIX_THREADSAFE
 #include <boost/thread/tss.hpp>
@@ -270,7 +270,7 @@
     eval(TupleT const& /*args*/) const
     {
         using namespace std;
- assert(frame.get() != 0);
+ BOOST_ASSERT(frame.get() != 0);
         return (*frame.get())[tuple_index<N>()];
     }
 

Modified: trunk/boost/spirit/home/classic/tree/common.hpp
==============================================================================
--- trunk/boost/spirit/home/classic/tree/common.hpp (original)
+++ trunk/boost/spirit/home/classic/tree/common.hpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -27,6 +27,7 @@
 #include <boost/spirit/home/classic/namespace.hpp>
 #include <boost/spirit/home/classic/core.hpp>
 #include <boost/detail/iterator.hpp> // for boost::detail::iterator_traits
+#include <boost/assert.hpp>
 
 #if defined(BOOST_SPIRIT_DEBUG) && \
     (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES)
@@ -462,7 +463,7 @@
             {
                 // See docs: reduced_node_d cannot be used with a
                 // rule inside the [].
- assert(i->children.size() == 0);
+ BOOST_ASSERT(i->children.size() == 0);
                 c.insert(c.end(), i->value.begin(), i->value.end());
             }
             return node_t(c.begin(), c.end());
@@ -504,7 +505,7 @@
             for (typename ContainerT::const_iterator i = nodes.begin();
                     i != i_end; ++i)
             {
- assert(i->children.size() == 0);
+ BOOST_ASSERT(i->children.size() == 0);
                 c.insert(c.end(), i->value.begin(), i->value.end());
             }
             return node_t(c.begin(), c.end());

Modified: trunk/boost/spirit/home/support/detail/lexer/parser/parser.hpp
==============================================================================
--- trunk/boost/spirit/home/support/detail/lexer/parser/parser.hpp (original)
+++ trunk/boost/spirit/home/support/detail/lexer/parser/parser.hpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -6,7 +6,7 @@
 #ifndef BOOST_LEXER_PARSER_HPP
 #define BOOST_LEXER_PARSER_HPP
 
-#include <assert.h>
+#include <boost/assert.hpp>
 #include "tree/end_node.hpp"
 #include "tree/iteration_node.hpp"
 #include "tree/leaf_node.hpp"
@@ -101,7 +101,7 @@
             throw runtime_error ("Empty rules are not allowed.");
         }
 
- assert (tree_node_stack_.size () == 1);
+ BOOST_ASSERT(tree_node_stack_.size () == 1);
 
         node *lhs_node_ = tree_node_stack_.top ();
 
@@ -161,7 +161,7 @@
             }
         } while (!token_stack_.empty () && action_ == '=');
 
- assert (token_stack_.empty () || action_ == '<');
+ BOOST_ASSERT(token_stack_.empty () || action_ == '<');
 
         switch (rhs_._type)
         {
@@ -231,7 +231,7 @@
     static void orexp (token_stack &handle_, token_stack &token_stack_,
         node_ptr_vector &node_ptr_vector_, tree_node_stack &tree_node_stack_)
     {
- assert (handle_.top ()._type == token::OREXP &&
+ BOOST_ASSERT(handle_.top ()._type == token::OREXP &&
             (handle_.size () == 1 || handle_.size () == 3));
 
         if (handle_.size () == 1)
@@ -241,9 +241,9 @@
         else
         {
             handle_.pop ();
- assert (handle_.top ()._type == token::OR);
+ BOOST_ASSERT(handle_.top ()._type == token::OR);
             handle_.pop ();
- assert (handle_.top ()._type == token::SEQUENCE);
+ BOOST_ASSERT(handle_.top ()._type == token::SEQUENCE);
             perform_or (node_ptr_vector_, tree_node_stack_);
             token_stack_.push (token::OREXP);
         }
@@ -252,7 +252,7 @@
     static void sub (token_stack &handle_, token_stack &token_stack_,
         node_ptr_vector &node_ptr_vector_, tree_node_stack &tree_node_stack_)
     {
- assert (handle_.top ()._type == token::SUB &&
+ BOOST_ASSERT(handle_.top ()._type == token::SUB &&
             (handle_.size () == 1 || handle_.size () == 2));
 
         if (handle_.size () == 1)
@@ -262,7 +262,7 @@
         else
         {
             handle_.pop ();
- assert (handle_.top ()._type == token::EXPRESSION);
+ BOOST_ASSERT(handle_.top ()._type == token::EXPRESSION);
             // perform join
             sequence (node_ptr_vector_, tree_node_stack_);
             token_stack_.push (token::SUB);
@@ -271,7 +271,7 @@
 
     static void repeat (token_stack &handle_, token_stack &token_stack_)
     {
- assert (handle_.top ()._type == token::REPEAT &&
+ BOOST_ASSERT(handle_.top ()._type == token::REPEAT &&
             handle_.size () >= 1 && handle_.size () <= 3);
 
         if (handle_.size () == 1)
@@ -281,7 +281,7 @@
         else
         {
             handle_.pop ();
- assert (handle_.top ()._type == token::DUP);
+ BOOST_ASSERT(handle_.top ()._type == token::DUP);
             token_stack_.push (token::REPEAT);
         }
     }
@@ -289,7 +289,7 @@
     static void charset (token_stack &handle_, token_stack &token_stack_,
         node_ptr_vector &node_ptr_vector_, tree_node_stack &tree_node_stack_)
     {
- assert (handle_.top ()._type == token::CHARSET &&
+ BOOST_ASSERT(handle_.top ()._type == token::CHARSET &&
             handle_.size () == 1);
         // store charset
         node_ptr_vector_->push_back (static_cast<leaf_node *>(0));
@@ -307,7 +307,7 @@
     {
         token &top_ = handle_.top ();
 
- assert (top_._type == token::MACRO && handle_.size () == 1);
+ BOOST_ASSERT(top_._type == token::MACRO && handle_.size () == 1);
 
         typename macro_map::const_iterator iter_ =
             macromap_.find (top_._macro);
@@ -335,12 +335,12 @@
 
     static void openparen (token_stack &handle_, token_stack &token_stack_)
     {
- assert (handle_.top ()._type == token::OPENPAREN &&
+ BOOST_ASSERT(handle_.top ()._type == token::OPENPAREN &&
             handle_.size () == 3);
         handle_.pop ();
- assert (handle_.top ()._type == token::REGEX);
+ BOOST_ASSERT(handle_.top ()._type == token::REGEX);
         handle_.pop ();
- assert (handle_.top ()._type == token::CLOSEPAREN);
+ BOOST_ASSERT(handle_.top ()._type == token::CLOSEPAREN);
         token_stack_.push (token::REPEAT);
     }
 

Modified: trunk/boost/spirit/home/support/detail/lexer/parser/tree/node.hpp
==============================================================================
--- trunk/boost/spirit/home/support/detail/lexer/parser/tree/node.hpp (original)
+++ trunk/boost/spirit/home/support/detail/lexer/parser/tree/node.hpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -6,7 +6,7 @@
 #ifndef BOOST_LEXER_NODE_HPP
 #define BOOST_LEXER_NODE_HPP
 
-#include <assert.h>
+#include <boost/assert.hpp>
 #include "../../containers/ptr_vector.hpp"
 #include "../../runtime_error.hpp"
 #include "../../size_t.hpp"
@@ -96,7 +96,7 @@
             }
         }
 
- assert (new_node_stack_.size () == 1);
+ BOOST_ASSERT(new_node_stack_.size () == 1);
         new_root_ = new_node_stack_.top ();
         new_node_stack_.pop ();
         return new_root_;

Modified: trunk/libs/spirit/classic/example/fundamental/ast_calc.cpp
==============================================================================
--- trunk/libs/spirit/classic/example/fundamental/ast_calc.cpp (original)
+++ trunk/libs/spirit/classic/example/fundamental/ast_calc.cpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -17,13 +17,13 @@
 #include <boost/spirit/include/classic_core.hpp>
 #include <boost/spirit/include/classic_ast.hpp>
 #include <boost/spirit/include/classic_tree_to_xml.hpp>
+#include <boost/assert.hpp>
 #include "tree_calc_grammar.hpp"
 
 #include <iostream>
 #include <stack>
 #include <functional>
 #include <string>
-#include <cassert>
 
 #if defined(BOOST_SPIRIT_DUMP_PARSETREE_AS_XML)
 #include <map>
@@ -55,7 +55,7 @@
 
     if (i->value.id() == calculator::integerID)
     {
- assert(i->children.size() == 0);
+ BOOST_ASSERT(i->children.size() == 0);
 
         // extract integer (not always delimited by '\0')
         string integer(i->value.begin(), i->value.end());
@@ -65,46 +65,46 @@
     else if (i->value.id() == calculator::factorID)
     {
         // factor can only be unary minus
- assert(*i->value.begin() == '-');
+ BOOST_ASSERT(*i->value.begin() == '-');
         return - eval_expression(i->children.begin());
     }
     else if (i->value.id() == calculator::termID)
     {
         if (*i->value.begin() == '*')
         {
- assert(i->children.size() == 2);
+ BOOST_ASSERT(i->children.size() == 2);
             return eval_expression(i->children.begin()) *
                 eval_expression(i->children.begin()+1);
         }
         else if (*i->value.begin() == '/')
         {
- assert(i->children.size() == 2);
+ BOOST_ASSERT(i->children.size() == 2);
             return eval_expression(i->children.begin()) /
                 eval_expression(i->children.begin()+1);
         }
         else
- assert(0);
+ BOOST_ASSERT(0);
     }
     else if (i->value.id() == calculator::expressionID)
     {
         if (*i->value.begin() == '+')
         {
- assert(i->children.size() == 2);
+ BOOST_ASSERT(i->children.size() == 2);
             return eval_expression(i->children.begin()) +
                 eval_expression(i->children.begin()+1);
         }
         else if (*i->value.begin() == '-')
         {
- assert(i->children.size() == 2);
+ BOOST_ASSERT(i->children.size() == 2);
             return eval_expression(i->children.begin()) -
                 eval_expression(i->children.begin()+1);
         }
         else
- assert(0);
+ BOOST_ASSERT(0);
     }
     else
     {
- assert(0); // error
+ BOOST_ASSERT(0); // error
     }
 
     return 0;

Modified: trunk/libs/spirit/classic/example/fundamental/distinct/distinct_parser.cpp
==============================================================================
--- trunk/libs/spirit/classic/example/fundamental/distinct/distinct_parser.cpp (original)
+++ trunk/libs/spirit/classic/example/fundamental/distinct/distinct_parser.cpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -6,7 +6,7 @@
     License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
     http://www.boost.org/LICENSE_1_0.txt)
 =============================================================================*/
-#include <cassert>
+#include <boost/assert.hpp>
 #include <iostream>
 #include <boost/cstdlib.hpp>
 #include <boost/spirit/include/classic_core.hpp>
@@ -56,13 +56,13 @@
     parse_info<> info;
 
     info = parse("declare ident", gram, space_p);
- assert(info.full); // valid input
+ BOOST_ASSERT(info.full); // valid input
 
     info = parse("declare: ident", gram, space_p);
- assert(info.full); // valid input
+ BOOST_ASSERT(info.full); // valid input
 
     info = parse("declareident", gram, space_p);
- assert(!info.hit); // invalid input
+ BOOST_ASSERT(!info.hit); // invalid input
 
     return exit_success;
 }

Modified: trunk/libs/spirit/classic/example/fundamental/distinct/distinct_parser_dynamic.cpp
==============================================================================
--- trunk/libs/spirit/classic/example/fundamental/distinct/distinct_parser_dynamic.cpp (original)
+++ trunk/libs/spirit/classic/example/fundamental/distinct/distinct_parser_dynamic.cpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -6,7 +6,7 @@
     License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
     http://www.boost.org/LICENSE_1_0.txt)
 =============================================================================*/
-#include <cassert>
+#include <boost/assert.hpp>
 #include <iostream>
 #include <boost/cstdlib.hpp>
 #include <boost/spirit/include/classic_core.hpp>
@@ -52,13 +52,13 @@
     parse_info<> info;
 
     info = parse("asn-declare ident", gram, space_p);
- assert(info.full); // valid input
+ BOOST_ASSERT(info.full); // valid input
 
     info = parse("asn-declare--ident", gram, space_p);
- assert(info.full); // valid input
+ BOOST_ASSERT(info.full); // valid input
 
     info = parse("asn-declare-ident", gram, space_p);
- assert(!info.hit); // invalid input
+ BOOST_ASSERT(!info.hit); // invalid input
 
     return exit_success;
 }

Modified: trunk/libs/spirit/classic/example/fundamental/error_handling.cpp
==============================================================================
--- trunk/libs/spirit/classic/example/fundamental/error_handling.cpp (original)
+++ trunk/libs/spirit/classic/example/fundamental/error_handling.cpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -15,7 +15,7 @@
 #include <boost/spirit/include/classic_core.hpp>
 #include <boost/spirit/include/classic_exceptions.hpp>
 #include <iostream>
-#include <cassert>
+#include <boost/assert.hpp>
 
 using namespace std;
 using namespace BOOST_SPIRIT_CLASSIC_NS;
@@ -49,7 +49,7 @@
 
     bool r = parse("abcx", start).full;
 
- assert(!r);
+ BOOST_ASSERT(!r);
     return 0;
 }
 

Modified: trunk/libs/spirit/classic/example/fundamental/more_calculators/ast_calc2.cpp
==============================================================================
--- trunk/libs/spirit/classic/example/fundamental/more_calculators/ast_calc2.cpp (original)
+++ trunk/libs/spirit/classic/example/fundamental/more_calculators/ast_calc2.cpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -8,6 +8,7 @@
 =============================================================================*/
 #include <boost/spirit/include/classic_core.hpp>
 #include <boost/spirit/include/classic_ast.hpp>
+#include <boost/assert.hpp>
 
 #include <iostream>
 #include <stack>
@@ -56,51 +57,51 @@
 
     if (i->value.id() == integer.id())
     {
- assert(i->children.size() == 0);
+ BOOST_ASSERT(i->children.size() == 0);
         return strtol(i->value.begin(), 0, 10);
     }
     else if (i->value.id() == factor.id())
     {
         // factor can only be unary minus
- assert(*i->value.begin() == '-');
+ BOOST_ASSERT(*i->value.begin() == '-');
         return - eval_expression(i->children.begin());
     }
     else if (i->value.id() == term.id())
     {
         if (*i->value.begin() == '*')
         {
- assert(i->children.size() == 2);
+ BOOST_ASSERT(i->children.size() == 2);
             return eval_expression(i->children.begin()) *
                 eval_expression(i->children.begin()+1);
         }
         else if (*i->value.begin() == '/')
         {
- assert(i->children.size() == 2);
+ BOOST_ASSERT(i->children.size() == 2);
             return eval_expression(i->children.begin()) /
                 eval_expression(i->children.begin()+1);
         }
         else
- assert(0);
+ BOOST_ASSERT(0);
     }
     else if (i->value.id() == expression.id())
     {
         if (*i->value.begin() == '+')
         {
- assert(i->children.size() == 2);
+ BOOST_ASSERT(i->children.size() == 2);
             return eval_expression(i->children.begin()) +
                 eval_expression(i->children.begin()+1);
         }
         else if (*i->value.begin() == '-')
         {
- assert(i->children.size() == 2);
+ BOOST_ASSERT(i->children.size() == 2);
             return eval_expression(i->children.begin()) -
                 eval_expression(i->children.begin()+1);
         }
         else
- assert(0);
+ BOOST_ASSERT(0);
     }
     else
- assert(0); // error
+ BOOST_ASSERT(0); // error
 
    return 0;
 }

Modified: trunk/libs/spirit/classic/example/fundamental/no_actions.cpp
==============================================================================
--- trunk/libs/spirit/classic/example/fundamental/no_actions.cpp (original)
+++ trunk/libs/spirit/classic/example/fundamental/no_actions.cpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -15,7 +15,7 @@
 //
 //-----------------------------------------------------------------------------
 
-#include <cassert>
+#include <boost/assert.hpp>
 #include <iostream>
 #include <boost/cstdlib.hpp>
 #include <boost/spirit/include/classic_core.hpp>
@@ -46,9 +46,9 @@
         ]
     );
 
- assert(info.full);
+ BOOST_ASSERT(info.full);
     // Check, that the action hasn't been invoked
- assert(i == 0);
+ BOOST_ASSERT(i == 0);
 
     return exit_success;
 }

Modified: trunk/libs/spirit/classic/example/fundamental/parse_tree_calc1.cpp
==============================================================================
--- trunk/libs/spirit/classic/example/fundamental/parse_tree_calc1.cpp (original)
+++ trunk/libs/spirit/classic/example/fundamental/parse_tree_calc1.cpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -16,6 +16,7 @@
 
 #include <boost/spirit/include/classic_core.hpp>
 #include <boost/spirit/include/classic_parse_tree.hpp>
+#include <boost/assert.hpp>
 
 #include <iostream>
 #include <stack>
@@ -63,7 +64,7 @@
 long eval_expression(iter_t const& i)
 {
     parser_id id = i->value.id();
- assert(id == expression.id()); // check the id
+ BOOST_ASSERT(id == expression.id()); // check the id
 
     // first child points to a term, so call eval_term on it
     iter_t chi = i->children.begin();
@@ -80,7 +81,7 @@
         else if (op == '-')
             lhs -= rhs;
         else
- assert(0);
+ BOOST_ASSERT(0);
     }
     return lhs;
 }
@@ -88,7 +89,7 @@
 long eval_term(iter_t const& i)
 {
     parser_id id = i->value.id();
- assert(id == term.id());
+ BOOST_ASSERT(id == term.id());
 
     iter_t chi = i->children.begin();
     long lhs = eval_factor(chi);
@@ -102,7 +103,7 @@
         else if (op == '/')
             lhs /= rhs;
         else
- assert(0);
+ BOOST_ASSERT(0);
     }
     return lhs;
 }
@@ -110,7 +111,7 @@
 long eval_factor(iter_t const& i)
 {
     parser_id id = i->value.id();
- assert(id == factor.id());
+ BOOST_ASSERT(id == factor.id());
 
     iter_t chi = i->children.begin();
     id = chi->value.id();
@@ -128,7 +129,7 @@
     }
     else
     {
- assert(0);
+ BOOST_ASSERT(0);
         return 0;
     }
 }

Modified: trunk/libs/spirit/classic/example/intermediate/lazy_parser.cpp
==============================================================================
--- trunk/libs/spirit/classic/example/intermediate/lazy_parser.cpp (original)
+++ trunk/libs/spirit/classic/example/intermediate/lazy_parser.cpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -30,7 +30,7 @@
 // parser to invoke the parser stored in the block.int_rule pointer.
 //
 //-----------------------------------------------------------------------------
-#include <cassert>
+#include <boost/assert.hpp>
 #include <boost/cstdlib.hpp>
 #include <boost/spirit/include/phoenix1.hpp>
 #include <boost/spirit/include/classic_core.hpp>
@@ -117,8 +117,8 @@
 
     int result;
     info = parse("bin{1 dec{1 2 3} 10}", gram[var(result) = arg1], space_p);
- assert(info.full);
- assert(result == 9);
+ BOOST_ASSERT(info.full);
+ BOOST_ASSERT(result == 9);
 
     return exit_success;
 }

Modified: trunk/libs/spirit/classic/example/techniques/epsilon.cpp
==============================================================================
--- trunk/libs/spirit/classic/example/techniques/epsilon.cpp (original)
+++ trunk/libs/spirit/classic/example/techniques/epsilon.cpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -24,7 +24,7 @@
 //-----------------------------------------------------------------------------
 #define BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT 2
 
-#include <cassert>
+#include <boost/assert.hpp>
 #include <iostream>
 #include <boost/cstdlib.hpp>
 #include <boost/spirit/include/classic_core.hpp>
@@ -58,9 +58,9 @@
         space_p
     );
 
- assert(info.full);
+ BOOST_ASSERT(info.full);
     // Check, that the semantic action was invoked only once
- assert(i == 1);
+ BOOST_ASSERT(i == 1);
 
     return exit_success;
 }

Modified: trunk/libs/spirit/classic/example/techniques/multiple_scanners.cpp
==============================================================================
--- trunk/libs/spirit/classic/example/techniques/multiple_scanners.cpp (original)
+++ trunk/libs/spirit/classic/example/techniques/multiple_scanners.cpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -15,6 +15,7 @@
 
 #include <iostream>
 #include <boost/spirit/include/classic_core.hpp>
+#include <boost/assert.hpp>
 
 using namespace BOOST_SPIRIT_CLASSIC_NS;
 
@@ -46,7 +47,7 @@
 {
     my_grammar g;
     bool success = parse("abcdef aBc d e f aBc d E f", g, space_p).full;
- assert(success);
+ BOOST_ASSERT(success);
     std::cout << "SUCCESS!!!\n";
     return 0;
 }

Modified: trunk/libs/spirit/classic/example/techniques/no_rules/no_rule1.cpp
==============================================================================
--- trunk/libs/spirit/classic/example/techniques/no_rules/no_rule1.cpp (original)
+++ trunk/libs/spirit/classic/example/techniques/no_rules/no_rule1.cpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -13,6 +13,7 @@
 
 #include <iostream>
 #include <boost/spirit/include/classic_core.hpp>
+#include <boost/assert.hpp>
 
 using namespace BOOST_SPIRIT_CLASSIC_NS;
 
@@ -44,7 +45,7 @@
     bool success = parse(
         "/*this is a comment*/\n//this is a c++ comment\n\n",
         *g).full;
- assert(success);
+ BOOST_ASSERT(success);
     std::cout << "SUCCESS!!!\n";
     return 0;
 }

Modified: trunk/libs/spirit/classic/example/techniques/no_rules/no_rule2.cpp
==============================================================================
--- trunk/libs/spirit/classic/example/techniques/no_rules/no_rule2.cpp (original)
+++ trunk/libs/spirit/classic/example/techniques/no_rules/no_rule2.cpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -13,6 +13,7 @@
 
 #include <iostream>
 #include <boost/spirit/include/classic_core.hpp>
+#include <boost/assert.hpp>
 
 using namespace BOOST_SPIRIT_CLASSIC_NS;
 
@@ -51,7 +52,7 @@
     bool success = parse(
         "/*this is a comment*/\n//this is a c++ comment\n\n",
         *g).full;
- assert(success);
+ BOOST_ASSERT(success);
     std::cout << "SUCCESS!!!\n";
     return 0;
 }

Modified: trunk/libs/spirit/classic/example/techniques/no_rules/no_rule3.cpp
==============================================================================
--- trunk/libs/spirit/classic/example/techniques/no_rules/no_rule3.cpp (original)
+++ trunk/libs/spirit/classic/example/techniques/no_rules/no_rule3.cpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -13,6 +13,7 @@
 
 #include <iostream>
 #include <boost/spirit/include/classic_core.hpp>
+#include <boost/assert.hpp>
 
 using namespace BOOST_SPIRIT_CLASSIC_NS;
 
@@ -79,7 +80,7 @@
     bool success = parse(
         "/*this is a comment*/\n//this is a c++ comment\n\n",
         *g).full;
- assert(success);
+ BOOST_ASSERT(success);
     std::cout << "SUCCESS!!!\n";
     return 0;
 }

Modified: trunk/libs/spirit/classic/example/techniques/right_recursion.cpp
==============================================================================
--- trunk/libs/spirit/classic/example/techniques/right_recursion.cpp (original)
+++ trunk/libs/spirit/classic/example/techniques/right_recursion.cpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -10,6 +10,7 @@
 
 #define BOOST_SPIRIT_DEBUG
 #include <boost/spirit/include/classic_core.hpp>
+#include <boost/assert.hpp>
 
 using namespace BOOST_SPIRIT_CLASSIC_NS;
 
@@ -63,25 +64,25 @@
     {
         non_greedy_kleene k;
         success = parse("3", k).full;
- assert(success);
+ BOOST_ASSERT(success);
         success = parse("abcdef3", k).full;
- assert(success);
+ BOOST_ASSERT(success);
         success = parse("abc2def3", k).full;
- assert(success);
+ BOOST_ASSERT(success);
         success = parse("abc", k).full;
- assert(!success);
+ BOOST_ASSERT(!success);
     }
     
     {
         non_greedy_plus p;
         success = parse("3", p).full;
- assert(!success);
+ BOOST_ASSERT(!success);
         success = parse("abcdef3", p).full;
- assert(success);
+ BOOST_ASSERT(success);
         success = parse("abc2def3", p).full;
- assert(success);
+ BOOST_ASSERT(success);
         success = parse("abc", p).full;
- assert(!success);
+ BOOST_ASSERT(!success);
     }
 
     std::cout << "SUCCESS!!!\n";

Modified: trunk/libs/spirit/classic/example/techniques/typeof.cpp
==============================================================================
--- trunk/libs/spirit/classic/example/techniques/typeof.cpp (original)
+++ trunk/libs/spirit/classic/example/techniques/typeof.cpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -14,6 +14,7 @@
 #include <iostream>
 #include <boost/spirit/include/classic_core.hpp>
 #include <boost/typeof/typeof.hpp>
+#include <boost/assert.hpp>
 
 using namespace BOOST_SPIRIT_CLASSIC_NS;
 
@@ -33,7 +34,7 @@
     bool success = parse(
         "/*this is a comment*/\n//this is a c++ comment\n\n",
         *skipper).full;
- assert(success);
+ BOOST_ASSERT(success);
     std::cout << "SUCCESS!!!\n";
     return 0;
 }

Modified: trunk/libs/spirit/example/qi/reference.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/reference.cpp (original)
+++ trunk/libs/spirit/example/qi/reference.cpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -5,6 +5,11 @@
     Distributed under the Boost Software License, Version 1.0. (See accompanying
     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 =============================================================================*/
+
+// this code is not supposed to be executed, so the asserts are for
+// demonstration purposes only
+// boostinspect:naassert_macro
+
 //[reference_includes
 #include <boost/spirit/include/qi.hpp>
 #include <boost/spirit/include/phoenix_core.hpp>

Modified: trunk/libs/spirit/test/qi/alternative.cpp
==============================================================================
--- trunk/libs/spirit/test/qi/alternative.cpp (original)
+++ trunk/libs/spirit/test/qi/alternative.cpp 2010-11-11 19:36:49 EST (Thu, 11 Nov 2010)
@@ -19,6 +19,7 @@
 #include <boost/spirit/include/phoenix_core.hpp>
 #include <boost/spirit/include/phoenix_operator.hpp>
 #include <boost/variant.hpp>
+#include <boost/assert.hpp>
 
 #include <string>
 #include <iostream>
@@ -182,11 +183,11 @@
 
         std::vector<boost::optional<char> > v;
         BOOST_TEST( (test("x,y,z", (*(',' | char_))[phx::ref(v) = _1])) );
- assert(v[0] == 'x');
- assert(!v[1]);
- assert(v[2] == 'y');
- assert(!v[3]);
- assert(v[4] == 'z');
+ BOOST_ASSERT(v[0] == 'x');
+ BOOST_ASSERT(!v[1]);
+ BOOST_ASSERT(v[2] == 'y');
+ BOOST_ASSERT(!v[3]);
+ BOOST_ASSERT(v[4] == 'z');
     }
 
     {


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