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;
declnlist new = NEW_(declnlist);
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;
shapelist new = NEW_(shapelist);
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;
paramlist new = NEW_(paramlist);
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);
printitem new = NEW_( printitem );
new->tag = printitem_is_str;
new->str = s;
return new;
}
printitem new = NEW_(printitem);
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 ) );
}
}
printlist new = NEW_(printlist);
new->item = h;
new->next = t;
return new;
}