www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - D Parser

reply "Andres C. Rodriguez" <acr ai.sri.com> writes:
Hello all,

I am looking for:

1) A grammar for D, which I suppose it's available.
2) A tool for generting a D AST (Abstract Syntax Tree).

I assume the second one is available thru the compiler, but not 
necessarily in D or in a digestable way.

Thanks for any info,

Andres
Aug 03 2004
next sibling parent parabolis <parabolis softhome.net> writes:
Andres C. Rodriguez wrote:

 
 Hello all,
 
 I am looking for:
 
 1) A grammar for D, which I suppose it's available.
 2) A tool for generting a D AST (Abstract Syntax Tree).
 
 I assume the second one is available thru the compiler, but not 
 necessarily in D or in a digestable way.
 
 Thanks for any info,
 
 Andres

The D docs provide the only publicly available (BNF) grammar parts I am aware of: http://www.digitalmars.com/d/index.html The source for the whole front end of the compiler is in the dmd/src directory if you download it: http://www.digitalmars.com/d/dcompiler.html
Aug 03 2004
prev sibling next sibling parent reply Stephan Wienczny <Stephan Wienczny.de> writes:
Andres C. Rodriguez wrote:
 
 Hello all,
 
 I am looking for:
 
 1) A grammar for D, which I suppose it's available.
 2) A tool for generting a D AST (Abstract Syntax Tree).
 
 I assume the second one is available thru the compiler, but not 
 necessarily in D or in a digestable way.
 
 Thanks for any info,
 
 Andres

There has been somebody on this newsgroup who, released a grammar for antlr. I don't exactly know which post it was, but maybe sombody else remembers... Stephan
Aug 04 2004
parent reply J C Calvarese <jcc7 cox.net> writes:
In article <ceq922$252e$1 digitaldaemon.com>, Stephan Wienczny says...
Andres C. Rodriguez wrote:
 
 Hello all,
 
 I am looking for:
 
 1) A grammar for D, which I suppose it's available.
 2) A tool for generting a D AST (Abstract Syntax Tree).
 
 I assume the second one is available thru the compiler, but not 
 necessarily in D or in a digestable way.
 
 Thanks for any info,
 
 Andres

There has been somebody on this newsgroup who, released a grammar for antlr. I don't exactly know which post it was, but maybe sombody else remembers... Stephan

I'm sure someone released some sort of grammar a while ago, but I think that the last time antlr was discussed, no one released anything. Here's the thread I found: digitalmars.D/4953 jcc7
Aug 04 2004
parent Stephan Wienczny <Stephan Wienczny.de> writes:
J C Calvarese wrote:
 In article <ceq922$252e$1 digitaldaemon.com>, Stephan Wienczny says...
 
 I'm sure someone released some sort of grammar a while ago, but I think that
the
 last time antlr was discussed, no one released anything. Here's the thread I
 found: digitalmars.D/4953
 
 jcc7

I think I saw the grammar, but it wasn't not (yet) finished. Stephan
Aug 04 2004
prev sibling parent Andy Friesen <andy ikagames.com> writes:
Andres C. Rodriguez wrote:

 
 Hello all,
 
 I am looking for:
 
 1) A grammar for D, which I suppose it's available.
 2) A tool for generting a D AST (Abstract Syntax Tree).
 
 I assume the second one is available thru the compiler, but not 
 necessarily in D or in a digestable way.
 
 Thanks for any info,

Walter hasn't written a complete, formal grammar. There is this, though: <http://dsource.org/forums/viewtopic.php?t=258> -- andy
Aug 04 2004