All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class IRT.Print

java.lang.Object
   |
   +----IRT.Print

public class Print
extends Object
Print the various parts of an intermediate representation tree (with components given by the Tree and Temp packages).

History

Version 1.0 (11 December 1998)
Created in support of the Tiger compiler project


Constructor Index

 o Print()

Method Index

 o print(PrintWriter, BINOP)
Print a binary operator.
 o print(PrintWriter, BUILTIN)
Print a call to a builtin operator.
 o print(PrintWriter, CALL)
Print a function call.
 o print(PrintWriter, CJUMP)
Print a conditional jump.
 o print(PrintWriter, CONST)
Print a constant.
 o print(PrintWriter, ESEQ)
Print an ESEQ.
 o print(PrintWriter, EXP)
Print an expression instruction.
 o print(PrintWriter, Exp)
Print any expression.
 o print(PrintWriter, ExpList)
Print a list of expressions.
 o print(PrintWriter, JUMP)
Print a JUMP instruction.
 o print(PrintWriter, LABEL)
Print a label instruction.
 o print(PrintWriter, Label)
Print a label.
 o print(PrintWriter, LabelList)
Print a list of labels.
 o print(PrintWriter, MEM)
Print a memory reference.
 o print(PrintWriter, MOVE)
Print a move instruction.
 o print(PrintWriter, NAME)
Print a label used as part of an argument.
 o print(PrintWriter, SEQ)
Print a sequence of instructions.
 o print(PrintWriter, Stm)
Print a statement.
 o print(PrintWriter, StmList)
Print a list of statements.
 o print(PrintWriter, STRING)
Print a string declaration.
 o print(PrintWriter, TEMP)
Print a temporary.
 o print(PrintWriter, Temp)
Print a temporary.
 o print(PrintWriter, TempList)
Print a list of temporaries.

Constructors

 o Print
 public Print()

Methods

 o print
 public static void print(PrintWriter out,
                          Label label) throws Exception
Print a label.

Throws: Exception
If the label is undefined.
 o print
 public static void print(PrintWriter out,
                          LabelList labels) throws Exception
Print a list of labels.

Throws: Exception
If any of the labels is null.
 o print
 public static void print(PrintWriter out,
                          Temp temp) throws Exception
Print a temporary. Relies on the modifed Temp.toString method.

Throws: Exception
If the temporary is undefined.
 o print
 public static void print(PrintWriter out,
                          TempList temps) throws Exception
Print a list of temporaries.

Throws: Exception
If any of the temporaries is null.
 o print
 public static void print(PrintWriter out,
                          Exp exp) throws Exception
Print any expression.

Throws: Exception
If the expression is unprintable (see the various kinds of expressions for more information) or if it's not one of the standard kinds of expressions.
 o print
 public static void print(PrintWriter out,
                          ExpList explist) throws Exception
Print a list of expressions.

Throws: Exception
If any of the parts of the list is invalid.
 o print
 public static void print(PrintWriter out,
                          BINOP binop) throws Exception
Print a binary operator.

Throws: Exception
When the operator is incorrect or one of the arguments is invalid.
 o print
 public static void print(PrintWriter out,
                          BUILTIN builtin) throws Exception
Print a call to a builtin operator.

Throws: Exception
When one of the arguments is incorrect.
 o print
 public static void print(PrintWriter out,
                          CALL call) throws Exception
Print a function call.

Throws: Exception
When one of the arguments is incorrect.
 o print
 public static void print(PrintWriter out,
                          CONST c)
Print a constant. Since this should only be used as an argument to something, it does not include a carriage return.

This is one of the few print methods that does not throw an exception.

 o print
 public static void print(PrintWriter out,
                          ESEQ eseq) throws Exception
Print an ESEQ. Since straight line IRTs should not have ESEQs, this should never be called. Nonetheless, it is included for safety.

Throws: Exception
If it's ever called
 o print
 public static void print(PrintWriter out,
                          MEM mem) throws Exception
Print a memory reference.

Throws: Exception
When the subreference is invalid or the whole thing is null.
 o print
 public static void print(PrintWriter out,
                          NAME name) throws Exception
Print a label used as part of an argument.

Throws: Exception
If the label is unspecified.
 o print
 public static void print(PrintWriter out,
                          TEMP temp) throws Exception
Print a temporary.

Throws: Exception
If the temporary is unspecified.
 o print
 public static void print(PrintWriter out,
                          Stm stm) throws Exception
Print a statement. This method figures out which related method to call, depending on which type of statement it is.

Throws: Exception
If there's a problem printing the specific type of statement.
 o print
 public static void print(PrintWriter out,
                          StmList statements) throws Exception
Print a list of statements.

Throws: Exception
If there are problems with the individual statements.
 o print
 public static void print(PrintWriter out,
                          CJUMP cjump) throws Exception
Print a conditional jump. Note that the second label for the conditional jump is not printed.

Throws: Exception
If the operator is invalid or one of the arguments is incorrect.
 o print
 public static void print(PrintWriter out,
                          EXP exp) throws Exception
Print an expression instruction.

Throws: Exception
If it's an invalid type of subexpression or there's a problem printing the subexpression.
 o print
 public static void print(PrintWriter out,
                          JUMP jump) throws Exception
Print a JUMP instruction.

Throws: Exception
If one of the parts of the jump is invalid.
 o print
 public static void print(PrintWriter out,
                          LABEL label) throws Exception
Print a label instruction.

Throws: Exception
If the label is unspecified.
 o print
 public static void print(PrintWriter out,
                          MOVE move) throws Exception
Print a move instruction.

Throws: Exception
If there's an error in one of the arguments.
 o print
 public static void print(PrintWriter out,
                          SEQ seq) throws Exception
Print a sequence of instructions. This should never be called, as all the SEQ nodes in a tree should have been removed.

Throws: Exception
If some element of the sequence is erroneous or if it's called at all.
 o print
 public static void print(PrintWriter out,
                          STRING string)
Print a string declaration.

Nope. No exceptions.


All Packages  Class Hierarchy  This Package  Previous  Next  Index