1. if (kindType.kind != CXType_Invalid)
  2. {
  3. CXSourceRange range = clang_getCursorExtent(cursor);
  4. CXToken *tokens = 0;
  5. unsigned int nTokens = 0;
  6. clang_tokenize(TU, range, &tokens, &nTokens);
  7. for (unsigned int i = 0; i < nTokens; i++)
  8. {
  9. CXString spelling = clang_getTokenSpelling(TU, tokens[i]);
  10. printf("token = %s\n", clang_getCString(spelling));
  11. clang_disposeString(spelling);
  12. }
  13. clang_disposeTokens(TU, tokens, nTokens);
  14. }
Comments powered by Disqus