pasn.pre 1.3 KB

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