Thread overview
simple parser framework + lazy bool error
Dec 26, 2006
Daniel919
Dec 26, 2006
Deewiant
Dec 27, 2006
BCS
Jan 07, 2007
Larry Evans
newbie help on mpl::set in D (was Re: simple parser framework + lazy bool error
Jan 08, 2007
Larry Evans
Jan 08, 2007
Larry Evans
December 26, 2006
Hi, this code is working: http://mitglied.lycos.de/daniel919/parser.d

But when I tried to further simplify it,
I encountered an error:
http://mitglied.lycos.de/daniel919/parser_lazy.d
It fails on compiling (dmd 0.178):
Internal error: toir.c 170

Tell me please what you think about the parser.
Bug report is necessary for the lazy bool error ?

Daniel
December 26, 2006
Daniel919 wrote:
> Bug report is necessary for the lazy bool error ?
> 
> Daniel

Whenever the compiler reports an internal error, one should make a bug report about it (unless one has already been made). I took the trouble and reported your problem as Issue 749: http://d.puremagic.com/issues/show_bug.cgi?id=749
December 27, 2006
Daniel919 wrote:
> Hi, this code is working:
> http://mitglied.lycos.de/daniel919/parser.d
> 
> But when I tried to further simplify it,
> I encountered an error:
> http://mitglied.lycos.de/daniel919/parser_lazy.d
> It fails on compiling (dmd 0.178):
> Internal error: toir.c 170
> 
> Tell me please what you think about the parser.
> Bug report is necessary for the lazy bool error ?
> 
> Daniel

Cool! a lot shorter than mine (and it actually works to) but I'm not sure what to make of the syntax.
January 07, 2007
On 12/25/2006 08:02 PM, Daniel919 wrote:
> Hi, this code is working:
> http://mitglied.lycos.de/daniel919/parser.d
> 

That's no longer available :(

Do you have any idea of how to implement the
grammar productions?  Spirit's Joel used the
subrule_list template:

http://boost.cvs.sourceforge.net/boost/boost/boost/spirit/core/non_terminal/subrule.hpp

however, there was discussion of using an mpl-like map:

http://article.gmane.org/gmane.comp.parsers.spirit.devel/2970

There is a simplified mpl::map implementation prototype in the boost
vault here:

http://tinyurl.com/y9tuc3

Maybe it could be translated to D.

BTW, would a D vault counterpart to boost vault be useful for
quick review and feedback on code such as Daniel's?

January 08, 2007
On 01/07/2007 09:11 AM, Larry Evans wrote:
[snip]
> 
> There is a simplified mpl::map implementation prototype in the boost vault here:
> 
> http://tinyurl.com/y9tuc3
> 
> Maybe it could be translated to D.
> 
The attached file is my first attempt at doing this in D.  It just
tries the mpl::set translation; however, I'm getting:
<--------- cut here -----------------
set_proto.d(59): Error: cannot implicitly convert expression
((has_key_tester)(cast(set)(set_int_float))) of type
set_proto.bool_!(false).bool_ to set_proto.bool_!(true).bool_
 >--------- cut here -----------------
Could someone show how to do this in D?

TIA.
-Larry


January 08, 2007
On 01/08/2007 07:48 AM, Larry Evans wrote:
[snip]
> The attached file is my first attempt at doing this in D.  It just
> tries the mpl::set translation; however, I'm getting:
> <--------- cut here -----------------
> set_proto.d(59): Error: cannot implicitly convert expression
> ((has_key_tester)(cast(set)(set_int_float))) of type
> set_proto.bool_!(false).bool_ to set_proto.bool_!(true).bool_
>  >--------- cut here -----------------
> Could someone show how to do this in D?
[snip]
The c++ counter part is attached.  The compiler used
is available from Douglas Gregor and is described here:

http://www.osl.iu.edu/~dgregor/cpp/variadic-templates.pdf

Is this not possible with D?