|
|
|
@ -17,11 +17,11 @@ namespace clang { |
|
|
|
|
|
|
|
|
|
|
|
class Token { |
|
|
|
class Token { |
|
|
|
public: |
|
|
|
public: |
|
|
|
explicit Token(CXTranslationUnit &cx_tu, CXToken &cx_token, CXCursor &cx_cursor): cx_tu(cx_tu), cx_token(cx_token), cx_cursor(cx_cursor) {}; |
|
|
|
Token(CXTranslationUnit &cx_tu, CXToken &cx_token, CXCursor &cx_cursor):
|
|
|
|
|
|
|
|
cx_tu(cx_tu), cx_token(cx_token), cx_cursor(cx_cursor), source_range(get_source_range()) {}; |
|
|
|
const TokenKind kind(); |
|
|
|
const TokenKind kind(); |
|
|
|
std::string get_token_spelling(); |
|
|
|
std::string get_token_spelling(); |
|
|
|
SourceLocation get_source_location(); |
|
|
|
SourceLocation get_source_location(); |
|
|
|
SourceRange get_source_range(); |
|
|
|
|
|
|
|
clang::Cursor get_cursor() {return clang::Cursor(cx_cursor);} |
|
|
|
clang::Cursor get_cursor() {return clang::Cursor(cx_cursor);} |
|
|
|
bool has_type(); |
|
|
|
bool has_type(); |
|
|
|
std::string get_type(); |
|
|
|
std::string get_type(); |
|
|
|
@ -29,6 +29,9 @@ namespace clang { |
|
|
|
CXTranslationUnit &cx_tu; |
|
|
|
CXTranslationUnit &cx_tu; |
|
|
|
CXToken& cx_token; |
|
|
|
CXToken& cx_token; |
|
|
|
CXCursor& cx_cursor; |
|
|
|
CXCursor& cx_cursor; |
|
|
|
|
|
|
|
SourceRange source_range; |
|
|
|
|
|
|
|
private: |
|
|
|
|
|
|
|
SourceRange get_source_range(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
} // namespace clang
|
|
|
|
} // namespace clang
|
|
|
|
#endif // TOKEN_H_
|
|
|
|
#endif // TOKEN_H_
|
|
|
|
|