📄 parse.c
字号:
static int valid_ref_assignconv_cast_p PROTO ((tree, tree, int));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));static tree build_unresolved_array_type PROTO ((tree));static tree build_array_from_name PROTO ((tree, tree, tree, tree *));static tree build_array_ref PROTO ((int, tree, tree));static tree patch_array_ref PROTO ((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 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 void check_deprecation PROTO ((tree, tree));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 add_stmt_to_block PROTO ((tree, tree, tree));static tree patch_exit_expr PROTO ((tree));static tree build_labeled_block PROTO ((int, tree));static tree finish_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 finish_loop_body PROTO ((int, tree, tree, int));static tree build_debugable_stmt PROTO ((int, tree));static tree finish_for_loop PROTO ((int, tree, tree, tree));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_try_statement PROTO ((int, tree, tree));static tree build_try_finally_statement PROTO ((int, tree, tree));static tree patch_try_statement PROTO ((tree));static tree patch_synchronized_statement PROTO ((tree, tree));static tree patch_throw_statement PROTO ((tree, tree));static void check_thrown_exceptions PROTO ((int, tree));static int check_thrown_exceptions_do PROTO ((tree));static void purge_unchecked_exceptions PROTO ((tree));static void check_throws_clauses PROTO ((tree, tree, tree));static void finish_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 int check_method_redefinition PROTO ((tree, tree));static int reset_method_name PROTO ((tree));static void java_check_regular_methods PROTO ((tree));static void java_check_abstract_methods PROTO ((tree));static tree maybe_build_primttype_type_ref PROTO ((tree, tree));static void unreachable_stmt_error PROTO ((tree));static tree find_expr_with_wfl PROTO ((tree));static void missing_return_error PROTO ((tree));static tree build_new_array_init PROTO ((int, tree));static tree patch_new_array_init PROTO ((tree, tree));static tree maybe_build_array_element_wfl PROTO ((tree));static int array_constructor_check_entry PROTO ((tree, tree));static char *purify_type_name PROTO ((char *));static tree fold_constant_for_init PROTO ((tree, tree));static tree strip_out_static_field_access_decl PROTO ((tree));static jdeplist *reverse_jdep_list PROTO ((struct parser_ctxt *));static void static_ref_err PROTO ((tree, tree, tree));/* Number of error found so far. */int java_error_count; /* Number of warning found so far. */int java_warning_count;/* Tell when not to fold, when doing xrefs */int do_not_fold;/* The current parser context */struct parser_ctxt *ctxp;/* List of things that were analyzed for which code will be generated */static struct parser_ctxt *ctxp_for_generation = NULL;/* binop_lookup maps token to tree_code. It is used where binary operations are involved and required by the parser. RDIV_EXPR covers both integral/floating point division. The code is changed once the type of both operator is worked out. */static enum tree_code binop_lookup[19] = { PLUS_EXPR, MINUS_EXPR, MULT_EXPR, RDIV_EXPR, TRUNC_MOD_EXPR, LSHIFT_EXPR, RSHIFT_EXPR, URSHIFT_EXPR, BIT_AND_EXPR, BIT_XOR_EXPR, BIT_IOR_EXPR, TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR, EQ_EXPR, NE_EXPR, GT_EXPR, GE_EXPR, LT_EXPR, LE_EXPR, };#define BINOP_LOOKUP(VALUE) \ binop_lookup [((VALUE) - PLUS_TK)% \ (sizeof (binop_lookup) / sizeof (binop_lookup[0]))]/* Fake WFL used to report error message. It is initialized once if needed and reused with it's location information is overriden. */tree wfl_operator = NULL_TREE;/* The "$L" identifier we use to create labels. */static tree label_id = NULL_TREE;/* The "StringBuffer" identifier used for the String `+' operator. */static tree wfl_string_buffer = NULL_TREE; /* The "append" identifier used for String `+' operator. */static tree wfl_append = NULL_TREE;/* The "toString" identifier used for String `+' operator. */static tree wfl_to_string = NULL_TREE;/* The "java.lang" import qualified name. */static tree java_lang_id = NULL_TREE;/* The "java.lang.Cloneable" qualified name. */static tree java_lang_cloneable = NULL_TREE;/* Context and flag for static blocks */static tree current_static_block = NULL_TREE;#line 304 "./parse.y"typedef union { tree node; int sub_token; struct { int token; int location; } operator; int value;} YYSTYPE;#line 314 "./parse.y"#include "lex.c"#ifndef YYDEBUG#define YYDEBUG 1#endif#include <stdio.h>#ifndef __cplusplus#ifndef __STDC__#define const#endif#endif#define YYFINAL 777#define YYFLAG -32768#define YYNTBASE 110#define YYTRANSLATE(x) ((unsigned)(x) <= 363 ? yytranslate[x] : 266)static const char yytranslate[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86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109};#if YYDEBUG != 0static const short yyprhs[] = { 0, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 38, 42, 46, 50, 54, 56, 58, 60, 64, 66, 67, 69, 71, 73, 76, 79, 82, 86, 88, 91, 93, 96, 100, 103, 107, 109, 111, 115, 118, 122, 128, 133, 139, 141, 143, 145, 147, 149, 152, 153, 161, 162, 169, 173, 176, 180, 185, 186, 189, 193, 196, 197, 200, 203, 205, 209, 213, 216, 220, 222, 225, 227, 229, 231, 233, 235, 238, 240, 242, 244, 248, 253,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -