Package jminusminus
Class CLException
java.lang.Object
jminusminus.CLException
Representation of an exception handler.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe class of exceptions that this exception handler is designated to catch.this instruction.int
endLabel is resolved to this value.Instruction after this label is first instruction of the handler.int
handlerLabel is resolved to this value.The exception handler is active from this instruction in the code section of the current method being added to ...int
startLabel is resolved to this value. -
Constructor Summary
ConstructorsConstructorDescriptionCLException
(String startLabel, String endLabel, String handlerLabel, String catchType) Constructs a CLException object. -
Method Summary
Modifier and TypeMethodDescriptionboolean
resolveLabels
(Hashtable<String, Integer> labelToPC) Resolves the jump labels to the corresponding pc values using the given label to pc mapping.
-
Field Details
-
startLabel
The exception handler is active from this instruction in the code section of the current method being added to ... -
endLabel
this instruction. Formally, the handler is active while the program counter is within the interval [startPC, endPC). -
handlerLabel
Instruction after this label is first instruction of the handler. -
catchType
The class of exceptions that this exception handler is designated to catch. -
startPC
public int startPCstartLabel is resolved to this value. -
endPC
public int endPCendLabel is resolved to this value. -
handlerPC
public int handlerPChandlerLabel is resolved to this value.
-
-
Constructor Details
-
CLException
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
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.
-