<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 5, 2011, at 12:47 PM, Stephen Siegel wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>If a pre-procesor object-like macro is used to define a literal value, such as in the example below (#define STEVE 345), is there any way to retrieve the name ("STEVE") from the AST?  In the example, I have printed the AST, and the right-hand side of the assignment statement is represented as:<br><br>              <IntegerLiteral file="f2" line="2" col="15" type="_1F" value="345"/><br><br>The line and column numbers do refer to the line with the #define,  but the name "STEVE" does not seem to be stored anywhere.<br></div></blockquote></div><div><br></div><div>This information can be extracted from Clang's in-memory AST, but it is not part of the XML output. In the in-memory AST, the source location of the integer literal will point into a macro instantiation, which you can map back to the tokens in the source code.</div><br><div>  - Doug</div></body></html>