clang: clang::format::TokenAnnotator Class Reference (original) (raw)

Determines extra information about the tokens comprising an [UnwrappedLine](structclang%5F1%5F1format%5F1%5F1UnwrappedLine.html "An unwrapped line is a sequence of Token, that we would like to put on a single line if there was no ..."). More...

#include "[/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/Format/TokenAnnotator.h](TokenAnnotator%5F8h%5Fsource.html)"

Public Member Functions
TokenAnnotator (const FormatStyle &Style, const AdditionalKeywords &Keywords)
void setCommentLineLevels (SmallVectorImpl< AnnotatedLine * > &Lines) const
Adapts the indent levels of comment lines to the indent of the subsequent line.
void annotate (AnnotatedLine &Line)
void calculateFormattingInformation (AnnotatedLine &Line) const

Detailed Description

Constructor & Destructor Documentation

Member Function Documentation

annotate()

void clang::format::TokenAnnotator::annotate ( AnnotatedLine & Line )

Definition at line 3692 of file TokenAnnotator.cpp.

References annotate(), clang::First, clang::format::getFunctionName(), clang::format::isCtorOrDtorName(), clang::Line, clang::format::LT_Invalid, clang::format::LT_ObjCDecl, clang::format::LT_ObjCMethodDecl, clang::format::LT_ObjCProperty, clang::format::LT_RequiresExpression, clang::format::LT_SimpleRequirement, clang::format::maxNestingDepth(), clang::format::FormatToken::setFinalizedType(), clang::format::ST_Class, and clang::format::ST_Other.

Referenced by annotate(), and clang::format::TokenAnalyzer::process().

calculateFormattingInformation()

void clang::format::TokenAnnotator::calculateFormattingInformation ( AnnotatedLine & Line ) const

Definition at line 3934 of file TokenAnnotator.cpp.

References clang::format::FormatStyle::AIAS_None, clang::format::BK_Block, clang::format::BK_BracedInit, calculateFormattingInformation(), clang::format::FormatToken::Children, clang::First, clang::format::FormatToken::is(), clang::format::isFunctionDeclarationName(), clang::format::FormatToken::isTrailingComment(), clang::Line, clang::format::FormatStyle::LK_ObjC, clang::format::LT_ArrayOfStructInitializer, clang::format::FormatToken::MatchingParen, clang::format::mustBreakAfterAttributes(), clang::format::FormatToken::MustBreakBefore, clang::format::FormatToken::Next, clang::format::FormatToken::opensScope(), clang::Parameter, clang::format::FormatToken::setFinalizedType(), and clang::format::FormatToken::TotalLength.

Referenced by calculateFormattingInformation().

setCommentLineLevels()

Adapts the indent levels of comment lines to the indent of the subsequent line.

Definition at line 3577 of file TokenAnnotator.cpp.

References clang::format::AnnotatedLine::First, clang::format::isClangFormatOff(), clang::format::AnnotatedLine::Level, clang::Line, clang::format::LT_CommentAbovePPDirective, clang::format::LT_ImportStatement, clang::format::LT_PreprocessorDirective, clang::format::FormatToken::NewlinesBefore, clang::format::FormatToken::OriginalColumn, clang::format::FormatStyle::PPDIS_BeforeHash, setCommentLineLevels(), and clang::format::AnnotatedLine::Type.

Referenced by setCommentLineLevels().


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