clang 10.0.0git

Public Types | Public Member Functions | List of all members
clang::TokenRewriter Class Reference

`#include "clang/Rewrite/Core/TokenRewriter.h"`

## Public Types
using | token_iterator = std::list< Token >::const_iterator

## Public Member Functions
| TokenRewriter (FileID FID, SourceManager &SM, const LangOptions &LO)
| TokenRewriter - This creates a TokenRewriter for the file with the specified FileID. More...
| TokenRewriter (const TokenRewriter &)=delete
TokenRewriter & | operator= (const TokenRewriter &)=delete
| ~TokenRewriter ()
token_iterator | token_begin () const
token_iterator | token_end () const
token_iterator | AddTokenBefore (token_iterator I, const char *Val)
token_iterator | AddTokenAfter (token_iterator I, const char *Val)

## Detailed Description

Definition at line 30 of file TokenRewriter.h.

## Member Typedef Documentation

## ◆ token_iterator

using clang::TokenRewriter::token_iterator = std::list<Token>::const_iterator

Definition at line 56 of file TokenRewriter.h.

## Constructor & Destructor Documentation

## ◆ TokenRewriter() [1/2]

TokenRewriter::TokenRewriter | ( | FileID | FID,
|  | SourceManager & | SM,
|  | const LangOptions & | LO
| ) |  |

TokenRewriter - This creates a TokenRewriter for the file with the specified FileID.

Definition at line 26 of file TokenRewriter.cpp.

References clang::comments::tok::eof, clang::SourceManager::getBuffer(), clang::Token::getLocation(), clang::format::FormatToken::is(), clang::Token::isNot(), clang::Lexer::LexFromRawLexer(), clang::Lexer::SetKeepWhitespaceMode(), clang::format::Tok, token_end(), and ~TokenRewriter().

## ◆ TokenRewriter() [2/2]

clang::TokenRewriter::TokenRewriter | ( | const TokenRewriter & |  | ) |
| delete

## ◆ ~TokenRewriter()

TokenRewriter::~TokenRewriter | ( |  | ) |
| default

Referenced by TokenRewriter().

## Member Function Documentation

## ◆ AddTokenAfter()

token_iterator clang::TokenRewriter::AddTokenAfter | ( | token_iterator | I,
|  | const char * | Val
| ) |  |
| inline

Definition at line 63 of file TokenRewriter.h.

References AddTokenBefore(), and token_end().

## ◆ AddTokenBefore()

TokenRewriter::token_iterator TokenRewriter::AddTokenBefore | ( | token_iterator | I,
|  | const char * | Val
| ) |  |

Definition at line 83 of file TokenRewriter.cpp.

References clang::Token::setKind(), clang::Token::setLength(), clang::Token::setLocation(), clang::Token::startToken(), and clang::format::Tok.

Referenced by AddTokenAfter(), and token_end().

## ◆ operator=()

TokenRewriter& clang::TokenRewriter::operator= | ( | const TokenRewriter & |  | ) |
| delete

## ◆ token_begin()

token_iterator clang::TokenRewriter::token_begin | ( |  | ) | const
| inline

Definition at line 58 of file TokenRewriter.h.

## ◆ token_end()

token_iterator clang::TokenRewriter::token_end | ( |  | ) | const
| inline

Definition at line 59 of file TokenRewriter.h.

References AddTokenBefore().

Referenced by AddTokenAfter(), and TokenRewriter().

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

- include/clang/Rewrite/Core/TokenRewriter.h
- lib/Rewrite/TokenRewriter.cpp