summaryrefslogtreecommitdiff
path: root/sources/scalac/Main.java
blob: 00f21908b783902aa1b5df43263401676e22631d (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
/*     ____ ____  ____ ____  ______                                     *\
**    / __// __ \/ __// __ \/ ____/    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") + " bootstrap"; // !!!
    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 CompilerPhases());
        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);
    }
}