www.digitalmars.com         C & C++   DMDScript  

D - Using the front end for DMD

reply "Charles" <sanders-consulting comcast.net> writes:
Has anyone used this in their project ?  Im looking for a way to parse out
variables and their types , I havent actually looked at it yet was wondering
if anyone has done work with it.

Thanks,
C
Dec 25 2003
parent reply "Sean L. Palmer" <palmer.sean verizon.net> writes:
I tried to compile it a while back but it's missing a few key ingredients.
Maybe Walter cleared some of that up (some of it was my own
misunderstanding)

(You pretty much need to make a wrapper around his backend, which you don't
have the source or even the interface to.)

Otherwise it's pretty clean C-style C++, should be pretty easy to work with.

Sean

"Charles" <sanders-consulting comcast.net> wrote in message
news:bsffca$1k95$1 digitaldaemon.com...
 Has anyone used this in their project ?  Im looking for a way to parse out
 variables and their types , I havent actually looked at it yet was

 if anyone has done work with it.

 Thanks,
 C

Dec 25 2003
next sibling parent reply "Charles" <sanders-consulting comcast.net> writes:
Cool, maybe Walter has a makefile for it ? <nudge,nudge > :)

C

"Sean L. Palmer" <palmer.sean verizon.net> wrote in message
news:bsfkac$1s6a$1 digitaldaemon.com...
 I tried to compile it a while back but it's missing a few key ingredients.
 Maybe Walter cleared some of that up (some of it was my own
 misunderstanding)

 (You pretty much need to make a wrapper around his backend, which you

 have the source or even the interface to.)

 Otherwise it's pretty clean C-style C++, should be pretty easy to work

 Sean

 "Charles" <sanders-consulting comcast.net> wrote in message
 news:bsffca$1k95$1 digitaldaemon.com...
 Has anyone used this in their project ?  Im looking for a way to parse


 variables and their types , I havent actually looked at it yet was

 if anyone has done work with it.

 Thanks,
 C


Dec 25 2003
parent reply Ilya Minkov <minkov cs.tum.edu> writes:
Charles wrote:
 Cool, maybe Walter has a makefile for it ? <nudge,nudge > :)
 
 C

Don't be a wimp! The problem is not the makefile. With such an attitude, you will definately not draw any wisdom from the front-end. -eye
Dec 26 2003
parent reply "Charles" <sanders-consulting comcast.net> writes:
True I'm lazy :P.  I actually think it will be easier to write my own, thats
probably the route Ill go.

Aren't you involved with the GNU port ? How's that going ?

C


"Ilya Minkov" <minkov cs.tum.edu> wrote in message
news:bsha8o$1jjd$1 digitaldaemon.com...
 Charles wrote:
 Cool, maybe Walter has a makefile for it ? <nudge,nudge > :)

 C

Don't be a wimp! The problem is not the makefile. With such an attitude, you will definately not draw any wisdom from the front-end. -eye

Dec 26 2003
parent reply Ilya Minkov <minkov cs.tum.edu> writes:
Not that anyone is currently involved with a GNU port. ;) Jan has no 
time, myself neither. I had made the first year of studies too simple 
for myself, and now i'm in trouble.

The first step would be to write a simple dumper, which would show that 
i have gained enough of understanding the DMD front-end. This would 
allow to create the first D->C compiler, which should be enough for the 
first. And also stuff like interpreters. The "real" GCC connection comes 
with the next enthusiastic generation of D users. ;)

For the code analyser you definately need much less of the frontend. I 
have not read the parser source, so i cannot tell you whether it makes 
sense to reuse it or not. Anyway, since it's a recursive descent, even 
if you would be putting your own grammar together, the source should 
give a lot of clues as to how the BNF should look. It definately makes 
sense to use LL(inf) generator, which will make sure the grammar will be 
fairly valid.

-eye

Charles wrote:
 True I'm lazy :P.  I actually think it will be easier to write my own, thats
 probably the route Ill go.
 
 Aren't you involved with the GNU port ? How's that going ?
 
 C

Dec 27 2003
parent reply "C" <dont respond.com> writes:
LL(inf) ?  lex & yacc is ll(1) right ?  Do you know of any parser generators
for LL(inifty?) ?

C


"Ilya Minkov" <minkov cs.tum.edu> wrote in message
news:bsjj0h$2f0t$1 digitaldaemon.com...
 Not that anyone is currently involved with a GNU port. ;) Jan has no
 time, myself neither. I had made the first year of studies too simple
 for myself, and now i'm in trouble.

 The first step would be to write a simple dumper, which would show that
 i have gained enough of understanding the DMD front-end. This would
 allow to create the first D->C compiler, which should be enough for the
 first. And also stuff like interpreters. The "real" GCC connection comes
 with the next enthusiastic generation of D users. ;)

 For the code analyser you definately need much less of the frontend. I
 have not read the parser source, so i cannot tell you whether it makes
 sense to reuse it or not. Anyway, since it's a recursive descent, even
 if you would be putting your own grammar together, the source should
 give a lot of clues as to how the BNF should look. It definately makes
 sense to use LL(inf) generator, which will make sure the grammar will be
 fairly valid.

 -eye

 Charles wrote:
 True I'm lazy :P.  I actually think it will be easier to write my own,


 probably the route Ill go.

 Aren't you involved with the GNU port ? How's that going ?

 C


Jan 02 2004
parent "Sean L. Palmer" <palmer.sean verizon.net> writes:
Antlr is LL(k)  (effectively infinity)

http://www.antlr.org/

lex & yacc are LALR

Sean

"C" <dont respond.com> wrote in message
news:bt4q7k$r15$1 digitaldaemon.com...
 LL(inf) ?  lex & yacc is ll(1) right ?  Do you know of any parser

 for LL(inifty?) ?

Jan 03 2004
prev sibling parent Ilya Minkov <minkov cs.tum.edu> writes:
Sean L. Palmer wrote:
 I tried to compile it a while back but it's missing a few key ingredients.
 Maybe Walter cleared some of that up (some of it was my own
 misunderstanding)

It misses critical header files, which belong to back-end.
 (You pretty much need to make a wrapper around his backend, which you don't
 have the source or even the interface to.)

The good ol' DLI fills the gap. Theoretically. There would still be a lot to do.
 Otherwise it's pretty clean C-style C++, should be pretty easy to work with.

But it's HUGE. I'd say it might rather make sense to write a grammar for a OO parser generator such as Antlr. I was going to hack up some basic back-end for D like C output, but i give up. I simply don't have the time. -eye
Dec 25 2003