cetus.hir
Class IfStatement
java.lang.Object
cetus.hir.Statement
cetus.hir.IfStatement
- All Implemented Interfaces:
- Annotatable, Printable, Traversable, java.lang.Cloneable
public class IfStatement
- extends Statement
| Methods inherited from class cetus.hir.Statement |
annotate, annotateAfter, annotateBefore, annotationToString, clone, containsAnnotation, detach, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getChildren, getParent, getProcedure, print, removeAnnotations, removeAnnotations, removeChild, setChild, setLineNumber, setParent, setPrintMethod, swapWith, toAnnotatedString, verify, where |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
IfStatement
public IfStatement(Expression condition,
Statement true_clause)
- Create an if statement that has no else clause.
- Parameters:
condition - The condition tested by the statement.true_clause - The code to execute if the condition is true.
IfStatement
public IfStatement(Expression condition,
Statement true_clause,
Statement false_clause)
- Create an if statement that has an else clause.
- Parameters:
condition - The condition tested by the statement.true_clause - The code to execute if the condition is true.false_clause - The code to execute if the condition is false.
defaultPrint
public static void defaultPrint(IfStatement stmt,
java.io.OutputStream stream)
- Prints a break statement to a stream.
- Parameters:
stmt - The statement to print.stream - The stream on which to print the statement.
toString
public java.lang.String toString()
- Description copied from class:
Statement
- Returns a string representation of this statement; every child class
should implement this method.
- Specified by:
toString in class Statement
getControlExpression
public Expression getControlExpression()
setControlExpression
public void setControlExpression(Expression cond)
getThenStatement
public Statement getThenStatement()
setThenStatement
public void setThenStatement(Statement stmt)
getElseStatement
public Statement getElseStatement()
setElseStatement
public void setElseStatement(Statement stmt)
setClassPrintMethod
public static void setClassPrintMethod(java.lang.reflect.Method m)
- Overrides the class print method, so that all subsequently
created objects will use the supplied method.
- Parameters:
m - The new print method.