Commit 793c5046 authored by dcw's avatar dcw
Browse files

write -> print throughout! eg. PrintFred -> WriteFred

parent 9595df80
......@@ -32,14 +32,14 @@ static void deconskind_body( decln );
static void deconskind_inner( decln );
static void deconsproc_header( char * , shape );
static void deconsproc_body( decln , shape );
static void printproc_header( char * );
static void printproc_body( decln );
static void print_using_case( char * , char * , shapelist );
static void print_param( char * , param );
static void print_all_params( char * , shape );
static void writeproc_header( char * );
static void writeproc_body( decln );
static void write_using_case( char * , char * , shapelist );
static void write_param( char * , param );
static void write_all_params( char * , shape );
static void write_bool( void );
static char * lookup_type( char * );
static char * lookup_print_proc( char * );
static char * lookup_write_proc( char * );
static int predefined_type( char * );
#else
static void line();
......@@ -56,14 +56,14 @@ static void deconskind_body();
static void deconskind_inner();
static void deconsproc_header();
static void deconsproc_body();
static void printproc_header();
static void printproc_body();
static void print_using_case();
static void print_param();
static void print_all_params();
static void writeproc_header();
static void writeproc_body();
static void write_using_case();
static void write_param();
static void write_all_params();
static void write_bool();
static char * lookup_type();
static char * lookup_print_proc();
static char * lookup_write_proc();
static int predefined_type();
#endif
......@@ -216,8 +216,8 @@ static void defn_onetype( d ) decln d;
nl();
}
line( "(* Print function for %s *)", d->name );
printproc_header( d->name );
line( "(* write function for %s *)", d->name );
writeproc_header( d->name );
nl();
nl();
}
......@@ -340,7 +340,7 @@ static void impln_onetype( d ) decln d;
}
}
printproc_body( d );
writeproc_body( d );
}
......@@ -541,21 +541,21 @@ static void deconsproc_body( d, s ) decln d; shape s;
}
/* --------------------------- Print procedure --------------------------- */
/* --------------------------- Write procedure --------------------------- */
static void printproc_header( name ) char *name;
static void writeproc_header( name ) char *name;
{
line( "PROCEDURE Print%s( f : File; this : %s );", name, name );
line( "PROCEDURE Write%s( f : File; this : %s );", name, name );
}
static void printproc_body( d ) decln d;
static void writeproc_body( d ) decln d;
{
shapelist s;
shapelist shapes;
printproc_header( d->name );
writeproc_header( d->name );
nl();
line( "BEGIN" );
indent();
......@@ -565,7 +565,7 @@ static void printproc_body( d ) decln d;
line( "IF this = NIL" );
line( "THEN" );
indent();
print_all_params( d->name, shapes );
write_all_params( d->name, shapes );
line( "RETURN;" );
outdent();
line( "END; (* IF *)" );
......@@ -573,49 +573,49 @@ static void printproc_body( d ) decln d;
}
if( d->TagField )
{
print_using_case( "this^.tag", d->name, shapes );
write_using_case( "this^.tag", d->name, shapes );
} else if( d->Struct ) /* only one shape left */
{
print_all_params( d->name, shapes );
write_all_params( d->name, shapes );
} else /* enumerated type */
{
char tag[256];
sprintf( tag, "VAL(KindOf%s, this)", d->name );
print_using_case( tag, d->name, shapes );
write_using_case( tag, d->name, shapes );
}
outdent();
line( "END Print%s;", d->name );
line( "END Write%s;", d->name );
nl();
}
static void print_using_case( tag, dname, s ) char *tag, *dname; shapelist s;
static void write_using_case( tag, dname, s ) char *tag, *dname; shapelist s;
{
line( "CASE %s OF", tag );
for( ; s != NULL; s = s->next )
{
line( "|%sIs%s:", dname, s->name );
indent();
print_all_params( dname, s );
write_all_params( dname, s );
outdent();
}
line( "ELSE" );
indent();
line( "Abort( \"Print%s: impossible tag\" );", dname );
line( "Abort( \"Write%s: impossible tag\" );", dname );
outdent();
line( "END; (* CASE *)" );
}
static void print_param( sname, p ) char *sname; param p;
static void write_param( sname, p ) char *sname; param p;
{
line( "%s( f, this^.%s%s );",
lookup_print_proc(p->type), sname, p->name );
lookup_write_proc(p->type), sname, p->name );
}
static void print_all_params( dname, s ) char *dname; shape s;
static void write_all_params( dname, s ) char *dname; shape s;
{
printlist pl;
paramlist p;
......@@ -629,7 +629,7 @@ static void print_all_params( dname, s ) char *dname; shape s;
line( "WriteChar( f, '(' );" );
for( p = s->params; p != NULL; p = p->next )
{
print_param( s->name, p );
write_param( s->name, p );
}
line( "WriteChar( f, ')' );" );
}
......@@ -651,7 +651,7 @@ static void print_all_params( dname, s ) char *dname; shape s;
ASSERT( p != NULL,
("m2datadec: bad printitem number in shape %s of type %s\n", s->name, dname));
}
print_param( s->name, p );
write_param( s->name, p );
}
}
}
......@@ -686,7 +686,7 @@ struct typelookup
{
char *name;
char *type_name;
char *print_name;
char *write_name;
};
......@@ -723,7 +723,7 @@ static char *lookup_type( typename ) char *typename;
}
static char *lookup_print_proc( typename ) char *typename;
static char *lookup_write_proc( typename ) char *typename;
{
int predef;
static char tmp[256];
......@@ -731,11 +731,11 @@ static char *lookup_print_proc( typename ) char *typename;
predef = predefined_type( typename );
if( predef == -1 )
{
sprintf( tmp, "Print%s", typename );
sprintf( tmp, "Write%s", typename );
return tmp;
} else
{
return lookup[predef].print_name;
return lookup[predef].write_name;
}
}
......
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