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 nice.lang.inline;
12:
13: import gnu.expr.*;
14: import gnu.bytecode.*;
15:
16: /**
17: Just compiles its argument, producing no bytecode itself.
18:
19: @version $Date: 2001/04/18 12:04:22 $
20: @author Daniel Bonniot
21: */
22:
23: public class Nop extends gnu.mapping.Procedure1 implements Inlineable {
24: public static Nop create(String param) {
25: return nop;
26: }
27:
28: private static Nop nop = new Nop();
29:
30: public void compile(ApplyExp exp, Compilation comp, Target target) {
31: exp.getArgs()[0].compile(comp, target);
32: }
33:
34: public gnu.bytecode.Type getReturnType(Expression[] args) {
35: return args[0].getType();
36: }
37:
38: public Object apply1(Object arg1) {
39: return arg1;
40: }
41: }
|