import java.io.*;

public class jsplit {


public static void main(String arg[]) {
String fn=arg[0];
try{
DataInput f0=new DataInputStream(new FileInputStream(fn));
DataOutput batfile=new DataOutputStream(new FileOutputStream("COMP.BAT"));
   /*The file COMP.BAT will be a batch file that will compile
     all of these files*/

System.out.println("input file:"+fn);
DataOutput f2=null;


String textline;
textline=f0.readLine();
 boolean fileopen=false;
 char eofchar=(char)(26);
while (textline!=null) {
   int z=textline.indexOf(eofchar);
   if (z>0) {System.out.println("|"+textline+"|   "+z);
   textline=textline.substring(0,z);
           } /*remove end of file character*/
   int k=textline.indexOf("*:=0) {  /*this line has the start of a program*/
       textline=textline.substring(k+29);
       int k2=textline.indexOf("****");
       textline=textline.substring(1,k2);
       System.out.println("output file: |"+textline+"|");
       batfile.writeBytes("javac "+textline+" \r\n");
       f2=new DataOutputStream(new FileOutputStream(textline));
       fileopen=true;
       textline=f0.readLine();
            }
    if (fileopen) {f2.writeBytes(textline+ "\r\n");}
    textline=f0.readLine();
       /* System.out.println("           "+textline);*/

} /*end while*/

} catch (Exception ex) {String err=ex.toString();
                        System.out.println(err);}

} /*end main*/
} /*end class javasplit*/