class FormatTokenLexer
Declaration
class FormatTokenLexer { /* full declaration omitted */ };
Declared at: clang/lib/Format/FormatTokenLexer.h:39
Member Variables
- private clang::format::FormatToken* FormatTok
- private bool IsFirstToken
- private std::stack<LexerState> StateStack
- private unsigned int Column
- private unsigned int TrailingWhitespace
- private std::unique_ptr<Lexer> Lex
- private clang::LangOptions LangOpts
- private const clang::SourceManager& SourceMgr
- private clang::FileID ID
- private const clang::format::FormatStyle& Style
- private clang::IdentifierTable& IdentTable
- private clang::format::AdditionalKeywords Keywords
- private encoding::Encoding Encoding
- private llvm::SpecificBumpPtrAllocator<FormatToken>& Allocator
- private unsigned int FirstInLineIndex
- private SmallVector<clang::format::FormatToken*, 16> Tokens
- private llvm:: SmallMapVector<IdentifierInfo*, TokenType, 8> Macros
- private bool FormattingDisabled
- private llvm::Regex MacroBlockBeginRegex
- private llvm::Regex MacroBlockEndRegex
- private static const llvm::StringSet<> CSharpAttributeTargets
Method Overview
- public FormatTokenLexer(const clang::SourceManager & SourceMgr, clang::FileID ID, unsigned int Column, const clang::format::FormatStyle & Style, encoding::Encoding Encoding, llvm::SpecificBumpPtrAllocator<FormatToken> & Allocator, clang::IdentifierTable & IdentTable)
- private bool canPrecedeRegexLiteral(clang::format::FormatToken * Prev)
- public const clang::format::AdditionalKeywords & getKeywords()
- private clang::format::FormatToken * getNextToken()
- private clang::format::FormatToken * getStashedToken()
- private void handleCSharpVerbatimAndInterpolatedStrings()
- private void handleTemplateStrings()
- public ArrayRef<clang::format::FormatToken *> lex()
- private bool precedesOperand(clang::format::FormatToken * Tok)
- private void readRawToken(clang::format::FormatToken & Tok)
- private bool readRawTokenVerilogSpecific(clang::Token & Tok)
- private void resetLexer(unsigned int Offset)
- private void truncateToken(size_t NewLen)
- private bool tryMergeCSharpKeywordVariables()
- private bool tryMergeCSharpStringLiteral()
- private bool tryMergeConflictMarkers()
- private bool tryMergeForEach()
- private bool tryMergeJSPrivateIdentifier()
- private bool tryMergeLessLess()
- private bool tryMergeNSStringLiteral()
- private bool tryMergeNullishCoalescingEqual()
- private void tryMergePreviousTokens()
- private bool tryMergeTokens(ArrayRef<tok::TokenKind> Kinds, clang::format::TokenType NewType)
- private bool tryMerge_TMacro()
- private void tryParseJSRegexLiteral()
- private void tryParsePythonComment()
- private bool tryTransformCSharpForEach()
- private bool tryTransformTryUsageForC()
Methods
¶FormatTokenLexer(
const clang::SourceManager& SourceMgr,
clang::FileID ID,
unsigned int Column,
const clang::format::FormatStyle& Style,
encoding::Encoding Encoding,
llvm::SpecificBumpPtrAllocator<FormatToken>&
Allocator,
clang::IdentifierTable& IdentTable)
FormatTokenLexer(
const clang::SourceManager& SourceMgr,
clang::FileID ID,
unsigned int Column,
const clang::format::FormatStyle& Style,
encoding::Encoding Encoding,
llvm::SpecificBumpPtrAllocator<FormatToken>&
Allocator,
clang::IdentifierTable& IdentTable)
Declared at: clang/lib/Format/FormatTokenLexer.h:41
Parameters
- const clang::SourceManager& SourceMgr
- clang::FileID ID
- unsigned int Column
- const clang::format::FormatStyle& Style
- encoding::Encoding Encoding
- llvm::SpecificBumpPtrAllocator<FormatToken>& Allocator
- clang::IdentifierTable& IdentTable
¶bool canPrecedeRegexLiteral(
clang::format::FormatToken* Prev)
bool canPrecedeRegexLiteral(
clang::format::FormatToken* Prev)
Declared at: clang/lib/Format/FormatTokenLexer.h:68
Parameters
¶const clang::format::AdditionalKeywords&
getKeywords()
const clang::format::AdditionalKeywords&
getKeywords()
Declared at: clang/lib/Format/FormatTokenLexer.h:48
¶clang::format::FormatToken* getNextToken()
clang::format::FormatToken* getNextToken()
Declared at: clang/lib/Format/FormatTokenLexer.h:99
¶clang::format::FormatToken* getStashedToken()
clang::format::FormatToken* getStashedToken()
Declared at: clang/lib/Format/FormatTokenLexer.h:97
¶void handleCSharpVerbatimAndInterpolatedStrings()
void handleCSharpVerbatimAndInterpolatedStrings()
Declared at: clang/lib/Format/FormatTokenLexer.h:87
¶void handleTemplateStrings()
void handleTemplateStrings()
Declared at: clang/lib/Format/FormatTokenLexer.h:85
¶ArrayRef<clang::format::FormatToken*> lex()
ArrayRef<clang::format::FormatToken*> lex()
Declared at: clang/lib/Format/FormatTokenLexer.h:46
¶bool precedesOperand(
clang::format::FormatToken* Tok)
bool precedesOperand(
clang::format::FormatToken* Tok)
Declared at: clang/lib/Format/FormatTokenLexer.h:66
Parameters
¶void readRawToken(clang::format::FormatToken& Tok)
void readRawToken(clang::format::FormatToken& Tok)
Declared at: clang/lib/Format/FormatTokenLexer.h:132
Parameters
¶bool readRawTokenVerilogSpecific(
clang::Token& Tok)
bool readRawTokenVerilogSpecific(
clang::Token& Tok)
Description
Handle Verilog-specific tokens.
Declared at: clang/lib/Format/FormatTokenLexer.h:130
Parameters
- clang::Token& Tok
¶void resetLexer(unsigned int Offset)
void resetLexer(unsigned int Offset)
Declared at: clang/lib/Format/FormatTokenLexer.h:134
Parameters
- unsigned int Offset
¶void truncateToken(size_t NewLen)
void truncateToken(size_t NewLen)
Declared at: clang/lib/Format/FormatTokenLexer.h:95
Parameters
- size_t NewLen
¶bool tryMergeCSharpKeywordVariables()
bool tryMergeCSharpKeywordVariables()
Declared at: clang/lib/Format/FormatTokenLexer.h:57
¶bool tryMergeCSharpStringLiteral()
bool tryMergeCSharpStringLiteral()
Declared at: clang/lib/Format/FormatTokenLexer.h:56
¶bool tryMergeConflictMarkers()
bool tryMergeConflictMarkers()
Declared at: clang/lib/Format/FormatTokenLexer.h:93
¶bool tryMergeForEach()
bool tryMergeForEach()
Declared at: clang/lib/Format/FormatTokenLexer.h:60
¶bool tryMergeJSPrivateIdentifier()
bool tryMergeJSPrivateIdentifier()
Declared at: clang/lib/Format/FormatTokenLexer.h:55
¶bool tryMergeLessLess()
bool tryMergeLessLess()
Declared at: clang/lib/Format/FormatTokenLexer.h:53
¶bool tryMergeNSStringLiteral()
bool tryMergeNSStringLiteral()
Declared at: clang/lib/Format/FormatTokenLexer.h:54
¶bool tryMergeNullishCoalescingEqual()
bool tryMergeNullishCoalescingEqual()
Declared at: clang/lib/Format/FormatTokenLexer.h:58
¶void tryMergePreviousTokens()
void tryMergePreviousTokens()
Declared at: clang/lib/Format/FormatTokenLexer.h:51
¶bool tryMergeTokens(
ArrayRef<tok::TokenKind> Kinds,
clang::format::TokenType NewType)
bool tryMergeTokens(
ArrayRef<tok::TokenKind> Kinds,
clang::format::TokenType NewType)
Declared at: clang/lib/Format/FormatTokenLexer.h:63
Parameters
- ArrayRef<tok::TokenKind> Kinds
- clang::format::TokenType NewType
¶bool tryMerge_TMacro()
bool tryMerge_TMacro()
Declared at: clang/lib/Format/FormatTokenLexer.h:91
¶void tryParseJSRegexLiteral()
void tryParseJSRegexLiteral()
Declared at: clang/lib/Format/FormatTokenLexer.h:74
¶void tryParsePythonComment()
void tryParsePythonComment()
Declared at: clang/lib/Format/FormatTokenLexer.h:89
¶bool tryTransformCSharpForEach()
bool tryTransformCSharpForEach()
Declared at: clang/lib/Format/FormatTokenLexer.h:59
¶bool tryTransformTryUsageForC()
bool tryTransformTryUsageForC()
Declared at: clang/lib/Format/FormatTokenLexer.h:61