Add the tiger source code bundle from the book site
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
This commit is contained in:
parent
915660c8a7
commit
33d8bac511
87 changed files with 3252 additions and 0 deletions
17
tiger/chap2/driver.sml
Normal file
17
tiger/chap2/driver.sml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue