www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - DMD Frontend

reply imr1984 <imr1984_member pathlink.com> writes:
Ok so the dmd front end source comes with the compiler, but is it actually
compilable in any way? ive tried to use the Parser class in the parse.cpp file
but it says that it needs Id.h, which is nowhere to be found. 

Has anyone had any success with it?
May 26 2005
next sibling parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
imr1984 wrote:

 Ok so the dmd front end source comes with the compiler, but is it actually
 compilable in any way? ive tried to use the Parser class in the parse.cpp file
 but it says that it needs Id.h, which is nowhere to be found. 
 
 Has anyone had any success with it?

FAQ, see http://www.prowiki.org/wiki4d/wiki.cgi?DMDSourceGuide --anders
May 26 2005
prev sibling parent reply "Ben Hinkle" <ben.hinkle gmail.com> writes:
"imr1984" <imr1984_member pathlink.com> wrote in message 
news:d74sea$2nbj$1 digitaldaemon.com...
 Ok so the dmd front end source comes with the compiler, but is it actually
 compilable in any way? ive tried to use the Parser class in the parse.cpp 
 file
 but it says that it needs Id.h, which is nowhere to be found.

 Has anyone had any success with it?

see also http://home.comcast.net/~benhinkle/dmdfe/ the "dmd front end starter kit". I think it's at dmd.123 or so.
May 26 2005
next sibling parent reply "G.Vidal" <gyvidal wanadoo.fr> writes:
Le Thu, 26 May 2005 12:27:58 -0400, Ben Hinkle a écrit :

 see also http://home.comcast.net/~benhinkle/dmdfe/ the "dmd front end 
 starter kit". I think it's at dmd.123 or so.

BTW I still cant compile it: jeff Anna:~/dmdfe$ make -f linux.mak cd dmd; g++ idgen.c -o idgen cd dmd; ./idgen cd dmd; g++ impcnvgen.c -o impcnvgen cd dmd; ./impcnvgen g++ -c -g -Istubs -Idmd -odmd/access.o dmd/access.c g++ -c -g -Istubs -Idmd -odmd/array.o dmd/array.c g++ -c -g -Istubs -Idmd -odmd/attrib.o dmd/attrib.c In file included from dmd/attrib.c:21: dmd/declaration.h:31: error: use of enum `TOK' without previous declaration dmd/declaration.h:31: error: déclaration ne déclarant rien du tout dmd/declaration.h:32: error: use of enum `MATCH' without previous declaration dmd/declaration.h:32: error: déclaration ne déclarant rien du tout dmd/declaration.h:57: error: 'MATCH' is used as a type, but is not defined as a type. dmd/declaration.h:392: error: use of enum `TOK' without previous declaration dmd/declaration.h:392: error: le C++ ISO interdit la déclaration de « tok » sans type dmd/declaration.h:394: error: use of enum `TOK' without previous declaration dmd/declaration.h:395: error: le C++ ISO interdit la déclaration de « tok » sans type make: *** [dmd/attrib.o] Erreur 1 jeff Anna:~/dmdfe$
May 26 2005
next sibling parent reply imr1984 <imr1984_member pathlink.com> writes:
hmm win32 version works fine.

In article <pan.2005.05.26.18.50.46.25133 wanadoo.fr>, G.Vidal says...
Le Thu, 26 May 2005 12:27:58 -0400, Ben Hinkle a écrit :

 see also http://home.comcast.net/~benhinkle/dmdfe/ the "dmd front end 
 starter kit". I think it's at dmd.123 or so.

BTW I still cant compile it: jeff Anna:~/dmdfe$ make -f linux.mak cd dmd; g++ idgen.c -o idgen cd dmd; ./idgen cd dmd; g++ impcnvgen.c -o impcnvgen cd dmd; ./impcnvgen g++ -c -g -Istubs -Idmd -odmd/access.o dmd/access.c g++ -c -g -Istubs -Idmd -odmd/array.o dmd/array.c g++ -c -g -Istubs -Idmd -odmd/attrib.o dmd/attrib.c In file included from dmd/attrib.c:21: dmd/declaration.h:31: error: use of enum `TOK' without previous declaration dmd/declaration.h:31: error: déclaration ne déclarant rien du tout dmd/declaration.h:32: error: use of enum `MATCH' without previous declaration dmd/declaration.h:32: error: déclaration ne déclarant rien du tout dmd/declaration.h:57: error: 'MATCH' is used as a type, but is not defined as a type. dmd/declaration.h:392: error: use of enum `TOK' without previous declaration dmd/declaration.h:392: error: le C++ ISO interdit la déclaration de « tok » sans type dmd/declaration.h:394: error: use of enum `TOK' without previous declaration dmd/declaration.h:395: error: le C++ ISO interdit la déclaration de « tok » sans type make: *** [dmd/attrib.o] Erreur 1 jeff Anna:~/dmdfe$

May 26 2005
parent reply "G.Vidal" <gyvidal wanadoo.fr> writes:
Le Thu, 26 May 2005 19:11:41 +0000, imr1984 a écrit :

 hmm win32 version works fine.

The code is not ISO compliant. To compile it I had to add #include "" directives in 3 or 4 source file, then it compiled with a lot of warning saying that the code uses deprecated things in the libc. But when I run it, it doesn't print anything :(
May 26 2005
parent imr1984 <imr1984_member pathlink.com> writes:
run it like:

dmdfe mandel.d

or whatever

In article <pan.2005.05.26.19.14.17.194715 wanadoo.fr>, G.Vidal says...
Le Thu, 26 May 2005 19:11:41 +0000, imr1984 a écrit :

 hmm win32 version works fine.

The code is not ISO compliant. To compile it I had to add #include "" directives in 3 or 4 source file, then it compiled with a lot of warning saying that the code uses deprecated things in the libc. But when I run it, it doesn't print anything :(

May 26 2005
prev sibling parent reply "Ben Hinkle" <bhinkle mathworks.com> writes:
"G.Vidal" <gyvidal wanadoo.fr> wrote in message 
news:pan.2005.05.26.18.50.46.25133 wanadoo.fr...
 Le Thu, 26 May 2005 12:27:58 -0400, Ben Hinkle a écrit :

 see also http://home.comcast.net/~benhinkle/dmdfe/ the "dmd front end
 starter kit". I think it's at dmd.123 or so.

BTW I still cant compile it:

Sorry - I still haven't updated that. I remember getting those before and I vaguely recall I had to insert some more includes into the c files. I'm afraid it's a bit of trial and error.
 jeff Anna:~/dmdfe$ make -f linux.mak
 cd dmd; g++ idgen.c -o idgen
 cd dmd; ./idgen
 cd dmd; g++ impcnvgen.c -o impcnvgen
 cd dmd; ./impcnvgen
 g++ -c -g -Istubs -Idmd -odmd/access.o dmd/access.c
 g++ -c -g -Istubs -Idmd -odmd/array.o dmd/array.c
 g++ -c -g -Istubs -Idmd -odmd/attrib.o dmd/attrib.c
 In file included from dmd/attrib.c:21:
 dmd/declaration.h:31: error: use of enum `TOK' without previous 
 declaration
 dmd/declaration.h:31: error: déclaration ne déclarant rien du tout
 dmd/declaration.h:32: error: use of enum `MATCH' without previous 
 declaration
 dmd/declaration.h:32: error: déclaration ne déclarant rien du tout
 dmd/declaration.h:57: error: 'MATCH' is used as a type, but is not defined 
 as a
   type.
 dmd/declaration.h:392: error: use of enum `TOK' without previous 
 declaration
 dmd/declaration.h:392: error: le C++ ISO interdit la déclaration de « 
 tok »
   sans type
 dmd/declaration.h:394: error: use of enum `TOK' without previous 
 declaration
 dmd/declaration.h:395: error: le C++ ISO interdit la déclaration de « 
 tok »
   sans type
 make: *** [dmd/attrib.o] Erreur 1
 jeff Anna:~/dmdfe$
 

May 26 2005
parent Paolo Invernizzi <arathorn NOSPAM_fastwebnet.it> writes:
Ben Hinkle wrote:

 Sorry - I still haven't updated that. I remember getting those before and I 
 vaguely recall I had to insert some more includes into the c files. I'm 
 afraid it's a bit of trial and error.

What about keeping a 'generic' compilable frontend in dsource? It can be a starting point for a collaborative effort of keeping it in sync with Walter releases, and several projects can benefit from it... If Walter is not against this... --- Paolo
May 26 2005
prev sibling parent reply imr1984 <imr1984_member pathlink.com> writes:
thanks man that was just what i needed :)

Ive built your dmdfe, but it doesnt print anything like you said it does, it
just says that it parsed the mandel.d file successfully. 

In article <d74teh$2o44$1 digitaldaemon.com>, Ben Hinkle says...
"imr1984" <imr1984_member pathlink.com> wrote in message 
news:d74sea$2nbj$1 digitaldaemon.com...
 Ok so the dmd front end source comes with the compiler, but is it actually
 compilable in any way? ive tried to use the Parser class in the parse.cpp 
 file
 but it says that it needs Id.h, which is nowhere to be found.

 Has anyone had any success with it?

see also http://home.comcast.net/~benhinkle/dmdfe/ the "dmd front end starter kit". I think it's at dmd.123 or so.

May 26 2005
parent reply "Ben Hinkle" <bhinkle mathworks.com> writes:
"imr1984" <imr1984_member pathlink.com> wrote in message 
news:d755qt$2v64$1 digitaldaemon.com...
 thanks man that was just what i needed :)

 Ive built your dmdfe, but it doesnt print anything like you said it does, 
 it
 just says that it parsed the mandel.d file successfully.

oh, I might have taken out the debugging prints. I thought I had updated the help/readme. I'll fix that up.
 In article <d74teh$2o44$1 digitaldaemon.com>, Ben Hinkle says...
"imr1984" <imr1984_member pathlink.com> wrote in message
news:d74sea$2nbj$1 digitaldaemon.com...
 Ok so the dmd front end source comes with the compiler, but is it 
 actually
 compilable in any way? ive tried to use the Parser class in the 
 parse.cpp
 file
 but it says that it needs Id.h, which is nowhere to be found.

 Has anyone had any success with it?

see also http://home.comcast.net/~benhinkle/dmdfe/ the "dmd front end starter kit". I think it's at dmd.123 or so.


May 26 2005
parent reply imr1984 <imr1984_member pathlink.com> writes:
Ben, can you give me an idea of how I could modify your dmdfe to print out a
tree/list of symbols that were found in the source.

At the moment im experimenting with adding print() calls after the 3rd semantic
analysis but there is so much code its overwhelming...

In article <d756kd$2vr9$1 digitaldaemon.com>, Ben Hinkle says...
"imr1984" <imr1984_member pathlink.com> wrote in message 
news:d755qt$2v64$1 digitaldaemon.com...
 thanks man that was just what i needed :)

 Ive built your dmdfe, but it doesnt print anything like you said it does, 
 it
 just says that it parsed the mandel.d file successfully.

oh, I might have taken out the debugging prints. I thought I had updated the help/readme. I'll fix that up.
 In article <d74teh$2o44$1 digitaldaemon.com>, Ben Hinkle says...
"imr1984" <imr1984_member pathlink.com> wrote in message
news:d74sea$2nbj$1 digitaldaemon.com...
 Ok so the dmd front end source comes with the compiler, but is it 
 actually
 compilable in any way? ive tried to use the Parser class in the 
 parse.cpp
 file
 but it says that it needs Id.h, which is nowhere to be found.

 Has anyone had any success with it?

see also http://home.comcast.net/~benhinkle/dmdfe/ the "dmd front end starter kit". I think it's at dmd.123 or so.



May 26 2005
parent reply "Ben Hinkle" <bhinkle mathworks.com> writes:
It sortof depends at what stage you want to print out the tree. Check out 
the stubs directory and dmd/mars.c and dmd/module.c - those are two 
important files. What happens is that the file is parsed into the parse tree 
and then semantics phases run (various optimizations and inlining etc are 
done) and then Module::genobjfile is called. In the file stubs/ir.c 
Module::genobjfile I have the print statement "successfully parsed and 
analyzed <file name>". I think you could replace the stubs for toElem to do 
something but actually I can't remember the details. I've only used dmdfe 
for making dlint and for that I didn't need to traverse the tree any more 
than dmd already did during the semantic analysis phase.

"imr1984" <imr1984_member pathlink.com> wrote in message 
news:d757rb$30p9$1 digitaldaemon.com...
 Ben, can you give me an idea of how I could modify your dmdfe to print out 
 a
 tree/list of symbols that were found in the source.

 At the moment im experimenting with adding print() calls after the 3rd 
 semantic
 analysis but there is so much code its overwhelming...

 In article <d756kd$2vr9$1 digitaldaemon.com>, Ben Hinkle says...
"imr1984" <imr1984_member pathlink.com> wrote in message
news:d755qt$2v64$1 digitaldaemon.com...
 thanks man that was just what i needed :)

 Ive built your dmdfe, but it doesnt print anything like you said it 
 does,
 it
 just says that it parsed the mandel.d file successfully.

oh, I might have taken out the debugging prints. I thought I had updated the help/readme. I'll fix that up.
 In article <d74teh$2o44$1 digitaldaemon.com>, Ben Hinkle says...
"imr1984" <imr1984_member pathlink.com> wrote in message
news:d74sea$2nbj$1 digitaldaemon.com...
 Ok so the dmd front end source comes with the compiler, but is it
 actually
 compilable in any way? ive tried to use the Parser class in the
 parse.cpp
 file
 but it says that it needs Id.h, which is nowhere to be found.

 Has anyone had any success with it?

see also http://home.comcast.net/~benhinkle/dmdfe/ the "dmd front end starter kit". I think it's at dmd.123 or so.




May 26 2005
parent imr1984 <imr1984_member pathlink.com> writes:
Cheers Ben - you're a star!

Now im gonna program a language service for Visual Studio using this.

In article <d7593v$60$1 digitaldaemon.com>, Ben Hinkle says...
It sortof depends at what stage you want to print out the tree. Check out 
the stubs directory and dmd/mars.c and dmd/module.c - those are two 
important files. What happens is that the file is parsed into the parse tree 
and then semantics phases run (various optimizations and inlining etc are 
done) and then Module::genobjfile is called. In the file stubs/ir.c 
Module::genobjfile I have the print statement "successfully parsed and 
analyzed <file name>". I think you could replace the stubs for toElem to do 
something but actually I can't remember the details. I've only used dmdfe 
for making dlint and for that I didn't need to traverse the tree any more 
than dmd already did during the semantic analysis phase.

"imr1984" <imr1984_member pathlink.com> wrote in message 
news:d757rb$30p9$1 digitaldaemon.com...
 Ben, can you give me an idea of how I could modify your dmdfe to print out 
 a
 tree/list of symbols that were found in the source.

 At the moment im experimenting with adding print() calls after the 3rd 
 semantic
 analysis but there is so much code its overwhelming...

 In article <d756kd$2vr9$1 digitaldaemon.com>, Ben Hinkle says...
"imr1984" <imr1984_member pathlink.com> wrote in message
news:d755qt$2v64$1 digitaldaemon.com...
 thanks man that was just what i needed :)

 Ive built your dmdfe, but it doesnt print anything like you said it 
 does,
 it
 just says that it parsed the mandel.d file successfully.

oh, I might have taken out the debugging prints. I thought I had updated the help/readme. I'll fix that up.
 In article <d74teh$2o44$1 digitaldaemon.com>, Ben Hinkle says...
"imr1984" <imr1984_member pathlink.com> wrote in message
news:d74sea$2nbj$1 digitaldaemon.com...
 Ok so the dmd front end source comes with the compiler, but is it
 actually
 compilable in any way? ive tried to use the Parser class in the
 parse.cpp
 file
 but it says that it needs Id.h, which is nowhere to be found.

 Has anyone had any success with it?

see also http://home.comcast.net/~benhinkle/dmdfe/ the "dmd front end starter kit". I think it's at dmd.123 or so.





May 26 2005