8-bit chars

Fergus Henderson fjh at kryten.cs.mu.OZ.AU
Wed Feb 19 15:37:18 AEDT 1997


Hi Tom,

Can you please review this one?

Estimated hours: 12

Support 8-bit characters, including '\0'.  (Previously we didn't
support them because NU-Prolog couldn't support them.)
This required two main changes:
(a) eliminating places where we explicitly assumed that character codes
    ranged from 1 to 127.
(b) making sure that all conversions from `Char' to `Integer' are done
    by first explicitly casting to `UnsignedChar'.  This is necessary
    to avoid potential problems on C compilers for which `char' is signed.

library/char.m:
library/char.nu.nl:
	Replace the implementation of char__to_int as a big table
	with an implementation using pragma c_code, so that it doesn't
	assume that character codes range from 1 to 127.
	Move the old implementation into a new file char.nu.nl,
	since it's still needed for Prolog support.
	Add new predicates char__min_char_value/1 and char__max_char_value/1.

library/Mmakefile:
	Add char.nu.nl to the list of files needed for Prolog support.

library/lexer.m:
	Rewrite io__get_token_[12] in the original (less efficient) way
	that they were written before conway's change in revision 1.17,
	to avoid assuming anything about the range of character codes.
	(Once this change has bootstrapped, it might be worth going back
	to the efficient version, modified of course to assume that
	character codes range from 0..255 rather than 1..127.
	However, at least for bootstrapping we need to use the less
	efficient version.)

runtime/mercury_string.h:
	Add `UnsignedChar' typedef.

library/string.m:
	In string__to_int_list, make sure that the conversion from
	`Char' to `Integer' is done by first explicitly casting to
	`UnsignedChar'.
	Also a few other minor fixes:
		- remove an old XXX by using make_aligned_string()
		- use `size_t' rather than `Word' for a string length;
		- add a missing `const'
		- remove an unnecessary cast to (char)
		- change a `while (--p >= Str) { ...' to
		  `while (p > Str) { p--; ...', because pointing to
		  one before the start of an array is not strictly
		  ANSI-conformant.

compiler/switch_detection.m:
compiler/dense_switch.m:
	Use char__min_char_value and char__max_char_value to avoid
	assuming 7-bit chars.  (We still don't get cross-compilation
	between platforms with different size characters right yet,
	but that's not a major issue right now.)

compiler/export.m:
	Make sure that conversions from `Char' to `Word'
	are done by first explicitly casting to `UnsignedChar'.

NEWS:
	Mention that we now support 8-bit characters.
	Mention the new predicates char__min_char_value/1 and
	char__max_char_value/1, as well as int__int_min, int__int_max,
	int__bits_per_int (which were added previously, with different
	names, but not mentioned in the NEWS file).
	Also make minor cleanups to a few of the other messages.

cvs diff: Diffing .
Index: NEWS
===================================================================
RCS file: /home/staff/zs/imp/mercury/NEWS,v
retrieving revision 1.43
diff -u -r1.43 NEWS
--- 1.43	1997/02/13 23:54:23
+++ NEWS	1997/02/18 15:16:02
@@ -82,6 +82,9 @@
   We now allow a function of arity N to coexist with a predicate of
   arity N+1.
 
+  The Mercury `char' type is now 8-bit clean (previously, "for
+  compatibility with NU-Prolog" we only supported 7-bit characters).
+
 * We've improved the compiler's diagnostics a bit.
 
   Some of the compiler's error messages are a bit more informative, and
@@ -116,14 +119,19 @@
 
   - set__subset XXX
 
-  - Made some extensive additions to bag.m to include the standard set
+  - We made some extensive additions to bag.m to include the standard set
     operations (union, intersection, subtraction), and some other predicates
-    for manipulating bags.  Also changed bag__contains/2 (swapped the 
-    arguments), and bag__remove (now semidet) to match the standard in set.m 
+    for manipulating bags.  We also changed bag__contains/2 (swapped the 
+    arguments), and bag__remove (now semidet) to be consistent with set.m 
     and map.m. 
 
-  - Added io__tmpnam, and io__remove_file to io.m.  Their functions are 
-    the same as the C functions tmpnam() and remove().
+  - There are two new predicates `io__tmpnam' and `io__remove_file',
+    with semantics similar to the ANSI C functions tmpnam() and remove().
+
+  - There are new predicates `int__max_int', `int__min_int', 
+    `int__bits_per_int', `char__min_char_value', `char__max_char_value',
+    with semantics similar to INT_MAX, INT_MIN, (CHAR_BIT * sizeof(int)),
+    CHAR_MIN, and CHAR_MAX in ANSI C (respectively).
 
   - Added list__merge_and_remove_dups/4 and list__sort_and_remove_dups/4
     to complete the set of list__merge and list__sort operations.
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing compiler
Index: compiler/dense_switch.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/dense_switch.m,v
retrieving revision 1.22
diff -u -r1.22 dense_switch.m
--- 1.22	1996/12/26 02:07:46
+++ dense_switch.m	1997/02/18 21:34:25
@@ -50,7 +50,7 @@
 :- implementation.
 
 :- import_module hlds_module, hlds_goal, hlds_data, code_gen.
-:- import_module map, tree, int, std_util, require.
+:- import_module char, map, tree, int, std_util, require.
 
 dense_switch__is_dense_switch(CaseVar, TaggedCases, CanFail0, ReqDensity,
 		FirstVal, LastVal, CanFail) -->
@@ -109,9 +109,15 @@
 	% Fail if the type isn't the sort of type that has a range
 	% or if the type's range is to big to switch on (e.g. int).
 
-	% XXX the size of `character' is hard-coded here.
-
-dense_switch__type_range(char_type, _, 128) --> [].
+dense_switch__type_range(char_type, _, CharRange) -->
+	% XXX the following code uses the host's character size,
+	% not the target's, so it won't work if cross-compiling
+	% to a machine with a different character size.
+	% Note also that the code above in dense_switch.m and the code
+	% in lookup_switch.m assume that char__min_char_value is 0.
+	{ char__max_char_value(MaxChar) },
+	{ char__min_char_value(MinChar) },
+	{ CharRange is MaxChar - MinChar + 1 }.
 dense_switch__type_range(enum_type, Type, TypeRange) -->
 	{ type_to_type_id(Type, TypeId0, _) ->
 		TypeId = TypeId0
Index: compiler/export.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/export.m,v
retrieving revision 1.9
diff -u -r1.9 export.m
--- 1.9	1997/02/03 07:03:59
+++ export.m	1997/02/18 14:41:25
@@ -361,6 +361,13 @@
 		string__append_list(["float_to_word(", Rval, ")" ],
 			ConvertedRval)
 	;
+        	Type = term__functor(term__atom("character"), [], _)
+	->
+		% We need to explicitly cast to UnsignedChar
+		% to avoid problems with C compilers for which `char'
+		% is signed.
+		string__append("(UnsignedChar) ", Rval, ConvertedRval)
+	;
 		ConvertedRval = Rval
 	).
 
Index: compiler/switch_detection.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/switch_detection.m,v
retrieving revision 1.64
diff -u -r1.64 switch_detection.m
--- 1.64	1997/01/27 07:45:37
+++ switch_detection.m	1997/02/18 21:34:48
@@ -31,7 +31,7 @@
 
 :- import_module hlds_goal, hlds_data, prog_data, instmap.
 :- import_module modes, mode_util, type_util, det_util.
-:- import_module int, list, assoc_list, map, set, std_util, term, require.
+:- import_module char, int, list, assoc_list, map, set, std_util, term, require.
 
 %-----------------------------------------------------------------------------%
 
@@ -476,9 +476,13 @@
 
 switch_covers_all_cases(CasesList, Type, _ModuleInfo) :-
 	Type = term__functor(term__atom("character"), [], _),
-	list__length(CasesList, 127).	% XXX should be 256
-		% NU-Prolog only allows chars '\001' .. '\0177'.
-		% Currently we assume the same set.
+	% XXX the following code uses the source machine's character size,
+	% not the target's, so it won't work if cross-compiling to a
+	% machine with a different size character.
+	char__max_char_value(MaxChar),
+	char__min_char_value(MinChar),
+	NumChars is MaxChar - MinChar + 1,
+	list__length(CasesList, NumChars).
 
 switch_covers_all_cases(CasesList, Type, ModuleInfo) :-
 	type_to_type_id(Type, TypeId, _),
cvs diff: Diffing compiler/notes
cvs diff: Diffing doc
cvs diff: Diffing library
Index: library/Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/mercury/library/Mmakefile,v
retrieving revision 1.1
diff -u -r1.1 Mmakefile
--- 1.1	1997/02/13 21:38:29
+++ Mmakefile	1997/02/18 04:13:27
@@ -56,10 +56,10 @@
 
 NU_LIBRARY_NOS = \
 	io.nu.no require.nu.no std_util.nu.no string.nu.no term_io.nu.no \
-	int.nu.no float.nu.no mercury_builtin.nu.no
+	int.nu.no float.nu.no char.nu.no mercury_builtin.nu.no
 NU_LIBRARY_QLS = \
 	io.nu.ql require.nu.ql std_util.nu.ql string.nu.ql term_io.nu.ql \
-	int.nu.ql float.nu.ql mercury_builtin.nu.ql sp_lib.ql
+	int.nu.ql float.nu.ql char.nu.ql mercury_builtin.nu.ql sp_lib.ql
 
 #-----------------------------------------------------------------------------#
 
Index: library/char.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/library/char.m,v
retrieving revision 1.18
diff -u -r1.18 char.m
--- 1.18	1996/05/24 02:51:19
+++ char.m	1997/02/18 14:55:16
@@ -36,6 +36,14 @@
 :- mode char__to_int(out, in) is semidet.
 	% Convert a character to it's corresponding numerical code.
 
+:- pred char__max_char_value(int).
+:- mode char__max_char_value(out) is det.
+	% Returns the maximum numerical character code.
+
+:- pred char__min_char_value(int).
+:- mode char__min_char_value(out) is det.
+	% Returns the minimum numerical character code.
+
 :- pred char__to_upper(char, char).
 :- mode char__to_upper(in, out) is det.
 	% Convert a character to uppercase.
@@ -292,269 +300,6 @@
 char__is_hex_digit('E').
 char__is_hex_digit('F').
 
-%%% char__to_int('\000', 0).	% not supported by NU-Prolog
-char__to_int('\001', 1).
-char__to_int('\002', 2).
-char__to_int('\003', 3).
-char__to_int('\004', 4).
-char__to_int('\005', 5).
-char__to_int('\006', 6).
-char__to_int('\007', 7).
-char__to_int('\010', 8).
-char__to_int('\011', 9).
-char__to_int('\012', 10).
-char__to_int('\013', 11).
-char__to_int('\014', 12).
-char__to_int('\015', 13).
-char__to_int('\016', 14).
-char__to_int('\017', 15).
-char__to_int('\020', 16).
-char__to_int('\021', 17).
-char__to_int('\022', 18).
-char__to_int('\023', 19).
-char__to_int('\024', 20).
-char__to_int('\025', 21).
-char__to_int('\026', 22).
-char__to_int('\027', 23).
-char__to_int('\030', 24).
-char__to_int('\031', 25).
-char__to_int('\032', 26).
-char__to_int('\033', 27).
-char__to_int('\034', 28).
-char__to_int('\035', 29).
-char__to_int('\036', 30).
-char__to_int('\037', 31).
-char__to_int('\040', 32).
-char__to_int('\041', 33).
-char__to_int('\042', 34).
-char__to_int('\043', 35).
-char__to_int('\044', 36).
-char__to_int('\045', 37).
-char__to_int('\046', 38).
-char__to_int('\047', 39).
-char__to_int('\050', 40).
-char__to_int('\051', 41).
-char__to_int('\052', 42).
-char__to_int('\053', 43).
-char__to_int('\054', 44).
-char__to_int('\055', 45).
-char__to_int('\056', 46).
-char__to_int('\057', 47).
-char__to_int('\060', 48).
-char__to_int('\061', 49).
-char__to_int('\062', 50).
-char__to_int('\063', 51).
-char__to_int('\064', 52).
-char__to_int('\065', 53).
-char__to_int('\066', 54).
-char__to_int('\067', 55).
-char__to_int('\070', 56).
-char__to_int('\071', 57).
-char__to_int('\072', 58).
-char__to_int('\073', 59).
-char__to_int('\074', 60).
-char__to_int('\075', 61).
-char__to_int('\076', 62).
-char__to_int('\077', 63).
-char__to_int('\100', 64).
-char__to_int('\101', 65).
-char__to_int('\102', 66).
-char__to_int('\103', 67).
-char__to_int('\104', 68).
-char__to_int('\105', 69).
-char__to_int('\106', 70).
-char__to_int('\107', 71).
-char__to_int('\110', 72).
-char__to_int('\111', 73).
-char__to_int('\112', 74).
-char__to_int('\113', 75).
-char__to_int('\114', 76).
-char__to_int('\115', 77).
-char__to_int('\116', 78).
-char__to_int('\117', 79).
-char__to_int('\120', 80).
-char__to_int('\121', 81).
-char__to_int('\122', 82).
-char__to_int('\123', 83).
-char__to_int('\124', 84).
-char__to_int('\125', 85).
-char__to_int('\126', 86).
-char__to_int('\127', 87).
-char__to_int('\130', 88).
-char__to_int('\131', 89).
-char__to_int('\132', 90).
-char__to_int('\133', 91).
-char__to_int('\134', 92).
-char__to_int('\135', 93).
-char__to_int('\136', 94).
-char__to_int('\137', 95).
-char__to_int('\140', 96).
-char__to_int('\141', 97).
-char__to_int('\142', 98).
-char__to_int('\143', 99).
-char__to_int('\144', 100).
-char__to_int('\145', 101).
-char__to_int('\146', 102).
-char__to_int('\147', 103).
-char__to_int('\150', 104).
-char__to_int('\151', 105).
-char__to_int('\152', 106).
-char__to_int('\153', 107).
-char__to_int('\154', 108).
-char__to_int('\155', 109).
-char__to_int('\156', 110).
-char__to_int('\157', 111).
-char__to_int('\160', 112).
-char__to_int('\161', 113).
-char__to_int('\162', 114).
-char__to_int('\163', 115).
-char__to_int('\164', 116).
-char__to_int('\165', 117).
-char__to_int('\166', 118).
-char__to_int('\167', 119).
-char__to_int('\170', 120).
-char__to_int('\171', 121).
-char__to_int('\172', 122).
-char__to_int('\173', 123).
-char__to_int('\174', 124).
-char__to_int('\175', 125).
-char__to_int('\176', 126).
-char__to_int('\177', 127).
-
-% XXX
-% NU-Prolog atoms can only include 7-bit ASCII chars.
-
-/***********
-char__to_int('\200', 128).
-char__to_int('\201', 129).
-char__to_int('\202', 130).
-char__to_int('\203', 131).
-char__to_int('\204', 132).
-char__to_int('\205', 133).
-char__to_int('\206', 134).
-char__to_int('\207', 135).
-char__to_int('\210', 136).
-char__to_int('\211', 137).
-char__to_int('\212', 138).
-char__to_int('\213', 139).
-char__to_int('\214', 140).
-char__to_int('\215', 141).
-char__to_int('\216', 142).
-char__to_int('\217', 143).
-char__to_int('\220', 144).
-char__to_int('\221', 145).
-char__to_int('\222', 146).
-char__to_int('\223', 147).
-char__to_int('\224', 148).
-char__to_int('\225', 149).
-char__to_int('\226', 150).
-char__to_int('\227', 151).
-char__to_int('\230', 152).
-char__to_int('\231', 153).
-char__to_int('\232', 154).
-char__to_int('\233', 155).
-char__to_int('\234', 156).
-char__to_int('\235', 157).
-char__to_int('\236', 158).
-char__to_int('\237', 159).
-char__to_int('\240', 160).
-char__to_int('\241', 161).
-char__to_int('\242', 162).
-char__to_int('\243', 163).
-char__to_int('\244', 164).
-char__to_int('\245', 165).
-char__to_int('\246', 166).
-char__to_int('\247', 167).
-char__to_int('\250', 168).
-char__to_int('\251', 169).
-char__to_int('\252', 170).
-char__to_int('\253', 171).
-char__to_int('\254', 172).
-char__to_int('\255', 173).
-char__to_int('\256', 174).
-char__to_int('\257', 175).
-char__to_int('\260', 176).
-char__to_int('\261', 177).
-char__to_int('\262', 178).
-char__to_int('\263', 179).
-char__to_int('\264', 180).
-char__to_int('\265', 181).
-char__to_int('\266', 182).
-char__to_int('\267', 183).
-char__to_int('\270', 184).
-char__to_int('\271', 185).
-char__to_int('\272', 186).
-char__to_int('\273', 187).
-char__to_int('\274', 188).
-char__to_int('\275', 189).
-char__to_int('\276', 190).
-char__to_int('\277', 191).
-char__to_int('\300', 192).
-char__to_int('\301', 193).
-char__to_int('\302', 194).
-char__to_int('\303', 195).
-char__to_int('\304', 196).
-char__to_int('\305', 197).
-char__to_int('\306', 198).
-char__to_int('\307', 199).
-char__to_int('\310', 200).
-char__to_int('\311', 201).
-char__to_int('\312', 202).
-char__to_int('\313', 203).
-char__to_int('\314', 204).
-char__to_int('\315', 205).
-char__to_int('\316', 206).
-char__to_int('\317', 207).
-char__to_int('\320', 208).
-char__to_int('\321', 209).
-char__to_int('\322', 210).
-char__to_int('\323', 211).
-char__to_int('\324', 212).
-char__to_int('\325', 213).
-char__to_int('\326', 214).
-char__to_int('\327', 215).
-char__to_int('\330', 216).
-char__to_int('\331', 217).
-char__to_int('\332', 218).
-char__to_int('\333', 219).
-char__to_int('\334', 220).
-char__to_int('\335', 221).
-char__to_int('\336', 222).
-char__to_int('\337', 223).
-char__to_int('\340', 224).
-char__to_int('\341', 225).
-char__to_int('\342', 226).
-char__to_int('\343', 227).
-char__to_int('\344', 228).
-char__to_int('\345', 229).
-char__to_int('\346', 230).
-char__to_int('\347', 231).
-char__to_int('\350', 232).
-char__to_int('\351', 233).
-char__to_int('\352', 234).
-char__to_int('\353', 235).
-char__to_int('\354', 236).
-char__to_int('\355', 237).
-char__to_int('\356', 238).
-char__to_int('\357', 239).
-char__to_int('\360', 240).
-char__to_int('\361', 241).
-char__to_int('\362', 242).
-char__to_int('\363', 243).
-char__to_int('\364', 244).
-char__to_int('\365', 245).
-char__to_int('\366', 246).
-char__to_int('\367', 247).
-char__to_int('\370', 248).
-char__to_int('\371', 249).
-char__to_int('\372', 250).
-char__to_int('\373', 251).
-char__to_int('\374', 252).
-char__to_int('\375', 253).
-char__to_int('\376', 254).
-char__to_int('\377', 255).
-*********/
-
 %-----------------------------------------------------------------------------%
 
 :- char__lower_upper(X, Y) when X or Y.
@@ -586,4 +331,36 @@
 char__lower_upper('y', 'Y').
 char__lower_upper('z', 'Z').
 
+%-----------------------------------------------------------------------------%
+
+:- pragma c_code(char__to_int(Character::in, Int::out), will_not_call_mercury, "
+	Int = (UnsignedChar) Character;
+").
+
+:- pragma c_code(char__to_int(Character::in, Int::in), will_not_call_mercury, "
+	SUCCESS_INDICATOR = ((UnsignedChar) Character == Int);
+").
+
+:- pragma c_code(char__to_int(Character::out, Int::in), will_not_call_mercury,
+"
+	/*
+	** If the integer doesn't fit into a char, then
+	** the assignment `Character = Int' below will truncate it.
+	** SUCCESS_INDICATOR will be set to true only if
+	** the result was not truncated.
+	*/
+	Character = Int;
+	SUCCESS_INDICATOR = ((UnsignedChar) Character == Int);
+").
+
+% We used unsigned character codes, so the minimum character code
+% is always zero.
+
+char__min_char_value(0).
+
+:- pragma c_header_code("#include <limits.h>").
+:- pragma c_code(char__max_char_value(Max::out), will_not_call_mercury, "
+	Max = UCHAR_MAX;
+").
+	
 %-----------------------------------------------------------------------------%
cvs diff: char.nu.nl is a new entry, no comparison available
Index: library/lexer.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/library/lexer.m,v
retrieving revision 1.20
diff -u -r1.20 lexer.m
--- 1.20	1996/10/22 11:53:17
+++ lexer.m	1997/02/18 18:22:05
@@ -134,8 +134,6 @@
 :- pred lexer__get_token_1(token, io__state, io__state).
 :- mode lexer__get_token_1(out, di, uo) is det.
 
-	% We use a big switch on Char here for efficiency - obviously not
-	% for conciseness.
 lexer__get_token_1(Token) -->
 	io__read_char(Result),
 	( { Result = error(Error) }, !,
@@ -143,136 +141,36 @@
 	; { Result = eof }, !,
 		{ Token = eof }
 	; { Result = ok(Char) },
-		( { Char = '\001', Token = junk(Char) }
-		; { Char = '\002', Token = junk(Char) }
-		; { Char = '\003', Token = junk(Char) }
-		; { Char = '\004', Token = junk(Char) }
-		; { Char = '\005', Token = junk(Char) }
-		; { Char = '\006', Token = junk(Char) }
-		; { Char = '\007', Token = junk(Char) }
-		; { Char = '\010', Token = junk(Char) }
-% \t		; { Char = '\011', Token = junk(Char) }
-		; { Char = '\t' }, lexer__get_token_2(Token)
-% \n		; { Char = '\012', Token = junk(Char) }
-		; { Char = '\n' }, lexer__get_token_2(Token)
-		; { Char = '\013', Token = junk(Char) }
-% \f		; { Char = '\014', Token = junk(Char) }
-		; { Char = '\f' }, lexer__get_token_2(Token)
-		; { Char = '\015', Token = junk(Char) }
-		; { Char = '\016', Token = junk(Char) }
-		; { Char = '\017', Token = junk(Char) }
-		; { Char = '\020', Token = junk(Char) }
-		; { Char = '\021', Token = junk(Char) }
-		; { Char = '\022', Token = junk(Char) }
-		; { Char = '\023', Token = junk(Char) }
-		; { Char = '\024', Token = junk(Char) }
-		; { Char = '\025', Token = junk(Char) }
-		; { Char = '\026', Token = junk(Char) }
-		; { Char = '\027', Token = junk(Char) }
-		; { Char = '\030', Token = junk(Char) }
-		; { Char = '\031', Token = junk(Char) }
-		; { Char = '\032', Token = junk(Char) }
-		; { Char = '\033', Token = junk(Char) }
-		; { Char = '\034', Token = junk(Char) }
-		; { Char = '\035', Token = junk(Char) }
-		; { Char = '\036', Token = junk(Char) }
-		; { Char = '\037', Token = junk(Char) }
-		; { Char = ' ' }, lexer__get_token_2(Token)
-		; { Char = ('!') }, { Token = name("!") }
-		; { Char = '"' }, lexer__get_quoted_name(Char, [], Token)
-		; { Char = ('#') }, lexer__get_source_line_number([], Token)
-		; { Char = ('$') }, lexer__get_graphic([Char], Token)
-		; { Char = ('%') }, lexer__skip_to_eol(Token)
-		; { Char = ('&') }, lexer__get_graphic([Char], Token)
-		; { Char = '''' }, lexer__get_quoted_name(Char, [], Token)
-		; { Char = ('(') }, { Token = open_ct }
-		; { Char = (')') }, { Token = close }
-		; { Char = ('*') }, lexer__get_graphic([Char], Token)
-		; { Char = ('+') }, lexer__get_graphic([Char], Token)
-		; { Char = (',') }, { Token = comma }
-		; { Char = ('-') }, lexer__get_graphic([Char], Token)
-		; { Char = ('.') }, lexer__get_dot(Token)
-		; { Char = ('/') }, lexer__get_slash(Token)
-		; { Char = '0' }, lexer__get_zero(Token)
-		; { Char = '1' }, lexer__get_number([Char], Token)
-		; { Char = '2' }, lexer__get_number([Char], Token)
-		; { Char = '3' }, lexer__get_number([Char], Token)
-		; { Char = '4' }, lexer__get_number([Char], Token)
-		; { Char = '5' }, lexer__get_number([Char], Token)
-		; { Char = '6' }, lexer__get_number([Char], Token)
-		; { Char = '7' }, lexer__get_number([Char], Token)
-		; { Char = '8' }, lexer__get_number([Char], Token)
-		; { Char = '9' }, lexer__get_number([Char], Token)
-		; { Char = (':') }, lexer__get_graphic([Char], Token)
-		; { Char = (';') }, { Token = name(";") }
-		; { Char = ('<') }, lexer__get_graphic([Char], Token)
-		; { Char = ('=') }, lexer__get_graphic([Char], Token)
-		; { Char = ('>') }, lexer__get_graphic([Char], Token)
-		; { Char = ('?') }, lexer__get_graphic([Char], Token)
-		; { Char = ('@') }, lexer__get_graphic([Char], Token)
-		; { Char = 'A' }, lexer__get_variable([Char], Token)
-		; { Char = 'B' }, lexer__get_variable([Char], Token)
-		; { Char = 'C' }, lexer__get_variable([Char], Token)
-		; { Char = 'D' }, lexer__get_variable([Char], Token)
-		; { Char = 'E' }, lexer__get_variable([Char], Token)
-		; { Char = 'F' }, lexer__get_variable([Char], Token)
-		; { Char = 'G' }, lexer__get_variable([Char], Token)
-		; { Char = 'H' }, lexer__get_variable([Char], Token)
-		; { Char = 'I' }, lexer__get_variable([Char], Token)
-		; { Char = 'J' }, lexer__get_variable([Char], Token)
-		; { Char = 'K' }, lexer__get_variable([Char], Token)
-		; { Char = 'L' }, lexer__get_variable([Char], Token)
-		; { Char = 'M' }, lexer__get_variable([Char], Token)
-		; { Char = 'N' }, lexer__get_variable([Char], Token)
-		; { Char = 'O' }, lexer__get_variable([Char], Token)
-		; { Char = 'P' }, lexer__get_variable([Char], Token)
-		; { Char = 'Q' }, lexer__get_variable([Char], Token)
-		; { Char = 'R' }, lexer__get_variable([Char], Token)
-		; { Char = 'S' }, lexer__get_variable([Char], Token)
-		; { Char = 'T' }, lexer__get_variable([Char], Token)
-		; { Char = 'U' }, lexer__get_variable([Char], Token)
-		; { Char = 'V' }, lexer__get_variable([Char], Token)
-		; { Char = 'W' }, lexer__get_variable([Char], Token)
-		; { Char = 'X' }, lexer__get_variable([Char], Token)
-		; { Char = 'Y' }, lexer__get_variable([Char], Token)
-		; { Char = 'Z' }, lexer__get_variable([Char], Token)
-		; { Char = ('[') }, { Token = open_list }
-		; { Char = ('\\') }, lexer__get_graphic([Char], Token)
-		; { Char = (']') }, { Token = close_list }
-		; { Char = ('^') }, lexer__get_graphic([Char], Token)
-		; { Char = '_' }, lexer__get_variable([Char], Token)
-		; { Char = 'a' }, lexer__get_name([Char], Token)
-		; { Char = 'b' }, lexer__get_name([Char], Token)
-		; { Char = 'c' }, lexer__get_name([Char], Token)
-		; { Char = 'd' }, lexer__get_name([Char], Token)
-		; { Char = 'e' }, lexer__get_name([Char], Token)
-		; { Char = 'f' }, lexer__get_name([Char], Token)
-		; { Char = 'g' }, lexer__get_name([Char], Token)
-		; { Char = 'h' }, lexer__get_name([Char], Token)
-		; { Char = 'i' }, lexer__get_name([Char], Token)
-		; { Char = 'j' }, lexer__get_name([Char], Token)
-		; { Char = 'k' }, lexer__get_name([Char], Token)
-		; { Char = 'l' }, lexer__get_name([Char], Token)
-		; { Char = 'm' }, lexer__get_name([Char], Token)
-		; { Char = 'n' }, lexer__get_name([Char], Token)
-		; { Char = 'o' }, lexer__get_name([Char], Token)
-		; { Char = 'p' }, lexer__get_name([Char], Token)
-		; { Char = 'q' }, lexer__get_name([Char], Token)
-		; { Char = 'r' }, lexer__get_name([Char], Token)
-		; { Char = 's' }, lexer__get_name([Char], Token)
-		; { Char = 't' }, lexer__get_name([Char], Token)
-		; { Char = 'u' }, lexer__get_name([Char], Token)
-		; { Char = 'v' }, lexer__get_name([Char], Token)
-		; { Char = 'w' }, lexer__get_name([Char], Token)
-		; { Char = 'x' }, lexer__get_name([Char], Token)
-		; { Char = 'y' }, lexer__get_name([Char], Token)
-		; { Char = 'z' }, lexer__get_name([Char], Token)
-		; { Char = ('{') }, { Token = open_curly }
-		; { Char = ('}') }, { Token = close_curly }
-		; { Char = ('|') }, { Token = ht_sep }
-		; { Char = ('~') }, lexer__get_graphic([Char], Token)
-		; { Char = '\140', Token = junk(Char) } % `
-		; { Char = '\177', Token = junk(Char) }
+		( { Char = ' ' ; Char = '\t' ; Char = '\n' } ->
+			lexer__get_token_2(Token)
+		; { char__is_upper(Char) ; Char = '_' } ->
+			lexer__get_variable([Char], Token)
+		; { char__is_lower(Char) } ->
+			lexer__get_name([Char], Token)
+		; { Char = '0' } ->
+			lexer__get_zero(Token)
+		; { char__is_digit(Char) } ->
+			lexer__get_number([Char], Token)
+		; { lexer__special_token(Char, SpecialToken) } ->
+			{ SpecialToken = open ->
+				Token = open_ct
+			;
+				Token = SpecialToken
+			}
+		; { Char = ('.') } ->
+			lexer__get_dot(Token)
+		; { Char = ('%') } ->
+			lexer__skip_to_eol(Token)
+		; { Char = '"' ; Char = '''' } ->
+			lexer__get_quoted_name(Char, [], Token)
+		; { Char = ('/') } ->
+			lexer__get_slash(Token)
+		; { Char = ('#') } ->
+			lexer__get_source_line_number([], Token)
+		; { lexer__graphic_token_char(Char) } ->
+			lexer__get_graphic([Char], Token)
+		;
+			{ Token = junk(Char) }
 		)
 	).
 
@@ -282,8 +180,6 @@
 	% This is just like get_token_1, except that we have already
 	% scanned past some whitespace, so '(' gets scanned as `open'
 	% rather than `open_ct'.
-	% We use a big switch on Char here for efficiency - obviously not
-	% for consiseness.
 
 lexer__get_token_2(Token) -->
 	io__read_char(Result),
@@ -292,138 +188,32 @@
 	; { Result = eof }, !,
 		{ Token = eof }
 	; { Result = ok(Char) },
-		( { Char = '\001', Token = junk(Char) }
-		; { Char = '\002', Token = junk(Char) }
-		; { Char = '\003', Token = junk(Char) }
-		; { Char = '\004', Token = junk(Char) }
-		; { Char = '\005', Token = junk(Char) }
-		; { Char = '\006', Token = junk(Char) }
-		; { Char = '\007', Token = junk(Char) }
-		; { Char = '\010', Token = junk(Char) }
-% \t		; { Char = '\011', Token = junk(Char) }
-		; { Char = '\t' }, lexer__get_token_2(Token)
-% \n		; { Char = '\012', Token = junk(Char) }
-		; { Char = '\n' }, lexer__get_token_2(Token)
-		; { Char = '\013', Token = junk(Char) }
-% \f		; { Char = '\014', Token = junk(Char) }
-		; { Char = '\f' }, lexer__get_token_2(Token)
-		; { Char = '\015', Token = junk(Char) }
-		; { Char = '\016', Token = junk(Char) }
-		; { Char = '\017', Token = junk(Char) }
-		; { Char = '\020', Token = junk(Char) }
-		; { Char = '\021', Token = junk(Char) }
-		; { Char = '\022', Token = junk(Char) }
-		; { Char = '\023', Token = junk(Char) }
-		; { Char = '\024', Token = junk(Char) }
-		; { Char = '\025', Token = junk(Char) }
-		; { Char = '\026', Token = junk(Char) }
-		; { Char = '\027', Token = junk(Char) }
-		; { Char = '\030', Token = junk(Char) }
-		; { Char = '\031', Token = junk(Char) }
-		; { Char = '\032', Token = junk(Char) }
-		; { Char = '\033', Token = junk(Char) }
-		; { Char = '\034', Token = junk(Char) }
-		; { Char = '\035', Token = junk(Char) }
-		; { Char = '\036', Token = junk(Char) }
-		; { Char = '\037', Token = junk(Char) }
-		; { Char = ' ' }, lexer__get_token_2(Token)
-		; { Char = ('!'),  Token = name("!") }
-		; { Char = '"' },
-			lexer__get_quoted_name(Char, [], Token)
-		; { Char = ('#') }, lexer__get_source_line_number([], Token)
-		; { Char = ('$') }, lexer__get_graphic([Char], Token)
-		; { Char = ('%') }, lexer__skip_to_eol(Token)
-		; { Char = ('&') }, lexer__get_graphic([Char], Token)
-		; { Char = '''' },
+		( { Char = ' ' ; Char = '\t' ; Char = '\n' } ->
+			lexer__get_token_2(Token)
+		; { char__is_upper(Char) ; Char = '_' } ->
+			lexer__get_variable([Char], Token)
+		; { char__is_lower(Char) } ->
+			lexer__get_name([Char], Token)
+		; { Char = '0' } ->
+			lexer__get_zero(Token)
+		; { char__is_digit(Char) } ->
+			lexer__get_number([Char], Token)
+		; { lexer__special_token(Char, SpecialToken) } ->
+			{ Token = SpecialToken }
+		; { Char = ('.') } ->
+			lexer__get_dot(Token)
+		; { Char = ('%') } ->
+			lexer__skip_to_eol(Token)
+		; { Char = '"' ; Char = '''' } ->
 			lexer__get_quoted_name(Char, [], Token)
-		; { Char = '(',  Token = open }
-		; { Char = ')',  Token = close }
-		; { Char = ('*') }, lexer__get_graphic([Char], Token)
-		; { Char = ('+') }, lexer__get_graphic([Char], Token)
-		; { Char = (','),  Token = comma }
-		; { Char = ('-') }, lexer__get_graphic([Char], Token)
-		; { Char = ('.') }, lexer__get_dot(Token)
-		; { Char = ('/') }, lexer__get_slash(Token)
-		; { Char = '0' }, lexer__get_zero(Token)
-		; { Char = '1' }, lexer__get_number([Char], Token)
-		; { Char = '2' }, lexer__get_number([Char], Token)
-		; { Char = '3' }, lexer__get_number([Char], Token)
-		; { Char = '4' }, lexer__get_number([Char], Token)
-		; { Char = '5' }, lexer__get_number([Char], Token)
-		; { Char = '6' }, lexer__get_number([Char], Token)
-		; { Char = '7' }, lexer__get_number([Char], Token)
-		; { Char = '8' }, lexer__get_number([Char], Token)
-		; { Char = '9' }, lexer__get_number([Char], Token)
-		; { Char = (':') }, lexer__get_graphic([Char], Token)
-		; { Char = (';'),  Token = name(";") }
-		; { Char = ('<') }, lexer__get_graphic([Char], Token)
-		; { Char = ('=') }, lexer__get_graphic([Char], Token)
-		; { Char = ('>') }, lexer__get_graphic([Char], Token)
-		; { Char = ('?') }, lexer__get_graphic([Char], Token)
-		; { Char = ('@') }, lexer__get_graphic([Char], Token)
-		; { Char = 'A' }, lexer__get_variable([Char], Token)
-		; { Char = 'B' }, lexer__get_variable([Char], Token)
-		; { Char = 'C' }, lexer__get_variable([Char], Token)
-		; { Char = 'D' }, lexer__get_variable([Char], Token)
-		; { Char = 'E' }, lexer__get_variable([Char], Token)
-		; { Char = 'F' }, lexer__get_variable([Char], Token)
-		; { Char = 'G' }, lexer__get_variable([Char], Token)
-		; { Char = 'H' }, lexer__get_variable([Char], Token)
-		; { Char = 'I' }, lexer__get_variable([Char], Token)
-		; { Char = 'J' }, lexer__get_variable([Char], Token)
-		; { Char = 'K' }, lexer__get_variable([Char], Token)
-		; { Char = 'L' }, lexer__get_variable([Char], Token)
-		; { Char = 'M' }, lexer__get_variable([Char], Token)
-		; { Char = 'N' }, lexer__get_variable([Char], Token)
-		; { Char = 'O' }, lexer__get_variable([Char], Token)
-		; { Char = 'P' }, lexer__get_variable([Char], Token)
-		; { Char = 'Q' }, lexer__get_variable([Char], Token)
-		; { Char = 'R' }, lexer__get_variable([Char], Token)
-		; { Char = 'S' }, lexer__get_variable([Char], Token)
-		; { Char = 'T' }, lexer__get_variable([Char], Token)
-		; { Char = 'U' }, lexer__get_variable([Char], Token)
-		; { Char = 'V' }, lexer__get_variable([Char], Token)
-		; { Char = 'W' }, lexer__get_variable([Char], Token)
-		; { Char = 'X' }, lexer__get_variable([Char], Token)
-		; { Char = 'Y' }, lexer__get_variable([Char], Token)
-		; { Char = 'Z' }, lexer__get_variable([Char], Token)
-		; { Char = ('['),  Token = open_list }
-		; { Char = ('\\') }, lexer__get_graphic([Char], Token)
-		; { Char = (']'),  Token = close_list }
-		; { Char = ('^') }, lexer__get_graphic([Char], Token)
-		; { Char = '_' }, lexer__get_variable([Char], Token)
-		; { Char = '\140', Token = junk(Char) } % `
-		; { Char = 'a' }, lexer__get_name([Char], Token)
-		; { Char = 'b' }, lexer__get_name([Char], Token)
-		; { Char = 'c' }, lexer__get_name([Char], Token)
-		; { Char = 'd' }, lexer__get_name([Char], Token)
-		; { Char = 'e' }, lexer__get_name([Char], Token)
-		; { Char = 'f' }, lexer__get_name([Char], Token)
-		; { Char = 'g' }, lexer__get_name([Char], Token)
-		; { Char = 'h' }, lexer__get_name([Char], Token)
-		; { Char = 'i' }, lexer__get_name([Char], Token)
-		; { Char = 'j' }, lexer__get_name([Char], Token)
-		; { Char = 'k' }, lexer__get_name([Char], Token)
-		; { Char = 'l' }, lexer__get_name([Char], Token)
-		; { Char = 'm' }, lexer__get_name([Char], Token)
-		; { Char = 'n' }, lexer__get_name([Char], Token)
-		; { Char = 'o' }, lexer__get_name([Char], Token)
-		; { Char = 'p' }, lexer__get_name([Char], Token)
-		; { Char = 'q' }, lexer__get_name([Char], Token)
-		; { Char = 'r' }, lexer__get_name([Char], Token)
-		; { Char = 's' }, lexer__get_name([Char], Token)
-		; { Char = 't' }, lexer__get_name([Char], Token)
-		; { Char = 'u' }, lexer__get_name([Char], Token)
-		; { Char = 'v' }, lexer__get_name([Char], Token)
-		; { Char = 'w' }, lexer__get_name([Char], Token)
-		; { Char = 'x' }, lexer__get_name([Char], Token)
-		; { Char = 'y' }, lexer__get_name([Char], Token)
-		; { Char = 'z' }, lexer__get_name([Char], Token)
-		; { Char = ('{'),  Token = open_curly }
-		; { Char = ('|'),  Token = ht_sep }
-		; { Char = ('}'),  Token = close_curly }
-		; { Char = ('~') }, lexer__get_graphic([Char], Token)
-		; { Char = '\177', Token = junk(Char) }
+		; { Char = ('/') } ->
+			lexer__get_slash(Token)
+		; { Char = ('#') } ->
+			lexer__get_source_line_number([], Token)
+		; { lexer__graphic_token_char(Char) } ->
+			lexer__get_graphic([Char], Token)
+		;
+			{ Token = junk(Char) }
 		)
 	).
 
Index: library/string.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/library/string.m,v
retrieving revision 1.87
diff -u -r1.87 string.m
--- 1.87	1997/01/13 11:45:51
+++ string.m	1997/02/18 19:38:23
@@ -554,10 +554,12 @@
 string__digit_to_char(34, 'Y').
 string__digit_to_char(35, 'Z').
 
+% NB: it would be more efficient to do this directly (using pragma c_code)
 string__to_char_list(String, CharList) :-
 	string__to_int_list(String, IntList),
 	string__int_list_to_char_list(IntList, CharList).
 
+% NB: it would be more efficient to do this directly (using pragma c_code)
 string__from_char_list(CharList, String) :-
 	string__char_list_to_int_list(CharList, IntList),
 	string__to_int_list(String, IntList).
@@ -1527,17 +1529,18 @@
 */
 
 :- pragma(c_code, string__to_int_list(Str::in, IntList::out), "{
-	char *p = Str + strlen(Str);
+	const char *p = Str + strlen(Str);
 	IntList = list_empty();
-	while (--p >= Str) {
-		IntList = list_cons(*p, IntList);
+	while (p > Str) {
+		p--;
+		IntList = list_cons((UnsignedChar) *p, IntList);
 	}
 }").
 
 :- pragma(c_code, string__to_int_list(Str::out, IntList::in), "{
 		/* mode (out, in) is det */
 	Word int_list_ptr;
-	Word size;
+	size_t size;
 	Word str_ptr;
 /*
 ** loop to calculate list length + sizeof(Word) in `size' using list in
@@ -1561,7 +1564,7 @@
 	size = 0;
 	int_list_ptr = IntList;
 	while (!list_is_empty(int_list_ptr)) {
-		Str[size++] = (char) list_head(int_list_ptr);
+		Str[size++] = list_head(int_list_ptr);
 		int_list_ptr = list_tail(int_list_ptr);
 	}
 /*
@@ -1756,8 +1759,7 @@
 	Integer len;
 	Word tmp;
 	if (Count <= 0) {
-		/* XXX need to guarantee alignment of strings */
-		Left = (String) (Word) """";
+		make_aligned_string(LVALUE_CAST(ConstString, Left), """");
 		Right = Str;
 	} else {
 		len = strlen(Str);
cvs diff: Diffing profiler
cvs diff: Diffing runtime
Index: runtime/mercury_string.h
===================================================================
RCS file: /home/staff/zs/imp/mercury/runtime/mercury_string.h,v
retrieving revision 1.3
diff -u -r1.3 mercury_string.h
--- 1.3	1997/02/19 02:50:36
+++ mercury_string.h	1997/02/19 02:49:43
@@ -16,12 +16,15 @@
 
 /*
 ** Mercury characters are given type `Char', which is a typedef for `char'.
+** But BEWARE: when stored in an Integer, the value must be
+** first cast to `UnsignedChar'.
 ** Mercury strings are stored as pointers to '\0'-terminated arrays of Char.
 **
 ** We may eventually move to using wchar_t for Mercury characters and strings,
 ** so it is important to use these typedefs.
 */
 typedef char Char;
+typedef unsigned char UnsignedChar;
 
 typedef Char *String;
 typedef const Char *ConstString;
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/diff
cvs diff: Diffing scripts
Index: scripts/mercury_update_interface.in
===================================================================
RCS file: /home/staff/zs/imp/mercury/scripts/mercury_update_interface.in,v
retrieving revision 1.3
diff -u -r1.3 mercury_update_interface.in
--- 1.3	1996/09/11 08:58:17
+++ mercury_update_interface.in	1997/02/19 02:15:57
@@ -47,7 +47,7 @@
 	$verbose && echo "\`$filename' has not changed." 1>&2
 	rm -f "$filename.tmp"
 else
-	$verbose && echo "\`$filename' has changed." 1>&2
+	echo "\`$filename' has CHANGED." 1>&2
 	mv -f "$filename.tmp" "$filename"
 	# Work-around for a parallel gmake problem
 	exit 0
cvs diff: Diffing tools
cvs diff: Diffing trial
cvs diff: Diffing util
%---------------------------------------------------------------------------%
library/char.nu.nl
%---------------------------------------------------------------------------%
% Copyright (C) 1994-1995, 1997 The University of Melbourne.
% This file may only be copied under the terms of the GNU Library General
% Public License - see the file COPYING.LIB in the Mercury distribution.
%---------------------------------------------------------------------------%

% File: char.nu.nl.
% Main author: fjh.

%%% char__to_int('\000', 0).	% not supported by NU-Prolog
char__to_int('\001', 1).
char__to_int('\002', 2).
char__to_int('\003', 3).
char__to_int('\004', 4).
char__to_int('\005', 5).
char__to_int('\006', 6).
char__to_int('\007', 7).
char__to_int('\010', 8).
char__to_int('\011', 9).
char__to_int('\012', 10).
char__to_int('\013', 11).
char__to_int('\014', 12).
char__to_int('\015', 13).
char__to_int('\016', 14).
char__to_int('\017', 15).
char__to_int('\020', 16).
char__to_int('\021', 17).
char__to_int('\022', 18).
char__to_int('\023', 19).
char__to_int('\024', 20).
char__to_int('\025', 21).
char__to_int('\026', 22).
char__to_int('\027', 23).
char__to_int('\030', 24).
char__to_int('\031', 25).
char__to_int('\032', 26).
char__to_int('\033', 27).
char__to_int('\034', 28).
char__to_int('\035', 29).
char__to_int('\036', 30).
char__to_int('\037', 31).
char__to_int('\040', 32).
char__to_int('\041', 33).
char__to_int('\042', 34).
char__to_int('\043', 35).
char__to_int('\044', 36).
char__to_int('\045', 37).
char__to_int('\046', 38).
char__to_int('\047', 39).
char__to_int('\050', 40).
char__to_int('\051', 41).
char__to_int('\052', 42).
char__to_int('\053', 43).
char__to_int('\054', 44).
char__to_int('\055', 45).
char__to_int('\056', 46).
char__to_int('\057', 47).
char__to_int('\060', 48).
char__to_int('\061', 49).
char__to_int('\062', 50).
char__to_int('\063', 51).
char__to_int('\064', 52).
char__to_int('\065', 53).
char__to_int('\066', 54).
char__to_int('\067', 55).
char__to_int('\070', 56).
char__to_int('\071', 57).
char__to_int('\072', 58).
char__to_int('\073', 59).
char__to_int('\074', 60).
char__to_int('\075', 61).
char__to_int('\076', 62).
char__to_int('\077', 63).
char__to_int('\100', 64).
char__to_int('\101', 65).
char__to_int('\102', 66).
char__to_int('\103', 67).
char__to_int('\104', 68).
char__to_int('\105', 69).
char__to_int('\106', 70).
char__to_int('\107', 71).
char__to_int('\110', 72).
char__to_int('\111', 73).
char__to_int('\112', 74).
char__to_int('\113', 75).
char__to_int('\114', 76).
char__to_int('\115', 77).
char__to_int('\116', 78).
char__to_int('\117', 79).
char__to_int('\120', 80).
char__to_int('\121', 81).
char__to_int('\122', 82).
char__to_int('\123', 83).
char__to_int('\124', 84).
char__to_int('\125', 85).
char__to_int('\126', 86).
char__to_int('\127', 87).
char__to_int('\130', 88).
char__to_int('\131', 89).
char__to_int('\132', 90).
char__to_int('\133', 91).
char__to_int('\134', 92).
char__to_int('\135', 93).
char__to_int('\136', 94).
char__to_int('\137', 95).
char__to_int('\140', 96).
char__to_int('\141', 97).
char__to_int('\142', 98).
char__to_int('\143', 99).
char__to_int('\144', 100).
char__to_int('\145', 101).
char__to_int('\146', 102).
char__to_int('\147', 103).
char__to_int('\150', 104).
char__to_int('\151', 105).
char__to_int('\152', 106).
char__to_int('\153', 107).
char__to_int('\154', 108).
char__to_int('\155', 109).
char__to_int('\156', 110).
char__to_int('\157', 111).
char__to_int('\160', 112).
char__to_int('\161', 113).
char__to_int('\162', 114).
char__to_int('\163', 115).
char__to_int('\164', 116).
char__to_int('\165', 117).
char__to_int('\166', 118).
char__to_int('\167', 119).
char__to_int('\170', 120).
char__to_int('\171', 121).
char__to_int('\172', 122).
char__to_int('\173', 123).
char__to_int('\174', 124).
char__to_int('\175', 125).
char__to_int('\176', 126).
char__to_int('\177', 127).

% NU-Prolog atoms can only include 7-bit ASCII chars.

/***********
char__to_int('\200', 128).
char__to_int('\201', 129).
char__to_int('\202', 130).
char__to_int('\203', 131).
char__to_int('\204', 132).
char__to_int('\205', 133).
char__to_int('\206', 134).
char__to_int('\207', 135).
char__to_int('\210', 136).
char__to_int('\211', 137).
char__to_int('\212', 138).
char__to_int('\213', 139).
char__to_int('\214', 140).
char__to_int('\215', 141).
char__to_int('\216', 142).
char__to_int('\217', 143).
char__to_int('\220', 144).
char__to_int('\221', 145).
char__to_int('\222', 146).
char__to_int('\223', 147).
char__to_int('\224', 148).
char__to_int('\225', 149).
char__to_int('\226', 150).
char__to_int('\227', 151).
char__to_int('\230', 152).
char__to_int('\231', 153).
char__to_int('\232', 154).
char__to_int('\233', 155).
char__to_int('\234', 156).
char__to_int('\235', 157).
char__to_int('\236', 158).
char__to_int('\237', 159).
char__to_int('\240', 160).
char__to_int('\241', 161).
char__to_int('\242', 162).
char__to_int('\243', 163).
char__to_int('\244', 164).
char__to_int('\245', 165).
char__to_int('\246', 166).
char__to_int('\247', 167).
char__to_int('\250', 168).
char__to_int('\251', 169).
char__to_int('\252', 170).
char__to_int('\253', 171).
char__to_int('\254', 172).
char__to_int('\255', 173).
char__to_int('\256', 174).
char__to_int('\257', 175).
char__to_int('\260', 176).
char__to_int('\261', 177).
char__to_int('\262', 178).
char__to_int('\263', 179).
char__to_int('\264', 180).
char__to_int('\265', 181).
char__to_int('\266', 182).
char__to_int('\267', 183).
char__to_int('\270', 184).
char__to_int('\271', 185).
char__to_int('\272', 186).
char__to_int('\273', 187).
char__to_int('\274', 188).
char__to_int('\275', 189).
char__to_int('\276', 190).
char__to_int('\277', 191).
char__to_int('\300', 192).
char__to_int('\301', 193).
char__to_int('\302', 194).
char__to_int('\303', 195).
char__to_int('\304', 196).
char__to_int('\305', 197).
char__to_int('\306', 198).
char__to_int('\307', 199).
char__to_int('\310', 200).
char__to_int('\311', 201).
char__to_int('\312', 202).
char__to_int('\313', 203).
char__to_int('\314', 204).
char__to_int('\315', 205).
char__to_int('\316', 206).
char__to_int('\317', 207).
char__to_int('\320', 208).
char__to_int('\321', 209).
char__to_int('\322', 210).
char__to_int('\323', 211).
char__to_int('\324', 212).
char__to_int('\325', 213).
char__to_int('\326', 214).
char__to_int('\327', 215).
char__to_int('\330', 216).
char__to_int('\331', 217).
char__to_int('\332', 218).
char__to_int('\333', 219).
char__to_int('\334', 220).
char__to_int('\335', 221).
char__to_int('\336', 222).
char__to_int('\337', 223).
char__to_int('\340', 224).
char__to_int('\341', 225).
char__to_int('\342', 226).
char__to_int('\343', 227).
char__to_int('\344', 228).
char__to_int('\345', 229).
char__to_int('\346', 230).
char__to_int('\347', 231).
char__to_int('\350', 232).
char__to_int('\351', 233).
char__to_int('\352', 234).
char__to_int('\353', 235).
char__to_int('\354', 236).
char__to_int('\355', 237).
char__to_int('\356', 238).
char__to_int('\357', 239).
char__to_int('\360', 240).
char__to_int('\361', 241).
char__to_int('\362', 242).
char__to_int('\363', 243).
char__to_int('\364', 244).
char__to_int('\365', 245).
char__to_int('\366', 246).
char__to_int('\367', 247).
char__to_int('\370', 248).
char__to_int('\371', 249).
char__to_int('\372', 250).
char__to_int('\373', 251).
char__to_int('\374', 252).
char__to_int('\375', 253).
char__to_int('\376', 254).
char__to_int('\377', 255).
*********/


-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list