Package jminusminus

Class CLException

java.lang.Object
jminusminus.CLException

class CLException extends Object
Representation of an exception handler.
  • Field Details

    • startLabel

      public String startLabel
      The exception handler is active from this instruction in the code section of the current method being added to ...
    • endLabel

      public String endLabel
      this instruction. Formally, the handler is active while the program counter is within the interval [startPC, endPC).
    • handlerLabel

      public String handlerLabel
      Instruction after this label is first instruction of the handler.
    • catchType

      public String catchType
      The class of exceptions that this exception handler is designated to catch.
    • startPC

      public int startPC
      startLabel is resolved to this value.
    • endPC

      public int endPC
      endLabel is resolved to this value.
    • handlerPC

      public int handlerPC
      handlerLabel is resolved to this value.
  • Constructor Details

    • CLException

      public CLException(String startLabel, String endLabel, String handlerLabel, String catchType)
      Constructs a CLException object.
      Parameters:
      startLabel - the exception handler is active from the instruction following this label in the code section of the current method being added.
      endLabel - to the instruction following this label. Formally, the handler is active while the program counter is within the interval [startLabel, endLabel).
      handlerLabel - the handler begins with instruction following this label.
      catchType - the exception type that this exception handler is designated to catch, as a fully qualified name in internal form.
  • Method Details

    • resolveLabels

      public boolean resolveLabels(Hashtable<String,Integer> labelToPC)
      Resolves the jump labels to the corresponding pc values using the given label to pc mapping. If unable to resolve a label, the corresponding pc is set to 0.
      Parameters:
      labelToPC - label to pc mapping.
      Returns:
      true if all labels were resolved successfully, and false otherwise.