📄 gcc2.9.txt
字号:
if ($$ != error_mark_node) C_SET_EXP_ORIGINAL_CODE ($$, MODIFY_EXPR); } | expr_no_commas ASSIGN expr_no_commas { $$ = build_x_modify_expr ($$, $2, $3); } | THROW { $$ = build_throw (NULL_TREE); } | THROW expr_no_commas { $$ = build_throw ($2); }/* These extensions are not defined. The second arg to build_m_component_ref is old, build_m_component_ref now does an implicit build_indirect_ref (x, NULL_PTR) on the second argument. | object '&' expr_no_commas %prec UNARY { $$ = build_m_component_ref ($$, build_x_unary_op (ADDR_EXPR, $3)); } | object unop expr_no_commas %prec UNARY { $$ = build_m_component_ref ($$, build_x_unary_op ($2, $3)); } | object '(' type_id ')' expr_no_commas %prec UNARY { tree type = groktypename ($3.t); $$ = build_m_component_ref ($$, build_c_cast (type, $5)); } | object primary_no_id %prec UNARY { $$ = build_m_component_ref ($$, $2); }*/ ;notype_unqualified_id: '~' see_typename identifier { $$ = build_parse_node (BIT_NOT_EXPR, $3); } | '~' see_typename template_type { $$ = build_parse_node (BIT_NOT_EXPR, $3); } | template_id | operator_name | IDENTIFIER | PTYPENAME | NSNAME %prec EMPTY ;do_id: { /* If lastiddecl is a TREE_LIST, it's a baselink, which means that we're in an expression like S::f<int>, so don't do_identifier; we only do that for unqualified identifiers. */ if (lastiddecl && TREE_CODE (lastiddecl) != TREE_LIST) $$ = do_identifier ($<ttype>-1, 1, NULL_TREE); else $$ = $<ttype>-1; } ; template_id: PFUNCNAME '<' do_id template_arg_list_opt template_close_bracket { $$ = lookup_template_function ($3, $4); } | operator_name '<' do_id template_arg_list_opt template_close_bracket { $$ = lookup_template_function ($3, $4); } ;object_template_id: TEMPLATE identifier '<' template_arg_list_opt template_close_bracket { $$ = lookup_template_function ($2, $4); } | TEMPLATE PFUNCNAME '<' template_arg_list_opt template_close_bracket { $$ = lookup_template_function ($2, $4); } | TEMPLATE operator_name '<' template_arg_list_opt template_close_bracket { $$ = lookup_template_function ($2, $4); } ;unqualified_id: notype_unqualified_id | TYPENAME | SELFNAME ;expr_or_declarator_intern: expr_or_declarator | attributes expr_or_declarator { /* Provide support for '(' attributes '*' declarator ')' etc */ $$ = decl_tree_cons ($1, $2, NULL_TREE); } ;expr_or_declarator: notype_unqualified_id | '*' expr_or_declarator_intern %prec UNARY { $$ = build_parse_node (INDIRECT_REF, $2); } | '&' expr_or_declarator_intern %prec UNARY { $$ = build_parse_node (ADDR_EXPR, $2); } | '(' expr_or_declarator_intern ')' { $$ = $2; } ;notype_template_declarator: IDENTIFIER '<' template_arg_list_opt template_close_bracket { $$ = lookup_template_function ($1, $3); } | NSNAME '<' template_arg_list template_close_bracket { $$ = lookup_template_function ($1, $3); } ; direct_notype_declarator: complex_direct_notype_declarator /* This precedence declaration is to prefer this reduce to the Koenig lookup shift in primary, below. I hate yacc. */ | notype_unqualified_id %prec '(' | notype_template_declarator | '(' expr_or_declarator_intern ')' { $$ = finish_decl_parsing ($2); } ;primary: notype_unqualified_id { if (TREE_CODE ($1) == BIT_NOT_EXPR) $$ = build_x_unary_op (BIT_NOT_EXPR, TREE_OPERAND ($1, 0)); else $$ = finish_id_expr ($1); } | CONSTANT | boolean.literal | string { if (processing_template_decl) push_obstacks (&permanent_obstack, &permanent_obstack); $$ = combine_strings ($$); /* combine_strings doesn't set up TYPE_MAIN_VARIANT of a const array the way we want, so fix it. */ if (flag_const_strings) TREE_TYPE ($$) = build_cplus_array_type (TREE_TYPE (TREE_TYPE ($$)), TYPE_DOMAIN (TREE_TYPE ($$))); if (processing_template_decl) pop_obstacks (); } | '(' expr ')' { $$ = finish_parenthesized_expr ($2); } | '(' expr_or_declarator_intern ')' { $2 = reparse_decl_as_expr (NULL_TREE, $2); $$ = finish_parenthesized_expr ($2); } | '(' error ')' { $$ = error_mark_node; } | '(' { tree scope = current_scope (); if (!scope || TREE_CODE (scope) != FUNCTION_DECL) { error ("braced-group within expression allowed only inside a function"); YYERROR; } if (pedantic) pedwarn ("ANSI C++ forbids braced-groups within expressions"); $<ttype>$ = begin_stmt_expr (); } compstmt ')' { $$ = finish_stmt_expr ($<ttype>2, $3); } /* Koenig lookup support We could store lastiddecl in $1 to avoid another lookup, but that would result in many additional reduce/reduce conflicts. */ | notype_unqualified_id '(' nonnull_exprlist ')' { $$ = finish_call_expr ($1, $3, 1); } | notype_unqualified_id LEFT_RIGHT { $$ = finish_call_expr ($1, NULL_TREE, 1); } | primary '(' nonnull_exprlist ')' { $$ = finish_call_expr ($1, $3, 0); } | primary LEFT_RIGHT { $$ = finish_call_expr ($1, NULL_TREE, 0); } | primary '[' expr ']' { $$ = grok_array_decl ($$, $3); } | primary PLUSPLUS { $$ = finish_increment_expr ($1, POSTINCREMENT_EXPR); } | primary MINUSMINUS { $$ = finish_increment_expr ($1, POSTDECREMENT_EXPR); } /* C++ extensions */ | THIS { $$ = finish_this_expr (); } | CV_QUALIFIER '(' nonnull_exprlist ')' { /* This is a C cast in C++'s `functional' notation using the "implicit int" extension so that: `const (3)' is equivalent to `const int (3)'. */ tree type; if ($3 == error_mark_node) { $$ = error_mark_node; break; } type = cp_build_qualified_type (integer_type_node, cp_type_qual_from_rid ($1)); $$ = build_c_cast (type, build_compound_expr ($3)); } | functional_cast | DYNAMIC_CAST '<' type_id '>' '(' expr ')' { tree type = groktypename ($3.t); check_for_new_type ("dynamic_cast", $3); $$ = build_dynamic_cast (type, $6); } | STATIC_CAST '<' type_id '>' '(' expr ')' { tree type = groktypename ($3.t); check_for_new_type ("static_cast", $3); $$ = build_static_cast (type, $6); } | REINTERPRET_CAST '<' type_id '>' '(' expr ')' { tree type = groktypename ($3.t); check_for_new_type ("reinterpret_cast", $3); $$ = build_reinterpret_cast (type, $6); } | CONST_CAST '<' type_id '>' '(' expr ')' { tree type = groktypename ($3.t); check_for_new_type ("const_cast", $3); $$ = build_const_cast (type, $6); } | TYPEID '(' expr ')' { $$ = build_x_typeid ($3); } | TYPEID '(' type_id ')' { tree type = groktypename ($3.t); check_for_new_type ("typeid", $3); $$ = get_typeid (TYPE_MAIN_VARIANT (type)); } | global_scope IDENTIFIER { $$ = do_scoped_id ($2, 1); } | global_scope template_id { $$ = $2; } | global_scope operator_name { got_scope = NULL_TREE; if (TREE_CODE ($2) == IDENTIFIER_NODE) $$ = do_scoped_id ($2, 1); else $$ = $2; } | overqualified_id %prec HYPERUNARY { $$ = build_offset_ref (OP0 ($$), OP1 ($$)); } | overqualified_id '(' nonnull_exprlist ')' { $$ = finish_qualified_call_expr ($1, $3); } | overqualified_id LEFT_RIGHT { $$ = finish_qualified_call_expr ($1, NULL_TREE); } | object object_template_id %prec UNARY { $$ = build_x_component_ref ($$, $2, NULL_TREE, 1); } | object object_template_id '(' nonnull_exprlist ')' { $$ = finish_object_call_expr ($2, $1, $4); } | object object_template_id LEFT_RIGHT { $$ = finish_object_call_expr ($2, $1, NULL_TREE); } | object unqualified_id %prec UNARY { $$ = build_x_component_ref ($$, $2, NULL_TREE, 1); } | object overqualified_id %prec UNARY { if (processing_template_decl) $$ = build_min_nt (COMPONENT_REF, $1, copy_to_permanent ($2)); else $$ = build_object_ref ($$, OP0 ($2), OP1 ($2)); } | object unqualified_id '(' nonnull_exprlist ')' { $$ = finish_object_call_expr ($2, $1, $4); } | object unqualified_id LEFT_RIGHT { $$ = finish_object_call_expr ($2, $1, NULL_TREE); } | object overqualified_id '(' nonnull_exprlist ')' { $$ = finish_qualified_object_call_expr ($2, $1, $4); } | object overqualified_id LEFT_RIGHT { $$ = finish_qualified_object_call_expr ($2, $1, NULL_TREE); } /* p->int::~int() is valid -- 12.4 */ | object '~' TYPESPEC LEFT_RIGHT { $$ = finish_pseudo_destructor_call_expr ($1, NULL_TREE, $3); } | object TYPESPEC SCOPE '~' TYPESPEC LEFT_RIGHT { $$ = finish_pseudo_destructor_call_expr ($1, $2, $5); } | object error { $$ = error_mark_node; } ;/* Not needed for now.primary_no_id: '(' expr ')' { $$ = $2; } | '(' error ')' { $$ = error_mark_node; } | '(' { if (current_function_decl == 0) { error ("braced-group within expression allowed only inside a function"); YYERROR; } $<ttype>$ = expand_start_stmt_expr (); } compstmt ')' { if (pedantic) pedwarn ("ANSI C++ forbids braced-groups within expressions"); $$ = expand_end_stmt_expr ($<ttype>2); } | primary_no_id '(' nonnull_exprlist ')' { $$ = build_x_function_call ($$, $3, current_class_ref); } | primary_no_id LEFT_RIGHT { $$ = build_x_function_call ($$, NULL_TREE, current_class_ref); } | primary_no_id '[' expr ']' { goto do_array; } | primary_no_id PLUSPLUS { $$ = build_x_unary_op (POSTINCREMENT_EXPR, $$); } | primary_no_id MINUSMINUS { $$ = build_x_unary_op (POSTDECREMENT_EXPR, $$); } | SCOPE IDENTIFIER { goto do_scoped_id; } | SCOPE operator_name { if (TREE_CODE ($2) == IDENTIFIER_NODE) goto do_scoped_id; goto do_scoped_operator; } ;*/new: NEW { $$ = 0; } | global_scope NEW { got_scope = NULL_TREE; $$ = 1; } ;delete: DELETE { $$ = 0; } | global_scope delete { got_scope = NULL_TREE; $$ = 1; } ;boolean.literal: CXX_TRUE { $$ = boolean_true_node; } | CXX_FALSE { $$ = boolean_false_node; } ;/* Produces a STRING_CST with perhaps more STRING_CSTs chained onto it. */string: STRING | string STRING { $$ = chainon ($$, $2); } ;nodecls: /* empty */ { if (! current_function_parms_stored) store_parm_decls (); setup_vtbl_ptr (); /* Always keep the BLOCK node associated with the outermost pair of curley braces of a function. These are needed for correct operation of dwarfout.c. */ keep_next_level (); } ;object: primary '.' { got_object = TREE_TYPE ($$); } | primary POINTSAT { $$ = build_x_arrow ($$); got_object = TREE_TYPE ($$); } ;decl: typespec initdecls ';' { resume_momentary ($2); if ($1.t && IS_AGGR_TYPE_CODE (TREE_CODE ($1.t))) note_got_semicolon ($1.t); } | typed_declspecs initdecls ';' { resume_momentary ($2); note_list_got_semicolon ($1.t); } | declmods notype_initdecls ';' { resume_momentary ($2); } | typed_declspecs ';' { shadow_tag ($1.t); note_list_got_semicolon ($1.t); } | declmods ';' { warning ("empty declaration"); } | extension decl { pedantic = $<itype>1; } ;/* Any kind of declarator (thus, all declarators allowed after an explicit typespec). */declarator: after_type_declarator %prec EMPTY | notype_declarator %prec EMPTY ;/* This is necessary to postpone reduction of `int()()()()'. */fcast_or_absdcl: LEFT_RIGHT %prec EMPTY { $$ = make_call_declarator (NULL_TREE, empty_parms (), NULL_TREE, NULL_TREE); } | fcast_or_absdcl LEFT_RIGHT %prec EMPTY { $$ = make_call_declarator ($$, empty_parms (), NULL_TREE, NULL_TREE); } ;/* ANSI type-id (8.1) */type_id: typed_typespecs absdcl { $$.t = build_decl_list ($1.t, $2); $$.new_type_flag = $1.new_type_flag; } | nonempty_cv_qualifiers absdcl { $$.t = build_decl_list ($1.t, $2); $$.new_type_flag = $1.new_type_flag; } | typespec absdcl { $$.t = build_decl_list (build_decl_list (NULL_TREE, $1.t), $2); $$.new_type_flag = $1.new_type_flag; } | typed_typespecs %prec EMPTY { $$.t = build_decl_list ($1.t, NULL_TREE); $$.new_type_flag = $1.new_type_flag; } | nonempty_cv_qualifiers %prec EMPTY { $$.t = build_decl_list ($1.t, NULL_TREE); $$.new_type_flag = $1.new_type_flag; } ;/* Declspecs which contain at least one type specifier or typedef name. (Just `const' or `volatile' is not enough.) A typedef'd name following these is taken as a name to be declared. In the result, declspecs have a non-NULL TREE_VALUE, attributes do not. */typed_declspecs: typed_typespecs %prec EMPTY | typed_declspecs1 ;typed_declspecs1: declmods typespec { $$.t = decl_tree_cons (NULL_TREE, $2.t, $1); $$.new_type_flag = $2.new_type_flag; } | typespec reserved_declspecs %prec HYPERUNARY { $$.t = decl_tree_cons (NULL_TREE, $1.t, $2); $$.new_type_flag = $1.new_type_flag; } | typespec reserved_typespecquals reserved_declspecs
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -