www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - simple parser framework + lazy bool error

reply Daniel919 <Daniel919 web.de> writes:
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
Dec 25 2006
next sibling parent Deewiant <deewiant.doesnotlike.spam gmail.com> writes:
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
Dec 26 2006
prev sibling next sibling parent BCS <BCS pathilink.com> writes:
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.
Dec 27 2006
prev sibling parent reply Larry Evans <cppljevans cos-internet.com> writes:
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?
Jan 07 2007
parent reply Larry Evans <cppljevans cos-internet.com> writes:
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
Jan 08 2007
parent Larry Evans <cppljevans cos-internet.com> writes:
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?
Jan 08 2007