clang API Documentation
#include <FormatToken.h>
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. | |
Protected Attributes | |
const FormatStyle & | Style |
Definition at line 447 of file FormatToken.h.
clang::format::TokenRole::TokenRole | ( | const FormatStyle & | Style | ) | [inline] |
Definition at line 449 of file FormatToken.h.
clang::format::TokenRole::~TokenRole | ( | ) | [virtual] |
Definition at line 55 of file FormatToken.cpp.
virtual void clang::format::TokenRole::CommaFound | ( | const FormatToken * | Token | ) | [inline, virtual] |
Notifies the Role
that a comma was found.
Reimplemented in clang::format::CommaSeparatedList.
Definition at line 477 of file FormatToken.h.
virtual unsigned clang::format::TokenRole::formatAfterToken | ( | LineState & | State, |
ContinuationIndenter * | Indenter, | ||
bool | DryRun | ||
) | [inline, virtual] |
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 470 of file FormatToken.h.
virtual unsigned clang::format::TokenRole::formatFromToken | ( | LineState & | State, |
ContinuationIndenter * | Indenter, | ||
bool | DryRun | ||
) | [inline, virtual] |
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 462 of file FormatToken.h.
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 57 of file FormatToken.cpp.
const FormatStyle& clang::format::TokenRole::Style [protected] |
Definition at line 480 of file FormatToken.h.
Referenced by clang::format::CommaSeparatedList::formatAfterToken(), and clang::format::CommaSeparatedList::precomputeFormattingInfos().