Commit 0981a859 by Alexandre Petit-Bianco Committed by Alexandre Petit-Bianco

[multiple changes]

2000-03-28  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* parse-scan.y (pop_class_context): Reset `inner_qualifier_length'
	to 0 when it reaches -1.

2000-03-27  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* jcf-parse.c (get_constant): Properly cast `num' during the
	invocation of `add_double call'.
	* jcf-write.c (push_long_const): Properly cast `lo' before
	comparing it to short bounds.
	* parse-scan.y (interface_declaration:): Rule re-arrange so that
	`interface_body:' is reduced after the current interface is
	pushed.

2000-02-28  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* parse-scan.y (inner_qualifier, inner_qualifier_length): New
	static globals.
	(push_class_context, pop_class_context): New function.
	(class_body:): Call pop_class_context.
	(interface_body:): Likewise.
	(INNER_QUALIFIER): New macro.
	(report_class_declaration): Changed output format and use
	INNER_QUALIFIER. Call push_class_context.

From-SVN: r32779
parent e3c2afab
2000-03-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse-scan.y (pop_class_context): Reset `inner_qualifier_length'
to 0 when it reaches -1.
2000-03-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
* jcf-parse.c (get_constant): Properly cast `num' during the
invocation of `add_double call'.
* jcf-write.c (push_long_const): Properly cast `lo' before
comparing it to short bounds.
* parse-scan.y (interface_declaration:): Rule re-arrange so that
`interface_body:' is reduced after the current interface is
pushed.
2000-03-26 Tom Tromey <tromey@cygnus.com> 2000-03-26 Tom Tromey <tromey@cygnus.com>
* jvspec.c (jvgenmain_spec): Add `%{<...}' construct for each * jvspec.c (jvgenmain_spec): Add `%{<...}' construct for each
...@@ -21,15 +36,15 @@ Sat Mar 25 09:12:10 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> ...@@ -21,15 +36,15 @@ Sat Mar 25 09:12:10 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* parse.y (check_abstract_method_definitions): New local * parse.y (check_abstract_method_definitions): New local
`end_type_reached'. Make sure we also consider `end_type'. `end_type_reached'. Make sure we also consider `end_type'.
(java_check_abstract_method_definitions): Make sure we also (java_check_abstract_method_definitions): Make sure we eventually
eventually consider `java.lang.Object'. consider `java.lang.Object'.
(maybe_use_access_method): Don't use access method if not a pure (maybe_use_access_method): Don't use access method if not in the
inner class or if the method's context is right. context of a pure inner class or if the method's context is right.
(find_applicable_accessible_methods_list): New static (find_applicable_accessible_methods_list): New static flag
`object_done'. Don't search abstract classes as interfaces. Fixed `object_done'. Don't search abstract classes as interfaces. Fixed
indentation. Fixed the `java.lang.Object' only search. Search class' indentation. Fixed the `java.lang.Object' only search. Search
interface(s) first, fully search enclosing contexts. class interface(s) first, then fully search enclosing contexts.
(find_most_specific_methods_list): Pick closest candidates when (find_most_specific_methods_list): Pick the closest candidate when
they're all abstract. they're all abstract.
Mon Mar 20 08:58:51 2000 Alexandre Petit-Bianco <apbianco@cygnus.com> Mon Mar 20 08:58:51 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
...@@ -130,6 +145,17 @@ Tue Mar 14 17:15:41 2000 Alexandre Petit-Bianco <apbianco@cygnus.com> ...@@ -130,6 +145,17 @@ Tue Mar 14 17:15:41 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (register_incomplete_type): Fixed initialization of * parse.y (register_incomplete_type): Fixed initialization of
JDEP_ENCLOSING. JDEP_ENCLOSING.
2000-02-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse-scan.y (inner_qualifier, inner_qualifier_length): New
static globals.
(push_class_context, pop_class_context): New function.
(class_body:): Call pop_class_context.
(interface_body:): Likewise.
(INNER_QUALIFIER): New macro.
(report_class_declaration): Changed output format and use
INNER_QUALIFIER. Call push_class_context.
2000-02-14 Andrew Haley <aph@cygnus.com> 2000-02-14 Andrew Haley <aph@cygnus.com>
* check-init.c (check_init): Add new cases for unary and binary * check-init.c (check_init): Add new cases for unary and binary
......
...@@ -272,7 +272,7 @@ get_constant (jcf, index) ...@@ -272,7 +272,7 @@ get_constant (jcf, index)
HOST_WIDE_INT lo, hi; HOST_WIDE_INT lo, hi;
lshift_double (num, 0, 32, 64, &lo, &hi, 0); lshift_double (num, 0, 32, 64, &lo, &hi, 0);
num = JPOOL_INT (jcf, index+1); num = JPOOL_INT (jcf, index+1);
add_double (lo, hi, num, 0, &lo, &hi); add_double (lo, hi, (uint32)num, 0, &lo, &hi);
value = build_int_2 (lo, hi); value = build_int_2 (lo, hi);
TREE_TYPE (value) = long_type_node; TREE_TYPE (value) = long_type_node;
force_fit_type (value, 0); force_fit_type (value, 0);
......
...@@ -845,7 +845,8 @@ push_long_const (lo, hi, state) ...@@ -845,7 +845,8 @@ push_long_const (lo, hi, state)
RESERVE(1); RESERVE(1);
OP1(OPCODE_lconst_0 + lo); OP1(OPCODE_lconst_0 + lo);
} }
else if ((hi == 0 && lo < 32768) || (hi == -1 && lo >= -32768)) else if ((hi == 0 && (jword)(lo & 0xFFFFFFFF) < 32768)
|| (hi == -1 && (jword)(lo & 0xFFFFFFFF) >= -32768))
{ {
push_int_const (lo, state); push_int_const (lo, state);
RESERVE (1); RESERVE (1);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -66,6 +66,10 @@ static int absorber; ...@@ -66,6 +66,10 @@ static int absorber;
static const char *current_class; static const char *current_class;
static const char *package_name; static const char *package_name;
/* Keep track of the current inner class qualifier. */
static char *inner_qualifier;
static int inner_qualifier_length;
/* Keep track of whether things have be listed before. */ /* Keep track of whether things have be listed before. */
static int previous_output; static int previous_output;
...@@ -92,6 +96,8 @@ struct method_declarator { ...@@ -92,6 +96,8 @@ struct method_declarator {
/* Two actions for this grammar */ /* Two actions for this grammar */
static void report_class_declaration PARAMS ((const char *)); static void report_class_declaration PARAMS ((const char *));
static void report_main_declaration PARAMS ((struct method_declarator *)); static void report_main_declaration PARAMS ((struct method_declarator *));
static void push_class_context PARAMS ((const char *));
static void pop_class_context PARAMS ((void));
#include "lex.h" #include "lex.h"
#include "parse.h" #include "parse.h"
...@@ -357,7 +363,9 @@ interface_type_list: ...@@ -357,7 +363,9 @@ interface_type_list:
class_body: class_body:
OCB_TK CCB_TK OCB_TK CCB_TK
{ pop_class_context (); }
| OCB_TK class_body_declarations CCB_TK | OCB_TK class_body_declarations CCB_TK
{ pop_class_context (); }
; ;
class_body_declarations: class_body_declarations:
...@@ -564,14 +572,18 @@ this_or_super: /* Added, simplifies error diagnostics */ ...@@ -564,14 +572,18 @@ this_or_super: /* Added, simplifies error diagnostics */
/* 19.9 Productions from 9: Interfaces */ /* 19.9 Productions from 9: Interfaces */
/* 19.9.1 Productions from 9.1: Interfaces Declarations */ /* 19.9.1 Productions from 9.1: Interfaces Declarations */
interface_declaration: interface_declaration:
INTERFACE_TK identifier interface_body INTERFACE_TK identifier
{ report_class_declaration ($2); modifier_value = 0; } { report_class_declaration ($2); modifier_value = 0; }
| modifiers INTERFACE_TK identifier interface_body interface_body
| modifiers INTERFACE_TK identifier
{ report_class_declaration ($3); modifier_value = 0; } { report_class_declaration ($3); modifier_value = 0; }
| INTERFACE_TK identifier extends_interfaces interface_body interface_body
| INTERFACE_TK identifier extends_interfaces
{ report_class_declaration ($2); modifier_value = 0; } { report_class_declaration ($2); modifier_value = 0; }
| modifiers INTERFACE_TK identifier extends_interfaces interface_body interface_body
| modifiers INTERFACE_TK identifier extends_interfaces
{ report_class_declaration ($3); modifier_value = 0; } { report_class_declaration ($3); modifier_value = 0; }
interface_body
; ;
extends_interfaces: extends_interfaces:
...@@ -581,7 +593,9 @@ extends_interfaces: ...@@ -581,7 +593,9 @@ extends_interfaces:
interface_body: interface_body:
OCB_TK CCB_TK OCB_TK CCB_TK
{ pop_class_context (); }
| OCB_TK interface_member_declarations CCB_TK | OCB_TK interface_member_declarations CCB_TK
{ pop_class_context (); }
; ;
interface_member_declarations: interface_member_declarations:
...@@ -1110,7 +1124,33 @@ java_push_parser_context () ...@@ -1110,7 +1124,33 @@ java_push_parser_context ()
ctxp = new; ctxp = new;
} }
static void
push_class_context (name)
const char *name;
{
size_t name_length = strlen (name);
inner_qualifier = xrealloc (inner_qualifier,
inner_qualifier_length + name_length+2);
memcpy (inner_qualifier+inner_qualifier_length, name, name_length);
inner_qualifier_length += name_length;
inner_qualifier [inner_qualifier_length] = '$';
inner_qualifier [++inner_qualifier_length] = '\0';
}
static void
pop_class_context ()
{
while (--inner_qualifier_length > 0
&& inner_qualifier [inner_qualifier_length-1] != '$')
;
inner_qualifier = xrealloc (inner_qualifier, inner_qualifier_length+1);
inner_qualifier [inner_qualifier_length] = '\0';
if (inner_qualifier_length == -1)
inner_qualifier_length = 0;
}
/* Actions defined here */ /* Actions defined here */
#define INNER_QUALIFIER (inner_qualifier ? inner_qualifier : "")
static void static void
report_class_declaration (name) report_class_declaration (name)
...@@ -1128,11 +1168,12 @@ report_class_declaration (name) ...@@ -1128,11 +1168,12 @@ report_class_declaration (name)
} }
if (package_name) if (package_name)
fprintf (out, "%s.%s ", package_name, name); fprintf (out, "%s.%s%s ", package_name, INNER_QUALIFIER, name);
else else
fprintf (out, "%s ", name); fprintf (out, "%s%s ", INNER_QUALIFIER, name);
} }
push_class_context (name);
current_class = name; current_class = name;
} }
......
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