Interface InstructionVisitor

All Known Implementing Classes:
CodeArray, InstructionAdapter, StackOpt, Tree

public interface InstructionVisitor
The visitor pattern allows functionality to be added to a number of classes (or in this case one class, Instruction, that can vary in behavior) without modifying the classes themselves. Additionally, the visitor pattern simulates double dispatching. For instance visit method of Instruction calls a particular method of InstructionVisitor based on the Instruction's opcode.

InstructionVisitor provides an interface for performing actions based on the instruction type. Classes implementing this interface should not be able to miss any of the instruction types. This interface was created as an alternative to having 138 different subtypes of Instruction.

See Also: