//==============================================================================
// Node.java
//==============================================================================
package sample.visitor;
/**
* Responsibilities:
* - represents a program node in an abstract syntax tree (AST).
*
*
* @author Copyright 2003 Nikolas S. Boyd.
*/
public abstract class Node {
/**
* Responsibilities:
* - visits a node in a program AST.
*
*
* @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