Skip to content

Marpa::R2 enhancement request: Generic AST traversal #266

@ronsavage

Description

@ronsavage

Would it be possible to add another method to Marpa::R2::ASF, to traverse the tree such that each node is visited once? That's what I need right now, and I suspect it's what many users would expect to have available.

See https://metacpan.org/pod/Tree#traverse-order for 1 way to describe the 3 orderings usually available.

I can see the docs already say "Methods of the glade object are used to find information about the glade, and to move around in it.", but how to move around it is not clear. And the bit above that - "The traverser may be called at every node of the forest" -, using "may", is the bit which worries me. I really do need to visit /every/ node. And hitting each node once is of course assumed.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions