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.
 
 

31 lines
707 B

#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;
private:
explicit Token(const CXToken &token);
friend SourceRange;
friend SourceLocation;
friend Tokens;
const CXToken& token_;
};
} // namespace clang
#endif // TOKEN_H_