blob: 37dc89f5e36180b7b8a05e2e9cdea324918a2744 (
plain) (
blame)
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
49
50
51
52
53
54
55
56
57
|
/* ____ ____ ____ ____ ______ *\
** / __// __ \/ __// __ \/ ____/ SOcos COmpiles Scala **
** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002, LAMP/EPFL **
** /_____/\____/\___/\____/____/ **
\* */
// $OldId: ScalaFunction.java,v 1.9 2002/07/03 16:08:00 paltherr Exp $
// $Id$
package scala.tools.scalai;
import scala.tools.util.SourceFile;
import scalac.ast.Tree;
import scalac.ast.Tree.ValDef;
import scalac.symtab.Symbol;
import scalac.util.Debug;
public class ScalaFunction extends CodeGenerator {
//########################################################################
// Private Fields
private final Compiler compiler;
private final SourceFile source;
private final Symbol symbol;
private final ValDef[] params;
private final Tree body;
//########################################################################
// Public Constructors
public ScalaFunction(Compiler compiler, SourceFile source, Symbol symbol, ValDef[] params, Tree body) {
this.compiler = compiler;
this.source = source;
this.symbol = symbol;
this.params = params;
this.body = body;
}
//########################################################################
// Public Methods - CodeGenerator interface
public CodeContainer generate() {
return compiler.compile(source, symbol, body, Tree.symbolOf(params));
}
//########################################################################
// Public Methods - Object interface
// !!!
public String toString() {
return "ScalaFunction(" + Debug.show(symbol) + ")";
}
//########################################################################
}
|