open TextIO; use "exp.sml"; exception parseError; fun cat fileName = let fun f inS = (* returns a list of char *) if endOfStream inS then (closeIn inS; []) else hd(explode(inputN(inS, 1))) :: (f inS) in f (openIn fileName) end and run fileName = case parse (lexical (cat fileName)) of (expErr m) => raise parseError | e => e (* LA, Dept Comp Sci, Monash, 1988 & CSSE, Monash .au, 2005 *)