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]
Other format: [Raw text]

C++ Parse Tree XML Export


Hi,
I´d like to implement a well structured export functionality of a high level
c++ parse tree.
it isn´t much of a compiler, but since c++ is not easy to parse I´m
considering GCC for parsing.
the output could be useful for source code browsers, source-to-source
transformers and so on.

so, I´m not very much into gcc internals, so far(using
dump_node(TDI_original)):

 - rest_of_compilation/rest_of_decl_compilation is too late to catch the
tree.
gcc already added implicit stuff like constructors, "this"-parameter and so
on.
(and not everything is marked "artificial". is there a reason why an
implicit constructor isn´t artificial?)

 - everything before rest_of(_decl)_compilation seems to be very distributed
among the parser.
is there a central function which gets called for any declaration/definition
parsed?

what I need is a tree which is parsed, of course, and name resolved and
similar.
but nothing artificial added, because, e.g. if you do source-to-source
transformations you want the output to be exactly the input except your
transformations.



with an export function like that you could easily write a library which is
able to read the data, change it and write c++ source code again.
it may seem not ideal to parse => export => change => write => parse =>
compile, but testing research extensions like aspect oriented c++ would be a
lot easier.

thanks for your help,





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