Writing a language parser in D

div0 div0 at users.sourceforge.net
Mon Sep 14 14:46:03 PDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Justin Johansson wrote:
> Can D people please recommend suitable tools for generating a parser (in D) for an LL(1) grammar.  There's bound to be much better parser generator tools available nowadays, since my last foray into this area 10+ years ago with YACC.  I've heard of tools like bison, SableCC etc but apart from the names know nothing about them.
> 
> (Note.  This question is not about writing a parser for D.  It is about writing a parser in D for another language which has an LL(1) grammar).
> 
> Thanks in advance for all help.
> 
> -- Justin Johansson
> 

I've ported boost::spirit to d. No idea if it does what you want,
but I've written some fairly complicated grammars with it.

It's not a tool though, you just define your grammar directly in code.
Which is either a plus or a minus depending on your point of view.

Quick intro:

http://www.boost.org/doc/libs/1_36_0/libs/spirit/classic/index.html

And D implementation:

http://www.sstk.co.uk/spiritd.php

- --
My enormous talent is exceeded only by my outrageous laziness.
http://www.ssTk.co.uk
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFKrrmbT9LetA9XoXwRAg0ZAJ95oFr48DUbDEBGKUOCpWDNewYhGwCfQb83
ud7OQmiXnPmpAuRQdpLHyLc=
=PPEc
-----END PGP SIGNATURE-----



More information about the Digitalmars-d mailing list