⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c-exp.tab.c

📁 早期freebsd实现
💻 C
📖 第 1 页 / 共 5 页
字号:
{ write_exp_elt_opcode(OP_TYPE);			  write_exp_elt_type(yypvt[-0].tval);			  write_exp_elt_opcode(OP_TYPE);} break;case 5:# line 224 "./c-exp.y"{ write_exp_elt_opcode (BINOP_COMMA); } break;case 6:# line 229 "./c-exp.y"{ write_exp_elt_opcode (UNOP_IND); } break;case 7:# line 232 "./c-exp.y"{ write_exp_elt_opcode (UNOP_ADDR); } break;case 8:# line 235 "./c-exp.y"{ write_exp_elt_opcode (UNOP_NEG); } break;case 9:# line 239 "./c-exp.y"{ write_exp_elt_opcode (UNOP_ZEROP); } break;case 10:# line 243 "./c-exp.y"{ write_exp_elt_opcode (UNOP_LOGNOT); } break;case 11:# line 247 "./c-exp.y"{ write_exp_elt_opcode (UNOP_PREINCREMENT); } break;case 12:# line 251 "./c-exp.y"{ write_exp_elt_opcode (UNOP_PREDECREMENT); } break;case 13:# line 255 "./c-exp.y"{ write_exp_elt_opcode (UNOP_POSTINCREMENT); } break;case 14:# line 259 "./c-exp.y"{ write_exp_elt_opcode (UNOP_POSTDECREMENT); } break;case 15:# line 263 "./c-exp.y"{ write_exp_elt_opcode (UNOP_SIZEOF); } break;case 16:# line 267 "./c-exp.y"{ write_exp_elt_opcode (STRUCTOP_PTR);			  write_exp_string (yypvt[-0].sval);			  write_exp_elt_opcode (STRUCTOP_PTR); } break;case 17:# line 273 "./c-exp.y"{ /* exp->type::name becomes exp->*(&type::name) */			  /* Note: this doesn't work if name is a			     static member!  FIXME */			  write_exp_elt_opcode (UNOP_ADDR);			  write_exp_elt_opcode (STRUCTOP_MPTR); } break;case 18:# line 280 "./c-exp.y"{ write_exp_elt_opcode (STRUCTOP_MPTR); } break;case 19:# line 284 "./c-exp.y"{ write_exp_elt_opcode (STRUCTOP_STRUCT);			  write_exp_string (yypvt[-0].sval);			  write_exp_elt_opcode (STRUCTOP_STRUCT); } break;case 20:# line 290 "./c-exp.y"{ /* exp.type::name becomes exp.*(&type::name) */			  /* Note: this doesn't work if name is a			     static member!  FIXME */			  write_exp_elt_opcode (UNOP_ADDR);			  write_exp_elt_opcode (STRUCTOP_MEMBER); } break;case 21:# line 298 "./c-exp.y"{ write_exp_elt_opcode (STRUCTOP_MEMBER); } break;case 22:# line 302 "./c-exp.y"{ write_exp_elt_opcode (BINOP_SUBSCRIPT); } break;case 23:# line 308 "./c-exp.y"{ start_arglist (); } break;case 24:# line 310 "./c-exp.y"{ write_exp_elt_opcode (OP_FUNCALL);			  write_exp_elt_longcst ((LONGEST) end_arglist ());			  write_exp_elt_opcode (OP_FUNCALL); } break;case 26:# line 319 "./c-exp.y"{ arglist_len = 1; } break;case 27:# line 323 "./c-exp.y"{ arglist_len++; } break;case 28:# line 327 "./c-exp.y"{ write_exp_elt_opcode (UNOP_MEMVAL);			  write_exp_elt_type (yypvt[-2].tval);			  write_exp_elt_opcode (UNOP_MEMVAL); } break;case 29:# line 333 "./c-exp.y"{ write_exp_elt_opcode (UNOP_CAST);			  write_exp_elt_type (yypvt[-2].tval);			  write_exp_elt_opcode (UNOP_CAST); } break;case 30:# line 339 "./c-exp.y"{ } break;case 31:# line 345 "./c-exp.y"{ write_exp_elt_opcode (BINOP_REPEAT); } break;case 32:# line 349 "./c-exp.y"{ write_exp_elt_opcode (BINOP_MUL); } break;case 33:# line 353 "./c-exp.y"{ write_exp_elt_opcode (BINOP_DIV); } break;case 34:# line 357 "./c-exp.y"{ write_exp_elt_opcode (BINOP_REM); } break;case 35:# line 361 "./c-exp.y"{ write_exp_elt_opcode (BINOP_ADD); } break;case 36:# line 365 "./c-exp.y"{ write_exp_elt_opcode (BINOP_SUB); } break;case 37:# line 369 "./c-exp.y"{ write_exp_elt_opcode (BINOP_LSH); } break;case 38:# line 373 "./c-exp.y"{ write_exp_elt_opcode (BINOP_RSH); } break;case 39:# line 377 "./c-exp.y"{ write_exp_elt_opcode (BINOP_EQUAL); } break;case 40:# line 381 "./c-exp.y"{ write_exp_elt_opcode (BINOP_NOTEQUAL); } break;case 41:# line 385 "./c-exp.y"{ write_exp_elt_opcode (BINOP_LEQ); } break;case 42:# line 389 "./c-exp.y"{ write_exp_elt_opcode (BINOP_GEQ); } break;case 43:# line 393 "./c-exp.y"{ write_exp_elt_opcode (BINOP_LESS); } break;case 44:# line 397 "./c-exp.y"{ write_exp_elt_opcode (BINOP_GTR); } break;case 45:# line 401 "./c-exp.y"{ write_exp_elt_opcode (BINOP_LOGAND); } break;case 46:# line 405 "./c-exp.y"{ write_exp_elt_opcode (BINOP_LOGXOR); } break;case 47:# line 409 "./c-exp.y"{ write_exp_elt_opcode (BINOP_LOGIOR); } break;case 48:# line 413 "./c-exp.y"{ write_exp_elt_opcode (BINOP_AND); } break;case 49:# line 417 "./c-exp.y"{ write_exp_elt_opcode (BINOP_OR); } break;case 50:# line 421 "./c-exp.y"{ write_exp_elt_opcode (TERNOP_COND); } break;case 51:# line 425 "./c-exp.y"{ write_exp_elt_opcode (BINOP_ASSIGN); } break;case 52:# line 429 "./c-exp.y"{ write_exp_elt_opcode (BINOP_ASSIGN_MODIFY);			  write_exp_elt_opcode (yypvt[-1].opcode);			  write_exp_elt_opcode (BINOP_ASSIGN_MODIFY); } break;case 53:# line 435 "./c-exp.y"{ write_exp_elt_opcode (OP_LONG);			  if (yypvt[-0].lval == (int) yypvt[-0].lval || yypvt[-0].lval == (unsigned int) yypvt[-0].lval)			    write_exp_elt_type (builtin_type_int);			  else			    write_exp_elt_type (BUILTIN_TYPE_LONGEST);			  write_exp_elt_longcst ((LONGEST) yypvt[-0].lval);			  write_exp_elt_opcode (OP_LONG); } break;case 54:# line 445 "./c-exp.y"{ YYSTYPE val;			  parse_number (yypvt[-0].ssym.stoken.ptr, yypvt[-0].ssym.stoken.length, 0, &val);			  write_exp_elt_opcode (OP_LONG);			  if (val.lval == (int) val.lval ||			      val.lval == (unsigned int) val.lval)			    write_exp_elt_type (builtin_type_int);			  else			    write_exp_elt_type (BUILTIN_TYPE_LONGEST);			  write_exp_elt_longcst (val.lval);			  write_exp_elt_opcode (OP_LONG); } break;case 55:# line 458 "./c-exp.y"{			  write_exp_elt_opcode (OP_LONG);			  if (yypvt[-0].ulval == (unsigned int) yypvt[-0].ulval)			    write_exp_elt_type (builtin_type_unsigned_int);			  else			    write_exp_elt_type (BUILTIN_TYPE_UNSIGNED_LONGEST);			  write_exp_elt_longcst ((LONGEST) yypvt[-0].ulval);			  write_exp_elt_opcode (OP_LONG);			} break;case 56:# line 470 "./c-exp.y"{ YYSTYPE val;			  parse_number (yypvt[-0].ssym.stoken.ptr, yypvt[-0].ssym.stoken.length, 0, &val);			  write_exp_elt_opcode (OP_LONG);			  if (val.ulval == (unsigned int) val.ulval)			    write_exp_elt_type (builtin_type_unsigned_int);			  else			    write_exp_elt_type (BUILTIN_TYPE_UNSIGNED_LONGEST);			  write_exp_elt_longcst ((LONGEST)val.ulval);			  write_exp_elt_opcode (OP_LONG);			} break;case 57:# line 483 "./c-exp.y"{ write_exp_elt_opcode (OP_LONG);			  write_exp_elt_type (builtin_type_char);			  write_exp_elt_longcst ((LONGEST) yypvt[-0].lval);			  write_exp_elt_opcode (OP_LONG); } break;case 58:# line 490 "./c-exp.y"{ write_exp_elt_opcode (OP_DOUBLE);			  write_exp_elt_type (builtin_type_double);			  write_exp_elt_dblcst (yypvt[-0].dval);			  write_exp_elt_opcode (OP_DOUBLE); } break;case 60:# line 500 "./c-exp.y"{ write_exp_elt_opcode (OP_LAST);			  write_exp_elt_longcst ((LONGEST) yypvt[-0].lval);			  write_exp_elt_opcode (OP_LAST); } break;case 61:# line 506 "./c-exp.y"{ write_exp_elt_opcode (OP_REGISTER);			  write_exp_elt_longcst ((LONGEST) yypvt[-0].lval);			  write_exp_elt_opcode (OP_REGISTER); } break;case 62:# line 512 "./c-exp.y"{ write_exp_elt_opcode (OP_INTERNALVAR);			  write_exp_elt_intern (yypvt[-0].ivar);			  write_exp_elt_opcode (OP_INTERNALVAR); } break;case 63:# line 518 "./c-exp.y"{ write_exp_elt_opcode (OP_LONG);			  write_exp_elt_type (builtin_type_int);			  write_exp_elt_longcst ((LONGEST) TYPE_LENGTH (yypvt[-1].tval));			  write_exp_elt_opcode (OP_LONG); } break;case 64:# line 525 "./c-exp.y"{ write_exp_elt_opcode (OP_STRING);			  write_exp_string (yypvt[-0].sval);			  write_exp_elt_opcode (OP_STRING); } break;case 65:# line 532 "./c-exp.y"{ write_exp_elt_opcode (OP_THIS);			  write_exp_elt_opcode (OP_THIS); } break;case 66:# line 539 "./c-exp.y"{			  if (yypvt[-0].ssym.sym != 0)			      yyval.bval = SYMBOL_BLOCK_VALUE (yypvt[-0].ssym.sym);			  else			    {			      struct symtab *tem =				  lookup_symtab (copy_name (yypvt[-0].ssym.stoken));			      if (tem)				yyval.bval = BLOCKVECTOR_BLOCK					 (BLOCKVECTOR (tem), STATIC_BLOCK);			      else				error ("No file or function \"%s\".",				       copy_name (yypvt[-0].ssym.stoken));			    }			} break;case 67:# line 557 "./c-exp.y"{ struct symbol *tem			    = lookup_symbol (copy_name (yypvt[-0].sval), yypvt[-2].bval,					     VAR_NAMESPACE, 0, NULL);			  if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)			    error ("No function \"%s\" in specified context.",				   copy_name (yypvt[-0].sval));			  yyval.bval = SYMBOL_BLOCK_VALUE (tem); } break;case 68:# line 567 "./c-exp.y"{ struct symbol *sym;			  sym = lookup_symbol (copy_name (yypvt[-0].sval), yypvt[-2].bval,					       VAR_NAMESPACE, 0, NULL);			  if (sym == 0)			    error ("No symbol \"%s\" in specified context.",				   copy_name (yypvt[-0].sval));			  write_exp_elt_opcode (OP_VAR_VALUE);			  write_exp_elt_sym (sym);			  write_exp_elt_opcode (OP_VAR_VALUE); } break;case 69:# line 580 "./c-exp.y"{			  struct type *type = yypvt[-2].tval;			  if (TYPE_CODE (type) != TYPE_CODE_STRUCT			      && TYPE_CODE (type) != TYPE_CODE_UNION)			    error ("`%s' is not defined as an aggregate type.",				   TYPE_NAME (type));			  write_exp_elt_opcode (OP_SCOPE);			  write_exp_elt_type (type);			  write_exp_string (yypvt[-0].sval);			  write_exp_elt_opcode (OP_SCOPE);			} break;case 70:# line 593 "./c-exp.y"{			  struct type *type = yypvt[-3].tval;			  struct stoken tmp_token;			  if (TYPE_CODE (type) != TYPE_CODE_STRUCT			      && TYPE_CODE (type) != TYPE_CODE_UNION)			    error ("`%s' is not defined as an aggregate type.",				   TYPE_NAME (type));			  if (strcmp (type_name_no_tag (type), yypvt[-0].sval.ptr))			    error ("invalid destructor `%s::~%s'",				   type_name_no_tag (type), yypvt[-0].sval.ptr);			  tmp_token.ptr = (char*) alloca (yypvt[-0].sval.length + 2);			  tmp_token.length = yypvt[-0].sval.length + 1;			  tmp_token.ptr[0] = '~';			  memcpy (tmp_token.ptr+1, yypvt[-0].sval.ptr, yypvt[-0].sval.length);			  tmp_token.ptr[tmp_token.length] = 0;			  write_exp_elt_opcode (OP_SCOPE);			  write_exp_elt_type (type);			  write_exp_string (tmp_token);			  write_exp_elt_opcode (OP_SCOPE);			} break;case 72:# line 619 "./c-exp.y"{			  char *name = copy_name (yypvt[-0].sval);			  struct symbol *sym;			  struct minimal_symbol *msymbol;			  sym =			    lookup_symbol (name, 0, VAR_NAMESPACE, 0, NULL);			  if (sym)			    {			      write_exp_elt_opcode (OP_VAR_VALUE);			      write_exp_elt_sym (sym);			      write_exp_elt_opcode (OP_VAR_VALUE);			      break;			    }			  msymbol = lookup_minimal_symbol (name,				      (struct objfile *) NULL);			  if (msymbol != NULL)			    {			      write_exp_elt_opcode (OP_LONG);			      write_exp_elt_type (builtin_type_int);			      write_exp_elt_longcst ((LONGEST) msymbol -> address);			      write_exp_elt_opcode (OP_LONG);			      write_exp_elt_opcode (UNOP_MEMVAL);			      if (msymbol -> type == mst_data ||				  msymbol -> type == mst_bss)				write_exp_elt_type (builtin_type_int);			      else if (msymbol -> type == mst_text)				write_exp_elt_type (lookup_function_type (builtin_type_int));			      else				write_exp_elt_type (builtin_type_char);			      write_exp_elt_opcode (UNOP_MEMVAL);			    }			  else			    if (!have_full_symbols () && !have_partial_symbols ())			      error ("No symbol table is loaded.  Use the \"file\" command.");			    else			      error ("No symbol \"%s\" in current context.", name);			} break;case 73:# line 661 "./c-exp.y"{ struct symbol *sym = yypvt[-0].ssym.sym;			  if (sym)			    {			      switch (SYMBOL_CLASS (sym))				{				case LOC_REGISTER:				case LOC_ARG:				case LOC_REF_ARG:				case LOC_REGPARM:				case LOC_LOCAL:				case LOC_LOCAL_ARG:				  if (innermost_block == 0 ||				      contained_in (block_found, 						    innermost_block))				    innermost_block = block_found;				case LOC_UNDEF:				case LOC_CONST:				case LOC_STATIC:				case LOC_TYPEDEF:				case LOC_LABEL:				case LOC_BLOCK:				case LOC_CONST_BYTES:				  /* In this case the expression can				     be evaluated regardless of what				     frame we are in, so there is no				     need to check for the				     innermost_block.  These cases are				     listed so that gcc -Wall will				     report types that may not have				     been considered.  */				  break;				}			      write_exp_elt_opcode (OP_VAR_VALUE);			      write_exp_elt_sym (sym);			      write_exp_elt_opcode (OP_VAR_VALUE);			    }			  else if (yypvt[-0].ssym.is_a_field_of_this)			    {			      /* C++: it hangs off of `this'.  Must			         not inadvertently convert from a method call				 to data ref.  */			      if (innermost_block == 0 || 				  contained_in (block_found, innermost_block))				innermost_block = block_found;			      write_exp_elt_opcode (OP_THIS);			      write_exp_elt_opcode (OP_THIS);			      write_exp_elt_opcode (STRUCTOP_PTR);			      write_exp_string (yypvt[-0].ssym.stoken);			      write_exp_elt_opcode (STRUCTOP_PTR);			    }			  else			    {			      struct minimal_symbol *msymbol;			      register char *arg = copy_name (yypvt[-0].ssym.stoken);			      msymbol = lookup_minimal_symbol (arg,					  (struct objfile *) NULL);			      if (msymbol != NULL)				{				  write_exp_elt_opcode (OP_LONG);				  write_exp_elt_type (builtin_type_int);				  write_exp_elt_longcst ((LONGEST) msymbol -> address);				  write_exp_elt_opcode (OP_LONG);				  write_exp_elt_opcode (UNOP_MEMVAL);				  if (msymbol -> type == mst_data ||				      msymbol -> type == mst_bss)				    write_exp_elt_type (builtin_type_int);				  else if (msymbol -> type == mst_

⌨️ 快捷键说明

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