[cfe-users] Can I use clang to convert C/C++ code to a list of tokens?

Ryan Cole ryan at rycole.com
Mon Mar 31 20:32:46 PDT 2014


Hi all,

I'm wanting to take some C/C++ code and convert it to a list of tokens.
Tokens that a compiler would use. I'm interested in the literal name of the
token, specifically. If I could get something that'd return to me something
along the lines of "this code you provided to me contains the following in
this order: variable, plus operator, minus operator, if statement start, if
statement end" etc. That is what I'm looking for.

Is this something that I can use clang to help me with?

Thanks,
Ryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20140401/0a00d423/attachment.html>


More information about the cfe-users mailing list