Skip to content

Commit

Permalink
Wordsmithing.
Browse files Browse the repository at this point in the history
Signed-off-by: Ken Domino <kenneth.domino@domemtech.com>
  • Loading branch information
kaby76 authored and parrt committed Jun 28, 2023
1 parent 58d5d55 commit ce7f5e7
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions doc/python-target.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,12 @@ Antlr generates two types of tree traversals: visitors and listeners.
Understanding when to choose a visitor versus a listener is a good idea.
For further information, see https://tomassetti.me/listeners-and-visitors/.

You can use this tree walker
to implement both [inherited](https://en.wikipedia.org/wiki/Attribute_grammar#Inherited_attributes)
and [synthesized attribute](https://en.wikipedia.org/wiki/Attribute_grammar#Synthesized_attributes)
analysis.

A visitor is the best choice when computing only a single synthesized attribute.
A visitor is the best choice when computing only a single [synthesized attribute](https://en.wikipedia.org/wiki/Attribute_grammar#Synthesized_attributes)
or when you want to control the order of parse tree nodes visited.
Alternatively, a listener is the best choice when computing both synthesized
and inherited attributes.
But, in many situations, they are interchangeable.
and [inherited attributes](https://en.wikipedia.org/wiki/Attribute_grammar#Inherited_attributes).

In many situations, they are interchangeable.

### Visitors

Expand Down

0 comments on commit ce7f5e7

Please sign in to comment.