Class TryCatch

java.lang.Object
EDU.purdue.cs.bloat.editor.TryCatch

public class TryCatch extends Object
TryCatch 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.
  • Constructor Details

    • 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 Details

    • 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 String toString()
      Overrides:
      toString in class Object