GTIRB-PPRINTER  v0.1.1
GrammaTech Intermediate Representation for Binaries: Pretty Printer
Classes | Typedefs | Enumerations | Functions
gtirb_pprint Namespace Reference

Pretty-print GTIRB representations. More...

Classes

class  AttPrettyPrinter
 
class  IntelPrettyPrinter
 
class  PrettyPrinter
 
class  PrettyPrinterBase
 

Typedefs

using factory = std::function< std::unique_ptr< PrettyPrinterBase >(gtirb::Context &context, gtirb::IR &ir, const string_range &, DebugStyle)>
 
using string_range = boost::any_range< std::string, boost::forward_traversal_tag, std::string &, std::ptrdiff_t >
 

Enumerations

enum  DebugStyle { NoDebug, DebugMessages }
 Whether a pretty printer should include debugging messages in it output. More...
 

Functions

std::set< std::string > getRegisteredSyntaxes ()
 Return the current set of syntaxes with registered factories. More...
 
bool registerPrinter (std::initializer_list< std::string > syntaxes, factory f)
 

Detailed Description

Pretty-print GTIRB representations.

Typedef Documentation

◆ factory

using gtirb_pprint::factory = typedef std::function<std::unique_ptr<PrettyPrinterBase>( gtirb::Context& context, gtirb::IR& ir, const string_range&, DebugStyle)>

The type of the factories that may be registered. A factory is simply something that can be called with an allocation context, the IR to pretty print, the set of function names to skip during printing, and a boolean indicating whether to include debugging output.

◆ string_range

using gtirb_pprint::string_range = typedef boost::any_range<std::string, boost::forward_traversal_tag, std::string&, std::ptrdiff_t>

A range containing strings. These can be standard library containers or pairs of iterators, for example.

Enumeration Type Documentation

◆ DebugStyle

Whether a pretty printer should include debugging messages in it output.

Enumerator
NoDebug 
DebugMessages 

Function Documentation

◆ getRegisteredSyntaxes()

std::set< std::string > gtirb_pprint::getRegisteredSyntaxes ( )

Return the current set of syntaxes with registered factories.

◆ registerPrinter()

bool gtirb_pprint::registerPrinter ( std::initializer_list< std::string >  syntaxes,
factory  f 
)

Register a factory for creating pretty printer objects. The factory will be used to generate the syntaxes named in the initialization list. For example,

registerPrinter({"foo", "bar"}, theFactory);
Parameters
syntaxesthe (non-empty) syntaxes produced by the factory
fthe (non-empty) object true