亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? eval.c

?? RISC處理器仿真分析程序。可以用于研究通用RISC處理器的指令和架構設計。在linux下編譯
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * expr.c - expression evaluator routines * * This file is a part of the SimpleScalar tool suite written by * Todd M. Austin as a part of the Multiscalar Research Project. *   * The tool suite is currently maintained by Doug Burger and Todd M. Austin. *  * Copyright (C) 1994, 1995, 1996, 1997 by Todd M. Austin * * This source file is distributed "as is" in the hope that it will be * useful.  The tool set comes with no warranty, and no author or * distributor accepts any responsibility for the consequences of its * use.  *  * Everyone is granted permission to copy, modify and redistribute * this tool set under the following conditions: *  *    This source code is distributed for non-commercial use only.  *    Please contact the maintainer for restrictions applying to  *    commercial use. * *    Permission is granted to anyone to make or distribute copies *    of this source code, either as received or modified, in any *    medium, provided that all copyright notices, permission and *    nonwarranty notices are preserved, and that the distributor *    grants the recipient permission for further redistribution as *    permitted by this document. * *    Permission is granted to distribute this file in compiled *    or executable form under the same conditions that apply for *    source code, provided that either: * *    A. it is accompanied by the corresponding machine-readable *       source code, *    B. it is accompanied by a written offer, with no time limit, *       to give anyone a machine-readable copy of the corresponding *       source code in return for reimbursement of the cost of *       distribution.  This written offer must permit verbatim *       duplication by anyone, or *    C. it is distributed by someone who received only the *       executable form, and is accompanied by a copy of the *       written offer of source code that they received concurrently. * * In other words, you are welcome to use, share and improve this * source file.  You are forbidden to forbid anyone else to use, share * and improve what you give them. * * INTERNET: dburger@cs.wisc.edu * US Mail:  1210 W. Dayton Street, Madison, WI 53706 * * $Id: eval.c,v 1.1 1997/03/11 01:31:26 taustin Exp taustin $ * * $Log: eval.c,v $ * Revision 1.1  1997/03/11  01:31:26  taustin * Initial revision * * */#include <stdio.h>#include <stdlib.h>#include <ctype.h>#if defined(__CYGWIN32__)#include <errno.h>#endif#include "misc.h"#include "eval.h"#if defined(sparc) && !defined(__svr4__)#define strtoul strtol#endif /* sparc *//* expression evaluation error, this must be a global */enum eval_err_t eval_error = ERR_NOERR;/* enum eval_err_t -> error description string map */char *eval_err_str[ERR_NUM] = {  /* ERR_NOERR */	"!! no error!!",  /* ERR_UPAREN */	"unmatched parenthesis",  /* ERR_NOTERM */	"expression term is missing",  /* ERR_DIV0 */	"divide by zero",  /* ERR_BADCONST */	"badly formed constant",  /* ERR_BADEXPR */	"badly formed expression",  /* ERR_UNDEFVAR */	"variable is undefined",  /* ERR_EXTRA */	"extra characters at end of expression"};/* *first* token character -> enum eval_token_t map */static enum eval_token_t tok_map[256];static int tok_map_initialized = FALSE;/* builds the first token map */static voidinit_tok_map(void){  int i;  for (i=0; i<256; i++)    tok_map[i] = tok_invalid;  /* identifier characters */  for (i='a'; i<='z'; i++)    tok_map[i] = tok_ident;  for (i='A'; i<='Z'; i++)    tok_map[i] = tok_ident;  tok_map[(int)'_'] = tok_ident;  tok_map[(int)'$'] = tok_ident;  /* numeric characters */  for (i='0'; i<='9'; i++)    tok_map[i] = tok_const;  tok_map[(int)'.'] = tok_const;  /* operator characters */  tok_map[(int)'+'] = tok_plus;  tok_map[(int)'-'] = tok_minus;  tok_map[(int)'*'] = tok_mult;  tok_map[(int)'/'] = tok_div;  tok_map[(int)'('] = tok_oparen;  tok_map[(int)')'] = tok_cparen;  /* whitespace characers */  tok_map[(int)' '] = tok_whitespace;  tok_map[(int)'\t'] = tok_whitespace;}/* get next token from the expression string */static enum eval_token_t		/* token parsed */get_next_token(struct eval_state_t *es)	/* expression evaluator */{  int allow_hex;  enum eval_token_t tok;  char *ptok_buf, last_char;  /* initialize the token map, if needed */  if (!tok_map_initialized)    {      init_tok_map();      tok_map_initialized = TRUE;    }  /* use the peek'ed token, if available, tok_buf should still be valid */  if (es->peek_tok != tok_invalid)    {      tok = es->peek_tok;      es->peek_tok = tok_invalid;      return tok;    }  /* set up the token string space */  ptok_buf = es->tok_buf;  *ptok_buf = '\0';  /* skip whitespace */  while (*es->p && tok_map[(int)*es->p] == tok_whitespace)    es->p++;  /* end of token stream? */  if (*es->p == '\0')    return tok_eof;  *ptok_buf++ = *es->p;  tok = tok_map[(int)*es->p++];  switch (tok)    {    case tok_ident:      /* parse off next identifier */      while (*es->p	     && (tok_map[(int)*es->p] == tok_ident		 || tok_map[(int)*es->p] == tok_const))	{	  *ptok_buf++ = *es->p++;	}      break;    case tok_const:      /* parse off next numeric literal */      last_char = '\0';      allow_hex = FALSE;      while (*es->p &&	     (tok_map[(int)*es->p] == tok_const	      || (*es->p == '-' && last_char == 'e')	      || (*es->p == '+' && last_char == 'e')	      || tolower(*es->p) == 'e'	      || tolower(*es->p) == 'x'	      || (tolower(*es->p) == 'a' && allow_hex)	      || (tolower(*es->p) == 'b' && allow_hex)	      || (tolower(*es->p) == 'c' && allow_hex)	      || (tolower(*es->p) == 'd' && allow_hex)	      || (tolower(*es->p) == 'e' && allow_hex)	      || (tolower(*es->p) == 'f' && allow_hex)))	{	  last_char = tolower(*es->p);	  if (*es->p == 'x' || *es->p == 'X')	    allow_hex = TRUE;	  *ptok_buf++ = *es->p++;	}      break;    case tok_plus:    case tok_minus:    case tok_mult:    case tok_div:    case tok_oparen:    case tok_cparen:      /* just pass on the token */      break;    default:      tok = tok_invalid;      break;    }  /* terminate the token string buffer */  *ptok_buf = '\0';  return tok;}/* peek ahead at the next token from the expression stream, currently   only the next token can be peek'ed at */static enum eval_token_t		 /* next token in expression */peek_next_token(struct eval_state_t *es) /* expression evalutor */{  /* if there is no peek ahead token, get one */  if (es->peek_tok == tok_invalid)    {      es->lastp = es->p;      es->peek_tok = get_next_token(es);    }  /* return peek ahead token */  return es->peek_tok;}/* forward declaration */static struct eval_value_t expr(struct eval_state_t *es);/* default expression error value, eval_err is also set */static struct eval_value_t err_value = { et_int, { 0 } };/* expression type strings */char *eval_type_str[et_NUM] = {  /* et_int */		"int",  /* et_uint */		"unsigned int",  /* et_float */	"float",  /* et_double */	"double",  /* et_symbol */	"symbol"};/* determine necessary arithmetic conversion on T1 <op> T2 */static enum eval_type_t			/* type of expression result */result_type(enum eval_type_t t1,	/* left operand type */	    enum eval_type_t t2)	/* right operand type */{  /* sanity check, symbols should not show up in arithmetic exprs */  if (t1 == et_symbol || t2 == et_symbol)    panic("symbol used in expression");  /* using C rules, i.e., A6.5 */  if (t1 == et_double || t2 == et_double)    return et_double;  else if (t1 == et_float || t2 == et_float)    return et_float;  else if (t1 == et_uint || t2 == et_uint)    return et_uint;  else    return et_int;}/* * expression value arithmetic conversions *//* eval_value_t (any numeric type) -> double */doubleeval_as_double(struct eval_value_t val){  switch (val.type)    {    case et_double:      return val.value.as_double;    case et_float:      return (double)val.value.as_float;    case et_uint:      return (double)val.value.as_uint;    case et_int:      return (double)val.value.as_int;    case et_symbol:      panic("symbol used in expression");    default:      panic("illegal arithmetic expression conversion");    }}/* eval_value_t (any numeric type) -> float */floateval_as_float(struct eval_value_t val){  switch (val.type)    {    case et_double:      return (float)val.value.as_double;    case et_float:      return val.value.as_float;    case et_uint:      return (float)val.value.as_uint;    case et_int:      return (float)val.value.as_int;    case et_symbol:      panic("symbol used in expression");    default:      panic("illegal arithmetic expression conversion");    }}/* eval_value_t (any numeric type) -> unsigned int */unsigned inteval_as_uint(struct eval_value_t val){  switch (val.type)    {    case et_double:      return (unsigned int)val.value.as_double;    case et_float:      return (unsigned int)val.value.as_float;    case et_uint:      return val.value.as_uint;    case et_int:      return (unsigned int)val.value.as_int;    case et_symbol:      panic("symbol used in expression");    default:      panic("illegal arithmetic expression conversion");    }}/* eval_value_t (any numeric type) -> int */inteval_as_int(struct eval_value_t val){  switch (val.type)    {    case et_double:      return (int)val.value.as_double;    case et_float:      return (int)val.value.as_float;    case et_uint:      return (int)val.value.as_uint;    case et_int:      return val.value.as_int;    case et_symbol:      panic("symbol used in expression");    default:      panic("illegal arithmetic expression conversion");    }}/* * arithmetic intrinsics operations, used during expression evaluation *//* compute <val1> + <val2> */static struct eval_value_tf_add(struct eval_value_t val1, struct eval_value_t val2){  enum eval_type_t et;  struct eval_value_t val;  /* symbols are not allowed in arithmetic expressions */  if (val1.type == et_symbol || val2.type == et_symbol)    {      eval_error = ERR_BADEXPR;      return err_value;    }  /* get result type, and perform operation in that type */  et = result_type(val1.type, val2.type);  switch (et)    {    case et_double:      val.type = et_double;      val.value.as_double = eval_as_double(val1) + eval_as_double(val2);      break;    case et_float:      val.type = et_float;      val.value.as_float = eval_as_float(val1) + eval_as_float(val2);      break;    case et_uint:      val.type = et_uint;      val.value.as_uint = eval_as_uint(val1) + eval_as_uint(val2);      break;    case et_int:      val.type = et_int;      val.value.as_int = eval_as_int(val1) + eval_as_int(val2);      break;    default:      panic("bogus expression type");    }  return val;}/* compute <val1> - <val2> */static struct eval_value_tf_sub(struct eval_value_t val1, struct eval_value_t val2){  enum eval_type_t et;  struct eval_value_t val;  /* symbols are not allowed in arithmetic expressions */  if (val1.type == et_symbol || val2.type == et_symbol)    {      eval_error = ERR_BADEXPR;      return err_value;    }  /* get result type, and perform operation in that type */  et = result_type(val1.type, val2.type);  switch (et)    {    case et_double:      val.type = et_double;      val.value.as_double = eval_as_double(val1) - eval_as_double(val2);      break;    case et_float:      val.type = et_float;      val.value.as_float = eval_as_float(val1) - eval_as_float(val2);      break;    case et_uint:      val.type = et_uint;      val.value.as_uint = eval_as_uint(val1) - eval_as_uint(val2);      break;    case et_int:      val.type = et_int;      val.value.as_int = eval_as_int(val1) - eval_as_int(val2);      break;    default:      panic("bogus expression type");    }  return val;}/* compute <val1> * <val2> */static struct eval_value_tf_mult(struct eval_value_t val1, struct eval_value_t val2){  enum eval_type_t et;  struct eval_value_t val;  /* symbols are not allowed in arithmetic expressions */  if (val1.type == et_symbol || val2.type == et_symbol)    {      eval_error = ERR_BADEXPR;      return err_value;    }  /* get result type, and perform operation in that type */  et = result_type(val1.type, val2.type);  switch (et)    {    case et_double:      val.type = et_double;      val.value.as_double = eval_as_double(val1) * eval_as_double(val2);      break;    case et_float:      val.type = et_float;      val.value.as_float = eval_as_float(val1) * eval_as_float(val2);      break;    case et_uint:      val.type = et_uint;      val.value.as_uint = eval_as_uint(val1) * eval_as_uint(val2);      break;    case et_int:      val.type = et_int;      val.value.as_int = eval_as_int(val1) * eval_as_int(val2);      break;    default:      panic("bogus expression type");    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品伊人色| 免费在线观看不卡| 亚洲午夜久久久久| 亚洲国产精品久久人人爱| 欧美经典三级视频一区二区三区| 欧美日韩免费视频| 同产精品九九九| 国产成人综合自拍| 日韩亚洲欧美高清| 亚洲一区在线观看视频| 波多野结衣中文一区| 精品蜜桃在线看| 污片在线观看一区二区| 91视视频在线直接观看在线看网页在线看| 日韩精品一区二区三区swag| 亚洲一区二区在线免费观看视频| 国产高清在线精品| 日韩精品一区二区三区视频| 亚洲电影一区二区三区| 欧美性受xxxx黑人xyx| 自拍偷拍国产精品| 91视视频在线观看入口直接观看www| 久久久三级国产网站| 老司机免费视频一区二区| 欧美久久久久久久久久| 亚洲成a人片在线观看中文| 91麻豆国产精品久久| 亚洲欧洲av色图| 成人爽a毛片一区二区免费| 国产香蕉久久精品综合网| 韩国女主播一区| 久久伊人中文字幕| 国产美女久久久久| 国产欧美综合在线观看第十页| 国产一区二区三区最好精华液| 欧美一级理论性理论a| 日本成人中文字幕在线视频| 欧美一区2区视频在线观看| 日本亚洲免费观看| 日韩视频在线一区二区| 韩日av一区二区| 国产日产欧美一区二区三区| 成人黄页在线观看| 亚洲黄色av一区| 国产精品每日更新| 777色狠狠一区二区三区| 五月激情综合网| 91精品国产综合久久久蜜臀图片| 午夜久久久影院| 一区二区三区四区视频精品免费 | 丁香天五香天堂综合| 亚洲国产高清在线观看视频| 成人影视亚洲图片在线| 亚洲人成7777| 欧美高清视频不卡网| 久久激情五月婷婷| 国产精品女同一区二区三区| 91亚洲精品乱码久久久久久蜜桃| 亚洲综合视频网| 欧美videos大乳护士334| 福利一区二区在线观看| 一区二区不卡在线播放| 日韩免费看网站| 91丨porny丨国产入口| 亚洲18影院在线观看| 精品88久久久久88久久久| 成人av在线看| 全部av―极品视觉盛宴亚洲| 国产欧美日韩三级| 欧美日本精品一区二区三区| 国内一区二区在线| 亚洲精品国产品国语在线app| 欧美肥妇毛茸茸| 成人性视频网站| 日本欧洲一区二区| 亚洲三级小视频| 精品国产乱码久久久久久牛牛| 99久久国产免费看| 美女网站一区二区| 亚洲精品五月天| 久久婷婷综合激情| 欧美精品在欧美一区二区少妇| 丰满放荡岳乱妇91ww| 日韩精品一二区| 亚洲精品国产精品乱码不99| 久久久久久电影| 91精品国产乱| 欧美日精品一区视频| 成人激情小说网站| 国内精品国产三级国产a久久| 五月天一区二区三区| 国产精品久久久久永久免费观看| 欧美大度的电影原声| 欧美亚一区二区| 99r精品视频| 国产 日韩 欧美大片| 蜜臀va亚洲va欧美va天堂| 亚洲午夜免费电影| 亚洲丝袜美腿综合| 中文字幕一区二区三区四区不卡| 国产亚洲va综合人人澡精品| 日韩精品中文字幕在线一区| 欧美美女激情18p| 欧美怡红院视频| 色婷婷亚洲一区二区三区| zzijzzij亚洲日本少妇熟睡| 国产精品综合网| 国产精品中文有码| 国产一区二区影院| 国产一区二区网址| 国产一区二区三区高清播放| 精品制服美女久久| 韩国三级在线一区| 精品一区二区精品| 极品少妇xxxx偷拍精品少妇| 经典三级视频一区| 国产美女精品人人做人人爽 | 欧美理论在线播放| 欧美日韩一区在线| 717成人午夜免费福利电影| 欧美日韩黄色一区二区| 8v天堂国产在线一区二区| 91精品国产综合久久蜜臀| 欧美一区二区精品| 精品国产91九色蝌蚪| 国产婷婷色一区二区三区四区| 国产亚洲成av人在线观看导航| 欧美国产一区二区| 亚洲色图制服丝袜| 亚洲成人av电影在线| 免费不卡在线观看| 国产精品小仙女| 99精品视频在线观看| 欧美图区在线视频| 日韩视频不卡中文| 日本一区二区三区国色天香| 亚洲免费视频成人| 欧美aaaaaa午夜精品| 国产电影一区二区三区| 99久久国产综合精品女不卡| 欧美三级韩国三级日本三斤| 欧美成人aa大片| 国产精品国产自产拍在线| 亚洲主播在线播放| 激情欧美一区二区| 91视频在线观看| 日韩三级视频在线看| 国产精品无圣光一区二区| 亚洲va韩国va欧美va| 国产成人在线免费观看| 欧美伊人精品成人久久综合97| 日韩免费一区二区| 亚洲日韩欧美一区二区在线| 免费视频最近日韩| av成人动漫在线观看| 欧美一级日韩免费不卡| 欧美国产综合一区二区| 午夜精品aaa| 成人免费视频caoporn| 这里只有精品视频在线观看| 日本一区二区综合亚洲| 日本在线播放一区二区三区| 成人免费福利片| 日韩久久久久久| 亚洲一区二区三区四区在线免费观看 | 久久不见久久见中文字幕免费| av一区二区三区四区| 欧美成人伊人久久综合网| 亚洲一区二区av在线| 风间由美性色一区二区三区| 日韩一区二区电影| 亚洲成av人片在线观看无码| 成人app在线观看| 精品三级在线看| 亚洲超碰精品一区二区| 91香蕉国产在线观看软件| 久久亚洲一区二区三区明星换脸 | 国产在线精品一区二区不卡了| 韩国一区二区三区| 久久亚洲精品国产精品紫薇| 美女免费视频一区二区| 99国产精品国产精品久久| 欧美xxxxxxxx| 天天综合网 天天综合色| 91啦中文在线观看| 国产日韩亚洲欧美综合| 精品在线亚洲视频| 91精品国产一区二区人妖| 亚洲国产综合人成综合网站| 99re热这里只有精品视频| 国产欧美日韩精品在线| 国产精品99久久久久久有的能看| 666欧美在线视频| 天天综合色天天| 欧美日韩国产免费一区二区| 悠悠色在线精品| 日本韩国精品在线| 一区二区三区蜜桃| 欧美性色欧美a在线播放| 亚洲最快最全在线视频|