digitalmars.D - DMD Frontend
- imr1984 (4/4) May 26 2005 Ok so the dmd front end source comes with the compiler, but is it actual...
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (3/8) May 26 2005 FAQ, see http://www.prowiki.org/wiki4d/wiki.cgi?DMDSourceGuide
- Ben Hinkle (4/9) May 26 2005 see also http://home.comcast.net/~benhinkle/dmdfe/ the "dmd front end
- G.Vidal (25/27) May 26 2005 BTW I still cant compile it:
- imr1984 (2/29) May 26 2005
- Ben Hinkle (5/40) May 26 2005 Sorry - I still haven't updated that. I remember getting those before an...
- Paolo Invernizzi (7/10) May 26 2005 What about keeping a 'generic' compilable frontend in dsource?
- imr1984 (4/14) May 26 2005 thanks man that was just what i needed :)
- Ben Hinkle (4/27) May 26 2005 oh, I might have taken out the debugging prints. I thought I had updated...
- imr1984 (5/34) May 26 2005 Ben, can you give me an idea of how I could modify your dmdfe to print o...
- Ben Hinkle (12/57) May 26 2005 It sortof depends at what stage you want to print out the tree. Check ou...
- imr1984 (3/63) May 26 2005 Cheers Ben - you're a star!
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
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
"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
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
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
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
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
"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 :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.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
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
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
"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
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
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
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