Use awk program to generate distinct C_xxx routines in separate files.

This commit is contained in:
bruce 1987-02-06 14:13:22 +00:00
parent 102790400d
commit d5e9250405
3 changed files with 97 additions and 147 deletions

View file

@ -4,17 +4,38 @@ INSTALL = $(EMHOME)/modules/install
COMPARE = $(EMHOME)/modules/compare COMPARE = $(EMHOME)/modules/compare
LIBOPT = libopt.a LIBOPT = libopt.a
CSRC = nopt.c aux.c mkcalls.c pseudo.c outputdfa.c outcalls.c\ # set HOWMUCH to head -20 to limit number of patterns used
#HOWMUCH = head -20
HOWMUCH = cat
LEXLIB = -ll
INCLDIR = -I$(EMHOME)/h -I$(EMHOME)/modules/h -I$(EMHOME)/modules/pkg
PREFLAGS = $(INCLDIR) -DPRIVATE=static
# Enable the next line to produce a version that output's the line number
# from the patterns file each time an optimization is performed.
#PREFLAG = $(PREFLAGS) -DSTATS
PROFFLAG = -O
CFLAGS = $(PREFLAGS) $(PROFFLAG)
LLOPT =
CMD = '$(CC) -c $(CFLAGS)'
.SUFFIXES: .d .r
.r.d:; CMD=$(CMD); export CMD; awk -f makefuns.awk $*.r | sh
touch $@
CSRC = nopt.c aux.c mkcalls.c outputdfa.c outcalls.c\
findworst.c initlex.c findworst.c initlex.c
SRCS = Makefile nopt.h parser.h parser.g syntax.l patterns $(CSRC) SRCS = Makefile nopt.h parser.h parser.g syntax.l pseudo.r patterns $(CSRC)
NOFILES = nopt.o dfa.o trans.o incalls.o pseudo.o aux.o mkcalls.o NOFILES = nopt.o dfa.o trans.o aux.o mkcalls.o
POFILES = parser.o syntax.o outputdfa.o outcalls.o findworst.o initlex.o Lpars.o POFILES = parser.o syntax.o outputdfa.o outcalls.o findworst.o initlex.o Lpars.o
GENFILES = Lpars.h Lpars.c parserdummy parser.c syntax.c dfadummy\ GENFILES = Lpars.h Lpars.c parserdummy parser.c syntax.c dfadummy\
dfa.c dfa.c.save trans.c trans.c.save incalls.c incalls.c.save dfa.c dfa.c.save trans.c trans.c.save incalls.d incalls.r\
incalls.r.save pseudo.d
all: $(LIBOPT) all: $(LIBOPT)
@ -31,37 +52,25 @@ opr:
make pr | opr make pr | opr
clean: clean:
rm -f C_*.o
rm -f C_*.c
rm -f $(NOFILES) $(POFILES) $(GENFILES) parser libopt.a rm -f $(NOFILES) $(POFILES) $(GENFILES) parser libopt.a
# set HOWMUCH to head -20 to limit number of patterns used $(LIBOPT): dfadummy $(NOFILES) pseudo.d incalls.d
#HOWMUCH = head -20
HOWMUCH = cat
LEXLIB = -ll
INCLDIR = -I$(EMHOME)/h -I$(EMHOME)/modules/h -I$(EMHOME)/modules/pkg
PREFLAGS = $(INCLDIR) -DPRIVATE=static
# Enable the next line to produce a version that output's the line number
# from the patterns file each time an optimization is performed.
#PREFLAGS = $(PREFLAGS) -DSTATS
PROFFLAG = -O
CFLAGS = $(PREFLAGS) $(PROFFLAG)
LLOPT =
$(LIBOPT): dfadummy $(NOFILES)
rm -f $(LIBOPT) rm -f $(LIBOPT)
ar rc $(LIBOPT) $(NOFILES) ar rc $(LIBOPT) C_*.o $(NOFILES)
-sh -c 'ranlib $(LIBOPT)' -sh -c 'ranlib $(LIBOPT)'
dfadummy: patterns parser dfadummy: patterns parser
-mv dfa.c dfa.c.save -mv dfa.c dfa.c.save
-mv trans.c trans.c.save -mv trans.c trans.c.save
-mv incalls.c incalls.c.save -mv incalls.r incalls.r.save
-/lib/cpp patterns | $(HOWMUCH) >/tmp/patts -/lib/cpp patterns | $(HOWMUCH) >/tmp/patts
parser </tmp/patts parser </tmp/patts
-rm /tmp/patts -rm /tmp/patts
-if cmp -s dfa.c dfa.c.save; then mv dfa.c.save dfa.c; else exit 0; fi -if cmp -s dfa.c dfa.c.save; then mv dfa.c.save dfa.c; else exit 0; fi
-if cmp -s trans.c trans.c.save; then mv trans.c.save trans.c; else exit 0; fi -if cmp -s trans.c trans.c.save; then mv trans.c.save trans.c; else exit 0; fi
-if cmp -s incalls.c incalls.c.save; then mv incalls.c.save incalls.c; else exit 0; fi -if cmp -s incalls.r incalls.r.save; then mv incalls.r.save incalls.r; else exit 0; fi
touch dfadummy touch dfadummy
# How to build program to parse patterns table and build c files. # How to build program to parse patterns table and build c files.
@ -80,12 +89,13 @@ parserdummy: parser.g
touch parserdummy touch parserdummy
nopt.o: nopt.h nopt.o: nopt.h
dfa.o: nopt.h
aux.o: nopt.h aux.o: nopt.h
trans.o: nopt.h pseudo.d: nopt.h
pseudo.o: nopt.h
incalls.o: nopt.h
mkcalls.o: nopt.h mkcalls.o: nopt.h
dfa.o: nopt.h dfadummy
trans.o: nopt.h dfadummy
incalls.d: nopt.h
incalls.r: dfadummy
parser.o: Lpars.h parser.h parser.o: Lpars.h parser.h
Lpars.o: Lpars.h Lpars.o: Lpars.h

View file

@ -9,30 +9,23 @@ OO_mkcalls(p)
{ {
switch(p->opcode) { switch(p->opcode) {
case op_aar: case op_aar:
if(p->argtype!=none_ptyp) O_aar(p->acst); O_aar(p->acst); break;
else O_aar_narg(); break;
case op_adf: case op_adf:
if(p->argtype!=none_ptyp) O_adf(p->acst); O_adf(p->acst); break;
else O_adf_narg(); break;
case op_adi: case op_adi:
if(p->argtype!=none_ptyp) O_adi(p->acst); O_adi(p->acst); break;
else O_adi_narg(); break;
case op_adp: case op_adp:
O_adp(p->acst); break; O_adp(p->acst); break;
case op_ads: case op_ads:
if(p->argtype!=none_ptyp) O_ads(p->acst); O_ads(p->acst); break;
else O_ads_narg(); break;
case op_adu: case op_adu:
if(p->argtype!=none_ptyp) O_adu(p->acst); O_adu(p->acst); break;
else O_adu_narg(); break;
case op_and: case op_and:
if(p->argtype!=none_ptyp) O_and(p->acst); O_and(p->acst); break;
else O_and_narg(); break;
case op_asp: case op_asp:
O_asp(p->acst); break; O_asp(p->acst); break;
case op_ass: case op_ass:
if(p->argtype!=none_ptyp) O_ass(p->acst); O_ass(p->acst); break;
else O_ass_narg(); break;
case op_beq: case op_beq:
O_beq((label)p->acst); break; O_beq((label)p->acst); break;
case op_bge: case op_bge:
@ -44,8 +37,7 @@ OO_mkcalls(p)
case op_blm: case op_blm:
O_blm(p->acst); break; O_blm(p->acst); break;
case op_bls: case op_bls:
if(p->argtype!=none_ptyp) O_bls(p->acst); O_bls(p->acst); break;
else O_bls_narg(); break;
case op_blt: case op_blt:
O_blt((label)p->acst); break; O_blt((label)p->acst); break;
case op_bne: case op_bne:
@ -69,28 +61,21 @@ OO_mkcalls(p)
case op_ciu: case op_ciu:
O_ciu(); break; O_ciu(); break;
case op_cmf: case op_cmf:
if(p->argtype!=none_ptyp) O_cmf(p->acst); O_cmf(p->acst); break;
else O_cmf_narg(); break;
case op_cmi: case op_cmi:
if(p->argtype!=none_ptyp) O_cmi(p->acst); O_cmi(p->acst); break;
else O_cmi_narg(); break;
case op_cmp: case op_cmp:
O_cmp(); break; O_cmp(); break;
case op_cms: case op_cms:
if(p->argtype!=none_ptyp) O_cms(p->acst); O_cms(p->acst); break;
else O_cms_narg(); break;
case op_cmu: case op_cmu:
if(p->argtype!=none_ptyp) O_cmu(p->acst); O_cmu(p->acst); break;
else O_cmu_narg(); break;
case op_com: case op_com:
if(p->argtype!=none_ptyp) O_com(p->acst); O_com(p->acst); break;
else O_com_narg(); break;
case op_csa: case op_csa:
if(p->argtype!=none_ptyp) O_csa(p->acst); O_csa(p->acst); break;
else O_csa_narg(); break;
case op_csb: case op_csb:
if(p->argtype!=none_ptyp) O_csb(p->acst); O_csb(p->acst); break;
else O_csb_narg(); break;
case op_cuf: case op_cuf:
O_cuf(); break; O_cuf(); break;
case op_cui: case op_cui:
@ -109,26 +94,19 @@ OO_mkcalls(p)
case op_dup: case op_dup:
O_dup(p->acst); break; O_dup(p->acst); break;
case op_dus: case op_dus:
if(p->argtype!=none_ptyp) O_dus(p->acst); O_dus(p->acst); break;
else O_dus_narg(); break;
case op_dvf: case op_dvf:
if(p->argtype!=none_ptyp) O_dvf(p->acst); O_dvf(p->acst); break;
else O_dvf_narg(); break;
case op_dvi: case op_dvi:
if(p->argtype!=none_ptyp) O_dvi(p->acst); O_dvi(p->acst); break;
else O_dvi_narg(); break;
case op_dvu: case op_dvu:
if(p->argtype!=none_ptyp) O_dvu(p->acst); O_dvu(p->acst); break;
else O_dvu_narg(); break;
case op_exg: case op_exg:
if(p->argtype!=none_ptyp) O_exg(p->acst); O_exg(p->acst); break;
else O_exg_narg(); break;
case op_fef: case op_fef:
if(p->argtype!=none_ptyp) O_fef(p->acst); O_fef(p->acst); break;
else O_fef_narg(); break;
case op_fif: case op_fif:
if(p->argtype!=none_ptyp) O_fif(p->acst); O_fif(p->acst); break;
else O_fif_narg(); break;
case op_fil: case op_fil:
if(p->argtype==nof_ptyp) O_fil_dlb(p->adlb, p->anoff); if(p->argtype==nof_ptyp) O_fil_dlb(p->adlb, p->anoff);
else O_fil_dnam(p->adnam, p->asoff); break; else O_fil_dnam(p->adnam, p->asoff); break;
@ -143,11 +121,9 @@ OO_mkcalls(p)
case op_inl: case op_inl:
O_inl(p->acst); break; O_inl(p->acst); break;
case op_inn: case op_inn:
if(p->argtype!=none_ptyp) O_inn(p->acst); O_inn(p->acst); break;
else O_inn_narg(); break;
case op_ior: case op_ior:
if(p->argtype!=none_ptyp) O_ior(p->acst); O_ior(p->acst); break;
else O_ior_narg(); break;
case op_lab: case op_lab:
O_df_ilb(p->alab); break; O_df_ilb(p->alab); break;
case op_lae: case op_lae:
@ -156,8 +132,7 @@ OO_mkcalls(p)
case op_lal: case op_lal:
O_lal(p->acst); break; O_lal(p->acst); break;
case op_lar: case op_lar:
if(p->argtype!=none_ptyp) O_lar(p->acst); O_lar(p->acst); break;
else O_lar_narg(); break;
case op_ldc: case op_ldc:
O_ldc(p->acst); break; O_ldc(p->acst); break;
case op_lde: case op_lde:
@ -191,8 +166,7 @@ OO_mkcalls(p)
case op_lor: case op_lor:
O_lor(p->acst); break; O_lor(p->acst); break;
case op_los: case op_los:
if(p->argtype!=none_ptyp) O_los(p->acst); O_los(p->acst); break;
else O_los_narg(); break;
case op_lpb: case op_lpb:
O_lpb(); break; O_lpb(); break;
case op_lpi: case op_lpi:
@ -202,58 +176,43 @@ OO_mkcalls(p)
case op_lxl: case op_lxl:
O_lxl(p->acst); break; O_lxl(p->acst); break;
case op_mlf: case op_mlf:
if(p->argtype!=none_ptyp) O_mlf(p->acst); O_mlf(p->acst); break;
else O_mlf_narg(); break;
case op_mli: case op_mli:
if(p->argtype!=none_ptyp) O_mli(p->acst); O_mli(p->acst); break;
else O_mli_narg(); break;
case op_mlu: case op_mlu:
if(p->argtype!=none_ptyp) O_mlu(p->acst); O_mlu(p->acst); break;
else O_mlu_narg(); break;
case op_mon: case op_mon:
O_mon(); break; O_mon(); break;
case op_ngf: case op_ngf:
if(p->argtype!=none_ptyp) O_ngf(p->acst); O_ngf(p->acst); break;
else O_ngf_narg(); break;
case op_ngi: case op_ngi:
if(p->argtype!=none_ptyp) O_ngi(p->acst); O_ngi(p->acst); break;
else O_ngi_narg(); break;
case op_nop: case op_nop:
O_nop(); break; O_nop(); break;
case op_rck: case op_rck:
if(p->argtype!=none_ptyp) O_rck(p->acst); O_rck(p->acst); break;
else O_rck_narg(); break;
case op_ret: case op_ret:
O_ret(p->acst); break; O_ret(p->acst); break;
case op_rmi: case op_rmi:
if(p->argtype!=none_ptyp) O_rmi(p->acst); O_rmi(p->acst); break;
else O_rmi_narg(); break;
case op_rmu: case op_rmu:
if(p->argtype!=none_ptyp) O_rmu(p->acst); O_rmu(p->acst); break;
else O_rmu_narg(); break;
case op_rol: case op_rol:
if(p->argtype!=none_ptyp) O_rol(p->acst); O_rol(p->acst); break;
else O_rol_narg(); break;
case op_ror: case op_ror:
if(p->argtype!=none_ptyp) O_ror(p->acst); O_ror(p->acst); break;
else O_ror_narg(); break;
case op_rtt: case op_rtt:
O_rtt(); break; O_rtt(); break;
case op_sar: case op_sar:
if(p->argtype!=none_ptyp) O_sar(p->acst); O_sar(p->acst); break;
else O_sar_narg(); break;
case op_sbf: case op_sbf:
if(p->argtype!=none_ptyp) O_sbf(p->acst); O_sbf(p->acst); break;
else O_sbf_narg(); break;
case op_sbi: case op_sbi:
if(p->argtype!=none_ptyp) O_sbi(p->acst); O_sbi(p->acst); break;
else O_sbi_narg(); break;
case op_sbs: case op_sbs:
if(p->argtype!=none_ptyp) O_sbs(p->acst); O_sbs(p->acst); break;
else O_sbs_narg(); break;
case op_sbu: case op_sbu:
if(p->argtype!=none_ptyp) O_sbu(p->acst); O_sbu(p->acst); break;
else O_sbu_narg(); break;
case op_sde: case op_sde:
if(p->argtype==nof_ptyp) O_sde_dlb(p->adlb, p->anoff); if(p->argtype==nof_ptyp) O_sde_dlb(p->adlb, p->anoff);
else O_sde_dnam(p->adnam, p->asoff); break; else O_sde_dnam(p->adnam, p->asoff); break;
@ -262,8 +221,7 @@ OO_mkcalls(p)
case op_sdl: case op_sdl:
O_sdl(p->acst); break; O_sdl(p->acst); break;
case op_set: case op_set:
if(p->argtype!=none_ptyp) O_set(p->acst); O_set(p->acst); break;
else O_set_narg(); break;
case op_sig: case op_sig:
O_sig(); break; O_sig(); break;
case op_sil: case op_sil:
@ -271,17 +229,13 @@ OO_mkcalls(p)
case op_sim: case op_sim:
O_sim(); break; O_sim(); break;
case op_sli: case op_sli:
if(p->argtype!=none_ptyp) O_sli(p->acst); O_sli(p->acst); break;
else O_sli_narg(); break;
case op_slu: case op_slu:
if(p->argtype!=none_ptyp) O_slu(p->acst); O_slu(p->acst); break;
else O_slu_narg(); break;
case op_sri: case op_sri:
if(p->argtype!=none_ptyp) O_sri(p->acst); O_sri(p->acst); break;
else O_sri_narg(); break;
case op_sru: case op_sru:
if(p->argtype!=none_ptyp) O_sru(p->acst); O_sru(p->acst); break;
else O_sru_narg(); break;
case op_ste: case op_ste:
if(p->argtype==nof_ptyp) O_ste_dlb(p->adlb, p->anoff); if(p->argtype==nof_ptyp) O_ste_dlb(p->adlb, p->anoff);
else O_ste_dnam(p->adnam, p->asoff); break; else O_ste_dnam(p->adnam, p->asoff); break;
@ -294,8 +248,7 @@ OO_mkcalls(p)
case op_str: case op_str:
O_str(p->acst); break; O_str(p->acst); break;
case op_sts: case op_sts:
if(p->argtype!=none_ptyp) O_sts(p->acst); O_sts(p->acst); break;
else O_sts_narg(); break;
case op_teq: case op_teq:
O_teq(); break; O_teq(); break;
case op_tge: case op_tge:
@ -311,13 +264,11 @@ OO_mkcalls(p)
case op_trp: case op_trp:
O_trp(); break; O_trp(); break;
case op_xor: case op_xor:
if(p->argtype!=none_ptyp) O_xor(p->acst); O_xor(p->acst); break;
else O_xor_narg(); break;
case op_zeq: case op_zeq:
O_zeq((label)p->acst); break; O_zeq((label)p->acst); break;
case op_zer: case op_zer:
if(p->argtype!=none_ptyp) O_zer(p->acst); O_zer(p->acst); break;
else O_zer_narg(); break;
case op_zge: case op_zge:
O_zge((label)p->acst); break; O_zge((label)p->acst); break;
case op_zgt: case op_zgt:
@ -332,8 +283,7 @@ OO_mkcalls(p)
if(p->argtype==nof_ptyp) O_zre_dlb(p->adlb, p->anoff); if(p->argtype==nof_ptyp) O_zre_dlb(p->adlb, p->anoff);
else O_zre_dnam(p->adnam, p->asoff); break; else O_zre_dnam(p->adnam, p->asoff); break;
case op_zrf: case op_zrf:
if(p->argtype!=none_ptyp) O_zrf(p->acst); O_zrf(p->acst); break;
else O_zrf_narg(); break;
case op_zrl: case op_zrl:
O_zrl(p->acst); break; O_zrl(p->acst); break;
} }

View file

@ -9,17 +9,16 @@ outputincalls()
struct idf *op; struct idf *op;
int opcode; int opcode;
char *s; char *s;
if(!sys_open("incalls.c",OP_WRITE,&ofile)) { if(!sys_open("incalls.r",OP_WRITE,&ofile)) {
fprint(STDERR,"Fatal Error: cannot open output file incalls.c\n"); fprint(STDERR,"Fatal Error: cannot open output file incalls.r\n");
sys_stop(S_EXIT); sys_stop(S_EXIT);
} }
fprint(ofile,"#include \"nopt.h\"\n\n");
for(op=ops;op!=(struct idf *)NULL;op=op->id_nextidf) { for(op=ops;op!=(struct idf *)NULL;op=op->id_nextidf) {
opcode = op->id_opcode; opcode = op->id_opcode;
s = op->id_text; s = op->id_text;
switch(op->id_argfmt) { switch(op->id_argfmt) {
case NOARG: case NOARG:
fprint(ofile,"\nC_%s() {\n",s); fprint(ofile,"%s\t|\t|\n",s);
if(op->id_used) { if(op->id_used) {
fprint(ofile,"\tOO_inop(op_%s);\n",s); fprint(ofile,"\tOO_inop(op_%s);\n",s);
fprint(ofile,"\tOO_dfa(op_%s);\n",s); fprint(ofile,"\tOO_dfa(op_%s);\n",s);
@ -28,10 +27,9 @@ outputincalls()
fprint(ofile,"\tFLUSHDFA();\n"); fprint(ofile,"\tFLUSHDFA();\n");
fprint(ofile,"\tO_%s();\n",s); fprint(ofile,"\tO_%s();\n",s);
} }
fprint(ofile,"}\n",s);
break; break;
case CSTOPT: case CSTOPT:
fprint(ofile,"\nC_%s_narg() {\n",s); fprint(ofile,"%s_narg\t|\t|\n",s);
if(op->id_used) { if(op->id_used) {
fprint(ofile,"\tOO_inop(op_%s);\n",s); fprint(ofile,"\tOO_inop(op_%s);\n",s);
fprint(ofile,"\tOO_dfa(op_%s);\n",s); fprint(ofile,"\tOO_dfa(op_%s);\n",s);
@ -40,10 +38,9 @@ outputincalls()
fprint(ofile,"\tFLUSHDFA();\n"); fprint(ofile,"\tFLUSHDFA();\n");
fprint(ofile,"\tO_%s_narg();\n",s); fprint(ofile,"\tO_%s_narg();\n",s);
} }
fprint(ofile,"}\n",s);
/* fall thru */ /* fall thru */
case CST: case CST:
fprint(ofile,"\nC_%s(n) int n; {\n",s); fprint(ofile,"%s\t| int:n\t|\n",s);
if(op->id_used) { if(op->id_used) {
fprint(ofile,"\tOO_incst(op_%s,n);\n",s); fprint(ofile,"\tOO_incst(op_%s,n);\n",s);
fprint(ofile,"\tOO_dfa(op_%s);\n",s); fprint(ofile,"\tOO_dfa(op_%s);\n",s);
@ -52,10 +49,9 @@ outputincalls()
fprint(ofile,"\tFLUSHDFA();\n"); fprint(ofile,"\tFLUSHDFA();\n");
fprint(ofile,"\tO_%s(n);\n",s); fprint(ofile,"\tO_%s(n);\n",s);
} }
fprint(ofile,"}\n",s);
break; break;
case DEFILB: case DEFILB:
fprint(ofile,"\nC_df_ilb(l) label l; {\n"); fprint(ofile,"df_ilb\t| label:l\t|\n");
if(op->id_used) { if(op->id_used) {
fprint(ofile,"\tOO_indefilb(op_%s,l);\n",s); fprint(ofile,"\tOO_indefilb(op_%s,l);\n",s);
fprint(ofile,"\tOO_dfa(op_%s);\n",s); fprint(ofile,"\tOO_dfa(op_%s);\n",s);
@ -64,10 +60,9 @@ outputincalls()
fprint(ofile,"\tFLUSHDFA();\n"); fprint(ofile,"\tFLUSHDFA();\n");
fprint(ofile,"\tO_df_ilb(l);\n",s); fprint(ofile,"\tO_df_ilb(l);\n",s);
} }
fprint(ofile,"}\n",s);
break; break;
case PNAM: case PNAM:
fprint(ofile,"\nC_%s(s) char *s; {\n",s); fprint(ofile,"%s\t| char *:s\t|\n",s);
if(op->id_used) { if(op->id_used) {
fprint(ofile,"\tOO_inpnam(op_%s,s);\n",s); fprint(ofile,"\tOO_inpnam(op_%s,s);\n",s);
fprint(ofile,"\tOO_dfa(op_%s);\n",s); fprint(ofile,"\tOO_dfa(op_%s);\n",s);
@ -76,10 +71,9 @@ outputincalls()
fprint(ofile,"\tFLUSHDFA();\n"); fprint(ofile,"\tFLUSHDFA();\n");
fprint(ofile,"\tO_%s(s);\n",s); fprint(ofile,"\tO_%s(s);\n",s);
} }
fprint(ofile,"}\n",s);
break; break;
case LAB: case LAB:
fprint(ofile,"\nC_%s(l) label l; {\n",s); fprint(ofile,"%s\t| label:l\t|\n",s);
if(op->id_used) { if(op->id_used) {
fprint(ofile,"\tOO_inlab(op_%s,l);\n",s); fprint(ofile,"\tOO_inlab(op_%s,l);\n",s);
fprint(ofile,"\tOO_dfa(op_%s);\n",s); fprint(ofile,"\tOO_dfa(op_%s);\n",s);
@ -88,10 +82,9 @@ outputincalls()
fprint(ofile,"\tFLUSHDFA();\n"); fprint(ofile,"\tFLUSHDFA();\n");
fprint(ofile,"\tO_%s(l);\n",s); fprint(ofile,"\tO_%s(l);\n",s);
} }
fprint(ofile,"}\n",s);
break; break;
case EXT: case EXT:
fprint(ofile,"\nC_%s(n) int n; {\n",s); fprint(ofile,"%s\t| int:n\t|\n",s);
if(op->id_used) { if(op->id_used) {
fprint(ofile,"\tOO_incst(op_%s,n);\n",s); fprint(ofile,"\tOO_incst(op_%s,n);\n",s);
fprint(ofile,"\tOO_dfa(op_%s);\n",s); fprint(ofile,"\tOO_dfa(op_%s);\n",s);
@ -100,8 +93,7 @@ outputincalls()
fprint(ofile,"\tFLUSHDFA();\n"); fprint(ofile,"\tFLUSHDFA();\n");
fprint(ofile,"\tO_%s(n);\n",s); fprint(ofile,"\tO_%s(n);\n",s);
} }
fprint(ofile,"}\n",s); fprint(ofile,"%s_dnam\t| char *:s int:n\t|\n",s);
fprint(ofile,"\nC_%s_dnam(s,n) char *s; int n; {\n",s);
if(op->id_used) { if(op->id_used) {
fprint(ofile,"\tOO_indnam(op_%s,s,n);\n",s); fprint(ofile,"\tOO_indnam(op_%s,s,n);\n",s);
fprint(ofile,"\tOO_dfa(op_%s);\n",s); fprint(ofile,"\tOO_dfa(op_%s);\n",s);
@ -110,8 +102,7 @@ outputincalls()
fprint(ofile,"\tFLUSHDFA();\n"); fprint(ofile,"\tFLUSHDFA();\n");
fprint(ofile,"\tO_%s_dnam(s,n);\n",s); fprint(ofile,"\tO_%s_dnam(s,n);\n",s);
} }
fprint(ofile,"}\n",s); fprint(ofile,"%s_dlb\t| label:l int:n\t|\n",s);
fprint(ofile,"\nC_%s_dlb(l,n) label l; int n; {\n",s);
if(op->id_used) { if(op->id_used) {
fprint(ofile,"\tOO_indlb(op_%s,l,n);\n",s); fprint(ofile,"\tOO_indlb(op_%s,l,n);\n",s);
fprint(ofile,"\tOO_dfa(op_%s);\n",s); fprint(ofile,"\tOO_dfa(op_%s);\n",s);
@ -120,7 +111,6 @@ outputincalls()
fprint(ofile,"\tFLUSHDFA();\n"); fprint(ofile,"\tFLUSHDFA();\n");
fprint(ofile,"\tO_%s_dlb(l,n);\n",s); fprint(ofile,"\tO_%s_dlb(l,n);\n",s);
} }
fprint(ofile,"}\n",s);
break; break;
} }
} }