Ascii.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Edited by Karlton on Jun 12, 1979 1:33 PM
Last edited by Paul Rovner on August 8, 1983 12:21 pm
Last Edited by: Levin, August 8, 1983 6:21 pm
Russ Atkinson (RRA) January 29, 1985 6:52:39 pm PST
Doug Wyatt, February 22, 1985 10:43:18 am PST
Control Characters
ControlA: CHAR = 'A - 100B;
ControlB: CHAR = 'B - 100B;
ControlC: CHAR = 'C - 100B;
ControlD: CHAR = 'D - 100B;
ControlE: CHAR = 'E - 100B;
ControlF: CHAR = 'F - 100B;
ControlG: CHAR = 'G - 100B;
ControlH: CHAR = 'H - 100B;
ControlI: CHAR = 'I - 100B;
ControlJ: CHAR = 'J - 100B;
ControlK: CHAR = 'K - 100B;
ControlL: CHAR = 'L - 100B;
ControlM: CHAR = 'M - 100B;
ControlN: CHAR = 'N - 100B;
ControlO: CHAR = 'O - 100B;
ControlP: CHAR = 'P - 100B;
ControlQ: CHAR = 'Q - 100B;
ControlR: CHAR = 'R - 100B;
ControlS: CHAR = 'S - 100B;
ControlT: CHAR = 'T - 100B;
ControlU: CHAR = 'U - 100B;
ControlV: CHAR = 'V - 100B;
ControlW: CHAR = 'W - 100B;
ControlX: CHAR = 'X - 100B;
ControlY: CHAR = 'Y - 100B;
ControlZ: CHAR = 'Z - 100B;
NUL: CHAR = 0C;
BEL: CHAR = ControlG;
BS: CHAR = ControlH;
TAB: CHAR = ControlI;
LF: CHAR = ControlJ;
FF: CHAR = ControlL;
CR: CHAR = ControlM;
ESC: CHAR = 33C;
SP: CHAR = ' ;
DEL: CHAR = 177C;
Character Conversion Operations
controlOffset: NAT = 100B;
caseOffset: NAT = 'a - 'A;
Control:
PROC [ch:
CHAR]
RETURNS [
CHAR] =
INLINE {
RETURN [IF ch IN ['A..'Z] THEN ch - controlOffset ELSE ch]
};
Upper:
PROC [ch:
CHAR]
RETURNS [
CHAR] =
INLINE {
RETURN [IF ch IN ['a..'z] THEN ch - caseOffset ELSE ch]
};
Lower:
PROC [ch:
CHAR]
RETURNS [
CHAR] =
INLINE {
RETURN [IF ch IN ['A..'Z] THEN ch + caseOffset ELSE ch]
};
Letter:
PROC [ch:
CHAR]
RETURNS [
BOOL] =
INLINE {
RETURN [ch IN ['A..'Z] OR ch IN ['a..'z]]
};
Digit:
PROC [ch:
CHAR]
RETURNS [
BOOL] =
INLINE {
RETURN [ch IN ['0..'9]]
};