From: ceriel Date: Wed, 16 Nov 1988 11:23:58 +0000 (+0000) Subject: removed tab.c, use tabgen X-Git-Tag: release-5-5~2727 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=6ac798b50c198068775a18f3fe3ad243468f426a;p=ack.git removed tab.c, use tabgen --- diff --git a/lang/cem/cemcom/.distr b/lang/cem/cemcom/.distr index 3ba0cdf3b..b5565509f 100644 --- a/lang/cem/cemcom/.distr +++ b/lang/cem/cemcom/.distr @@ -93,21 +93,9 @@ struct.c struct.str switch.c switch.str -tab.c tokenname.c tokenname.h type.c type.str util.str 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 diff --git a/lang/cem/cemcom/BigPars b/lang/cem/cemcom/BigPars index 226c44716..08aaa58b3 100644 --- a/lang/cem/cemcom/BigPars +++ b/lang/cem/cemcom/BigPars @@ -39,7 +39,7 @@ !File: strsize.h #define ISTRSIZE 32 /* minimum number of bytes allocated for 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 */ @@ -86,9 +86,15 @@ !File: use_tmp.h -#define USE_TMP 1 /* collect exa, exp, ina and inp commands - and let them precede the rest of - the generated compact code */ +#define PREPEND_SCOPES 1 /* collect exa, exp, ina and inp commands + and if USE_TMP is defined let them + 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 @@ -96,8 +102,8 @@ !File: textsize.h -#define ITEXTSIZE 8 /* 1st piece of memory for repl. text */ -#define RTEXTSIZE 8 /* stepsize for enlarging repl.text */ +#define ITEXTSIZE 32 /* 1st piece of memory for repl. text */ +#define RTEXTSIZE 16 /* stepsize for enlarging repl.text */ !File: inputtype.h diff --git a/lang/cem/cemcom/LintPars b/lang/cem/cemcom/LintPars index 4bfd2a9a0..37266f8d3 100644 --- a/lang/cem/cemcom/LintPars +++ b/lang/cem/cemcom/LintPars @@ -86,9 +86,15 @@ !File: use_tmp.h -#undef USE_TMP 1 /* collect exa, exp, ina and inp commands - and let them precede the rest of - the generated compact code */ +#undef PREPEND_SCOPES 1 /* collect exa, exp, ina and inp commands + and if USE_TMP is defined let them + 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 diff --git a/lang/cem/cemcom/Makefile b/lang/cem/cemcom/Makefile index 1c744df85..25523d6cb 100644 --- a/lang/cem/cemcom/Makefile +++ b/lang/cem/cemcom/Makefile @@ -17,7 +17,7 @@ PRTLIB = $(EMHOME)/modules/lib/libprint.a EMMESLIB = $(EMHOME)/modules/lib/libem_mes.a EMMESOLIB = $(EMHOME)/modules/lib/libem_mesO.a EMMESCELIB = $(EMHOME)/modules/lib/libem_mesCE.a -MACH = sun3 +MACH = vax4 EMCELIB = $(EMHOME)/lib/$(MACH)/ce.a \ $(EMHOME)/lib/$(MACH)/back.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) # 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) # include files containing ALLOCDEF specifications @@ -172,7 +172,7 @@ cmp: Main -cmp $(CURRDIR)/cemcom.1 $(EMHOME)/man/em_cemcom.6 pr: - @pr Makefile make.* tab.c char.tab Parameters $(HSRC) $(STRSRC) $(LSRC) $(CSRC) + @pr Makefile make.* char.tab Parameters $(HSRC) $(STRSRC) $(LSRC) $(CSRC) opr: make pr | opr @@ -212,11 +212,8 @@ tokenfile.g: tokenname.c make.tokfile symbol2str.c: tokenname.c make.tokcase symbol2str.c -char.c: tab char.tab - tab -fchar.tab >char.c - -tab: - $(CC) tab.c -o tab +char.c: char.tab + $(EMHOME)/bin/tabgen -fchar.tab >char.c next.c: make.next $(STRSRC) ./make.next $(STRSRC) >next.c diff --git a/lang/cem/cemcom/Makefile.erik b/lang/cem/cemcom/Makefile.erik index 2782ce09c..195e07fca 100644 --- a/lang/cem/cemcom/Makefile.erik +++ b/lang/cem/cemcom/Makefile.erik @@ -100,7 +100,7 @@ GHSRC = botch_free.h dataflow.h debug.h density.h errout.h \ reg_count.h # 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) # include files containing ALLOCDEF specifications @@ -139,8 +139,8 @@ tokenfile.g: tokenname.c make.tokfile symbol2str.c: tokenname.c make.tokcase symbol2str.c -char.c: tab char.tab - tab -fchar.tab >char.c +char.c: char.tab + $(EMHOME)/bin/tabgen -fchar.tab >char.c next.c: make.next $(NEXTFILES) ./make.next $(NEXTFILES) >next.c @@ -208,7 +208,7 @@ xref: lxref: lxref $(OBJ) -lc >lxref -lint: lint.main lint.cem lint.tab +lint: lint.main lint.cem lint.main: cfiles $(LINT) -bx $(CDEFS) $(SRC) $(LINTLIBS) >lint.out @@ -219,12 +219,6 @@ cchk: clean: rm -f $(LCSRC) $(OBJ) $(GENERATED) $(GSRC) $(GHSRC) -tab: - $(CC) tab.c -o tab - -lint.tab: - $(LINT) -abx tab.c - sim: cfiles $(SIM) $(SIMFLAGS) $(CSRC) $(GSRC) $(LSRC) diff --git a/lang/cem/cemcom/SmallPars b/lang/cem/cemcom/SmallPars index 26ff30edf..fb0bf2a5d 100644 --- a/lang/cem/cemcom/SmallPars +++ b/lang/cem/cemcom/SmallPars @@ -86,9 +86,15 @@ !File: use_tmp.h -#undef USE_TMP 1 /* collect exa, exp, ina and inp commands - and let them precede the rest of - the generated compact code */ +#undef PREPEND_SCOPES 1 /* collect exa, exp, ina and inp commands + and if USE_TMP is defined let them + 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 diff --git a/lang/cem/cemcom/char.tab b/lang/cem/cemcom/char.tab index eedba40b4..fb0ff8727 100644 --- a/lang/cem/cemcom/char.tab +++ b/lang/cem/cemcom/char.tab @@ -7,8 +7,7 @@ % % START OF TOKEN % -%C -STGARB:\000-\200 +%iSTGARB STSKIP:\r \t\013\f STNL:\n STCOMP:-!&+<=>| diff --git a/lang/cem/cemcom/code.c b/lang/cem/cemcom/code.c index 3bcd510f2..f13b17c81 100644 --- a/lang/cem/cemcom/code.c +++ b/lang/cem/cemcom/code.c @@ -67,8 +67,10 @@ init_code(dst_file) C_magic(); C_ms_emx(word_size, pointer_size); #ifdef USE_TMP +#ifdef PREPEND_SCOPES C_insertpart(tmp_id = C_getid()); #endif USE_TMP +#endif PREPEND_SCOPES } #endif LINT @@ -119,7 +121,7 @@ end_code() C_close(); } -#ifdef USE_TMP +#ifdef PREPEND_SCOPES prepend_scopes() { /* 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; +#ifdef USE_TMP C_beginpart(tmp_id); +#endif USE_TMP while (se != 0) { register struct idf *id = se->se_idf; register struct def *df = id->id_def; @@ -137,9 +141,11 @@ prepend_scopes() code_scope(id->id_text, df); se = se->next; } +#ifdef USE_TMP C_endpart(tmp_id); +#endif USE_TMP } -#endif USE_TMP +#endif PREPEND_SCOPES code_scope(text, def) char *text; @@ -190,9 +196,9 @@ begin_proc(ds, idf) /* to be called when entering a procedure */ register char *name = idf->id_text; register struct def *def = idf->id_def; -#ifndef USE_TMP +#ifndef PREPEND_SCOPES code_scope(name, def); -#endif USE_TMP +#endif PREPEND_SCOPES #ifdef DATAFLOW if (options['d']) DfaStartFunction(name); @@ -376,11 +382,11 @@ code_declaration(idf, expr, lvl, sc) return; if (sc == EXTERN && expr && !is_anon_idf(idf)) error("%s is extern; cannot initialize", idf->id_text); -#ifndef USE_TMP +#ifndef PREPEND_SCOPES if (def->df_type->tp_fund == FUNCTION) { code_scope(idf->id_text, def); } -#endif +#endif PREPEND_SCOPES if (lvl == L_GLOBAL) { /* global variable */ /* is this an allocating declaration? */ if ( (sc == 0 || sc == STATIC) @@ -389,9 +395,9 @@ code_declaration(idf, expr, lvl, sc) ) def->df_alloc = ALLOC_SEEN; if (expr) { /* code only if initialized */ -#ifndef USE_TMP +#ifndef PREPEND_SCOPES code_scope(idf->id_text, def); -#endif USE_TMP +#endif PREPEND_SCOPES def->df_alloc = ALLOC_DONE; C_df_dnam(idf->id_text); } @@ -423,9 +429,9 @@ code_declaration(idf, expr, lvl, sc) case GLOBAL: case IMPLICIT: /* we are sure there is no expression */ -#ifndef USE_TMP +#ifndef PREPEND_SCOPES code_scope(idf->id_text, def); -#endif USE_TMP +#endif PREPEND_SCOPES break; case AUTO: case REGISTER: @@ -501,9 +507,9 @@ bss(idf) */ arith size = idf->id_def->df_type->tp_size; -#ifndef USE_TMP +#ifndef PREPEND_SCOPES 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 df_alloc is only non-zero if size >= 0, we have: */ diff --git a/lang/cem/cemcom/main.c b/lang/cem/cemcom/main.c index 607a74182..70be4e201 100644 --- a/lang/cem/cemcom/main.c +++ b/lang/cem/cemcom/main.c @@ -209,9 +209,9 @@ compile(argc, argv) /* compile the source text */ C_program(); -#ifdef USE_TMP +#ifdef PREPEND_SCOPES prepend_scopes(); -#endif USE_TMP +#endif PREPEND_SCOPES end_code(); #ifdef DEBUG