changeset 140:aac62d1e30a6

fix minor syntax error
author kono
date Wed, 07 May 2003 13:12:58 +0900
parents 742224f4da02
children b70018bb3c0e
files Makefile conv/null.c conv_func.pl mc-parse.c
diffstat 4 files changed, 45 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Tue May 06 02:36:55 2003 +0900
+++ b/Makefile	Wed May 07 13:12:58 2003 +0900
@@ -73,22 +73,53 @@
                 mc-code-powerpc.c
 
 clean :
-	-rm -f mc mc-ia32 mc-powerpc mc-mips *.bak *.s *.o *.cc mc mc1 a.out *~ core* */*.o *.bak test/*.s test/*.cc test/*.o test/*.bak test/*~ conv/*.s conv/*.cc conv/*.o conv/*.bak conv/*~ *.out */*.out *.i */*.i
+	-rm -f mc mc-ia32 mc-powerpc mc-mips *.bak *.s *.o *.cc mc mc1 mc2 a.out *~ core* */*.o *.bak test/*.s test/*.cc test/*.o test/*.bak test/*~ conv/*.s conv/*.cc conv/*.o conv/*.bak conv/*~ *.out */*.out *.i */*.i
 
 mc1 : b00.s b01.s mc-codegen.o mc-tree.o $(CONVERTER)
 	$(CC) -g -o $@ $(PRINTF) b00.s b01.s mc-codegen.o mc-tree.o $(CONVERTER)
+
+mc2 : b00.s b01.s b02.s b03.s mc-codegen.o mc-tree.o $(CONVERTER)
+	$(CC) -g -o $@ $(PRINTF) b00.s b01.s b02.s b03.s $(CONVERTER)
+
 b00.s : mc-parse.c $(MC)
 	./$(MC) -s -ob00.s mc-parse.c
 b01.s : $(CODE) $(MC)
 	./$(MC) -s -ob01.s $(CODE)
+b02.s : mc-codegen.c $(MC)
+	./$(MC) -s -ob02.s mc-codegen.c
+b03.s : mc-tree.c $(MC)
+	./$(MC) -s -ob03.s mc-tree.c
+
 b10.s : mc-parse.c mc1
 	./mc1 -s -ob10.s mc-parse.c
 b11.s : $(CODE) $(PRINTF) mc1
 	./mc1 -s -ob11.s $(CODE)
+b12.s : mc-codegen.c mc1
+	./mc1 -s -ob12.s mc-codegen.c
+b13.s : mc-tree.c mc1
+	./mc1 -s -ob13.s mc-tree.c
 
-diff :  b00.s b01.s b10.s b11.s
+b20.s : mc-parse.c mc2
+	./mc2 -s -ob20.s mc-parse.c
+b21.s : $(CODE) $(PRINTF) mc2
+	./mc2 -s -ob21.s $(CODE)
+b22.s : mc-codegen.c mc2
+	./mc2 -s -ob22.s mc-codegen.c
+b23.s : mc-tree.c mc2
+	./mc2 -s -ob23.s mc-tree.c
+
+diff :  b00.s b01.s b02.s b03.s b10.s b11.s b12.s b13.s
 	-diff b00.s b10.s
 	-diff b01.s b11.s
+	-diff b02.s b12.s
+	-diff b03.s b13.s
+
+diff2 :  b00.s b01.s b02.s b03.s b20.s b21.s b22.s b23.s
+	-diff b00.s b20.s
+	-diff b01.s b21.s
+	-diff b02.s b22.s
+	-diff b03.s b23.s
+
 
 # DO NOT DELETE
 
--- a/conv/null.c	Tue May 06 02:36:55 2003 +0900
+++ b/conv/null.c	Wed May 07 13:12:58 2003 +0900
@@ -1,4 +1,5 @@
 /* Do not edit this file. This is automatically generated. */
+/* Edit conv_func.tbl */
 #define EXTERN /**/
 #include "mc.h"
 #include "conv/convdef.h"
--- a/conv_func.pl	Tue May 06 02:36:55 2003 +0900
+++ b/conv_func.pl	Wed May 07 13:12:58 2003 +0900
@@ -8,10 +8,13 @@
 open(IN,"<$in") or die("can't open $in");
 open(OUT,">$out") or die("can't open $out");
 print OUT "/* Do not edit this file. This is automatically generated. */\n";
+print OUT "/* Edit $in */\n";
 open(DEF,">$def") or die("can't open $def");
 print DEF "/* Do not edit this file. This is automatically generated. */\n";
+print DEF "/* Edit $in */\n";
 open(NUL,">$nul") or die("can't open $nul");
 print NUL "/* Do not edit this file. This is automatically generated. */\n";
+print NUL "/* Edit $in */\n";
 
 print OUT "typedef struct converter {\n";
 print NUL "#define EXTERN /**/\n";
--- a/mc-parse.c	Tue May 06 02:36:55 2003 +0900
+++ b/mc-parse.c	Wed May 07 13:12:58 2003 +0900
@@ -1023,11 +1023,15 @@
 		offset = decl_data(car(t1),n,offset);  /* alignment? */
 		t1 = cadr(t1);
 		if ( t1 && sym==COMMA) { conv->comma_(); continue; }
+		if (!t1 && sym==COMMA) getsym(); /* extra comma */
 		if (!t1 && sym!=RC) error(DCERR);
 	    }
 	    conv->decl_data_end_(); conv->rc_();
 	    getsym();
 	    return offset;
+	} else if (sym==RC) { /* empty case */
+	    conv->lc_();
+	    return offset;
 	} else
 	    error(DCERR);
     } else {
@@ -2155,6 +2159,8 @@
 	case LVAR:
 	    e=list2(ADDRESS,e);
 	    break;
+	case FNAME:
+	    break;
 	default:error(LVERR);
 	}
 	type=list2(POINTER,type);
@@ -3613,7 +3619,8 @@
     nptr->dsp = list2((int)cheapp,args); /* macro body */
     while ((*cheapp++ = c = *chptr++)
 	&& c != '\n') {
-	if (c=='\\' && chptr[1]=='\n') {
+	if (c=='\\' && (*chptr=='\n'||*chptr==0)) {
+	    chptr++;
 	    cheapp--;
 	    getline();
 	}