kgram.c

来自「一个很不错的程序切片工具,希望大家来讨论以下,对测试人员很有帮助」· C语言 代码 · 共 1,918 行 · 第 1/5 页

C
1,918 行
字号
# line 379 "kgram.y"{make_decl (yypvt[-0].token, FLAG_SC_EXTERN);} break;case 93:# line 381 "kgram.y"{make_decl (yypvt[-0].token, FLAG_SC_STATIC);} break;case 94:# line 383 "kgram.y"{make_decl (yypvt[-0].token, FLAG_SC_AUTO);} break;case 95:# line 385 "kgram.y"{make_decl (yypvt[-0].token, FLAG_SC_REGISTER);} break;case 96:# line 389 "kgram.y"{make_decl (yypvt[-0].token, FLAG_TYPE_CHAR);} break;case 97:# line 390 "kgram.y"{make_decl (yypvt[-0].token, FLAG_TYPE_SHORT);} break;case 98:# line 391 "kgram.y"{make_decl (yypvt[-0].token, FLAG_TYPE_INT);} break;case 99:# line 392 "kgram.y"{make_decl (yypvt[-0].token, FLAG_TYPE_LONG);} break;case 100:# line 393 "kgram.y"{make_decl (yypvt[-0].token, FLAG_TYPE_SIGNED);} break;case 101:# line 394 "kgram.y"{make_decl (yypvt[-0].token, FLAG_TYPE_UNSIGNED);} break;case 102:# line 395 "kgram.y"{make_decl (yypvt[-0].token, FLAG_TYPE_FLOAT);} break;case 103:# line 396 "kgram.y"{make_decl (yypvt[-0].token, FLAG_TYPE_DOUBLE);} break;case 104:# line 397 "kgram.y"{make_decl (yypvt[-0].token, FLAG_TYPE_VOID);} break;case 107:# line 400 "kgram.y"{make_decl (yypvt[-0].token, FLAG_TYPE_USER_NAME);} break;case 108:# line 405 "kgram.y"{			yypvt[-1].token->desc.decl->tag = yypvt[-0].token;			decl (yypvt[-1].token,(token_ptr)NULL,True);		} break;case 109:# line 410 "kgram.y"{			int		offset;			yypvt[-5].token->desc.decl->member_ste = struct_decl(yypvt[-1].token,&offset);			yypvt[-5].token->desc.decl->members = yypvt[-1].token;			yypvt[-5].token->desc.decl->offset = offset;		} break;case 110:# line 418 "kgram.y"{			int		offset;			yypvt[-3].token->desc.decl->members = yypvt[-1].token;			yypvt[-3].token->desc.decl->member_ste = struct_decl(yypvt[-1].token,&offset);			yypvt[-3].token->desc.decl->offset = offset;		} break;case 111:# line 426 "kgram.y"{			yypvt[-1].token->desc.decl->tag = yypvt[-0].token;		} break;case 112:# line 433 "kgram.y"{make_decl (yypvt[-0].token, FLAG_TYPE_US | FLAG_TYPE_STRUCT); } break;case 113:# line 435 "kgram.y"{make_decl (yypvt[-0].token, FLAG_TYPE_US | FLAG_TYPE_UNION); } break;case 115:# line 442 "kgram.y"{			token_ptr	t;			t = yypvt[-1].token;			if (t){				while (t->next) t = t->next;				t->next = yypvt[-0].token;			}			else yyval.token = yypvt[-0].token;		} break;case 118:# line 458 "kgram.y"{			yypvt[-1].token->desc.decl->decl_flags |= yypvt[-0].token->desc.decl->decl_flags;			if (yypvt[-1].token->desc.decl->tag == NULL)				yypvt[-1].token->desc.decl->tag = yypvt[-0].token->desc.decl->tag;			if (yypvt[-1].token->desc.decl->vars == NULL)				yypvt[-1].token->desc.decl->vars = yypvt[-0].token->desc.decl->vars;			if (yypvt[-1].token->desc.decl->members == NULL)				yypvt[-1].token->desc.decl->members = yypvt[-0].token->desc.decl->members;			if (yypvt[-1].token->desc.decl->member_ste == NULL)				yypvt[-1].token->desc.decl->member_ste = yypvt[-0].token->desc.decl->member_ste;		} break;case 119:# line 470 "kgram.y"{			yypvt[-1].token->desc.decl->decl_flags |= yypvt[-0].token->desc.decl->decl_flags;			if (yypvt[-1].token->desc.decl->tag == NULL)				yypvt[-1].token->desc.decl->tag = yypvt[-0].token->desc.decl->tag;			if (yypvt[-1].token->desc.decl->vars == NULL)				yypvt[-1].token->desc.decl->vars = yypvt[-0].token->desc.decl->vars;			if (yypvt[-1].token->desc.decl->members == NULL)				yypvt[-1].token->desc.decl->members = yypvt[-0].token->desc.decl->members;			if (yypvt[-1].token->desc.decl->member_ste == NULL)				yypvt[-1].token->desc.decl->member_ste = yypvt[-0].token->desc.decl->member_ste;		} break;case 120:# line 487 "kgram.y"{			yypvt[-2].token->desc.decl->vars = yypvt[-1].token;		} break;case 121:# line 491 "kgram.y"{			yypvt[-1].token->desc.decl->vars = NULL;		} break;case 123:# line 499 "kgram.y"{			token_ptr	t;/************************************************************                                                        **  Collect list of declarators                           **                                                        ************************************************************/			if (yypvt[-2].token){				t = yypvt[-2].token;				while (t->next) t = t->next;				t->next = yypvt[-0].token;			}			else yyval.token = yypvt[-0].token;		} break;case 125:# line 521 "kgram.y"{yyval.token = NULL;} break;case 127:# line 527 "kgram.y"{ make_decl (yypvt[-3].token, FLAG_TYPE_ENUM);yypvt[-3].token->desc.decl->members = yypvt[-1].token;} break;case 128:# line 529 "kgram.y"{ make_decl (yypvt[-4].token,FLAG_TYPE_ENUM);yypvt[-4].token->desc.decl->members = yypvt[-1].token;} break;case 129:# line 531 "kgram.y"{ make_decl (yypvt[-1].token,FLAG_TYPE_ENUM); yypvt[-1].token->desc.decl->members = NULL;} break;case 131:# line 537 "kgram.y"{			token_ptr	t;/************************************************************                                                        **  Collect list of enumerators                           **                                                        ************************************************************/			if (yypvt[-2].token){				t = yypvt[-2].token;				while (t->next) t = t->next;				t->next = yypvt[-0].token;			}			else yyval.token = yypvt[-0].token;		} break;case 136:# line 565 "kgram.y"{	int i;			for (i = 0; i < (int)yypvt[-1].token; i++)				modify_type (yypvt[-0].token,IS_PTR_TO,NO_STYLE,(token_ptr)NULL);			yyval.token = yypvt[-0].token;		} break;case 137:# line 573 "kgram.y"{ /*printf ("PARM(%d)\n",lineno);*/in_parms = 1;} break;case 139:# line 577 "kgram.y"{yyval.token = yypvt[-1].token;} break;case 140:# line 579 "kgram.y"{modify_type (yypvt[-2].token,IS_ARRAY_OF,NO_STYLE,(token_ptr)NULL);} break;case 141:# line 581 "kgram.y"{modify_type (yypvt[-3].token,IS_ARRAY_OF,NO_STYLE,(token_ptr)NULL);} break;case 142:# line 583 "kgram.y"{modify_type (yypvt[-3].token,IS_FUNC_RET,OLD_STYLE_VOID,(token_ptr)NULL);			in_parms = 0;} break;case 143:# line 586 "kgram.y"{modify_type (yypvt[-4].token,IS_FUNC_RET,NEW_STYLE,yypvt[-1].token); in_parms = 0;} break;case 144:# line 588 "kgram.y"{modify_type (yypvt[-4].token,IS_FUNC_RET,OLD_STYLE,yypvt[-1].token); in_parms = 0;} break;case 145:# line 593 "kgram.y"{yyval.token = (token_ptr)1;} break;case 146:# line 595 "kgram.y"{yyval.token = (token_ptr)1;} break;case 147:# line 597 "kgram.y"{yyval.token = (token_ptr)((int)yypvt[-0].token + 1);} break;case 148:# line 599 "kgram.y"{yyval.token = (token_ptr)((int)yypvt[-0].token + 1);} break;case 149:# line 603 "kgram.y"{make_decl (yypvt[-0].token, FLAG_TYPE_CONST);} break;case 150:# line 604 "kgram.y"{make_decl (yypvt[-0].token, FLAG_TYPE_VOLATILE);} break;case 155:# line 639 "kgram.y"{			token_ptr	t;			if (yypvt[-2].token){				t = yypvt[-2].token;				while (t->next) t = t->next;				t->next = yypvt[-0].token;			}			else yyval.token = yypvt[-0].token;		} break;case 159:# line 659 "kgram.y"{			token_ptr	t;			if (yypvt[-2].token){				t = yypvt[-2].token;				while (t->next) t = t->next;				t->next = yypvt[-0].token;			}			else yyval.token = yypvt[-0].token;		} break;case 160:# line 674 "kgram.y"{	/* : declaration_specifiers declarator */			yypvt[-1].token->desc.decl->vars = yypvt[-0].token;		} break;case 164:# line 697 "kgram.y"{			yypvt[-1].token->desc.type_desc = (type_ptr) yypvt[-0].token;		} break;case 165:# line 704 "kgram.y"{	int i;			type_ptr	old = NULL,new;			for (i = 0; i < (int)yypvt[-0].token; i++){				new = make_abstract_type (					IS_PTR_TO,NO_STYLE,(token_ptr)NULL);				if (!old) old = new;				else merge_abstract_type (old,new);			}			yyval.token = (token_ptr)old;		} break;case 167:# line 717 "kgram.y"{	int i;			type_ptr	old = NULL,new;			if (yypvt[-0].token) old = (type_ptr)yypvt[-0].token;			for (i = 0; i < (int)yypvt[-1].token; i++){				new = make_abstract_type (					IS_PTR_TO,NO_STYLE,(token_ptr)NULL);				if (!old) old = new;				else merge_abstract_type (old,new);			}			yyval.token = (token_ptr)old;		} break;case 168:# line 734 "kgram.y"{yyval.token = yypvt[-1].token;} break;case 169:# line 736 "kgram.y"{yyval.token = (token_ptr) make_abstract_type (IS_ARRAY_OF,NO_STYLE,NULL);} break;case 170:# line 738 "kgram.y"{yyval.token = (token_ptr) make_abstract_type (IS_ARRAY_OF,NO_STYLE,NULL);} break;case 171:# line 740 "kgram.y"{type_ptr	new;			new = make_abstract_type (IS_ARRAY_OF,NO_STYLE,NULL);			if (yypvt[-2].token){				merge_abstract_type (yypvt[-2].token,new);			}			else yyval.token = (token_ptr) new;		} break;case 172:# line 748 "kgram.y"{type_ptr	new;			new = make_abstract_type (IS_ARRAY_OF,NO_STYLE,NULL);			if (yypvt[-3].token){				merge_abstract_type (yypvt[-3].token,new);			}			else yyval.token = (token_ptr) new;		} break;case 173:# line 756 "kgram.y"{yyval.token = NULL;} break;case 174:# line 758 "kgram.y"{yyval.token = NULL;} break;case 177:# line 765 "kgram.y"{ yyval.token = NULL;} break;case 178:# line 767 "kgram.y"{yyval.token = NULL;} break;case 179:# line 769 "kgram.y"{yyval.token = NULL;} break;case 188:# line 788 "kgram.y"{yyval.stmt = stmt_label(yypvt[-2].token,yypvt[-0].stmt);} break;case 189:# line 790 "kgram.y"{yyval.stmt = case_stmt (yypvt[-3].token,yypvt[-1].token,yypvt[-0].stmt,False);} break;case 190:# line 792 "kgram.y"{yyval.stmt = case_stmt (yypvt[-2].token,yypvt[-1].token,yypvt[-0].stmt,True);} break;case 191:# line 797 "kgram.y"{			end_local_decl();		} break;case 192:# line 804 "kgram.y"{			open_scope();			start_local_decl();		} break;case 193:# line 812 "kgram.y"{yyval.stmt = brace_stmt (yypvt[-1].token,(token_ptr)NULL,yypvt[-0].token);} break;case 194:# line 814 "kgram.y"{yyval.stmt = brace_stmt (yypvt[-2].token,yypvt[-1].stmt,yypvt[-0].token);} break;case 195:# line 816 "kgram.y"{				close_scope();				yyval.stmt = brace_stmt (yypvt[-3].token,(token_ptr)NULL,yypvt[-0].token);			} break;case 196:# line 821 "kgram.y"{				close_scope();				yyval.stmt = brace_stmt (yypvt[-4].token,yypvt[-1].stmt,yypvt[-0].token);			} break;case 198:# line 830 "kgram.y"{			if (yypvt[-1].token){				yypvt[-1].token->next = yypvt[-0].token;			}			else yyval.token = yypvt[-0].token;		} break;case 200:# line 841 "kgram.y"{ yyval.stmt = join_stmt (yypvt[-1].stmt,yypvt[-0].stmt);} break;case 201:# line 846 "kgram.y"{			int		node;			node = get_stmt_no();			source_map (

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?