summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-03-24 16:41:34 +0000
committerpaltherr <paltherr@epfl.ch>2003-03-24 16:41:34 +0000
commit856b1b4355b0540fc896d9f2729579a96675c2ab (patch)
tree32c79c7b5c01088d9b69e5ec516fafd3439a68a6
parente0cfd0011b1694618890baa4dd5fb51a07ebef8b (diff)
downloadscala-856b1b4355b0540fc896d9f2729579a96675c2ab.tar.gz
scala-856b1b4355b0540fc896d9f2729579a96675c2ab.tar.bz2
scala-856b1b4355b0540fc896d9f2729579a96675c2ab.zip
- Removed class SymbolWriter
-rw-r--r--sources/scala/tools/scalai/Compiler.java20
-rw-r--r--sources/scala/tools/scalai/Interpreter.java2
-rw-r--r--sources/scala/tools/scalai/SymbolWriter.java42
3 files changed, 3 insertions, 61 deletions
diff --git a/sources/scala/tools/scalai/Compiler.java b/sources/scala/tools/scalai/Compiler.java
index 0ea8e67c6d..f25fe10c6e 100644
--- a/sources/scala/tools/scalai/Compiler.java
+++ b/sources/scala/tools/scalai/Compiler.java
@@ -36,24 +36,17 @@ public class Compiler {
//########################################################################
- private final Symbol WRITER;
- private final Symbol WRITER_WRITE;
- private final Type SYMBOL_TYPE;
-
- //########################################################################
-
private final Global global;
private final Definitions definitions;
private final Constants constants;
private final ClassLoader loader;
private final Environment environment;
private final Evaluator evaluator; // !!! remove
- private final SymbolWriter writer;
private final Map any_methods;
private boolean interactive;
- public Compiler(Global global, Evaluator evaluator, SymbolWriter writer) {
+ public Compiler(Global global, Evaluator evaluator) {
this.global = global;
this.definitions = global.definitions;
this.constants = new Constants();
@@ -62,17 +55,8 @@ public class Compiler {
JavaMirror mirror = new JavaMirror(definitions, loader);
this.environment = new Environment(this, mirror);
this.evaluator = evaluator;
- this.writer = writer;
this.any_methods = new HashMap();
- Name WRITER_N = Name.fromString(SymbolWriter.class.getName());
- Type WRITER_TYPE = definitions.getType(WRITER_N);
- this.WRITER = newGlobalVariable(WRITER_TYPE, writer);
- this.WRITER_WRITE = WRITER_TYPE.lookup(Name.fromString("write2"));
-
- Name SYMBOL_N = Name.fromString(Symbol.class.getName());
- this.SYMBOL_TYPE = definitions.getType(SYMBOL_N);
-
environment.insertFunction(definitions.STRING_PLUS_ANY, Function.StringPlus); // !!!
// !!! ANY_PLUS_STRING is commented out in definitions
// !!! environment.insertFunction(definitions.ANY_PLUS_STRING, Function.StringPlus); // !!!
@@ -336,7 +320,7 @@ public class Compiler {
case ValDef(_, _, _, Tree body):
assert symbol.isModule() : Debug.show(symbol);
environment.insertVariable(symbol, Variable.Module(new CodePromise(new ModuleBuilder(this, symbol, body)), null));
- if (interactive && writer != null &&
+ if (interactive &&
symbol.name.toString().startsWith(global.CONSOLE_S)) // !!!
{
global.prevPhase();
diff --git a/sources/scala/tools/scalai/Interpreter.java b/sources/scala/tools/scalai/Interpreter.java
index e5cfcc0702..b9ed4358e2 100644
--- a/sources/scala/tools/scalai/Interpreter.java
+++ b/sources/scala/tools/scalai/Interpreter.java
@@ -101,7 +101,7 @@ public class Interpreter {
this.writer = writer;
this.matcher = matcher();
this.evaluator = new Evaluator();
- this.compiler = new Compiler(global,evaluator,new SymbolWriter(writer)); // !!!
+ this.compiler = new Compiler(global, evaluator); // !!!
this.lfiles = new String[0];
this.ufiles = new String[0];
}
diff --git a/sources/scala/tools/scalai/SymbolWriter.java b/sources/scala/tools/scalai/SymbolWriter.java
deleted file mode 100644
index 3839582c55..0000000000
--- a/sources/scala/tools/scalai/SymbolWriter.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/* ____ ____ ____ ____ ______ *\
-** / __// __ \/ __// __ \/ ____/ SOcos COmpiles Scala **
-** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002, LAMP/EPFL **
-** /_____/\____/\___/\____/____/ **
-\* */
-
-// $OldId: SymbolWriter.java,v 1.1 2002/07/12 16:59:14 paltherr Exp $
-// $Id$
-
-package scalai;
-
-import java.io.PrintWriter;
-
-import scalac.symtab.Symbol;
-
-public class SymbolWriter {
-
- //########################################################################
- // Private Fields
-
- public final PrintWriter writer;
-
- //########################################################################
- // Public Constructors
-
- public SymbolWriter(PrintWriter writer) {
- this.writer = writer;
- }
-
- //########################################################################
- // Public Methods
-
- public void write1(Symbol symbol) {
- writer.println(symbol.defString());
- }
-
- public void write2(Symbol symbol, Object value) {
- writer.println(symbol.defString() + " = " + value);
- }
-
- //########################################################################
-}