removed tab.c, use tabgen

This commit is contained in:
ceriel 1988-11-16 11:23:58 +00:00
parent b8cc947bc3
commit 6ac798b50c
9 changed files with 60 additions and 58 deletions

View file

@ -93,21 +93,9 @@ struct.c
struct.str struct.str
switch.c switch.c
switch.str switch.str
tab.c
tokenname.c tokenname.c
tokenname.h tokenname.h
type.c type.c
type.str type.str
util.str util.str
util.c util.c
acklint
l_class.h
l_comment.c
l_ev_ord.c
l_lint.c
l_lint.h
l_misc.c
l_outdef.c
l_outdef.str
l_state.str
l_states.c

View file

@ -39,7 +39,7 @@
!File: strsize.h !File: strsize.h
#define ISTRSIZE 32 /* minimum number of bytes allocated for #define ISTRSIZE 32 /* minimum number of bytes allocated for
storing a string */ storing a string */
#define RSTRSIZE 8 /* step size in enlarging the memory for #define RSTRSIZE 16 /* step size in enlarging the memory for
the storage of a string */ the storage of a string */
@ -86,9 +86,15 @@
!File: use_tmp.h !File: use_tmp.h
#define USE_TMP 1 /* collect exa, exp, ina and inp commands #define PREPEND_SCOPES 1 /* collect exa, exp, ina and inp commands
and let them precede the rest of and if USE_TMP is defined let them
the generated compact code */ precede the rest of the generated
compact code */
#define USE_TMP 1 /* use C_insertpart, C_endpart mechanism
to generate EM-code in the order needed
for the code-generators. If not defined,
the old-style peephole optimizer is
needed. */
!File: parbufsize.h !File: parbufsize.h
@ -96,8 +102,8 @@
!File: textsize.h !File: textsize.h
#define ITEXTSIZE 8 /* 1st piece of memory for repl. text */ #define ITEXTSIZE 32 /* 1st piece of memory for repl. text */
#define RTEXTSIZE 8 /* stepsize for enlarging repl.text */ #define RTEXTSIZE 16 /* stepsize for enlarging repl.text */
!File: inputtype.h !File: inputtype.h

View file

@ -86,9 +86,15 @@
!File: use_tmp.h !File: use_tmp.h
#undef USE_TMP 1 /* collect exa, exp, ina and inp commands #undef PREPEND_SCOPES 1 /* collect exa, exp, ina and inp commands
and let them precede the rest of and if USE_TMP is defined let them
the generated compact code */ precede the rest of the generated
compact code */
#undef USE_TMP 1 /* use C_insertpart, C_endpart mechanism
to generate EM-code in the order needed
for the code-generators. If not defined,
the old-style peephole optimizer is
needed. */
!File: parbufsize.h !File: parbufsize.h

View file

@ -17,7 +17,7 @@ PRTLIB = $(EMHOME)/modules/lib/libprint.a
EMMESLIB = $(EMHOME)/modules/lib/libem_mes.a EMMESLIB = $(EMHOME)/modules/lib/libem_mes.a
EMMESOLIB = $(EMHOME)/modules/lib/libem_mesO.a EMMESOLIB = $(EMHOME)/modules/lib/libem_mesO.a
EMMESCELIB = $(EMHOME)/modules/lib/libem_mesCE.a EMMESCELIB = $(EMHOME)/modules/lib/libem_mesCE.a
MACH = sun3 MACH = vax4
EMCELIB = $(EMHOME)/lib/$(MACH)/ce.a \ EMCELIB = $(EMHOME)/lib/$(MACH)/ce.a \
$(EMHOME)/lib/$(MACH)/back.a \ $(EMHOME)/lib/$(MACH)/back.a \
$(EMHOME)/modules/lib/libobject.a $(EMHOME)/lib/em_data.a $(EMHOME)/modules/lib/libobject.a $(EMHOME)/lib/em_data.a
@ -115,7 +115,7 @@ HSRC = LLlex.h align.h arith.h assert.h atw.h class.h \
HFILES = $(HSRC) $(GHSRC) $(GHSTRSRC) HFILES = $(HSRC) $(GHSRC) $(GHSTRSRC)
# generated files, for 'make clean' only # generated files, for 'make clean' only
GENERATED = tab tokenfile.g Lpars.h LLfiles LL.output lint.out \ GENERATED = tokenfile.g Lpars.h LLfiles LL.output lint.out \
print hfiles Cfiles $(GHSRC) $(GSRC) longnames $(LCSRC) print hfiles Cfiles $(GHSRC) $(GSRC) longnames $(LCSRC)
# include files containing ALLOCDEF specifications # include files containing ALLOCDEF specifications
@ -172,7 +172,7 @@ cmp: Main
-cmp $(CURRDIR)/cemcom.1 $(EMHOME)/man/em_cemcom.6 -cmp $(CURRDIR)/cemcom.1 $(EMHOME)/man/em_cemcom.6
pr: pr:
@pr Makefile make.* tab.c char.tab Parameters $(HSRC) $(STRSRC) $(LSRC) $(CSRC) @pr Makefile make.* char.tab Parameters $(HSRC) $(STRSRC) $(LSRC) $(CSRC)
opr: opr:
make pr | opr make pr | opr
@ -212,11 +212,8 @@ tokenfile.g: tokenname.c make.tokfile
symbol2str.c: tokenname.c make.tokcase symbol2str.c: tokenname.c make.tokcase
<tokenname.c ./make.tokcase >symbol2str.c <tokenname.c ./make.tokcase >symbol2str.c
char.c: tab char.tab char.c: char.tab
tab -fchar.tab >char.c $(EMHOME)/bin/tabgen -fchar.tab >char.c
tab:
$(CC) tab.c -o tab
next.c: make.next $(STRSRC) next.c: make.next $(STRSRC)
./make.next $(STRSRC) >next.c ./make.next $(STRSRC) >next.c

View file

@ -100,7 +100,7 @@ GHSRC = botch_free.h dataflow.h debug.h density.h errout.h \
reg_count.h reg_count.h
# Other generated files, for 'make clean' only # Other generated files, for 'make clean' only
GENERATED = tab tokenfile.g Lpars.h LLfiles LL.output lint.out \ GENERATED = tokenfile.g Lpars.h LLfiles LL.output lint.out \
print Xref lxref hfiles cfiles $(GLCSRC) print Xref lxref hfiles cfiles $(GLCSRC)
# include files containing ALLOCDEF specifications # include files containing ALLOCDEF specifications
@ -139,8 +139,8 @@ tokenfile.g: tokenname.c make.tokfile
symbol2str.c: tokenname.c make.tokcase symbol2str.c: tokenname.c make.tokcase
<tokenname.c ./make.tokcase >symbol2str.c <tokenname.c ./make.tokcase >symbol2str.c
char.c: tab char.tab char.c: char.tab
tab -fchar.tab >char.c $(EMHOME)/bin/tabgen -fchar.tab >char.c
next.c: make.next $(NEXTFILES) next.c: make.next $(NEXTFILES)
./make.next $(NEXTFILES) >next.c ./make.next $(NEXTFILES) >next.c
@ -208,7 +208,7 @@ xref:
lxref: lxref:
lxref $(OBJ) -lc >lxref lxref $(OBJ) -lc >lxref
lint: lint.main lint.cem lint.tab lint: lint.main lint.cem
lint.main: cfiles lint.main: cfiles
$(LINT) -bx $(CDEFS) $(SRC) $(LINTLIBS) >lint.out $(LINT) -bx $(CDEFS) $(SRC) $(LINTLIBS) >lint.out
@ -219,12 +219,6 @@ cchk:
clean: clean:
rm -f $(LCSRC) $(OBJ) $(GENERATED) $(GSRC) $(GHSRC) rm -f $(LCSRC) $(OBJ) $(GENERATED) $(GSRC) $(GHSRC)
tab:
$(CC) tab.c -o tab
lint.tab:
$(LINT) -abx tab.c
sim: cfiles sim: cfiles
$(SIM) $(SIMFLAGS) $(CSRC) $(GSRC) $(LSRC) $(SIM) $(SIMFLAGS) $(CSRC) $(GSRC) $(LSRC)

View file

@ -86,9 +86,15 @@
!File: use_tmp.h !File: use_tmp.h
#undef USE_TMP 1 /* collect exa, exp, ina and inp commands #undef PREPEND_SCOPES 1 /* collect exa, exp, ina and inp commands
and let them precede the rest of and if USE_TMP is defined let them
the generated compact code */ precede the rest of the generated
compact code */
#undef USE_TMP 1 /* use C_insertpart, C_endpart mechanism
to generate EM-code in the order needed
for the code-generators. If not defined,
the old-style peephole optimizer is
needed. */
!File: parbufsize.h !File: parbufsize.h

View file

@ -7,8 +7,7 @@
% %
% START OF TOKEN % START OF TOKEN
% %
%C %iSTGARB
STGARB:\000-\200
STSKIP:\r \t\013\f STSKIP:\r \t\013\f
STNL:\n STNL:\n
STCOMP:-!&+<=>| STCOMP:-!&+<=>|

View file

@ -67,8 +67,10 @@ init_code(dst_file)
C_magic(); C_magic();
C_ms_emx(word_size, pointer_size); C_ms_emx(word_size, pointer_size);
#ifdef USE_TMP #ifdef USE_TMP
#ifdef PREPEND_SCOPES
C_insertpart(tmp_id = C_getid()); C_insertpart(tmp_id = C_getid());
#endif USE_TMP #endif USE_TMP
#endif PREPEND_SCOPES
} }
#endif LINT #endif LINT
@ -119,7 +121,7 @@ end_code()
C_close(); C_close();
} }
#ifdef USE_TMP #ifdef PREPEND_SCOPES
prepend_scopes() prepend_scopes()
{ {
/* prepend_scopes() runs down the list of global idf's /* prepend_scopes() runs down the list of global idf's
@ -128,7 +130,9 @@ prepend_scopes()
*/ */
register struct stack_entry *se = local_level->sl_entry; register struct stack_entry *se = local_level->sl_entry;
#ifdef USE_TMP
C_beginpart(tmp_id); C_beginpart(tmp_id);
#endif USE_TMP
while (se != 0) { while (se != 0) {
register struct idf *id = se->se_idf; register struct idf *id = se->se_idf;
register struct def *df = id->id_def; register struct def *df = id->id_def;
@ -137,9 +141,11 @@ prepend_scopes()
code_scope(id->id_text, df); code_scope(id->id_text, df);
se = se->next; se = se->next;
} }
#ifdef USE_TMP
C_endpart(tmp_id); C_endpart(tmp_id);
#endif USE_TMP
} }
#endif USE_TMP #endif PREPEND_SCOPES
code_scope(text, def) code_scope(text, def)
char *text; char *text;
@ -190,9 +196,9 @@ begin_proc(ds, idf) /* to be called when entering a procedure */
register char *name = idf->id_text; register char *name = idf->id_text;
register struct def *def = idf->id_def; register struct def *def = idf->id_def;
#ifndef USE_TMP #ifndef PREPEND_SCOPES
code_scope(name, def); code_scope(name, def);
#endif USE_TMP #endif PREPEND_SCOPES
#ifdef DATAFLOW #ifdef DATAFLOW
if (options['d']) if (options['d'])
DfaStartFunction(name); DfaStartFunction(name);
@ -376,11 +382,11 @@ code_declaration(idf, expr, lvl, sc)
return; return;
if (sc == EXTERN && expr && !is_anon_idf(idf)) if (sc == EXTERN && expr && !is_anon_idf(idf))
error("%s is extern; cannot initialize", idf->id_text); error("%s is extern; cannot initialize", idf->id_text);
#ifndef USE_TMP #ifndef PREPEND_SCOPES
if (def->df_type->tp_fund == FUNCTION) { if (def->df_type->tp_fund == FUNCTION) {
code_scope(idf->id_text, def); code_scope(idf->id_text, def);
} }
#endif #endif PREPEND_SCOPES
if (lvl == L_GLOBAL) { /* global variable */ if (lvl == L_GLOBAL) { /* global variable */
/* is this an allocating declaration? */ /* is this an allocating declaration? */
if ( (sc == 0 || sc == STATIC) if ( (sc == 0 || sc == STATIC)
@ -389,9 +395,9 @@ code_declaration(idf, expr, lvl, sc)
) )
def->df_alloc = ALLOC_SEEN; def->df_alloc = ALLOC_SEEN;
if (expr) { /* code only if initialized */ if (expr) { /* code only if initialized */
#ifndef USE_TMP #ifndef PREPEND_SCOPES
code_scope(idf->id_text, def); code_scope(idf->id_text, def);
#endif USE_TMP #endif PREPEND_SCOPES
def->df_alloc = ALLOC_DONE; def->df_alloc = ALLOC_DONE;
C_df_dnam(idf->id_text); C_df_dnam(idf->id_text);
} }
@ -423,9 +429,9 @@ code_declaration(idf, expr, lvl, sc)
case GLOBAL: case GLOBAL:
case IMPLICIT: case IMPLICIT:
/* we are sure there is no expression */ /* we are sure there is no expression */
#ifndef USE_TMP #ifndef PREPEND_SCOPES
code_scope(idf->id_text, def); code_scope(idf->id_text, def);
#endif USE_TMP #endif PREPEND_SCOPES
break; break;
case AUTO: case AUTO:
case REGISTER: case REGISTER:
@ -501,9 +507,9 @@ bss(idf)
*/ */
arith size = idf->id_def->df_type->tp_size; arith size = idf->id_def->df_type->tp_size;
#ifndef USE_TMP #ifndef PREPEND_SCOPES
code_scope(idf->id_text, idf->id_def); code_scope(idf->id_text, idf->id_def);
#endif USE_TMP #endif PREPEND_SCOPES
/* Since bss() is only called if df_alloc is non-zero, and /* Since bss() is only called if df_alloc is non-zero, and
since df_alloc is only non-zero if size >= 0, we have: since df_alloc is only non-zero if size >= 0, we have:
*/ */

View file

@ -209,9 +209,9 @@ compile(argc, argv)
/* compile the source text */ /* compile the source text */
C_program(); C_program();
#ifdef USE_TMP #ifdef PREPEND_SCOPES
prepend_scopes(); prepend_scopes();
#endif USE_TMP #endif PREPEND_SCOPES
end_code(); end_code();
#ifdef DEBUG #ifdef DEBUG