SE450
:
Double Dispatch
[43/55]
Each element type provides methods:
public class ElementType
i
{
public void accept(Visitor v) { v.visitElementType
i
(this); }
...
}
Completely mechanical
Example:
public class DirectoryNode
{
public void accept(Visitor v) { v.visitDirectoryNode(this); }
...
}