The Scan interface contains procedures that convert a text representation to its corresponding Modula-3 value. Leading and trailing blanks (ie. characters in "Lex.Blanks") are ignored. "Lex.Error" is raised if the first non-blank substring is not generated by the corresponding "Lex" grammar or if there are zero or more than one non-blank substrings. "FloatMode.Trap" is raised as per "Lex".
PROCEDURE Bool(txt: TEXT): BOOLEAN RAISES {Lex.Error};
PROCEDURE Int(txt: TEXT; defaultBase: [2..16] := 10): INTEGER
RAISES {Lex.Error, FloatMode.Trap};
PROCEDURE Unsigned(txt: TEXT; defaultBase: [2..16] := 16): Word.T
RAISES {Lex.Error, FloatMode.Trap};
PROCEDURE Real(txt: TEXT): REAL
RAISES {Lex.Error, FloatMode.Trap};
PROCEDURE LongReal(txt: TEXT): LONGREAL
RAISES {Lex.Error, FloatMode.Trap};
PROCEDURE Extended(txt: TEXT): EXTENDED
RAISES {Lex.Error, FloatMode.Trap};