clang  16.0.0git
Namespaces | Macros | Functions
TokenAnnotator.cpp File Reference
#include "TokenAnnotator.h"
#include "FormatToken.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TokenKinds.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Support/Debug.h"
#include "clang/Basic/TransformTypeTraits.def"
Include dependency graph for TokenAnnotator.cpp:

Go to the source code of this file.

Namespaces

 clang
 
 clang::format
 

Macros

#define DEBUG_TYPE   "format-token-annotator"
 
#define TRANSFORM_TYPE_TRAIT_DEF(_, Trait)   tok::kw___##Trait,
 

Functions

static unsigned clang::format::maxNestingDepth (const AnnotatedLine &Line)
 
static bool clang::format::isFunctionDeclarationName (bool IsCpp, const FormatToken &Current, const AnnotatedLine &Line)
 
static bool clang::format::isAllmanBrace (const FormatToken &Tok)
 
static bool clang::format::IsFunctionArgument (const FormatToken &Tok)
 
static bool clang::format::isItAnEmptyLambdaAllowed (const FormatToken &Tok, FormatStyle::ShortLambdaStyle ShortLambdaOption)
 
static bool clang::format::isAllmanLambdaBrace (const FormatToken &Tok)
 
static const FormatToken * clang::format::getFirstNonComment (const AnnotatedLine &Line)
 

Detailed Description

This file implements a token annotator, i.e. creates AnnotatedTokens out of FormatTokens with required extra information.

Definition in file TokenAnnotator.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "format-token-annotator"

Definition at line 22 of file TokenAnnotator.cpp.

◆ TRANSFORM_TYPE_TRAIT_DEF

#define TRANSFORM_TYPE_TRAIT_DEF (   _,
  Trait 
)    tok::kw___##Trait,

Variable Documentation

◆ BindingStrength

unsigned BindingStrength

Definition at line 1584 of file TokenAnnotator.cpp.

◆ CanBeExpression

bool CanBeExpression = true

Definition at line 1592 of file TokenAnnotator.cpp.

◆ CaretFound

bool CaretFound = false

Definition at line 1593 of file TokenAnnotator.cpp.

◆ ColonIsDictLiteral

bool ColonIsDictLiteral = false

Definition at line 1588 of file TokenAnnotator.cpp.

◆ ColonIsForRangeExpr

bool ColonIsForRangeExpr = false

Definition at line 1587 of file TokenAnnotator.cpp.

◆ ColonIsObjCMethodExpr

bool ColonIsObjCMethodExpr = false

Definition at line 1589 of file TokenAnnotator.cpp.

◆ ContextKind

tok::TokenKind ContextKind

Definition at line 1583 of file TokenAnnotator.cpp.

Referenced by clang::Sema::getCurrentMangleNumberContext().

◆ ContextType

enum { ... } ContextType

◆ FirstObjCSelectorName

FormatToken* FirstObjCSelectorName = nullptr

Definition at line 1590 of file TokenAnnotator.cpp.

◆ FirstStartOfName

FormatToken* FirstStartOfName = nullptr

Definition at line 1591 of file TokenAnnotator.cpp.

◆ InCpp11AttributeSpecifier

bool InCpp11AttributeSpecifier = false

Definition at line 1594 of file TokenAnnotator.cpp.

◆ InCSharpAttributeSpecifier

bool InCSharpAttributeSpecifier = false

Definition at line 1595 of file TokenAnnotator.cpp.

◆ IsExpression

bool IsExpression

Definition at line 1585 of file TokenAnnotator.cpp.

◆ LongestObjCSelectorName

unsigned LongestObjCSelectorName = 0

Definition at line 1586 of file TokenAnnotator.cpp.

◆ P

AnnotatingParser& P

Definition at line 1617 of file TokenAnnotator.cpp.