Writing a language parser in D

Justin Johansson procode at adam-dott-com.au
Tue Sep 15 01:34:48 PDT 2009


Hi downs,

Thanks for the offer but since YACC is my prior background I'll probably go to the closest tool which is the modern variant for LL(1).  Still if you have a small sample to share I'm sure other D people will be delighted.

<JJ/>

downs Wrote:

> 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
> > 
> 
> In a completely different vein, tools.rd is a simplicistic recursive descent parser framework implemented at compiletime that I've used for most/all of my toy languages. It keeps things trivial - there's no lexing stage, it parses straight from input string. It's not that well documented, but if you want, give me a simple language description and I can write you a sample parser. It's probably the easiest to use though - just mix it in from D code :)




More information about the Digitalmars-d mailing list