Official D Grammar

Russel Winder russel at winder.org.uk
Wed May 1 09:53:35 PDT 2013


On Wed, 2013-05-01 at 17:34 +0200, Tobias Pankrath wrote:
> On Friday, 26 April 2013 at 20:44:12 UTC, Brian Schott wrote:
> > On Saturday, 20 April 2013 at 08:31:34 UTC, Brian Schott wrote:
> >> This uses ANTLR, as the other parser generators can't handle 
> >> D's grammar.

Which other parser generators? cf. for example,
http://en.wikipedia.org/wiki/Comparison_of_parser_generators

> > I'm beginning to think that ANTRL is not up to the task either. 
> > I've somehow managed to get the grammar to the point where it 
> > correctly parses several phobos modules but takes a half hour 
> > to do so.

LL(k) can sometimes do this. As can LALR(1) of course.

> Do you know, which parts of the grammar make the parser so slow?
> Do you use any suspicious features of ANTLR?

There isn't just one ANTLR: ANTLR 2, ANTLR 3, and ANTLR 4 are very
different beasties.

Not many of the parser generators generate D code :-(

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130501/6c4faf59/attachment.pgp>


More information about the Digitalmars-d mailing list