28
CS269: HW/SW Engineering of Embedded Systems, Winter02
Steps to Write a Visitor
(1)
•
What the return value is?
–
If new information only needs to be stored in the nodes of
the AST, return null in this case.
–
Usually, the return value for all the visit methods are
consistent.
•
What nodes in the AST to be visited?
–
only a few nodes
–
all nodes
These will determine which traversal method to use.