-
I am new to Langium. Is there any support for AST traversing? A way to generate a Visitor Module for the generated AST? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hey @crguezl, We don't offer a visitor for ASTs, but you can use the |
Beta Was this translation helpful? Give feedback.
-
Thanks @msujew. I am going to try it. |
Beta Was this translation helpful? Give feedback.
Hey @crguezl,
We don't offer a visitor for ASTs, but you can use the
AstUtils.streamAllContents
function instead. Just pass the root node of your document in there and it will yield a stream of all elements within the root node. You can then apply a visitor pattern on top of that if you want to.