Package EDU.purdue.cs.bloat.editor
Class TryCatch
- java.lang.Object
-
- EDU.purdue.cs.bloat.editor.TryCatch
-
public class TryCatch extends java.lang.ObjectTryCatch holds the labels for the start and end of a protected block and the beginning of a catch block and the type of the exception to catch.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Labelend()Get the end label of the protected block.Labelhandler()Get the start label of the catch block.voidsetHandler(Label handler)Set the start label of the catch block.Labelstart()Get the start label of the protected block.java.lang.StringtoString()Typetype()Get the type of the exception to catch.
-
-
-
Constructor Detail
-
TryCatch
public TryCatch(Label start, Label end, Label handler, Type type)
Constructor.- Parameters:
start- The start label of the protected block.end- The label of the instruction after the end of the protected block.handler- The start label of the exception handler.type- The type of exception to catch.
-
-
Method Detail
-
start
public Label start()
Get the start label of the protected block.- Returns:
- The start label.
-
end
public Label end()
Get the end label of the protected block.- Returns:
- The end label.
-
handler
public Label handler()
Get the start label of the catch block.- Returns:
- The handler label.
-
setHandler
public void setHandler(Label handler)
Set the start label of the catch block.
-
type
public Type type()
Get the type of the exception to catch.- Returns:
- The type of the exception to catch.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-