| 1 |
4 |
tbourke |
(* $Id: file_pos.sig 43 2008-05-09 06:44:05Z tbourke $
|
| 2 |
|
|
|
| 3 |
|
|
Record positions for error reporting. Based on idea from ML-Yacc manual.
|
| 4 |
|
|
Positions are line (from 1), character (from 0) pairs.
|
| 5 |
|
|
*)
|
| 6 |
|
|
signature FILE_POS =
|
| 7 |
|
|
sig
|
| 8 |
|
|
type state
|
| 9 |
|
|
type pos
|
| 10 |
|
|
|
| 11 |
|
|
val zero : pos
|
| 12 |
|
|
|
| 13 |
|
|
val newstate : unit -> state
|
| 14 |
|
|
val nextline : state * int -> unit (* pass (yyarg, yypos) *)
|
| 15 |
|
|
val currpos : state * int -> pos (* pass (yyarg, yypos) *)
|
| 16 |
|
|
|
| 17 |
|
|
val incCommentDepth : state -> unit
|
| 18 |
|
|
val decCommentDepth : state -> bool
|
| 19 |
|
|
(* returns true when the comment depth is zero. *)
|
| 20 |
|
|
|
| 21 |
|
|
val error : string -> string * pos * pos -> unit
|
| 22 |
|
|
end
|
| 23 |
|
|
|