code: def print_grammar_ast(
      self, grammar: Grammar, printer: Callable[..., None] = print
  ) -> None:
      for rule in grammar.rules.values():
          printer(self.print_nodes_recursively(rule))
  
file_path: cpython/Tools/peg_generator/pegen/grammar_visualizer.py
imports: import argparse
  import sys
  from typing import Any, Callable, Iterator
  from pegen.build import build_parser
  from pegen.grammar import Grammar, Rule
label_desc: Use image node_id 3 for calling the ASTGrammarPrinter obj's underlying member method code with example usage: obj.print_grammar_ast(grammar, printer) without return types