1998-09-06 15:36:06 +00:00
|
|
|
/* Language parser definitions for the GNU compiler for the Java(TM) language.
|
|
|
|
Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
|
|
|
Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com)
|
|
|
|
|
|
|
|
This file is part of GNU CC.
|
|
|
|
|
|
|
|
GNU CC is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
GNU CC is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with GNU CC; see the file COPYING. If not, write to
|
|
|
|
the Free Software Foundation, 59 Temple Place - Suite 330,
|
|
|
|
Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
Java and all Java-based marks are trademarks or registered trademarks
|
|
|
|
of Sun Microsystems, Inc. in the United States and other countries.
|
|
|
|
The Free Software Foundation is independent of Sun Microsystems, Inc. */
|
|
|
|
|
|
|
|
#ifndef JV_LANG_H
|
|
|
|
#define JV_LANG_H
|
|
|
|
|
|
|
|
#include "lex.h"
|
|
|
|
|
|
|
|
/* Extern global variable declarations */
|
|
|
|
extern int java_error_count;
|
|
|
|
extern struct obstack temporary_obstack;
|
|
|
|
extern struct obstack permanent_obstack;
|
|
|
|
extern int quiet_flag;
|
|
|
|
|
|
|
|
#ifndef JC1_LITE
|
|
|
|
/* Function extern to java/ */
|
|
|
|
extern int int_fits_type_p PROTO ((tree, tree));
|
|
|
|
extern tree stabilize_reference PROTO ((tree));
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Macros for verbose debug info */
|
|
|
|
#ifdef VERBOSE_SKELETON
|
|
|
|
#define RULE( rule ) printf ( "jv_yacc:%d: rule %s\n", lineno, rule )
|
|
|
|
#else
|
|
|
|
#define RULE( rule )
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef SOURCE_FRONTEND_DEBUG
|
|
|
|
#undef SOURCE_FRONTEND_DEBUG
|
|
|
|
#define SOURCE_FRONTEND_DEBUG(X) \
|
|
|
|
{if (!quiet_flag) {printf ("* "); printf X; putchar ('\n');} }
|
|
|
|
#else
|
|
|
|
#define SOURCE_FRONTEND_DEBUG(X)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Macro for error recovering */
|
|
|
|
#ifdef YYDEBUG
|
|
|
|
#define RECOVERED \
|
|
|
|
{ if (!quiet_flag) {printf ("** Recovered\n");} }
|
|
|
|
#define DRECOVERED(s) \
|
|
|
|
{ if (!quiet_flag) {printf ("** Recovered (%s)\n", #s);}}
|
|
|
|
#else
|
|
|
|
#define RECOVERED
|
|
|
|
#define DRECOVERED(s)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define DRECOVER(s) {yyerrok; DRECOVERED(s)}
|
|
|
|
#define RECOVER {yyerrok; RECOVERED}
|
|
|
|
|
|
|
|
#define YYERROR_NOW ctxp->java_error_flag = 1
|
|
|
|
#define YYNOT_TWICE if (ctxp->prevent_ese != lineno)
|
|
|
|
|
|
|
|
/* Accepted modifiers */
|
|
|
|
#define CLASS_MODIFIERS ACC_PUBLIC|ACC_ABSTRACT|ACC_FINAL
|
|
|
|
#define FIELD_MODIFIERS ACC_PUBLIC|ACC_PROTECTED|ACC_PRIVATE|ACC_FINAL| \
|
|
|
|
ACC_STATIC|ACC_TRANSIENT|ACC_VOLATILE
|
|
|
|
#define METHOD_MODIFIERS ACC_PUBLIC|ACC_PROTECTED|ACC_PRIVATE|ACC_ABSTRACT| \
|
|
|
|
ACC_STATIC|ACC_FINAL|ACC_SYNCHRONIZED|ACC_NATIVE
|
|
|
|
#define INTERFACE_MODIFIERS ACC_PUBLIC|ACC_ABSTRACT
|
|
|
|
#define INTERFACE_METHOD_MODIFIERS ACC_PUBLIC|ACC_ABSTRACT
|
|
|
|
#define INTERFACE_FIELD_MODIFIERS ACC_PUBLIC|ACC_STATIC|ACC_FINAL
|
|
|
|
|
|
|
|
/* Getting a modifier WFL */
|
|
|
|
#define MODIFIER_WFL(M) (ctxp->modifier_ctx [(M) - PUBLIC_TK])
|
|
|
|
|
|
|
|
/* Check on modifiers */
|
|
|
|
#define THIS_MODIFIER_ONLY(f, m, v, count, l) \
|
|
|
|
if ((f) & (m)) \
|
|
|
|
{ \
|
|
|
|
tree node = ctxp->modifier_ctx [v]; \
|
|
|
|
if ((l) \
|
|
|
|
&& ((EXPR_WFL_COLNO (node) > EXPR_WFL_COLNO (l)) \
|
|
|
|
|| (EXPR_WFL_LINENO (node) > EXPR_WFL_LINENO (l)))) \
|
|
|
|
l = node; \
|
|
|
|
else if (!(l)) \
|
|
|
|
l = node; \
|
|
|
|
count++; \
|
|
|
|
}
|
|
|
|
|
class.c (layout_class): Don't mangle <finit>, produce __finit<class> instead.
Wed Oct 28 08:03:31 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* class.c (layout_class): Don't mangle <finit>, produce
__finit<class> instead. Don't verify artificial methods.
* decl.c (finit_identifier_node): New declared global.
(init_decl_processing): finit_identifier_node initialized.
* java-tree.def (CONDITIONAL_EXPR): New Java tree code.
* java-tree.h (finit_identifier_node): Declared as extern.
(struct lang_decl): New field called_constructor.
(DECL_CONSTRUCTOR_CALLS): Access macro to called_constructor.
(CLASS_HAS_FINIT_P): New macro.
(CALL_CONSTRUCTOR_P): Leading comment changed. Macro now checks
explicit constructor invocation.
(CALL_EXPLICIT_CONSTRUCTOR_P, CALL_THIS_CONSTRUCTOR_P,
CALL_SUPER_CONSTRUCTOR_P): New macros.
(write_classfile): Added prototype.
* jcf-parse.c (jcf_parse_source): Parse and remember for
generation if the file was seen on the command line.
(parse_source_file): Don't write the class file here.
(yyparse): Loop on files rewritten. Set current_jcf.
(parse_zip_file_entries): Parse class file only if it was found.
* lang.c (init_parse): Don't open command line provided filename
here.
(lang_parse): Don't set main_jcf anymore.
* parse.h (ABSTRAC_CHECK): Capitalized arguments.
(JCONSTRUCTOR_CHECK): New macro.
(JBSC_TYPE_P): New macro.
(IN_TRY_BLOCK_P, EXCEPTIONS_P): Fixed leading comment.
(COMPLETE_CHECK_OP_2): New macro.
(struct parse_ctxt): New field explicit_constructor_p.
(check_class_interface_creation): Fixed prototype indentation.
(patch_method_invocation_stmt): Prototype reflects added argument.
(patch_invoke): Likewise.
(complete_method_declaration, build_super_invocation,
verify_constructor_circularity,
build_this_super_qualified_invocation, get_printable_method_name,
patch_conditional_expr, maybe_generate_finit, fix_constructors,
verify_constructor_super, create_artificial_method,
start_artificial_method_body, end_artificial_method_body,
generate_field_initialization_code): New function prototypes.
* parse.y: Fixed leading comment
(constructor_header:, constructor_body:, block_end:): Rules tagged
<node>.
(type_declaration:): Call maybe_generate_finit.
(method_declaration:): Action for method_body: placed in new
function complete_method_declaration, called here.
(constructor_declaration:): Defined actions. Removed leading
FIXME.
(constructor_header:): New rule with action.
(constructor_body:): Rule rewritten using block_begin: and
block_end:. Defined actions.
(constructor_declarator:, explicit_constructor_invocation:):
Defined actions.
(block:): Use new rules block_begin: block_end:.
(block_begin:, block_end:): New rules and actions.
(block_statements:): Fixed error message for explicit
constructors.
(method_invocation:): Call build_this_super_qualified_invocation
if primary is `this' or `super' was seen.
(conditional_expression:): Action defined.
(extra_ctxp_pushed_p): New static global flag.
(java_parser_context_save_global): Create parser context if
necessary. Use extra_ctxp_pushed_p to remember it.
(java_parser_context_restore_global): Pop extra parser context if
one exists.
(build_array_from_name): Array on primitive types are marked
loaded.
(register_fields): Restore new name in field initializer
expression if type was altered. Non static fields initialized upon
declaration marked initialized.
(maybe_generate_finit): New function.
(maybe_generate_clinit): Use create_artificial_method,
start_artificial_method_body, end_artificial_method_body. Generate
debug info for enclosed initialization statements.
(method_header): Fixed leading comment. Check constructor
flags. Detect constructor declarations and set DECL_CONSTRUCTOR_P
accordingly.
(complete_method_declaration, constructor_circularity_msg,
verify_constructor_circularity): New functions.
(get_printable_method_name): New function.
(check_method_redefinition): Don't rename <finit> methods. Fix
declared constructor names. Error message for
constructors modified.
(java_check_regular_methods): Local variable seen_constructor
renamed saw_constructor. Skip verification on constructors. Create
default constructor with create_artificial_method.
(java_check_methods): Removed unnecessary empty line.
(create_artificial_method, start_artificial_method_body,
end_artificial_method_body): New functions.
(java_layout_classes): Changed leading comment. Reverse fields
list if necessary. Always layout java.lang.Object if being
defined.
(java_complete_expand_methods): Verify constructor circularity.
(java_complete_expand_method): Call fix_constructor on
constructors. Local variable no_ac_found removed. Restore
bindings if method body expansion failed.
(fix_constructors, verify_constructor_super,
generate_field_initialization_code): New function.
(java_expand_classes): Fixed leading comment. Write class file
here.
(resolve_expression_name): Check for illegal instance variable
usage within the argument scope of an explicit constructor
invocation.
(resolve_qualified_expression_name): Pass extra from_super flag
when invoking patch_method_invocation_stmt. New case for
conditional expression when used as a primary. Check for error
when acquiring super.
(patch_method_invocation_stmt): Added extra argument super. New
local variable is_static_flag. Set class_to_search according to
the nature of the constructor invocation. Don't add `this'
argument when expanding NEW_CLASS_EXPR. Check for illegal method
invocation within the argument scope of explicit constructor
invocation. Set is_static according to is_static_flag. Provide
extra `super' argument to patch_invoke invocation.
(patch_invoke): New argument from_super. Loop on arguments
indentation fixed. Pass from_super to invocation_mode. New switch
case INVOKE_SUPER. Fixed error message in switch default case.
Don't use CALL_CONSTRUCTOR_P but rather a test on the tree node
value.
(invocation_mode): Return INVOKE_SUPER mode when appropriate.
(lookup_method_invoke): Fixed prototypes in candidates list. Error
message takes constructors into account.
(find_applicable_accessible_methods_list): Fixed indentation.
(qualify_ambiguous_name): Take explicit constructor invocation
into account. Deal with a conditional expression as a primary to
a method call.
(java_complete_tree): Added local wfl_op3. New CONDITIONAL_EXPR
case. Added extra argument to patch_method_invocation_stmt.
Register calls made to explicit constructor `this'. Don't call
save_expr in ARRAY_REF case when emitting class files. Check for
illegal use of this when expanding explicit constructor invocation
arguments.
(complete_function_arguments): Set and reset parser context
explicit_constructor_p field value when appropriate.
(build_super_invocation, build_this_super_qualified_invocation):
New functions.
(patch_assignment): Fixed typo.
(patch_unaryop): Check on final fields occurs only when a decl
exits.
(patch_return): Take constructors into account.
(patch_conditional_expr): New function.
* typeck.c (build_java_signature): Removed unnecessary empty line.
This patch implements the conditional operator, fixes the super
invokation mode, implements most of what is required for constructors
and changes the way source files are handled by the front-end.
From-SVN: r23403
1998-10-28 13:06:17 +00:00
|
|
|
#define ABSTRACT_CHECK(FLAG, V, CL, S) \
|
|
|
|
if ((FLAG) & (V)) \
|
|
|
|
parse_error_context ((CL), S " method can't be abstract");
|
|
|
|
|
|
|
|
#define JCONSTRUCTOR_CHECK(FLAG, V, CL, S) \
|
|
|
|
if ((FLAG) & (V)) \
|
|
|
|
parse_error_context ((CL), "Constructor can't be %s", (S)); \
|
|
|
|
|
1998-09-06 15:36:06 +00:00
|
|
|
/* Misc. */
|
|
|
|
#define exit_java_complete_class() \
|
|
|
|
{ \
|
|
|
|
pop_obstacks (); \
|
|
|
|
return; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define CLASS_OR_INTERFACE(decl, s1, s2) \
|
|
|
|
(decl ? \
|
|
|
|
((get_access_flags_from_decl (TYPE_NAME (TREE_TYPE (decl))) \
|
|
|
|
& ACC_INTERFACE) ? \
|
|
|
|
s2 : s1) : ((s1 [0]=='S'|| s1 [0]=='s') ? \
|
|
|
|
(s1 [0]=='S' ? "Supertype" : "supertype") : \
|
|
|
|
(s1 [0] > 'A' ? "Type" : "type")))
|
|
|
|
|
|
|
|
/* Pedantic warning on obsolete modifiers. Note: when cl is NULL,
|
|
|
|
flags was set artificially, such as for a interface method */
|
|
|
|
#define OBSOLETE_MODIFIER_WARNING(cl, flags, modifier, format, arg) \
|
|
|
|
{ \
|
|
|
|
if ((cl) && ((flags) & (modifier))) \
|
|
|
|
parse_warning_context (cl, \
|
|
|
|
"Discouraged redundant use of `%s' modifier " \
|
|
|
|
"in declaration of " format, \
|
|
|
|
java_accstring_lookup (modifier), arg); \
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Quickly build a temporary pointer on hypothetical type NAME. */
|
|
|
|
#define BUILD_PTR_FROM_NAME(ptr, name) \
|
|
|
|
{ \
|
|
|
|
ptr = build (POINTER_TYPE, NULL_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))
|
|
|
|
|
|
|
|
/* 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. */
|
|
|
|
#define JAVA_MAYBE_GENERATE_DEBUG_INFO(node) \
|
|
|
|
(debug_info_level != DINFO_LEVEL_NONE ? \
|
|
|
|
EXPR_WFL_EMIT_LINE_NOTE (node) = 1, node : node)
|
|
|
|
|
|
|
|
/* Types classification, according to the JLS, section 4.2 */
|
1998-10-12 05:43:53 -07:00
|
|
|
#define JFLOAT_TYPE_P(TYPE) (TYPE && TREE_CODE ((TYPE)) == REAL_TYPE)
|
|
|
|
#define JINTEGRAL_TYPE_P(TYPE) ((TYPE) \
|
|
|
|
&& (TREE_CODE ((TYPE)) == INTEGER_TYPE \
|
|
|
|
|| TREE_CODE ((TYPE)) == CHAR_TYPE))
|
|
|
|
#define JNUMERIC_TYPE_P(TYPE) ((TYPE) \
|
|
|
|
&& (JFLOAT_TYPE_P ((TYPE)) \
|
|
|
|
|| JINTEGRAL_TYPE_P ((TYPE))))
|
|
|
|
#define JPRIMITIVE_TYPE_P(TYPE) ((TYPE) \
|
|
|
|
&& (JNUMERIC_TYPE_P ((TYPE)) \
|
|
|
|
|| TREE_CODE ((TYPE)) == BOOLEAN_TYPE))
|
1998-09-06 15:36:06 +00:00
|
|
|
|
class.c (layout_class): Don't mangle <finit>, produce __finit<class> instead.
Wed Oct 28 08:03:31 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* class.c (layout_class): Don't mangle <finit>, produce
__finit<class> instead. Don't verify artificial methods.
* decl.c (finit_identifier_node): New declared global.
(init_decl_processing): finit_identifier_node initialized.
* java-tree.def (CONDITIONAL_EXPR): New Java tree code.
* java-tree.h (finit_identifier_node): Declared as extern.
(struct lang_decl): New field called_constructor.
(DECL_CONSTRUCTOR_CALLS): Access macro to called_constructor.
(CLASS_HAS_FINIT_P): New macro.
(CALL_CONSTRUCTOR_P): Leading comment changed. Macro now checks
explicit constructor invocation.
(CALL_EXPLICIT_CONSTRUCTOR_P, CALL_THIS_CONSTRUCTOR_P,
CALL_SUPER_CONSTRUCTOR_P): New macros.
(write_classfile): Added prototype.
* jcf-parse.c (jcf_parse_source): Parse and remember for
generation if the file was seen on the command line.
(parse_source_file): Don't write the class file here.
(yyparse): Loop on files rewritten. Set current_jcf.
(parse_zip_file_entries): Parse class file only if it was found.
* lang.c (init_parse): Don't open command line provided filename
here.
(lang_parse): Don't set main_jcf anymore.
* parse.h (ABSTRAC_CHECK): Capitalized arguments.
(JCONSTRUCTOR_CHECK): New macro.
(JBSC_TYPE_P): New macro.
(IN_TRY_BLOCK_P, EXCEPTIONS_P): Fixed leading comment.
(COMPLETE_CHECK_OP_2): New macro.
(struct parse_ctxt): New field explicit_constructor_p.
(check_class_interface_creation): Fixed prototype indentation.
(patch_method_invocation_stmt): Prototype reflects added argument.
(patch_invoke): Likewise.
(complete_method_declaration, build_super_invocation,
verify_constructor_circularity,
build_this_super_qualified_invocation, get_printable_method_name,
patch_conditional_expr, maybe_generate_finit, fix_constructors,
verify_constructor_super, create_artificial_method,
start_artificial_method_body, end_artificial_method_body,
generate_field_initialization_code): New function prototypes.
* parse.y: Fixed leading comment
(constructor_header:, constructor_body:, block_end:): Rules tagged
<node>.
(type_declaration:): Call maybe_generate_finit.
(method_declaration:): Action for method_body: placed in new
function complete_method_declaration, called here.
(constructor_declaration:): Defined actions. Removed leading
FIXME.
(constructor_header:): New rule with action.
(constructor_body:): Rule rewritten using block_begin: and
block_end:. Defined actions.
(constructor_declarator:, explicit_constructor_invocation:):
Defined actions.
(block:): Use new rules block_begin: block_end:.
(block_begin:, block_end:): New rules and actions.
(block_statements:): Fixed error message for explicit
constructors.
(method_invocation:): Call build_this_super_qualified_invocation
if primary is `this' or `super' was seen.
(conditional_expression:): Action defined.
(extra_ctxp_pushed_p): New static global flag.
(java_parser_context_save_global): Create parser context if
necessary. Use extra_ctxp_pushed_p to remember it.
(java_parser_context_restore_global): Pop extra parser context if
one exists.
(build_array_from_name): Array on primitive types are marked
loaded.
(register_fields): Restore new name in field initializer
expression if type was altered. Non static fields initialized upon
declaration marked initialized.
(maybe_generate_finit): New function.
(maybe_generate_clinit): Use create_artificial_method,
start_artificial_method_body, end_artificial_method_body. Generate
debug info for enclosed initialization statements.
(method_header): Fixed leading comment. Check constructor
flags. Detect constructor declarations and set DECL_CONSTRUCTOR_P
accordingly.
(complete_method_declaration, constructor_circularity_msg,
verify_constructor_circularity): New functions.
(get_printable_method_name): New function.
(check_method_redefinition): Don't rename <finit> methods. Fix
declared constructor names. Error message for
constructors modified.
(java_check_regular_methods): Local variable seen_constructor
renamed saw_constructor. Skip verification on constructors. Create
default constructor with create_artificial_method.
(java_check_methods): Removed unnecessary empty line.
(create_artificial_method, start_artificial_method_body,
end_artificial_method_body): New functions.
(java_layout_classes): Changed leading comment. Reverse fields
list if necessary. Always layout java.lang.Object if being
defined.
(java_complete_expand_methods): Verify constructor circularity.
(java_complete_expand_method): Call fix_constructor on
constructors. Local variable no_ac_found removed. Restore
bindings if method body expansion failed.
(fix_constructors, verify_constructor_super,
generate_field_initialization_code): New function.
(java_expand_classes): Fixed leading comment. Write class file
here.
(resolve_expression_name): Check for illegal instance variable
usage within the argument scope of an explicit constructor
invocation.
(resolve_qualified_expression_name): Pass extra from_super flag
when invoking patch_method_invocation_stmt. New case for
conditional expression when used as a primary. Check for error
when acquiring super.
(patch_method_invocation_stmt): Added extra argument super. New
local variable is_static_flag. Set class_to_search according to
the nature of the constructor invocation. Don't add `this'
argument when expanding NEW_CLASS_EXPR. Check for illegal method
invocation within the argument scope of explicit constructor
invocation. Set is_static according to is_static_flag. Provide
extra `super' argument to patch_invoke invocation.
(patch_invoke): New argument from_super. Loop on arguments
indentation fixed. Pass from_super to invocation_mode. New switch
case INVOKE_SUPER. Fixed error message in switch default case.
Don't use CALL_CONSTRUCTOR_P but rather a test on the tree node
value.
(invocation_mode): Return INVOKE_SUPER mode when appropriate.
(lookup_method_invoke): Fixed prototypes in candidates list. Error
message takes constructors into account.
(find_applicable_accessible_methods_list): Fixed indentation.
(qualify_ambiguous_name): Take explicit constructor invocation
into account. Deal with a conditional expression as a primary to
a method call.
(java_complete_tree): Added local wfl_op3. New CONDITIONAL_EXPR
case. Added extra argument to patch_method_invocation_stmt.
Register calls made to explicit constructor `this'. Don't call
save_expr in ARRAY_REF case when emitting class files. Check for
illegal use of this when expanding explicit constructor invocation
arguments.
(complete_function_arguments): Set and reset parser context
explicit_constructor_p field value when appropriate.
(build_super_invocation, build_this_super_qualified_invocation):
New functions.
(patch_assignment): Fixed typo.
(patch_unaryop): Check on final fields occurs only when a decl
exits.
(patch_return): Take constructors into account.
(patch_conditional_expr): New function.
* typeck.c (build_java_signature): Removed unnecessary empty line.
This patch implements the conditional operator, fixes the super
invokation mode, implements most of what is required for constructors
and changes the way source files are handled by the front-end.
From-SVN: r23403
1998-10-28 13:06:17 +00:00
|
|
|
#define JBSC_TYPE_P(TYPE) ((TYPE) && (((TYPE) == byte_type_node) \
|
|
|
|
|| ((TYPE) == short_type_node) \
|
|
|
|
|| ((TYPE) == char_type_node)))
|
|
|
|
|
1998-09-06 15:36:06 +00:00
|
|
|
/* Not defined in the LRM */
|
1998-10-12 05:43:53 -07:00
|
|
|
#define JSTRING_TYPE_P(TYPE) ((TYPE) \
|
|
|
|
&& ((TYPE) == string_type_node || \
|
|
|
|
(TREE_CODE (TYPE) == POINTER_TYPE && \
|
|
|
|
TREE_TYPE (TYPE) == string_type_node)))
|
|
|
|
#define JSTRING_P(NODE) ((NODE) \
|
|
|
|
&& (TREE_CODE (NODE) == STRING_CST \
|
|
|
|
|| IS_CRAFTED_STRING_BUFFER_P (NODE) \
|
|
|
|
|| JSTRING_TYPE_P (TREE_TYPE (NODE))))
|
|
|
|
|
|
|
|
#define JREFERENCE_TYPE_P(TYPE) ((TYPE) \
|
|
|
|
&& (TREE_CODE (TYPE) == RECORD_TYPE \
|
|
|
|
|| (TREE_CODE (TYPE) == POINTER_TYPE \
|
|
|
|
&& TREE_CODE (TREE_TYPE (TYPE)) == \
|
|
|
|
RECORD_TYPE)))
|
1998-09-06 15:36:06 +00:00
|
|
|
|
|
|
|
/* Other predicate */
|
|
|
|
#define DECL_P(NODE) (NODE && (TREE_CODE (NODE) == PARM_DECL \
|
|
|
|
|| TREE_CODE (NODE) == VAR_DECL \
|
|
|
|
|| TREE_CODE (NODE) == FIELD_DECL))
|
|
|
|
|
|
|
|
#define TYPE_INTERFACE_P(TYPE) \
|
|
|
|
(CLASS_P (TYPE) && CLASS_INTERFACE (TYPE_NAME (TYPE)))
|
|
|
|
|
|
|
|
#define TYPE_CLASS_P(TYPE) (CLASS_P (TYPE) \
|
|
|
|
&& !CLASS_INTERFACE (TYPE_NAME (TYPE)) \
|
|
|
|
&& !TYPE_ARRAY_P (TYPE))
|
|
|
|
|
|
|
|
/* Standard error messages */
|
|
|
|
#define ERROR_CANT_CONVERT_TO_BOOLEAN(OPERATOR, NODE, TYPE) \
|
|
|
|
parse_error_context \
|
|
|
|
((OPERATOR), "Incompatible type for `%s'. Can't convert `%s' to " \
|
java-tree.h (pop_labeled_block, [...]): New function prototypes.
Wed Oct 14 18:21:29 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* java-tree.h (pop_labeled_block, lang_printable_name,
maybe_add_interface, set_super_info, get_access_flags_from_decl,
interface_of_p, inherits_from_p, fix_classpath,
complete_start_java_method, emit_handlers, init_outgoing_cpool,
make_class_data, register_class, alloc_name_constant): New
function prototypes.
* lang.c (lang_decode_option): Set argc argument unused. Fixed
indentation. Added cast to remove warning.
(lang_printable_name): Set v argument unused.
(lang_print_error): Added argument to lang_printable_name call.
(java_dummy_print, print_lang_decl, print_lang_type,
print_lang_identifier, lang_print_xnode): All argument marked
unused.
* lex.c (java_unget_unicode): Removed unnecessary argument.
(java_allocate_new_line): Unused local variable is gone.
(java_read_char): Added parenthesis in expressions to remove
warnings. Added final return statement.
(java_read_unicode): Added parenthesis in expression to remove
warning.
(java_parse_end_comment): Fixed java_unget_unicode invocation.
(java_parse_escape_sequence): Likewise.
(java_lex): Unused local variables are gone. Fixed
java_unget_unicode invocation.
* lex.h (set_float_handler): Prototype added when JC1_LITE not
defined.
* parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed
lang_printable_name invocation in macro.
(ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL):
Likewise.
(duplicate_declaration_error): Suppressed unused argument in
prototype.
(identical_subpath_p): Function declaration is gone.
(patch_invoke): Suppressed unused argument in prototype.
(patch_cast, build_labeled_block, check_thrown_exceptions):
Likewise.
* parse.y (setjmp.h): Included
(toplev.h): Likewise.
(field_declaration:): Suppressed unused local
(label_decl:): Fixed build_labeled_block invocation.
(java_pop_parser_context): Put extra parenthesis around assignment
in if.
(yyerror): Suppressed unused local variables.
(variable_redefinition_error): Fixed lang_printable_name
invocation.
(create_interface): Suppressed unused local variables.
(create_class): Likewise.
(duplicate_declaration_error): Suppressed unused argument. Fixed
lang_printable_name invocation.
(register_fields): Suppressed unused local variable. Fixed
duplicate_declaration_error invocation.
(method_header): Suppressed unused local variable.
(method_declarator, parser_check_super): Likewise.
(java_complete_class): Suppressed unused local variable. Fixed
fatal error message.
(complete_class_report_errors): Added default: in switch.
(java_check_regular_methods): Fixed lang_printable_name
invocations.
(check_throws_clauses): Likewise.
(java_check_abstract_methods): Suppressed unused local
variable. Fixed lang_printable_name invocation.
(read_import_entry): Added supplemental return statement.
(read_import_dir): Suppressed unused local variables.
(check_pkg_class_access, declare_local_variables): Likewise.
(source_start_java_method): Suppressed unused extern variable
declarations
(expand_start_java_method): Suppressed unused extern and local
variable declarations.
(java_complete_expand_methods): Likewise.
(java_complete_expand_method): Suppressed unused local variables.
(make_qualified_name): Likewise.
(resolve_qualified_expression_name): Added default: in
switch. Fixed lang_printable_name invocation.
(class_instance_creation_expression): Added parenthesis around
expressions.
(patch_method_invocation_stmt): Fixed lang_printable_name and
patch_invoke invocations.
(check_for_static_method_reference): Fixed lang_printable_name
invocation.
(patch_invoke): Suppressed unused arguments and local variables.
(lookup_method_invoke): Suppressed unused local variables.
(qualify_ambiguous_name): Added default: in switch.
(identical_subpath_p): Function removed.
(patch_assignment): Suppressed unused local variables. Suppressed
unnecessary if statement. Fixed lang_printable_name invocations.
(try_builtin_assignconv): Fixed lang_printable_name invocations.
(valid_ref_assignconv_cast_p): Parenthesis around
expression. Suppressed unused local variables.
(build_binop): Suppressed unused local variables. fixed
lang_printable_name invocations.
(string_constant_concatenation): Suppressed unused local
variables.
(patch_unaryop): Fixed lang_printable_name invocation.
(patch_cast): Suppressed unnecessary argument. Fixed
lang_printable_name invocation.
(patch_array_ref): Fixed lang_printable_name invocation.
(patch_newarray, patch_return, patch_if_else_statement): Likewise.
(build_labeled_block): Suppressed unused argument.
(generate_labeled_block): Fixed build_labeled_block invocation.
(build_loop_body): Suppressed unused local variables.
(patch_loop_statement): Likewise.
(patch_exit): Fixed lang_printable_name invocation.
(patch_switch_statement): Likewise.
(case_identity): First argument marked unused.
(patch_try_statement): Fixed lang_printable_name invocations.
(patch_synchronized_statement, patch_throw_statement): Likewise.
(check_thrown_exceptions): Fixed check_thrown_exceptions and
lang_printable_name invocations.
(check_thrown_exceptions_do): Suppressed unused argument.
Suppresses warnings during the compilation of parse.y (including
lex.c) and lang.c
From-SVN: r23090
1998-10-14 19:18:07 +00:00
|
|
|
"boolean", operator_string ((NODE)), lang_printable_name ((TYPE),0))
|
1998-09-06 15:36:06 +00:00
|
|
|
|
|
|
|
#define ERROR_CANT_CONVERT_TO_NUMERIC(OPERATOR, NODE, TYPE) \
|
|
|
|
parse_error_context \
|
|
|
|
((OPERATOR), "Incompatible type for `%s'. Can't convert `%s' to " \
|
java-tree.h (pop_labeled_block, [...]): New function prototypes.
Wed Oct 14 18:21:29 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* java-tree.h (pop_labeled_block, lang_printable_name,
maybe_add_interface, set_super_info, get_access_flags_from_decl,
interface_of_p, inherits_from_p, fix_classpath,
complete_start_java_method, emit_handlers, init_outgoing_cpool,
make_class_data, register_class, alloc_name_constant): New
function prototypes.
* lang.c (lang_decode_option): Set argc argument unused. Fixed
indentation. Added cast to remove warning.
(lang_printable_name): Set v argument unused.
(lang_print_error): Added argument to lang_printable_name call.
(java_dummy_print, print_lang_decl, print_lang_type,
print_lang_identifier, lang_print_xnode): All argument marked
unused.
* lex.c (java_unget_unicode): Removed unnecessary argument.
(java_allocate_new_line): Unused local variable is gone.
(java_read_char): Added parenthesis in expressions to remove
warnings. Added final return statement.
(java_read_unicode): Added parenthesis in expression to remove
warning.
(java_parse_end_comment): Fixed java_unget_unicode invocation.
(java_parse_escape_sequence): Likewise.
(java_lex): Unused local variables are gone. Fixed
java_unget_unicode invocation.
* lex.h (set_float_handler): Prototype added when JC1_LITE not
defined.
* parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed
lang_printable_name invocation in macro.
(ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL):
Likewise.
(duplicate_declaration_error): Suppressed unused argument in
prototype.
(identical_subpath_p): Function declaration is gone.
(patch_invoke): Suppressed unused argument in prototype.
(patch_cast, build_labeled_block, check_thrown_exceptions):
Likewise.
* parse.y (setjmp.h): Included
(toplev.h): Likewise.
(field_declaration:): Suppressed unused local
(label_decl:): Fixed build_labeled_block invocation.
(java_pop_parser_context): Put extra parenthesis around assignment
in if.
(yyerror): Suppressed unused local variables.
(variable_redefinition_error): Fixed lang_printable_name
invocation.
(create_interface): Suppressed unused local variables.
(create_class): Likewise.
(duplicate_declaration_error): Suppressed unused argument. Fixed
lang_printable_name invocation.
(register_fields): Suppressed unused local variable. Fixed
duplicate_declaration_error invocation.
(method_header): Suppressed unused local variable.
(method_declarator, parser_check_super): Likewise.
(java_complete_class): Suppressed unused local variable. Fixed
fatal error message.
(complete_class_report_errors): Added default: in switch.
(java_check_regular_methods): Fixed lang_printable_name
invocations.
(check_throws_clauses): Likewise.
(java_check_abstract_methods): Suppressed unused local
variable. Fixed lang_printable_name invocation.
(read_import_entry): Added supplemental return statement.
(read_import_dir): Suppressed unused local variables.
(check_pkg_class_access, declare_local_variables): Likewise.
(source_start_java_method): Suppressed unused extern variable
declarations
(expand_start_java_method): Suppressed unused extern and local
variable declarations.
(java_complete_expand_methods): Likewise.
(java_complete_expand_method): Suppressed unused local variables.
(make_qualified_name): Likewise.
(resolve_qualified_expression_name): Added default: in
switch. Fixed lang_printable_name invocation.
(class_instance_creation_expression): Added parenthesis around
expressions.
(patch_method_invocation_stmt): Fixed lang_printable_name and
patch_invoke invocations.
(check_for_static_method_reference): Fixed lang_printable_name
invocation.
(patch_invoke): Suppressed unused arguments and local variables.
(lookup_method_invoke): Suppressed unused local variables.
(qualify_ambiguous_name): Added default: in switch.
(identical_subpath_p): Function removed.
(patch_assignment): Suppressed unused local variables. Suppressed
unnecessary if statement. Fixed lang_printable_name invocations.
(try_builtin_assignconv): Fixed lang_printable_name invocations.
(valid_ref_assignconv_cast_p): Parenthesis around
expression. Suppressed unused local variables.
(build_binop): Suppressed unused local variables. fixed
lang_printable_name invocations.
(string_constant_concatenation): Suppressed unused local
variables.
(patch_unaryop): Fixed lang_printable_name invocation.
(patch_cast): Suppressed unnecessary argument. Fixed
lang_printable_name invocation.
(patch_array_ref): Fixed lang_printable_name invocation.
(patch_newarray, patch_return, patch_if_else_statement): Likewise.
(build_labeled_block): Suppressed unused argument.
(generate_labeled_block): Fixed build_labeled_block invocation.
(build_loop_body): Suppressed unused local variables.
(patch_loop_statement): Likewise.
(patch_exit): Fixed lang_printable_name invocation.
(patch_switch_statement): Likewise.
(case_identity): First argument marked unused.
(patch_try_statement): Fixed lang_printable_name invocations.
(patch_synchronized_statement, patch_throw_statement): Likewise.
(check_thrown_exceptions): Fixed check_thrown_exceptions and
lang_printable_name invocations.
(check_thrown_exceptions_do): Suppressed unused argument.
Suppresses warnings during the compilation of parse.y (including
lex.c) and lang.c
From-SVN: r23090
1998-10-14 19:18:07 +00:00
|
|
|
"numeric type", operator_string ((NODE)), lang_printable_name ((TYPE), 0))
|
1998-09-06 15:36:06 +00:00
|
|
|
|
|
|
|
#define ERROR_CAST_NEEDED_TO_INTEGRAL(OPERATOR, NODE, TYPE) \
|
|
|
|
parse_error_context \
|
|
|
|
((OPERATOR), (JPRIMITIVE_TYPE_P (TYPE) ? \
|
|
|
|
"Incompatible type for `%s'. Explicit cast needed to convert " \
|
|
|
|
"`%s' to integral" : "Incompatible type for `%s'. Can't convert " \
|
|
|
|
"`%s' to integral"), operator_string ((NODE)), \
|
java-tree.h (pop_labeled_block, [...]): New function prototypes.
Wed Oct 14 18:21:29 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* java-tree.h (pop_labeled_block, lang_printable_name,
maybe_add_interface, set_super_info, get_access_flags_from_decl,
interface_of_p, inherits_from_p, fix_classpath,
complete_start_java_method, emit_handlers, init_outgoing_cpool,
make_class_data, register_class, alloc_name_constant): New
function prototypes.
* lang.c (lang_decode_option): Set argc argument unused. Fixed
indentation. Added cast to remove warning.
(lang_printable_name): Set v argument unused.
(lang_print_error): Added argument to lang_printable_name call.
(java_dummy_print, print_lang_decl, print_lang_type,
print_lang_identifier, lang_print_xnode): All argument marked
unused.
* lex.c (java_unget_unicode): Removed unnecessary argument.
(java_allocate_new_line): Unused local variable is gone.
(java_read_char): Added parenthesis in expressions to remove
warnings. Added final return statement.
(java_read_unicode): Added parenthesis in expression to remove
warning.
(java_parse_end_comment): Fixed java_unget_unicode invocation.
(java_parse_escape_sequence): Likewise.
(java_lex): Unused local variables are gone. Fixed
java_unget_unicode invocation.
* lex.h (set_float_handler): Prototype added when JC1_LITE not
defined.
* parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed
lang_printable_name invocation in macro.
(ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL):
Likewise.
(duplicate_declaration_error): Suppressed unused argument in
prototype.
(identical_subpath_p): Function declaration is gone.
(patch_invoke): Suppressed unused argument in prototype.
(patch_cast, build_labeled_block, check_thrown_exceptions):
Likewise.
* parse.y (setjmp.h): Included
(toplev.h): Likewise.
(field_declaration:): Suppressed unused local
(label_decl:): Fixed build_labeled_block invocation.
(java_pop_parser_context): Put extra parenthesis around assignment
in if.
(yyerror): Suppressed unused local variables.
(variable_redefinition_error): Fixed lang_printable_name
invocation.
(create_interface): Suppressed unused local variables.
(create_class): Likewise.
(duplicate_declaration_error): Suppressed unused argument. Fixed
lang_printable_name invocation.
(register_fields): Suppressed unused local variable. Fixed
duplicate_declaration_error invocation.
(method_header): Suppressed unused local variable.
(method_declarator, parser_check_super): Likewise.
(java_complete_class): Suppressed unused local variable. Fixed
fatal error message.
(complete_class_report_errors): Added default: in switch.
(java_check_regular_methods): Fixed lang_printable_name
invocations.
(check_throws_clauses): Likewise.
(java_check_abstract_methods): Suppressed unused local
variable. Fixed lang_printable_name invocation.
(read_import_entry): Added supplemental return statement.
(read_import_dir): Suppressed unused local variables.
(check_pkg_class_access, declare_local_variables): Likewise.
(source_start_java_method): Suppressed unused extern variable
declarations
(expand_start_java_method): Suppressed unused extern and local
variable declarations.
(java_complete_expand_methods): Likewise.
(java_complete_expand_method): Suppressed unused local variables.
(make_qualified_name): Likewise.
(resolve_qualified_expression_name): Added default: in
switch. Fixed lang_printable_name invocation.
(class_instance_creation_expression): Added parenthesis around
expressions.
(patch_method_invocation_stmt): Fixed lang_printable_name and
patch_invoke invocations.
(check_for_static_method_reference): Fixed lang_printable_name
invocation.
(patch_invoke): Suppressed unused arguments and local variables.
(lookup_method_invoke): Suppressed unused local variables.
(qualify_ambiguous_name): Added default: in switch.
(identical_subpath_p): Function removed.
(patch_assignment): Suppressed unused local variables. Suppressed
unnecessary if statement. Fixed lang_printable_name invocations.
(try_builtin_assignconv): Fixed lang_printable_name invocations.
(valid_ref_assignconv_cast_p): Parenthesis around
expression. Suppressed unused local variables.
(build_binop): Suppressed unused local variables. fixed
lang_printable_name invocations.
(string_constant_concatenation): Suppressed unused local
variables.
(patch_unaryop): Fixed lang_printable_name invocation.
(patch_cast): Suppressed unnecessary argument. Fixed
lang_printable_name invocation.
(patch_array_ref): Fixed lang_printable_name invocation.
(patch_newarray, patch_return, patch_if_else_statement): Likewise.
(build_labeled_block): Suppressed unused argument.
(generate_labeled_block): Fixed build_labeled_block invocation.
(build_loop_body): Suppressed unused local variables.
(patch_loop_statement): Likewise.
(patch_exit): Fixed lang_printable_name invocation.
(patch_switch_statement): Likewise.
(case_identity): First argument marked unused.
(patch_try_statement): Fixed lang_printable_name invocations.
(patch_synchronized_statement, patch_throw_statement): Likewise.
(check_thrown_exceptions): Fixed check_thrown_exceptions and
lang_printable_name invocations.
(check_thrown_exceptions_do): Suppressed unused argument.
Suppresses warnings during the compilation of parse.y (including
lex.c) and lang.c
From-SVN: r23090
1998-10-14 19:18:07 +00:00
|
|
|
lang_printable_name ((TYPE), 0))
|
1998-09-06 15:36:06 +00:00
|
|
|
|
|
|
|
#define ERROR_VARIABLE_NOT_INITIALIZED(WFL, V) \
|
|
|
|
parse_error_context \
|
1998-10-12 05:43:53 -07:00
|
|
|
((WFL), "Variable `%s' may not have been initialized", \
|
1998-09-06 15:36:06 +00:00
|
|
|
IDENTIFIER_POINTER (V))
|
|
|
|
|
1998-10-12 05:43:53 -07:00
|
|
|
/* Definition for loop handling. This is Java's own definition of a
|
|
|
|
loop body. See parse.y for documentation. It's valid once you hold
|
|
|
|
a loop's body (LOOP_EXPR_BODY) */
|
1998-09-06 15:36:06 +00:00
|
|
|
|
|
|
|
/* The loop main block is the one hold the condition and the loop body */
|
|
|
|
#define LOOP_EXPR_BODY_MAIN_BLOCK(NODE) TREE_OPERAND (NODE, 0)
|
|
|
|
/* And then there is the loop update block */
|
|
|
|
#define LOOP_EXPR_BODY_UPDATE_BLOCK(NODE) TREE_OPERAND (NODE, 1)
|
|
|
|
|
|
|
|
/* Inside the loop main block, there is the loop condition and the
|
|
|
|
loop body. They may be reversed if the loop being described is a
|
|
|
|
do-while loop. NOTE: if you use a WFL around the EXIT_EXPR so you
|
|
|
|
can issue debug info for it, the EXIT_EXPR will be one operand
|
|
|
|
further. */
|
|
|
|
#define LOOP_EXPR_BODY_CONDITION_EXPR(NODE, R) \
|
|
|
|
TREE_OPERAND (LOOP_EXPR_BODY_MAIN_BLOCK (NODE), (R ? 1 : 0))
|
|
|
|
|
|
|
|
/* Here is the labeled block the loop real body is encapsulated in */
|
|
|
|
#define LOOP_EXPR_BODY_LABELED_BODY(NODE, R) \
|
|
|
|
TREE_OPERAND (LOOP_EXPR_BODY_MAIN_BLOCK (NODE), (R ? 0 : 1))
|
|
|
|
/* And here is the loop's real body */
|
|
|
|
#define LOOP_EXPR_BODY_BODY_EXPR(NODE, R) \
|
|
|
|
LABELED_BLOCK_BODY (LOOP_EXPR_BODY_LABELED_BODY(NODE, R))
|
|
|
|
|
|
|
|
/* Does a loop have a label ? */
|
|
|
|
#define LOOP_HAS_LABEL_P(LOOP) \
|
|
|
|
(ctxp->current_labeled_block \
|
|
|
|
&& LABELED_BLOCK_BODY (ctxp->current_labeled_block) == (LOOP))
|
|
|
|
|
|
|
|
/* Same operation than the one performed above, but considering the
|
|
|
|
previous labeled block */
|
|
|
|
#define LOOP_HAS_LABEL_SKIP_P(LOOP) \
|
|
|
|
(ctxp->current_labeled_block \
|
|
|
|
&& TREE_CHAIN (ctxp->current_labeled_block) \
|
|
|
|
&& LABELED_BLOCK_BODY (TREE_CHAIN (ctxp->current_labeled_block)) == (LOOP))
|
|
|
|
|
|
|
|
#define PUSH_LABELED_BLOCK(B) \
|
|
|
|
{ \
|
|
|
|
TREE_CHAIN (B) = ctxp->current_labeled_block; \
|
|
|
|
ctxp->current_labeled_block = (B); \
|
|
|
|
}
|
|
|
|
#define POP_LABELED_BLOCK() \
|
|
|
|
ctxp->current_labeled_block = TREE_CHAIN (ctxp->current_labeled_block)
|
|
|
|
|
|
|
|
#define PUSH_LOOP(L) \
|
|
|
|
{ \
|
|
|
|
TREE_CHAIN (L) = ctxp->current_loop; \
|
|
|
|
ctxp->current_loop = (L); \
|
|
|
|
}
|
|
|
|
#define POP_LOOP() ctxp->current_loop = TREE_CHAIN (ctxp->current_loop)
|
|
|
|
|
decl.c (runtime_exception_type_node, [...]): New global variables.
Tue Oct 13 03:50:28 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* decl.c (runtime_exception_type_node, error_exception_type_node):
New global variables.
(init_decl_processing): Initialized.
* expr.c (java_lang_expand_expr): Set caught exception type to
null if catch handler argument doesn't exit.
* java-tree.def (SYNCHRONIZED_EXPR, THROW_EXPR): New Java specific
tree codes.
* java-tree.h (runtime_exception_type_node,
error_exception_type_node): Global variables declared.
(DECL_FUNCTION_THROWS): New macro.
(DECL_FUNCTION_BODY): Modified comment.
(DECL_SPECIFIC_COUNT): Likewise.
(struct lang_decl): New field throws_list.
(IS_UNCHECKED_EXPRESSION_P): New macro.
* lex.c (java_lex): Generate location information for THROW_TK.
* parse.h (PUSH_EXCEPTIONS, POP_EXCEPTIONS, IN_TRY_BLOCK_P,
EXCEPTIONS_P): New macros.
(enum jdep_code): New value JDEP_EXCEPTION.
(BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT,
BUILD_ASSIGN_EXCEPTION_INFO, BUILD_THROW, SET_WFL_OPERATOR,
PATCH_METHOD_RETURN_ERROR): New macros.
(patch_method_invocation_stmt): Added new argument to prototype.
(patch_synchronized_statement, patch_throw_statement,
check_thrown_exceptions, check_thrown_exceptions_do,
purge_unchecked_exceptions, check_throws_clauses): New function
prototypes.
* parse.y Fixed typo in keyword section.
(throw:): Rule tagged <node>.
(THROW_TK): Keyword tagged <operator>.
(method_header:): Last argument to call to method_header passed
from throws: rule.
(throws:, class_type_list:, throw_statement:,
synchronized_statement:, synchronized:): Defined actions.
(method_header): New local variable current. Register exceptions
from throws clause.
(java_complete_tree): Complete and verify exceptions from throws
clause.
(complete_class_report_errors): Error message on exceptions not
found
(java_check_regular_methods): Fixed typo. Shortcut on private
overriding methods. Changed error message on method
redefinition. Check for throws clause compatibility.
(check_throws_clauses): New function.
(java_check_abstract_methods): Use DECL_NAME for wfl or current
method. Changed error message on method redefinition.
(currently_caught_type_list): New static variable.
(java_complete_expand_methods): Purge unchecked exceptions from
throws clause list. Call PUSH_EXCEPTIONS before walk and
POP_EXCEPTIONS after.
(resolve_qualified_expression_name): Pass new argument as NULL to
patch_method_invocation_stmt.
(patch_method_invocation_stmt): New argument ref_decl. Invoke
PATCH_METHOD_RETURN_ERROR when returning with error. Reverse
argument list when appropriate. Use new argument if non null to
store selected method decl.
(patch_invoke): Convert if necessary args of builtin types before
forming CALL_EXPR. Argument list no longer reversed here.
(invocation_mode): Treat final methods as static methods.
(java_complete_tree): New cases for THROW_EXPR: and
SYNCHRONIZED_EXPR:. Check thrown exceptions when completing
function call.
(complete_function_arguments): No more RECORD_TYPE
conversion. Function parameter nodes no longer saved.
(valid_ref_assignconv_cast_p): Avoid handling null type.
(patch_binop): Fixed null constant reference handling.
(build_try_statement): Use BUILD_ASSIGN_EXCEPTION_INFO and
BUILD_THROW macros.
(patch_try_statement): Fixed comments. Record caught types in
list, push the list, expand try block and pop the list.
(patch_synchronized_statement, patch_throw_statement,
check_thrown_exceptions, check_thrown_exceptions_do,
purge_unchecked_exceptions): New functions.
* typeck.c (lookup_argument_method): Allow WFL in place of method
DECL_NAME during method definition check
Implements the `synchronized' statement, the `throw' statements and
the `throws' clause. Fixes method invocation bugs.
From-SVN: r23087
1998-10-14 15:11:04 +00:00
|
|
|
#define PUSH_EXCEPTIONS(E) \
|
|
|
|
currently_caught_type_list = \
|
|
|
|
tree_cons (NULL_TREE, (E), currently_caught_type_list);
|
|
|
|
|
|
|
|
#define POP_EXCEPTIONS() \
|
|
|
|
currently_caught_type_list = TREE_CHAIN (currently_caught_type_list)
|
|
|
|
|
class.c (layout_class): Don't mangle <finit>, produce __finit<class> instead.
Wed Oct 28 08:03:31 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* class.c (layout_class): Don't mangle <finit>, produce
__finit<class> instead. Don't verify artificial methods.
* decl.c (finit_identifier_node): New declared global.
(init_decl_processing): finit_identifier_node initialized.
* java-tree.def (CONDITIONAL_EXPR): New Java tree code.
* java-tree.h (finit_identifier_node): Declared as extern.
(struct lang_decl): New field called_constructor.
(DECL_CONSTRUCTOR_CALLS): Access macro to called_constructor.
(CLASS_HAS_FINIT_P): New macro.
(CALL_CONSTRUCTOR_P): Leading comment changed. Macro now checks
explicit constructor invocation.
(CALL_EXPLICIT_CONSTRUCTOR_P, CALL_THIS_CONSTRUCTOR_P,
CALL_SUPER_CONSTRUCTOR_P): New macros.
(write_classfile): Added prototype.
* jcf-parse.c (jcf_parse_source): Parse and remember for
generation if the file was seen on the command line.
(parse_source_file): Don't write the class file here.
(yyparse): Loop on files rewritten. Set current_jcf.
(parse_zip_file_entries): Parse class file only if it was found.
* lang.c (init_parse): Don't open command line provided filename
here.
(lang_parse): Don't set main_jcf anymore.
* parse.h (ABSTRAC_CHECK): Capitalized arguments.
(JCONSTRUCTOR_CHECK): New macro.
(JBSC_TYPE_P): New macro.
(IN_TRY_BLOCK_P, EXCEPTIONS_P): Fixed leading comment.
(COMPLETE_CHECK_OP_2): New macro.
(struct parse_ctxt): New field explicit_constructor_p.
(check_class_interface_creation): Fixed prototype indentation.
(patch_method_invocation_stmt): Prototype reflects added argument.
(patch_invoke): Likewise.
(complete_method_declaration, build_super_invocation,
verify_constructor_circularity,
build_this_super_qualified_invocation, get_printable_method_name,
patch_conditional_expr, maybe_generate_finit, fix_constructors,
verify_constructor_super, create_artificial_method,
start_artificial_method_body, end_artificial_method_body,
generate_field_initialization_code): New function prototypes.
* parse.y: Fixed leading comment
(constructor_header:, constructor_body:, block_end:): Rules tagged
<node>.
(type_declaration:): Call maybe_generate_finit.
(method_declaration:): Action for method_body: placed in new
function complete_method_declaration, called here.
(constructor_declaration:): Defined actions. Removed leading
FIXME.
(constructor_header:): New rule with action.
(constructor_body:): Rule rewritten using block_begin: and
block_end:. Defined actions.
(constructor_declarator:, explicit_constructor_invocation:):
Defined actions.
(block:): Use new rules block_begin: block_end:.
(block_begin:, block_end:): New rules and actions.
(block_statements:): Fixed error message for explicit
constructors.
(method_invocation:): Call build_this_super_qualified_invocation
if primary is `this' or `super' was seen.
(conditional_expression:): Action defined.
(extra_ctxp_pushed_p): New static global flag.
(java_parser_context_save_global): Create parser context if
necessary. Use extra_ctxp_pushed_p to remember it.
(java_parser_context_restore_global): Pop extra parser context if
one exists.
(build_array_from_name): Array on primitive types are marked
loaded.
(register_fields): Restore new name in field initializer
expression if type was altered. Non static fields initialized upon
declaration marked initialized.
(maybe_generate_finit): New function.
(maybe_generate_clinit): Use create_artificial_method,
start_artificial_method_body, end_artificial_method_body. Generate
debug info for enclosed initialization statements.
(method_header): Fixed leading comment. Check constructor
flags. Detect constructor declarations and set DECL_CONSTRUCTOR_P
accordingly.
(complete_method_declaration, constructor_circularity_msg,
verify_constructor_circularity): New functions.
(get_printable_method_name): New function.
(check_method_redefinition): Don't rename <finit> methods. Fix
declared constructor names. Error message for
constructors modified.
(java_check_regular_methods): Local variable seen_constructor
renamed saw_constructor. Skip verification on constructors. Create
default constructor with create_artificial_method.
(java_check_methods): Removed unnecessary empty line.
(create_artificial_method, start_artificial_method_body,
end_artificial_method_body): New functions.
(java_layout_classes): Changed leading comment. Reverse fields
list if necessary. Always layout java.lang.Object if being
defined.
(java_complete_expand_methods): Verify constructor circularity.
(java_complete_expand_method): Call fix_constructor on
constructors. Local variable no_ac_found removed. Restore
bindings if method body expansion failed.
(fix_constructors, verify_constructor_super,
generate_field_initialization_code): New function.
(java_expand_classes): Fixed leading comment. Write class file
here.
(resolve_expression_name): Check for illegal instance variable
usage within the argument scope of an explicit constructor
invocation.
(resolve_qualified_expression_name): Pass extra from_super flag
when invoking patch_method_invocation_stmt. New case for
conditional expression when used as a primary. Check for error
when acquiring super.
(patch_method_invocation_stmt): Added extra argument super. New
local variable is_static_flag. Set class_to_search according to
the nature of the constructor invocation. Don't add `this'
argument when expanding NEW_CLASS_EXPR. Check for illegal method
invocation within the argument scope of explicit constructor
invocation. Set is_static according to is_static_flag. Provide
extra `super' argument to patch_invoke invocation.
(patch_invoke): New argument from_super. Loop on arguments
indentation fixed. Pass from_super to invocation_mode. New switch
case INVOKE_SUPER. Fixed error message in switch default case.
Don't use CALL_CONSTRUCTOR_P but rather a test on the tree node
value.
(invocation_mode): Return INVOKE_SUPER mode when appropriate.
(lookup_method_invoke): Fixed prototypes in candidates list. Error
message takes constructors into account.
(find_applicable_accessible_methods_list): Fixed indentation.
(qualify_ambiguous_name): Take explicit constructor invocation
into account. Deal with a conditional expression as a primary to
a method call.
(java_complete_tree): Added local wfl_op3. New CONDITIONAL_EXPR
case. Added extra argument to patch_method_invocation_stmt.
Register calls made to explicit constructor `this'. Don't call
save_expr in ARRAY_REF case when emitting class files. Check for
illegal use of this when expanding explicit constructor invocation
arguments.
(complete_function_arguments): Set and reset parser context
explicit_constructor_p field value when appropriate.
(build_super_invocation, build_this_super_qualified_invocation):
New functions.
(patch_assignment): Fixed typo.
(patch_unaryop): Check on final fields occurs only when a decl
exits.
(patch_return): Take constructors into account.
(patch_conditional_expr): New function.
* typeck.c (build_java_signature): Removed unnecessary empty line.
This patch implements the conditional operator, fixes the super
invokation mode, implements most of what is required for constructors
and changes the way source files are handled by the front-end.
From-SVN: r23403
1998-10-28 13:06:17 +00:00
|
|
|
/* Check that we're inside a try block. */
|
decl.c (runtime_exception_type_node, [...]): New global variables.
Tue Oct 13 03:50:28 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* decl.c (runtime_exception_type_node, error_exception_type_node):
New global variables.
(init_decl_processing): Initialized.
* expr.c (java_lang_expand_expr): Set caught exception type to
null if catch handler argument doesn't exit.
* java-tree.def (SYNCHRONIZED_EXPR, THROW_EXPR): New Java specific
tree codes.
* java-tree.h (runtime_exception_type_node,
error_exception_type_node): Global variables declared.
(DECL_FUNCTION_THROWS): New macro.
(DECL_FUNCTION_BODY): Modified comment.
(DECL_SPECIFIC_COUNT): Likewise.
(struct lang_decl): New field throws_list.
(IS_UNCHECKED_EXPRESSION_P): New macro.
* lex.c (java_lex): Generate location information for THROW_TK.
* parse.h (PUSH_EXCEPTIONS, POP_EXCEPTIONS, IN_TRY_BLOCK_P,
EXCEPTIONS_P): New macros.
(enum jdep_code): New value JDEP_EXCEPTION.
(BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT,
BUILD_ASSIGN_EXCEPTION_INFO, BUILD_THROW, SET_WFL_OPERATOR,
PATCH_METHOD_RETURN_ERROR): New macros.
(patch_method_invocation_stmt): Added new argument to prototype.
(patch_synchronized_statement, patch_throw_statement,
check_thrown_exceptions, check_thrown_exceptions_do,
purge_unchecked_exceptions, check_throws_clauses): New function
prototypes.
* parse.y Fixed typo in keyword section.
(throw:): Rule tagged <node>.
(THROW_TK): Keyword tagged <operator>.
(method_header:): Last argument to call to method_header passed
from throws: rule.
(throws:, class_type_list:, throw_statement:,
synchronized_statement:, synchronized:): Defined actions.
(method_header): New local variable current. Register exceptions
from throws clause.
(java_complete_tree): Complete and verify exceptions from throws
clause.
(complete_class_report_errors): Error message on exceptions not
found
(java_check_regular_methods): Fixed typo. Shortcut on private
overriding methods. Changed error message on method
redefinition. Check for throws clause compatibility.
(check_throws_clauses): New function.
(java_check_abstract_methods): Use DECL_NAME for wfl or current
method. Changed error message on method redefinition.
(currently_caught_type_list): New static variable.
(java_complete_expand_methods): Purge unchecked exceptions from
throws clause list. Call PUSH_EXCEPTIONS before walk and
POP_EXCEPTIONS after.
(resolve_qualified_expression_name): Pass new argument as NULL to
patch_method_invocation_stmt.
(patch_method_invocation_stmt): New argument ref_decl. Invoke
PATCH_METHOD_RETURN_ERROR when returning with error. Reverse
argument list when appropriate. Use new argument if non null to
store selected method decl.
(patch_invoke): Convert if necessary args of builtin types before
forming CALL_EXPR. Argument list no longer reversed here.
(invocation_mode): Treat final methods as static methods.
(java_complete_tree): New cases for THROW_EXPR: and
SYNCHRONIZED_EXPR:. Check thrown exceptions when completing
function call.
(complete_function_arguments): No more RECORD_TYPE
conversion. Function parameter nodes no longer saved.
(valid_ref_assignconv_cast_p): Avoid handling null type.
(patch_binop): Fixed null constant reference handling.
(build_try_statement): Use BUILD_ASSIGN_EXCEPTION_INFO and
BUILD_THROW macros.
(patch_try_statement): Fixed comments. Record caught types in
list, push the list, expand try block and pop the list.
(patch_synchronized_statement, patch_throw_statement,
check_thrown_exceptions, check_thrown_exceptions_do,
purge_unchecked_exceptions): New functions.
* typeck.c (lookup_argument_method): Allow WFL in place of method
DECL_NAME during method definition check
Implements the `synchronized' statement, the `throw' statements and
the `throws' clause. Fixes method invocation bugs.
From-SVN: r23087
1998-10-14 15:11:04 +00:00
|
|
|
#define IN_TRY_BLOCK_P() \
|
|
|
|
(currently_caught_type_list \
|
|
|
|
&& ((TREE_VALUE (currently_caught_type_list) != \
|
|
|
|
DECL_FUNCTION_THROWS (current_function_decl)) \
|
|
|
|
|| TREE_CHAIN (currently_caught_type_list)))
|
|
|
|
|
class.c (layout_class): Don't mangle <finit>, produce __finit<class> instead.
Wed Oct 28 08:03:31 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* class.c (layout_class): Don't mangle <finit>, produce
__finit<class> instead. Don't verify artificial methods.
* decl.c (finit_identifier_node): New declared global.
(init_decl_processing): finit_identifier_node initialized.
* java-tree.def (CONDITIONAL_EXPR): New Java tree code.
* java-tree.h (finit_identifier_node): Declared as extern.
(struct lang_decl): New field called_constructor.
(DECL_CONSTRUCTOR_CALLS): Access macro to called_constructor.
(CLASS_HAS_FINIT_P): New macro.
(CALL_CONSTRUCTOR_P): Leading comment changed. Macro now checks
explicit constructor invocation.
(CALL_EXPLICIT_CONSTRUCTOR_P, CALL_THIS_CONSTRUCTOR_P,
CALL_SUPER_CONSTRUCTOR_P): New macros.
(write_classfile): Added prototype.
* jcf-parse.c (jcf_parse_source): Parse and remember for
generation if the file was seen on the command line.
(parse_source_file): Don't write the class file here.
(yyparse): Loop on files rewritten. Set current_jcf.
(parse_zip_file_entries): Parse class file only if it was found.
* lang.c (init_parse): Don't open command line provided filename
here.
(lang_parse): Don't set main_jcf anymore.
* parse.h (ABSTRAC_CHECK): Capitalized arguments.
(JCONSTRUCTOR_CHECK): New macro.
(JBSC_TYPE_P): New macro.
(IN_TRY_BLOCK_P, EXCEPTIONS_P): Fixed leading comment.
(COMPLETE_CHECK_OP_2): New macro.
(struct parse_ctxt): New field explicit_constructor_p.
(check_class_interface_creation): Fixed prototype indentation.
(patch_method_invocation_stmt): Prototype reflects added argument.
(patch_invoke): Likewise.
(complete_method_declaration, build_super_invocation,
verify_constructor_circularity,
build_this_super_qualified_invocation, get_printable_method_name,
patch_conditional_expr, maybe_generate_finit, fix_constructors,
verify_constructor_super, create_artificial_method,
start_artificial_method_body, end_artificial_method_body,
generate_field_initialization_code): New function prototypes.
* parse.y: Fixed leading comment
(constructor_header:, constructor_body:, block_end:): Rules tagged
<node>.
(type_declaration:): Call maybe_generate_finit.
(method_declaration:): Action for method_body: placed in new
function complete_method_declaration, called here.
(constructor_declaration:): Defined actions. Removed leading
FIXME.
(constructor_header:): New rule with action.
(constructor_body:): Rule rewritten using block_begin: and
block_end:. Defined actions.
(constructor_declarator:, explicit_constructor_invocation:):
Defined actions.
(block:): Use new rules block_begin: block_end:.
(block_begin:, block_end:): New rules and actions.
(block_statements:): Fixed error message for explicit
constructors.
(method_invocation:): Call build_this_super_qualified_invocation
if primary is `this' or `super' was seen.
(conditional_expression:): Action defined.
(extra_ctxp_pushed_p): New static global flag.
(java_parser_context_save_global): Create parser context if
necessary. Use extra_ctxp_pushed_p to remember it.
(java_parser_context_restore_global): Pop extra parser context if
one exists.
(build_array_from_name): Array on primitive types are marked
loaded.
(register_fields): Restore new name in field initializer
expression if type was altered. Non static fields initialized upon
declaration marked initialized.
(maybe_generate_finit): New function.
(maybe_generate_clinit): Use create_artificial_method,
start_artificial_method_body, end_artificial_method_body. Generate
debug info for enclosed initialization statements.
(method_header): Fixed leading comment. Check constructor
flags. Detect constructor declarations and set DECL_CONSTRUCTOR_P
accordingly.
(complete_method_declaration, constructor_circularity_msg,
verify_constructor_circularity): New functions.
(get_printable_method_name): New function.
(check_method_redefinition): Don't rename <finit> methods. Fix
declared constructor names. Error message for
constructors modified.
(java_check_regular_methods): Local variable seen_constructor
renamed saw_constructor. Skip verification on constructors. Create
default constructor with create_artificial_method.
(java_check_methods): Removed unnecessary empty line.
(create_artificial_method, start_artificial_method_body,
end_artificial_method_body): New functions.
(java_layout_classes): Changed leading comment. Reverse fields
list if necessary. Always layout java.lang.Object if being
defined.
(java_complete_expand_methods): Verify constructor circularity.
(java_complete_expand_method): Call fix_constructor on
constructors. Local variable no_ac_found removed. Restore
bindings if method body expansion failed.
(fix_constructors, verify_constructor_super,
generate_field_initialization_code): New function.
(java_expand_classes): Fixed leading comment. Write class file
here.
(resolve_expression_name): Check for illegal instance variable
usage within the argument scope of an explicit constructor
invocation.
(resolve_qualified_expression_name): Pass extra from_super flag
when invoking patch_method_invocation_stmt. New case for
conditional expression when used as a primary. Check for error
when acquiring super.
(patch_method_invocation_stmt): Added extra argument super. New
local variable is_static_flag. Set class_to_search according to
the nature of the constructor invocation. Don't add `this'
argument when expanding NEW_CLASS_EXPR. Check for illegal method
invocation within the argument scope of explicit constructor
invocation. Set is_static according to is_static_flag. Provide
extra `super' argument to patch_invoke invocation.
(patch_invoke): New argument from_super. Loop on arguments
indentation fixed. Pass from_super to invocation_mode. New switch
case INVOKE_SUPER. Fixed error message in switch default case.
Don't use CALL_CONSTRUCTOR_P but rather a test on the tree node
value.
(invocation_mode): Return INVOKE_SUPER mode when appropriate.
(lookup_method_invoke): Fixed prototypes in candidates list. Error
message takes constructors into account.
(find_applicable_accessible_methods_list): Fixed indentation.
(qualify_ambiguous_name): Take explicit constructor invocation
into account. Deal with a conditional expression as a primary to
a method call.
(java_complete_tree): Added local wfl_op3. New CONDITIONAL_EXPR
case. Added extra argument to patch_method_invocation_stmt.
Register calls made to explicit constructor `this'. Don't call
save_expr in ARRAY_REF case when emitting class files. Check for
illegal use of this when expanding explicit constructor invocation
arguments.
(complete_function_arguments): Set and reset parser context
explicit_constructor_p field value when appropriate.
(build_super_invocation, build_this_super_qualified_invocation):
New functions.
(patch_assignment): Fixed typo.
(patch_unaryop): Check on final fields occurs only when a decl
exits.
(patch_return): Take constructors into account.
(patch_conditional_expr): New function.
* typeck.c (build_java_signature): Removed unnecessary empty line.
This patch implements the conditional operator, fixes the super
invokation mode, implements most of what is required for constructors
and changes the way source files are handled by the front-end.
From-SVN: r23403
1998-10-28 13:06:17 +00:00
|
|
|
/* Check that we have exceptions in E. */
|
decl.c (runtime_exception_type_node, [...]): New global variables.
Tue Oct 13 03:50:28 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* decl.c (runtime_exception_type_node, error_exception_type_node):
New global variables.
(init_decl_processing): Initialized.
* expr.c (java_lang_expand_expr): Set caught exception type to
null if catch handler argument doesn't exit.
* java-tree.def (SYNCHRONIZED_EXPR, THROW_EXPR): New Java specific
tree codes.
* java-tree.h (runtime_exception_type_node,
error_exception_type_node): Global variables declared.
(DECL_FUNCTION_THROWS): New macro.
(DECL_FUNCTION_BODY): Modified comment.
(DECL_SPECIFIC_COUNT): Likewise.
(struct lang_decl): New field throws_list.
(IS_UNCHECKED_EXPRESSION_P): New macro.
* lex.c (java_lex): Generate location information for THROW_TK.
* parse.h (PUSH_EXCEPTIONS, POP_EXCEPTIONS, IN_TRY_BLOCK_P,
EXCEPTIONS_P): New macros.
(enum jdep_code): New value JDEP_EXCEPTION.
(BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT,
BUILD_ASSIGN_EXCEPTION_INFO, BUILD_THROW, SET_WFL_OPERATOR,
PATCH_METHOD_RETURN_ERROR): New macros.
(patch_method_invocation_stmt): Added new argument to prototype.
(patch_synchronized_statement, patch_throw_statement,
check_thrown_exceptions, check_thrown_exceptions_do,
purge_unchecked_exceptions, check_throws_clauses): New function
prototypes.
* parse.y Fixed typo in keyword section.
(throw:): Rule tagged <node>.
(THROW_TK): Keyword tagged <operator>.
(method_header:): Last argument to call to method_header passed
from throws: rule.
(throws:, class_type_list:, throw_statement:,
synchronized_statement:, synchronized:): Defined actions.
(method_header): New local variable current. Register exceptions
from throws clause.
(java_complete_tree): Complete and verify exceptions from throws
clause.
(complete_class_report_errors): Error message on exceptions not
found
(java_check_regular_methods): Fixed typo. Shortcut on private
overriding methods. Changed error message on method
redefinition. Check for throws clause compatibility.
(check_throws_clauses): New function.
(java_check_abstract_methods): Use DECL_NAME for wfl or current
method. Changed error message on method redefinition.
(currently_caught_type_list): New static variable.
(java_complete_expand_methods): Purge unchecked exceptions from
throws clause list. Call PUSH_EXCEPTIONS before walk and
POP_EXCEPTIONS after.
(resolve_qualified_expression_name): Pass new argument as NULL to
patch_method_invocation_stmt.
(patch_method_invocation_stmt): New argument ref_decl. Invoke
PATCH_METHOD_RETURN_ERROR when returning with error. Reverse
argument list when appropriate. Use new argument if non null to
store selected method decl.
(patch_invoke): Convert if necessary args of builtin types before
forming CALL_EXPR. Argument list no longer reversed here.
(invocation_mode): Treat final methods as static methods.
(java_complete_tree): New cases for THROW_EXPR: and
SYNCHRONIZED_EXPR:. Check thrown exceptions when completing
function call.
(complete_function_arguments): No more RECORD_TYPE
conversion. Function parameter nodes no longer saved.
(valid_ref_assignconv_cast_p): Avoid handling null type.
(patch_binop): Fixed null constant reference handling.
(build_try_statement): Use BUILD_ASSIGN_EXCEPTION_INFO and
BUILD_THROW macros.
(patch_try_statement): Fixed comments. Record caught types in
list, push the list, expand try block and pop the list.
(patch_synchronized_statement, patch_throw_statement,
check_thrown_exceptions, check_thrown_exceptions_do,
purge_unchecked_exceptions): New functions.
* typeck.c (lookup_argument_method): Allow WFL in place of method
DECL_NAME during method definition check
Implements the `synchronized' statement, the `throw' statements and
the `throws' clause. Fixes method invocation bugs.
From-SVN: r23087
1998-10-14 15:11:04 +00:00
|
|
|
#define EXCEPTIONS_P(E) ((E) ? TREE_VALUE (E) : NULL_TREE)
|
|
|
|
|
1998-09-06 15:36:06 +00:00
|
|
|
/* Invocation modes, as returned by invocation_mode (). */
|
|
|
|
enum {
|
|
|
|
INVOKE_STATIC,
|
|
|
|
INVOKE_NONVIRTUAL,
|
|
|
|
INVOKE_SUPER,
|
|
|
|
INVOKE_INTERFACE,
|
|
|
|
INVOKE_VIRTUAL,
|
|
|
|
};
|
|
|
|
|
|
|
|
/* We need the resolution stuff only if we compile jc1 */
|
|
|
|
#ifndef JC1_LITE
|
|
|
|
|
|
|
|
/* Unresolved type identifiers handling. When we process the source
|
|
|
|
code, we blindly accept an unknown type identifier and try to
|
|
|
|
resolve it later. When an unknown type identifier is encountered
|
|
|
|
and used, we record in a struct jdep element what the incomplete
|
|
|
|
type is and what it should patch. Later, java_complete_class will
|
|
|
|
process all classes known to have unresolved type
|
|
|
|
dependencies. Within each of these classes, this routine will
|
|
|
|
process unresolved type dependencies (JDEP_TO_RESOLVE), patch what
|
|
|
|
needs to be patched in the dependent tree node (JDEP_GET_PATCH,
|
|
|
|
JDEP_APPLY_PATCH) and perform other actions dictated by the context
|
|
|
|
of the patch (JDEP_KIND). The ideas are: we patch only what needs
|
|
|
|
to be patched, and with java_complete_class called at the right
|
|
|
|
time, we will start processing incomplete function bodies tree
|
|
|
|
nodes with everything external to function's bodies already
|
|
|
|
completed, it makes things much simpler. */
|
|
|
|
|
|
|
|
enum jdep_code {
|
|
|
|
JDEP_NO_PATCH, /* Must be first */
|
|
|
|
JDEP_SUPER, /* Patch the type of one type
|
|
|
|
supertype. Requires some check
|
|
|
|
before it's done */
|
|
|
|
JDEP_FIELD, /* Patch the type of a class field */
|
|
|
|
|
|
|
|
/* JDEP_{METHOD,METHOD_RETURN,METHOD_END} to be kept in order */
|
|
|
|
JDEP_METHOD, /* Mark the beginning of the patching
|
|
|
|
of a method declaration, including
|
|
|
|
it's arguments */
|
|
|
|
JDEP_METHOD_RETURN, /* Mark the beginning of the patching
|
|
|
|
of a method declaration. Arguments
|
|
|
|
aren't patched, only the returned
|
|
|
|
type is */
|
|
|
|
JDEP_METHOD_END, /* Mark the end of the patching of a
|
|
|
|
method declaration. It indicates
|
|
|
|
that it's time to compute and
|
|
|
|
install a new signature */
|
|
|
|
|
|
|
|
JDEP_INTERFACE, /* Patch the type of a Class/interface
|
|
|
|
extension */
|
|
|
|
JDEP_VARIABLE, /* Patch the type of a variable declaration */
|
|
|
|
JDEP_PARM, /* Patch the type of a parm declaration */
|
|
|
|
JDEP_TYPE, /* Patch a random tree node type,
|
|
|
|
without the need for any specific
|
|
|
|
actions */
|
decl.c (runtime_exception_type_node, [...]): New global variables.
Tue Oct 13 03:50:28 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* decl.c (runtime_exception_type_node, error_exception_type_node):
New global variables.
(init_decl_processing): Initialized.
* expr.c (java_lang_expand_expr): Set caught exception type to
null if catch handler argument doesn't exit.
* java-tree.def (SYNCHRONIZED_EXPR, THROW_EXPR): New Java specific
tree codes.
* java-tree.h (runtime_exception_type_node,
error_exception_type_node): Global variables declared.
(DECL_FUNCTION_THROWS): New macro.
(DECL_FUNCTION_BODY): Modified comment.
(DECL_SPECIFIC_COUNT): Likewise.
(struct lang_decl): New field throws_list.
(IS_UNCHECKED_EXPRESSION_P): New macro.
* lex.c (java_lex): Generate location information for THROW_TK.
* parse.h (PUSH_EXCEPTIONS, POP_EXCEPTIONS, IN_TRY_BLOCK_P,
EXCEPTIONS_P): New macros.
(enum jdep_code): New value JDEP_EXCEPTION.
(BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT,
BUILD_ASSIGN_EXCEPTION_INFO, BUILD_THROW, SET_WFL_OPERATOR,
PATCH_METHOD_RETURN_ERROR): New macros.
(patch_method_invocation_stmt): Added new argument to prototype.
(patch_synchronized_statement, patch_throw_statement,
check_thrown_exceptions, check_thrown_exceptions_do,
purge_unchecked_exceptions, check_throws_clauses): New function
prototypes.
* parse.y Fixed typo in keyword section.
(throw:): Rule tagged <node>.
(THROW_TK): Keyword tagged <operator>.
(method_header:): Last argument to call to method_header passed
from throws: rule.
(throws:, class_type_list:, throw_statement:,
synchronized_statement:, synchronized:): Defined actions.
(method_header): New local variable current. Register exceptions
from throws clause.
(java_complete_tree): Complete and verify exceptions from throws
clause.
(complete_class_report_errors): Error message on exceptions not
found
(java_check_regular_methods): Fixed typo. Shortcut on private
overriding methods. Changed error message on method
redefinition. Check for throws clause compatibility.
(check_throws_clauses): New function.
(java_check_abstract_methods): Use DECL_NAME for wfl or current
method. Changed error message on method redefinition.
(currently_caught_type_list): New static variable.
(java_complete_expand_methods): Purge unchecked exceptions from
throws clause list. Call PUSH_EXCEPTIONS before walk and
POP_EXCEPTIONS after.
(resolve_qualified_expression_name): Pass new argument as NULL to
patch_method_invocation_stmt.
(patch_method_invocation_stmt): New argument ref_decl. Invoke
PATCH_METHOD_RETURN_ERROR when returning with error. Reverse
argument list when appropriate. Use new argument if non null to
store selected method decl.
(patch_invoke): Convert if necessary args of builtin types before
forming CALL_EXPR. Argument list no longer reversed here.
(invocation_mode): Treat final methods as static methods.
(java_complete_tree): New cases for THROW_EXPR: and
SYNCHRONIZED_EXPR:. Check thrown exceptions when completing
function call.
(complete_function_arguments): No more RECORD_TYPE
conversion. Function parameter nodes no longer saved.
(valid_ref_assignconv_cast_p): Avoid handling null type.
(patch_binop): Fixed null constant reference handling.
(build_try_statement): Use BUILD_ASSIGN_EXCEPTION_INFO and
BUILD_THROW macros.
(patch_try_statement): Fixed comments. Record caught types in
list, push the list, expand try block and pop the list.
(patch_synchronized_statement, patch_throw_statement,
check_thrown_exceptions, check_thrown_exceptions_do,
purge_unchecked_exceptions): New functions.
* typeck.c (lookup_argument_method): Allow WFL in place of method
DECL_NAME during method definition check
Implements the `synchronized' statement, the `throw' statements and
the `throws' clause. Fixes method invocation bugs.
From-SVN: r23087
1998-10-14 15:11:04 +00:00
|
|
|
JDEP_EXCEPTION, /* Patch exceptions specified by `throws' */
|
1998-09-06 15:36:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _jdep {
|
|
|
|
#ifdef ONLY_INT_FIELDS
|
|
|
|
int kind : 8; /* Type of patch */
|
|
|
|
#else
|
|
|
|
enum jdep_code kind : 8;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int flag0 : 1; /* Some flags */
|
|
|
|
tree decl; /* Tied decl/or WFL */
|
|
|
|
tree solv; /* What to solve */
|
|
|
|
tree wfl; /* Where thing to resolve where found */
|
|
|
|
tree misc; /* Miscellaneous info (optional). */
|
|
|
|
tree *patch; /* Address of a location to patch */
|
|
|
|
struct _jdep *next; /* Linked list */
|
|
|
|
} jdep;
|
|
|
|
|
|
|
|
|
|
|
|
#define JDEP_DECL(J) ((J)->decl)
|
|
|
|
#define JDEP_DECL_WFL(J) ((J)->decl)
|
|
|
|
#define JDEP_KIND(J) ((J)->kind)
|
|
|
|
#define JDEP_SOLV(J) ((J)->solv)
|
|
|
|
#define JDEP_WFL(J) ((J)->wfl)
|
|
|
|
#define JDEP_MISC(J) ((J)->misc)
|
|
|
|
#define JDEP_CLASS(J) ((J)->class)
|
|
|
|
#define JDEP_APPLY_PATCH(J,P) (*(J)->patch = (P))
|
|
|
|
#define JDEP_GET_PATCH(J) ((J)->patch)
|
|
|
|
#define JDEP_CHAIN(J) ((J)->next)
|
|
|
|
#define JDEP_TO_RESOLVE(J) (TREE_PURPOSE ((J)->solv))
|
|
|
|
#define JDEP_RESOLVED_DECL(J) ((J)->solv ? TREE_PURPOSE ((J)->solv):NULL_TREE)
|
|
|
|
#define JDEP_RESOLVED(J, D) \
|
|
|
|
{ \
|
|
|
|
TREE_PURPOSE ((J)->solv) = D; \
|
|
|
|
TREE_VALUE ((J)->solv) = (J)->solv; \
|
|
|
|
}
|
|
|
|
#define JDEP_RESOLVED_P(J) (!(J)->solv || \
|
|
|
|
TREE_VALUE ((J)->solv) == (J)->solv)
|
|
|
|
|
|
|
|
typedef struct _jdeplist {
|
|
|
|
jdep *first;
|
|
|
|
jdep *last;
|
|
|
|
struct _jdeplist *next;
|
|
|
|
} jdeplist;
|
|
|
|
static jdeplist *reverse_jdep_list ();
|
|
|
|
|
|
|
|
#endif /* JC1_LITE */
|
|
|
|
|
|
|
|
#define CLASSD_FIRST(CD) ((CD)->first)
|
|
|
|
#define CLASSD_LAST(CD) ((CD)->last)
|
|
|
|
#define CLASSD_CHAIN(CD) ((CD)->next)
|
|
|
|
|
|
|
|
#define JDEP_INSERT(L,J) \
|
|
|
|
{ \
|
|
|
|
if (!(L)->first) \
|
|
|
|
(L)->last = (L)->first = (J); \
|
|
|
|
else \
|
|
|
|
{ \
|
|
|
|
JDEP_CHAIN ((L)->last) = (J); \
|
|
|
|
(L)->last = (J); \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
1998-10-16 19:36:39 +00:00
|
|
|
/* 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; \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
1998-09-06 15:36:06 +00:00
|
|
|
/* Insert a DECL in the current block */
|
|
|
|
#define BLOCK_CHAIN_DECL(NODE) \
|
|
|
|
{ \
|
|
|
|
TREE_CHAIN ((NODE)) = \
|
|
|
|
BLOCK_EXPR_DECLS (DECL_FUNCTION_BODY (current_function_decl)); \
|
|
|
|
BLOCK_EXPR_DECLS (DECL_FUNCTION_BODY (current_function_decl)) = (NODE); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define BLOCK_EXPR_DECLS(NODE) BLOCK_VARS(NODE)
|
|
|
|
#define BLOCK_EXPR_BODY(NODE) BLOCK_SUBBLOCKS(NODE)
|
|
|
|
#define BLOCK_EXPR_ORIGIN(NODE) BLOCK_ABSTRACT_ORIGIN(NODE)
|
|
|
|
|
|
|
|
/* Merge an other line to the source line number of a decl. Used to
|
|
|
|
remember function's end. */
|
|
|
|
#define DECL_SOURCE_LINE_MERGE(DECL,NO) DECL_SOURCE_LINE(DECL) |= (NO << 16)
|
|
|
|
|
|
|
|
/* Retrieve those two info separately. */
|
|
|
|
#define DECL_SOURCE_LINE_FIRST(DECL) (DECL_SOURCE_LINE(DECL) & 0x0000ffff)
|
|
|
|
#define DECL_SOURCE_LINE_LAST(DECL) (DECL_SOURCE_LINE(DECL) >> 16)
|
|
|
|
|
|
|
|
/* Build a WFL for expression nodes */
|
|
|
|
#define BUILD_EXPR_WFL(NODE, WFL) \
|
|
|
|
build_expr_wfl ((NODE), input_filename, EXPR_WFL_LINENO ((WFL)), \
|
|
|
|
EXPR_WFL_COLNO ((WFL)))
|
|
|
|
|
|
|
|
#define EXPR_WFL_QUALIFICATION(WFL) TREE_OPERAND ((WFL), 1)
|
|
|
|
#define QUAL_WFL(NODE) TREE_PURPOSE (NODE)
|
|
|
|
#define QUAL_RESOLUTION(NODE) TREE_VALUE (NODE)
|
|
|
|
#define QUAL_DECL_TYPE(NODE) \
|
|
|
|
(TREE_CODE (TREE_TYPE (NODE)) == POINTER_TYPE ? \
|
|
|
|
TREE_TYPE (TREE_TYPE (NODE)) : TREE_TYPE (NODE))
|
|
|
|
|
|
|
|
/* Handy macros for the walk operation */
|
|
|
|
#define COMPLETE_CHECK_OP(NODE, N) \
|
|
|
|
{ \
|
|
|
|
TREE_OPERAND ((NODE), (N)) = \
|
|
|
|
java_complete_tree (TREE_OPERAND ((NODE), (N))); \
|
|
|
|
if (TREE_OPERAND ((NODE), (N)) == error_mark_node) \
|
|
|
|
return error_mark_node; \
|
|
|
|
}
|
|
|
|
#define COMPLETE_CHECK_OP_0(NODE) COMPLETE_CHECK_OP(NODE, 0)
|
|
|
|
#define COMPLETE_CHECK_OP_1(NODE) COMPLETE_CHECK_OP(NODE, 1)
|
class.c (layout_class): Don't mangle <finit>, produce __finit<class> instead.
Wed Oct 28 08:03:31 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* class.c (layout_class): Don't mangle <finit>, produce
__finit<class> instead. Don't verify artificial methods.
* decl.c (finit_identifier_node): New declared global.
(init_decl_processing): finit_identifier_node initialized.
* java-tree.def (CONDITIONAL_EXPR): New Java tree code.
* java-tree.h (finit_identifier_node): Declared as extern.
(struct lang_decl): New field called_constructor.
(DECL_CONSTRUCTOR_CALLS): Access macro to called_constructor.
(CLASS_HAS_FINIT_P): New macro.
(CALL_CONSTRUCTOR_P): Leading comment changed. Macro now checks
explicit constructor invocation.
(CALL_EXPLICIT_CONSTRUCTOR_P, CALL_THIS_CONSTRUCTOR_P,
CALL_SUPER_CONSTRUCTOR_P): New macros.
(write_classfile): Added prototype.
* jcf-parse.c (jcf_parse_source): Parse and remember for
generation if the file was seen on the command line.
(parse_source_file): Don't write the class file here.
(yyparse): Loop on files rewritten. Set current_jcf.
(parse_zip_file_entries): Parse class file only if it was found.
* lang.c (init_parse): Don't open command line provided filename
here.
(lang_parse): Don't set main_jcf anymore.
* parse.h (ABSTRAC_CHECK): Capitalized arguments.
(JCONSTRUCTOR_CHECK): New macro.
(JBSC_TYPE_P): New macro.
(IN_TRY_BLOCK_P, EXCEPTIONS_P): Fixed leading comment.
(COMPLETE_CHECK_OP_2): New macro.
(struct parse_ctxt): New field explicit_constructor_p.
(check_class_interface_creation): Fixed prototype indentation.
(patch_method_invocation_stmt): Prototype reflects added argument.
(patch_invoke): Likewise.
(complete_method_declaration, build_super_invocation,
verify_constructor_circularity,
build_this_super_qualified_invocation, get_printable_method_name,
patch_conditional_expr, maybe_generate_finit, fix_constructors,
verify_constructor_super, create_artificial_method,
start_artificial_method_body, end_artificial_method_body,
generate_field_initialization_code): New function prototypes.
* parse.y: Fixed leading comment
(constructor_header:, constructor_body:, block_end:): Rules tagged
<node>.
(type_declaration:): Call maybe_generate_finit.
(method_declaration:): Action for method_body: placed in new
function complete_method_declaration, called here.
(constructor_declaration:): Defined actions. Removed leading
FIXME.
(constructor_header:): New rule with action.
(constructor_body:): Rule rewritten using block_begin: and
block_end:. Defined actions.
(constructor_declarator:, explicit_constructor_invocation:):
Defined actions.
(block:): Use new rules block_begin: block_end:.
(block_begin:, block_end:): New rules and actions.
(block_statements:): Fixed error message for explicit
constructors.
(method_invocation:): Call build_this_super_qualified_invocation
if primary is `this' or `super' was seen.
(conditional_expression:): Action defined.
(extra_ctxp_pushed_p): New static global flag.
(java_parser_context_save_global): Create parser context if
necessary. Use extra_ctxp_pushed_p to remember it.
(java_parser_context_restore_global): Pop extra parser context if
one exists.
(build_array_from_name): Array on primitive types are marked
loaded.
(register_fields): Restore new name in field initializer
expression if type was altered. Non static fields initialized upon
declaration marked initialized.
(maybe_generate_finit): New function.
(maybe_generate_clinit): Use create_artificial_method,
start_artificial_method_body, end_artificial_method_body. Generate
debug info for enclosed initialization statements.
(method_header): Fixed leading comment. Check constructor
flags. Detect constructor declarations and set DECL_CONSTRUCTOR_P
accordingly.
(complete_method_declaration, constructor_circularity_msg,
verify_constructor_circularity): New functions.
(get_printable_method_name): New function.
(check_method_redefinition): Don't rename <finit> methods. Fix
declared constructor names. Error message for
constructors modified.
(java_check_regular_methods): Local variable seen_constructor
renamed saw_constructor. Skip verification on constructors. Create
default constructor with create_artificial_method.
(java_check_methods): Removed unnecessary empty line.
(create_artificial_method, start_artificial_method_body,
end_artificial_method_body): New functions.
(java_layout_classes): Changed leading comment. Reverse fields
list if necessary. Always layout java.lang.Object if being
defined.
(java_complete_expand_methods): Verify constructor circularity.
(java_complete_expand_method): Call fix_constructor on
constructors. Local variable no_ac_found removed. Restore
bindings if method body expansion failed.
(fix_constructors, verify_constructor_super,
generate_field_initialization_code): New function.
(java_expand_classes): Fixed leading comment. Write class file
here.
(resolve_expression_name): Check for illegal instance variable
usage within the argument scope of an explicit constructor
invocation.
(resolve_qualified_expression_name): Pass extra from_super flag
when invoking patch_method_invocation_stmt. New case for
conditional expression when used as a primary. Check for error
when acquiring super.
(patch_method_invocation_stmt): Added extra argument super. New
local variable is_static_flag. Set class_to_search according to
the nature of the constructor invocation. Don't add `this'
argument when expanding NEW_CLASS_EXPR. Check for illegal method
invocation within the argument scope of explicit constructor
invocation. Set is_static according to is_static_flag. Provide
extra `super' argument to patch_invoke invocation.
(patch_invoke): New argument from_super. Loop on arguments
indentation fixed. Pass from_super to invocation_mode. New switch
case INVOKE_SUPER. Fixed error message in switch default case.
Don't use CALL_CONSTRUCTOR_P but rather a test on the tree node
value.
(invocation_mode): Return INVOKE_SUPER mode when appropriate.
(lookup_method_invoke): Fixed prototypes in candidates list. Error
message takes constructors into account.
(find_applicable_accessible_methods_list): Fixed indentation.
(qualify_ambiguous_name): Take explicit constructor invocation
into account. Deal with a conditional expression as a primary to
a method call.
(java_complete_tree): Added local wfl_op3. New CONDITIONAL_EXPR
case. Added extra argument to patch_method_invocation_stmt.
Register calls made to explicit constructor `this'. Don't call
save_expr in ARRAY_REF case when emitting class files. Check for
illegal use of this when expanding explicit constructor invocation
arguments.
(complete_function_arguments): Set and reset parser context
explicit_constructor_p field value when appropriate.
(build_super_invocation, build_this_super_qualified_invocation):
New functions.
(patch_assignment): Fixed typo.
(patch_unaryop): Check on final fields occurs only when a decl
exits.
(patch_return): Take constructors into account.
(patch_conditional_expr): New function.
* typeck.c (build_java_signature): Removed unnecessary empty line.
This patch implements the conditional operator, fixes the super
invokation mode, implements most of what is required for constructors
and changes the way source files are handled by the front-end.
From-SVN: r23403
1998-10-28 13:06:17 +00:00
|
|
|
#define COMPLETE_CHECK_OP_2(NODE) COMPLETE_CHECK_OP(NODE, 2)
|
1998-09-06 15:36:06 +00:00
|
|
|
|
1998-10-12 05:43:53 -07:00
|
|
|
/* Building invocations: append(ARG) and StringBuffer(ARG) */
|
|
|
|
#define BUILD_APPEND(ARG) \
|
|
|
|
build_method_invocation (wfl_append, \
|
|
|
|
(ARG ? build_tree_list (NULL, (ARG)): NULL_TREE))
|
|
|
|
#define BUILD_STRING_BUFFER(ARG) \
|
|
|
|
build_new_invocation (wfl_string_buffer, \
|
|
|
|
(ARG ? build_tree_list (NULL, (ARG)) : NULL_TREE))
|
|
|
|
|
decl.c (runtime_exception_type_node, [...]): New global variables.
Tue Oct 13 03:50:28 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* decl.c (runtime_exception_type_node, error_exception_type_node):
New global variables.
(init_decl_processing): Initialized.
* expr.c (java_lang_expand_expr): Set caught exception type to
null if catch handler argument doesn't exit.
* java-tree.def (SYNCHRONIZED_EXPR, THROW_EXPR): New Java specific
tree codes.
* java-tree.h (runtime_exception_type_node,
error_exception_type_node): Global variables declared.
(DECL_FUNCTION_THROWS): New macro.
(DECL_FUNCTION_BODY): Modified comment.
(DECL_SPECIFIC_COUNT): Likewise.
(struct lang_decl): New field throws_list.
(IS_UNCHECKED_EXPRESSION_P): New macro.
* lex.c (java_lex): Generate location information for THROW_TK.
* parse.h (PUSH_EXCEPTIONS, POP_EXCEPTIONS, IN_TRY_BLOCK_P,
EXCEPTIONS_P): New macros.
(enum jdep_code): New value JDEP_EXCEPTION.
(BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT,
BUILD_ASSIGN_EXCEPTION_INFO, BUILD_THROW, SET_WFL_OPERATOR,
PATCH_METHOD_RETURN_ERROR): New macros.
(patch_method_invocation_stmt): Added new argument to prototype.
(patch_synchronized_statement, patch_throw_statement,
check_thrown_exceptions, check_thrown_exceptions_do,
purge_unchecked_exceptions, check_throws_clauses): New function
prototypes.
* parse.y Fixed typo in keyword section.
(throw:): Rule tagged <node>.
(THROW_TK): Keyword tagged <operator>.
(method_header:): Last argument to call to method_header passed
from throws: rule.
(throws:, class_type_list:, throw_statement:,
synchronized_statement:, synchronized:): Defined actions.
(method_header): New local variable current. Register exceptions
from throws clause.
(java_complete_tree): Complete and verify exceptions from throws
clause.
(complete_class_report_errors): Error message on exceptions not
found
(java_check_regular_methods): Fixed typo. Shortcut on private
overriding methods. Changed error message on method
redefinition. Check for throws clause compatibility.
(check_throws_clauses): New function.
(java_check_abstract_methods): Use DECL_NAME for wfl or current
method. Changed error message on method redefinition.
(currently_caught_type_list): New static variable.
(java_complete_expand_methods): Purge unchecked exceptions from
throws clause list. Call PUSH_EXCEPTIONS before walk and
POP_EXCEPTIONS after.
(resolve_qualified_expression_name): Pass new argument as NULL to
patch_method_invocation_stmt.
(patch_method_invocation_stmt): New argument ref_decl. Invoke
PATCH_METHOD_RETURN_ERROR when returning with error. Reverse
argument list when appropriate. Use new argument if non null to
store selected method decl.
(patch_invoke): Convert if necessary args of builtin types before
forming CALL_EXPR. Argument list no longer reversed here.
(invocation_mode): Treat final methods as static methods.
(java_complete_tree): New cases for THROW_EXPR: and
SYNCHRONIZED_EXPR:. Check thrown exceptions when completing
function call.
(complete_function_arguments): No more RECORD_TYPE
conversion. Function parameter nodes no longer saved.
(valid_ref_assignconv_cast_p): Avoid handling null type.
(patch_binop): Fixed null constant reference handling.
(build_try_statement): Use BUILD_ASSIGN_EXCEPTION_INFO and
BUILD_THROW macros.
(patch_try_statement): Fixed comments. Record caught types in
list, push the list, expand try block and pop the list.
(patch_synchronized_statement, patch_throw_statement,
check_thrown_exceptions, check_thrown_exceptions_do,
purge_unchecked_exceptions): New functions.
* typeck.c (lookup_argument_method): Allow WFL in place of method
DECL_NAME during method definition check
Implements the `synchronized' statement, the `throw' statements and
the `throws' clause. Fixes method invocation bugs.
From-SVN: r23087
1998-10-14 15:11:04 +00:00
|
|
|
/* For exception handling, build diverse function calls */
|
|
|
|
#define BUILD_MONITOR_ENTER(WHERE, ARG) \
|
|
|
|
{ \
|
|
|
|
(WHERE) = build (CALL_EXPR, int_type_node, \
|
|
|
|
build_address_of (soft_monitorenter_node), \
|
|
|
|
build_tree_list (NULL_TREE, (ARG))); \
|
|
|
|
TREE_SIDE_EFFECTS (WHERE) = 1; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define BUILD_MONITOR_EXIT(WHERE, ARG) \
|
|
|
|
{ \
|
|
|
|
(WHERE) = build (CALL_EXPR, int_type_node, \
|
|
|
|
build_address_of (soft_monitorexit_node), \
|
|
|
|
build_tree_list (NULL_TREE, (ARG))); \
|
|
|
|
TREE_SIDE_EFFECTS (WHERE) = 1; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define BUILD_ASSIGN_EXCEPTION_INFO(WHERE, TO) \
|
|
|
|
{ \
|
|
|
|
(WHERE) = build (MODIFY_EXPR, void_type_node, (TO), \
|
|
|
|
soft_exceptioninfo_call_node); \
|
|
|
|
TREE_SIDE_EFFECTS (WHERE) = 1; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define BUILD_THROW(WHERE, WHAT) \
|
|
|
|
{ \
|
|
|
|
(WHERE) = build (CALL_EXPR, void_type_node, \
|
|
|
|
build_address_of (throw_node), \
|
|
|
|
build_tree_list (NULL_TREE, (WHAT)), NULL_TREE); \
|
|
|
|
TREE_SIDE_EFFECTS ((WHERE)) = 1; \
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Set wfl_operator for the most accurate error location */
|
|
|
|
#define SET_WFL_OPERATOR(WHICH, NODE, WFL) \
|
|
|
|
EXPR_WFL_LINECOL (WHICH) = \
|
|
|
|
(TREE_CODE (WFL) == EXPR_WITH_FILE_LOCATION ? \
|
|
|
|
EXPR_WFL_LINECOL (WFL) : EXPR_WFL_LINECOL (NODE))
|
|
|
|
|
|
|
|
#define PATCH_METHOD_RETURN_ERROR() \
|
|
|
|
{ \
|
|
|
|
if (ret_decl) \
|
|
|
|
*ret_decl = NULL_TREE; \
|
|
|
|
return error_mark_node; \
|
|
|
|
}
|
|
|
|
|
1998-09-06 15:36:06 +00:00
|
|
|
/* Parser context data structure. */
|
|
|
|
struct parser_ctxt {
|
|
|
|
|
|
|
|
char *filename; /* Current filename */
|
|
|
|
FILE *finput; /* Current file input stream */
|
|
|
|
struct parser_ctxt *next;
|
|
|
|
|
|
|
|
struct java_line *p_line, *c_line; /* Previous and current line */
|
|
|
|
java_lc elc; /* Error's line column info */
|
|
|
|
unicode_t unget_utf8_value; /* An unget utf8 value */
|
|
|
|
int ccb_indent; /* Keep track of {} indent, lexer */
|
|
|
|
int first_ccb_indent1; /* First { at ident level 1 */
|
|
|
|
int last_ccb_indent1; /* Last } at ident level 1 */
|
|
|
|
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 */
|
|
|
|
|
|
|
|
/* This section is defined only if we compile jc1 */
|
|
|
|
#ifndef JC1_LITE
|
|
|
|
tree modifier_ctx [11]; /* WFL of modifiers */
|
|
|
|
tree current_class; /* Current class */
|
|
|
|
tree current_function_decl; /* Current function decl, save/restore */
|
|
|
|
|
|
|
|
JCF *current_jcf; /* CU jcf */
|
|
|
|
|
|
|
|
int prevent_ese; /* Prevent expression statement error */
|
|
|
|
int class_err; /* Flag to report certain errors */
|
|
|
|
|
|
|
|
int formal_parameter_number; /* Number of parameters found */
|
|
|
|
int interface_number; /* # itfs declared to extend an itf def */
|
|
|
|
|
|
|
|
tree package; /* Defined package ID */
|
|
|
|
|
|
|
|
tree incomplete_class; /* List of non-complete classes */
|
|
|
|
tree current_parsed_class; /* Class currently parsed */
|
|
|
|
tree class_list; /* List of classes in a CU */
|
|
|
|
jdeplist *classd_list; /* Classe dependencies in a CU */
|
|
|
|
|
|
|
|
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 */
|
|
|
|
tree current_labeled_block; /* List of currently nested
|
|
|
|
labeled blocks. */
|
|
|
|
|
|
|
|
int pending_block; /* Pending block to close */
|
class.c (layout_class): Don't mangle <finit>, produce __finit<class> instead.
Wed Oct 28 08:03:31 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* class.c (layout_class): Don't mangle <finit>, produce
__finit<class> instead. Don't verify artificial methods.
* decl.c (finit_identifier_node): New declared global.
(init_decl_processing): finit_identifier_node initialized.
* java-tree.def (CONDITIONAL_EXPR): New Java tree code.
* java-tree.h (finit_identifier_node): Declared as extern.
(struct lang_decl): New field called_constructor.
(DECL_CONSTRUCTOR_CALLS): Access macro to called_constructor.
(CLASS_HAS_FINIT_P): New macro.
(CALL_CONSTRUCTOR_P): Leading comment changed. Macro now checks
explicit constructor invocation.
(CALL_EXPLICIT_CONSTRUCTOR_P, CALL_THIS_CONSTRUCTOR_P,
CALL_SUPER_CONSTRUCTOR_P): New macros.
(write_classfile): Added prototype.
* jcf-parse.c (jcf_parse_source): Parse and remember for
generation if the file was seen on the command line.
(parse_source_file): Don't write the class file here.
(yyparse): Loop on files rewritten. Set current_jcf.
(parse_zip_file_entries): Parse class file only if it was found.
* lang.c (init_parse): Don't open command line provided filename
here.
(lang_parse): Don't set main_jcf anymore.
* parse.h (ABSTRAC_CHECK): Capitalized arguments.
(JCONSTRUCTOR_CHECK): New macro.
(JBSC_TYPE_P): New macro.
(IN_TRY_BLOCK_P, EXCEPTIONS_P): Fixed leading comment.
(COMPLETE_CHECK_OP_2): New macro.
(struct parse_ctxt): New field explicit_constructor_p.
(check_class_interface_creation): Fixed prototype indentation.
(patch_method_invocation_stmt): Prototype reflects added argument.
(patch_invoke): Likewise.
(complete_method_declaration, build_super_invocation,
verify_constructor_circularity,
build_this_super_qualified_invocation, get_printable_method_name,
patch_conditional_expr, maybe_generate_finit, fix_constructors,
verify_constructor_super, create_artificial_method,
start_artificial_method_body, end_artificial_method_body,
generate_field_initialization_code): New function prototypes.
* parse.y: Fixed leading comment
(constructor_header:, constructor_body:, block_end:): Rules tagged
<node>.
(type_declaration:): Call maybe_generate_finit.
(method_declaration:): Action for method_body: placed in new
function complete_method_declaration, called here.
(constructor_declaration:): Defined actions. Removed leading
FIXME.
(constructor_header:): New rule with action.
(constructor_body:): Rule rewritten using block_begin: and
block_end:. Defined actions.
(constructor_declarator:, explicit_constructor_invocation:):
Defined actions.
(block:): Use new rules block_begin: block_end:.
(block_begin:, block_end:): New rules and actions.
(block_statements:): Fixed error message for explicit
constructors.
(method_invocation:): Call build_this_super_qualified_invocation
if primary is `this' or `super' was seen.
(conditional_expression:): Action defined.
(extra_ctxp_pushed_p): New static global flag.
(java_parser_context_save_global): Create parser context if
necessary. Use extra_ctxp_pushed_p to remember it.
(java_parser_context_restore_global): Pop extra parser context if
one exists.
(build_array_from_name): Array on primitive types are marked
loaded.
(register_fields): Restore new name in field initializer
expression if type was altered. Non static fields initialized upon
declaration marked initialized.
(maybe_generate_finit): New function.
(maybe_generate_clinit): Use create_artificial_method,
start_artificial_method_body, end_artificial_method_body. Generate
debug info for enclosed initialization statements.
(method_header): Fixed leading comment. Check constructor
flags. Detect constructor declarations and set DECL_CONSTRUCTOR_P
accordingly.
(complete_method_declaration, constructor_circularity_msg,
verify_constructor_circularity): New functions.
(get_printable_method_name): New function.
(check_method_redefinition): Don't rename <finit> methods. Fix
declared constructor names. Error message for
constructors modified.
(java_check_regular_methods): Local variable seen_constructor
renamed saw_constructor. Skip verification on constructors. Create
default constructor with create_artificial_method.
(java_check_methods): Removed unnecessary empty line.
(create_artificial_method, start_artificial_method_body,
end_artificial_method_body): New functions.
(java_layout_classes): Changed leading comment. Reverse fields
list if necessary. Always layout java.lang.Object if being
defined.
(java_complete_expand_methods): Verify constructor circularity.
(java_complete_expand_method): Call fix_constructor on
constructors. Local variable no_ac_found removed. Restore
bindings if method body expansion failed.
(fix_constructors, verify_constructor_super,
generate_field_initialization_code): New function.
(java_expand_classes): Fixed leading comment. Write class file
here.
(resolve_expression_name): Check for illegal instance variable
usage within the argument scope of an explicit constructor
invocation.
(resolve_qualified_expression_name): Pass extra from_super flag
when invoking patch_method_invocation_stmt. New case for
conditional expression when used as a primary. Check for error
when acquiring super.
(patch_method_invocation_stmt): Added extra argument super. New
local variable is_static_flag. Set class_to_search according to
the nature of the constructor invocation. Don't add `this'
argument when expanding NEW_CLASS_EXPR. Check for illegal method
invocation within the argument scope of explicit constructor
invocation. Set is_static according to is_static_flag. Provide
extra `super' argument to patch_invoke invocation.
(patch_invoke): New argument from_super. Loop on arguments
indentation fixed. Pass from_super to invocation_mode. New switch
case INVOKE_SUPER. Fixed error message in switch default case.
Don't use CALL_CONSTRUCTOR_P but rather a test on the tree node
value.
(invocation_mode): Return INVOKE_SUPER mode when appropriate.
(lookup_method_invoke): Fixed prototypes in candidates list. Error
message takes constructors into account.
(find_applicable_accessible_methods_list): Fixed indentation.
(qualify_ambiguous_name): Take explicit constructor invocation
into account. Deal with a conditional expression as a primary to
a method call.
(java_complete_tree): Added local wfl_op3. New CONDITIONAL_EXPR
case. Added extra argument to patch_method_invocation_stmt.
Register calls made to explicit constructor `this'. Don't call
save_expr in ARRAY_REF case when emitting class files. Check for
illegal use of this when expanding explicit constructor invocation
arguments.
(complete_function_arguments): Set and reset parser context
explicit_constructor_p field value when appropriate.
(build_super_invocation, build_this_super_qualified_invocation):
New functions.
(patch_assignment): Fixed typo.
(patch_unaryop): Check on final fields occurs only when a decl
exits.
(patch_return): Take constructors into account.
(patch_conditional_expr): New function.
* typeck.c (build_java_signature): Removed unnecessary empty line.
This patch implements the conditional operator, fixes the super
invokation mode, implements most of what is required for constructors
and changes the way source files are handled by the front-end.
From-SVN: r23403
1998-10-28 13:06:17 +00:00
|
|
|
|
|
|
|
int explicit_constructor_p; /* True when processing an
|
|
|
|
explicit constructor. This flag is
|
|
|
|
used to trap illegal argument usage
|
|
|
|
during an explicit constructor
|
|
|
|
invocation. */
|
1998-09-06 15:36:06 +00:00
|
|
|
#endif /* JC1_LITE */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Functions declarations */
|
|
|
|
#ifndef JC1_LITE
|
|
|
|
static char *java_accstring_lookup PROTO ((int));
|
|
|
|
static void parse_error PROTO ((char *));
|
1998-10-12 05:43:53 -07:00
|
|
|
static void classitf_redefinition_error PROTO ((char *,tree, tree, tree));
|
|
|
|
static void variable_redefinition_error PROTO ((tree, tree, tree, int));
|
1998-09-06 15:36:06 +00:00
|
|
|
static void check_modifiers PROTO ((char *, int, int));
|
|
|
|
static tree create_class PROTO ((int, tree, tree, tree));
|
|
|
|
static tree create_interface PROTO ((int, tree, tree));
|
|
|
|
static tree find_field PROTO ((tree, tree));
|
|
|
|
static tree lookup_field_wrapper PROTO ((tree, tree));
|
1998-10-16 19:36:39 +00:00
|
|
|
static int duplicate_declaration_error_p PROTO ((tree, tree, tree));
|
1998-09-06 15:36:06 +00:00
|
|
|
static void register_fields PROTO ((int, tree, tree));
|
|
|
|
static tree parser_qualified_classname PROTO ((tree));
|
|
|
|
static int parser_check_super PROTO ((tree, tree, tree));
|
|
|
|
static int parser_check_super_interface PROTO ((tree, tree, tree));
|
|
|
|
static void check_modifiers_consistency PROTO ((int));
|
|
|
|
static tree lookup_cl PROTO ((tree));
|
|
|
|
static tree lookup_java_method2 PROTO ((tree, tree, int));
|
|
|
|
static tree method_header PROTO ((int, tree, tree, tree));
|
|
|
|
static tree method_declarator PROTO ((tree, tree));
|
|
|
|
static void parse_error_context VPROTO ((tree cl, char *msg, ...));
|
|
|
|
static void parse_warning_context VPROTO ((tree cl, char *msg, ...));
|
1998-10-12 05:43:53 -07:00
|
|
|
static tree parse_jdk1_1_error PROTO ((char *));
|
1998-09-06 15:36:06 +00:00
|
|
|
static void complete_class_report_errors PROTO ((jdep *));
|
|
|
|
static int process_imports PROTO ((void));
|
|
|
|
static void read_import_dir PROTO ((tree));
|
|
|
|
static int find_in_imports_on_demand PROTO ((tree));
|
|
|
|
static int find_in_imports PROTO ((tree));
|
|
|
|
static int check_pkg_class_access PROTO ((tree, tree));
|
|
|
|
static tree resolve_class PROTO ((tree, tree, tree));
|
|
|
|
static tree do_resolve_class PROTO ((tree, tree, tree));
|
|
|
|
static void declare_local_variables PROTO ((int, tree, tree));
|
|
|
|
static void source_start_java_method PROTO ((tree));
|
|
|
|
static void source_end_java_method PROTO ((void));
|
|
|
|
static void expand_start_java_method PROTO ((tree));
|
|
|
|
static tree find_name_in_single_imports PROTO ((tree));
|
|
|
|
static void check_abstract_method_header PROTO ((tree));
|
|
|
|
static tree lookup_java_interface_method2 PROTO ((tree, tree));
|
|
|
|
static tree resolve_expression_name PROTO ((tree));
|
|
|
|
static tree maybe_create_class_interface_decl PROTO ((tree, tree, tree));
|
class.c (layout_class): Don't mangle <finit>, produce __finit<class> instead.
Wed Oct 28 08:03:31 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* class.c (layout_class): Don't mangle <finit>, produce
__finit<class> instead. Don't verify artificial methods.
* decl.c (finit_identifier_node): New declared global.
(init_decl_processing): finit_identifier_node initialized.
* java-tree.def (CONDITIONAL_EXPR): New Java tree code.
* java-tree.h (finit_identifier_node): Declared as extern.
(struct lang_decl): New field called_constructor.
(DECL_CONSTRUCTOR_CALLS): Access macro to called_constructor.
(CLASS_HAS_FINIT_P): New macro.
(CALL_CONSTRUCTOR_P): Leading comment changed. Macro now checks
explicit constructor invocation.
(CALL_EXPLICIT_CONSTRUCTOR_P, CALL_THIS_CONSTRUCTOR_P,
CALL_SUPER_CONSTRUCTOR_P): New macros.
(write_classfile): Added prototype.
* jcf-parse.c (jcf_parse_source): Parse and remember for
generation if the file was seen on the command line.
(parse_source_file): Don't write the class file here.
(yyparse): Loop on files rewritten. Set current_jcf.
(parse_zip_file_entries): Parse class file only if it was found.
* lang.c (init_parse): Don't open command line provided filename
here.
(lang_parse): Don't set main_jcf anymore.
* parse.h (ABSTRAC_CHECK): Capitalized arguments.
(JCONSTRUCTOR_CHECK): New macro.
(JBSC_TYPE_P): New macro.
(IN_TRY_BLOCK_P, EXCEPTIONS_P): Fixed leading comment.
(COMPLETE_CHECK_OP_2): New macro.
(struct parse_ctxt): New field explicit_constructor_p.
(check_class_interface_creation): Fixed prototype indentation.
(patch_method_invocation_stmt): Prototype reflects added argument.
(patch_invoke): Likewise.
(complete_method_declaration, build_super_invocation,
verify_constructor_circularity,
build_this_super_qualified_invocation, get_printable_method_name,
patch_conditional_expr, maybe_generate_finit, fix_constructors,
verify_constructor_super, create_artificial_method,
start_artificial_method_body, end_artificial_method_body,
generate_field_initialization_code): New function prototypes.
* parse.y: Fixed leading comment
(constructor_header:, constructor_body:, block_end:): Rules tagged
<node>.
(type_declaration:): Call maybe_generate_finit.
(method_declaration:): Action for method_body: placed in new
function complete_method_declaration, called here.
(constructor_declaration:): Defined actions. Removed leading
FIXME.
(constructor_header:): New rule with action.
(constructor_body:): Rule rewritten using block_begin: and
block_end:. Defined actions.
(constructor_declarator:, explicit_constructor_invocation:):
Defined actions.
(block:): Use new rules block_begin: block_end:.
(block_begin:, block_end:): New rules and actions.
(block_statements:): Fixed error message for explicit
constructors.
(method_invocation:): Call build_this_super_qualified_invocation
if primary is `this' or `super' was seen.
(conditional_expression:): Action defined.
(extra_ctxp_pushed_p): New static global flag.
(java_parser_context_save_global): Create parser context if
necessary. Use extra_ctxp_pushed_p to remember it.
(java_parser_context_restore_global): Pop extra parser context if
one exists.
(build_array_from_name): Array on primitive types are marked
loaded.
(register_fields): Restore new name in field initializer
expression if type was altered. Non static fields initialized upon
declaration marked initialized.
(maybe_generate_finit): New function.
(maybe_generate_clinit): Use create_artificial_method,
start_artificial_method_body, end_artificial_method_body. Generate
debug info for enclosed initialization statements.
(method_header): Fixed leading comment. Check constructor
flags. Detect constructor declarations and set DECL_CONSTRUCTOR_P
accordingly.
(complete_method_declaration, constructor_circularity_msg,
verify_constructor_circularity): New functions.
(get_printable_method_name): New function.
(check_method_redefinition): Don't rename <finit> methods. Fix
declared constructor names. Error message for
constructors modified.
(java_check_regular_methods): Local variable seen_constructor
renamed saw_constructor. Skip verification on constructors. Create
default constructor with create_artificial_method.
(java_check_methods): Removed unnecessary empty line.
(create_artificial_method, start_artificial_method_body,
end_artificial_method_body): New functions.
(java_layout_classes): Changed leading comment. Reverse fields
list if necessary. Always layout java.lang.Object if being
defined.
(java_complete_expand_methods): Verify constructor circularity.
(java_complete_expand_method): Call fix_constructor on
constructors. Local variable no_ac_found removed. Restore
bindings if method body expansion failed.
(fix_constructors, verify_constructor_super,
generate_field_initialization_code): New function.
(java_expand_classes): Fixed leading comment. Write class file
here.
(resolve_expression_name): Check for illegal instance variable
usage within the argument scope of an explicit constructor
invocation.
(resolve_qualified_expression_name): Pass extra from_super flag
when invoking patch_method_invocation_stmt. New case for
conditional expression when used as a primary. Check for error
when acquiring super.
(patch_method_invocation_stmt): Added extra argument super. New
local variable is_static_flag. Set class_to_search according to
the nature of the constructor invocation. Don't add `this'
argument when expanding NEW_CLASS_EXPR. Check for illegal method
invocation within the argument scope of explicit constructor
invocation. Set is_static according to is_static_flag. Provide
extra `super' argument to patch_invoke invocation.
(patch_invoke): New argument from_super. Loop on arguments
indentation fixed. Pass from_super to invocation_mode. New switch
case INVOKE_SUPER. Fixed error message in switch default case.
Don't use CALL_CONSTRUCTOR_P but rather a test on the tree node
value.
(invocation_mode): Return INVOKE_SUPER mode when appropriate.
(lookup_method_invoke): Fixed prototypes in candidates list. Error
message takes constructors into account.
(find_applicable_accessible_methods_list): Fixed indentation.
(qualify_ambiguous_name): Take explicit constructor invocation
into account. Deal with a conditional expression as a primary to
a method call.
(java_complete_tree): Added local wfl_op3. New CONDITIONAL_EXPR
case. Added extra argument to patch_method_invocation_stmt.
Register calls made to explicit constructor `this'. Don't call
save_expr in ARRAY_REF case when emitting class files. Check for
illegal use of this when expanding explicit constructor invocation
arguments.
(complete_function_arguments): Set and reset parser context
explicit_constructor_p field value when appropriate.
(build_super_invocation, build_this_super_qualified_invocation):
New functions.
(patch_assignment): Fixed typo.
(patch_unaryop): Check on final fields occurs only when a decl
exits.
(patch_return): Take constructors into account.
(patch_conditional_expr): New function.
* typeck.c (build_java_signature): Removed unnecessary empty line.
This patch implements the conditional operator, fixes the super
invokation mode, implements most of what is required for constructors
and changes the way source files are handled by the front-end.
From-SVN: r23403
1998-10-28 13:06:17 +00:00
|
|
|
static int check_class_interface_creation PROTO ((int, int, tree,
|
|
|
|
tree, tree, tree));
|
|
|
|
static tree patch_method_invocation_stmt PROTO ((tree, tree, tree,
|
|
|
|
int *, tree *, int));
|
1998-09-06 15:36:06 +00:00
|
|
|
static int breakdown_qualified PROTO ((tree *, tree *, tree));
|
|
|
|
static tree resolve_and_layout PROTO ((tree, tree));
|
|
|
|
static tree resolve_no_layout PROTO ((tree, tree));
|
|
|
|
static int invocation_mode PROTO ((tree, int));
|
1998-10-12 05:43:53 -07:00
|
|
|
static tree find_applicable_accessible_methods_list PROTO ((tree, tree, tree));
|
|
|
|
static tree find_most_specific_methods_list PROTO ((tree));
|
|
|
|
static int argument_types_convertible PROTO ((tree, tree));
|
class.c (layout_class): Don't mangle <finit>, produce __finit<class> instead.
Wed Oct 28 08:03:31 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* class.c (layout_class): Don't mangle <finit>, produce
__finit<class> instead. Don't verify artificial methods.
* decl.c (finit_identifier_node): New declared global.
(init_decl_processing): finit_identifier_node initialized.
* java-tree.def (CONDITIONAL_EXPR): New Java tree code.
* java-tree.h (finit_identifier_node): Declared as extern.
(struct lang_decl): New field called_constructor.
(DECL_CONSTRUCTOR_CALLS): Access macro to called_constructor.
(CLASS_HAS_FINIT_P): New macro.
(CALL_CONSTRUCTOR_P): Leading comment changed. Macro now checks
explicit constructor invocation.
(CALL_EXPLICIT_CONSTRUCTOR_P, CALL_THIS_CONSTRUCTOR_P,
CALL_SUPER_CONSTRUCTOR_P): New macros.
(write_classfile): Added prototype.
* jcf-parse.c (jcf_parse_source): Parse and remember for
generation if the file was seen on the command line.
(parse_source_file): Don't write the class file here.
(yyparse): Loop on files rewritten. Set current_jcf.
(parse_zip_file_entries): Parse class file only if it was found.
* lang.c (init_parse): Don't open command line provided filename
here.
(lang_parse): Don't set main_jcf anymore.
* parse.h (ABSTRAC_CHECK): Capitalized arguments.
(JCONSTRUCTOR_CHECK): New macro.
(JBSC_TYPE_P): New macro.
(IN_TRY_BLOCK_P, EXCEPTIONS_P): Fixed leading comment.
(COMPLETE_CHECK_OP_2): New macro.
(struct parse_ctxt): New field explicit_constructor_p.
(check_class_interface_creation): Fixed prototype indentation.
(patch_method_invocation_stmt): Prototype reflects added argument.
(patch_invoke): Likewise.
(complete_method_declaration, build_super_invocation,
verify_constructor_circularity,
build_this_super_qualified_invocation, get_printable_method_name,
patch_conditional_expr, maybe_generate_finit, fix_constructors,
verify_constructor_super, create_artificial_method,
start_artificial_method_body, end_artificial_method_body,
generate_field_initialization_code): New function prototypes.
* parse.y: Fixed leading comment
(constructor_header:, constructor_body:, block_end:): Rules tagged
<node>.
(type_declaration:): Call maybe_generate_finit.
(method_declaration:): Action for method_body: placed in new
function complete_method_declaration, called here.
(constructor_declaration:): Defined actions. Removed leading
FIXME.
(constructor_header:): New rule with action.
(constructor_body:): Rule rewritten using block_begin: and
block_end:. Defined actions.
(constructor_declarator:, explicit_constructor_invocation:):
Defined actions.
(block:): Use new rules block_begin: block_end:.
(block_begin:, block_end:): New rules and actions.
(block_statements:): Fixed error message for explicit
constructors.
(method_invocation:): Call build_this_super_qualified_invocation
if primary is `this' or `super' was seen.
(conditional_expression:): Action defined.
(extra_ctxp_pushed_p): New static global flag.
(java_parser_context_save_global): Create parser context if
necessary. Use extra_ctxp_pushed_p to remember it.
(java_parser_context_restore_global): Pop extra parser context if
one exists.
(build_array_from_name): Array on primitive types are marked
loaded.
(register_fields): Restore new name in field initializer
expression if type was altered. Non static fields initialized upon
declaration marked initialized.
(maybe_generate_finit): New function.
(maybe_generate_clinit): Use create_artificial_method,
start_artificial_method_body, end_artificial_method_body. Generate
debug info for enclosed initialization statements.
(method_header): Fixed leading comment. Check constructor
flags. Detect constructor declarations and set DECL_CONSTRUCTOR_P
accordingly.
(complete_method_declaration, constructor_circularity_msg,
verify_constructor_circularity): New functions.
(get_printable_method_name): New function.
(check_method_redefinition): Don't rename <finit> methods. Fix
declared constructor names. Error message for
constructors modified.
(java_check_regular_methods): Local variable seen_constructor
renamed saw_constructor. Skip verification on constructors. Create
default constructor with create_artificial_method.
(java_check_methods): Removed unnecessary empty line.
(create_artificial_method, start_artificial_method_body,
end_artificial_method_body): New functions.
(java_layout_classes): Changed leading comment. Reverse fields
list if necessary. Always layout java.lang.Object if being
defined.
(java_complete_expand_methods): Verify constructor circularity.
(java_complete_expand_method): Call fix_constructor on
constructors. Local variable no_ac_found removed. Restore
bindings if method body expansion failed.
(fix_constructors, verify_constructor_super,
generate_field_initialization_code): New function.
(java_expand_classes): Fixed leading comment. Write class file
here.
(resolve_expression_name): Check for illegal instance variable
usage within the argument scope of an explicit constructor
invocation.
(resolve_qualified_expression_name): Pass extra from_super flag
when invoking patch_method_invocation_stmt. New case for
conditional expression when used as a primary. Check for error
when acquiring super.
(patch_method_invocation_stmt): Added extra argument super. New
local variable is_static_flag. Set class_to_search according to
the nature of the constructor invocation. Don't add `this'
argument when expanding NEW_CLASS_EXPR. Check for illegal method
invocation within the argument scope of explicit constructor
invocation. Set is_static according to is_static_flag. Provide
extra `super' argument to patch_invoke invocation.
(patch_invoke): New argument from_super. Loop on arguments
indentation fixed. Pass from_super to invocation_mode. New switch
case INVOKE_SUPER. Fixed error message in switch default case.
Don't use CALL_CONSTRUCTOR_P but rather a test on the tree node
value.
(invocation_mode): Return INVOKE_SUPER mode when appropriate.
(lookup_method_invoke): Fixed prototypes in candidates list. Error
message takes constructors into account.
(find_applicable_accessible_methods_list): Fixed indentation.
(qualify_ambiguous_name): Take explicit constructor invocation
into account. Deal with a conditional expression as a primary to
a method call.
(java_complete_tree): Added local wfl_op3. New CONDITIONAL_EXPR
case. Added extra argument to patch_method_invocation_stmt.
Register calls made to explicit constructor `this'. Don't call
save_expr in ARRAY_REF case when emitting class files. Check for
illegal use of this when expanding explicit constructor invocation
arguments.
(complete_function_arguments): Set and reset parser context
explicit_constructor_p field value when appropriate.
(build_super_invocation, build_this_super_qualified_invocation):
New functions.
(patch_assignment): Fixed typo.
(patch_unaryop): Check on final fields occurs only when a decl
exits.
(patch_return): Take constructors into account.
(patch_conditional_expr): New function.
* typeck.c (build_java_signature): Removed unnecessary empty line.
This patch implements the conditional operator, fixes the super
invokation mode, implements most of what is required for constructors
and changes the way source files are handled by the front-end.
From-SVN: r23403
1998-10-28 13:06:17 +00:00
|
|
|
static tree patch_invoke PROTO ((tree, tree, tree, int));
|
1998-09-06 15:36:06 +00:00
|
|
|
static tree lookup_method_invoke PROTO ((int, tree, tree, tree, tree));
|
|
|
|
static tree register_incomplete_type PROTO ((int, tree, tree, tree));
|
|
|
|
static tree obtain_incomplete_type PROTO ((tree));
|
|
|
|
static tree java_complete_tree PROTO ((tree));
|
|
|
|
static void java_complete_expand_method PROTO ((tree));
|
|
|
|
static int unresolved_type_p PROTO ((tree, tree *));
|
|
|
|
static void create_jdep_list PROTO ((struct parser_ctxt *));
|
|
|
|
static tree build_expr_block PROTO ((tree, tree));
|
|
|
|
static tree enter_block PROTO ((void));
|
1998-10-12 05:43:53 -07:00
|
|
|
static tree enter_a_block PROTO ((tree));
|
1998-09-06 15:36:06 +00:00
|
|
|
static tree exit_block PROTO ((void));
|
|
|
|
static tree lookup_name_in_blocks PROTO ((tree));
|
|
|
|
static void maybe_absorb_scoping_blocks PROTO ((void));
|
|
|
|
static tree build_method_invocation PROTO ((tree, tree));
|
1998-10-12 05:43:53 -07:00
|
|
|
static tree build_new_invocation PROTO ((tree, tree));
|
1998-09-06 15:36:06 +00:00
|
|
|
static tree build_assignment PROTO ((int, int, tree, tree));
|
|
|
|
static tree build_binop PROTO ((enum tree_code, int, tree, tree));
|
|
|
|
static tree patch_assignment PROTO ((tree, tree, tree ));
|
|
|
|
static tree patch_binop PROTO ((tree, tree, tree));
|
|
|
|
static tree build_unaryop PROTO ((int, int, tree));
|
|
|
|
static tree build_incdec PROTO ((int, int, tree, int));
|
|
|
|
static tree patch_unaryop PROTO ((tree, tree));
|
|
|
|
static tree build_cast PROTO ((int, tree, tree));
|
java-tree.h (pop_labeled_block, [...]): New function prototypes.
Wed Oct 14 18:21:29 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* java-tree.h (pop_labeled_block, lang_printable_name,
maybe_add_interface, set_super_info, get_access_flags_from_decl,
interface_of_p, inherits_from_p, fix_classpath,
complete_start_java_method, emit_handlers, init_outgoing_cpool,
make_class_data, register_class, alloc_name_constant): New
function prototypes.
* lang.c (lang_decode_option): Set argc argument unused. Fixed
indentation. Added cast to remove warning.
(lang_printable_name): Set v argument unused.
(lang_print_error): Added argument to lang_printable_name call.
(java_dummy_print, print_lang_decl, print_lang_type,
print_lang_identifier, lang_print_xnode): All argument marked
unused.
* lex.c (java_unget_unicode): Removed unnecessary argument.
(java_allocate_new_line): Unused local variable is gone.
(java_read_char): Added parenthesis in expressions to remove
warnings. Added final return statement.
(java_read_unicode): Added parenthesis in expression to remove
warning.
(java_parse_end_comment): Fixed java_unget_unicode invocation.
(java_parse_escape_sequence): Likewise.
(java_lex): Unused local variables are gone. Fixed
java_unget_unicode invocation.
* lex.h (set_float_handler): Prototype added when JC1_LITE not
defined.
* parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed
lang_printable_name invocation in macro.
(ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL):
Likewise.
(duplicate_declaration_error): Suppressed unused argument in
prototype.
(identical_subpath_p): Function declaration is gone.
(patch_invoke): Suppressed unused argument in prototype.
(patch_cast, build_labeled_block, check_thrown_exceptions):
Likewise.
* parse.y (setjmp.h): Included
(toplev.h): Likewise.
(field_declaration:): Suppressed unused local
(label_decl:): Fixed build_labeled_block invocation.
(java_pop_parser_context): Put extra parenthesis around assignment
in if.
(yyerror): Suppressed unused local variables.
(variable_redefinition_error): Fixed lang_printable_name
invocation.
(create_interface): Suppressed unused local variables.
(create_class): Likewise.
(duplicate_declaration_error): Suppressed unused argument. Fixed
lang_printable_name invocation.
(register_fields): Suppressed unused local variable. Fixed
duplicate_declaration_error invocation.
(method_header): Suppressed unused local variable.
(method_declarator, parser_check_super): Likewise.
(java_complete_class): Suppressed unused local variable. Fixed
fatal error message.
(complete_class_report_errors): Added default: in switch.
(java_check_regular_methods): Fixed lang_printable_name
invocations.
(check_throws_clauses): Likewise.
(java_check_abstract_methods): Suppressed unused local
variable. Fixed lang_printable_name invocation.
(read_import_entry): Added supplemental return statement.
(read_import_dir): Suppressed unused local variables.
(check_pkg_class_access, declare_local_variables): Likewise.
(source_start_java_method): Suppressed unused extern variable
declarations
(expand_start_java_method): Suppressed unused extern and local
variable declarations.
(java_complete_expand_methods): Likewise.
(java_complete_expand_method): Suppressed unused local variables.
(make_qualified_name): Likewise.
(resolve_qualified_expression_name): Added default: in
switch. Fixed lang_printable_name invocation.
(class_instance_creation_expression): Added parenthesis around
expressions.
(patch_method_invocation_stmt): Fixed lang_printable_name and
patch_invoke invocations.
(check_for_static_method_reference): Fixed lang_printable_name
invocation.
(patch_invoke): Suppressed unused arguments and local variables.
(lookup_method_invoke): Suppressed unused local variables.
(qualify_ambiguous_name): Added default: in switch.
(identical_subpath_p): Function removed.
(patch_assignment): Suppressed unused local variables. Suppressed
unnecessary if statement. Fixed lang_printable_name invocations.
(try_builtin_assignconv): Fixed lang_printable_name invocations.
(valid_ref_assignconv_cast_p): Parenthesis around
expression. Suppressed unused local variables.
(build_binop): Suppressed unused local variables. fixed
lang_printable_name invocations.
(string_constant_concatenation): Suppressed unused local
variables.
(patch_unaryop): Fixed lang_printable_name invocation.
(patch_cast): Suppressed unnecessary argument. Fixed
lang_printable_name invocation.
(patch_array_ref): Fixed lang_printable_name invocation.
(patch_newarray, patch_return, patch_if_else_statement): Likewise.
(build_labeled_block): Suppressed unused argument.
(generate_labeled_block): Fixed build_labeled_block invocation.
(build_loop_body): Suppressed unused local variables.
(patch_loop_statement): Likewise.
(patch_exit): Fixed lang_printable_name invocation.
(patch_switch_statement): Likewise.
(case_identity): First argument marked unused.
(patch_try_statement): Fixed lang_printable_name invocations.
(patch_synchronized_statement, patch_throw_statement): Likewise.
(check_thrown_exceptions): Fixed check_thrown_exceptions and
lang_printable_name invocations.
(check_thrown_exceptions_do): Suppressed unused argument.
Suppresses warnings during the compilation of parse.y (including
lex.c) and lang.c
From-SVN: r23090
1998-10-14 19:18:07 +00:00
|
|
|
static tree patch_cast PROTO ((tree, tree));
|
1998-09-06 15:36:06 +00:00
|
|
|
static int valid_ref_assignconv_cast_p PROTO ((tree, tree, int));
|
1998-10-12 05:43:53 -07:00
|
|
|
static int valid_builtin_assignconv_identity_widening_p PROTO ((tree, tree));
|
|
|
|
static int valid_cast_to_p PROTO ((tree, tree));
|
|
|
|
static int valid_method_invocation_conversion_p PROTO ((tree, tree));
|
|
|
|
static tree try_builtin_assignconv PROTO ((tree, tree, tree));
|
|
|
|
static tree try_reference_assignconv PROTO ((tree, tree));
|
1998-09-06 15:36:06 +00:00
|
|
|
static tree build_unresolved_array_type PROTO ((tree));
|
1998-10-16 19:36:39 +00:00
|
|
|
static tree build_array_from_name PROTO ((tree, tree, tree, tree *));
|
1998-09-06 15:36:06 +00:00
|
|
|
static tree build_array_ref PROTO ((int, tree, tree));
|
|
|
|
static tree patch_array_ref PROTO ((tree, tree, tree));
|
|
|
|
static tree make_qualified_name PROTO ((tree, tree, int));
|
|
|
|
static tree merge_qualified_name PROTO ((tree, tree));
|
|
|
|
static tree make_qualified_primary PROTO ((tree, tree, int));
|
|
|
|
static int resolve_qualified_expression_name PROTO ((tree, tree *, tree *, tree *));
|
|
|
|
static void qualify_ambiguous_name PROTO ((tree));
|
|
|
|
static void maybe_generate_clinit PROTO ((void));
|
|
|
|
static tree resolve_field_access PROTO ((tree, tree *, tree *));
|
|
|
|
static tree build_newarray_node PROTO ((tree, tree, int));
|
|
|
|
static tree patch_newarray PROTO ((tree));
|
|
|
|
static tree resolve_type_during_patch PROTO ((tree));
|
|
|
|
static int not_initialized_as_it_should_p PROTO ((tree));
|
|
|
|
static tree build_this PROTO ((int));
|
|
|
|
static tree build_return PROTO ((int, tree));
|
|
|
|
static tree patch_return PROTO ((tree));
|
|
|
|
static tree maybe_access_field PROTO ((tree, tree, tree));
|
|
|
|
static int complete_function_arguments PROTO ((tree));
|
|
|
|
static int check_for_static_method_reference PROTO ((tree, tree, tree, tree, tree));
|
|
|
|
static int not_accessible_p PROTO ((tree, tree, int));
|
|
|
|
static int class_in_current_package PROTO ((tree));
|
|
|
|
static tree build_if_else_statement PROTO ((int, tree, tree, tree));
|
|
|
|
static tree patch_if_else_statement PROTO ((tree));
|
|
|
|
static tree add_stmt_to_compound PROTO ((tree, tree, tree));
|
1998-10-12 05:43:53 -07:00
|
|
|
static tree add_stmt_to_block PROTO ((tree, tree, tree));
|
1998-09-06 15:36:06 +00:00
|
|
|
static tree patch_exit_expr PROTO ((tree));
|
java-tree.h (pop_labeled_block, [...]): New function prototypes.
Wed Oct 14 18:21:29 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* java-tree.h (pop_labeled_block, lang_printable_name,
maybe_add_interface, set_super_info, get_access_flags_from_decl,
interface_of_p, inherits_from_p, fix_classpath,
complete_start_java_method, emit_handlers, init_outgoing_cpool,
make_class_data, register_class, alloc_name_constant): New
function prototypes.
* lang.c (lang_decode_option): Set argc argument unused. Fixed
indentation. Added cast to remove warning.
(lang_printable_name): Set v argument unused.
(lang_print_error): Added argument to lang_printable_name call.
(java_dummy_print, print_lang_decl, print_lang_type,
print_lang_identifier, lang_print_xnode): All argument marked
unused.
* lex.c (java_unget_unicode): Removed unnecessary argument.
(java_allocate_new_line): Unused local variable is gone.
(java_read_char): Added parenthesis in expressions to remove
warnings. Added final return statement.
(java_read_unicode): Added parenthesis in expression to remove
warning.
(java_parse_end_comment): Fixed java_unget_unicode invocation.
(java_parse_escape_sequence): Likewise.
(java_lex): Unused local variables are gone. Fixed
java_unget_unicode invocation.
* lex.h (set_float_handler): Prototype added when JC1_LITE not
defined.
* parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed
lang_printable_name invocation in macro.
(ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL):
Likewise.
(duplicate_declaration_error): Suppressed unused argument in
prototype.
(identical_subpath_p): Function declaration is gone.
(patch_invoke): Suppressed unused argument in prototype.
(patch_cast, build_labeled_block, check_thrown_exceptions):
Likewise.
* parse.y (setjmp.h): Included
(toplev.h): Likewise.
(field_declaration:): Suppressed unused local
(label_decl:): Fixed build_labeled_block invocation.
(java_pop_parser_context): Put extra parenthesis around assignment
in if.
(yyerror): Suppressed unused local variables.
(variable_redefinition_error): Fixed lang_printable_name
invocation.
(create_interface): Suppressed unused local variables.
(create_class): Likewise.
(duplicate_declaration_error): Suppressed unused argument. Fixed
lang_printable_name invocation.
(register_fields): Suppressed unused local variable. Fixed
duplicate_declaration_error invocation.
(method_header): Suppressed unused local variable.
(method_declarator, parser_check_super): Likewise.
(java_complete_class): Suppressed unused local variable. Fixed
fatal error message.
(complete_class_report_errors): Added default: in switch.
(java_check_regular_methods): Fixed lang_printable_name
invocations.
(check_throws_clauses): Likewise.
(java_check_abstract_methods): Suppressed unused local
variable. Fixed lang_printable_name invocation.
(read_import_entry): Added supplemental return statement.
(read_import_dir): Suppressed unused local variables.
(check_pkg_class_access, declare_local_variables): Likewise.
(source_start_java_method): Suppressed unused extern variable
declarations
(expand_start_java_method): Suppressed unused extern and local
variable declarations.
(java_complete_expand_methods): Likewise.
(java_complete_expand_method): Suppressed unused local variables.
(make_qualified_name): Likewise.
(resolve_qualified_expression_name): Added default: in
switch. Fixed lang_printable_name invocation.
(class_instance_creation_expression): Added parenthesis around
expressions.
(patch_method_invocation_stmt): Fixed lang_printable_name and
patch_invoke invocations.
(check_for_static_method_reference): Fixed lang_printable_name
invocation.
(patch_invoke): Suppressed unused arguments and local variables.
(lookup_method_invoke): Suppressed unused local variables.
(qualify_ambiguous_name): Added default: in switch.
(identical_subpath_p): Function removed.
(patch_assignment): Suppressed unused local variables. Suppressed
unnecessary if statement. Fixed lang_printable_name invocations.
(try_builtin_assignconv): Fixed lang_printable_name invocations.
(valid_ref_assignconv_cast_p): Parenthesis around
expression. Suppressed unused local variables.
(build_binop): Suppressed unused local variables. fixed
lang_printable_name invocations.
(string_constant_concatenation): Suppressed unused local
variables.
(patch_unaryop): Fixed lang_printable_name invocation.
(patch_cast): Suppressed unnecessary argument. Fixed
lang_printable_name invocation.
(patch_array_ref): Fixed lang_printable_name invocation.
(patch_newarray, patch_return, patch_if_else_statement): Likewise.
(build_labeled_block): Suppressed unused argument.
(generate_labeled_block): Fixed build_labeled_block invocation.
(build_loop_body): Suppressed unused local variables.
(patch_loop_statement): Likewise.
(patch_exit): Fixed lang_printable_name invocation.
(patch_switch_statement): Likewise.
(case_identity): First argument marked unused.
(patch_try_statement): Fixed lang_printable_name invocations.
(patch_synchronized_statement, patch_throw_statement): Likewise.
(check_thrown_exceptions): Fixed check_thrown_exceptions and
lang_printable_name invocations.
(check_thrown_exceptions_do): Suppressed unused argument.
Suppresses warnings during the compilation of parse.y (including
lex.c) and lang.c
From-SVN: r23090
1998-10-14 19:18:07 +00:00
|
|
|
static tree build_labeled_block PROTO ((int, tree));
|
1998-09-06 15:36:06 +00:00
|
|
|
static tree generate_labeled_block PROTO (());
|
|
|
|
static tree complete_labeled_statement PROTO ((tree, tree));
|
|
|
|
static tree build_bc_statement PROTO ((int, int, tree));
|
|
|
|
static tree patch_bc_statement PROTO ((tree));
|
|
|
|
static tree patch_loop_statement PROTO ((tree));
|
|
|
|
static tree build_new_loop PROTO ((tree));
|
|
|
|
static tree build_loop_body PROTO ((int, tree, int));
|
|
|
|
static tree complete_loop_body PROTO ((int, tree, tree, int));
|
|
|
|
static tree build_debugable_stmt PROTO ((int, tree));
|
|
|
|
static tree complete_for_loop PROTO ((int, tree, tree, tree));
|
1998-10-12 05:43:53 -07:00
|
|
|
static tree patch_switch_statement PROTO ((tree));
|
|
|
|
static tree string_constant_concatenation PROTO ((tree, tree));
|
|
|
|
static tree build_string_concatenation PROTO ((tree, tree));
|
|
|
|
static tree patch_string_cst PROTO ((tree));
|
|
|
|
static tree patch_string PROTO ((tree));
|
|
|
|
static tree build_jump_to_finally PROTO ((tree, tree, tree, tree));
|
|
|
|
static tree build_try_statement PROTO ((int, tree, tree, tree));
|
|
|
|
static tree patch_try_statement PROTO ((tree));
|
decl.c (runtime_exception_type_node, [...]): New global variables.
Tue Oct 13 03:50:28 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* decl.c (runtime_exception_type_node, error_exception_type_node):
New global variables.
(init_decl_processing): Initialized.
* expr.c (java_lang_expand_expr): Set caught exception type to
null if catch handler argument doesn't exit.
* java-tree.def (SYNCHRONIZED_EXPR, THROW_EXPR): New Java specific
tree codes.
* java-tree.h (runtime_exception_type_node,
error_exception_type_node): Global variables declared.
(DECL_FUNCTION_THROWS): New macro.
(DECL_FUNCTION_BODY): Modified comment.
(DECL_SPECIFIC_COUNT): Likewise.
(struct lang_decl): New field throws_list.
(IS_UNCHECKED_EXPRESSION_P): New macro.
* lex.c (java_lex): Generate location information for THROW_TK.
* parse.h (PUSH_EXCEPTIONS, POP_EXCEPTIONS, IN_TRY_BLOCK_P,
EXCEPTIONS_P): New macros.
(enum jdep_code): New value JDEP_EXCEPTION.
(BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT,
BUILD_ASSIGN_EXCEPTION_INFO, BUILD_THROW, SET_WFL_OPERATOR,
PATCH_METHOD_RETURN_ERROR): New macros.
(patch_method_invocation_stmt): Added new argument to prototype.
(patch_synchronized_statement, patch_throw_statement,
check_thrown_exceptions, check_thrown_exceptions_do,
purge_unchecked_exceptions, check_throws_clauses): New function
prototypes.
* parse.y Fixed typo in keyword section.
(throw:): Rule tagged <node>.
(THROW_TK): Keyword tagged <operator>.
(method_header:): Last argument to call to method_header passed
from throws: rule.
(throws:, class_type_list:, throw_statement:,
synchronized_statement:, synchronized:): Defined actions.
(method_header): New local variable current. Register exceptions
from throws clause.
(java_complete_tree): Complete and verify exceptions from throws
clause.
(complete_class_report_errors): Error message on exceptions not
found
(java_check_regular_methods): Fixed typo. Shortcut on private
overriding methods. Changed error message on method
redefinition. Check for throws clause compatibility.
(check_throws_clauses): New function.
(java_check_abstract_methods): Use DECL_NAME for wfl or current
method. Changed error message on method redefinition.
(currently_caught_type_list): New static variable.
(java_complete_expand_methods): Purge unchecked exceptions from
throws clause list. Call PUSH_EXCEPTIONS before walk and
POP_EXCEPTIONS after.
(resolve_qualified_expression_name): Pass new argument as NULL to
patch_method_invocation_stmt.
(patch_method_invocation_stmt): New argument ref_decl. Invoke
PATCH_METHOD_RETURN_ERROR when returning with error. Reverse
argument list when appropriate. Use new argument if non null to
store selected method decl.
(patch_invoke): Convert if necessary args of builtin types before
forming CALL_EXPR. Argument list no longer reversed here.
(invocation_mode): Treat final methods as static methods.
(java_complete_tree): New cases for THROW_EXPR: and
SYNCHRONIZED_EXPR:. Check thrown exceptions when completing
function call.
(complete_function_arguments): No more RECORD_TYPE
conversion. Function parameter nodes no longer saved.
(valid_ref_assignconv_cast_p): Avoid handling null type.
(patch_binop): Fixed null constant reference handling.
(build_try_statement): Use BUILD_ASSIGN_EXCEPTION_INFO and
BUILD_THROW macros.
(patch_try_statement): Fixed comments. Record caught types in
list, push the list, expand try block and pop the list.
(patch_synchronized_statement, patch_throw_statement,
check_thrown_exceptions, check_thrown_exceptions_do,
purge_unchecked_exceptions): New functions.
* typeck.c (lookup_argument_method): Allow WFL in place of method
DECL_NAME during method definition check
Implements the `synchronized' statement, the `throw' statements and
the `throws' clause. Fixes method invocation bugs.
From-SVN: r23087
1998-10-14 15:11:04 +00:00
|
|
|
static tree patch_synchronized_statement PROTO ((tree, tree));
|
|
|
|
static tree patch_throw_statement PROTO ((tree, tree));
|
|
|
|
static void check_thrown_exceptions PROTO ((int, tree));
|
java-tree.h (pop_labeled_block, [...]): New function prototypes.
Wed Oct 14 18:21:29 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* java-tree.h (pop_labeled_block, lang_printable_name,
maybe_add_interface, set_super_info, get_access_flags_from_decl,
interface_of_p, inherits_from_p, fix_classpath,
complete_start_java_method, emit_handlers, init_outgoing_cpool,
make_class_data, register_class, alloc_name_constant): New
function prototypes.
* lang.c (lang_decode_option): Set argc argument unused. Fixed
indentation. Added cast to remove warning.
(lang_printable_name): Set v argument unused.
(lang_print_error): Added argument to lang_printable_name call.
(java_dummy_print, print_lang_decl, print_lang_type,
print_lang_identifier, lang_print_xnode): All argument marked
unused.
* lex.c (java_unget_unicode): Removed unnecessary argument.
(java_allocate_new_line): Unused local variable is gone.
(java_read_char): Added parenthesis in expressions to remove
warnings. Added final return statement.
(java_read_unicode): Added parenthesis in expression to remove
warning.
(java_parse_end_comment): Fixed java_unget_unicode invocation.
(java_parse_escape_sequence): Likewise.
(java_lex): Unused local variables are gone. Fixed
java_unget_unicode invocation.
* lex.h (set_float_handler): Prototype added when JC1_LITE not
defined.
* parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed
lang_printable_name invocation in macro.
(ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL):
Likewise.
(duplicate_declaration_error): Suppressed unused argument in
prototype.
(identical_subpath_p): Function declaration is gone.
(patch_invoke): Suppressed unused argument in prototype.
(patch_cast, build_labeled_block, check_thrown_exceptions):
Likewise.
* parse.y (setjmp.h): Included
(toplev.h): Likewise.
(field_declaration:): Suppressed unused local
(label_decl:): Fixed build_labeled_block invocation.
(java_pop_parser_context): Put extra parenthesis around assignment
in if.
(yyerror): Suppressed unused local variables.
(variable_redefinition_error): Fixed lang_printable_name
invocation.
(create_interface): Suppressed unused local variables.
(create_class): Likewise.
(duplicate_declaration_error): Suppressed unused argument. Fixed
lang_printable_name invocation.
(register_fields): Suppressed unused local variable. Fixed
duplicate_declaration_error invocation.
(method_header): Suppressed unused local variable.
(method_declarator, parser_check_super): Likewise.
(java_complete_class): Suppressed unused local variable. Fixed
fatal error message.
(complete_class_report_errors): Added default: in switch.
(java_check_regular_methods): Fixed lang_printable_name
invocations.
(check_throws_clauses): Likewise.
(java_check_abstract_methods): Suppressed unused local
variable. Fixed lang_printable_name invocation.
(read_import_entry): Added supplemental return statement.
(read_import_dir): Suppressed unused local variables.
(check_pkg_class_access, declare_local_variables): Likewise.
(source_start_java_method): Suppressed unused extern variable
declarations
(expand_start_java_method): Suppressed unused extern and local
variable declarations.
(java_complete_expand_methods): Likewise.
(java_complete_expand_method): Suppressed unused local variables.
(make_qualified_name): Likewise.
(resolve_qualified_expression_name): Added default: in
switch. Fixed lang_printable_name invocation.
(class_instance_creation_expression): Added parenthesis around
expressions.
(patch_method_invocation_stmt): Fixed lang_printable_name and
patch_invoke invocations.
(check_for_static_method_reference): Fixed lang_printable_name
invocation.
(patch_invoke): Suppressed unused arguments and local variables.
(lookup_method_invoke): Suppressed unused local variables.
(qualify_ambiguous_name): Added default: in switch.
(identical_subpath_p): Function removed.
(patch_assignment): Suppressed unused local variables. Suppressed
unnecessary if statement. Fixed lang_printable_name invocations.
(try_builtin_assignconv): Fixed lang_printable_name invocations.
(valid_ref_assignconv_cast_p): Parenthesis around
expression. Suppressed unused local variables.
(build_binop): Suppressed unused local variables. fixed
lang_printable_name invocations.
(string_constant_concatenation): Suppressed unused local
variables.
(patch_unaryop): Fixed lang_printable_name invocation.
(patch_cast): Suppressed unnecessary argument. Fixed
lang_printable_name invocation.
(patch_array_ref): Fixed lang_printable_name invocation.
(patch_newarray, patch_return, patch_if_else_statement): Likewise.
(build_labeled_block): Suppressed unused argument.
(generate_labeled_block): Fixed build_labeled_block invocation.
(build_loop_body): Suppressed unused local variables.
(patch_loop_statement): Likewise.
(patch_exit): Fixed lang_printable_name invocation.
(patch_switch_statement): Likewise.
(case_identity): First argument marked unused.
(patch_try_statement): Fixed lang_printable_name invocations.
(patch_synchronized_statement, patch_throw_statement): Likewise.
(check_thrown_exceptions): Fixed check_thrown_exceptions and
lang_printable_name invocations.
(check_thrown_exceptions_do): Suppressed unused argument.
Suppresses warnings during the compilation of parse.y (including
lex.c) and lang.c
From-SVN: r23090
1998-10-14 19:18:07 +00:00
|
|
|
static int check_thrown_exceptions_do PROTO ((tree));
|
decl.c (runtime_exception_type_node, [...]): New global variables.
Tue Oct 13 03:50:28 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* decl.c (runtime_exception_type_node, error_exception_type_node):
New global variables.
(init_decl_processing): Initialized.
* expr.c (java_lang_expand_expr): Set caught exception type to
null if catch handler argument doesn't exit.
* java-tree.def (SYNCHRONIZED_EXPR, THROW_EXPR): New Java specific
tree codes.
* java-tree.h (runtime_exception_type_node,
error_exception_type_node): Global variables declared.
(DECL_FUNCTION_THROWS): New macro.
(DECL_FUNCTION_BODY): Modified comment.
(DECL_SPECIFIC_COUNT): Likewise.
(struct lang_decl): New field throws_list.
(IS_UNCHECKED_EXPRESSION_P): New macro.
* lex.c (java_lex): Generate location information for THROW_TK.
* parse.h (PUSH_EXCEPTIONS, POP_EXCEPTIONS, IN_TRY_BLOCK_P,
EXCEPTIONS_P): New macros.
(enum jdep_code): New value JDEP_EXCEPTION.
(BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT,
BUILD_ASSIGN_EXCEPTION_INFO, BUILD_THROW, SET_WFL_OPERATOR,
PATCH_METHOD_RETURN_ERROR): New macros.
(patch_method_invocation_stmt): Added new argument to prototype.
(patch_synchronized_statement, patch_throw_statement,
check_thrown_exceptions, check_thrown_exceptions_do,
purge_unchecked_exceptions, check_throws_clauses): New function
prototypes.
* parse.y Fixed typo in keyword section.
(throw:): Rule tagged <node>.
(THROW_TK): Keyword tagged <operator>.
(method_header:): Last argument to call to method_header passed
from throws: rule.
(throws:, class_type_list:, throw_statement:,
synchronized_statement:, synchronized:): Defined actions.
(method_header): New local variable current. Register exceptions
from throws clause.
(java_complete_tree): Complete and verify exceptions from throws
clause.
(complete_class_report_errors): Error message on exceptions not
found
(java_check_regular_methods): Fixed typo. Shortcut on private
overriding methods. Changed error message on method
redefinition. Check for throws clause compatibility.
(check_throws_clauses): New function.
(java_check_abstract_methods): Use DECL_NAME for wfl or current
method. Changed error message on method redefinition.
(currently_caught_type_list): New static variable.
(java_complete_expand_methods): Purge unchecked exceptions from
throws clause list. Call PUSH_EXCEPTIONS before walk and
POP_EXCEPTIONS after.
(resolve_qualified_expression_name): Pass new argument as NULL to
patch_method_invocation_stmt.
(patch_method_invocation_stmt): New argument ref_decl. Invoke
PATCH_METHOD_RETURN_ERROR when returning with error. Reverse
argument list when appropriate. Use new argument if non null to
store selected method decl.
(patch_invoke): Convert if necessary args of builtin types before
forming CALL_EXPR. Argument list no longer reversed here.
(invocation_mode): Treat final methods as static methods.
(java_complete_tree): New cases for THROW_EXPR: and
SYNCHRONIZED_EXPR:. Check thrown exceptions when completing
function call.
(complete_function_arguments): No more RECORD_TYPE
conversion. Function parameter nodes no longer saved.
(valid_ref_assignconv_cast_p): Avoid handling null type.
(patch_binop): Fixed null constant reference handling.
(build_try_statement): Use BUILD_ASSIGN_EXCEPTION_INFO and
BUILD_THROW macros.
(patch_try_statement): Fixed comments. Record caught types in
list, push the list, expand try block and pop the list.
(patch_synchronized_statement, patch_throw_statement,
check_thrown_exceptions, check_thrown_exceptions_do,
purge_unchecked_exceptions): New functions.
* typeck.c (lookup_argument_method): Allow WFL in place of method
DECL_NAME during method definition check
Implements the `synchronized' statement, the `throw' statements and
the `throws' clause. Fixes method invocation bugs.
From-SVN: r23087
1998-10-14 15:11:04 +00:00
|
|
|
static void purge_unchecked_exceptions PROTO ((tree));
|
|
|
|
static void check_throws_clauses PROTO ((tree, tree, tree));
|
class.c (layout_class): Don't mangle <finit>, produce __finit<class> instead.
Wed Oct 28 08:03:31 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* class.c (layout_class): Don't mangle <finit>, produce
__finit<class> instead. Don't verify artificial methods.
* decl.c (finit_identifier_node): New declared global.
(init_decl_processing): finit_identifier_node initialized.
* java-tree.def (CONDITIONAL_EXPR): New Java tree code.
* java-tree.h (finit_identifier_node): Declared as extern.
(struct lang_decl): New field called_constructor.
(DECL_CONSTRUCTOR_CALLS): Access macro to called_constructor.
(CLASS_HAS_FINIT_P): New macro.
(CALL_CONSTRUCTOR_P): Leading comment changed. Macro now checks
explicit constructor invocation.
(CALL_EXPLICIT_CONSTRUCTOR_P, CALL_THIS_CONSTRUCTOR_P,
CALL_SUPER_CONSTRUCTOR_P): New macros.
(write_classfile): Added prototype.
* jcf-parse.c (jcf_parse_source): Parse and remember for
generation if the file was seen on the command line.
(parse_source_file): Don't write the class file here.
(yyparse): Loop on files rewritten. Set current_jcf.
(parse_zip_file_entries): Parse class file only if it was found.
* lang.c (init_parse): Don't open command line provided filename
here.
(lang_parse): Don't set main_jcf anymore.
* parse.h (ABSTRAC_CHECK): Capitalized arguments.
(JCONSTRUCTOR_CHECK): New macro.
(JBSC_TYPE_P): New macro.
(IN_TRY_BLOCK_P, EXCEPTIONS_P): Fixed leading comment.
(COMPLETE_CHECK_OP_2): New macro.
(struct parse_ctxt): New field explicit_constructor_p.
(check_class_interface_creation): Fixed prototype indentation.
(patch_method_invocation_stmt): Prototype reflects added argument.
(patch_invoke): Likewise.
(complete_method_declaration, build_super_invocation,
verify_constructor_circularity,
build_this_super_qualified_invocation, get_printable_method_name,
patch_conditional_expr, maybe_generate_finit, fix_constructors,
verify_constructor_super, create_artificial_method,
start_artificial_method_body, end_artificial_method_body,
generate_field_initialization_code): New function prototypes.
* parse.y: Fixed leading comment
(constructor_header:, constructor_body:, block_end:): Rules tagged
<node>.
(type_declaration:): Call maybe_generate_finit.
(method_declaration:): Action for method_body: placed in new
function complete_method_declaration, called here.
(constructor_declaration:): Defined actions. Removed leading
FIXME.
(constructor_header:): New rule with action.
(constructor_body:): Rule rewritten using block_begin: and
block_end:. Defined actions.
(constructor_declarator:, explicit_constructor_invocation:):
Defined actions.
(block:): Use new rules block_begin: block_end:.
(block_begin:, block_end:): New rules and actions.
(block_statements:): Fixed error message for explicit
constructors.
(method_invocation:): Call build_this_super_qualified_invocation
if primary is `this' or `super' was seen.
(conditional_expression:): Action defined.
(extra_ctxp_pushed_p): New static global flag.
(java_parser_context_save_global): Create parser context if
necessary. Use extra_ctxp_pushed_p to remember it.
(java_parser_context_restore_global): Pop extra parser context if
one exists.
(build_array_from_name): Array on primitive types are marked
loaded.
(register_fields): Restore new name in field initializer
expression if type was altered. Non static fields initialized upon
declaration marked initialized.
(maybe_generate_finit): New function.
(maybe_generate_clinit): Use create_artificial_method,
start_artificial_method_body, end_artificial_method_body. Generate
debug info for enclosed initialization statements.
(method_header): Fixed leading comment. Check constructor
flags. Detect constructor declarations and set DECL_CONSTRUCTOR_P
accordingly.
(complete_method_declaration, constructor_circularity_msg,
verify_constructor_circularity): New functions.
(get_printable_method_name): New function.
(check_method_redefinition): Don't rename <finit> methods. Fix
declared constructor names. Error message for
constructors modified.
(java_check_regular_methods): Local variable seen_constructor
renamed saw_constructor. Skip verification on constructors. Create
default constructor with create_artificial_method.
(java_check_methods): Removed unnecessary empty line.
(create_artificial_method, start_artificial_method_body,
end_artificial_method_body): New functions.
(java_layout_classes): Changed leading comment. Reverse fields
list if necessary. Always layout java.lang.Object if being
defined.
(java_complete_expand_methods): Verify constructor circularity.
(java_complete_expand_method): Call fix_constructor on
constructors. Local variable no_ac_found removed. Restore
bindings if method body expansion failed.
(fix_constructors, verify_constructor_super,
generate_field_initialization_code): New function.
(java_expand_classes): Fixed leading comment. Write class file
here.
(resolve_expression_name): Check for illegal instance variable
usage within the argument scope of an explicit constructor
invocation.
(resolve_qualified_expression_name): Pass extra from_super flag
when invoking patch_method_invocation_stmt. New case for
conditional expression when used as a primary. Check for error
when acquiring super.
(patch_method_invocation_stmt): Added extra argument super. New
local variable is_static_flag. Set class_to_search according to
the nature of the constructor invocation. Don't add `this'
argument when expanding NEW_CLASS_EXPR. Check for illegal method
invocation within the argument scope of explicit constructor
invocation. Set is_static according to is_static_flag. Provide
extra `super' argument to patch_invoke invocation.
(patch_invoke): New argument from_super. Loop on arguments
indentation fixed. Pass from_super to invocation_mode. New switch
case INVOKE_SUPER. Fixed error message in switch default case.
Don't use CALL_CONSTRUCTOR_P but rather a test on the tree node
value.
(invocation_mode): Return INVOKE_SUPER mode when appropriate.
(lookup_method_invoke): Fixed prototypes in candidates list. Error
message takes constructors into account.
(find_applicable_accessible_methods_list): Fixed indentation.
(qualify_ambiguous_name): Take explicit constructor invocation
into account. Deal with a conditional expression as a primary to
a method call.
(java_complete_tree): Added local wfl_op3. New CONDITIONAL_EXPR
case. Added extra argument to patch_method_invocation_stmt.
Register calls made to explicit constructor `this'. Don't call
save_expr in ARRAY_REF case when emitting class files. Check for
illegal use of this when expanding explicit constructor invocation
arguments.
(complete_function_arguments): Set and reset parser context
explicit_constructor_p field value when appropriate.
(build_super_invocation, build_this_super_qualified_invocation):
New functions.
(patch_assignment): Fixed typo.
(patch_unaryop): Check on final fields occurs only when a decl
exits.
(patch_return): Take constructors into account.
(patch_conditional_expr): New function.
* typeck.c (build_java_signature): Removed unnecessary empty line.
This patch implements the conditional operator, fixes the super
invokation mode, implements most of what is required for constructors
and changes the way source files are handled by the front-end.
From-SVN: r23403
1998-10-28 13:06:17 +00:00
|
|
|
static void complete_method_declaration PROTO ((tree));
|
|
|
|
static tree build_super_invocation PROTO (());
|
|
|
|
static int verify_constructor_circularity PROTO ((tree, tree));
|
|
|
|
static char *constructor_circularity_msg PROTO ((tree, tree));
|
|
|
|
static tree build_this_super_qualified_invocation PROTO ((int, tree, tree,
|
|
|
|
int, int));
|
|
|
|
static char *get_printable_method_name PROTO ((tree));
|
|
|
|
static tree patch_conditional_expr PROTO ((tree, tree, tree));
|
|
|
|
static void maybe_generate_finit PROTO (());
|
|
|
|
static void fix_constructors PROTO ((tree));
|
|
|
|
static int verify_constructor_super PROTO (());
|
|
|
|
static tree create_artificial_method PROTO ((tree, int, tree, tree, tree));
|
|
|
|
static void start_artificial_method_body PROTO ((tree));
|
|
|
|
static void end_artificial_method_body PROTO ((tree));
|
|
|
|
static tree generate_field_initialization_code PROTO ((tree));
|
1998-09-06 15:36:06 +00:00
|
|
|
|
|
|
|
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));
|
1998-10-12 05:43:53 -07:00
|
|
|
void java_expand_switch PROTO ((tree));
|
|
|
|
tree java_get_catch_block PROTO ((tree, int));
|
1998-09-06 15:36:06 +00:00
|
|
|
#endif /* JC1_LITE */
|
|
|
|
|
|
|
|
/* Always in use, no matter what you compile */
|
|
|
|
|
|
|
|
void java_push_parser_context PROTO ((void));
|
1998-10-20 11:16:37 +00:00
|
|
|
void java_pop_parser_context PROTO ((int));
|
1998-09-06 15:36:06 +00:00
|
|
|
void java_init_lex PROTO ((void));
|
|
|
|
int yyparse PROTO ((void));
|
|
|
|
int yylex ();
|
|
|
|
void yyerror PROTO ((char *));
|
|
|
|
|
|
|
|
#endif
|