clang 22.0.0git
clang::TokenRole Class Reference

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/Format/FormatToken.h"

Inheritance diagram for clang::TokenRole:
[legend]

Public Member Functions

 TokenRole (const FormatStyle &Style)
virtual ~TokenRole ()
virtual void precomputeFormattingInfos (const FormatToken *Token)
 After the TokenAnnotator has finished annotating all the tokens, this function precomputes required information for formatting.
virtual unsigned formatFromToken (LineState &State, ContinuationIndenter *Indenter, bool DryRun)
 Apply the special formatting that the given role demands.
virtual unsigned formatAfterToken (LineState &State, ContinuationIndenter *Indenter, bool DryRun)
 Same as formatFromToken, but assumes that the first token has already been set thereby deciding on the first line break.
virtual void CommaFound (const FormatToken *Token)
 Notifies the Role that a comma was found.
virtual const FormatTokenlastComma ()

Protected Attributes

const FormatStyle & Style

Detailed Description

Definition at line 928 of file FormatToken.h.

Constructor & Destructor Documentation

◆ TokenRole()

clang::TokenRole::TokenRole ( const FormatStyle & Style)
inline

Definition at line 930 of file FormatToken.h.

References Style, and TokenRole().

Referenced by TokenRole().

◆ ~TokenRole()

clang::format::TokenRole::~TokenRole ( )
virtual

Definition at line 82 of file FormatToken.cpp.

Member Function Documentation

◆ CommaFound()

virtual void clang::TokenRole::CommaFound ( const FormatToken * Token)
inlinevirtual

Notifies the Role that a comma was found.

Reimplemented in clang::CommaSeparatedList.

Definition at line 958 of file FormatToken.h.

◆ formatAfterToken()

virtual unsigned clang::TokenRole::formatAfterToken ( LineState & State,
ContinuationIndenter * Indenter,
bool DryRun )
inlinevirtual

Same as formatFromToken, but assumes that the first token has already been set thereby deciding on the first line break.

Reimplemented in clang::CommaSeparatedList.

Definition at line 951 of file FormatToken.h.

◆ formatFromToken()

virtual unsigned clang::TokenRole::formatFromToken ( LineState & State,
ContinuationIndenter * Indenter,
bool DryRun )
inlinevirtual

Apply the special formatting that the given role demands.

Assumes that the token having this role is already formatted.

Continues formatting from State leaving indentation to Indenter and returns the total penalty that this formatting incurs.

Reimplemented in clang::CommaSeparatedList.

Definition at line 943 of file FormatToken.h.

References formatFromToken().

Referenced by formatFromToken().

◆ lastComma()

virtual const FormatToken * clang::TokenRole::lastComma ( )
inlinevirtual

Reimplemented in clang::CommaSeparatedList.

Definition at line 960 of file FormatToken.h.

◆ precomputeFormattingInfos()

void clang::format::TokenRole::precomputeFormattingInfos ( const FormatToken * Token)
virtual

After the TokenAnnotator has finished annotating all the tokens, this function precomputes required information for formatting.

Reimplemented in clang::CommaSeparatedList.

Definition at line 84 of file FormatToken.cpp.

References FormatToken().

Member Data Documentation

◆ Style


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