01: package gnu.jemacs.lang;
02:
03: import gnu.expr.*;
04: import kawa.lang.*;
05: import gnu.lists.*;
06: import gnu.mapping.*;
07:
08: /** Implement the ELisp `while' syntax form. */
09:
10: public class While extends Syntax {
11: static kawa.standard.begin begin = new kawa.standard.begin();
12:
13: public Expression rewriteForm(Pair form, Translator tr) {
14: Object obj = form.cdr;
15: if (!(obj instanceof Pair))
16: return tr.syntaxError("missing arguments for while");
17: tr.mustCompileHere();
18: form = (Pair) obj;
19: return Expression.makeWhile(form.car,
20: new Pair(begin, form.cdr), tr);
21: }
22: }
|