removed tab.c, use tabgen
authorceriel <none@none>
Wed, 16 Nov 1988 11:23:58 +0000 (11:23 +0000)
committerceriel <none@none>
Wed, 16 Nov 1988 11:23:58 +0000 (11:23 +0000)
lang/cem/cemcom/.distr
lang/cem/cemcom/BigPars
lang/cem/cemcom/LintPars
lang/cem/cemcom/Makefile
lang/cem/cemcom/Makefile.erik
lang/cem/cemcom/SmallPars
lang/cem/cemcom/char.tab
lang/cem/cemcom/code.c
lang/cem/cemcom/main.c

index 3ba0cdf..b556550 100644 (file)
@@ -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
index 226c447..08aaa58 100644 (file)
@@ -39,7 +39,7 @@
 !File: strsize.h
 #define ISTRSIZE       32      /* minimum number of bytes allocated for
                                        storing a string                */
-#define RSTRSIZE             /* step size in enlarging the memory for
+#define RSTRSIZE       16      /* step size in enlarging the memory for
                                        the storage of a string         */
 
 
 
 
 !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
 
 
 !File: textsize.h
-#define ITEXTSIZE            /* 1st piece of memory for repl. text   */
-#define RTEXTSIZE            /* 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
index 4bfd2a9..37266f8 100644 (file)
 
 
 !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
index 1c744df..25523d6 100644 (file)
@@ -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
        <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
index 2782ce0..195e07f 100644 (file)
@@ -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
        <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)
 
index 26ff30e..fb0bf2a 100644 (file)
 
 
 !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
index eedba40..fb0ff87 100644 (file)
@@ -7,8 +7,7 @@
 %
 %      START OF TOKEN
 %
-%C
-STGARB:\000-\200
+%iSTGARB
 STSKIP:\r \t\013\f
 STNL:\n
 STCOMP:-!&+<=>|
index 3bcd510..f13b17c 100644 (file)
@@ -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:
        */
index 607a741..70be4e2 100644 (file)
@@ -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