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

Ben Gertzfield bgertzfield at gmail.com
Thu Dec 20 14:06:55 PST 2012


Exposes Dmitri's new comment AST introspection APIs (
http://clang.llvm.org/doxygen/group__CINDEX__COMMENT.html ) via the
existing Python bindings.

Unit tests included.

Open questions:

1) For the comment AST methods, they're currently all in one
(way-too-large) Comment class.

Should I split these into multiple Python classes, or leave them in a flat
hierarchy to match the libclang API?

Splitting it up may make it easier to read the API, but makes it more
fragile when the AST logic changes (and it probably will change over time).

Keeping it in one class makes it simpler to handle AST logic changes in the
future, but the class is pretty bloated, and has a number of is_foo_type()
methods.

2) For the methods that return HTML and XML, should they just return
strings, or should I make the API return parser objects? (It seems like
introducing a dependency on those modules is probably not the best idea,
but I'm not sure what the state of the art is in HTML and XML in Python.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121220/529e36d6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-py-comments-v1.patch
Type: application/octet-stream
Size: 32713 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121220/529e36d6/attachment.obj>


More information about the cfe-commits mailing list