auparse_node_compare - Linux


auparse_node_compare compares nodes in two AU parse trees and prints a summary of differences. It is useful for debugging and testing AU parsers.


auparse_node_compare [-h] [-s STR] [-r] [-d]
                      au_parse_tree1 au_parse_tree2


  • -h, –help: Show help message and exit.
  • -s STR, –score STR: Print score (0-100) indicating similarity of trees.
  • -r, –root: Compare subtrees rooted at first nodes in trees rather than entire trees.
  • -d, –disable-reorder: Disable node reordering for comparison.


  • Compare entire trees:
  • Compare subtrees:
auparse_node_compare -r
  • Print similarity score:
auparse_node_compare -s

Common Issues

  • Nodes with different order: If nodes are not in the same order in both trees, the comparison may fail. Use the -d flag to disable node reordering for more lenient comparison.
  • Different node types: If nodes are of different types (e.g., branch vs. leaf), the comparison will fail. Ensure trees are well-formed before comparison.


auparse_node_compare can be integrated into scripts or pipelines for automated testing or debugging.

Related Commands

  • auparse: Parses AU language expressions into parse trees.
  • auparse_print: Prints AU parse trees in a readable format.