I use pyparsing to parse a hexadecimal string, and I'm looking for an automatic way to print a parser tree.
The closest approach is a team dump, but it prints a lot of duplicated information.
For instance:
from pyparsing import *
The goal is that the result of result.dump () was something like
- frame: ['02', '01', '03', '03', '01', '04', '02', '03', '02'] - id: 02 - array: ['03', '03', '01', '04', '02', '03', '02'] - char: 01 - boolean: 02 - char: 02
A cute print is optional, pretending to be a tree structure.
Is there a way to make this fingerprint, or do I need to have setParseAction for all the rules?
source share