[cfe-commits] [PATCH] Add Python bindings to comment AST introspection APIs

Ben Gertzfield bgertzfield at gmail.com
Fri Dec 21 09:43:12 PST 2012


On Thu, Dec 20, 2012 at 10:28 PM, Dmitri Gribenko <gribozavr at gmail.com>wrote:

So certainly, workarounds are possible, and we can somehow maintain
> the old API *and* keep binary compatibility.  But is it worth it?  It
> depends on how useful it is.


The XML "API" is flexible because of its simplicity: it returns a string
containing a serialized tree of nodes, each of which has:

1) A name (== type)
2) Zero or more key-value parameter pairs
3) Zero or more children (which can be either nodes or text)

Perhaps we can simplify the C AST API to return an iterator over such a
tree? Then it's infinitely flexible, just like the XML "API". We can add
types, remove types, add parameters, remove parameters, etc. at any time,
maintaining binary compatibility.

Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121221/8bae3568/attachment.html>


More information about the cfe-commits mailing list