src/Pure/System/main.scala
author wenzelm
Sun, 22 Apr 2012 15:50:29 +0200
changeset 47663 20e0865ae9e7
child 47664 3f9681ca7040
permissions -rw-r--r--
default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
47663
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
     1
/*  Title:      Pure/System/main.scala
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
     2
    Author:     Makarius
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
     3
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
     4
Default Isabelle application wrapper.
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
     5
*/
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
     6
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
     7
package isabelle
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
     8
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
     9
import scala.swing.TextArea
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    10
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    11
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    12
object Main
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    13
{
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    14
  def main(args: Array[String]) =
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    15
  {
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    16
    val (out, rc) =
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    17
      try {
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    18
        Platform.init_laf()
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    19
        Isabelle_System.init()
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    20
        Isabelle_System.isabelle_tool("jedit", args: _*)
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    21
      }
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    22
      catch { case exn: Throwable => (Exn.message(exn), 2) }
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    23
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    24
    if (rc != 0) {
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    25
      val text = new TextArea(out)
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    26
      text.editable = false
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    27
      Library.dialog(null, "Isabelle", "Isabelle output", text)
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    28
    }
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    29
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    30
    System.exit(rc)
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    31
  }
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    32
}
20e0865ae9e7 default Isabelle application wrapper -- JVM entry point for Isabelle.exe;
wenzelm
parents:
diff changeset
    33