modified the string-constant printing routines; bts2str() is invoked
authorerikb <none@none>
Thu, 27 Mar 1986 11:01:12 +0000 (11:01 +0000)
committererikb <none@none>
Thu, 27 Mar 1986 11:01:12 +0000 (11:01 +0000)
lang/cem/cemcom/Makefile.erik
lang/cem/cemcom/dumpidf.c
lang/cem/cemcom/main.c

index 3fe9018..8acb5b6 100644 (file)
@@ -185,7 +185,7 @@ sim:        cfiles
        $(SIM) $(SIMFLAGS) `sources $(COBJ)` $(GSRC) $(LSRC)
 
 #AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO
-main.o: LLlex.h Lpars.h alloc.h arith.h debug.h declar.h idf.h input.h inputtype.h level.h maxincl.h myalloc.h nobitfield.h nopp.h spec_arith.h specials.h target_sizes.h tokenname.h type.h use_tmp.h
+main.o: LLlex.h Lpars.h alloc.h arith.h debug.h declar.h idf.h input.h inputtype.h level.h maxincl.h myalloc.h nobitfield.h nopp.h spec_arith.h specials.h target_sizes.h tokenname.h type.h use_tmp.h ssize.h
 idf.o: LLlex.h Lpars.h align.h alloc.h arith.h assert.h botch_free.h debug.h declar.h decspecs.h def.h idf.h idfsize.h label.h level.h nobitfield.h nopp.h sizes.h spec_arith.h specials.h stack.h storage.h struct.h type.h
 declarator.o: Lpars.h alloc.h arith.h botch_free.h declar.h expr.h idf.h label.h nobitfield.h nopp.h sizes.h spec_arith.h storage.h type.h
 decspecs.o: Lpars.h arith.h decspecs.h def.h level.h nobitfield.h spec_arith.h type.h
index b2732bf..867b731 100644 (file)
@@ -284,7 +284,8 @@ type2str(tp)
 }
 
 char *         /* the ultimate transient buffer supplier */
-next_transient()       {
+next_transient()
+{
        static int bnum;
        static char buf[MAXTRANS][300];
 
@@ -340,8 +341,15 @@ p1_expr(lvl, expr)
                                v->vl_value);
                break;
        case String:
-               printf("%s\n", expr->SG_VALUE);
+       {
+               char bts2str();
+
+               printf(
+                       "%s\n",
+                       bts2str(expr->SG_VALUE, expr->SG_LEN, next_transient())
+               );
                break;
+       }
        case Float:
                printf("%s\n", expr->FL_VALUE);
                break;
index 276b11f..685f783 100644 (file)
@@ -21,6 +21,7 @@
 #include       "LLlex.h"
 #include       "alloc.h"
 #include       "specials.h"
+#include       "ssize.h"
 
 extern struct tokenname tkidf[], tkother[];
 extern char *symbol2str();
@@ -328,8 +329,14 @@ preprocess()
                        printf(" ");
                        break;
                case STRING:
-                       printf("\"%s\" ", dot.tk_bts);
+               {
+                       char sbuf[SSIZE];
+                       char *bts2str();
+
+                       printf("\"%s\" ", 
+                               bts2str(dot.tk_bts, dot.tk_len, sbuf));
                        break;
+               }
                case INTEGER:
                        printf("%ld ", dot.tk_ival);
                        break;