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

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

?? lemon.c

?? 新版輕量級嵌入式數據庫
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* Free all memory associated with the given acttab */void acttab_free(acttab *p){  free( p->aAction );  free( p->aLookahead );  free( p );}/* Allocate a new acttab structure */acttab *acttab_alloc(void){  acttab *p = malloc( sizeof(*p) );  if( p==0 ){    fprintf(stderr,"Unable to allocate memory for a new acttab.");    exit(1);  }  memset(p, 0, sizeof(*p));  return p;}/* Add a new action to the current transaction set*/void acttab_action(acttab *p, int lookahead, int action){  if( p->nLookahead>=p->nLookaheadAlloc ){    p->nLookaheadAlloc += 25;    p->aLookahead = realloc( p->aLookahead,                             sizeof(p->aLookahead[0])*p->nLookaheadAlloc );    if( p->aLookahead==0 ){      fprintf(stderr,"malloc failed\n");      exit(1);    }  }  if( p->nLookahead==0 ){    p->mxLookahead = lookahead;    p->mnLookahead = lookahead;    p->mnAction = action;  }else{    if( p->mxLookahead<lookahead ) p->mxLookahead = lookahead;    if( p->mnLookahead>lookahead ){      p->mnLookahead = lookahead;      p->mnAction = action;    }  }  p->aLookahead[p->nLookahead].lookahead = lookahead;  p->aLookahead[p->nLookahead].action = action;  p->nLookahead++;}/*** Add the transaction set built up with prior calls to acttab_action()** into the current action table.  Then reset the transaction set back** to an empty set in preparation for a new round of acttab_action() calls.**** Return the offset into the action table of the new transaction.*/int acttab_insert(acttab *p){  int i, j, k, n;  assert( p->nLookahead>0 );  /* Make sure we have enough space to hold the expanded action table  ** in the worst case.  The worst case occurs if the transaction set  ** must be appended to the current action table  */  n = p->mxLookahead + 1;  if( p->nAction + n >= p->nActionAlloc ){    int oldAlloc = p->nActionAlloc;    p->nActionAlloc = p->nAction + n + p->nActionAlloc + 20;    p->aAction = realloc( p->aAction,                          sizeof(p->aAction[0])*p->nActionAlloc);    if( p->aAction==0 ){      fprintf(stderr,"malloc failed\n");      exit(1);    }    for(i=oldAlloc; i<p->nActionAlloc; i++){      p->aAction[i].lookahead = -1;      p->aAction[i].action = -1;    }  }  /* Scan the existing action table looking for an offset where we can  ** insert the current transaction set.  Fall out of the loop when that  ** offset is found.  In the worst case, we fall out of the loop when  ** i reaches p->nAction, which means we append the new transaction set.  **  ** i is the index in p->aAction[] where p->mnLookahead is inserted.  */  for(i=0; i<p->nAction+p->mnLookahead; i++){    if( p->aAction[i].lookahead<0 ){      for(j=0; j<p->nLookahead; j++){        k = p->aLookahead[j].lookahead - p->mnLookahead + i;        if( k<0 ) break;        if( p->aAction[k].lookahead>=0 ) break;      }      if( j<p->nLookahead ) continue;      for(j=0; j<p->nAction; j++){        if( p->aAction[j].lookahead==j+p->mnLookahead-i ) break;      }      if( j==p->nAction ){        break;  /* Fits in empty slots */      }    }else if( p->aAction[i].lookahead==p->mnLookahead ){      if( p->aAction[i].action!=p->mnAction ) continue;      for(j=0; j<p->nLookahead; j++){        k = p->aLookahead[j].lookahead - p->mnLookahead + i;        if( k<0 || k>=p->nAction ) break;        if( p->aLookahead[j].lookahead!=p->aAction[k].lookahead ) break;        if( p->aLookahead[j].action!=p->aAction[k].action ) break;      }      if( j<p->nLookahead ) continue;      n = 0;      for(j=0; j<p->nAction; j++){        if( p->aAction[j].lookahead<0 ) continue;        if( p->aAction[j].lookahead==j+p->mnLookahead-i ) n++;      }      if( n==p->nLookahead ){        break;  /* Same as a prior transaction set */      }    }  }  /* Insert transaction set at index i. */  for(j=0; j<p->nLookahead; j++){    k = p->aLookahead[j].lookahead - p->mnLookahead + i;    p->aAction[k] = p->aLookahead[j];    if( k>=p->nAction ) p->nAction = k+1;  }  p->nLookahead = 0;  /* Return the offset that is added to the lookahead in order to get the  ** index into yy_action of the action */  return i - p->mnLookahead;}/********************** From the file "assert.c" ****************************//*** A more efficient way of handling assertions.*/void myassert(file,line)char *file;int line;{  fprintf(stderr,"Assertion failed on line %d of file \"%s\"\n",line,file);  exit(1);}/********************** From the file "build.c" *****************************//*** Routines to construction the finite state machine for the LEMON** parser generator.*//* Find a precedence symbol of every rule in the grammar.** ** Those rules which have a precedence symbol coded in the input** grammar using the "[symbol]" construct will already have the** rp->precsym field filled.  Other rules take as their precedence** symbol the first RHS symbol with a defined precedence.  If there** are not RHS symbols with a defined precedence, the precedence** symbol field is left blank.*/void FindRulePrecedences(xp)struct lemon *xp;{  struct rule *rp;  for(rp=xp->rule; rp; rp=rp->next){    if( rp->precsym==0 ){      int i, j;      for(i=0; i<rp->nrhs && rp->precsym==0; i++){        struct symbol *sp = rp->rhs[i];        if( sp->type==MULTITERMINAL ){          for(j=0; j<sp->nsubsym; j++){            if( sp->subsym[j]->prec>=0 ){              rp->precsym = sp->subsym[j];              break;            }          }        }else if( sp->prec>=0 ){          rp->precsym = rp->rhs[i];	}      }    }  }  return;}/* Find all nonterminals which will generate the empty string.** Then go back and compute the first sets of every nonterminal.** The first set is the set of all terminal symbols which can begin** a string generated by that nonterminal.*/void FindFirstSets(lemp)struct lemon *lemp;{  int i, j;  struct rule *rp;  int progress;  for(i=0; i<lemp->nsymbol; i++){    lemp->symbols[i]->lambda = B_FALSE;  }  for(i=lemp->nterminal; i<lemp->nsymbol; i++){    lemp->symbols[i]->firstset = SetNew();  }  /* First compute all lambdas */  do{    progress = 0;    for(rp=lemp->rule; rp; rp=rp->next){      if( rp->lhs->lambda ) continue;      for(i=0; i<rp->nrhs; i++){         struct symbol *sp = rp->rhs[i];         if( sp->type!=TERMINAL || sp->lambda==B_FALSE ) break;      }      if( i==rp->nrhs ){        rp->lhs->lambda = B_TRUE;        progress = 1;      }    }  }while( progress );  /* Now compute all first sets */  do{    struct symbol *s1, *s2;    progress = 0;    for(rp=lemp->rule; rp; rp=rp->next){      s1 = rp->lhs;      for(i=0; i<rp->nrhs; i++){        s2 = rp->rhs[i];        if( s2->type==TERMINAL ){          progress += SetAdd(s1->firstset,s2->index);          break;        }else if( s2->type==MULTITERMINAL ){          for(j=0; j<s2->nsubsym; j++){            progress += SetAdd(s1->firstset,s2->subsym[j]->index);          }          break;	}else if( s1==s2 ){          if( s1->lambda==B_FALSE ) break;	}else{          progress += SetUnion(s1->firstset,s2->firstset);          if( s2->lambda==B_FALSE ) break;	}      }    }  }while( progress );  return;}/* Compute all LR(0) states for the grammar.  Links** are added to between some states so that the LR(1) follow sets** can be computed later.*/PRIVATE struct state *getstate(/* struct lemon * */);  /* forward reference */void FindStates(lemp)struct lemon *lemp;{  struct symbol *sp;  struct rule *rp;  Configlist_init();  /* Find the start symbol */  if( lemp->start ){    sp = Symbol_find(lemp->start);    if( sp==0 ){      ErrorMsg(lemp->filename,0,"The specified start symbol \"%s\" is not \in a nonterminal of the grammar.  \"%s\" will be used as the start \symbol instead.",lemp->start,lemp->rule->lhs->name);      lemp->errorcnt++;      sp = lemp->rule->lhs;    }  }else{    sp = lemp->rule->lhs;  }  /* Make sure the start symbol doesn't occur on the right-hand side of  ** any rule.  Report an error if it does.  (YACC would generate a new  ** start symbol in this case.) */  for(rp=lemp->rule; rp; rp=rp->next){    int i;    for(i=0; i<rp->nrhs; i++){      if( rp->rhs[i]==sp ){   /* FIX ME:  Deal with multiterminals */        ErrorMsg(lemp->filename,0,"The start symbol \"%s\" occurs on the \right-hand side of a rule. This will result in a parser which \does not work properly.",sp->name);        lemp->errorcnt++;      }    }  }  /* The basis configuration set for the first state  ** is all rules which have the start symbol as their  ** left-hand side */  for(rp=sp->rule; rp; rp=rp->nextlhs){    struct config *newcfp;    newcfp = Configlist_addbasis(rp,0);    SetAdd(newcfp->fws,0);  }  /* Compute the first state.  All other states will be  ** computed automatically during the computation of the first one.  ** The returned pointer to the first state is not used. */  (void)getstate(lemp);  return;}/* Return a pointer to a state which is described by the configuration** list which has been built from calls to Configlist_add.*/PRIVATE void buildshifts(/* struct lemon *, struct state * */); /* Forwd ref */PRIVATE struct state *getstate(lemp)struct lemon *lemp;{  struct config *cfp, *bp;  struct state *stp;  /* Extract the sorted basis of the new state.  The basis was constructed  ** by prior calls to "Configlist_addbasis()". */  Configlist_sortbasis();  bp = Configlist_basis();  /* Get a state with the same basis */  stp = State_find(bp);  if( stp ){    /* A state with the same basis already exists!  Copy all the follow-set    ** propagation links from the state under construction into the    ** preexisting state, then return a pointer to the preexisting state */    struct config *x, *y;    for(x=bp, y=stp->bp; x && y; x=x->bp, y=y->bp){      Plink_copy(&y->bplp,x->bplp);      Plink_delete(x->fplp);      x->fplp = x->bplp = 0;    }    cfp = Configlist_return();    Configlist_eat(cfp);  }else{    /* This really is a new state.  Construct all the details */    Configlist_closure(lemp);    /* Compute the configuration closure */    Configlist_sort();           /* Sort the configuration closure */    cfp = Configlist_return();   /* Get a pointer to the config list */    stp = State_new();           /* A new state structure */    MemoryCheck(stp);    stp->bp = bp;                /* Remember the configuration basis */    stp->cfp = cfp;              /* Remember the configuration closure */    stp->statenum = lemp->nstate++; /* Every state gets a sequence number */    stp->ap = 0;                 /* No actions, yet. */    State_insert(stp,stp->bp);   /* Add to the state table */    buildshifts(lemp,stp);       /* Recursively compute successor states */  }  return stp;}/*** Return true if two symbols are the same.*/int same_symbol(a,b)struct symbol *a;struct symbol *b;{  int i;  if( a==b ) return 1;  if( a->type!=MULTITERMINAL ) return 0;  if( b->type!=MULTITERMINAL ) return 0;  if( a->nsubsym!=b->nsubsym ) return 0;  for(i=0; i<a->nsubsym; i++){    if( a->subsym[i]!=b->subsym[i] ) return 0;  }  return 1;}/* Construct all successor states to the given state.  A "successor"** state is any state which can be reached by a shift action.*/PRIVATE void buildshifts(lemp,stp)struct lemon *lemp;struct state *stp;     /* The state from which successors are computed */{  struct config *cfp;  /* For looping thru the config closure of "stp" */  struct config *bcfp; /* For the inner loop on config closure of "stp" */  struct config *new;  /* */  struct symbol *sp;   /* Symbol following the dot in configuration "cfp" */  struct symbol *bsp;  /* Symbol following the dot in configuration "bcfp" */  struct state *newstp; /* A pointer to a successor state */  /* Each configuration becomes complete after it contibutes to a successor  ** state.  Initially, all configurations are incomplete */  for(cfp=stp->cfp; cfp; cfp=cfp->next) cfp->status = INCOMPLETE;  /* Loop through all configurations of the state "stp" */  for(cfp=stp->cfp; cfp; cfp=cfp->next){    if( cfp->status==COMPLETE ) continue;    /* Already used by inner loop */    if( cfp->dot>=cfp->rp->nrhs ) continue;  /* Can't shift this config */    Configlist_reset();                      /* Reset the new config set */    sp = cfp->rp->rhs[cfp->dot];             /* Symbol after the dot */    /* For every configuration in the state "stp" which has the symbol "sp"    ** following its dot, add the same configuration to the basis set under    ** construction but with the dot shifted one symbol to the right. */    for(bcfp=cfp; bcfp; bcfp=bcfp->next){      if( bcfp->status==COMPLETE ) continue;    /* Already used */      if( bcfp->dot>=bcfp->rp->nrhs ) continue; /* Can't shift this one */      bsp = bcfp->rp->rhs[bcfp->dot];           /* Get symbol after dot */      if( !same_symbol(bsp,sp) ) continue;      /* Must be same as for "cfp" */      bcfp->status = COMPLETE;                  /* Mark this config as used */      new = Configlist_addbasis(bcfp->rp,bcfp->dot+1);      Plink_add(&new->bplp,bcfp);    }    /* Get a pointer to the state described by the basis configuration set    ** constructed in the preceding loop */    newstp = getstate(lemp);    /* The state "newstp" is reached from the state "stp" by a shift action    ** on the symbol "sp" */    if( sp->type==MULTITERMINAL ){      int i;      for(i=0; i<sp->nsubsym; i++){        Action_add(&stp->ap,SHIFT,sp->subsym[i],(char*)newstp);      }    }else{      Action_add(&stp->ap,SHIFT,sp,(char *)newstp);    }  }}/*** Construct the propagation links*/void FindLinks(lemp)struct lemon *lemp;{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产不卡视频在线播放| 日韩欧美一卡二卡| 亚洲欧美另类小说| 91成人在线观看喷潮| 日韩精品欧美精品| 日韩一区二区精品葵司在线| 国产真实精品久久二三区| 国产色综合一区| 色婷婷综合久久久中文字幕| 亚洲国产精品久久不卡毛片| 欧美一卡二卡三卡四卡| 国产麻豆精品视频| 亚洲日本一区二区三区| 欧美日韩精品一区二区三区四区 | 国产盗摄视频一区二区三区| 中文字幕精品综合| av一区二区久久| 日韩影视精彩在线| 久久久久久久久蜜桃| 99re亚洲国产精品| 日本vs亚洲vs韩国一区三区| 国产亚洲污的网站| 欧美亚洲丝袜传媒另类| 狠狠色丁香久久婷婷综合_中 | 五月天久久比比资源色| 26uuu另类欧美亚洲曰本| k8久久久一区二区三区| 强制捆绑调教一区二区| 欧美国产一区视频在线观看| 欧美日韩精品三区| 成人午夜大片免费观看| 丝袜a∨在线一区二区三区不卡| 国产区在线观看成人精品| 欧洲一区二区三区免费视频| 国产一区二区在线看| 亚洲一二三四在线| 久久人人97超碰com| 欧美高清视频一二三区| 色综合中文综合网| 久久精品久久综合| 樱桃国产成人精品视频| 久久夜色精品国产噜噜av| 欧美色男人天堂| 成人一区在线观看| 极品少妇xxxx偷拍精品少妇| 亚洲动漫第一页| 国产精品欧美极品| 欧美大片国产精品| 欧美日本免费一区二区三区| 成人黄色大片在线观看| 韩国av一区二区三区在线观看| 亚洲小说欧美激情另类| 国产精品久久久久aaaa樱花| 久久亚洲精华国产精华液| 欧美亚洲综合一区| 日本韩国精品在线| aaa欧美日韩| 国产高清在线精品| 国产一区二区三区美女| 日本美女视频一区二区| 亚洲国产精品一区二区久久| 亚洲欧美另类小说| 日韩一区在线播放| 国产精品毛片a∨一区二区三区| 日韩美一区二区三区| 在线不卡欧美精品一区二区三区| 在线观看视频91| 99r国产精品| 91在线视频免费91| av在线一区二区| 色综合天天综合网国产成人综合天| 国产一区二区三区黄视频| 精品一区二区三区免费毛片爱| 免费观看在线综合色| 欧美aa在线视频| 另类小说色综合网站| 久久精品久久综合| 国内国产精品久久| 成人综合在线视频| 99精品视频一区二区三区| 99热精品国产| 一本一道久久a久久精品| 色婷婷久久一区二区三区麻豆| 色嗨嗨av一区二区三区| 色婷婷综合久久久中文字幕| 欧美视频在线不卡| 欧美一级日韩不卡播放免费| 日韩欧美综合在线| 久久亚洲影视婷婷| 亚洲欧美一区二区视频| 亚洲国产美女搞黄色| 日韩1区2区3区| 极品少妇xxxx偷拍精品少妇| 成人网在线免费视频| 色天天综合久久久久综合片| 欧美日韩一区国产| 精品国产伦理网| 国产精品人妖ts系列视频| 综合在线观看色| 天天综合网天天综合色| 国产综合色产在线精品| jlzzjlzz亚洲女人18| 欧美日本在线播放| 国产人成一区二区三区影院| 亚洲黄色录像片| 麻豆精品一区二区综合av| 国产一区在线不卡| 色老汉av一区二区三区| 精品久久久久久无| 亚洲免费视频中文字幕| 秋霞影院一区二区| 成人激情视频网站| 欧美人妇做爰xxxⅹ性高电影| 26uuu欧美日本| 一区二区三区四区不卡在线| 精品一区中文字幕| 色偷偷成人一区二区三区91| 精品国产伦一区二区三区观看方式 | 国产乱理伦片在线观看夜一区| 97久久精品人人做人人爽50路| 欧美精品日韩一区| 国产女主播在线一区二区| 亚洲大片在线观看| 成人丝袜高跟foot| 欧美一区2区视频在线观看| 制服丝袜日韩国产| 亚洲成人av电影在线| 日本欧美韩国一区三区| 91在线观看视频| 欧美xxx久久| 亚洲一区在线视频| 精品福利在线导航| 久久久久久久久97黄色工厂| 一区二区三区精品视频在线| 国产综合久久久久久鬼色| 欧美性猛片aaaaaaa做受| 久久久久久毛片| 免费国产亚洲视频| 欧美日韩精品一区视频| 亚洲欧美日韩国产另类专区| 国产精品一区在线| 日韩欧美中文一区二区| 亚洲欧美日韩小说| 国产经典欧美精品| 精品国精品国产| 日韩黄色免费电影| 欧美视频一区二区三区四区| 亚洲视频一区在线观看| 不卡电影免费在线播放一区| 久久综合成人精品亚洲另类欧美| 亚洲成人av中文| 欧日韩精品视频| 亚洲精品国产一区二区精华液| 丁香激情综合五月| 久久久久久一二三区| 久久99精品久久只有精品| 91精品国产高清一区二区三区| 亚洲激情男女视频| 色综合色综合色综合色综合色综合| 欧美国产日本韩| 丁香婷婷综合五月| 爽好久久久欧美精品| 91一区二区在线| 国产精品的网站| 成人av电影免费观看| 亚洲国产精品99久久久久久久久| 国产欧美日韩综合| 国产91清纯白嫩初高中在线观看| 国产精品久久久爽爽爽麻豆色哟哟| 色94色欧美sute亚洲线路一ni| 亚洲精品国产成人久久av盗摄 | 天天综合色天天| 在线观看三级视频欧美| 久久久久99精品一区| 亚洲视频图片小说| 国产精品无遮挡| 中文字幕永久在线不卡| 日韩欧美高清在线| 欧美性受xxxx黑人xyx性爽| 日本久久精品电影| 国产欧美视频一区二区| 亚洲成人你懂的| 久久99精品国产.久久久久久| 日韩欧美中文一区二区| 欧美一区二区三区在线| 日韩欧美电影一区| 精品精品欲导航| 2023国产一二三区日本精品2022| 99视频在线精品| 国产成人精品免费在线| 久久99精品久久久久婷婷| 日韩高清电影一区| 五月天亚洲精品| 青青青伊人色综合久久| 久久国产婷婷国产香蕉| 香蕉av福利精品导航| 久久国产精品99久久人人澡| 97se亚洲国产综合自在线不卡| 成人av免费网站| 91黄色激情网站|