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
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 27, 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
1 2
Next ›   Last »