|
CIRCT 24.0.0git
|
Wrap the TokenStream with a helper for CallbackTokens, to record the print events on the stream. More...
#include <PrettyPrinterHelpers.h>


Public Member Functions | |
| TokenStreamWithCallback (PPTy &pp, PrintEventAndStorageListener< CallableType, DataType > &saver, bool enableCallback) | |
| void | addCallback (DataType d) |
| Add a Callback token. | |
| Public Member Functions inherited from circt::pretty::TokenStream< PrettyPrinter > | |
| TokenStream (PrettyPrinter &pp, TokenStringSaver &saver) | |
| Create a TokenStream using the specified PrettyPrinter and StringSaver storage. | |
| TokenStream & | operator<< (const char *s) |
| Add a string literal (external storage). | |
| TokenStream & | addAsString (T &&t) |
| General-purpose "format this" helper, for types not supported by operator<< yet. | |
| auto | invokeWithStringOS (Callable &&c) |
| Helper to invoke code with a llvm::raw_ostream argument for compatibility. | |
| TokenStream & | writeEscaped (StringRef str, bool useHexEscapes=false) |
| Write escaped versions of the string, saved in storage. | |
| TokenStream & | writeQuotedEscaped (StringRef str, bool useHexEscapes=false, StringRef left="\"", StringRef right="\"") |
| auto | scopedBox (T &&t, Callable &&c, Token close=EndToken()) |
| Open a box, invoke the lambda, and close it after. | |
| Public Member Functions inherited from circt::pretty::TokenBuilder< PrettyPrinter > | |
| TokenBuilder (PrettyPrinter &pp) | |
| std::enable_if_t< std::is_base_of_v< Token, T > > | add (Args &&...args) |
| Add new token. | |
| void | addToken (Token t) |
| void | eof () |
| End of a stream. | |
| void | literal (StringRef str) |
| Add a literal (with external storage). | |
| void | nbsp () |
| Add a non-breaking space. | |
| void | neverbreak () |
| Add a 'neverbreak' break. Always 'fits'. | |
| void | newline () |
| Add a newline (break too wide to fit, always breaks). | |
| void | spaces (uint32_t n) |
| Add breakable spaces. | |
| void | space () |
| Add a breakable space. | |
| void | zerobreak () |
| Add a break that is zero-wide if not broken. | |
| void | bbox (int32_t offset=0, Breaks breaks=Breaks::Consistent) |
| Start a IndentStyle::Block group with specified offset. | |
| void | cbox (int32_t offset=0, IndentStyle style=IndentStyle::Visual) |
| Start a consistent group with specified offset. | |
| void | ibox (int32_t offset=0, IndentStyle style=IndentStyle::Visual) |
| Start an inconsistent group with specified offset. | |
| void | neverbox () |
| Start a group that cannot break, including nested groups. | |
| void | end () |
| End a group. | |
Private Types | |
| using | Base = TokenStream<PPTy> |
Private Attributes | |
| PrintEventAndStorageListener< CallableType, DataType > & | saver |
| const bool | enableCallback |
Additional Inherited Members | |
| Protected Attributes inherited from circt::pretty::TokenStream< PrettyPrinter > | |
| TokenStringSaver & | saver |
Wrap the TokenStream with a helper for CallbackTokens, to record the print events on the stream.
Definition at line 378 of file PrettyPrinterHelpers.h.
|
private |
Definition at line 379 of file PrettyPrinterHelpers.h.
|
inline |
Definition at line 385 of file PrettyPrinterHelpers.h.
References enableCallback, circt::pretty::TokenBuilder< PrettyPrinter >::pp, saver, and circt::pretty::TokenStream< PrettyPrinter >::TokenStream().
|
inline |
Add a Callback token.
Definition at line 391 of file PrettyPrinterHelpers.h.
References circt::pretty::TokenBuilder< PPTy >::addToken(), enableCallback, and saver.
|
private |
Definition at line 382 of file PrettyPrinterHelpers.h.
Referenced by addCallback(), and TokenStreamWithCallback().
|
private |
Definition at line 380 of file PrettyPrinterHelpers.h.
Referenced by addCallback(), and TokenStreamWithCallback().