main scan.sats
 1staload  "libats/SATS/stringbuf.sats"
 2
 3vtypedef scanner = @{
 4    file = FILEref,
 5    buf  = stringbuf,
 6    cur  = int,
 7    line = int,
 8    col  = int
 9}
10
11(* each one carries the scanner position, var needs the var name *)
12datavtype tok = 
13    | TOKrule  of (int, int) 
14    | TOKbuild of (int, int) 
15    | TOKvar   of (Strptr1, int, int) 
16    | TOKeof   of (int, int) 
17
18datavtype stringpart =
19    | Literal  of Strptr1
20    | Variable of Strptr1
21
22fun next       (s: &scanner): void 
23fun scanname   (s: &scanner): Strptr1
24fun skipspace  (s: &scanner): void
25fun mktok      (text: Strptr1,
26                line: int,
27                col:  int): tok 
28fun scanchar   (s: &scanner, wanted: int): void 
29fun scanindent (s: &scanner): bool
30fun scankeyword(s: &scanner): tok
31fun scanvalue  (s: &scanner): List0_vt(stringpart)
32fun scanpath  (s: &scanner): Strptr1
33