01: package kawa.standard;
02:
03: import kawa.lang.*;
04: import gnu.mapping.*;
05: import gnu.expr.*;
06: import gnu.lists.*;
07:
08: /**
09: * Implement the re-writer for the "begin" primitive.
10: * @author Per Bothner
11: */
12:
13: public class begin extends Syntax {
14: public static final begin begin = new begin();
15: static {
16: begin.setName("begin");
17: }
18:
19: public Expression rewrite(Object obj, Translator tr) {
20: return tr.rewrite_body(obj);
21: }
22:
23: public void scanForm(Pair st, ScopeExp defs, Translator tr) {
24: Object body = tr.scanBody(st.cdr, defs, true);
25: if (body != LList.Empty)
26: // Because rewrite to be called later, with whatever is left after
27: // removing declarations.
28: tr.formStack.add(Translator.makePair(st, st.car, body));
29: }
30: }
|