Many improvements by Hans van Eck

This commit is contained in:
ceriel
1989-05-03 10:30:22 +00:00
parent 19638876a1
commit a94dec52d8
37 changed files with 1743 additions and 381 deletions

View File

@@ -1,6 +1,7 @@
#include "debug.h"
#include <em.h>
#include <assert.h>
#include "LLlex.h"
#include "def.h"
@@ -25,35 +26,53 @@ set_outp()
make_extfl()
{
register struct def *df;
if( err_occurred ) return;
extfl_label = ++data_label;
C_df_dlb(extfl_label);
if( inpflag )
if( inpflag ) {
C_ina_dnam(input);
C_con_dnam(input, (arith) 0);
}
else
C_con_ucon("0", pointer_size);
if( outpflag )
if( outpflag ) {
C_ina_dnam(output);
C_con_dnam(output, (arith) 0);
}
else
C_con_ucon("0", pointer_size);
extflc = 2;
for( df = GlobalScope->sc_def; df; df = df->df_nextinscope )
if( (df->df_flags & D_PROGPAR) &&
df->var_name != input && df->var_name != output) {
C_con_dnam(df->var_name, (arith) 0);
extflc++;
}
/* Process the identifiers in the global scope (at this point only
* the program parameters) in order of specification.
*/
make_extfl_args( GlobalScope->sc_def );
}
make_extfl_args(df)
register struct def *df;
{
if( !df ) return;
make_extfl_args(df->df_nextinscope);
assert(df->df_flags & D_PROGPAR);
if( df->var_name != input && df->var_name != output ) {
C_ina_dnam(df->var_name);
C_con_dnam(df->var_name, (arith) 0);
extflc++;
}
}
call_ini()
{
C_lxl((arith) 0);
C_lae_dlb(extfl_label, (arith) 0);
if( extflc )
C_lae_dlb(extfl_label, (arith) 0);
else
C_zer(pointer_size);
C_loc((arith) extflc);
C_lxa((arith) 0);
C_cal("_ini");