Commit 30ca27b4 by Per Bothner Committed by Per Bothner

lex.c (java_parse_end_comment): Take extra parameter (next char).

�
	* lex.c (java_parse_end_comment):  Take extra parameter (next char).
	* class.c (build_utf8_ref):  Fix possible name class/ambiguity.
	* class.c (layout_class_method):  A static method in a base class
	is never overridden, so treat it like it doesn't exist.
	However, do complain about private non-static method overriding
	public static method.
	* parse.y:  Don't set unused INITIALIZED_P flag.
	* java-tree.h (INITIALIZED_P):  Removed no-longer needed flag.
	* parse.y (find_expr_with_wfl):  Optimize tail-calls.
	(build_array_from_name):  Re-order &index[string] to &string[index].
	* parse.y (java_complete_tree):  Don't call patch_assignment if rhs is
	error_mark (it might catch more errors, but it is more likely to lose).

From-SVN: r25641
parent c0d87ff6
Fri Mar 5 15:17:29 1999 Per Bothner <bothner@cygnus.com>
* lex.c (java_parse_end_comment): Take extra parameter (next char).
* class.c (build_utf8_ref): Fix possible name class/ambiguity.
* class.c (layout_class_method): A static method in a base class
is never overridden, so treat it like it doesn't exist.
However, do complain about private non-static method overriding
public static method.
* parse.y: Don't set unused INITIALIZED_P flag.
* java-tree.h (INITIALIZED_P): Removed no-longer needed flag.
* parse.y (find_expr_with_wfl): Optimize tail-calls.
(build_array_from_name): Re-order &index[string] to &string[index].
* parse.y (java_complete_tree): Don't call patch_assignment if rhs is
error_mark (it might catch more errors, but it is more likely to lose).
Sat Mar 6 11:17:16 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> Sat Mar 6 11:17:16 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (jcf-parse.o): Depend on $(PARSE_H). * Makefile.in (jcf-parse.o): Depend on $(PARSE_H).
......
...@@ -569,6 +569,8 @@ build_utf8_ref (name) ...@@ -569,6 +569,8 @@ build_utf8_ref (name)
/* Build a unique identifier based on buf. */ /* Build a unique identifier based on buf. */
sprintf(buf, "_Utf%d", ++utf8_count); sprintf(buf, "_Utf%d", ++utf8_count);
buf_ptr = &buf[strlen (buf)]; buf_ptr = &buf[strlen (buf)];
if (name_len > 0 && name_ptr[0] >= '0' && name_ptr[0] <= '9')
*buf_ptr++ = '_';
while (--name_len >= 0) while (--name_len >= 0)
{ {
unsigned char c = *name_ptr++; unsigned char c = *name_ptr++;
...@@ -1627,11 +1629,10 @@ layout_class_method (this_class, super_class, method_decl, dtable_count) ...@@ -1627,11 +1629,10 @@ layout_class_method (this_class, super_class, method_decl, dtable_count)
build_java_argument_signature (TREE_TYPE (method_decl)); build_java_argument_signature (TREE_TYPE (method_decl));
tree super_method = lookup_argument_method (super_class, method_name, tree super_method = lookup_argument_method (super_class, method_name,
method_sig); method_sig);
if (super_method != NULL_TREE) if (super_method != NULL_TREE && ! METHOD_PRIVATE (super_method))
{ {
DECL_VINDEX (method_decl) = DECL_VINDEX (super_method); DECL_VINDEX (method_decl) = DECL_VINDEX (super_method);
if (DECL_VINDEX (method_decl) == NULL_TREE && if (DECL_VINDEX (method_decl) == NULL_TREE)
! TREE_PRIVATE (method_decl))
error_with_decl (method_decl, error_with_decl (method_decl,
"non-static method '%s' overrides static method"); "non-static method '%s' overrides static method");
#if 0 #if 0
......
...@@ -90,7 +90,6 @@ struct JCF; ...@@ -90,7 +90,6 @@ struct JCF;
6: METHOD_TRANSIENT (in FUNCTION_DECL) 6: METHOD_TRANSIENT (in FUNCTION_DECL)
LABEL_CHANGED (in LABEL_DECL) LABEL_CHANGED (in LABEL_DECL)
CLASS_SUPER (in TYPE_DECL, ACC_SUPER flag) CLASS_SUPER (in TYPE_DECL, ACC_SUPER flag)
INITIALIZED_P (in FIELD_DECL, VAR_DECL, PARM_DECL)
7: DECL_CONSTRUCTOR_P (in FUNCTION_DECL). 7: DECL_CONSTRUCTOR_P (in FUNCTION_DECL).
*/ */
...@@ -634,10 +633,6 @@ extern int encode_newarray_type PROTO ((tree)); ...@@ -634,10 +633,6 @@ extern int encode_newarray_type PROTO ((tree));
#define FIELD_VOLATILE(DECL) DECL_LANG_FLAG_4 (DECL) #define FIELD_VOLATILE(DECL) DECL_LANG_FLAG_4 (DECL)
#define FIELD_TRANSIENT(DECL) DECL_LANG_FLAG_5 (DECL) #define FIELD_TRANSIENT(DECL) DECL_LANG_FLAG_5 (DECL)
/* Initialized flag on variable/field/parm decl */
#define INITIALIZED_P(DECL) DECL_LANG_FLAG_6 (DECL)
/* Access flags etc for a class (a TYPE_DECL): */ /* Access flags etc for a class (a TYPE_DECL): */
#define CLASS_PUBLIC(DECL) DECL_LANG_FLAG_1 (DECL) #define CLASS_PUBLIC(DECL) DECL_LANG_FLAG_1 (DECL)
......
...@@ -64,7 +64,7 @@ static void java_store_unicode PROTO ((struct java_line *, unicode_t, int)); ...@@ -64,7 +64,7 @@ static void java_store_unicode PROTO ((struct java_line *, unicode_t, int));
static unicode_t java_parse_escape_sequence PROTO (()); static unicode_t java_parse_escape_sequence PROTO (());
static int java_letter_or_digit_p PROTO ((unicode_t)); static int java_letter_or_digit_p PROTO ((unicode_t));
static int java_parse_doc_section PROTO ((unicode_t)); static int java_parse_doc_section PROTO ((unicode_t));
static void java_parse_end_comment PROTO (()); static void java_parse_end_comment PROTO ((unicode_t));
static unicode_t java_get_unicode PROTO (()); static unicode_t java_get_unicode PROTO (());
static unicode_t java_read_unicode PROTO ((int, int *)); static unicode_t java_read_unicode PROTO ((int, int *));
static void java_store_unicode PROTO ((struct java_line *, unicode_t, int)); static void java_store_unicode PROTO ((struct java_line *, unicode_t, int));
...@@ -366,13 +366,14 @@ java_lineterminator (c) ...@@ -366,13 +366,14 @@ java_lineterminator (c)
return 0; return 0;
} }
/* Parse the end of a C style comment */ /* Parse the end of a C style comment.
* C is the first character after the '/*'. */
static void static void
java_parse_end_comment () java_parse_end_comment (c)
unicode_t c;
{ {
unicode_t c;
for (c = java_get_unicode ();; c = java_get_unicode ()) for ( ;; c = java_get_unicode ())
{ {
switch (c) switch (c)
{ {
...@@ -559,8 +560,9 @@ java_lex (java_lval) ...@@ -559,8 +560,9 @@ java_lex (java_lval)
switch (c = java_get_unicode ()) switch (c = java_get_unicode ())
{ {
case '/': case '/':
for (c = java_get_unicode ();;c = java_get_unicode ()) for (;;)
{ {
c = java_get_unicode ();
if (c == UEOF) if (c == UEOF)
java_lex_error ("Comment not terminated at end of input", 0); java_lex_error ("Comment not terminated at end of input", 0);
if (c == '\n') /* ULT */ if (c == '\n') /* ULT */
...@@ -576,10 +578,8 @@ java_lex (java_lval) ...@@ -576,10 +578,8 @@ java_lex (java_lval)
else if (java_parse_doc_section (c)) else if (java_parse_doc_section (c))
goto step1; goto step1;
} }
else
java_unget_unicode ();
java_parse_end_comment (); java_parse_end_comment (c);
goto step1; goto step1;
break; break;
default: default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment