clang  6.0.0svn
Public Member Functions | Protected Attributes | List of all members
clang::format::TokenRole Class Reference

#include "/opt/doxygen-docs/src/llvm/tools/clang/lib/Format/FormatToken.h"

Inheritance diagram for clang::format::TokenRole:
Inheritance graph
[legend]
Collaboration diagram for clang::format::TokenRole:
Collaboration graph
[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. More...
 
virtual unsigned formatFromToken (LineState &State, ContinuationIndenter *Indenter, bool DryRun)
 Apply the special formatting that the given role demands. More...
 
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. More...
 
virtual void CommaFound (const FormatToken *Token)
 Notifies the Role that a comma was found. More...
 

Protected Attributes

const FormatStyleStyle
 

Detailed Description

Definition at line 544 of file FormatToken.h.

Constructor & Destructor Documentation

◆ TokenRole()

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

Definition at line 546 of file FormatToken.h.

◆ ~TokenRole()

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

Definition at line 70 of file FormatToken.cpp.

Member Function Documentation

◆ CommaFound()

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

Notifies the Role that a comma was found.

Reimplemented in clang::format::CommaSeparatedList.

Definition at line 574 of file FormatToken.h.

◆ formatAfterToken()

virtual unsigned clang::format::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::format::CommaSeparatedList.

Definition at line 567 of file FormatToken.h.

◆ formatFromToken()

virtual unsigned clang::format::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::format::CommaSeparatedList.

Definition at line 559 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::format::CommaSeparatedList.

Definition at line 72 of file FormatToken.cpp.

Member Data Documentation

◆ Style

const FormatStyle& clang::format::TokenRole::Style
protected

Definition at line 577 of file FormatToken.h.


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