clang 10.0.0git

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
clang::format::TokenAnalyzer Class Referenceabstract

`#include "/work/www-prereleases/10.0.0/rc1/docsbuild/clang/lib/Format/TokenAnalyzer.h"`

Inheritance diagram for clang::format::TokenAnalyzer:
[legend]
Collaboration diagram for clang::format::TokenAnalyzer:
[legend]

## Public Member Functions
| TokenAnalyzer (const Environment &Env, const FormatStyle &Style)
std::pair< tooling::Replacements, unsigned > | process ()
Public Member Functions inherited from clang::format::UnwrappedLineConsumer
virtual | ~UnwrappedLineConsumer ()

## Protected Member Functions
virtual std::pair< tooling::Replacements, unsigned > | analyze (TokenAnnotator &Annotator, SmallVectorImpl< AnnotatedLine *> &AnnotatedLines, FormatTokenLexer &Tokens)=0
void | consumeUnwrappedLine (const UnwrappedLine &TheLine) override
void | finishRun () override

## Protected Attributes
FormatStyle | Style
const Environment & | Env
AffectedRangeManager | AffectedRangeMgr
SmallVector< SmallVector< UnwrappedLine, 16 >, 2 > | UnwrappedLines
encoding::Encoding | Encoding

## Detailed Description

Definition at line 80 of file TokenAnalyzer.h.

## Constructor & Destructor Documentation

## ◆ TokenAnalyzer()

clang::format::TokenAnalyzer::TokenAnalyzer | ( | const Environment & | Env,
|  | const FormatStyle & | Style
| ) |  |

Definition at line 51 of file TokenAnalyzer.cpp.

References Encoding, clang::format::encoding::Encoding_UTF8, and clang::format::getLanguageName().

## Member Function Documentation

## ◆ analyze()

virtual std::pair<tooling::Replacements, unsigned> clang::format::TokenAnalyzer::analyze | ( | TokenAnnotator & | Annotator,
|  | SmallVectorImpl< AnnotatedLine *> & | AnnotatedLines,
|  | FormatTokenLexer & | Tokens
| ) |  |
| protected pure virtual

Implemented in clang::format::JavaScriptImportSorter, clang::format::NamespaceEndCommentsFixer, and clang::format::UsingDeclarationsSorter.

## ◆ consumeUnwrappedLine()

void clang::format::TokenAnalyzer::consumeUnwrappedLine | ( | const UnwrappedLine & | TheLine | ) |
| override protected virtual

Implements clang::format::UnwrappedLineConsumer.

Definition at line 114 of file TokenAnalyzer.cpp.

References UnwrappedLines.

## ◆ finishRun()

void clang::format::TokenAnalyzer::finishRun | ( |  | ) |
| override protected virtual

Implements clang::format::UnwrappedLineConsumer.

Definition at line 119 of file TokenAnalyzer.cpp.

References UnwrappedLines.

## ◆ process()

std::pair< tooling::Replacements, unsigned > clang::format::TokenAnalyzer::process | ( |  | ) |

Definition at line 65 of file TokenAnalyzer.cpp.

Referenced by clang::format::fixNamespaceEndComments(), clang::format::sortJavaScriptImports(), and clang::format::sortUsingDeclarations().

## Member Data Documentation

## ◆ AffectedRangeMgr

AffectedRangeManager clang::format::TokenAnalyzer::AffectedRangeMgr
| protected

Definition at line 100 of file TokenAnalyzer.h.

## ◆ Encoding

encoding::Encoding clang::format::TokenAnalyzer::Encoding
| protected

Definition at line 102 of file TokenAnalyzer.h.

Referenced by TokenAnalyzer().

## ◆ Env

const Environment& clang::format::TokenAnalyzer::Env
| protected

Definition at line 98 of file TokenAnalyzer.h.

## ◆ Style

FormatStyle clang::format::TokenAnalyzer::Style
| protected

Definition at line 96 of file TokenAnalyzer.h.

## ◆ UnwrappedLines

SmallVector<SmallVector<UnwrappedLine, 16>, 2> clang::format::TokenAnalyzer::UnwrappedLines
| protected

Definition at line 101 of file TokenAnalyzer.h.

Referenced by consumeUnwrappedLine(), and finishRun().

The documentation for this class was generated from the following files:

- lib/Format/TokenAnalyzer.h
- lib/Format/TokenAnalyzer.cpp