def print_trie(trie_node, indent=0):
  """Recursively prints Trie for debugging purposes."""
  print("%s %s" % ("-" * indent, trie_node.symbol))
  for value in trie_node.values:
    print("%s value: %s" % ("-" * indent, value))
  for child in trie_node.symbol_to_child.values():
    print_trie(child, indent=indent + 1)
Recursively prints Trie for debugging purposes.
language/compgen/csl/cky/cfg_parser.py