class UnwrappedLineParser

Declaration

class UnwrappedLineParser { /* full declaration omitted */ };

Declared at: clang/lib/Format/UnwrappedLineParser.h:76

Member Variables

private std::unique_ptr<UnwrappedLine> Line
private SmallVector<clang::format::FormatToken*, 1> CommentsBeforeNextToken
private clang::format::FormatToken* FormatTok
private bool MustBreakBeforeNextToken
private SmallVector<clang::format::UnwrappedLine, 8> Lines
private SmallVector<clang::format::UnwrappedLine, 4> PreprocessorDirectives
private SmallVectorImpl<clang::format::UnwrappedLine>* CurrentLines
private llvm::BitVector DeclarationScopeStack
private const clang::format::FormatStyle& Style
private const clang::format::AdditionalKeywords& Keywords
private llvm::Regex CommentPragmasRegex
private clang::format::FormatTokenSource* Tokens
private clang::format::UnwrappedLineConsumer& Callback
private ArrayRef<clang::format::FormatToken*> AllTokens
private SmallVector<bool, 8> NestedTooDeep
private SmallVector< clang::format::UnwrappedLineParser::PPBranch, 16> PPStack
private int PPBranchLevel
private SmallVector<int, 8> PPLevelBranchIndex
private SmallVector<int, 8> PPLevelBranchCount
private std::stack<int> PPChainBranchIndex
private clang::format::UnwrappedLineParser:: IncludeGuardState IncludeGuard
private clang::format::FormatToken* IncludeGuardToken
private unsigned int FirstStartColumn

Method Overview

Methods

UnwrappedLineParser(
    const clang::format::FormatStyle& Style,
    const clang::format::AdditionalKeywords&
        Keywords,
    unsigned int FirstStartColumn,
    ArrayRef<clang::format::FormatToken*> Tokens,
    clang::format::UnwrappedLineConsumer&
        Callback)

Declared at: clang/lib/Format/UnwrappedLineParser.h:78

Parameters

const clang::format::FormatStyle& Style
const clang::format::AdditionalKeywords& Keywords
unsigned int FirstStartColumn
ArrayRef<clang::format::FormatToken*> Tokens
clang::format::UnwrappedLineConsumer& Callback

void addUnwrappedLine(
    clang::format::UnwrappedLineParser::LineLevel
        AdjustLevel = LineLevel::Remove)

Declared at: clang/lib/Format/UnwrappedLineParser.h:182

Parameters

clang::format::UnwrappedLineParser::LineLevel AdjustLevel = LineLevel::Remove

void calculateBraceTypes(
    bool ExpectClassBody = false)

Declared at: clang/lib/Format/UnwrappedLineParser.h:207

Parameters

bool ExpectClassBody = false

size_t computePPHash() const

Declared at: clang/lib/Format/UnwrappedLineParser.h:223

void conditionalCompilationAlternative()

Declared at: clang/lib/Format/UnwrappedLineParser.h:215

void conditionalCompilationCondition(
    bool Unreachable)

Declared at: clang/lib/Format/UnwrappedLineParser.h:213

Parameters

bool Unreachable

void conditionalCompilationEnd()

Declared at: clang/lib/Format/UnwrappedLineParser.h:216

void conditionalCompilationStart(bool Unreachable)

Declared at: clang/lib/Format/UnwrappedLineParser.h:214

Parameters

bool Unreachable

void distributeComments(
    const SmallVectorImpl<
        clang::format::FormatToken*>& Comments,
    const clang::format::FormatToken* NextTok)

Declared at: clang/lib/Format/UnwrappedLineParser.h:201

Parameters

const SmallVectorImpl< clang::format::FormatToken*>& Comments
const clang::format::FormatToken* NextTok

bool eof() const

Declared at: clang/lib/Format/UnwrappedLineParser.h:183

void flushComments(bool NewlineBeforeNext)

Declared at: clang/lib/Format/UnwrappedLineParser.h:205

Parameters

bool NewlineBeforeNext

void handleAttributes()

Declared at: clang/lib/Format/UnwrappedLineParser.h:132

bool handleCppAttributes()

Declared at: clang/lib/Format/UnwrappedLineParser.h:133

bool isOnNewLine(
    const clang::format::FormatToken& FormatTok)

Declared at: clang/lib/Format/UnwrappedLineParser.h:218

Parameters

const clang::format::FormatToken& FormatTok

void keepAncestorBraces()

Declared at: clang/lib/Format/UnwrappedLineParser.h:130

bool mightFitOnOneLine(
    clang::format::UnwrappedLine& Line,
    const clang::format::FormatToken*
        OpeningBrace = nullptr) const

Declared at: clang/lib/Format/UnwrappedLineParser.h:101

Parameters

clang::format::UnwrappedLine& Line
const clang::format::FormatToken* OpeningBrace = nullptr

void nextToken(int LevelDifference = 0)

Declared at: clang/lib/Format/UnwrappedLineParser.h:188

Parameters

int LevelDifference = 0

void parse()

Declared at: clang/lib/Format/UnwrappedLineParser.h:83

void parseAccessSpecifier()

Declared at: clang/lib/Format/UnwrappedLineParser.h:145

clang::format::FormatToken* parseBlock(
    bool MustBeDeclaration = false,
    unsigned int AddLevels = 1U,
    bool MunchSemi = true,
    bool KeepBraces = true,
    clang::format::UnwrappedLineParser::
        IfStmtKind* IfKind = nullptr,
    bool UnindentWhitesmithsBraces = false,
    bool CanContainBracedList = true,
    clang::format::TokenType NextLBracesType =
        TT_Unknown)

Declared at: clang/lib/Format/UnwrappedLineParser.h:103

Parameters

bool MustBeDeclaration = false
unsigned int AddLevels = 1U
bool MunchSemi = true
bool KeepBraces = true
clang::format::UnwrappedLineParser::IfStmtKind* IfKind = nullptr
bool UnindentWhitesmithsBraces = false
bool CanContainBracedList = true
clang::format::TokenType NextLBracesType = TT_Unknown

bool parseBracedList(
    bool ContinueOnSemicolons = false,
    bool IsEnum = false,
    tok::TokenKind ClosingBraceKind =
        tok::r_brace)

Declared at: clang/lib/Format/UnwrappedLineParser.h:126

Parameters

bool ContinueOnSemicolons = false
bool IsEnum = false
tok::TokenKind ClosingBraceKind = tok::r_brace

void parseCSharpAttribute()

Declared at: clang/lib/Format/UnwrappedLineParser.h:166

void parseCSharpGenericTypeConstraint()

Declared at: clang/lib/Format/UnwrappedLineParser.h:170

void parseCaseLabel()

Declared at: clang/lib/Format/UnwrappedLineParser.h:140

void parseChildBlock(
    bool CanContainBracedList = true,
    clang::format::TokenType NextLBracesType =
        TT_Unknown)

Declared at: clang/lib/Format/UnwrappedLineParser.h:109

Parameters

bool CanContainBracedList = true
clang::format::TokenType NextLBracesType = TT_Unknown

void parseConcept()

Declared at: clang/lib/Format/UnwrappedLineParser.h:148

void parseConstraintExpression()

Declared at: clang/lib/Format/UnwrappedLineParser.h:152

void parseDoWhile()

Declared at: clang/lib/Format/UnwrappedLineParser.h:138

bool parseEnum()

Declared at: clang/lib/Format/UnwrappedLineParser.h:146

void parseFile()

Declared at: clang/lib/Format/UnwrappedLineParser.h:94

void parseForOrWhileLoop()

Declared at: clang/lib/Format/UnwrappedLineParser.h:137

clang::format::FormatToken* parseIfThenElse(
    clang::format::UnwrappedLineParser::
        IfStmtKind* IfKind,
    bool KeepBraces = false)

Declared at: clang/lib/Format/UnwrappedLineParser.h:134

Parameters

clang::format::UnwrappedLineParser::IfStmtKind* IfKind
bool KeepBraces = false

void parseJavaEnumBody()

Declared at: clang/lib/Format/UnwrappedLineParser.h:153

void parseJavaScriptEs6ImportExport()

Declared at: clang/lib/Format/UnwrappedLineParser.h:164

void parseLabel(bool LeftAlignLabel = false)

Declared at: clang/lib/Format/UnwrappedLineParser.h:139

Parameters

bool LeftAlignLabel = false

bool parseLevel(
    const clang::format::FormatToken*
        OpeningBrace = nullptr,
    bool CanContainBracedList = true,
    clang::format::TokenType NextLBracesType =
        TT_Unknown,
    clang::format::UnwrappedLineParser::
        IfStmtKind* IfKind = nullptr,
    clang::format::FormatToken** IfLeftBrace =
        nullptr)

Declared at: clang/lib/Format/UnwrappedLineParser.h:96

Parameters

const clang::format::FormatToken* OpeningBrace = nullptr
bool CanContainBracedList = true
clang::format::TokenType NextLBracesType = TT_Unknown
clang::format::UnwrappedLineParser::IfStmtKind* IfKind = nullptr
clang::format::FormatToken** IfLeftBrace = nullptr

void parseLoopBody(bool KeepBraces,
                   bool WrapRightBrace)

Declared at: clang/lib/Format/UnwrappedLineParser.h:136

Parameters

bool KeepBraces
bool WrapRightBrace

void parseModuleImport()

Declared at: clang/lib/Format/UnwrappedLineParser.h:143

void parseNamespace()

Declared at: clang/lib/Format/UnwrappedLineParser.h:142

void parseNew()

Declared at: clang/lib/Format/UnwrappedLineParser.h:144

void parseObjCInterfaceOrImplementation()

Declared at: clang/lib/Format/UnwrappedLineParser.h:162

void parseObjCLightweightGenerics()

Declared at: clang/lib/Format/UnwrappedLineParser.h:158

void parseObjCMethod()

Declared at: clang/lib/Format/UnwrappedLineParser.h:159

bool parseObjCProtocol()

Declared at: clang/lib/Format/UnwrappedLineParser.h:163

void parseObjCProtocolList()

Declared at: clang/lib/Format/UnwrappedLineParser.h:160

void parseObjCUntilAtEnd()

Declared at: clang/lib/Format/UnwrappedLineParser.h:161

void parsePPDefine()

Declared at: clang/lib/Format/UnwrappedLineParser.h:112

void parsePPDirective()

Declared at: clang/lib/Format/UnwrappedLineParser.h:111

void parsePPElIf()

Declared at: clang/lib/Format/UnwrappedLineParser.h:114

void parsePPElse()

Declared at: clang/lib/Format/UnwrappedLineParser.h:115

void parsePPEndIf()

Declared at: clang/lib/Format/UnwrappedLineParser.h:116

void parsePPIf(bool IfDef)

Declared at: clang/lib/Format/UnwrappedLineParser.h:113

Parameters

bool IfDef

void parsePPUnknown()

Declared at: clang/lib/Format/UnwrappedLineParser.h:117

void parseParens(clang::format::TokenType
                     AmpAmpTokenType = TT_Unknown)

Declared at: clang/lib/Format/UnwrappedLineParser.h:128

Parameters

clang::format::TokenType AmpAmpTokenType = TT_Unknown

void parseRecord(bool ParseAsExpr = false)

Declared at: clang/lib/Format/UnwrappedLineParser.h:157

Parameters

bool ParseAsExpr = false

bool parseRequires()

Declared at: clang/lib/Format/UnwrappedLineParser.h:149

void parseRequiresClause(
    clang::format::FormatToken* RequiresToken)

Declared at: clang/lib/Format/UnwrappedLineParser.h:150

Parameters

clang::format::FormatToken* RequiresToken

void parseRequiresExpression(
    clang::format::FormatToken* RequiresToken)

Declared at: clang/lib/Format/UnwrappedLineParser.h:151

Parameters

clang::format::FormatToken* RequiresToken

void parseSquare(bool LambdaIntroducer = false)

Declared at: clang/lib/Format/UnwrappedLineParser.h:129

Parameters

bool LambdaIntroducer = false

void parseStatementMacro()

Declared at: clang/lib/Format/UnwrappedLineParser.h:165

bool parseStructLike()

Declared at: clang/lib/Format/UnwrappedLineParser.h:147

void parseStructuralElement(
    bool IsTopLevel = false,
    clang::format::TokenType NextLBracesType =
        TT_Unknown,
    clang::format::UnwrappedLineParser::
        IfStmtKind* IfKind = nullptr,
    clang::format::FormatToken** IfLeftBrace =
        nullptr,
    bool* HasDoWhile = nullptr,
    bool* HasLabel = nullptr)

Declared at: clang/lib/Format/UnwrappedLineParser.h:119

Parameters

bool IsTopLevel = false
clang::format::TokenType NextLBracesType = TT_Unknown
clang::format::UnwrappedLineParser::IfStmtKind* IfKind = nullptr
clang::format::FormatToken** IfLeftBrace = nullptr
bool* HasDoWhile = nullptr
bool* HasLabel = nullptr

void parseSwitch()

Declared at: clang/lib/Format/UnwrappedLineParser.h:141

void parseTryCatch()

Declared at: clang/lib/Format/UnwrappedLineParser.h:135

void parseUnbracedBody(bool CheckEOF = false)

Declared at: clang/lib/Format/UnwrappedLineParser.h:131

Parameters

bool CheckEOF = false

bool precededByCommentOrPPDirective() const

Declared at: clang/lib/Format/UnwrappedLineParser.h:95

void pushToken(clang::format::FormatToken* Tok)

Declared at: clang/lib/Format/UnwrappedLineParser.h:206

Parameters

clang::format::FormatToken* Tok

void readToken(int LevelDifference = 0)

Declared at: clang/lib/Format/UnwrappedLineParser.h:189

Parameters

int LevelDifference = 0

void readTokenWithJavaScriptASI()

Declared at: clang/lib/Format/UnwrappedLineParser.h:118

void reset()

Declared at: clang/lib/Format/UnwrappedLineParser.h:93

bool tryToParseBracedList()

Declared at: clang/lib/Format/UnwrappedLineParser.h:125

bool tryToParseChildBlock()

Declared at: clang/lib/Format/UnwrappedLineParser.h:172

void tryToParseJSFunction()

Declared at: clang/lib/Format/UnwrappedLineParser.h:175

bool tryToParseLambda()

Declared at: clang/lib/Format/UnwrappedLineParser.h:171

bool tryToParseLambdaIntroducer()

Declared at: clang/lib/Format/UnwrappedLineParser.h:173

bool tryToParsePropertyAccessor()

Declared at: clang/lib/Format/UnwrappedLineParser.h:174

bool tryToParseSimpleAttribute()

Declared at: clang/lib/Format/UnwrappedLineParser.h:176