01: /**************************************************************************/
02: /* N I C E */
03: /* A high-level object-oriented research language */
04: /* (c) Daniel Bonniot 2000 */
05: /* */
06: /* This program is free software; you can redistribute it and/or modify */
07: /* it under the terms of the GNU General Public License as published by */
08: /* the Free Software Foundation; either version 2 of the License, or */
09: /* (at your option) any later version. */
10: /* */
11: /**************************************************************************/package regtest.basic;
12:
13: import gnu.expr.*;
14: import gnu.bytecode.*;
15:
16: /**
17: Taken from nice.lang.inline, to test inlined methods.
18:
19: Just compiles its argument, producing no bytecode itself.
20: */
21:
22: public class Nop extends gnu.mapping.Procedure1 implements Inlineable {
23: public static Nop create(String param) {
24: return nop;
25: }
26:
27: private static Nop nop = new Nop();
28:
29: public void compile(ApplyExp exp, Compilation comp, Target target) {
30: exp.getArgs()[0].compile(comp, target);
31: }
32:
33: public gnu.bytecode.Type getReturnType(Expression[] args) {
34: return args[0].getType();
35: }
36:
37: public Object apply1(Object arg1) {
38: return arg1;
39: }
40: }
|