clang: lib/Format/TokenAnalyzer.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16#ifndef LLVM_CLANG_LIB_FORMAT_TOKENANALYZER_H
17#define LLVM_CLANG_LIB_FORMAT_TOKENANALYZER_H
18
22
24namespace format {
25
27public:
28
29
30
31
32
33 Environment(StringRef Code, StringRef FileName, unsigned FirstStartColumn = 0,
34 unsigned NextStartColumn = 0, unsigned LastStartColumn = 0);
35
37
39
41
42
43
45
46
47
49
50
51
53
54
55
56 static std::unique_ptr make(StringRef Code, StringRef FileName,
58 unsigned FirstStartColumn = 0,
59 unsigned NextStartColumn = 0,
60 unsigned LastStartColumn = 0);
61
62private:
63
64 std::unique_ptr VirtualSM;
65
66
67
70
72 unsigned FirstStartColumn;
73 unsigned NextStartColumn;
74 unsigned LastStartColumn;
75};
76
78public:
80
81 std::pair<tooling::Replacements, unsigned>
82 process(bool SkipAnnotation = false);
83
84protected:
85 virtual std::pair<tooling::Replacements, unsigned>
89
91
93
96
98
102};
103
104}
105}
106
107#endif
AffectedRangeManager class manages affected ranges in the code.
This file contains FormatTokenLexer, which tokenizes a source file into a token stream suitable for C...
This file implements a token annotator, i.e.
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
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.
SourceManager & getSourceManager() const
unsigned getNextStartColumn() const
ArrayRef< CharSourceRange > getCharRanges() const
unsigned getLastStartColumn() const
static std::unique_ptr< Environment > make(StringRef Code, StringRef FileName, ArrayRef< tooling::Range > Ranges, unsigned FirstStartColumn=0, unsigned NextStartColumn=0, unsigned LastStartColumn=0)
unsigned getFirstStartColumn() const
encoding::Encoding Encoding
virtual std::pair< tooling::Replacements, unsigned > analyze(TokenAnnotator &Annotator, SmallVectorImpl< AnnotatedLine * > &AnnotatedLines, FormatTokenLexer &Tokens)=0
AffectedRangeManager AffectedRangeMgr
SmallVector< SmallVector< UnwrappedLine, 16 >, 2 > UnwrappedLines
std::pair< tooling::Replacements, unsigned > process(bool SkipAnnotation=false)
void consumeUnwrappedLine(const UnwrappedLine &TheLine) override
void finishRun() override
Determines extra information about the tokens comprising an UnwrappedLine.
Interface for users of the UnwrappedLineParser to receive the parsed lines.
The JSON file list parser is used to communicate input to InstallAPI.
The FormatStyle is used to configure the formatting to follow specific guidelines.
An unwrapped line is a sequence of Token, that we would like to put on a single line if there was no ...