clang API Documentation

Public Member Functions | Protected Attributes
clang::format::TokenRole Class Reference

#include <FormatToken.h>

Inheritance diagram for clang::format::TokenRole:
Inheritance graph
[legend]
Collaboration diagram for clang::format::TokenRole:
Collaboration graph
[legend]

List of all members.

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 FormatStyleStyle

Detailed Description

Definition at line 447 of file FormatToken.h.


Constructor & Destructor Documentation

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

Definition at line 449 of file FormatToken.h.

Definition at line 55 of file FormatToken.cpp.


Member Function Documentation

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.

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.


Member Data Documentation


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