Skip to content

Docs enhancement on visitor with defaults #1919

Answered by bd82
ierehon1905 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @ierehon1905

From the code it appears that you need to explicitly invoke the visitor for the children when you provide an implementation.

I guess the reasoning behind this is that if you implemented an "handler" for a specific grammar rule
You likely want to collect / assemble the individual children visitor results in some manner, not merely invoke the visitor on those.

You can always add additional helpers and logic for your visitor, e.g:

Other ideas:

  • only travers…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ierehon1905
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1916 on February 11, 2023 23:02.