Commit 0c6335e9 authored by dcw's avatar dcw
Browse files

minor changes, defined macro Puts as fputs(,stdout)

and used instead of some printfs.
added print_shape to simplify things a teensy weensy bit.
parent 6a6709cc
......@@ -33,9 +33,10 @@ declnlist build_declnlist( name, s, next ) char *name; shapelist s; declnlist ne
void print_declnlist( d ) declnlist d;
{
for( ; d!=NULL; d=d->next ) {
printf( "%s = ", d->name );
Puts( d->name );
Puts( " = " );
print_shapelist( d->shapes );
printf( "\n" );
putchar( '\n' );
}
}
......@@ -44,7 +45,7 @@ shapelist build_shapelist( id, p, pl, next ) char *id; paramlist p; printlist pl
{
shapelist new = NEW( struct shapelist_str );
COPYOF( new->tagname, id );
COPYOF( new->name, id );
new->params = p;
new->pl = pl;
new->next = next;
......@@ -52,18 +53,27 @@ shapelist build_shapelist( id, p, pl, next ) char *id; paramlist p; printlist pl
}
void print_shape( s ) shapelist s;
{
Puts( s->name );
if( s->params )
{
Puts( "( " );
print_paramlist( s->params );
Puts( " )" );
}
putchar( ' ' );
print_printlist( s->pl );
}
void print_shapelist( s ) shapelist s;
{
if( s != NULL ) {
printf( "%s( ", s->tagname );
print_paramlist( s->params );
printf( " ) " );
print_printlist( s->pl );
print_shape( s );
for( s=s->next; s!=NULL; s=s->next ) {
printf( " or %s( ", s->tagname );
print_paramlist( s->params );
printf( " ) " );
print_printlist( s->pl );
Puts( "or " );
print_shape(s);
}
}
}
......
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