Parameters
body.c
casestat.C
-char.c
char.tab
chk_expr.c
chk_expr.h
make.tokfile
misc.c
misc.h
-next.c
node.H
node.c
options.c
scope.H
scope.c
statement.g
-tab.c
tmpvar.C
tokenname.c
tokenname.h
LFLAGS = $(PROFILE)
LSRC = declar.c expression.c program.c statement.c tokenfile.c
LOBJ = declar.o expression.o program.o statement.o tokenfile.o
-CSRC = LLlex.c LLmessage.c body.c char.c chk_expr.c code.c\
+CSRC = LLlex.c LLmessage.c body.c chk_expr.c code.c\
cstoper.c def.c desig.c enter.c error.c idf.c input.c label.c\
- lookup.c main.c misc.c next.c node.c options.c readwrite.c\
+ lookup.c main.c misc.c node.c options.c readwrite.c\
scope.c symbol2str.c tokenname.c type.c typequiv.c progs.c
COBJ = LLlex.o LLmessage.o body.o casestat.o char.o chk_expr.o code.o\
cstoper.o def.o desig.o enter.o error.o idf.o input.o label.o\
# Keep the next entries up to date!
GENCFILES= Lpars.c declar.c expression.c program.c statement.c\
- tokenfile.c symbol2str.c casestat.c tmpvar.c
+ tokenfile.c symbol2str.c casestat.c tmpvar.c char.c next.c
SRC = Lpars.c $(CSRC) $(GENCFILES)
GENGFILES= tokenfile.g
GENHFILES= Lpars.h debugcst.h density.h errout.h idfsize.h inputtype.h\
next.c: $(NEXTFILES) ./make.next
./make.next $(NEXTFILES) > next.c
-char.c: char.tab tab
- tab -fchar.tab > char.c
+char.c: char.tab
+ $(EMHOME)/bin/tabgen -fchar.tab > char.c
-tab:
- $(CC) tab.c -o tab
depend:
sed '/^#AUTOAUTO/,$$d' Makefile > Makefile.new
echo '#AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO' >> Makefile.new
%
% CHARACTER CLASSES
%
-%C
-STGARB:\000-\200
+%iSTGARB
STSKIP: \r\t
STNL:\012\013\014
-STSIMP:()*+,-/;=@[]^{}
+STSIMP:-()*+,/;=@[]^{}
STCOMP:.:<>
STIDF:a-zA-Z
STSTR:'
CodeFil()
{
- if( !options['L'] )
+ if ( !options['L'] )
C_fil_dlb((label) 1, (arith) 0);
}
offset = CodeGtoDescr(df->prc_vis->sc_scope);
CodeFil();
- /* %%% initialiseren external files %%% */
- make_con(); call_ini(); /* %%%TYDELIJK%%% */
-
+ /* initialize external files */
+ make_extfl();
+ call_ini();
break;
case D_PROCEDURE :
/* link all definitions in a scope */
struct idf *df_idf; /* link back to the name */
struct scope *df_scope; /* scope in which this definition resides */
- unsigned int df_kind; /* the kind of this definition: */
+ long df_kind; /* the kind of this definition: */
#define D_PROCEDURE 0x00001 /* procedure */
#define D_FUNCTION 0x00002 /* function */
#define D_TYPE 0x00004 /* a type */
df->df_flags |= (D_PROGPAR | D_NOREG);
if( !strcmp(input, idlist->nd_IDF->id_text) ) {
df->var_name = input;
- set_inp(); /* %%% */
+ set_inp();
}
else {
df->var_name = output;
- set_outp(); /* %%% */
+ set_outp();
}
}
}
if( df = define(idlist->nd_IDF, CurrentScope,
D_PARAMETER) ) {
df->df_type = error_type;
- set_prog(df); /* %%% */
+ df->df_flags |= D_PROGPAR;
}
}
-/* TYDELYK !!!!!! */
-
#include "debug.h"
-#include <assert.h>
#include <em.h>
#include "LLlex.h"
#include "scope.h"
#include "type.h"
-arith cnt = 2; /* standaard input & output */
-int inpflag = 0; /* std input gedefinieerd of niet */
-int outpflag = 0; /* std output gedefinieerd of niet */
-label con_label;
+static int extflc; /* number of external files */
+static int inpflag = 0; /* input mentioned in heading ? */
+static int outpflag = 0; /* output mentioned in heading ? */
+static label extfl_label; /* label of array of file pointers */
set_inp()
{
outpflag = 1;
}
-set_prog(df)
- struct def *df;
-{
- cnt++;
- df->df_flags |= 0x40;
-}
-
-make_con()
+make_extfl()
{
register struct def *df;
- con_label = ++data_label;
- C_df_dlb(con_label);
- C_con_cst(cnt);
+ extfl_label = ++data_label;
+ C_df_dlb(extfl_label);
if( inpflag )
- C_con_dnam("input", (arith) 0);
+ C_con_dnam(input, (arith) 0);
else
- C_con_cst((arith) -1);
+ C_con_ucon("0", pointer_size);
if( outpflag )
- C_con_dnam("output", (arith) 0);
+ C_con_dnam(output, (arith) 0);
else
- C_con_cst((arith) -1);
+ C_con_ucon("0", pointer_size);
+
+ extflc = 2;
for( df = GlobalScope->sc_def; df; df = df->df_nextinscope )
- if( df->df_flags & 0x40 ) {
+ if( (df->df_flags & D_PROGPAR) &&
+ df->var_name != input && df->var_name != output) {
C_con_dnam(df->var_name, (arith) 0);
- cnt--;
+ extflc++;
}
-
- assert(cnt == 2);
}
call_ini()
{
C_lxl((arith) 0);
- C_lae_dlb(con_label, (arith) 0);
- C_zer(pointer_size);
+ C_lae_dlb(extfl_label, (arith) 0);
+ C_loc((arith) extflc);
C_lxa((arith) 0);
C_cal("_ini");
- C_asp(4 * pointer_size);
+ C_asp(3 * pointer_size + word_size);
}