You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/python-target.md
+5-8Lines changed: 5 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,15 +81,12 @@ Antlr generates two types of tree traversals: visitors and listeners.
81
81
Understanding when to choose a visitor versus a listener is a good idea.
82
82
For further information, see https://tomassetti.me/listeners-and-visitors/.
83
83
84
-
You can use this tree walker
85
-
to implement both [inherited](https://en.wikipedia.org/wiki/Attribute_grammar#Inherited_attributes)
86
-
and [synthesized attribute](https://en.wikipedia.org/wiki/Attribute_grammar#Synthesized_attributes)
87
-
analysis.
88
-
89
-
A visitor is the best choice when computing only a single synthesized attribute.
84
+
A visitor is the best choice when computing only a single [synthesized attribute](https://en.wikipedia.org/wiki/Attribute_grammar#Synthesized_attributes)
85
+
or when you want to control the order of parse tree nodes visited.
90
86
Alternatively, a listener is the best choice when computing both synthesized
91
-
and inherited attributes.
92
-
But, in many situations, they are interchangeable.
87
+
and [inherited attributes](https://en.wikipedia.org/wiki/Attribute_grammar#Inherited_attributes).
0 commit comments