01: package gnu.commonlisp.lang;
02:
03: import kawa.lang.*;
04: import gnu.expr.Expression;
05: import gnu.expr.TryExp;
06: import gnu.lists.Pair;
07:
08: public class UnwindProtect extends Syntax {
09: public Expression rewrite(Object obj, Translator tr) {
10: if (!(obj instanceof Pair))
11: return tr.syntaxError("invalid syntax for unwind-protect");
12: Pair pair = (Pair) obj;
13: return new TryExp(tr.rewrite(pair.car), tr
14: .rewrite_body(pair.cdr));
15: }
16: }
|