summaryrefslogtreecommitdiff
path: root/sources/scalac/Main.java
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2003-02-13 14:41:36 +0000
committerMartin Odersky <odersky@gmail.com>2003-02-13 14:41:36 +0000
commit4177daab2f54bdb20c71f623296a8bb32616fd12 (patch)
tree23f08b43f3758e825d5965b336030603a65bbcf7 /sources/scalac/Main.java
parent33d6e170c97ca7b2f991896a0729941a7240b6d6 (diff)
downloadscala-4177daab2f54bdb20c71f623296a8bb32616fd12.tar.gz
scala-4177daab2f54bdb20c71f623296a8bb32616fd12.tar.bz2
scala-4177daab2f54bdb20c71f623296a8bb32616fd12.zip
Initial version.
Diffstat (limited to 'sources/scalac/Main.java')
-rw-r--r--sources/scalac/Main.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/sources/scalac/Main.java b/sources/scalac/Main.java
new file mode 100644
index 0000000000..2c0dc78140
--- /dev/null
+++ b/sources/scalac/Main.java
@@ -0,0 +1,38 @@
+/* ____ ____ ____ ____ ______ *\
+** / __// __ \/ __// __ \/ ____/ SOcos COmpiles Scala **
+** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002, LAMP/EPFL **
+** /_____/\____/\___/\____/____/ **
+** **
+** $Id$
+\* */
+
+package scalac;
+
+import scalac.util.Reporter;
+
+/** The main class for SoCoS, a compiler for the programming
+ * language Scala.
+ *
+ * @author Matthias Zenger
+ * @version 1.0
+ */
+public class Main {
+
+ public static final String PRODUCT =
+ System.getProperty("scala.product", "socos");
+ public static final String VERSION =
+ System.getProperty("scala.version", "unknown version");
+
+ public static void main(String[] args) {
+ Reporter reporter = new Reporter();
+ CompilerCommand command = new CompilerCommand(
+ PRODUCT, VERSION, reporter, new PhaseRepository());
+ if (command.parse(args) && command.files.list.size() > 0) {
+ Global global = new Global(command);
+ global.compile(command.files.toArray(), false);
+ global.stop("total");
+ global.reporter.printSummary();
+ }
+ System.exit((reporter.errors() > 0) ? -1 : 0);
+ }
+}