Looking for champion - std.lang.d.lex

Nick Sabalausky a at a.a
Sun Oct 24 03:21:23 PDT 2010

"Walter Bright" <newshound2 at digitalmars.com> wrote in message 
news:ia0pce$2pbk$1 at digitalmars.com...
> Nick Sabalausky wrote:
>> If anyone's interested, further details are here(1):
>> http://www.devincook.com/goldparser/
> It looks nice, but in clicking around on FAQ, documentation, getting 
> started, etc., I can't find any example code.

Well, that's because that program (GOLD Parser Builder) is just a tool that 
takes in a grammar description file and spits out the lexer/parser DFA/LALR 
tables. Then you use any GOLD-compatible engine in any langauge (such as 
Goldie) to load the DFA/LALR tables and use them to lex/parse. (But again, 
I'm currently working on code that will do that without having to use GOLD 
Parser Builder.)

Here's some specific links for Goldie, and keep in mind that

1. I already have it pretty much converted to D2/Phobos in trunk (it used to 
be D1/Tango),
2. The API is not final and definitely open to suggestions (I have a few 
ideas already),
3. Any suggestions for improvements to the documentation, are, of course, 
welcome too,
4. Like I've said, in the next official release, using "GOLD Parser Builder" 
won't actually be required.

Main Goldie Project page:

Documentation for latest official release:

Samples directory in trunk:

Slightly old documentation for the samples:

There's two "calculator" samples. They're the same, but correspond to the 
two different styles Goldie supports. One, "dynamic", doesn't involve any 
source-code-generation step and can load and use any arbitrary grammar at 
runtime (neat usages of this are shown in the "ParseAnything" sample and in 
the "Parse" tool 
http://www.semitwist.com/goldiedocs/current/Docs/Tools/Parse/ ). The other, 
"static", does involve generating some source-code (via a comand-line tool), 
but that gives you an API that's statically-checked against the grammar. The 
differences and pros/cons between these two styles are explained here (let 
me know if it's unclear):

More information about the Digitalmars-d mailing list