[cfe-dev] Python bindings questions

Joxean Koret joxeankoret at yahoo.es
Tue Dec 27 04:45:40 PST 2011


Hi all,

I'm writing a simple tool that generates one XML file based on the AST
given by the clang Python bindings. The problem is that I don't know how
to get the operator used, the constant values, etc... I mean, given this
simple C code:

void foo(void)
{
  int i = 29;
}

I first get a VAR_DECL cursor object with displayname "i" and, then, I
get an INTEGER_LITERAL cursor object but I don't know how to get the
value "29". The same goes for BINARY_OPERATOR, etc...

So, my question is: how do I get this information with the python
bindings? Sorry if it's a dumb question!

Thanks in advance!
Joxean Koret

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20111227/dc8b193a/attachment.sig>


More information about the cfe-dev mailing list