pyk.kcfg.show module

class KCFGShow(kprint: KPrint, node_printer: NodePrinter | None = None)[source]

Bases: object

dot(kcfg: KCFG) Digraph[source]
dump(cfgid: str, cfg: KCFG, dump_dir: Path, dot: bool = False) None[source]
static hide_cells(term: KInner, omit_cells: Iterable[str]) KInner[source]
kprint: KPrint
static make_unique_segments(segments: Iterable[tuple[str, Iterable[str]]]) Iterable[tuple[str, Iterable[str]]][source]
node_printer: NodePrinter
node_short_info(kcfg: KCFG, node: Node) list[str][source]
pretty(kcfg: KCFG, minimize: bool = True) Iterable[str][source]
pretty_segments(kcfg: KCFG, minimize: bool = True) Iterable[tuple[str, Iterable[str]]][source]

Return a pretty version of the KCFG in segments.

Each segment is a tuple of an identifier and a list of lines to be printed for that segment (Tuple[str, Iterable[str]). The identifier tells you whether that segment is for a given node, edge, or just pretty spacing (‘unknown’). This is useful for applications which want to pretty print in chunks, so that they can know which printed region corresponds to each node/edge.

show(cfg: KCFG, nodes: Iterable[NodeIdLike] = (), node_deltas: Iterable[tuple[NodeIdLike, NodeIdLike]] = (), to_module: bool = False, minimize: bool = True, sort_collections: bool = False, omit_cells: Iterable[str] = (), module_name: str | None = None) list[str][source]
static simplify_config(config: KInner, omit_cells: Iterable[str]) KInner[source]
to_module(cfg: KCFG, module_name: str | None = None, omit_cells: Iterable[str] = (), parseable_output: bool = True) KFlatModule[source]
class NodePrinter(kprint: KPrint, full_printer: bool = False, minimize: bool = False)[source]

Bases: object

full_printer: bool
kprint: KPrint
minimize: bool
node_attrs(kcfg: KCFG, node: Node) list[str][source]
print_node(kcfg: KCFG, node: Node) list[str][source]