home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / src / test / mosmlyac / test3main.sml < prev   
Encoding:
Text File  |  1997-08-18  |  474 b   |  17 lines  |  [TEXT/R*ch]

  1.  
  2. fun createLexerStream (is : BasicIO.instream) =
  3.     Lexing.createLexer (fn buff => fn n => Nonstdio.buff_input is buff 0 n);
  4.  
  5. fun readlam filename = 
  6.     let open BasicIO Nonstdio 
  7.     val is     = open_in filename
  8.     val lexbuf = createLexerStream is
  9.     val lam    = test3.Lambda test3lex.Token lexbuf
  10.     val env0   = fn s => raise Fail ("Unknown identifier: " ^ s)
  11.     in 
  12.     lam env0
  13.     before close_in is 
  14.     end
  15.     handle SysErr _ => raise Fail ("Cannot read file " ^ filename)
  16.  
  17.