You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
683 B

11 years ago
#ifndef TOKEN_H_
#define TOKEN_H_
#include <clang-c/Index.h>
11 years ago
#include "SourceLocation.h"
#include "SourceRange.h"
#include <string>
11 years ago
namespace clang {
class SourceLocation;
class SourceRange;
11 years ago
enum TokenKind {
Token_Punctuation,
Token_Keyword,
Token_Identifier,
Token_Literal,
Token_Comment
};
class Token {
public:
explicit Token(CXTranslationUnit &tu, const CXToken &token);
11 years ago
const TokenKind kind();
std::string get_token_spelling();
SourceLocation get_source_location();
SourceRange get_source_range();
std::string type;
11 years ago
const CXToken& token_;
CXTranslationUnit &tu;
11 years ago
};
} // namespace clang
#endif // TOKEN_H_