modern-compiler-ml/tiger/chap2/driver.sml
jmug 33d8bac511 Add the tiger source code bundle from the book site
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2024-12-18 15:18:45 -08:00

17 lines
357 B
Standard ML

structure Parse =
struct
fun parse filename =
let val file = TextIO.openIn filename
fun get _ = TextIO.input file
val lexer = Mlex.makeLexer get
fun do_it() =
let val t = lexer()
in print t; print "\n";
if substring(t,0,3)="EOF" then () else do_it()
end
in do_it();
TextIO.closeIn file
end
end