Newer
Older
/*
* DATA STRUCTURES
* ==== ==========
*
* FOR THE
* === ===
*
* DATA DECLARATION BUILDER
* ==== =========== =======
*
* This module provides the internal structures needed
* for the data declaration builder. It is itself the
* sort of output generated by the program (although a
* bit optimized!)
declnlist build_declnlist(name,s,next) char *name; shapelist s; declnlist next;
for ( ; d; d = d->next)
{
Puts(d->name);
Puts(" = ");
print_shapelist(d->shapes);
putchar('\n');
shapelist build_shapelist(id, p, pl, next) char *id; paramlist p; printlist pl; shapelist next;
if (s != NULL)
{
print_shape(s);
for (s = s->next; s; s = s->next)
{
Puts("or ");
paramlist build_paramlist(type, id, next) char *type, *id; paramlist next;
if (p != NULL)
{
printf("%s %s", p->type, p->name);
for (p = p->next; p; p = p->next)
{
printf(", %s %s", p->type, p->name);
new->tag = printitem_is_str;
new->str = s;
return new;
}
new->tag = printitem_is_num;
new->num = n;
return new;
}
{
case printitem_is_num:
break;
case printitem_is_str:
break;
default:
ABORT( ("datadec: print_printitem called with printitem tag = %d\n", i->tag ) );
}
}
new->item = h;
new->next = t;
return new;
}
param findnthparam( n, p, sname, dname ) int n; paramlist p; char *sname, *dname;
{
int m = n;
for( ; p != NULL && --m; p = p->next );
ASSERT( p != NULL,
("datadec: bad print number %d in shape %s of type %s\n",
m, sname, dname));
return p;
}