pyk.kcfg.show module

class KCFGShow(defn: KDefinition, 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]
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_printer: PrettyPrinter
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, 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, defunc_with: KDefinition | None = None, imports: Iterable[KImport] = ()) KFlatModule[source]
class NodePrinter(cterm_show: CTermShow, full_printer: bool = False)[source]

Bases: object

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