[cfe-dev] from source location to token?

Paolo Bolzoni bolzoni at cs.unipr.it
Mon Nov 24 02:38:08 PST 2008


dear cfe list,
I am implementing an AST visitor, and I seldom need to know the exact token
that generated the AST vertex.

I can get the source location using the virtual function getSourceRange(),
the clang::SourceLocation can be used with the SourceManager, but I can't
find a natural way to get the clang::Token or the IdentifierInfo.

Or I must use const char* clang::SourceManager::getCharacterData() and parse
again?

Thanks for help.
pb



More information about the cfe-dev mailing list