This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: reproducing C source code from gcc parse tree?


On Mon, 8 Oct 2001 19:52:14 -0400  Diego Novillo wrote:
>On Mon, 08 Oct 2001, Dennis Dams wrote:
>
>> Hi,
>>
>> Is there any functionality in gcc that allows to reproduce C source
>> code from a parse tree (i.e. from the tree representation as defined
>> in tree.h)?
>>
>Nope.  It shouldn't be too hard, though.

I can confirm that, at least partially - for the C++ classes and the method
declarations within them - I have done that work for sufficiently big and complex
collection of the classes, using gcc 3.0 . But I warn you that if you are going
to play with the attributes, then you may meet several annoying errors in gcc,
some of them are hard to locate and fix (not being accustomed with the gcc).
And I didn't deal with the expressions (except of trivial cases in the default
values for the parameters) and the templates.
  The documentation (chapter "Trees" in the gcc manual) gives a more or less
suitable starting point, but in many cases you should find a proper macro yourself
(and yes, you may expect that it exists somewhere in tree.h ).


Alexander Kopilovitch                      aek@vib.usr.pu.ru
Saint-Petersburg
Russia


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]