Parser

BCS BCS at pathlink.com
Tue Feb 6 12:06:14 PST 2007


Michiel wrote:
> I want to write a parser in D. Is there a D library like lex/yacc/bison with
> which I can do syntax-directed translation?
> 

you have several choices

1) use lax/yacc and call from D
	Not recommended

2) enki
	it's fairly mature and works well but requiters an extra build step
http://www.dsource.org/projects/ddl/browser/trunk/enki

3) dparser
	New'n'cool, not vary mature and not well tested but it doesn't requirer 
anything but DMD to build. with the new import expression it will even 
support external BNF files.
http://www.dsource.org/projects/scrapple/browser/trunk/dparser/dparse.d
(Disclosure: It's also my project)

> The digitalmars site said that the D parser has also been written in D. How
> did they build the parser?

The D parser for DMD is in C++.

Classic bootstrapping problem. Then again Walter wrote oplink in ASM!

> 
> Thanks!



More information about the Digitalmars-d mailing list