//============================================================================== // Node.java //============================================================================== package sample.visitor; /** * Responsibilities:

* * @author Copyright 2003 Nikolas S. Boyd. */ public abstract class Node { /** * Responsibilities:

* * @author Copyright 2003 Nikolas S. Boyd. */ public interface Visitor { /** * Visits a node. * @param node represents a node in a program AST. */ public void visit(Node node); } // Node.Visitor /** * Accepts a node visitor for this kind of AST node. * @param visitor knows what to do with this kind of node. */ public abstract void accept(Visitor visitor); } // Node