//==============================================================================
// AssignmentNode.java
//==============================================================================
package sample.visitor;
/**
* Responsibilities:
* - respresents an assignment expression in a program.
*
*
* @author Copyright 2003 Nikolas S. Boyd.
*/
public class AssignmentNode extends Node {
/**
* Responsibilities:
* - visits an assignment node in a program AST.
*
*
* @author Copyright 2003 Nikolas S. Boyd.
*/
public interface Visitor {
/**
* Visits an assignment node.
* @param node represents a node in a program AST.
*/
public void visit(AssignmentNode node);
} // AssignmentNode.Vistor
/**
* Accepts a node visitor for this kind of AST node.
* @param visitor knows what to do with an assignment.
*/
public void accept(Visitor visitor) {
visitor.visit(this);
}
/**
* Accepts a node visitor for this kind of AST node.
* @param visitor must know how to visit this kind of node.
*/
public void accept(Node.Visitor visitor) {
accept((Visitor) visitor);
return;
}
// ... other aspects of the assignment node ...
} // AssignmentNode