1998-09-06 11:36:06 -04:00
|
|
|
/* Shift right, logical. */
|
|
|
|
|
1998-10-12 08:43:52 -04:00
|
|
|
DEFTREECODE (URSHIFT_EXPR, "urshift_expr", '2', 2)
|
1998-09-06 11:36:06 -04:00
|
|
|
|
|
|
|
/* Return -1, 0, 1 depending on whether the first argument is
|
|
|
|
less, equal, or greater to the second argument. */
|
1998-10-12 08:43:52 -04:00
|
|
|
DEFTREECODE (COMPARE_EXPR, "compare_expr", '2', 2)
|
1998-09-06 11:36:06 -04:00
|
|
|
|
|
|
|
/* Same as COMPARE_EXPR, but if either value is NaN, the result is -1. */
|
1998-10-12 08:43:52 -04:00
|
|
|
DEFTREECODE (COMPARE_L_EXPR, "compare_l_expr", '2', 2)
|
1998-09-06 11:36:06 -04:00
|
|
|
/* Same as COMPARE_EXPR, but if either value is NaN, the result is 1. */
|
1998-10-12 08:43:52 -04:00
|
|
|
DEFTREECODE (COMPARE_G_EXPR, "compare_g_expr", '2', 2)
|
|
|
|
|
|
|
|
/* Unary plus. Operand 0 is the expression the unary plus is applied
|
|
|
|
to */
|
|
|
|
DEFTREECODE (UNARY_PLUS_EXPR, "unary_plus_expr", '1', 1)
|
|
|
|
|
|
|
|
/* New array creation expression.
|
|
|
|
Operand 0 is the array base type.
|
|
|
|
Operand 1 is the list of dimension expressions.
|
|
|
|
Operand 2 is the number of other dimensions of unspecified range.
|
|
|
|
Once patched, the node will bear the type of the created array. */
|
|
|
|
DEFTREECODE (NEW_ARRAY_EXPR, "new_array_expr", 'e', 3)
|
|
|
|
|
|
|
|
/* New class creation expression.
|
|
|
|
Operand 0 is the name of the class to be created
|
|
|
|
Operand 1 is the argument list used to select a constructor.
|
|
|
|
There is no operand 2. That slot is used for the
|
|
|
|
CALL_EXPR_RTL macro (see preexpand_calls).
|
|
|
|
The type should be the one of the created class. */
|
|
|
|
DEFTREECODE (NEW_CLASS_EXPR, "new_class_expr", 'e', 3)
|
|
|
|
|
|
|
|
/* Defines `this' as an expression. */
|
|
|
|
DEFTREECODE (THIS_EXPR, "this", '1', 0)
|
|
|
|
|
|
|
|
/* Case statement expression.
|
|
|
|
Operand 1 is the case value. */
|
|
|
|
DEFTREECODE (CASE_EXPR, "case", '1', 1)
|
|
|
|
|
|
|
|
/* Default statement expression. */
|
|
|
|
DEFTREECODE (DEFAULT_EXPR, "default", '1', 0)
|
|
|
|
|
|
|
|
/* Try expression
|
|
|
|
Operand 0 is the tried block,
|
|
|
|
Operand 1 contains chained catch nodes
|
|
|
|
Operand 2 contains the finally clause. */
|
|
|
|
DEFTREECODE (TRY_EXPR, "try-catch-finally", 'e', 3)
|
|
|
|
|
|
|
|
/* Catch clause.
|
|
|
|
Operand 0 is the catch clause block, which contains the declaration of
|
|
|
|
the catch clause parameter. */
|
|
|
|
DEFTREECODE (CATCH_EXPR, "catch", '1', 1)
|
|
|
|
|
|
|
|
/* Finally clause.
|
|
|
|
Operand 0 is the finally label.
|
|
|
|
Operand 1 is the finally block. */
|
1998-10-13 18:35:34 -04:00
|
|
|
DEFTREECODE (FINALLY_EXPR, "finally", 'e', 2)
|
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 11:11:04 -04:00
|
|
|
|
|
|
|
/* Synchronized statement.
|
|
|
|
Operand 0 is the expression on which we whish to synchronize,
|
|
|
|
Operand 1 is the synchronized expression block. */
|
|
|
|
DEFTREECODE (SYNCHRONIZED_EXPR, "synchronized", 'e', 2)
|
|
|
|
|
|
|
|
/* Throw statement.
|
|
|
|
Operand 0 is the throw expresion. */
|
|
|
|
DEFTREECODE (THROW_EXPR, "throw", '1', 1)
|