01: package kawa.standard;
02:
03: import kawa.lang.*;
04: import gnu.expr.*;
05: import gnu.lists.*;
06: import gnu.bytecode.*;
07:
08: public class module_implements extends Syntax {
09: public static final module_implements module_implements = new module_implements();
10: static {
11: module_implements .setName("module-implements");
12: }
13:
14: public Expression rewriteForm(Pair form, Translator tr) {
15: Object args = form.cdr;
16: int len = LList.listLength(args, false);
17: if (len < 0)
18: return tr.syntaxError("improper argument list for "
19: + getName());
20: ClassType[] interfaces = new ClassType[len];
21: for (int i = 0; i < len; i++) {
22: Pair pair = (Pair) args;
23: interfaces[i] = (ClassType) tr.exp2Type(pair);
24: args = pair.cdr;
25: }
26: ModuleExp module = tr.getModule();
27: module.setInterfaces(interfaces);
28: module.setFlag(ModuleExp.SUPERTYPE_SPECIFIED);
29: return QuoteExp.voidExp;
30: }
31: }
|