clang: include/clang/Tooling/Syntax/TokenBufferTokenManager.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9#ifndef LLVM_CLANG_TOOLING_SYNTAX_TOKEN_BUFFER_TOKEN_MANAGER_H

10#define LLVM_CLANG_TOOLING_SYNTAX_TOKEN_BUFFER_TOKEN_MANAGER_H

11

14

16namespace syntax {

17

18

19

21public:

24 : Tokens(Tokens), LangOpts(LangOpts), SM(SourceMgr) {}

25

27 llvm::StringLiteral kind() const override { return Kind; }

28

29 llvm::StringRef getText(Key I) const override {

32

33

34

36 return "";

38 }

39

41 return reinterpret_cast<const syntax::Token *>(I);

42 }

46

47private:

48

49 static constexpr llvm::StringLiteral Kind = "TokenBuffer";

50

51

52

53

54 std::pair<FileID, ArrayRef>

55 lexBuffer(std::unique_ptrllvm::MemoryBuffer Buffer);

57

60

61

63

64 llvm::DenseMap<FileID, std::vector> ExtraTokens;

65};

66

67}

68}

69

70#endif

Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...

This class handles loading and caching of source files into memory.

Exposes private syntax tree APIs required to implement node synthesis.

A TokenBuffer-powered token manager.

const syntax::Token * getToken(Key I) const

const TokenBuffer & tokenBuffer() const

static bool classof(const TokenManager *N)

TokenBufferTokenManager(const TokenBuffer &Tokens, const LangOptions &LangOpts, SourceManager &SourceMgr)

llvm::StringLiteral kind() const override

Describes what the exact class kind of the TokenManager is.

llvm::StringRef getText(Key I) const override

SourceManager & sourceManager()

const SourceManager & sourceManager() const

A list of tokens obtained by preprocessing a text buffer and operations to map between the expanded a...

Defines interfaces for operating "Token" in the clang syntax-tree.

uintptr_t Key

A key to identify a specific token.

virtual llvm::StringLiteral kind() const =0

Describes what the exact class kind of the TokenManager is.

A token coming directly from a file or from a macro invocation.

llvm::StringRef text(const SourceManager &SM) const

Get the substring covered by the token.

tok::TokenKind kind() const

The JSON file list parser is used to communicate input to InstallAPI.