CSc 520 - Principles of Programming Languages
30 : Control Structures -- Exceptions

Christian Collberg

Department of Computer Science

University of Arizona

1 Exception Handling

2 Exception Handling...


Exceptions in PL/I


3 So, what happens afterwards?

4 Exceptions in PL/I

5 Exceptions in PL/I...


Exceptions in Modula-3


6 Exceptions in Modula-3


1#1

7 Exceptions in Modula-3...



4#4

8 Exceptions in Modula-3...


5#5

9 Exceptions in Modula-3...


6#6


Exceptions in Java


10 Exceptions as classes

11 Exception hierarchy

class Throwable {}
   class Exception extends Throwable {}
      class InterruptedException extends Exception {}
      class RuntimeException extends Exception {}
         class ArithmeticException extends RuntimeException {}
         class NullPointerException extends RuntimeException {}
         class ClassCastException extends RuntimeException {}
   class Error extends Throwable {}
      class ThreadDeath extends Error {}

12 Catching an exception

13 The finally-clause


Implementing exceptions


14 Implementation

15 The Range Table

16 The Range Table...

RangeTable

17 Unwinding the Stack (Locate)

18 Unwinding the Stack (Locate)...

Locate

19 Unwinding the Stack (Unwind)

20 Unwinding the Stack (Unwind)...

Unwind

21 The Exception Handler

 
8#8
 9#9  
10#10

22 The Algorithm


11#11

23 Example -- Explanation of source code

24 Example

12#12

25 Example -- Explanation of Actions


Exceptions in C


26 setjmp/longjmp

27 setjmp/longjmp...

28 Readings and References

29 Summary



Christian Collberg 2008-04-02