Generating Python bindings with the Clang API


I'm working together with another KDE contributor on automated python
binding generation by using to parse the headers.

Generating Python Bindings with Clang | Steveire's Blog

I've encountered a limitation of the API while attempting to parse
default values of method parameters. Because I am focusing on Qt libraries,
it is necessary to be able to parse

Type match(..., Qt::MatchFlags flags =

as found in QAbstractItemModel subclasses, and

void foo(QString const& input = QStringLiteral("Foo"));

where the QStringLiteral expands to a lambda which gets called like:

#define STRINGLITERAL(STR) (() -> String { return String("" STR ""); }())

The attached patch to the and the sample header file,
executed with

python2 testfile.h

shows that the expression for the flags is omitted entirely, and I have no
idea where to start with the STRINGLITERAL example.

Can anyone help with this?



patch (1.95 KB)

testfile.h (555 Bytes)