Larry Evans | 14 May 20:22

[proto v4]compile time equation soln prototype fails to compile with "when" map for "variables"

In the vault at:

http://www.boost-consulting.com/vault/index.php?action=downloadfile&filename=pass_thru_tag_xform.cpp&directory=Strings%20-%20Text%20Processing&PHPSESSID=ab51206c9d980155d142f5bcef8e00ee

there's a partial prototype for compile time solving a system of
equations. The partial prototype is partial because it just tries
to simplify the rhs of the equation.  The domain is calculating
the empty attributes of a set of grammar productions (i.e. the
equations).  The typedef ... xfrm_empty_varbl_map0
is supposed to implement a substitution operation which
substitutes a literal value for a variable.  In this
particular case, the variable is

   empty::tag_varbl<gram::varbl_factor>

and the value to be substituted is:

   empty::tag_literal<empty::literal_not>

As indicated in the comments following:

//NOTE:varbl_empty_map_bug:

it fails to reduce the rhs to a terminal expression
of type tag_literal<empty::literal_not> at the valu_empty_not_leaves
statement.  However, this only happens when the xfrm_empty_varbl_map0
is included as the 1st term in xfrm_reduce_empty_n.

Does anybody have any ideas of why that happens?

(Continue reading)

Eric Niebler | 8 Apr 02:40

Proto v4

No library ever made it through a review unscathed and proto is no 
exception. There's a new version of proto in branches/proto/v4, and 
Spirit-2 will need some changes to work with it. This is the version 
that will be merged into trunk, eventually.

First the simple things:

* Proto lives at boost/proto/, not boost/xpressive/proto
* boost/proto/proto.hpp now includes all of proto with the
   exception of the typeof registrations. That includes the
   contexts, the transforms and the debugging utilities. If
   you just want the core of proto without the other stuff,
   there is boost/proto/core.hpp
* s/posit/unary_plus/
* s/arg/child, s/arg_c/child_c/, s/_argN/_childN
* s/bind/lazy/
* s/_visitor/_data/
* The proto::transform namespace is no more.

Some bigger changes:

The protocol for defining a primitive transform has changed. Previously, 
primitive transforms were just ternary function objects like this:

struct MyTransform : proto::callable
{
   template<class Sig>
   struct result;

   template<class This, class Expr, class State, class Data>
(Continue reading)

Hartmut Kaiser | 25 Feb 02:59

Re: skipper rules silently ignored (spirit2)

Cédric,

This issue should be fixed now by generating a compile time error whenever
the skipper is not convertible to the skipper specified while defining the
grammar/rule.

Thanks again!
Regards Hartmut

> -----Original Message-----
> From: Hartmut Kaiser [mailto:hartmut.kaiser <at> gmail.com]
> Sent: Sunday, February 24, 2008 5:29 PM
> To: 'Spirit Development'
> Cc: 'Joel de Guzman'
> Subject: RE: [Spirit-devel] skipper rules silently ignored (spirit2)
> 
> Hi,
> 
> > Using the latest svn version of spirit2, I have had a small problem
> > with the
> > skipper rule.
> > Since I wanted to use a rule more complexe than space (and that I
> > didn't
> > have its type):
> >
> > charset::space | ('%' >> *~spirit::char_('\n') >> '\n')
> >
> > I defined my grammar like this:
> >
> > template <typename Iterator>
(Continue reading)

Hartmut Kaiser | 25 Feb 00:29

Re: skipper rules silently ignored (spirit2)

Hi,

> Using the latest svn version of spirit2, I have had a small problem
> with the
> skipper rule.
> Since I wanted to use a rule more complexe than space (and that I
> didn't
> have its type):
> 
> charset::space | ('%' >> *~spirit::char_('\n') >> '\n')
> 
> I defined my grammar like this:
> 
> template <typename Iterator>
> struct my_grammar : qi::grammar_def<Iterator, qi::rule<Iterator> >
> {...};
> 
> but doing:
> 
> bool r = phrase_parse(iter, storage.end(), make_parser(def),
> 		charset::space | ('%' >> *~spirit::char_('\n') >> '\n'));
> 
> ignore the skipping rule
> 
> in qi/nonterminal/rule.hpp:170
> 
>   template <typename Iterator_, typename Context, typename Skipper>
>         bool parse(
>             Iterator_& first, Iterator_ const& last
>           , Context& context, Skipper const& skipper) const
(Continue reading)

Cédric Venet | 24 Feb 18:14

skipper rules silently ignored (spirit2)

Hi,

Using the latest svn version of spirit2, I have had a small problem with the
skipper rule.
Since I wanted to use a rule more complexe than space (and that I didn't
have its type):

charset::space | ('%' >> *~spirit::char_('\n') >> '\n')

I defined my grammar like this:

template <typename Iterator>
struct my_grammar : qi::grammar_def<Iterator, qi::rule<Iterator> > {...};

but doing:

bool r = phrase_parse(iter, storage.end(), make_parser(def),
		charset::space | ('%' >> *~spirit::char_('\n') >> '\n'));

ignore the skipping rule

in qi/nonterminal/rule.hpp:170

  template <typename Iterator_, typename Context, typename Skipper>
        bool parse(
            Iterator_& first, Iterator_ const& last
          , Context& context, Skipper const& skipper) const
        {
// in this function, the skipper is ok
// but this call loose it (select the unused_type for the skipper overload
(Continue reading)

Eric Niebler | 12 Jan 07:45

proto breaking changes (and patch for spirit2)

I've committed to boost svn head a new version of proto with improved 
transforms. This is a breaking change. There isn't documentation yet for 
the new transforms, so I made a patch that gets Spirit-2 working again. 
(At least, it works with msvc, but there appear to be other problems 
with spirit-2 and gcc which are unrelated.) Patch attached.

Cheers,

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com
Index: boost/spirit/lex/lexer/meta_grammar.hpp
===================================================================
--- boost/spirit/lex/lexer/meta_grammar.hpp	(revision 785)
+++ boost/spirit/lex/lexer/meta_grammar.hpp	(working copy)
@@ -99,11 +99,11 @@
             // semantic actions for tokens
             meta_grammar::binary_rule<
                 lex::domain, proto::tag::subscript, action,
-                token_def_meta_grammar, proto::transform::arg<proto::_>
+                token_def_meta_grammar, proto::when<proto::_, proto::_arg>
             >,
             meta_grammar::binary_rule<
                 lex::domain, proto::tag::subscript, action,
-                action_lexer_meta_grammar, proto::transform::arg<proto::_>
+                action_lexer_meta_grammar, proto::when<proto::_, proto::_arg>
             >
(Continue reading)

[fusion] Constructing fusion::map<P1, P2, .., PN> Requires same ordering of P's?

Hi Everyone,

I don't know if this is a bug or intended behavior, given the snippet
below:

<code>

struct tags {
  struct type_1 { };
  struct type_2 { };
};

typedef map< pair<tags::type_1, int>, pair<tags::type_2, int> > 
	my_map_type;

void foo() {
  my_map_type instance( make_pair<tags::type_2>(1),
make_pair<tags::type_2>(2) );
};

</code>

It complains that instance does not have a defined constructor given the
order of arguments. I'm using Fusion that's in Boost SVN trunk revision
39151 -- frozen due to internal development/engineering decisions.

Is this a bug, or a feature?

Insights would be most appreciated.

(Continue reading)

Dean Michael Berris | 22 Sep 08:02

[fusion] Short-circuited Exception-based View Iteration

Hi Everyone,

I'm not sure if the title makes sense, but I have a problem which can
be solved with a handful of preprocessor macros, but would like to see
solved with Fusion.

Let's say I have a vector of values:

fusion::vector<int, int, int, int> ints(0, 1, 2, 3);

I then have a function such as:

struct function {
  void operator()(int value) {
    if (value < 2)
      throw runtime_error("less than 3");
    cout << value << endl;
  };
};

Would there be a way for me to iterate through every element of 'ints'
and apply the function object instance to each element, and stop the
iteration only when function does not throw?

I know using exceptions for control flow is pretty frowned upon, and I
can certainly use it the other way around -- to short-circuit the
iteration only when it throws.

If you're interested in the use case for this particular question, I'm
looking for a way to make the dispatcher library I'm working on
(Continue reading)

Spirit & Karma | 12 Sep 13:52

[Spirit & Karma] #36: Create missing utilities for spirit2 (distinct parsers, iterators etc.)

#36: Create missing utilities for spirit2 (distinct parsers, iterators etc.)
-------------------------+--------------------------------------------------
 Reporter:  guest        |       Owner:  djowel   
     Type:  enhancement  |      Status:  new      
 Priority:  major        |   Milestone:  Spirit V2
Component:  Spirit       |     Version:  Spirit V2
 Keywords:               |  
-------------------------+--------------------------------------------------
 While the main part of spirit2 is already working, its still missing some
 utilities, people are used to in spirit1.x.

 For example distinct parser, or file/position iterators.

 Would be nice to know if there are plans to implement them soon, or on
 how-to-do-that ;)

--

-- 
Ticket URL: <http://fortytwo.cct.lsu.edu:8000/SpiritKarma/ticket/36>
Spirit &amp; Karma <http://spirit.sourceforge.net>
Development of the Boost::Spirit V2 libraries
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Spirit & Karma | 12 Sep 13:44

[Spirit & Karma] #35: confix and comment parsers implementation with functor parsers

#35: confix and comment parsers implementation with functor parsers
--------------------+-------------------------------------------------------
 Reporter:  guest   |       Owner:  djowel   
     Type:  defect  |      Status:  new      
 Priority:  major   |   Milestone:  Spirit V2
Component:  Spirit  |     Version:  Spirit V2
 Keywords:          |  
--------------------+-------------------------------------------------------
 Hi,

 I am Jens Weller, logged in as guest ;)

 Hartmut and Me have discussed how to implement the confix and comment
 parsers quickly.
 Hartmut suggested using the functorparser and implementing it this way.
 Thats what we did, and as a result, I send the confix.hpp last Monday to
 the mailinglist (general).
 There is still a problem with compilation, Hartmut is currently busy, so
 would be nice if someone else could take a look at it...

 regards

 Jens

--

-- 
Ticket URL: <http://fortytwo.cct.lsu.edu:8000/SpiritKarma/ticket/35>
Spirit &amp; Karma <http://spirit.sourceforge.net>
Development of the Boost::Spirit V2 libraries
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
(Continue reading)

Nicola Musatti | 1 Sep 00:41

Spirit 1.8.5 and 1.6.4 released

It is my pleasure to announce the release of Spirit 1.8.5 and 1.6.4 .

Spirit 1.8.5 is a standalone variant of the version that is included in 
Boost 1.34.1; it doesn't provide new features, but contains all the 
fixes that were applied since Spirit 1.8.4 . You can download Spirit 
1.8.5 here:

http://sourceforge.net/project/showfiles.php?group_id=28447&package_id=20317&release_id=536340
http://tinyurl.com/36sj7f

Spirit 1.6.4 is the latest in a series of releases that are based on an 
earlier implementation that is friendlier towards older, less standard 
compliant compilers. This is a bug fix only release and is likely to be 
the final 1.6.x version. Spirit 1.6.4 is available here:

http://sourceforge.net/project/showfiles.php?group_id=28447&package_id=20317&release_id=536348
http://tinyurl.com/3dnnhv

Both Spirit 1.8.5 and 1.6.4 are available in the following variants:

Library only (the spirit-1.x.y.zip / spirit-1.x.y.tar.gz files) - These 
contain only Spirit itself and require an existing Boost installation. 
Both were tested only with Boost 1.34.0 and 1.34.1, but should work with 
other reasonably recent releases.

Miniboost (the spirit-1.x.y-miniboost.zip / 
spirit-1.x.y-miniboost.tar.gz files) - These contain also the minimal 
subset of Boost that is needed to use Spirit. This is a new version of 
the Miniboost that is based on Boost 1.34.1 and has the same directory 
structure as Boost itself.
(Continue reading)


Gmane