CIRCT  19.0.0git
Public Types | Public Member Functions | Public Attributes | List of all members
circt::pretty::BufferingPP Struct Reference

Buffer tokens for clients that need to adjust things. More...

#include <PrettyPrinterHelpers.h>

Collaboration diagram for circt::pretty::BufferingPP:
Collaboration graph
[legend]

Public Types

using BufferVec = SmallVectorImpl< Token >
 

Public Member Functions

 BufferingPP (BufferVec &tokens)
 
void add (Token t)
 
template<typename R >
void addTokens (R &&newTokens)
 Add a range of tokens. More...
 
void eof ()
 Buffer a final EOF, no tokens allowed after this. More...
 
void flush (PrettyPrinter &pp)
 Flush buffered tokens to the specified pretty printer. More...
 

Public Attributes

BufferVectokens
 
bool hasEOF = false
 

Detailed Description

Buffer tokens for clients that need to adjust things.

Definition at line 33 of file PrettyPrinterHelpers.h.

Member Typedef Documentation

◆ BufferVec

using circt::pretty::BufferingPP::BufferVec = SmallVectorImpl<Token>

Definition at line 34 of file PrettyPrinterHelpers.h.

Constructor & Destructor Documentation

◆ BufferingPP()

circt::pretty::BufferingPP::BufferingPP ( BufferVec tokens)
inline

Definition at line 38 of file PrettyPrinterHelpers.h.

Member Function Documentation

◆ add()

void circt::pretty::BufferingPP::add ( Token  t)
inline

Definition at line 40 of file PrettyPrinterHelpers.h.

References assert(), hasEOF, and tokens.

◆ addTokens()

template<typename R >
void circt::pretty::BufferingPP::addTokens ( R &&  newTokens)
inline

Add a range of tokens.

Definition at line 47 of file PrettyPrinterHelpers.h.

References assert(), hasEOF, and tokens.

◆ eof()

void circt::pretty::BufferingPP::eof ( )
inline

Buffer a final EOF, no tokens allowed after this.

Definition at line 53 of file PrettyPrinterHelpers.h.

References assert(), and hasEOF.

◆ flush()

void circt::pretty::BufferingPP::flush ( PrettyPrinter pp)
inline

Flush buffered tokens to the specified pretty printer.

Emit the EOF is one was added.

Definition at line 60 of file PrettyPrinterHelpers.h.

References circt::pretty::PrettyPrinter::addTokens(), circt::pretty::PrettyPrinter::eof(), hasEOF, and tokens.

Member Data Documentation

◆ hasEOF

bool circt::pretty::BufferingPP::hasEOF = false

Definition at line 36 of file PrettyPrinterHelpers.h.

Referenced by add(), addTokens(), eof(), and flush().

◆ tokens

BufferVec& circt::pretty::BufferingPP::tokens

Definition at line 35 of file PrettyPrinterHelpers.h.

Referenced by add(), addTokens(), and flush().


The documentation for this struct was generated from the following file: