# Changeset 6071efc

Ignore:
Timestamp:
Jun 16, 2021, 10:44:22 AM (8 months ago)
Branches:
jacob/cs343-translation, master, new-ast-unique-expr
Children:
edebbf7
Parents:
b51e389c
Message:

Andrew MMath: Update the first three chapters using Colby's comments.

Location:
doc/theses/andrew_beach_MMath
Files:
3 edited

### Legend:

Unmodified
 rb51e389c \subsection{Raise / Handle} An exception operation has two main parts: raise and handle. These terms are sometimes also known as throw and catch but this work uses These terms are sometimes known as throw and catch but this work uses throw/catch as a particular kind of raise/handle. These are the two parts that the user writes and may Only raises inside the guarded region and raising exceptions that match the label can be handled by a given handler. Different EHMs use different rules to pick a handler, if multiple handlers could be used such as best match" or first found". If multiple handlers could can handle an exception, EHMs will define a rule to pick one, such as best match" or first found". The @try@ statements of \Cpp, Java and Python are common examples. All three case when stack unwinding is involved. If a matching handler is not guarantied to be found, the EHM needs a If a matching handler is not guaranteed to be found, the EHM needs a different course of action for the case where no handler matches. This situation only occurs with unchecked exceptions as checked exceptions \subsection{Completion} After the handler has finished the entire exception operation has to complete After the handler has finished, the entire exception operation has to complete and continue executing somewhere else. This step is usually simple, both logically and in its implementation, as the installation of the handler Virtual types and casts are not part of \CFA's EHM nor are they required for any EHM. However, it is one of the best ways to support an exception hierachy However, it is one of the best ways to support an exception hierarchy is via a virtual hierarchy and dispatch system. There is a global \defaultResumptionHandler{} is polymorphic over all resumption exceptions and preforms a termination throw on the exception. The \defaultTerminationHandler{} can be overriden by providing a new The \defaultTerminationHandler{} can be overridden by providing a new function that is a better match. Two things can expose differences between these cases. One is the existance of multiple handlers on a single try statement. One is the existence of multiple handlers on a single try statement. A reraise skips all later handlers on this try statement but a conditional catch does not. implicitly skipped, with a conditional catch they are not. Still, they are equivalently powerful, both can be used two mimick the behaviour of the other, both can be used two mimic the behaviour of the other, as reraise can pack arbitrary code in the handler and conditional catches can put arbitrary code in the predicate. % I was struggling with a long explination about some simple solutions, % I was struggling with a long explanation about some simple solutions, % like repeating a condition on later handlers, and the general solution of % merging everything together. I don't think it is useful though unless its