[cfe-dev] [patch] improved ast-print-xml for C++
Olaf Krzikalla
Olaf.Krzikalla at tu-dresden.de
Tue May 11 01:57:27 PDT 2010
Hi,
Douglas Gregor schrieb:
> I have a secret agenda w.r.t. XML output as well, but it's very different: I want it to either become a clean representation of C++ ASTs in XML, or I want it removed from Clang. That's a strong statement, but here's what I think Clang's XML output should be:
>
> - Complete, covering all of C/C++/Objective-C: We can achieve this incrementally.
>
Thats what I've thought a year ago. Apparently it isn't that easy, esp.
since the C++ development has overrun me.
> - Documented with Schema: we need to describe what the XML format is, and be able to validate it
>
That's what the *XML.def files are all about. You've (correctly)
insisted that I introduced them and IIRC I did it in a way that they are
easy convertible.
> - C++, not Clang: The XML format should describe C++, not Clang's ASTs. Clang's ASTs are not stable and aren't necessarily the best way to describe a C++ program. XML formats are supposed to be for interchange, so they have to be stable, and ideally could be generated by another front end as well.
>
Hmm, but this point is really just a new project. Which is the best way
to describe a C++ program? Is it the plain source code? Or is it the
AST? Or something completely different? And why is that "something " not
used elsewhere? Well, I still think, that XML-dumping the AST is not the
worst way, even if you have to adjust it constantly.
Best regards
Olaf Krzikalla
More information about the cfe-dev
mailing list