class TokenCollector

Declaration

class TokenCollector { /* full declaration omitted */ };

Description

Collects tokens for the main file while running the frontend action. An instance of this object should be created on FrontendAction::BeginSourceFile() and the results should be consumed after FrontendAction::Execute() finishes.

Declared at: clang/include/clang/Tooling/Syntax/Tokens.h:419

Member Variables

private std::vector<syntax::Token> Expanded
private clang::syntax::TokenCollector::PPExpansions Expansions
private clang::Preprocessor& PP
private clang::syntax::TokenCollector:: CollectPPExpansions* Collector

Method Overview

Methods

TokenCollector(clang::Preprocessor& P)

Description

Adds the hooks to collect the tokens. Should be called before the preprocessing starts, i.e. as a part of BeginSourceFile() or CreateASTConsumer().

Declared at: clang/include/clang/Tooling/Syntax/Tokens.h:424

Parameters

clang::Preprocessor& P

clang::syntax::TokenBuffer consume() &&

Description

Finalizes token collection. Should be called after preprocessing is finished, i.e. after running Execute().

Declared at: clang/include/clang/Tooling/Syntax/Tokens.h:428