Commit c583dd46 by Alexandre Petit-Bianco Committed by Alexandre Petit-Bianco

lex.c (setjmp.h): No longer included.

Fri Oct 16 10:59:01 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* lex.c (setjmp.h): No longer included.
	* lex.h (setjmp.h): Included.
	* parse.h (SET_TYPE_FOR_RESOLUTION): New macro.
	(duplicate_declaration_error_p): Renamed from
 	duplicate_declaration_error.
	(build_array_from_name): New function prototype.
	* parse.y (setjmp.h): No longer included.
	(variable_declarator_id): Define action.
	(build_array_from_name): New function.
	(duplicate_declaration_error_p): Renamed from
 	duplicate_declaration_error.  Fixed leading comment.
	(register_fields): Main `for' loop reorganized. Uses
 	SET_TYPE_FOR_RESOLUTION and build_array_from_name.
	(method_declarator): Uses SET_TYPE_FOR_RESOLUTION and call
 	build_array_from_name.
	(resolve_class): Set CLASS_LOADED_P on newly build array dimension
 	types.
	(read_import_dir): Don't try to skip `.' and `..'.
	(declare_local_variables): Uses SET_TYPE_FOR_RESOLUTION and
 	build_array_from_name. Main `for' loop reorganized.
	(resolve_qualified_expression_name): When building access to a
 	field, use the type where the field was found, not its own type.
	(maybe_access_field): Use field DECL_CONTEXT if the type where the
 	field was found is null.
	(qualify_ambiguous_name): Sweep through all successive array
 	dimensions.
Implements the alternate form `T a[]' of array declarations. Fixes a
bug when building access to certain fields. Fixed a compilation
warning when lex.h is included from somewhere else than parse.y

From-SVN: r23142
parent 8e52e063
Fri Oct 16 10:59:01 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* lex.c (setjmp.h): No longer included.
* lex.h (setjmp.h): Included.
* parse.h (SET_TYPE_FOR_RESOLUTION): New macro.
(duplicate_declaration_error_p): Renamed from
duplicate_declaration_error.
(build_array_from_name): New function prototype.
* parse.y (setjmp.h): No longer included.
(variable_declarator_id): Define action.
(build_array_from_name): New function.
(duplicate_declaration_error_p): Renamed from
duplicate_declaration_error. Fixed leading comment.
(register_fields): Main `for' loop reorganized. Uses
SET_TYPE_FOR_RESOLUTION and build_array_from_name.
(method_declarator): Uses SET_TYPE_FOR_RESOLUTION and call
build_array_from_name.
(resolve_class): Set CLASS_LOADED_P on newly build array dimension
types.
(read_import_dir): Don't try to skip `.' and `..'.
(declare_local_variables): Uses SET_TYPE_FOR_RESOLUTION and
build_array_from_name. Main `for' loop reorganized.
(resolve_qualified_expression_name): When building access to a
field, use the type where the field was found, not its own type.
(maybe_access_field): Use field DECL_CONTEXT if the type where the
field was found is null.
(qualify_ambiguous_name): Sweep through all successive array
dimensions.
Wed Oct 14 18:21:29 1998 Alexandre Petit-Bianco <apbianco@cygnus.com> Wed Oct 14 18:21:29 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* java-tree.h (pop_labeled_block, lang_printable_name, * java-tree.h (pop_labeled_block, lang_printable_name,
......
...@@ -37,7 +37,6 @@ Addison Wesley 1996" (http://java.sun.com/docs/books/jls/html/3.doc.html) */ ...@@ -37,7 +37,6 @@ Addison Wesley 1996" (http://java.sun.com/docs/books/jls/html/3.doc.html) */
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <strings.h> #include <strings.h>
#include <setjmp.h>
#ifdef JAVA_LEX_DEBUG #ifdef JAVA_LEX_DEBUG
#include <ctype.h> #include <ctype.h>
......
...@@ -26,6 +26,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ ...@@ -26,6 +26,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#ifndef JV_LEX_H #ifndef JV_LEX_H
#define JV_LEX_H #define JV_LEX_H
#include <setjmp.h> /* set_float_handler argument uses it */
/* Extern global variables declarations */ /* Extern global variables declarations */
extern FILE *finput; extern FILE *finput;
extern int lineno; extern int lineno;
......
...@@ -399,6 +399,27 @@ static jdeplist *reverse_jdep_list (); ...@@ -399,6 +399,27 @@ static jdeplist *reverse_jdep_list ();
} \ } \
} }
/* if TYPE can't be resolved, obtain something suitable for its
resolution (TYPE is saved in SAVE before being changed). and set
CHAIN to 1. Otherwise, type is set to something usable. CHAIN is
usually used to determine that a new DEP must be installed on TYPE. */
#define SET_TYPE_FOR_RESOLUTION(TYPE, SAVE, CHAIN) \
{ \
tree returned_type; \
(CHAIN) = 0; \
if (unresolved_type_p (type, &returned_type)) \
{ \
if (returned_type) \
(TYPE) = returned_type; \
else \
{ \
(SAVE) = (TYPE); \
(TYPE) = obtain_incomplete_type (TYPE); \
CHAIN = 1; \
} \
} \
}
/* Insert a DECL in the current block */ /* Insert a DECL in the current block */
#define BLOCK_CHAIN_DECL(NODE) \ #define BLOCK_CHAIN_DECL(NODE) \
{ \ { \
...@@ -560,7 +581,7 @@ static tree create_class PROTO ((int, tree, tree, tree)); ...@@ -560,7 +581,7 @@ static tree create_class PROTO ((int, tree, tree, tree));
static tree create_interface PROTO ((int, tree, tree)); static tree create_interface PROTO ((int, tree, tree));
static tree find_field PROTO ((tree, tree)); static tree find_field PROTO ((tree, tree));
static tree lookup_field_wrapper PROTO ((tree, tree)); static tree lookup_field_wrapper PROTO ((tree, tree));
static int duplicate_declaration_error PROTO ((tree, tree, tree)); static int duplicate_declaration_error_p PROTO ((tree, tree, tree));
static void register_fields PROTO ((int, tree, tree)); static void register_fields PROTO ((int, tree, tree));
static tree parser_qualified_classname PROTO ((tree)); static tree parser_qualified_classname PROTO ((tree));
static int parser_check_super PROTO ((tree, tree, tree)); static int parser_check_super PROTO ((tree, tree, tree));
...@@ -631,6 +652,7 @@ static int valid_method_invocation_conversion_p PROTO ((tree, tree)); ...@@ -631,6 +652,7 @@ static int valid_method_invocation_conversion_p PROTO ((tree, tree));
static tree try_builtin_assignconv PROTO ((tree, tree, tree)); static tree try_builtin_assignconv PROTO ((tree, tree, tree));
static tree try_reference_assignconv PROTO ((tree, tree)); static tree try_reference_assignconv PROTO ((tree, tree));
static tree build_unresolved_array_type PROTO ((tree)); static tree build_unresolved_array_type PROTO ((tree));
static tree build_array_from_name PROTO ((tree, tree, tree, tree *));
static tree build_array_ref PROTO ((int, tree, tree)); static tree build_array_ref PROTO ((int, tree, tree));
static tree patch_array_ref PROTO ((tree, tree, tree)); static tree patch_array_ref PROTO ((tree, tree, tree));
static tree make_qualified_name PROTO ((tree, tree, int)); static tree make_qualified_name PROTO ((tree, tree, int));
......
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