CIRCT  20.0.0git
Namespaces | Classes | Enumerations | Functions
circt::pretty Namespace Reference

Namespaces

 detail
 

Classes

class  Token
 
struct  TokenBase
 Helper class to CRTP-derive common functions. More...
 
struct  StringToken
 Token types. More...
 
struct  BreakToken
 
struct  BeginToken
 
struct  EndToken
 
struct  CallbackToken
 
class  PrettyPrinter
 
struct  BufferingPP
 Buffer tokens for clients that need to adjust things. More...
 
class  TokenBuilder
 Add convenience methods for generating pretty-printing tokens. More...
 
class  TokenStringSaver
 PrettyPrinter::Listener that saves strings while live. More...
 
class  PrintEventAndStorageListener
 Note: Callable class must implement a callable with signature: void (Data) More...
 
struct  PPExtString
 String wrapper to indicate string has external storage. More...
 
struct  PPSaveString
 String wrapper to indicate string needs to be saved. More...
 
class  TokenStream
 Wrap a PrettyPrinter with TokenBuilder features as well as operator<<'s. More...
 
class  TokenStreamWithCallback
 Wrap the TokenStream with a helper for CallbackTokens, to record the print events on the stream. More...
 

Enumerations

enum class  Breaks { Consistent , Inconsistent , Never }
 Style of breaking within a group: More...
 
enum class  IndentStyle { Visual , Block }
 Style of indent when starting a group: More...
 
enum class  PP {
  bbox2 , cbox0 , cbox2 , end ,
  eof , ibox0 , ibox2 , nbsp ,
  neverbox , neverbreak , newline , space ,
  zerobreak
}
 Send one of these to TokenStream to add the corresponding token. More...
 

Functions

static uint32_t computeNewIndent (ssize_t newIndent, int32_t offset, uint32_t maxStartingIndent)
 Compute indentation w/o overflow, clamp to [0,maxStartingIndent]. More...
 

Enumeration Type Documentation

◆ Breaks

enum circt::pretty::Breaks
strong

Style of breaking within a group:

  • Consistent: all fits or all breaks.
  • Inconsistent: best fit, break where needed.
  • Never: force no breaking including nested groups.
Enumerator
Consistent 
Inconsistent 
Never 

Definition at line 44 of file PrettyPrinter.h.

◆ IndentStyle

Style of indent when starting a group:

  • Visual: offset is relative to current column.
  • Block: offset is relative to current base indentation.
Enumerator
Visual 
Block 

Definition at line 49 of file PrettyPrinter.h.

◆ PP

enum circt::pretty::PP
strong

Send one of these to TokenStream to add the corresponding token.

See TokenBuilder for details of each.

Enumerator
bbox2 
cbox0 
cbox2 
end 
eof 
ibox0 
ibox2 
nbsp 
neverbox 
neverbreak 
newline 
space 
zerobreak 

Definition at line 207 of file PrettyPrinterHelpers.h.

Function Documentation

◆ computeNewIndent()

static uint32_t circt::pretty::computeNewIndent ( ssize_t  newIndent,
int32_t  offset,
uint32_t  maxStartingIndent 
)
static

Compute indentation w/o overflow, clamp to [0,maxStartingIndent].

Output looks better if we don't stop indenting entirely at target width, but don't do this indefinitely.

Definition at line 243 of file PrettyPrinter.cpp.

Referenced by circt::pretty::PrettyPrinter::print().