|
|
|
|
@ -5,6 +5,7 @@
|
|
|
|
|
#include "SourceRange.h" |
|
|
|
|
#include "Cursor.h" |
|
|
|
|
#include <string> |
|
|
|
|
#include <ostream> |
|
|
|
|
|
|
|
|
|
namespace clangmm { |
|
|
|
|
class Token { |
|
|
|
|
@ -28,6 +29,15 @@ namespace clangmm {
|
|
|
|
|
clangmm::Cursor get_cursor() const {return clangmm::Cursor(cx_cursor);} |
|
|
|
|
|
|
|
|
|
bool is_identifier() const; |
|
|
|
|
|
|
|
|
|
friend std::ostream &operator<<(std::ostream &os, const Token &token) { |
|
|
|
|
auto offsets=token.get_source_range().get_offsets(); |
|
|
|
|
os << token.get_source_location().get_path() << ":" |
|
|
|
|
<< offsets.first.line << ":" << offsets.first.index << "-" |
|
|
|
|
<< offsets.second.line << ":" << offsets.second.index << " " |
|
|
|
|
<< token.get_spelling(); |
|
|
|
|
return os; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
CXTranslationUnit &cx_tu; |
|
|
|
|
CXToken& cx_token; |
|
|
|
|
|