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.

25 lines
697 B

11 years ago
#ifndef TOKENS_H_
#define TOKENS_H_
#include <clang-c/Index.h>
11 years ago
#include "SourceRange.h"
#include "Token.h"
#include <unordered_map>
#include <vector>
11 years ago
namespace clangmm {
class Tokens : public std::vector<clangmm::Token> {
11 years ago
friend class TranslationUnit;
friend class Diagnostic;
11 years ago
Tokens(CXTranslationUnit &cx_tu, const SourceRange &range);
11 years ago
public:
11 years ago
~Tokens();
std::vector<std::pair<clangmm::Offset, clangmm::Offset> > get_similar_token_offsets(const std::string &spelling, const std::string &usr);
11 years ago
private:
CXToken *cx_tokens;
unsigned num_tokens;
std::vector<CXCursor> cx_cursors;
CXTranslationUnit& cx_tu;
11 years ago
};
} // namespace clangmm
11 years ago
#endif // TOKENS_H_