+
+ /* print the chain as it is written in the source: */
+ /* start with the last entry */
+ for (type = start; type && type->next; type = type->next)
+ ;
+ while (type)
+ {
+ if (IS_DECL (type))
+ {
+ if (DCL_PTR_VOLATILE (type)) {
+ fprintf (of, "volatile ");
+ }
+ switch (DCL_TYPE (type))
+ {
+ case FUNCTION:
+ fprintf (of, "function ");
+ break;
+ case GPOINTER:
+ if (DCL_PTR_CONST (type))
+ fprintf (of, "const ");
+ fprintf (of, "generic * ");
+ break;
+ case CPOINTER:
+ if (DCL_PTR_CONST (type))
+ fprintf (of, "const ");
+ fprintf (of, "code * ");
+ break;
+ case FPOINTER:
+ if (DCL_PTR_CONST (type))
+ fprintf (of, "const ");
+ fprintf (of, "xdata * ");
+ break;
+ case EEPPOINTER:
+ if (DCL_PTR_CONST (type))
+ fprintf (of, "const ");
+ fprintf (of, "eeprom * ");
+ break;
+
+ case POINTER:
+ if (DCL_PTR_CONST (type))
+ fprintf (of, "const ");
+ fprintf (of, "near *");
+ break;
+ case IPOINTER:
+ if (DCL_PTR_CONST (type))
+ fprintf (of, "const ");
+ fprintf (of, "idata * ");
+ break;
+ case PPOINTER:
+ if (DCL_PTR_CONST (type))
+ fprintf (of, "const ");
+ fprintf (of, "pdata * ");
+ break;
+ case UPOINTER:
+ if (DCL_PTR_CONST (type))
+ fprintf (of, "const ");
+ fprintf (of, "unkown * ");
+ break;
+ case ARRAY:
+ fprintf (of, "[] ");
+ break;
+ }
+ }
+ else
+ {
+ switch (SPEC_SCLS(type))
+ {
+ case S_DATA: fprintf (of, "data "); break;
+ case S_XDATA: fprintf (of, "xdata "); break;
+ case S_SFR: fprintf (of, "sfr "); break;
+ case S_SBIT: fprintf (of, "sbit "); break;
+ case S_CODE: fprintf (of, "code "); break;
+ case S_IDATA: fprintf (of, "idata "); break;
+ case S_PDATA: fprintf (of, "pdata "); break;
+ case S_LITERAL: fprintf (of, "literal "); break;
+ case S_STACK: fprintf (of, "stack "); break;
+ case S_XSTACK: fprintf (of, "xstack "); break;
+ case S_BIT: fprintf (of, "bit "); break;
+ case S_EEPROM: fprintf (of, "eeprom "); break;
+ default: break;
+ }
+
+ if (SPEC_VOLATILE (type))
+ fprintf (of, "volatile ");
+ if (SPEC_USIGN (type))
+ fprintf (of, "unsigned ");
+ if (SPEC_CONST (type))
+ fprintf (of, "const ");
+
+ switch (SPEC_NOUN (type))
+ {
+ case V_INT:
+ if (IS_LONG (type))
+ fprintf (of, "long ");
+ fprintf (of, "int");
+ break;
+
+ case V_CHAR:
+ fprintf (of, "char");
+ break;
+
+ case V_VOID:
+ fprintf (of, "void");
+ break;
+
+ case V_FLOAT:
+ fprintf (of, "float");
+ break;
+
+ case V_STRUCT:
+ fprintf (of, "struct %s", SPEC_STRUCT (type)->tag);
+ break;
+
+ case V_SBIT:
+ fprintf (of, "sbit");
+ break;
+
+ case V_BIT:
+ fprintf (of, "bit {%d,%d}", SPEC_BSTR (type), SPEC_BLEN (type));
+ break;
+
+ case V_DOUBLE:
+ fprintf (of, "double");
+ break;
+
+ default:
+ fprintf (of, "unknown type");
+ break;
+ }
+ }
+ /* search entry in list before "type" */
+ for (search = start; search && search->next != type;)
+ search = search->next;
+ type = search;
+ if (type)
+ fputc (' ', of);