signature STREAM = sig type fileId = int type fileOffset = int datatype pos = Pos of string * int * int type t exception EOF val Ppos: (pos, 'a, 'b) a1printer val getchar: t -> char option * t (* Will throw UngetcError, if applied at the beginning of the stream. * Can be always avoided, so is not provided in sig file *) val ungetc: t -> t val EOFpos: t -> pos * t val getSubstr: fileOffset -> fileOffset -> t -> string val getLine: t -> string option * t val getFname: t -> string (* both throw IO.Io *) val create: string -> t val createFromInstream: string -> TextIO.instream -> t val getOffset: t -> fileOffset val isFirstOnLine: t -> fileOffset -> bool val getPosRaw: fileOffset -> t -> pos * t val getPos: t -> pos * t val getPosAfterChar: t -> pos * t end