Writing a language parser in D

Bill Baxter wbaxter at gmail.com
Mon Sep 14 15:12:29 PDT 2009


On Mon, Sep 14, 2009 at 2:46 PM, div0 <div0 at users.sourceforge.net> wrote:
> -----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

I'm not seeing the powershell script or test app in that .zip file.
I don't really need it, I was just curious what the syntax looked like
without any operator overloading.

--bb



More information about the Digitalmars-d mailing list