Patch: bug fix for jv-scan

Tom Tromey tromey@cygnus.com
Mon Oct 4 13:30:00 GMT 1999


I'm committing the appended patch.  It fixes Java PR gcj/59, a bug in
"jv-scan --print-main".  I also changed jv-scan to print something
when it decides the user's .java file has a syntax error.  This makes
it easier for us to find jv-scan bugs, if nothing else.

1999-10-04  Tom Tromey  <tromey@cygnus.com>

	* lex.h (BUILD_OPERATOR2): Return ASSIGN_ANY_TK in `lite' case as
	well.  Fixes Java PR gcj/59.
	* parse-scan.y (yyerror): Report errors.

Tom

Index: lex.h
===================================================================
RCS file: /cvs/egcs/egcs/gcc/java/lex.h,v
retrieving revision 1.12
diff -u -r1.12 lex.h
--- lex.h	1999/05/12 16:52:35	1.12
+++ lex.h	1999/10/04 20:27:53
@@ -123,7 +123,7 @@
 #define SET_MODIFIER_CTX(TOKEN) java_lval->value = (TOKEN)
 #define GET_TYPE_PRECISION(NODE) 4
 #define BUILD_OPERATOR(TOKEN)	return TOKEN
-#define BUILD_OPERATOR2(TOKEN)	return TOKEN
+#define BUILD_OPERATOR2(TOKEN)	return ASSIGN_ANY_TK
 #define SET_LVAL_NODE(NODE)
 #define SET_LVAL_NODE_TYPE(NODE, TYPE)
 #define BUILD_ID_WFL(EXP) (EXP)
Index: parse-scan.y
===================================================================
RCS file: /cvs/egcs/egcs/gcc/java/parse-scan.y,v
retrieving revision 1.12
diff -u -r1.12 parse-scan.y
--- parse-scan.y	1999/09/16 15:45:11	1.12
+++ parse-scan.y	1999/10/04 20:27:59
@@ -1174,4 +1174,6 @@
 yyerror (msg)
      const char *msg ATTRIBUTE_UNUSED;
 {
+  fprintf (stderr, "%s: %d: %s\n", input_filename, lineno, msg);
+  exit (1);
 }


More information about the Gcc-patches mailing list