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.

32 lines
700 B

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