1: # include   <ingres.h>
   2: # include   <aux.h>
   3: # include   <symbol.h>
   4: # include   <tree.h>
   5: # include   "../decomp/globs.h"
   6: # include   <sccs.h>
   7: 
   8: SCCSID(@(#)prsym.c	8.2	1/17/85)
   9: 
  10: prsym(s)
  11: register SYMBOL *s;
  12: {
  13:     register union symvalue *p;
  14:     register int        type;
  15:     register int        len;
  16:     union symvalue      temp;
  17: 
  18:     type = s->type;
  19:     len = s->len & I1MASK;
  20:     p = &s->value;
  21:     if (type == S_VAR)
  22:     {
  23:         /* actually, S_VAR's are rendered the same as VAR's
  24: 		 * by call_ovqp70.c's ovqpnod()
  25: 		 */
  26:         printf("s_");   /* first part of "s_var" message */
  27:         type = VAR; /* execute var portion */
  28:     }
  29:     if (type == VAR)
  30:     {
  31:         printf("var:att#=%d:", p->sym_var.attno);
  32:         type = p->sym_var.varfrmt;
  33:         len = p->sym_var.varfrml;
  34:         if (type != CHAR)
  35:         {
  36:             /* move anytype to symvalue boundary */
  37:             bmove((char *)p->sym_var.valptr, (char *)&temp, sizeof *p);
  38:             p = &temp;
  39:         }
  40:     }
  41:     xputchar(type);
  42:     printf("%d:value='", len);
  43:     switch (type)
  44:     {
  45:       case AND:
  46:         printf("%d [AND] (operator)", p->sym_op.opno);
  47:         break;
  48:       case AOP:
  49:         printf("%d [AOP] (operator)", p->sym_op.opno);
  50:         break;
  51:       case BOP:
  52:         printf("%d [BOP] (operator)", p->sym_op.opno);
  53:         break;
  54:       case OR:
  55:         printf("%d [OR] (operator)", p->sym_op.opno);
  56:         break;
  57:       case RESDOM:
  58:         printf("%d [RESDOM] (operator)", p->sym_op.opno);
  59:         break;
  60:       case UOP:
  61:         printf("%d [UOP] (operator)", p->sym_op.opno);
  62:         break;
  63:       case COP:
  64:         printf("%d [COP] (operator)", p->sym_op.opno);
  65:         break;
  66: 
  67:       case INT:
  68:         switch (len)
  69:         {
  70:           case 1:
  71:             printf("%d", p->sym_data.i1type);
  72:             break;
  73: 
  74:           case 2:
  75:             printf("%d", p->sym_data.i2type);
  76:             break;
  77: 
  78:           case 4:
  79:             printf("%ld", p->sym_data.i4type);
  80:         }
  81:         break;
  82: 
  83:       case FLOAT:
  84:         printf("%10.3f", p->sym_data.f4type);
  85:         break;
  86: 
  87:       case RESULTID:
  88:       case SOURCEID:
  89:       case CHAR:
  90:         printf("%x=", p->sym_data.c0type);
  91:         prstr(p->sym_data.c0type, len);
  92:         break;
  93: 
  94:       case AGHEAD:
  95:         printf("AGHEAD (delim)");
  96:         break;
  97:       case BYHEAD:
  98:         printf("BYHEAD (delim)");
  99:         break;
 100:       case QLEND:
 101:         printf("QLEND (delim)");
 102:         break;
 103:       case ROOT:
 104:         printf("ROOT (delim)");
 105:         break;
 106:       case TREE:
 107:         printf("TREE (delim)");
 108:         break;
 109: 
 110:       case CHANGESTRAT:
 111:       case REOPENRES:
 112:       case EXIT:
 113:       case QMODE:
 114:       case RETVAL:
 115:       case USERQRY:
 116:         if (len)
 117:             printf("%d", p->sym_op.opno);
 118:         printf(" (status)");
 119:         break;
 120: 
 121:       default:
 122:         printf("\nError in prsym: bad type= %d\n", type);
 123:     }
 124:     printf("'\n");
 125: }
 126: 
 127: 
 128: prstack(s)
 129: register SYMBOL *s;
 130: {
 131:     if (s->type == CHAR)
 132:     {
 133:         printf("c%d:value='%x=", s->len,s->value.sym_data.cptype);
 134:         prstr(s->value.sym_data.cptype, s->len & I1MASK);
 135:         printf("'\n");
 136:     }
 137:     else
 138:         prsym(s);
 139: }
 140: 
 141: 
 142: 
 143: prstr(p, l)
 144: register char   *p;
 145: register int    l;
 146: {
 147:     while (--l >= 0)
 148:         putchar(*p++);
 149: }

Defined functions

prstr defined in line 143; used 2 times
Last modified: 1986-04-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 900
Valid CSS Valid XHTML 1.0 Strict