import java.io.PrintWriter; import Instruction; /** * The amazingly strange "Seq" instruction, which sequences two * instructions and can therefore be used to build a tree of instructions. * Part of AAAL, the amazingly abstract assembly language. * * @author Samuel A. Rebelsky * @version 1.0 of April 2001 */ public class Seq implements Instruction { // +--------+------------------------------------------------------------ // | Fields | // +--------+ /** The first instruction. */ protected Instruction first; /** The second instruction. */ protected Instruction second; // +--------------+------------------------------------------------------ // | Constructors | // +--------------+ /** * Build a new sequence of instructions with specified first * and second instruction. */ public Seq(Instruction first, Instruction second) { this.first = first; this.second = second; } // Seq(Instruction, Instruction) // +---------------------+----------------------------------------------- // | Instruction Methods | // +---------------------+ /** * Print the instruction. */ public void print(PrintWriter out) { // Note that the Seq should be transparent; it simply // seequences instructions. first.print(out); second.print(out); } // print(PrintWriter) } // class Seq