tuned signature -- facilitate experimentation with other processes;
authorwenzelm
Tue, 01 Oct 2013 12:53:24 +0200
changeset 54005 132640f4c453
parent 54004 e13b0c88c798
child 54006 9fe1bd54d437
tuned signature -- facilitate experimentation with other processes;
src/Pure/System/isabelle_process.scala
src/Pure/System/system_channel.scala
--- a/src/Pure/System/isabelle_process.scala	Mon Sep 30 22:01:46 2013 +0900
+++ b/src/Pure/System/isabelle_process.scala	Tue Oct 01 12:53:24 2013 +0200
@@ -64,7 +64,7 @@
 
 class Isabelle_Process(
     receiver: Isabelle_Process.Message => Unit = Console.println(_),
-    args: List[String] = Nil)
+    arguments: List[String] = Nil)
 {
   import Isabelle_Process._
 
@@ -126,13 +126,14 @@
 
   /** process manager **/
 
+  def command_line(channel: System_Channel, args: List[String]): List[String] =
+    Isabelle_System.getenv_strict("ISABELLE_PROCESS") :: (channel.isabelle_args ::: args)
+
   private val system_channel = System_Channel()
 
   private val process =
     try {
-      val cmdline =
-        Isabelle_System.getenv_strict("ISABELLE_PROCESS") ::
-          (system_channel.isabelle_args ::: args)
+      val cmdline = command_line(system_channel, arguments)
       new Isabelle_System.Managed_Process(null, null, false, cmdline: _*)
     }
     catch { case e: IOException => system_channel.accepted(); throw(e) }
--- a/src/Pure/System/system_channel.scala	Mon Sep 30 22:01:46 2013 +0900
+++ b/src/Pure/System/system_channel.scala	Tue Oct 01 12:53:24 2013 +0200
@@ -21,6 +21,7 @@
 
 abstract class System_Channel
 {
+  def params: List[String]
   def isabelle_args: List[String]
   def rendezvous(): (OutputStream, InputStream)
   def accepted(): Unit
@@ -57,6 +58,8 @@
   private val fifo1 = mk_fifo()
   private val fifo2 = mk_fifo()
 
+  def params: List[String] = List(fifo1, fifo2)
+
   val isabelle_args: List[String] = List ("-W", fifo1 + ":" + fifo2)
 
   def rendezvous(): (OutputStream, InputStream) =
@@ -76,6 +79,8 @@
 {
   private val server = new ServerSocket(0, 2, InetAddress.getByName("127.0.0.1"))
 
+  def params: List[String] = List("127.0.0.1", server.getLocalPort.toString)
+
   def isabelle_args: List[String] = List("-T", "127.0.0.1:" + server.getLocalPort)
 
   def rendezvous(): (OutputStream, InputStream) =