I assume that when you say pre-defined
constant, you mean a macro. The parser resolves macros before adding the
information to the AST. I’ve never tried this, but my guess is that you
should be able to find the macro by getting the node location of the literal.
It should somehow point to the macro definition for which you can get the name
of the macro as you expected.
From:
cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Yuan Zhang
Sent: Thursday, July 06, 2006 3:02
PM
To: cdt-dev@xxxxxxxxxxx
Subject: [cdt-dev] A question
about IASTLiteralExpression
I am using CDT to
implement a static analysis tool. I have a question about the class
IASTLiteralExpression. For example, if I have a MPI function call
MPI_Barrier(MPI_COMM_WORLD), the parameter MPI_COMM_WORLD is a pre-defined
constant, and finally it is a IASTLiteralExpression. However, the
"value" of this parameter is an address 0x(something), not the string
MPI_COMM_WORLD as I expected. Does anybody know how to get the original string?