aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/parse.h
diff options
context:
space:
mode:
authorAlexandre Petit-Bianco <apbianco@gcc.gnu.org>1998-11-24 09:57:41 -0800
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>1998-11-24 09:57:41 -0800
commit23a79c61921246f3d84df2503555208f2683203e (patch)
treeddfaaed8a863a8721201f3dd3d76d282cc58791c /gcc/java/parse.h
parent333a9f0aafc0d0e426d948e545daae6f6d277f19 (diff)
downloadgcc-23a79c61921246f3d84df2503555208f2683203e.zip
gcc-23a79c61921246f3d84df2503555208f2683203e.tar.gz
gcc-23a79c61921246f3d84df2503555208f2683203e.tar.bz2
[multiple changes]
Tue Nov 24 17:06:38 1998 Per Bothner <bothner@cygnus.com> * (generate_classfile): Always write class access flag with ACC_SUPER set. Tue Nov 24 16:34:33 1998 Alexandre Petit-Bianco <apbianco@cygnus.com> * class.c (maybe_layout_super_class): New function. (layout_class): Reorganized. Loop on class methods dispatched into a new function. Call maybe_layout_super_class. (layout_class_methods, layout_class_method): New functions. * expr.c (expand_java_NEW): Call layout_class_methods on loaded class. (expand_invoke): Likewise. * java-tree.h (all_class_list): New global variable declared. (layout_class_methods, layout_class_method): New function prototypes. (LAYOUT_SEEN_CLASS_METHODS): New macro. * jcf-parse.c (all_class_list): New global variable. (load_class): Extended what class_or_name can be. Use parser context mechanism to save globals before calling jcf_parse. (jcf_parse_source): Don't parse twice if HAS_BEEN_ALREADY_PARSED_P is set on the file name. (jcf_parse): Layout class methods when Object is loaded, otherwise record class in all_class_list for delayed method layout. (parse_class_file): Use LAYOUT_SEEN_CLASS_METHODS. * lang.c (put_decl_node): Decode <init> into the decl context class name. * lex.c (java_allocate_new_line): Use xmalloc. * parse.h (INCOMPLETE_TYPE_P): Redefined to work with incomplete pointers, not TREE_LIST elements. (struct parser_ctxt): Fixed comment indentations, added comments and reordered some fields. (java_check_methods): Function prototype removed. * parse.y (java_push_parser_context): Use xmalloc. (java_parser_context_restore_global): Pop extra pushed ctxp only when there's nothing next. (maybe_create_class_interface_decl): Fixed comment, add new created class decl to all_class_list. (method_header): Use GET_REAL_TYPE on argument's types. (method_declarator): Use GET_REAL_TYPE, change type to the real type in TREE_LIST dependency node. Build argument list with the real type. (create_jdep_list): Use xmalloc. Removed allocation error message. (obtain_incomplete_type): Fixed leading comment. Broadened incoming argument meaning. (register_incomplete_type): Use xmalloc. Removed allocation error message. (safe_layout_class): Fixed leading comment. (jdep_resolve_class): Reversed if statement condition and switch if and else bodies. (resolve_and_layout): Fixed leading comment. Broadened incoming argument meaning. (complete_class_report_errors): New local variable name, for clarity. purify_type_name used for all error cases. (java_get_real_method_name): Stricter check on constructors. (java_check_regular_methods): Reverse methods list only if not already laid out. Layout artificial constructor. (java_check_methods): Deleted. (source_start_java_method): Obtain incomplete type for patchable method arguments. (java_layout_classes): Fixed leading comment. Use LAYOUT_SEEN_CLASS_METHODS, use a loop to check methods. Added else statement to layout operation, reuse LAYOUT_SEEN_CLASS_METHODS before returning. Fixed comments. (java_expand_classes): Check for errors up front. (patch_method_invocation): Class to search is resolved and laid out. A step forward truly mixing .class and .java during package compilation. Includes a Per's patch. From-SVN: r23834
Diffstat (limited to 'gcc/java/parse.h')
-rw-r--r--gcc/java/parse.h43
1 files changed, 23 insertions, 20 deletions
diff --git a/gcc/java/parse.h b/gcc/java/parse.h
index b2b0644..b73b8db 100644
--- a/gcc/java/parse.h
+++ b/gcc/java/parse.h
@@ -147,10 +147,10 @@ extern tree stabilize_reference PROTO ((tree));
TYPE_NAME (ptr) = name; \
}
-#define INCOMPLETE_TYPE_P(NODE) \
- ((TREE_CODE (NODE) == TREE_LIST) \
- && (TREE_CODE (TREE_PURPOSE (NODE)) == POINTER_TYPE) \
- && (TREE_TYPE (TREE_PURPOSE (NODE)) == NULL_TREE))
+#define INCOMPLETE_TYPE_P(NODE) \
+ ((TREE_CODE (NODE) == POINTER_TYPE) \
+ && !TREE_TYPE (NODE) \
+ && TREE_CODE (TYPE_NAME (NODE)) == IDENTIFIER_NODE)
/* Set the EMIT_LINE_NOTE flag of a EXPR_WLF to 1 if debug information
are requested. Works in the context of a parser rule. */
@@ -589,13 +589,13 @@ struct parser_ctxt {
int parser_ccb_indent; /* Keep track of {} indent, parser */
int osb_number; /* Keep track of ['s */
int minus_seen; /* Integral literal overflow */
- int lineno; /* Current lineno */
- int java_error_flag; /* Report error when true */
+ int lineno; /* Current lineno */
+ int java_error_flag; /* Report error when true */
int deprecated; /* @deprecated tag seen */
/* This section is defined only if we compile jc1 */
#ifndef JC1_LITE
- tree modifier_ctx [11]; /* WFL of modifiers */
+ tree modifier_ctx [11]; /* WFL of modifiers */
tree current_class; /* Current class */
tree current_function_decl; /* Current function decl, save/restore */
@@ -609,30 +609,34 @@ struct parser_ctxt {
tree package; /* Defined package ID */
+ /* Those tow list are saved accross file traversal */
tree incomplete_class; /* List of non-complete classes */
- tree current_parsed_class; /* Class currently parsed */
- tree current_parsed_class_un; /* Curr. parsed class unqualified name */
+ tree gclass_list; /* All classes seen from source code */
+
+ /* These two lists won't survive file traversal */
tree class_list; /* List of classes in a CU */
- tree gclass_list; /* All classes seen so far. */
jdeplist *classd_list; /* Classe dependencies in a CU */
+ tree current_parsed_class; /* Class currently parsed */
+ tree current_parsed_class_un; /* Curr. parsed class unqualified name */
+
tree non_static_initialized; /* List of non static initialized fields */
tree static_initialized; /* List of static non final initialized */
tree import_list; /* List of import */
tree import_demand_list; /* List of import on demand */
- tree current_loop; /* List of the currently nested loops/switches */
- tree current_labeled_block; /* List of currently nested
- labeled blocks. */
+ tree current_loop; /* List of the currently nested
+ loops/switches */
+ tree current_labeled_block; /* List of currently nested
+ labeled blocks. */
- int pending_block; /* Pending block to close */
+ int pending_block; /* Pending block to close */
- int explicit_constructor_p; /* True when processing an
- explicit constructor. This flag is
- used to trap illegal argument usage
- during an explicit constructor
- invocation. */
+ int explicit_constructor_p; /* True when processing an explicit
+ constructor. This flag is used to trap
+ illegal argument usage during an
+ explicit constructor invocation. */
#endif /* JC1_LITE */
};
@@ -803,7 +807,6 @@ void safe_layout_class PROTO ((tree));
void java_complete_class PROTO ((void));
void java_check_circular_reference PROTO ((void));
void java_check_final PROTO ((void));
-void java_check_methods PROTO ((void));
void java_layout_classes PROTO ((void));
tree java_method_add_stmt PROTO ((tree, tree));
char *java_get_line_col PROTO ((char *, int, int));