01: package kawa.standard;
02:
03: import kawa.lang.*;
04: import gnu.lists.*;
05: import gnu.expr.*;
06:
07: /** Implement the standard Scheme "syntax-rules" form. */
08:
09: public class syntax_rules extends Syntax {
10: public static final syntax_rules syntax_rules = new syntax_rules();
11: static {
12: syntax_rules.setName("syntax-rules");
13: }
14:
15: public Expression rewriteForm(Pair form, Translator tr) {
16: Pair pair = (Pair) form.cdr;
17:
18: Object[] literal_identifiers = SyntaxPattern.getLiteralsList(
19: pair.car, null, tr);
20: SyntaxRules rules = new SyntaxRules(literal_identifiers,
21: pair.cdr, tr);
22: return new QuoteExp(rules);
23: }
24: }
|