-/*
- * Print out a range type (integer, char, or boolean).
- */
-
-private printrange(i, t)
-Integer i;
-register Symbol t;
-{
- if (istypename(t->type, "boolean")) {
- printf(((Boolean) i) == true ? "true" : "false");
- } else if (istypename(t->type, "char")) {
- putchar('\'');
- printchar(i);
- putchar('\'');
- } else if (t->symvalue.rangev.lower >= 0) {
- printf("%lu", i);
- } else {
- printf("%ld", i);
- }
-}
-
-/*
- * Print out a null-terminated string (pointer to char)
- * starting at the given address.
- */
-
-private printstring(addr)
-Address addr;
-{
- register Address a;
- register Integer i, len;
- register Boolean endofstring;
- union {
- char ch[sizeof(Word)];
- int word;
- } u;
-
- putchar('"');
- a = addr;
- endofstring = false;
- while (not endofstring) {
- dread(&u, a, sizeof(u));
- i = 0;
- do {
- if (u.ch[i] == '\0') {
- endofstring = true;
- } else {
- printchar(u.ch[i]);
- }
- ++i;
- } while (i < sizeof(Word) and not endofstring);
- a += sizeof(Word);
- }
- putchar('"');
-}
-
-/*
- * Print out an enumerated value by finding the corresponding
- * name in the enumeration list.
- */
-
-private printenum(i, t)
-Integer i;
-Symbol t;
-{
- register Symbol e;
-
- e = t->chain;
- while (e != nil and e->symvalue.iconval != i) {
- e = e->chain;
- }
- if (e != nil) {
- printf("%s", symname(e));
- } else {
- printf("%d", i);
- }
-}
-