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
-
Print()
-
-
print(PrintWriter, BINOP)
- Print a binary operator.
-
print(PrintWriter, BUILTIN)
- Print a call to a builtin operator.
-
print(PrintWriter, CALL)
- Print a function call.
-
print(PrintWriter, CJUMP)
- Print a conditional jump.
-
print(PrintWriter, CONST)
- Print a constant.
-
print(PrintWriter, ESEQ)
- Print an ESEQ.
-
print(PrintWriter, EXP)
- Print an expression instruction.
-
print(PrintWriter, Exp)
- Print any expression.
-
print(PrintWriter, ExpList)
- Print a list of expressions.
-
print(PrintWriter, JUMP)
- Print a JUMP instruction.
-
print(PrintWriter, LABEL)
- Print a label instruction.
-
print(PrintWriter, Label)
- Print a label.
-
print(PrintWriter, LabelList)
- Print a list of labels.
-
print(PrintWriter, MEM)
- Print a memory reference.
-
print(PrintWriter, MOVE)
- Print a move instruction.
-
print(PrintWriter, NAME)
- Print a label used as part of an argument.
-
print(PrintWriter, SEQ)
- Print a sequence of instructions.
-
print(PrintWriter, Stm)
- Print a statement.
-
print(PrintWriter, StmList)
- Print a list of statements.
-
print(PrintWriter, STRING)
- Print a string declaration.
-
print(PrintWriter, TEMP)
- Print a temporary.
-
print(PrintWriter, Temp)
- Print a temporary.
-
print(PrintWriter, TempList)
- Print a list of temporaries.
Print
public Print()
print
public static void print(PrintWriter out,
Label label) throws Exception
- Print a label.
- Throws: Exception
- If the label is undefined.
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.
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.
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.
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.
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.
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.
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.
print
public static void print(PrintWriter out,
CALL call) throws Exception
- Print a function call.
- Throws: Exception
- When one of the arguments is incorrect.
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.
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
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.
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.
print
public static void print(PrintWriter out,
TEMP temp) throws Exception
- Print a temporary.
- Throws: Exception
- If the temporary is unspecified.
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.
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.
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.
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.
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.
print
public static void print(PrintWriter out,
LABEL label) throws Exception
- Print a label instruction.
- Throws: Exception
- If the label is unspecified.
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.
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.
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