|
Boost-Commit : |
From: eric_at_[hidden]
Date: 2008-04-18 20:38:46
Author: eric_niebler
Date: 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
New Revision: 44566
URL: http://svn.boost.org/trac/boost/changeset/44566
Log:
Merged revisions 44524-44535,44537-44541,44547,44551,44553-44562 via svnmerge from
https://svn.boost.org/svn/boost/trunk
........
r44524 | djowel | 2008-04-17 16:59:34 -0700 (Thu, 17 Apr 2008) | 1 line
action-dispatch
........
r44525 | djowel | 2008-04-17 17:55:12 -0700 (Thu, 17 Apr 2008) | 1 line
added example on various ways to attach actions
........
r44526 | djowel | 2008-04-17 17:59:39 -0700 (Thu, 17 Apr 2008) | 1 line
action-dispatch tweaks for phoenix special handling
........
r44527 | hkaiser | 2008-04-17 18:11:25 -0700 (Thu, 17 Apr 2008) | 1 line
Spirit: added eol and end parsers.
........
r44528 | hkaiser | 2008-04-17 18:12:10 -0700 (Thu, 17 Apr 2008) | 1 line
Spirit.Lex: Added support for token ids other than std::size_t.
........
r44529 | hkaiser | 2008-04-17 18:39:58 -0700 (Thu, 17 Apr 2008) | 1 line
Spirit.Karma: added simple function support for semantic actions, added example.
........
r44530 | djowel | 2008-04-17 18:49:31 -0700 (Thu, 17 Apr 2008) | 1 line
minor tweaks
........
r44531 | djowel | 2008-04-18 01:33:12 -0700 (Fri, 18 Apr 2008) | 1 line
fixed include
........
r44532 | speedsnail | 2008-04-18 02:53:46 -0700 (Fri, 18 Apr 2008) | 1 line
removed misspelled mimte-type property
........
r44533 | johnmaddock | 2008-04-18 03:03:46 -0700 (Fri, 18 Apr 2008) | 2 lines
Removed command line options that screw up Intel on Darwin.
Added warning suppression to code instead.
........
r44534 | johnmaddock | 2008-04-18 03:14:23 -0700 (Fri, 18 Apr 2008) | 1 line
Update thread tests: allow thread creation to fail at runtime.
........
r44535 | johnmaddock | 2008-04-18 03:15:09 -0700 (Fri, 18 Apr 2008) | 1 line
Apply BOOST_NO_ADL_BARRIER to more Sunpro versions.
........
r44537 | djowel | 2008-04-18 03:32:09 -0700 (Fri, 18 Apr 2008) | 1 line
added actions test + bug fixes
........
r44538 | djowel | 2008-04-18 03:32:40 -0700 (Fri, 18 Apr 2008) | 1 line
added actions test + bug fixes
........
r44539 | djowel | 2008-04-18 04:12:14 -0700 (Fri, 18 Apr 2008) | 1 line
tweaks
........
r44540 | hkaiser | 2008-04-18 05:35:25 -0700 (Fri, 18 Apr 2008) | 1 line
Spirit: changed end parser to be named eoi.
........
r44541 | hkaiser | 2008-04-18 06:52:47 -0700 (Fri, 18 Apr 2008) | 1 line
Spirit.Lex: trying to fix some gcc issues.
........
r44547 | hkaiser | 2008-04-18 09:03:09 -0700 (Fri, 18 Apr 2008) | 1 line
Spirit: Fixed a duplicate header include guard constant
........
r44551 | speedsnail | 2008-04-18 11:11:03 -0700 (Fri, 18 Apr 2008) | 2 lines
relaxed test, ignoring case of drive letter.
Thanks to Mat Marcus for the fix.
........
r44553 | djowel | 2008-04-18 13:05:59 -0700 (Fri, 18 Apr 2008) | 1 line
removed unnecessary stuff
........
r44554 | djowel | 2008-04-18 13:23:21 -0700 (Fri, 18 Apr 2008) | 1 line
added test for function reference; removed test for non-const ref attribute.
........
r44555 | djowel | 2008-04-18 13:23:49 -0700 (Fri, 18 Apr 2008) | 1 line
disallow mutability of attribute in actions
........
r44556 | djowel | 2008-04-18 13:32:43 -0700 (Fri, 18 Apr 2008) | 1 line
tweaks
........
r44557 | djowel | 2008-04-18 13:33:10 -0700 (Fri, 18 Apr 2008) | 1 line
uncommenting failing code (a regression)
........
r44558 | djowel | 2008-04-18 14:03:53 -0700 (Fri, 18 Apr 2008) | 1 line
fixed rule accepting any type of skipper but doing nothing
........
r44559 | djowel | 2008-04-18 14:04:15 -0700 (Fri, 18 Apr 2008) | 1 line
fixed rule accepting any type of skipper but doing nothing
........
r44560 | djowel | 2008-04-18 14:09:11 -0700 (Fri, 18 Apr 2008) | 1 line
fixed rule accepting any type of skipper but doing nothing
........
r44561 | djowel | 2008-04-18 16:41:48 -0700 (Fri, 18 Apr 2008) | 1 line
put virtual_component_base outside detail namespace plus a few renames
........
r44562 | hkaiser | 2008-04-18 17:06:02 -0700 (Fri, 18 Apr 2008) | 1 line
Spirit: Removed testing for compatibility of skipper and delimiter with the rule. Added some comments at the place where the compilation error occurs if skipper of delimiter are incompatible.
........
Added:
branches/proto/v4/boost/spirit/home/qi/char/primitives.hpp
- copied unchanged from r44562, /trunk/boost/spirit/home/qi/char/primitives.hpp
branches/proto/v4/boost/spirit/home/qi/nonterminal/virtual_component_base.hpp
- copied unchanged from r44562, /trunk/boost/spirit/home/qi/nonterminal/virtual_component_base.hpp
branches/proto/v4/boost/spirit/home/support/detail/action_dispatch.hpp
- copied unchanged from r44562, /trunk/boost/spirit/home/support/detail/action_dispatch.hpp
branches/proto/v4/libs/spirit/example/karma/actions.cpp
- copied unchanged from r44562, /trunk/libs/spirit/example/karma/actions.cpp
branches/proto/v4/libs/spirit/example/qi/actions.cpp
- copied unchanged from r44562, /trunk/libs/spirit/example/qi/actions.cpp
branches/proto/v4/libs/spirit/test/qi/actions.cpp
- copied unchanged from r44562, /trunk/libs/spirit/test/qi/actions.cpp
Properties modified:
branches/proto/v4/ (props changed)
branches/proto/v4/boost/iostreams/detail/execute.hpp (props changed)
branches/proto/v4/boost/iostreams/detail/functional.hpp (props changed)
Text files modified:
branches/proto/v4/boost/config/compiler/sunpro_cc.hpp | 2
branches/proto/v4/boost/spirit/home/karma/action/action.hpp | 8 ++-
branches/proto/v4/boost/spirit/home/karma/generate.hpp | 31 ----------------
branches/proto/v4/boost/spirit/home/karma/nonterminal/detail/rule.hpp | 10 ++--
branches/proto/v4/boost/spirit/home/karma/nonterminal/grammar.hpp | 20 ----------
branches/proto/v4/boost/spirit/home/karma/nonterminal/rule.hpp | 30 ++-------------
branches/proto/v4/boost/spirit/home/lex/lexer/lexer.hpp | 26 ++++++++------
branches/proto/v4/boost/spirit/home/lex/lexer/lexer_fwd.hpp | 3 +
branches/proto/v4/boost/spirit/home/lex/lexer/lexertl/lexertl_lexer.hpp | 21 +++++++---
branches/proto/v4/boost/spirit/home/lex/lexer/lexertl/lexertl_static_lexer.hpp | 20 ++++------
branches/proto/v4/boost/spirit/home/lex/lexer/lexertl/lexertl_token.hpp | 3 +
branches/proto/v4/boost/spirit/home/lex/lexer/meta_grammar.hpp | 9 +---
branches/proto/v4/boost/spirit/home/lex/lexer/string_token_def.hpp | 4 +
branches/proto/v4/boost/spirit/home/lex/lexer/token_def.hpp | 44 ++++++++++++++++-------
branches/proto/v4/boost/spirit/home/lex/lexer/token_set.hpp | 20 ++++++----
branches/proto/v4/boost/spirit/home/qi/action/action.hpp | 24 ++++++++----
branches/proto/v4/boost/spirit/home/qi/char.hpp | 1
branches/proto/v4/boost/spirit/home/qi/char/detail/basic_chset.hpp | 4 +-
branches/proto/v4/boost/spirit/home/qi/char/meta_grammar.hpp | 5 ++
branches/proto/v4/boost/spirit/home/qi/debug/detail/debug_handler.hpp | 34 +++++++++---------
branches/proto/v4/boost/spirit/home/qi/nonterminal/detail/error_handler.hpp | 4 +-
branches/proto/v4/boost/spirit/home/qi/nonterminal/detail/rule.hpp | 73 ++-------------------------------------
branches/proto/v4/boost/spirit/home/qi/nonterminal/grammar.hpp | 18 ---------
branches/proto/v4/boost/spirit/home/qi/nonterminal/rule.hpp | 31 +++-------------
branches/proto/v4/boost/spirit/home/qi/parse.hpp | 30 ----------------
branches/proto/v4/boost/spirit/home/support/iterators/detail/multi_pass.hpp | 8 ----
branches/proto/v4/boost/spirit/home/support/iterators/multi_pass_fwd.hpp | 4 +-
branches/proto/v4/boost/spirit/home/support/placeholders.hpp | 7 +++
branches/proto/v4/boost/spirit/phoenix.hpp | 6 +-
branches/proto/v4/libs/config/test/boost_has_pthreads.ipp | 14 ++++++-
branches/proto/v4/libs/math/test/Jamfile.v2 | 9 ++--
branches/proto/v4/libs/math/test/handle_test_result.hpp | 5 ++
branches/proto/v4/libs/spirit/example/qi/Jamfile | 1
branches/proto/v4/libs/spirit/test/Jamfile | 1
branches/proto/v4/libs/spirit/test/qi/char.cpp | 34 ++++++++++++++++++
branches/proto/v4/libs/spirit/test/qi/grammar_fail.cpp | 4 +-
branches/proto/v4/libs/spirit/test/qi/rule_fail.cpp | 6 +-
branches/proto/v4/tools/jam/src/expand.c | 7 +++
38 files changed, 239 insertions(+), 342 deletions(-)
Modified: branches/proto/v4/boost/config/compiler/sunpro_cc.hpp
==============================================================================
--- branches/proto/v4/boost/config/compiler/sunpro_cc.hpp (original)
+++ branches/proto/v4/boost/config/compiler/sunpro_cc.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -67,13 +67,13 @@
# endif
# if (__SUNPRO_CC <= 0x580)
# define BOOST_NO_IS_ABSTRACT
-# define BOOST_NO_ADL_BARRIER
# endif
//
// Issues that effect all known versions:
//
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+#define BOOST_NO_ADL_BARRIER
#define BOOST_COMPILER "Sun compiler version " BOOST_STRINGIZE(__SUNPRO_CC)
Modified: branches/proto/v4/boost/spirit/home/karma/action/action.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/karma/action/action.hpp (original)
+++ branches/proto/v4/boost/spirit/home/karma/action/action.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -13,6 +13,7 @@
#include <boost/spirit/home/support/component.hpp>
#include <boost/spirit/home/support/detail/values.hpp>
#include <boost/spirit/home/support/attribute_of.hpp>
+#include <boost/spirit/home/support/detail/action_dispatch.hpp>
#include <boost/spirit/home/karma/domain.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/identity.hpp>
@@ -60,9 +61,10 @@
// call the function, passing the parameter, the context
// and a bool flag that the client can set to false to
// fail parsing.
- bool pass = true;
- spirit::right(component)(
- spirit::detail::pass_value<param_type>::call(p), ctx, pass);
+ // call the function, passing the attribute, the context.
+ // The client can return false to fail parsing.
+ bool pass = spirit::detail::action_dispatch(
+ spirit::right(component), p, ctx);
return pass &&
director::generate(spirit::left(component), sink, ctx, d, p);
Modified: branches/proto/v4/boost/spirit/home/karma/generate.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/karma/generate.hpp (original)
+++ branches/proto/v4/boost/spirit/home/karma/generate.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -17,21 +17,6 @@
#include <boost/mpl/assert.hpp>
#include <boost/mpl/bool.hpp>
-///////////////////////////////////////////////////////////////////////////
-namespace boost { namespace spirit { namespace traits
-{
- // normally any skipper can be used with any generator
- template <typename Generator, typename Delimiter>
- struct delimiter_is_compatible : mpl::true_
- {
- };
-
- // If the parser is a rule or a grammar, then the delimiter must be
- // convertible to the delimiter used with this rule or grammar. The
- // corresponding specializations are defined in the files grammar.hpp and
- // rule.hpp.
-}}}
-
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit { namespace karma
{
@@ -104,14 +89,6 @@
BOOST_MPL_ASSERT_MSG(delimiter_is_component::value,
delimiter_is_not_convertible_to_a_generator,
(OutputIterator, Expr, Delimiter));
-
- typedef spirit::traits::delimiter_is_compatible<Expr, Delimiter>
- delimiter_is_compatible;
-
- BOOST_MPL_ASSERT_MSG(
- delimiter_is_compatible::value,
- delimiter_is_not_compatible_with_generator,
- (OutputIterator, Expr, Delimiter));
// wrap user supplied iterator into our own output iterator
detail::output_iterator<OutputIterator> sink(target_sink);
@@ -151,14 +128,6 @@
BOOST_MPL_ASSERT_MSG(delimiter_is_component::value,
delimiter_is_not_convertible_to_a_generator,
(OutputIterator, Expr, Parameter, Delimiter));
-
- typedef spirit::traits::delimiter_is_compatible<Expr, Delimiter>
- delimiter_is_compatible;
-
- BOOST_MPL_ASSERT_MSG(
- delimiter_is_compatible::value,
- delimiter_is_not_compatible_with_generator,
- (OutputIterator, Expr, Parameter, Delimiter));
// wrap user supplied iterator into our own output iterator
detail::output_iterator<OutputIterator> sink(target_sink);
Modified: branches/proto/v4/boost/spirit/home/karma/nonterminal/detail/rule.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/karma/nonterminal/detail/rule.hpp (original)
+++ branches/proto/v4/boost/spirit/home/karma/nonterminal/detail/rule.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -36,12 +36,12 @@
template <typename OutputIterator, typename Context, typename Delimiter>
struct virtual_component_base
{
- struct no_delimiter {};
+ struct take_no_delimiter {};
typedef typename
mpl::eval_if<
is_same<Delimiter, unused_type>,
- mpl::identity<no_delimiter>,
+ mpl::identity<take_no_delimiter>,
result_of::as_component<karma::domain, Delimiter>
>::type
delimiter_type;
@@ -205,7 +205,7 @@
virtual_component_base<OutputIterator, Context, Delimiter>
base_type;
typedef typename base_type::delimiter_type delimiter_type;
- typedef typename base_type::no_delimiter no_delimiter;
+ typedef typename base_type::take_no_delimiter take_no_delimiter;
virtual_component(Component const& component)
: component(component)
@@ -237,7 +237,7 @@
}
bool
- generate_main(OutputIterator& /*sink*/, Context& /*context*/, no_delimiter,
+ generate_main(OutputIterator& /*sink*/, Context& /*context*/, take_no_delimiter,
mpl::false_)
{
BOOST_ASSERT(false); // this should never be called
@@ -245,7 +245,7 @@
}
bool
- generate_main(OutputIterator& /*sink*/, Context& /*context*/, no_delimiter,
+ generate_main(OutputIterator& /*sink*/, Context& /*context*/, take_no_delimiter,
mpl::true_)
{
BOOST_ASSERT(false); // this should never be called
Modified: branches/proto/v4/boost/spirit/home/karma/nonterminal/grammar.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/karma/nonterminal/grammar.hpp (original)
+++ branches/proto/v4/boost/spirit/home/karma/nonterminal/grammar.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -113,24 +113,4 @@
}}}
-///////////////////////////////////////////////////////////////////////////////
-namespace boost { namespace spirit { namespace traits
-{
- // forward declaration only (the default specialization is defined in the
- // file generate.hpp)
- template <typename Generator, typename Delimiter>
- struct delimiter_is_compatible;
-
- // If the parser is a grammar, then the delimiter must be convertible to
- // the delimiter used with this grammar.
- template <typename Definition, typename Delimiter>
- struct delimiter_is_compatible<karma::grammar<Definition>, Delimiter>
- : is_convertible<
- Delimiter, typename karma::grammar<Definition>::delimiter_type
- >
- {
- };
-
-}}}
-
#endif
Modified: branches/proto/v4/boost/spirit/home/karma/nonterminal/rule.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/karma/nonterminal/rule.hpp (original)
+++ branches/proto/v4/boost/spirit/home/karma/nonterminal/rule.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -159,6 +159,11 @@
bool generate(
OutputIterator_& sink, Context& context, Delimiter const& delim) const
{
+ // If the following line produces a compilation error stating the
+ // 3rd parameter is not convertible to the expected type, then you
+ // probably trying to use this rule instance with a delimiter which
+ // is not compatible with the delimiter type used while defining
+ // the type of this rule instance.
return ptr->generate(sink, context, delim);
}
@@ -188,31 +193,6 @@
}}}
-///////////////////////////////////////////////////////////////////////////////
-namespace boost { namespace spirit { namespace traits
-{
- // forward declaration only (the default specialization is defined in the
- // file generate.hpp)
- template <typename Generator, typename Delimiter>
- struct delimiter_is_compatible;
-
- // If the parser is a rule, then the delimiter must be convertible to
- // the delimiter used with this rule.
- template <
- typename OutputIterator, typename T0, typename T1, typename T2,
- typename Delimiter
- >
- struct delimiter_is_compatible<
- karma::rule<OutputIterator, T0, T1, T2>, Delimiter>
- : is_convertible<
- Delimiter,
- typename karma::rule<OutputIterator, T0, T1, T2>::delimiter_type
- >
- {
- };
-
-}}}
-
#if defined(BOOST_MSVC)
# pragma warning(pop)
#endif
Modified: branches/proto/v4/boost/spirit/home/lex/lexer/lexer.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/lex/lexer/lexer.hpp (original)
+++ branches/proto/v4/boost/spirit/home/lex/lexer/lexer.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -47,6 +47,8 @@
typedef typename proto::terminal<terminal_holder>::type tag;
typedef proto::extends<tag, lexer_def_> base_type;
+ typedef typename LexerDef::id_type id_type;
+
tag make_tag() const
{
tag xpr = {{ this }};
@@ -65,7 +67,7 @@
// id, and the corresponding pair of iterators
typedef typename Iterator::base_iterator_type iterator_type;
typedef
- fusion::vector<std::size_t, iterator_range<iterator_type> >
+ fusion::vector<id_type, iterator_range<iterator_type> >
type;
};
@@ -84,7 +86,7 @@
token_type;
token_type &t = *first;
- if (0 != t.id()) {
+ if (token_is_valid(t)) {
// any of the token definitions matched
qi::detail::assign_to(t, attr);
++first;
@@ -109,31 +111,31 @@
{}
adder const&
- operator()(char_type c, std::size_t token_id = 0) const
+ operator()(char_type c, id_type token_id = 0) const
{
if (0 == token_id)
- token_id = static_cast<std::size_t>(c);
+ token_id = static_cast<id_type>(c);
def.def.add_token (def.state.c_str(), lex::detail::escape(c),
token_id);
return *this;
}
adder const&
- operator()(string_type const& s, std::size_t token_id = 0) const
+ operator()(string_type const& s, id_type token_id = id_type()) const
{
if (0 == token_id)
- token_id = next_id();
+ token_id = next_id<id_type>::get();
def.def.add_token (def.state.c_str(), s, token_id);
return *this;
}
template <typename Attribute>
adder const&
- operator()(token_def<Attribute, char_type>& tokdef,
- std::size_t token_id = 0) const
+ operator()(token_def<Attribute, char_type, id_type>& tokdef,
+ id_type token_id = id_type()) const
{
// make sure we have a token id
if (0 == token_id) {
if (0 == tokdef.id()) {
- token_id = next_id();
+ token_id = next_id<id_type>::get();
tokdef.id(token_id);
}
else {
@@ -278,16 +280,17 @@
// definitions
///////////////////////////////////////////////////////////////////////////
template <typename Lexer>
- class lexer_def : noncopyable, public Lexer
+ class lexer_def : private noncopyable, public Lexer
{
private:
- typedef lexer_def<Lexer> self_type;
+ typedef lexer_def self_type;
// avoid warnings about using 'this' in constructor
lexer_def& this_() { return *this; }
public:
typedef Lexer lexer_type;
+ typedef typename Lexer::id_type id_type;
typedef detail::lexer_def_<self_type> token_set;
typedef typename Lexer::char_type char_type;
typedef std::basic_string<char_type> string_type;
@@ -317,6 +320,7 @@
typedef typename Definition::lexer_type lexer_type;
typedef typename Definition::char_type char_type;
typedef typename Definition::iterator_type iterator_type;
+ typedef typename Definition::id_type id_type;
lexer(Definition& token_def_)
: token_def(token_def_)
Modified: branches/proto/v4/boost/spirit/home/lex/lexer/lexer_fwd.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/lex/lexer/lexer_fwd.hpp (original)
+++ branches/proto/v4/boost/spirit/home/lex/lexer/lexer_fwd.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -17,7 +17,8 @@
///////////////////////////////////////////////////////////////////////////
// This component represents a token definition
///////////////////////////////////////////////////////////////////////////
- template<typename Attribute = unused_type, typename Char = char>
+ template<typename Attribute = unused_type, typename Char = char,
+ typename Idtype = std::size_t>
class token_def;
///////////////////////////////////////////////////////////////////////////
Modified: branches/proto/v4/boost/spirit/home/lex/lexer/lexertl/lexertl_lexer.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/lex/lexer/lexertl/lexertl_lexer.hpp (original)
+++ branches/proto/v4/boost/spirit/home/lex/lexer/lexertl/lexertl_lexer.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -83,6 +83,9 @@
typedef std::basic_string<char_type> string_type;
public:
+ typedef Token token_type;
+ typedef typename Token::id_type id_type;
+
// interface for token definition management
void add_token (char_type const* state, string_type const& tokendef,
std::size_t token_id)
@@ -192,9 +195,19 @@
// Every lexer type to be used as a lexer for Spirit has to conform to
// a public interface .
typedef Token token_type;
+ typedef typename Token::id_type id_type;
typedef TokenSet token_set;
typedef lexertl_iterator<Functor> iterator_type;
-
+
+ private:
+ // this type is purely used for the iterator_type construction below
+ struct iterator_data_type {
+ boost::lexer::state_machine const& state_machine_;
+ boost::lexer::basic_rules<char_type> const& rules_;
+ typename Functor::semantic_actions_type const& actions_;
+ };
+
+ public:
// Return the start iterator usable for iterating over the generated
// tokens.
iterator_type begin(Iterator& first, Iterator const& last) const
@@ -202,12 +215,6 @@
if (!init_dfa())
return iterator_type();
- struct iterator_data_type {
- boost::lexer::state_machine const& state_machine_;
- boost::lexer::basic_rules<char_type> const& rules_;
- typename Functor::semantic_actions_type const& actions_;
- };
-
iterator_data_type iterator_data = { state_machine, rules, actions };
return iterator_type(iterator_data, first, last);
}
Modified: branches/proto/v4/boost/spirit/home/lex/lexer/lexertl/lexertl_static_lexer.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/lex/lexer/lexertl/lexertl_static_lexer.hpp (original)
+++ branches/proto/v4/boost/spirit/home/lex/lexer/lexertl/lexertl_static_lexer.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -169,18 +169,21 @@
typedef Token token_type;
typedef TokenSet token_set;
typedef lexertl_iterator<Functor> iterator_type;
-
+
+ private:
+ // this type is purely used for the iterator_type construction below
+ struct iterator_data_type {
+ typename Functor::next_token_functor next_;
+ typename Functor::semantic_actions_type const& actions_;
+ };
+
+ public:
// Return the start iterator usable for iterating over the generated
// tokens, the Functor F is called to match the next token from the
// input.
template <typename F>
iterator_type begin(Iterator& first, Iterator const& last, F next) const
{
- struct iterator_data_type {
- typename Functor::next_token_functor next_;
- typename Functor::semantic_actions_type const& actions_;
- };
-
iterator_data_type iterator_data = { next, actions };
return iterator_type(iterator_data, first, last);
}
@@ -191,11 +194,6 @@
template <typename Iterator_>
iterator_type begin(Iterator_& first, Iterator_ const& last) const
{
- struct iterator_data_type {
- typename Functor::next_token_functor next_;
- typename Functor::semantic_actions_type const& actions_;
- };
-
iterator_data_type iterator_data =
{ &lex::static_::next_token<Iterator_>, actions };
return iterator_type(iterator_data, first, last);
Modified: branches/proto/v4/boost/spirit/home/lex/lexer/lexertl/lexertl_token.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/lex/lexer/lexertl/lexertl_token.hpp (original)
+++ branches/proto/v4/boost/spirit/home/lex/lexer/lexertl/lexertl_token.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -53,6 +53,8 @@
// iterator_type The type of the iterator used to access the
// underlying character stream.
//
+ // id_type The type of the token id used.
+ //
// methods
// default constructor
// This should initialize the token as an end of
@@ -107,6 +109,7 @@
{
typedef Iterator iterator_type;
typedef mpl::false_ has_state;
+ typedef std::size_t id_type;
// default constructed tokens correspond to EOI tokens
lexertl_token()
Modified: branches/proto/v4/boost/spirit/home/lex/lexer/meta_grammar.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/lex/lexer/meta_grammar.hpp (original)
+++ branches/proto/v4/boost/spirit/home/lex/lexer/meta_grammar.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -12,6 +12,7 @@
#endif
#include <boost/spirit/home/lex/domain.hpp>
+#include <boost/spirit/home/lex/lexer/lexer_fwd.hpp>
#include <boost/spirit/home/lex/lexer/terminal_holder.hpp>
#include <boost/spirit/home/support/placeholders.hpp>
#include <boost/spirit/home/support/meta_grammar.hpp>
@@ -29,12 +30,6 @@
struct string_token_def;
struct char_token_def;
- template<typename Attribute, typename Char>
- class token_def;
-
- template <typename TokenSet>
- class token_set;
-
struct lexer_meta_grammar;
template <typename Expr, typename Enable>
@@ -52,7 +47,7 @@
// token_def<>
meta_grammar::terminal_rule<
lex::domain,
- terminal_holder<proto::_, lex::token_def<proto::_, proto::_> >,
+ terminal_holder<proto::_, lex::token_def<proto::_, proto::_, proto::_> >,
terminal_director
>,
// token_set
Modified: branches/proto/v4/boost/spirit/home/lex/lexer/string_token_def.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/lex/lexer/string_token_def.hpp (original)
+++ branches/proto/v4/boost/spirit/home/lex/lexer/string_token_def.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -27,7 +27,9 @@
collect(Component const& component, LexerDef& lexdef,
String const& state)
{
- lexdef.add_token (state.c_str(), subject(component), next_id());
+ typedef typename LexerDef::id_type id_type;
+ lexdef.add_token (state.c_str(), subject(component),
+ next_id<id_type>::get());
}
};
Modified: branches/proto/v4/boost/spirit/home/lex/lexer/token_def.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/lex/lexer/token_def.hpp (original)
+++ branches/proto/v4/boost/spirit/home/lex/lexer/token_def.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -34,22 +34,37 @@
};
///////////////////////////////////////////////////////////////////////////
- inline std::size_t next_id()
+ // The next_id template needs to be specialized for any non-default token
+ // id type used by a custom token type. It need to expose a function
+ // 'static Idtype get()' returning the next available token id each time
+ // it is called.
+ template <typename Idtype>
+ struct next_id;
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Default specialization for the next_id template returning the next
+ // available token id.
+ template <>
+ struct next_id<std::size_t>
{
- static std::size_t next_token_id = min_token_id;
- return next_token_id++;
- }
-
+ static std::size_t get()
+ {
+ static std::size_t next_token_id = min_token_id;
+ return next_token_id++;
+ }
+ };
+
///////////////////////////////////////////////////////////////////////////
// This component represents a token definition
///////////////////////////////////////////////////////////////////////////
- template<typename Attribute, typename Char>
+ template<typename Attribute, typename Char, typename Idtype>
class token_def
: public proto::extends<
typename make_terminal_holder<
- token_def<Attribute, Char>*, token_def<Attribute, Char>
+ token_def<Attribute, Char, Idtype>*,
+ token_def<Attribute, Char, Idtype>
>::type,
- token_def<Attribute, Char>
+ token_def<Attribute, Char, Idtype>
>
{
private:
@@ -132,23 +147,24 @@
{
token_state = lexdef.add_state(state.c_str());
if (0 == token_id)
- token_id = next_id();
+ token_id = next_id<Idtype>::get();
lexdef.add_token (state.c_str(), def, token_id);
}
public:
typedef Char char_type;
+ typedef Idtype id_type;
typedef std::basic_string<char_type> string_type;
// Lex interface: constructing token definitions
token_def()
: base_type(make_tag()), token_id(0), token_state(~0)
{}
- explicit token_def(char_type def_, std::size_t id_ = 0)
+ explicit token_def(char_type def_, Idtype id_ = Idtype())
: base_type(make_tag()), def(lex::detail::escape(def_)),
token_id(0 == id_ ? def_ : id_), token_state(~0)
{}
- explicit token_def(string_type def_, std::size_t id_ = 0)
+ explicit token_def(string_type def_, Idtype id_ = Idtype())
: base_type(make_tag()), def(def_), token_id(id_), token_state(~0)
{}
@@ -167,14 +183,14 @@
}
// general accessors
- std::size_t id() const { return token_id; }
- void id(std::size_t id) { token_id = id; }
+ Idtype id() const { return token_id; }
+ void id(Idtype id) { token_id = id; }
string_type const& definition() const { return def; }
std::size_t state() const { return token_state; }
private:
string_type def;
- std::size_t token_id;
+ Idtype token_id;
std::size_t token_state;
};
Modified: branches/proto/v4/boost/spirit/home/lex/lexer/token_set.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/lex/lexer/token_set.hpp (original)
+++ branches/proto/v4/boost/spirit/home/lex/lexer/token_set.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -42,7 +42,7 @@
// avoid warnings about using 'this' in constructor
token_set& this_() { return *this; }
- typedef token_set<TokenSet> self_type;
+ typedef token_set self_type;
typedef TokenSet base_token_set;
// initialize proto base class
@@ -57,6 +57,8 @@
}
public:
+ typedef typename TokenSet::id_type id_type;
+
// Qi interface: metafunction calculating parser return type
template <typename Component, typename Context, typename Iterator>
struct attribute
@@ -65,7 +67,7 @@
// and the corresponding pair of iterators
typedef typename Iterator::base_iterator_type iterator_type;
typedef
- fusion::vector<std::size_t, iterator_range<iterator_type> >
+ fusion::vector<id_type, iterator_range<iterator_type> >
type;
};
@@ -88,7 +90,7 @@
BOOST_ASSERT(~0 != token_state);
token_type &t = *first;
- if (0 != t.id() && token_state == t.state()) {
+ if (token_is_valid(t) && token_state == t.state()) {
// any of the token definitions matched
qi::detail::assign_to(t, attr);
++first;
@@ -123,7 +125,7 @@
{}
adder const&
- operator()(char_type c, std::size_t token_id = 0) const
+ operator()(char_type c, id_type token_id = id_type()) const
{
if (0 == token_id)
token_id = static_cast<std::size_t>(c);
@@ -132,22 +134,22 @@
return *this;
}
adder const&
- operator()(string_type const& s, std::size_t token_id = 0) const
+ operator()(string_type const& s, id_type token_id = id_type()) const
{
if (0 == token_id)
- token_id = next_id();
+ token_id = next_id<id_type>::get();
def.add_token (def.initial_state().c_str(), s, token_id);
return *this;
}
template <typename Attribute>
adder const&
- operator()(token_def<Attribute, char_type>& tokdef,
- std::size_t token_id = 0) const
+ operator()(token_def<Attribute, char_type, id_type>& tokdef,
+ id_type token_id = id_type()) const
{
// make sure we have a token id
if (0 == token_id) {
if (0 == tokdef.id()) {
- token_id = next_id();
+ token_id = next_id<id_type>::get();
tokdef.id(token_id);
}
else {
Modified: branches/proto/v4/boost/spirit/home/qi/action/action.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/qi/action/action.hpp (original)
+++ branches/proto/v4/boost/spirit/home/qi/action/action.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -10,7 +10,7 @@
#include <boost/spirit/home/qi/domain.hpp>
#include <boost/spirit/home/support/component.hpp>
#include <boost/spirit/home/support/attribute_of.hpp>
-#include <boost/spirit/home/support/detail/values.hpp>
+#include <boost/spirit/home/support/detail/action_dispatch.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/type_traits/remove_const.hpp>
@@ -32,6 +32,17 @@
{
};
+ template <typename F, typename Attribute, typename Context>
+ static bool const_action_dispatch(
+ F const& f, Attribute const& attr, Context& context)
+ {
+ // This function makes Attribute a const reference
+ // before calling detail::action_dispatch whereby
+ // disallowing mutability of the attribute in semantic
+ // actions.
+ return spirit::detail::action_dispatch(f, attr, context);
+ }
+
template <
typename Component
, typename Iterator, typename Context
@@ -60,13 +71,10 @@
if (director::parse(
spirit::left(component), first, last, context, skipper, attr))
{
- // call the function, passing the attribute, the context
- // and a bool flag that the client can set to false to
- // fail parsing.
- bool pass = true;
- spirit::right(component)(
- spirit::detail::pass_value<attr_type>::call(attr), context, pass);
- return pass;
+ // call the function, passing the attribute, the context.
+ // The client can return false to fail parsing.
+ return const_action_dispatch(
+ spirit::right(component), attr, context);
}
return false;
}
Modified: branches/proto/v4/boost/spirit/home/qi/char.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/qi/char.hpp (original)
+++ branches/proto/v4/boost/spirit/home/qi/char.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -10,6 +10,7 @@
#include <boost/spirit/home/qi/char/char_parser.hpp>
#include <boost/spirit/home/qi/char/char.hpp>
#include <boost/spirit/home/qi/char/char_class.hpp>
+#include <boost/spirit/home/qi/char/primitives.hpp>
#include <boost/spirit/home/qi/char/meta_grammar.hpp>
#endif
Modified: branches/proto/v4/boost/spirit/home/qi/char/detail/basic_chset.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/qi/char/detail/basic_chset.hpp (original)
+++ branches/proto/v4/boost/spirit/home/qi/char/detail/basic_chset.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -48,13 +48,13 @@
void
clear(Char from, Char to)
{
- rr.set(range<Char>(c, c));
+ rr.clear(range<Char>(from, to));
}
void
clear(Char c)
{
- rr.clear(range<Char>(from, to));
+ rr.clear(range<Char>(c, c));
}
void
Modified: branches/proto/v4/boost/spirit/home/qi/char/meta_grammar.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/qi/char/meta_grammar.hpp (original)
+++ branches/proto/v4/boost/spirit/home/qi/char/meta_grammar.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -64,6 +64,9 @@
template <typename Tag>
struct char_class;
+ struct eol_director;
+ struct eoi_director;
+
///////////////////////////////////////////////////////////////////////////
struct char_meta_grammar;
@@ -338,6 +341,8 @@
, qi::domain
, char_class<mpl::_>
>
+ , meta_grammar::terminal_rule<qi::domain, tag::eol, eol_director>
+ , meta_grammar::terminal_rule<qi::domain, tag::eoi, eoi_director>
>
{};
Modified: branches/proto/v4/boost/spirit/home/qi/debug/detail/debug_handler.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/qi/debug/detail/debug_handler.hpp (original)
+++ branches/proto/v4/boost/spirit/home/qi/debug/detail/debug_handler.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -8,7 +8,7 @@
#if !defined(BOOST_SPIRIT_DEBUG_HANDLER_NOV_12_2007_0926AM)
#define BOOST_SPIRIT_DEBUG_HANDLER_NOV_12_2007_0926AM
-#include <boost/spirit/home/qi/nonterminal/detail/rule.hpp>
+#include <boost/spirit/home/qi/nonterminal/virtual_component_base.hpp>
namespace boost { namespace spirit { namespace qi { namespace debug
{
@@ -26,8 +26,8 @@
struct trace_level
{
- trace_level(int &level)
- : level(level)
+ trace_level(int &level)
+ : level(level)
{
++level;
}
@@ -35,27 +35,27 @@
{
--level;
}
-
+
int& level;
};
-
+
///////////////////////////////////////////////////////////////////////////
template <
typename Iterator, typename Context, typename Skipper,
typename PreParseF, typename PostParseF
>
- struct debug_handler
- : qi::detail::virtual_component_base<Iterator, Context, Skipper>
+ struct debug_handler
+ : virtual_component_base<Iterator, Context, Skipper>
{
- typedef
- qi::detail::virtual_component_base<Iterator, Context, Skipper>
+ typedef
+ virtual_component_base<Iterator, Context, Skipper>
base_type;
typedef intrusive_ptr<base_type> pointer_type;
typedef typename base_type::skipper_type skipper_type;
debug_handler(pointer_type subject, std::string const& name,
bool trace, PreParseF preF, PostParseF postF)
- : subject(subject), name(name), trace(trace),
+ : subject(subject), name(name), trace(trace),
preF(preF), postF(postF)
{
}
@@ -67,21 +67,21 @@
, Context& context
, Skipper_ const& skipper)
{
- // execute embedded parser if tracing is disabled or if the
+ // execute embedded parser if tracing is disabled or if the
// pre-parse hook returns true
bool r = false;
- if (!trace || preF(name, subject, get_trace_level(), first, last))
+ if (!trace || preF(name, subject, get_trace_level(), first, last))
{
{
trace_level level(get_trace_level());
-
+
// do the actual parsing
Iterator i = first;
r = subject->parse(i, last, context, skipper);
if (r)
first = i;
}
-
+
// the post-parse hook gets executed only if tracing is enabled
if (trace)
postF(r, name, subject, get_trace_level(), first, last);
@@ -104,7 +104,7 @@
Iterator& first
, Iterator const& last
, Context& context
- , unused_type)
+ , no_skipper)
{
return parse_main(first, last, context, unused);
}
@@ -115,8 +115,8 @@
PreParseF preF;
PostParseF postF;
};
-
-}
+
+}
}}}}
#endif
Modified: branches/proto/v4/boost/spirit/home/qi/nonterminal/detail/error_handler.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/qi/nonterminal/detail/error_handler.hpp (original)
+++ branches/proto/v4/boost/spirit/home/qi/nonterminal/detail/error_handler.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -7,7 +7,7 @@
#if !defined(BOOST_SPIRIT_ERROR_HANDLER_APR_29_2007_1042PM)
#define BOOST_SPIRIT_ERROR_HANDLER_APR_29_2007_1042PM
-#include <boost/spirit/home/qi/nonterminal/detail/rule.hpp>
+#include <boost/spirit/home/qi/nonterminal/virtual_component_base.hpp>
#include <boost/spirit/home/qi/nonterminal/error_handler_result.hpp>
#include <boost/spirit/home/qi/operator/expect.hpp>
#include <boost/fusion/include/vector.hpp>
@@ -87,7 +87,7 @@
Iterator& first
, Iterator const& last
, Context& context
- , unused_type)
+ , no_skipper)
{
return parse_main(first, last, context, unused);
}
Modified: branches/proto/v4/boost/spirit/home/qi/nonterminal/detail/rule.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/qi/nonterminal/detail/rule.hpp (original)
+++ branches/proto/v4/boost/spirit/home/qi/nonterminal/detail/rule.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -7,74 +7,11 @@
#if !defined(BOOST_SPIRIT_RULE_FEB_12_2007_0440PM)
#define BOOST_SPIRIT_RULE_FEB_12_2007_0440PM
-#include <boost/spirit/home/support/unused.hpp>
-#include <boost/spirit/home/support/component.hpp>
-#include <boost/intrusive_ptr.hpp>
-#include <boost/detail/atomic_count.hpp>
-#include <boost/mpl/eval_if.hpp>
-#include <boost/mpl/identity.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <boost/function_types/is_function.hpp>
+#include <boost/spirit/home/qi/nonterminal/virtual_component_base.hpp>
#include <boost/assert.hpp>
-#include <algorithm>
namespace boost { namespace spirit { namespace qi { namespace detail
{
- template <typename Iterator, typename Context, typename Skipper>
- struct virtual_component_base
- {
- struct no_skipper {};
-
- typedef typename
- mpl::eval_if<
- is_same<Skipper, unused_type>
- , mpl::identity<no_skipper>
- , result_of::as_component<qi::domain, Skipper>
- >::type
- skipper_type;
-
- virtual_component_base()
- : use_count(0)
- {
- }
-
- virtual ~virtual_component_base()
- {
- }
-
- virtual bool
- parse(
- Iterator& first
- , Iterator const& last
- , Context& context
- , skipper_type const& skipper) = 0;
-
- virtual bool
- parse(
- Iterator& first
- , Iterator const& last
- , Context& context
- , unused_type) = 0;
-
- boost::detail::atomic_count use_count;
- };
-
- template <typename Iterator, typename Context, typename Skipper>
- inline void
- intrusive_ptr_add_ref(virtual_component_base<Iterator, Context, Skipper>* p)
- {
- ++p->use_count;
- }
-
- template <typename Iterator, typename Context, typename Skipper>
- inline void
- intrusive_ptr_release(virtual_component_base<Iterator, Context, Skipper>* p)
- {
- if (--p->use_count == 0)
- delete p;
- }
-
template <
typename Iterator, typename Component
, typename Context, typename Skipper
@@ -84,7 +21,7 @@
{
typedef virtual_component_base<Iterator, Context, Skipper> base_type;
typedef typename base_type::skipper_type skipper_type;
- typedef typename base_type::no_skipper no_skipper;
+ typedef typename base_type::take_no_skipper take_no_skipper;
virtual_component(Component const& component)
: component(component)
@@ -151,7 +88,7 @@
Iterator& /*first*/
, Iterator const& /*last*/
, Context&
- , no_skipper
+ , take_no_skipper
, mpl::false_)
{
BOOST_ASSERT(false); // this should never be called
@@ -162,7 +99,7 @@
Iterator& /*first*/
, Iterator const& /*last*/
, Context& /*context*/
- , no_skipper
+ , take_no_skipper
, mpl::true_)
{
BOOST_ASSERT(false); // this should never be called
@@ -184,7 +121,7 @@
Iterator& first
, Iterator const& last
, Context& context
- , unused_type)
+ , no_skipper)
{
return parse_main(first, last, context, unused, Auto());
}
Modified: branches/proto/v4/boost/spirit/home/qi/nonterminal/grammar.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/qi/nonterminal/grammar.hpp (original)
+++ branches/proto/v4/boost/spirit/home/qi/nonterminal/grammar.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -123,22 +123,4 @@
}}}
-///////////////////////////////////////////////////////////////////////////////
-namespace boost { namespace spirit { namespace traits
-{
- // forward declaration only (the default specialization is defined in the
- // file parse.hpp)
- template <typename Parser, typename Skipper>
- struct skipper_is_compatible;
-
- // If the parser is a grammar, then the skipper must be convertible to
- // the skipper used with this grammar.
- template <typename Definition, typename Skipper>
- struct skipper_is_compatible<qi::grammar<Definition>, Skipper>
- : is_convertible<Skipper, typename qi::grammar<Definition>::skipper_type>
- {
- };
-
-}}}
-
#endif
Modified: branches/proto/v4/boost/spirit/home/qi/nonterminal/rule.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/qi/nonterminal/rule.hpp (original)
+++ branches/proto/v4/boost/spirit/home/qi/nonterminal/rule.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -47,7 +47,7 @@
typedef rule<Iterator, T0, T1, T2> self_type;
typedef
- detail::virtual_component_base<
+ virtual_component_base<
Iterator
, typename base_type::context_type
, skipper_type
@@ -168,6 +168,11 @@
Iterator_& first, Iterator_ const& last
, Context& context, Skipper const& skipper) const
{
+ // If the following line produces a compilation error stating the
+ // 4th parameter is not convertible to the expected type, then you
+ // probably trying to use this rule instance with a skipper which
+ // is not compatible with the skipper type used while defining the
+ // type of this rule instance.
return ptr->parse(first, last, context, skipper);
}
@@ -209,7 +214,7 @@
static call(Rule& r, A1 const& a1)
{
typename Rule::pointer_type old (r.ptr);
- r.ptr.reset(new Decorator(r.ptr, a1));
+ r.ptr.reset(new Decorator(r.ptr, a1));
return old;
}
@@ -356,28 +361,6 @@
}}}
-///////////////////////////////////////////////////////////////////////////////
-namespace boost { namespace spirit { namespace traits
-{
- // forward declaration only
- template <typename Parser, typename Skipper>
- struct skipper_is_compatible;
-
- // If the parser is a rule, then the skipper must be convertible to
- // the skipper used with this rule.
- template <
- typename Iterator, typename T0, typename T1, typename T2,
- typename Skipper
- >
- struct skipper_is_compatible<qi::rule<Iterator, T0, T1, T2>, Skipper>
- : is_convertible<
- Skipper, typename qi::rule<Iterator, T0, T1, T2>::skipper_type
- >
- {
- };
-
-}}}
-
#if defined(BOOST_MSVC)
# pragma warning(pop)
#endif
Modified: branches/proto/v4/boost/spirit/home/qi/parse.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/qi/parse.hpp (original)
+++ branches/proto/v4/boost/spirit/home/qi/parse.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -13,21 +13,6 @@
#include <boost/mpl/assert.hpp>
#include <boost/mpl/bool.hpp>
-///////////////////////////////////////////////////////////////////////////
-namespace boost { namespace spirit { namespace traits
-{
- // normally any skipper can be used with any parser
- template <typename Parser, typename Skipper>
- struct skipper_is_compatible : mpl::true_
- {
- };
-
- // If the parser is a rule or a grammar, then the skipper must be
- // convertible to the skipper used with this rule or grammar. The
- // corresponding specializations are defined in the files grammar.hpp and
- // rule.hpp.
-}}}
-
namespace boost { namespace spirit { namespace qi
{
template <typename Iterator, typename Expr>
@@ -92,13 +77,6 @@
skipper_is_component::value,
skipper_is_not_convertible_to_a_parser, (Iterator, Expr, Skipper));
- typedef spirit::traits::skipper_is_compatible<Expr, Skipper>
- skipper_is_compatible;
-
- BOOST_MPL_ASSERT_MSG(
- skipper_is_compatible::value,
- skipper_is_not_compatible_with_parser, (Iterator, Expr, Skipper));
-
typedef typename result_of::as_component<qi::domain, Expr>::type component;
typedef typename component::director director;
component c = spirit::as_component(qi::domain(), xpr);
@@ -137,14 +115,6 @@
skipper_is_not_convertible_to_a_parser,
(Iterator, Expr, Attr, Skipper));
- typedef spirit::traits::skipper_is_compatible<Expr, Skipper>
- skipper_is_compatible;
-
- BOOST_MPL_ASSERT_MSG(
- skipper_is_compatible::value,
- skipper_is_not_compatible_with_parser,
- (Iterator, Expr, Attr, Skipper));
-
typedef typename result_of::as_component<qi::domain, Expr>::type component;
typedef typename component::director director;
component c = spirit::as_component(qi::domain(), xpr);
Modified: branches/proto/v4/boost/spirit/home/support/iterators/detail/multi_pass.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/support/iterators/detail/multi_pass.hpp (original)
+++ branches/proto/v4/boost/spirit/home/support/iterators/detail/multi_pass.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -14,14 +14,6 @@
#include <algorithm>
///////////////////////////////////////////////////////////////////////////////
-namespace boost { namespace spirit
-{
- // forward declaration only
- template <typename T, typename Policies>
- void swap(multi_pass<T, Policies> &x, multi_pass<T, Policies> &y);
-}}
-
-///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit { namespace detail
{
///////////////////////////////////////////////////////////////////////////
Modified: branches/proto/v4/boost/spirit/home/support/iterators/multi_pass_fwd.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/support/iterators/multi_pass_fwd.hpp (original)
+++ branches/proto/v4/boost/spirit/home/support/iterators/multi_pass_fwd.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -5,8 +5,8 @@
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)
=============================================================================*/
-#if !defined(BOOST_SPIRIT_ITERATOR_MULTI_PASS_FWD_HPP)
-#define BOOST_SPIRIT_ITERATOR_MULTI_PASS_FWD_HPP
+#if !defined(BOOST_SPIRIT_ITERATOR_MULTI_PASS_FWD_APR_18_2008_1102AM)
+#define BOOST_SPIRIT_ITERATOR_MULTI_PASS_FWD_APR_18_2008_1102AM
#include <cstddef>
Modified: branches/proto/v4/boost/spirit/home/support/placeholders.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/home/support/placeholders.hpp (original)
+++ branches/proto/v4/boost/spirit/home/support/placeholders.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -23,6 +23,8 @@
struct wchar {};
struct lit {};
struct wlit {};
+ struct eol {};
+ struct eoi {};
struct bin {};
struct oct {};
@@ -80,6 +82,8 @@
typedef proto::terminal<tag::wchar>::type wchar_type;
typedef proto::terminal<tag::lit>::type lit_type;
typedef proto::terminal<tag::wlit>::type wlit_type;
+ typedef proto::terminal<tag::eol>::type eol_type;
+ typedef proto::terminal<tag::eoi>::type end_type;
typedef proto::terminal<tag::bin>::type bin_type;
typedef proto::terminal<tag::oct>::type oct_type;
@@ -136,6 +140,8 @@
proto::terminal<tag::wchar>::type const wchar = {{}};
proto::terminal<tag::lit>::type const lit = {{}};
proto::terminal<tag::wlit>::type const wlit = {{}};
+ proto::terminal<tag::eol>::type const eol = {{}};
+ proto::terminal<tag::eoi>::type const eoi = {{}};
proto::terminal<tag::bin>::type const bin = {{}};
proto::terminal<tag::oct>::type const oct = {{}};
@@ -197,6 +203,7 @@
inline void silence_unused_warnings__placeholders()
{
(void) char_; (void) wchar; (void) lit; (void) wlit;
+ (void) eol; (void) eoi;
(void) bin; (void) oct; (void) hex;
(void) byte; (void) word; (void) dword;
(void) big_word; (void) big_dword;
Modified: branches/proto/v4/boost/spirit/phoenix.hpp
==============================================================================
--- branches/proto/v4/boost/spirit/phoenix.hpp (original)
+++ branches/proto/v4/boost/spirit/phoenix.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -10,14 +10,14 @@
#define BOOST_SPIRIT_DEPRECATED_INCLUDE_PHOENIX
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/classic_phoenix.hpp")
+# pragma message ("Warning: This header is deprecated. Please use: boost/spirit/include/phoenix1.hpp")
#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "This header is deprecated. Please use: boost/spirit/include/classic_phoenix.hpp"
+# warning "This header is deprecated. Please use: boost/spirit/include/phoenix1.hpp"
#endif
#if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
#define BOOST_SPIRIT_USE_OLD_NAMESPACE
#endif
-#include <boost/spirit/include/classic_phoenix.hpp>
+#include <boost/spirit/include/phoenix1.hpp>
#endif
Modified: branches/proto/v4/libs/config/test/boost_has_pthreads.ipp
==============================================================================
--- branches/proto/v4/libs/config/test/boost_has_pthreads.ipp (original)
+++ branches/proto/v4/libs/config/test/boost_has_pthreads.ipp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -25,19 +25,29 @@
int result = pthread_mutex_init(&mut, 0);
if(0 == result)
{
+ //
+ // Failure to be able to create and use a mutex
+ // is always a failure, even if the pthread
+ // library is just a non-functioning stub.
+ //
result |= pthread_mutex_lock(&mut);
result |= pthread_mutex_unlock(&mut);
result |= pthread_mutex_trylock(&mut);
result |= pthread_mutex_unlock(&mut);
result |= pthread_mutex_destroy(&mut);
//
- // Check that we can actually create a thread:
+ // Try and create a thread, this is allowed
+ // to fail, in case we are linking to a pthread
+ // "stub" library.
//
pthread_t t;
int r = pthread_create(&t, 0, &thread_proc, 0);
- result |= r;
+ // result |= r;
if(r == 0)
{
+ //
+ // If we can create a thread, then we must be able to join to it:
+ //
void* arg;
r = pthread_join(t, &arg);
result |= r;
Modified: branches/proto/v4/libs/math/test/Jamfile.v2
==============================================================================
--- branches/proto/v4/libs/math/test/Jamfile.v2 (original)
+++ branches/proto/v4/libs/math/test/Jamfile.v2 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -13,11 +13,8 @@
<toolset>gcc:<cxxflags>-Wno-missing-braces
<toolset>darwin:<cxxflags>-Wno-missing-braces
<toolset>acc:<cxxflags>+W2068,2461,2236,4070,4069
- <toolset>intel:<cxxflags>-Qwd264
- <toolset>intel:<cxxflags>-Qwd239
- <toolset>intel:<cxxflags>/nologo
- <toolset>intel-linux:<cxxflags>-wd239
- <toolset>intel:<linkflags>/nologo
+ <toolset>intel:<cxxflags>-nologo
+ <toolset>intel:<linkflags>-nologo
<toolset>msvc:<warnings>all
<toolset>msvc:<asynch-exceptions>on
<toolset>msvc:<cxxflags>/wd4996
@@ -492,3 +489,5 @@
run complex_test.cpp ;
+
+
Modified: branches/proto/v4/libs/math/test/handle_test_result.hpp
==============================================================================
--- branches/proto/v4/libs/math/test/handle_test_result.hpp (original)
+++ branches/proto/v4/libs/math/test/handle_test_result.hpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -12,6 +12,11 @@
#include <boost/regex.hpp>
#include <boost/test/test_tools.hpp>
+#if defined(BOOST_INTEL)
+# pragma warning(disable:239)
+# pragma warning(disable:264)
+#endif
+
//
// Every client of this header has to define this function,
// and initialise the table of expected results:
Modified: branches/proto/v4/libs/spirit/example/qi/Jamfile
==============================================================================
--- branches/proto/v4/libs/spirit/example/qi/Jamfile (original)
+++ branches/proto/v4/libs/spirit/example/qi/Jamfile 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -6,6 +6,7 @@
#==============================================================================
project spirit-qi-example ;
+exe actions : actions.cpp ;
exe sum : sum.cpp ;
exe complex_number : complex_number.cpp ;
exe employee : employee.cpp ;
Modified: branches/proto/v4/libs/spirit/test/Jamfile
==============================================================================
--- branches/proto/v4/libs/spirit/test/Jamfile (original)
+++ branches/proto/v4/libs/spirit/test/Jamfile 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -14,6 +14,7 @@
test-suite spirit_v2 :
# run Qi tests
+ [ run qi/actions.cpp : : : : ]
[ run qi/char.cpp : : : : ]
[ run qi/char_class.cpp : : : : ]
[ run qi/lit.cpp : : : : ]
Modified: branches/proto/v4/libs/spirit/test/qi/char.cpp
==============================================================================
--- branches/proto/v4/libs/spirit/test/qi/char.cpp (original)
+++ branches/proto/v4/libs/spirit/test/qi/char.cpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -23,7 +23,9 @@
using namespace boost::spirit::ascii;
using boost::spirit::char_;
using boost::spirit::wchar;
-
+ using boost::spirit::eol;
+ using boost::spirit::eoi;
+
{
BOOST_TEST(test("x", 'x'));
BOOST_TEST(test(L"x", L'x'));
@@ -115,5 +117,35 @@
BOOST_TEST((test("h", char_(val('a'), val('n')))));
}
+ { // eol
+ BOOST_TEST(test("\r", eol));
+ BOOST_TEST(test("\r\n", eol));
+ BOOST_TEST(test("\n", eol));
+ BOOST_TEST(!test("\b", eol));
+
+ BOOST_TEST(test(" \r", eol, char_(' ')));
+ BOOST_TEST(test(" \r\n", eol, char_(' ')));
+ BOOST_TEST(test(" \n", eol, char_(' ')));
+ BOOST_TEST(!test(" \b", eol, char_(' ')));
+
+ BOOST_TEST(test(L"\r", eol));
+ BOOST_TEST(test(L"\r\n", eol));
+ BOOST_TEST(test(L"\n", eol));
+ BOOST_TEST(!test(L"\b", eol));
+
+ BOOST_TEST(test(L" \r", eol, wchar(L' ')));
+ BOOST_TEST(test(L" \r\n", eol, wchar(L' ')));
+ BOOST_TEST(test(L" \n", eol, wchar(L' ')));
+ BOOST_TEST(!test(L" \b", eol, wchar(L' ')));
+ }
+
+ { // eoi
+ BOOST_TEST(test("", eoi));
+ BOOST_TEST(!test("a", eoi));
+
+ BOOST_TEST(test(" ", eoi, space));
+ BOOST_TEST(!test(" a", eoi, space));
+ }
+
return boost::report_errors();
}
Modified: branches/proto/v4/libs/spirit/test/qi/grammar_fail.cpp
==============================================================================
--- branches/proto/v4/libs/spirit/test/qi/grammar_fail.cpp (original)
+++ branches/proto/v4/libs/spirit/test/qi/grammar_fail.cpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -33,10 +33,10 @@
{
char const* input = "some input, it doesn't matter";
char const* end = &input[strlen(input)+1];
-
+
num_list def;
bool r = phrase_parse(input, end, make_parser(def),
- space | ('%' >> *~char_('\n') >> '\n'));
+ space | ('%' >> *~char_('\n') >> '\n'));
return 0;
}
Modified: branches/proto/v4/libs/spirit/test/qi/rule_fail.cpp
==============================================================================
--- branches/proto/v4/libs/spirit/test/qi/rule_fail.cpp (original)
+++ branches/proto/v4/libs/spirit/test/qi/rule_fail.cpp 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -20,12 +20,12 @@
{
char const* input = "some input, it doesn't matter";
char const* end = &input[strlen(input)+1];
-
+
rule<char const*, rule<char const*> > def;
def = int_ >> *(',' >> int_);
-
+
bool r = phrase_parse(input, end, def,
- space | ('%' >> *~char_('\n') >> '\n'));
+ space | ('%' >> *~char_('\n') >> '\n'));
return 0;
}
Modified: branches/proto/v4/tools/jam/src/expand.c
==============================================================================
--- branches/proto/v4/tools/jam/src/expand.c (original)
+++ branches/proto/v4/tools/jam/src/expand.c 2008-04-18 20:38:43 EDT (Fri, 18 Apr 2008)
@@ -749,7 +749,12 @@
assert(l != 0);
assert(list_next(l) == 0);
# ifdef OS_CYGWIN
- assert( !strcmp( l->string, "c:\\foo\\bar" ) );
+ /* On some installations of cygwin the drive letter is expanded to other case. */
+ /* This has been reported to be the case if cygwin has been installed to C:\ */
+ /* as opposed to C:\cygwin */
+ /* Since case of the drive letter will not matter, we allow for both. */
+ assert( 0 == strcmp( l->string, "c:\\foo\\bar" )
+ || 0 == strcmp( l->string, "C:\\foo\\bar") );
# else
assert( !strcmp( l->string, cygpath ) );
# endif
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