diff options
Diffstat (limited to 'gcc/java/parse.h')
-rw-r--r-- | gcc/java/parse.h | 433 |
1 files changed, 257 insertions, 176 deletions
diff --git a/gcc/java/parse.h b/gcc/java/parse.h index 50d51401149..52d9917df87 100644 --- a/gcc/java/parse.h +++ b/gcc/java/parse.h @@ -1,5 +1,5 @@ /* Language parser definitions for the GNU compiler for the Java(TM) language. - Copyright (C) 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com) This file is part of GNU CC. @@ -47,7 +47,7 @@ extern tree stabilize_reference PROTO ((tree)); #define RULE( rule ) #endif -#ifdef SOURCE_FRONTEND_DEBUG +#ifdef VERBOSE_SKELETON #undef SOURCE_FRONTEND_DEBUG #define SOURCE_FRONTEND_DEBUG(X) \ {if (!quiet_flag) {printf ("* "); printf X; putchar ('\n');} } @@ -99,10 +99,14 @@ extern tree stabilize_reference PROTO ((tree)); count++; \ } -#define ABSTRACT_CHECK(flag, v, cl, s) \ - if ((flag) & (v)) \ - parse_error_context (cl, s " method can't be abstract"); +#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)); \ + /* Misc. */ #define exit_java_complete_class() \ { \ @@ -118,11 +122,25 @@ extern tree stabilize_reference PROTO ((tree)); (s1 [0]=='S' ? "Supertype" : "supertype") : \ (s1 [0] > 'A' ? "Type" : "type"))) +#define GET_REAL_TYPE(TYPE) \ + (TREE_CODE (TYPE) == TREE_LIST ? TREE_PURPOSE (TYPE) : TYPE) + +#define GET_METHOD_NAME(METHOD) \ + (TREE_CODE (DECL_NAME (METHOD)) == EXPR_WITH_FILE_LOCATION ? \ + EXPR_WFL_NODE (DECL_NAME (METHOD)) : DECL_NAME (METHOD)) + +/* Get TYPE name string, regardless whether TYPE is a class or an + array. */ +#define GET_TYPE_NAME(TYPE) \ + (TREE_CODE (TYPE_NAME (TYPE)) == IDENTIFIER_NODE ? \ + IDENTIFIER_POINTER (TYPE_NAME (TYPE)) : \ + IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (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))) \ + if (flag_redundant && (cl) && ((flags) & (modifier))) \ parse_warning_context (cl, \ "Discouraged redundant use of `%s' modifier " \ "in declaration of " format, \ @@ -136,10 +154,10 @@ extern tree stabilize_reference PROTO ((tree)); TYPE_NAME (ptr) = name; \ } -#define INCOMPLETE_TYPE_P(NODE) \ - ((TREE_CODE (NODE) == TREE_LIST) \ - && (TREE_CODE (TREE_PURPOSE (NODE)) == POINTER_TYPE) \ - && (TREE_TYPE (TREE_PURPOSE (NODE)) == NULL_TREE)) +#define INCOMPLETE_TYPE_P(NODE) \ + ((TREE_CODE (NODE) == POINTER_TYPE) \ + && !TREE_TYPE (NODE) \ + && TREE_CODE (TYPE_NAME (NODE)) == IDENTIFIER_NODE) /* Set the EMIT_LINE_NOTE flag of a EXPR_WLF to 1 if debug information are requested. Works in the context of a parser rule. */ @@ -148,45 +166,60 @@ extern tree stabilize_reference PROTO ((tree)); EXPR_WFL_EMIT_LINE_NOTE (node) = 1, node : node) /* Types classification, according to the JLS, section 4.2 */ -#define JFLOAT_TYPE_P(TYPE) (TREE_CODE ((TYPE)) == REAL_TYPE) -#define JINTEGRAL_TYPE_P(TYPE) ((TREE_CODE ((TYPE)) == INTEGER_TYPE) \ - || (TREE_CODE ((TYPE)) == CHAR_TYPE)) -#define JNUMERIC_TYPE_P(TYPE) (JFLOAT_TYPE_P ((TYPE)) \ - || JINTEGRAL_TYPE_P ((TYPE))) -#define JPRIMITIVE_TYPE_P(TYPE) (JNUMERIC_TYPE_P ((TYPE)) \ - || (TREE_CODE ((TYPE)) == BOOLEAN_TYPE)) +#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)) + +#define JBSC_TYPE_P(TYPE) ((TYPE) && (((TYPE) == byte_type_node) \ + || ((TYPE) == short_type_node) \ + || ((TYPE) == char_type_node))) /* Not defined in the LRM */ -#define JSTRING_TYPE_P(TYPE) ((TYPE) == string_type_node || \ - (TREE_CODE (TYPE) == POINTER_TYPE && \ - TREE_TYPE (op1_type) == string_type_node)) - -#define JREFERENCE_TYPE_P(TYPE) (TREE_CODE (TYPE) == RECORD_TYPE || \ - (TREE_CODE (TYPE) == POINTER_TYPE && \ - TREE_CODE (TREE_TYPE (TYPE)) == RECORD_TYPE)) +#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))) +#define JNULLP_TYPE_P(TYPE) ((TYPE) && (TREE_CODE (TYPE) == POINTER_TYPE) \ + && (TYPE) == TREE_TYPE (null_pointer_node)) /* Other predicate */ -#define DECL_P(NODE) (NODE && (TREE_CODE (NODE) == PARM_DECL \ - || TREE_CODE (NODE) == VAR_DECL \ - || TREE_CODE (NODE) == FIELD_DECL)) +#define JDECL_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)) + && !CLASS_INTERFACE (TYPE_NAME (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 " \ - "boolean", operator_string ((NODE)), lang_printable_name ((TYPE))) + "boolean", operator_string ((NODE)), lang_printable_name ((TYPE),0)) #define ERROR_CANT_CONVERT_TO_NUMERIC(OPERATOR, NODE, TYPE) \ parse_error_context \ ((OPERATOR), "Incompatible type for `%s'. Can't convert `%s' to " \ - "numeric type", operator_string ((NODE)), lang_printable_name ((TYPE))) + "numeric type", operator_string ((NODE)), lang_printable_name ((TYPE), 0)) #define ERROR_CAST_NEEDED_TO_INTEGRAL(OPERATOR, NODE, TYPE) \ parse_error_context \ @@ -194,16 +227,16 @@ extern tree stabilize_reference PROTO ((tree)); "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)), \ - lang_printable_name ((TYPE))) + lang_printable_name ((TYPE), 0)) #define ERROR_VARIABLE_NOT_INITIALIZED(WFL, V) \ parse_error_context \ - ((WFL), "Variable `%s' may not have been initialized", \ + ((WFL), "Variable `%s' may not have been initialized", \ IDENTIFIER_POINTER (V)) -/* Definition for loop handling. This 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) */ +/* 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) */ /* 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) @@ -252,6 +285,22 @@ extern tree stabilize_reference PROTO ((tree)); } #define POP_LOOP() ctxp->current_loop = TREE_CHAIN (ctxp->current_loop) +#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) + +/* Check that we're inside a try block. */ +#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))) + +/* Check that we have exceptions in E. */ +#define EXCEPTIONS_P(E) ((E) ? TREE_VALUE (E) : NULL_TREE) /* Invocation modes, as returned by invocation_mode (). */ enum { @@ -259,7 +308,7 @@ enum { INVOKE_NONVIRTUAL, INVOKE_SUPER, INVOKE_INTERFACE, - INVOKE_VIRTUAL, + INVOKE_VIRTUAL }; /* We need the resolution stuff only if we compile jc1 */ @@ -308,6 +357,7 @@ enum jdep_code { JDEP_TYPE, /* Patch a random tree node type, without the need for any specific actions */ + JDEP_EXCEPTION /* Patch exceptions specified by `throws' */ }; typedef struct _jdep { @@ -337,22 +387,17 @@ typedef struct _jdep { #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) +#define JDEP_TO_RESOLVE(J) ((J)->solv) +#define JDEP_RESOLVED_DECL(J) ((J)->solv) +#define JDEP_RESOLVED(J, D) ((J)->solv = D) +#define JDEP_RESOLVED_P(J) \ + (!(J)->solv || TREE_CODE ((J)->solv) != POINTER_TYPE) typedef struct _jdeplist { jdep *first; jdep *last; struct _jdeplist *next; } jdeplist; -static jdeplist *reverse_jdep_list (); #endif /* JC1_LITE */ @@ -371,16 +416,57 @@ static jdeplist *reverse_jdep_list (); } \ } +/* if TYPE can't be resolved, obtain something suitable for its + resolution (TYPE is saved in SAVE before being changed). and set + CHAIN to 1. Otherwise, type is set to something usable. CHAIN is + usually used to determine that a new DEP must be installed on TYPE. + Note that when compiling java.lang.Object, references to Object are + java.lang.Object. */ +#define SET_TYPE_FOR_RESOLUTION(TYPE, SAVE, CHAIN) \ + { \ + tree returned_type; \ + (CHAIN) = 0; \ + if (TREE_TYPE (ctxp->current_parsed_class) == object_type_node \ + && TREE_CODE (TYPE) == EXPR_WITH_FILE_LOCATION \ + && EXPR_WFL_NODE (TYPE) == unqualified_object_id_node) \ + (TYPE) = object_type_node; \ + else \ + { \ + if (unresolved_type_p (type, &returned_type)) \ + { \ + if (returned_type) \ + (TYPE) = returned_type; \ + else \ + { \ + (SAVE) = (TYPE); \ + (TYPE) = obtain_incomplete_type (TYPE); \ + CHAIN = 1; \ + } \ + } \ + } \ + } +/* Promote a type if it won't be registered as a patch */ +#define PROMOTE_RECORD_IF_COMPLETE(TYPE, IS_INCOMPLETE) \ + { \ + if (!(IS_INCOMPLETE) && TREE_CODE (TYPE) == RECORD_TYPE) \ + (TYPE) = promote_type (TYPE); \ + } + /* 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); \ + BLOCK_EXPR_DECLS (GET_CURRENT_BLOCK (current_function_decl)); \ + BLOCK_EXPR_DECLS (GET_CURRENT_BLOCK (current_function_decl)) = (NODE); \ } -#define BLOCK_EXPR_DECLS(NODE) BLOCK_VARS(NODE) -#define BLOCK_EXPR_BODY(NODE) BLOCK_SUBBLOCKS(NODE) +/* Return the current block, either found in the body of the currently + declared function or in the current static block being defined. */ +#define GET_CURRENT_BLOCK(F) ((F) ? DECL_FUNCTION_BODY ((F)) : \ + current_static_block) + +/* For an artificial BLOCK (created to house a local variable declaration not + at the start of an existing block), the parent block; otherwise NULL. */ #define BLOCK_EXPR_ORIGIN(NODE) BLOCK_ABSTRACT_ORIGIN(NODE) /* Merge an other line to the source line number of a decl. Used to @@ -391,6 +477,13 @@ static jdeplist *reverse_jdep_list (); #define DECL_SOURCE_LINE_FIRST(DECL) (DECL_SOURCE_LINE(DECL) & 0x0000ffff) #define DECL_SOURCE_LINE_LAST(DECL) (DECL_SOURCE_LINE(DECL) >> 16) +/* Retrieve line/column from a WFL. */ +#define EXPR_WFL_GET_LINECOL(V,LINE,COL) \ + { \ + (LINE) = (V) >> 12; \ + (COL) = (V) & 0xfff; \ + } + /* Build a WFL for expression nodes */ #define BUILD_EXPR_WFL(NODE, WFL) \ build_expr_wfl ((NODE), input_filename, EXPR_WFL_LINENO ((WFL)), \ @@ -399,9 +492,11 @@ static jdeplist *reverse_jdep_list (); #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) \ +#define QUAL_DECL_TYPE(NODE) GET_SKIP_TYPE (NODE) + +#define GET_SKIP_TYPE(NODE) \ (TREE_CODE (TREE_TYPE (NODE)) == POINTER_TYPE ? \ - TREE_TYPE (TREE_TYPE (NODE)) : TREE_TYPE (NODE)) + TREE_TYPE (TREE_TYPE (NODE)): TREE_TYPE (NODE)) /* Handy macros for the walk operation */ #define COMPLETE_CHECK_OP(NODE, N) \ @@ -413,7 +508,81 @@ static jdeplist *reverse_jdep_list (); } #define COMPLETE_CHECK_OP_0(NODE) COMPLETE_CHECK_OP(NODE, 0) #define COMPLETE_CHECK_OP_1(NODE) COMPLETE_CHECK_OP(NODE, 1) +#define COMPLETE_CHECK_OP_2(NODE) COMPLETE_CHECK_OP(NODE, 2) + +/* Building invocations: append(ARG) and StringBuffer(ARG) */ +#define BUILD_APPEND(ARG) \ + ((JSTRING_TYPE_P (TREE_TYPE (ARG)) || JPRIMITIVE_TYPE_P (TREE_TYPE (ARG))) \ + ? build_method_invocation (wfl_append, \ + ARG ? build_tree_list (NULL, (ARG)) : NULL_TREE)\ + : build_method_invocation (wfl_append, \ + ARG ? build_tree_list (NULL, \ + build1 (CONVERT_EXPR, \ + object_type_node,\ + (ARG))) \ + : NULL_TREE)) +#define BUILD_STRING_BUFFER(ARG) \ + build_new_invocation (wfl_string_buffer, \ + (ARG ? build_tree_list (NULL, (ARG)) : NULL_TREE)) + +/* For exception handling, build diverse function calls */ +#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; \ + } + +/* Convenient macro to check. Assumes that CLASS is a CLASS_DECL. */ +#define CHECK_METHODS(CLASS) \ + { \ + if (CLASS_INTERFACE ((CLASS))) \ + java_check_abstract_methods ((CLASS)); \ + else \ + java_check_regular_methods ((CLASS)); \ + } + +/* Using and reseting the @deprecated tag flag */ +#define CHECK_DEPRECATED(DECL) \ + { \ + if (ctxp->deprecated) \ + DECL_DEPRECATED (DECL) = 1; \ + ctxp->deprecated = 0; \ + } + +/* Register an import */ +#define REGISTER_IMPORT(WHOLE, NAME) \ +{ \ + IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P ((NAME)) = 1; \ + node = build_tree_list ((WHOLE), (NAME)); \ + TREE_CHAIN (node) = ctxp->import_list; \ + ctxp->import_list = node; \ +} +/* Macro to access the osb (opening square bracket) count */ +#define CURRENT_OSB(C) (C)->osb_number [(C)->osb_depth] + /* Parser context data structure. */ struct parser_ctxt { @@ -428,18 +597,21 @@ struct parser_ctxt { 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 osb_depth; /* Current depth of [ in an expression */ + int osb_limit; /* Limit of this depth */ + int *osb_number; /* Keep track of ['s */ int minus_seen; /* Integral literal overflow */ - int lineno; /* Current lineno */ - int java_error_flag; /* Report error when true */ + int lineno; /* Current lineno */ + int java_error_flag; /* Report error when true */ + int deprecated; /* @deprecated tag seen */ /* This section is defined only if we compile jc1 */ #ifndef JC1_LITE - tree modifier_ctx [11]; /* WFL of modifiers */ + tree modifier_ctx [11]; /* WFL of modifiers */ tree current_class; /* Current class */ tree current_function_decl; /* Current function decl, save/restore */ - JCF *current_jcf; /* CU jcf */ + struct JCF *current_jcf; /* CU jcf */ int prevent_ese; /* Prevent expression statement error */ int class_err; /* Flag to report certain errors */ @@ -449,151 +621,60 @@ struct parser_ctxt { tree package; /* Defined package ID */ + /* Those tow list are saved accross file traversal */ tree incomplete_class; /* List of non-complete classes */ - tree current_parsed_class; /* Class currently parsed */ + tree gclass_list; /* All classes seen from source code */ + + /* These two lists won't survive file traversal */ tree class_list; /* List of classes in a CU */ jdeplist *classd_list; /* Classe dependencies in a CU */ + tree current_parsed_class; /* Class currently parsed */ + tree current_parsed_class_un; /* Curr. parsed class unqualified name */ + tree non_static_initialized; /* List of non static initialized fields */ tree static_initialized; /* List of static non final initialized */ tree import_list; /* List of import */ tree import_demand_list; /* List of import on demand */ - tree current_loop; /* List of the currently nested loops */ - tree current_labeled_block; /* List of currently nested - labeled blocks. */ + tree current_loop; /* List of the currently nested + loops/switches */ + tree current_labeled_block; /* List of currently nested + labeled blocks. */ + + int pending_block; /* Pending block to close */ - int pending_block; /* Pending block to close */ + int explicit_constructor_p; /* True when processing an explicit + constructor. This flag is used to trap + illegal argument usage during an + explicit constructor invocation. */ #endif /* JC1_LITE */ }; -/* Functions declarations */ #ifndef JC1_LITE -static char *java_accstring_lookup PROTO ((int)); -static void parse_error PROTO ((char *)); -static void redefinition_error PROTO ((char *,tree, tree, tree)); -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)); -static int duplicate_declaration_error PROTO ((tree, tree, tree, tree)); -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, ...)); -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)); -static int check_class_interface_creation PROTO ((int, int, tree, tree, tree, tree)); -static tree patch_method_invocation_stmt PROTO ((tree, tree, tree, int *)); -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 identical_subpath_p PROTO ((tree, tree)); -static int invocation_mode PROTO ((tree, int)); -static tree refine_accessible_methods_list PROTO ((int, tree)); -static tree patch_invoke PROTO ((tree, tree, tree, tree)); -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)); -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)); -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)); -static tree patch_cast PROTO ((tree, tree, tree)); -static int valid_ref_assignconv_cast_p PROTO ((tree, tree, int)); -static int can_cast_to_p PROTO ((tree, tree)); -static tree build_unresolved_array_type PROTO ((tree)); -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)); -static tree patch_exit_expr PROTO ((tree)); -static tree build_labeled_block PROTO ((int, tree, tree)); -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)); - 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)); +void java_expand_switch PROTO ((tree)); +int java_report_errors PROTO (()); +extern tree do_resolve_class PROTO ((tree, tree, tree)); +#endif char *java_get_line_col PROTO ((char *, int, int)); -#endif /* JC1_LITE */ +extern void reset_report PROTO ((void)); /* Always in use, no matter what you compile */ - void java_push_parser_context PROTO ((void)); +void java_pop_parser_context PROTO ((int)); void java_init_lex PROTO ((void)); +extern void java_parser_context_save_global PROTO ((void)); +extern void java_parser_context_restore_global PROTO ((void)); int yyparse PROTO ((void)); +extern int java_parse PROTO ((void)); int yylex (); void yyerror PROTO ((char *)); - +extern void java_expand_classes PROTO ((void)); #endif |