Skip to content

How to generate a sequence of rules that produced the AST? #918

Answered by MegaIng
brando90 asked this question in Q&A
Discussion options

You must be logged in to vote

There is the Transformer, Visitor and Interpreter classes that visit the nodes of the tree.

If that does not do what you want, you will need to provide an example of what you want. Potentially the internal tree_matcher does what you want.

Note that if you want to match how it is parsed in reverse, that doesn't really make sense since we are implementing different algorithms that don't directly walk the grammar in a tangible way.

Replies: 1 comment 33 replies

Comment options

You must be logged in to vote
33 replies
@MegaIng
Comment options

@brando90
Comment options

@brando90
Comment options

@MegaIng
Comment options

@MegaIng
Comment options

Answer selected by brando90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants