Commit 128a414d authored by dcw's avatar dcw

reformatting.

split { onto new lines.
parent b67d5408
......@@ -19,33 +19,34 @@
#include "struct.h"
declnlist build_declnlist( name, s, next ) char *name; shapelist s; declnlist next;
declnlist build_declnlist(name,s,next) char *name; shapelist s; declnlist next;
{
declnlist new = NEW( struct declnlist_str );
COPYOF( new->name, name );
COPYOF(new->name, name);
new->shapes = s;
new->next = next;
return new;
}
void print_declnlist( d ) declnlist d;
void print_declnlist(d) declnlist d;
{
for( ; d!=NULL; d=d->next ) {
Puts( d->name );
Puts( " = " );
print_shapelist( d->shapes );
putchar( '\n' );
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 build_shapelist(id, p, pl, next) char *id; paramlist p; printlist pl; shapelist next;
{
shapelist new = NEW( struct shapelist_str );
COPYOF( new->name, id );
COPYOF(new->name, id);
new->params = p;
new->pl = pl;
new->next = next;
......@@ -53,55 +54,60 @@ shapelist build_shapelist( id, p, pl, next ) char *id; paramlist p; printlist pl
}
void print_shape( s ) shapelist s;
void print_shape(s) shapelist s;
{
Puts( s->name );
if( s->params )
Puts(s->name);
if (s->params)
{
Puts( "( " );
print_paramlist( s->params );
Puts( " )" );
Puts("( ");
print_paramlist(s->params);
Puts(" )");
}
putchar( ' ' );
print_printlist( s->pl );
putchar(' ');
print_printlist(s->pl);
}
void print_shapelist( s ) shapelist s;
void print_shapelist(s) shapelist s;
{
if( s != NULL ) {
print_shape( s );
for( s=s->next; s!=NULL; s=s->next ) {
Puts( "or " );
if (s != NULL)
{
print_shape(s);
for (s = s->next; s; s = s->next)
{
Puts("or ");
print_shape(s);
}
}
}
paramlist build_paramlist( type, id, next ) char *type, *id; paramlist next;
paramlist build_paramlist(type, id, next) char *type, *id; paramlist next;
{
paramlist new = NEW( struct paramlist_str );
COPYOF( new->type, type );
COPYOF( new->name, id );
COPYOF(new->type, type);
COPYOF(new->name, id);
new->next = next;
return new;
}
void print_paramlist( p ) paramlist p;
void print_paramlist(p) paramlist p;
{
if( p != NULL ) {
printf( "%s %s", p->type, p->name );
for( p=p->next; p!=NULL; p=p->next ) {
printf( ", %s %s", p->type, p->name );
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 build_printitem_str( s ) char *s;
printitem build_printitem_str(s) char *s;
{
printitem new = NEW( struct printitem_str );
......@@ -112,7 +118,7 @@ printitem build_printitem_str( s ) char *s;
}
printitem build_printitem_num( n ) int n;
printitem build_printitem_num(n) int n;
{
printitem new = NEW( struct printitem_str );
......@@ -123,15 +129,15 @@ printitem build_printitem_num( n ) int n;
}
void print_printitem( i ) printitem i;
void print_printitem(i) printitem i;
{
switch( i->tag )
switch(i->tag)
{
case printitem_is_num:
printf( "%d ", i->num );
printf("%d ", i->num);
break;
case printitem_is_str:
printf( "\"%s\" ", i->str );
printf("\"%s\" ", i->str);
break;
default:
ABORT( ("datadec: print_printitem called with printitem tag = %d\n", i->tag ) );
......@@ -139,7 +145,7 @@ void print_printitem( i ) printitem i;
}
printlist build_printlist( h, t ) printitem h; printlist t;
printlist build_printlist(h, t) printitem h; printlist t;
{
printlist new = NEW( struct printlist_str );
......@@ -149,10 +155,10 @@ printlist build_printlist( h, t ) printitem h; printlist t;
}
void print_printlist( p ) printlist p;
void print_printlist(p) printlist p;
{
for( ; p!=NULL; p=p->next )
for (; p; p = p->next)
{
print_printitem( p->item );
print_printitem(p->item);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment