pasn.perq 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. (*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. %
  3. % PASCAL BASED MINI-LISP
  4. %
  5. % File: PASN.RED - Trailer File
  6. % ChangeDate: 5:39am Saturday, 26 September 1981
  7. % By: M. L. Griss
  8. % Add Hooks for CATCH/THROW
  9. %
  10. % All RIGHTS RESERVED
  11. % COPYRIGHT (C) - 1981 - M. L. GRISS
  12. % Computer Science Department
  13. % University of Utah
  14. %
  15. % Do Not distribute with out written consent of M. L. Griss
  16. %
  17. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*)
  18. (* pasN.PAS ---- the last file to be appended, close CATCH, do init *)
  19. BEGIN (* Body of Catch *)
  20. IF initphase=0 THEN (* Kludge to get into scope of CATCH *)
  21. BEGIN init; initphase := 1; firstp; END
  22. ELSE BEGIN
  23. initphase := initphase + 1;
  24. idspace[xthrowing].val := nilref;
  25. catch_stk:=st; (* Capture Stack *)
  26. catch_bstk:=idspace[xbstack].val; (* Capture Bstack *)
  27. xeval;
  28. initphase := initphase - 1;
  29. (* Return Point *)
  30. IF idspace[xthrowing].val <> nilref
  31. THEN BEGIN
  32. st:=catch_stk;
  33. r[2]:=catch_bstk;
  34. xunbindto; (* return value, old stack *)
  35. END;
  36. END
  37. END (* catch *);
  38. BEGIN (* Top Level *)
  39. initphase := 0;
  40. r[1] := nilref;
  41. Xcatch;
  42. writeln('halt after top catch');
  43. exit(pas0);
  44. end.