clang-tools 10.0.0

Functions
clang::tidy::utils::lexer Namespace Reference

## Functions
Token | getPreviousToken (SourceLocation Location, const SourceManager &SM, const LangOptions &LangOpts, bool SkipComments=true)
| Returns previous token or `tok::unknown` if not found. More...
SourceLocation | findPreviousTokenStart (SourceLocation Start, const SourceManager &SM, const LangOptions &LangOpts)
SourceLocation | findPreviousTokenKind (SourceLocation Start, const SourceManager &SM, const LangOptions &LangOpts, tok::TokenKind TK)
SourceLocation | findNextTerminator (SourceLocation Start, const SourceManager &SM, const LangOptions &LangOpts)
Optional< Token > | findNextTokenSkippingComments (SourceLocation Start, const SourceManager &SM, const LangOptions &LangOpts)
bool | rangeContainsExpansionsOrDirectives (SourceRange Range, const SourceManager &SM, const LangOptions &LangOpts)
| Re-lex the provide `Range` and return `false` if either a macro spans multiple tokens, a pre-processor directive or failure to retrieve the next token is found, otherwise `true`. More...
llvm::Optional< Token > | getQualifyingToken (tok::TokenKind TK, CharSourceRange Range, const ASTContext &Context, const SourceManager &SM)
| Assuming that `Range` spans a CVR-qualified type, returns the token in `Range` that is responsible for the qualification. More...
template<typename TokenKind , typename... TokenKinds>
SourceLocation | findPreviousAnyTokenKind (SourceLocation Start, const SourceManager &SM, const LangOptions &LangOpts, TokenKind TK, TokenKinds... TKs)
template<typename TokenKind , typename... TokenKinds>
SourceLocation | findNextAnyTokenKind (SourceLocation Start, const SourceManager &SM, const LangOptions &LangOpts, TokenKind TK, TokenKinds... TKs)

## Function Documentation

## ◆ findNextAnyTokenKind()

template<typename TokenKind , typename... TokenKinds>

SourceLocation clang::tidy::utils::lexer::findNextAnyTokenKind | ( | SourceLocation | Start,
|  | const SourceManager & | SM,
|  | const LangOptions & | LangOpts,
|  | TokenKind | TK,
|  | TokenKinds... | TKs
| ) |  |

Definition at line 62 of file LexerUtils.h.

## ◆ findNextTerminator()

SourceLocation clang::tidy::utils::lexer::findNextTerminator | ( | SourceLocation | Start,
|  | const SourceManager & | SM,
|  | const LangOptions & | LangOpts
| ) |  |

Definition at line 73 of file LexerUtils.cpp.

## ◆ findNextTokenSkippingComments()

Optional< Token > clang::tidy::utils::lexer::findNextTokenSkippingComments | ( | SourceLocation | Start,
|  | const SourceManager & | SM,
|  | const LangOptions & | LangOpts
| ) |  |

Definition at line 78 of file LexerUtils.cpp.

## ◆ findPreviousAnyTokenKind()

template<typename TokenKind , typename... TokenKinds>

SourceLocation clang::tidy::utils::lexer::findPreviousAnyTokenKind | ( | SourceLocation | Start,
|  | const SourceManager & | SM,
|  | const LangOptions & | LangOpts,
|  | TokenKind | TK,
|  | TokenKinds... | TKs
| ) |  |

Definition at line 38 of file LexerUtils.h.

## ◆ findPreviousTokenKind()

SourceLocation clang::tidy::utils::lexer::findPreviousTokenKind | ( | SourceLocation | Start,
|  | const SourceManager & | SM,
|  | const LangOptions & | LangOpts,
|  | tok::TokenKind | TK
| ) |  |

Definition at line 50 of file LexerUtils.cpp.

## ◆ findPreviousTokenStart()

SourceLocation clang::tidy::utils::lexer::findPreviousTokenStart | ( | SourceLocation | Start,
|  | const SourceManager & | SM,
|  | const LangOptions & | LangOpts
| ) |  |

Definition at line 37 of file LexerUtils.cpp.

## ◆ getPreviousToken()

Token clang::tidy::utils::lexer::getPreviousToken | ( | SourceLocation | Location,
|  | const SourceManager & | SM,
|  | const LangOptions & | LangOpts,
|  | bool | SkipComments
| ) |  |

Returns previous token or `tok::unknown` if not found.

Definition at line 16 of file LexerUtils.cpp.

## ◆ getQualifyingToken()

llvm::Optional< Token > clang::tidy::utils::lexer::getQualifyingToken | ( | tok::TokenKind | TK,
|  | CharSourceRange | Range,
|  | const ASTContext & | Context,
|  | const SourceManager & | SM
| ) |  |

Assuming that `Range` spans a CVR-qualified type, returns the token in `Range` that is responsible for the qualification.

`Range` must be valid with respect to `SM`. Returns `None` if no qualifying tokens are found.

Note
  : doesn't support member function qualifiers.

Definition at line 112 of file LexerUtils.cpp.

## ◆ rangeContainsExpansionsOrDirectives()

bool clang::tidy::utils::lexer::rangeContainsExpansionsOrDirectives | ( | SourceRange | Range,
|  | const SourceManager & | SM,
|  | const LangOptions & | LangOpts
| ) |  |

Re-lex the provide `Range` and return `false` if either a macro spans multiple tokens, a pre-processor directive or failure to retrieve the next token is found, otherwise `true`.

Definition at line 88 of file LexerUtils.cpp.