INTERFACE QGet; (* Fast "Lex"-like procedures that die instead of raising Lex.Error. *) IMPORT Rd, Lex; CONST Blanks = Lex.Blanks; Spaces = SET OF CHAR{' ', '\t'}; PROCEDURE Skip(rd: Rd.T; READONLY cs: SET OF CHAR := Blanks); PROCEDURE Match(rd: Rd.T; t: TEXT); PROCEDURE EOL(rd: Rd.T); (* Equivalent to Skip(rd, Spaces); Match(rd, "\n"). *) PROCEDURE Colon(rd: Rd.T); (* Performs Skip(rd, Spaces); Match(rd, ":"); then skips one space or tab, if present. *) (* The procedures below will skip spaces or tabs (but not newlines, unlike their "Lex" counterparts) before the desired input. The procedures "Int", "Real", and "LongReal" are faster than the ones in FGet, but less accurate. *) PROCEDURE Char(rd: Rd.T): CHAR; PROCEDURE Bool(rd: Rd.T): BOOLEAN; PROCEDURE Int(rd: Rd.T): INTEGER; PROCEDURE Real(rd: Rd.T): REAL; PROCEDURE LongReal(rd: Rd.T): LONGREAL; END QGet. (* Copyright © 2001 Universidade Estadual de Campinas (UNICAMP). Authors: Helena C. G. Leitão and Jorge Stolfi. This file can be freely distributed, used, and modified, provided that this copyright and authorship notice is preserved, and that any modified versions are clearly marked as such. This software has NO WARRANTY of correctness or applicability for any purpose. Neither the authors nor their employers chall be held responsible for any losses or damages that may result from its use. *)