Import Upstream version 20180207
[hcoop/debian/mlton.git] / mlyacc / examples / fol / interface.sml
CommitLineData
7f918cf1
CE
1(* Externally visible aspects of the lexer and parser *)
2
3signature INTERFACE =
4sig
5
6type pos
7val line : pos ref
8val init_line : unit -> unit
9val next_line : unit -> unit
10val error : string * pos * pos -> unit
11
12type arg
13val nothing : arg
14
15end (* signature INTERFACE *)
16
17functor Interface () : INTERFACE =
18struct
19
20type pos = int
21val line = ref 0
22fun init_line () = (line := 1)
23fun next_line () = (line := !line + 1)
24fun error (errmsg,line:pos,_) =
25 TextIO.output(TextIO.stdOut,"Line " ^ (Int.toString line) ^ ": " ^ errmsg ^ "\n")
26
27type arg = unit
28
29val nothing = ()
30
31end (* functor INTERFACE *)