Implementing the interface (described here) would give us access to useful functions, especially print_tree(...). The most basic implementation would only consist of defining
The current, default, output (Base.show(...)) looks like this.
1{2,2,3{5}}
We could add the tree pretty-printing as an alternative or replace Base.show(...) for rule nodes with this.
I don't know whether printing the actual expressions using the grammar (instead of the rule number seen above) is straightforward with this API, but it would be nice to have that as well.
Just found that this is somewhat addressed in HerbGrammarhere, but it seems like this functionality should be here in HerbCore as it's only concerned with RuleNodes.
We should probably also expand this to AbstractRuleNodes as well.
Implementing the interface (described here) would give us access to useful functions, especially
print_tree(...)
. The most basic implementation would only consist of definingOut of the box, this would allow for
to be displayed by
and with a little extra tweaking
The current, default, output (
Base.show(...)
) looks like this.We could add the tree pretty-printing as an alternative or replace
Base.show(...)
for rule nodes with this.I don't know whether printing the actual expressions using the grammar (instead of the rule number seen above) is straightforward with this API, but it would be nice to have that as well.