I’m not sure if this is the right forum to ask this question, if not then please point me out to the right place.
I’m running clang with -ast-dump option
clang -Xclang -ast-dump
And I’m getting a long output, but below is the part I’m asking about.
__| | |
-ImplicitCastExpr 0x331e008 <col:1> 'char *' <ArrayToPointerDecay>__ **| | | -StringLiteral 0x331de80 col:1 ‘char ’ lvalue “ab.c”**
| | |-ImplicitCastExpr 0x331e038 line:107:1 ‘WmkU32’:‘unsigned int’
I’d like to extract the StringLiteral “ab.c”, I tried doing so via libclang python bindings but I couldn’t fine a property exposed to do that. Is there a way to do this in Python?
If not, how can I do this in C, a pointer to where this option is implemented in the source will be equally good.
Thanks a lot.