calling a seperate program and supplying command line args.

Sigbjorn Finne sof@galois.com
Thu, 8 Aug 2002 15:56:35 -0700


This is a multi-part message in MIME format.

------=_NextPart_000_01AF_01C23EF4.2C418930
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi there,

in H98:

import System
....
   exCode <- System.system "java-parser -O -c input-file -o output-file"
   ...
   ls <- readFile "output-file"


--sigbjorn

  ----- Original Message -----=20
  From: Jason Smith=20
  To: glasgow-haskell-users@haskell.org=20
  Sent: Thursday, August 08, 2002 15:24
  Subject: calling a seperate program and supplying command line args.


  How to basically?

  I've not had much luck finding much in the way of doc's in ghc on how =
to do this?...basically I have a compiler in haskell and I want to call =
a parser which is written in Java.  The parser is a .NET binary, it =
spits out a text file containing the parse tree which I then suck up and =
do the usual compiler things with.  I need to supply the java parser =
command line args i.e the file to parse etc..=20

  Thanks heaps
  Jason.

------=_NextPart_000_01AF_01C23EF4.2C418930
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2716.2200" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi there,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>in H98:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>import System</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>....</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; exCode &lt;- System.system =

"java-parser -O -c input-file -o output-file"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; ...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;ls &lt;- readFile=20
"output-file"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>--sigbjorn</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A title=3Djns28@student.canterbury.ac.nz=20
  href=3D"mailto:jns28@student.canterbury.ac.nz">Jason Smith</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A=20
  title=3Dglasgow-haskell-users@haskell.org=20
  =
href=3D"mailto:glasgow-haskell-users@haskell.org">glasgow-haskell-users@h=
askell.org</A>=20
  </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Thursday, August 08, 2002 =

  15:24</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> calling a seperate =
program and=20
  supplying command line args.</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=3DArial size=3D2>How to basically?</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>I've not had much luck finding much =
in the way of=20
  doc's in ghc on how to do this?...basically I have a compiler in =
haskell and I=20
  want to call a parser which is written in Java.&nbsp; The parser is a =
.NET=20
  binary, it spits out a text file containing the&nbsp;parse tree =
which&nbsp;I=20
  then suck up and do the usual compiler things with.&nbsp; I need to =
supply the=20
  java parser command line args i.e the file to parse etc.. =
</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>Thanks heaps</FONT></DIV>
  <DIV><FONT face=3DArial =
size=3D2>Jason.</FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_01AF_01C23EF4.2C418930--