File: Nop.java

package info (click to toggle)
nice 0.9.13-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 7,284 kB
  • ctags: 6,893
  • sloc: java: 42,767; xml: 3,508; lisp: 1,084; sh: 742; makefile: 670; cpp: 21; awk: 3
file content (48 lines) | stat: -rw-r--r-- 1,514 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**************************************************************************/
/*                                N I C E                                 */
/*             A high-level object-oriented research language             */
/*                        (c) Daniel Bonniot 2000                         */
/*                                                                        */
/*  This program is free software; you can redistribute it and/or modify  */
/*  it under the terms of the GNU General Public License as published by  */
/*  the Free Software Foundation; either version 2 of the License, or     */
/*  (at your option) any later version.                                   */
/*                                                                        */
/**************************************************************************/

package regtest.basic;

import gnu.expr.*;
import gnu.bytecode.*;

/**
   Taken from nice.lang.inline, to test inlined methods.

   Just compiles its argument, producing no bytecode itself.
 */

public class Nop 
extends gnu.mapping.Procedure1 implements Inlineable
{
  public static Nop create(String param)
  {
    return nop;
  }
  
  private static Nop nop = new Nop();
  
  public void compile (ApplyExp exp, Compilation comp, Target target)
  {
    exp.getArgs()[0].compile(comp, target);
  }
  
  public gnu.bytecode.Type getReturnType (Expression[] args)
  {
    return args[0].getType();
  }

  public Object apply1 (Object arg1)
  {
    return arg1;
  }
}