Thread overview
Writing parsers
Sep 18, 2004
Stephan Wienczny
Sep 18, 2004
Lars Ivar Igesund
Sep 18, 2004
Stephan Wienczny
Sep 19, 2004
J C Calvarese
[Digression] Re: Writing parsers
Sep 20, 2004
Stephen Silber
Sep 24, 2004
Ilya Minkov
September 17, 2004
I need to write a lexer / parser for a language like SQL and thougth this was the perfect change to learn D. Any comments, advice or tutorials that you can recomend.

Thanks.


September 18, 2004
Someone surfing on the net wrote:
> I need to write a lexer / parser for a language like SQL and thougth this was
> the perfect change to learn D. Any comments, advice or tutorials that you can
> recomend.
> 
> Thanks.
> 
> 
Look at Walter's frontend source code...

Stephan
September 18, 2004
Stephan Wienczny wrote:
> Someone surfing on the net wrote:
> 
>> I need to write a lexer / parser for a language like SQL and thougth this was
>> the perfect change to learn D. Any comments, advice or tutorials that you can
>> recomend.
>>
>> Thanks.
>>
>>
> Look at Walter's frontend source code...

How would a D parser in C help with writing a parser for a SQL-like language in D?

Lars Ivar Igesund
September 18, 2004
Lars Ivar Igesund wrote:
> 
> How would a D parser in C help with writing a parser for a SQL-like language in D?
> 
> Lars Ivar Igesund

It helps writing parsers in general. IMHO there is no big difference between C and D for Parsers. The concept is still the same.

Stephan
September 19, 2004
Someone surfing on the net wrote:
> I need to write a lexer / parser for a language like SQL and thougth this was the perfect change to learn D. Any comments, advice or tutorials that you can recomend.
> 
> Thanks.

A while back, I converted a program called D2HTML into another program that attempts to produce syntax-highlighted webpages. I haven't spend much time on the SQL analysis part of it, so there's probably a lot of unnecessary code. In case it makes a difference, it was targeted at Microsoft Access-style SQL.

Maybe this will help you figure out how to accomplish your goal, so I'm attaching the code and the other files needed to use it.


If you're looking for general D tutorials, try: http://www.prowiki.org/wiki4d/wiki.cgi?D__Tutorial

-- 
Justin (a/k/a jcc7)
http://jcc_7.tripod.com/d/


September 19, 2004
J C Calvarese wrote:

> Microsoft Access-style SQL.

A small digression, being in a suitably bleak mood at the moment:

"Microsoft Access-style ___Standard___ Query Language"

Cheers,
Sigbjørn Lund Olsen
September 20, 2004
In all honesty, go use a prebuilt solution, and do something less painful to learn D!

Check out www.antlr.org for a great parser toolkit that already has a SQL grammar for it.

>
>I need to write a lexer / parser for a language like SQL and thougth this was the perfect change to learn D. Any comments, advice or tutorials that you can recomend.


September 24, 2004
Someone surfing on the net schrieb:

> I need to write a lexer / parser for a language like SQL and thougth this was
> the perfect change to learn D. Any comments, advice or tutorials that you can
> recomend.

For a very calm introduction, you may like

http://compilers.iecc.com/crenshaw/

It doesn't cover many things, but i liked it. I work somewhat differently for my purposes, but the basic ideas are the same. Don't hesitate to ask me questions, we will work out some solutions.

Otherwise, you may want to use some parser generator - i half-way even ported COCO/R to D, but then decided to change the direction and change the C version instead of porting the Java one. If i have time next days, i do that.

-eye/photoallergics