Replies: 1 comment
-
Do you mean the visitor pattern? I'm not sure off the top of my head, you can check out projects here if any of them used the visitor pattern: https://github.com/pest-parser/awesome-pest?tab=readme-ov-file#projects Otherwise, as you mentioned pest-ast is a good start; once you have ast, you can define a visitor on it: https://rust-unofficial.github.io/patterns/patterns/behavioural/visitor.html (not pest-specific) A side-note: if you need to handle operator precedence, you can check out Pratt Parser: https://pest.rs/book/precedence.html |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a working , but incomplete, project , that uses antlr4rust. It uses the visitor model - which I really like. Is it possible to do the same thing using pest. I see the pest_ast project, maybe I need to tackle using that first.
Beta Was this translation helpful? Give feedback.
All reactions