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

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

?? tblcmp.c

?? C++版 詞法分析、語法分析器
?? C
?? 第 1 頁 / 共 2 頁
字號:
 *
 * synopsis
 *   mkdeftbl();
 */

void mkdeftbl()

    {
    int i;

    jamstate = lastdfa + 1;

    ++tblend; /* room for transition on end-of-buffer character */

    if ( tblend + numecs > current_max_xpairs )
	expand_nxt_chk();

    /* add in default end-of-buffer transition */
    nxt[tblend] = end_of_buffer_state;
    chk[tblend] = jamstate;

    for ( i = 1; i <= numecs; ++i )
	{
	nxt[tblend + i] = 0;
	chk[tblend + i] = jamstate;
	}

    jambase = tblend;

    base[jamstate] = jambase;
    def[jamstate] = 0;

    tblend += numecs;
    ++numtemps;
    }


/* mkentry - create base/def and nxt/chk entries for transition array
 *
 * synopsis
 *   int state[numchars + 1], numchars, statenum, deflink, totaltrans;
 *   mkentry( state, numchars, statenum, deflink, totaltrans );
 *
 * "state" is a transition array "numchars" characters in size, "statenum"
 * is the offset to be used into the base/def tables, and "deflink" is the
 * entry to put in the "def" table entry.  If "deflink" is equal to
 * "JAMSTATE", then no attempt will be made to fit zero entries of "state"
 * (i.e., jam entries) into the table.  It is assumed that by linking to
 * "JAMSTATE" they will be taken care of.  In any case, entries in "state"
 * marking transitions to "SAME_TRANS" are treated as though they will be
 * taken care of by whereever "deflink" points.  "totaltrans" is the total
 * number of transitions out of the state.  If it is below a certain threshold,
 * the tables are searched for an interior spot that will accommodate the
 * state array.
 */

void mkentry( state, numchars, statenum, deflink, totaltrans )
register int *state;
int numchars, statenum, deflink, totaltrans;

    {
    register int minec, maxec, i, baseaddr;
    int tblbase, tbllast;

    if ( totaltrans == 0 )
	{ /* there are no out-transitions */
	if ( deflink == JAMSTATE )
	    base[statenum] = JAMSTATE;
	else
	    base[statenum] = 0;

	def[statenum] = deflink;
	return;
	}

    for ( minec = 1; minec <= numchars; ++minec )
	{
	if ( state[minec] != SAME_TRANS )
	    if ( state[minec] != 0 || deflink != JAMSTATE )
		break;
	}

    if ( totaltrans == 1 )
	{
	/* there's only one out-transition.  Save it for later to fill
	 * in holes in the tables.
	 */
	stack1( statenum, minec, state[minec], deflink );
	return;
	}

    for ( maxec = numchars; maxec > 0; --maxec )
	{
	if ( state[maxec] != SAME_TRANS )
	    if ( state[maxec] != 0 || deflink != JAMSTATE )
		break;
	}

    /* Whether we try to fit the state table in the middle of the table
     * entries we have already generated, or if we just take the state
     * table at the end of the nxt/chk tables, we must make sure that we
     * have a valid base address (i.e., non-negative).  Note that not only are
     * negative base addresses dangerous at run-time (because indexing the
     * next array with one and a low-valued character might generate an
     * array-out-of-bounds error message), but at compile-time negative
     * base addresses denote TEMPLATES.
     */

    /* find the first transition of state that we need to worry about. */
    if ( totaltrans * 100 <= numchars * INTERIOR_FIT_PERCENTAGE )
	{ /* attempt to squeeze it into the middle of the tabls */
	baseaddr = firstfree;

	while ( baseaddr < minec )
	    {
	    /* using baseaddr would result in a negative base address below
	     * find the next free slot
	     */
	    for ( ++baseaddr; chk[baseaddr] != 0; ++baseaddr )
		;
	    }

	if ( baseaddr + maxec - minec + 1 >= current_max_xpairs )
	    expand_nxt_chk();

	for ( i = minec; i <= maxec; ++i )
	    if ( state[i] != SAME_TRANS )
		if ( state[i] != 0 || deflink != JAMSTATE )
		    if ( chk[baseaddr + i - minec] != 0 )
			{ /* baseaddr unsuitable - find another */
			for ( ++baseaddr;
			      baseaddr < current_max_xpairs &&
			      chk[baseaddr] != 0;
			      ++baseaddr )
			    ;

			if ( baseaddr + maxec - minec + 1 >=
  			     current_max_xpairs )
			    expand_nxt_chk();

			/* reset the loop counter so we'll start all
			 * over again next time it's incremented
			 */

			i = minec - 1;
			}
	}

    else
	{
	/* ensure that the base address we eventually generate is
	 * non-negative
	 */
	baseaddr = max( tblend + 1, minec );
	}

    tblbase = baseaddr - minec;
    tbllast = tblbase + maxec;

    if ( tbllast + 1 >= current_max_xpairs )
	expand_nxt_chk();

    base[statenum] = tblbase;
    def[statenum] = deflink;

    for ( i = minec; i <= maxec; ++i )
	if ( state[i] != SAME_TRANS )
	    if ( state[i] != 0 || deflink != JAMSTATE )
		{
		nxt[tblbase + i] = state[i];
		chk[tblbase + i] = statenum;
		}

    if ( baseaddr == firstfree )
	/* find next free slot in tables */
	for ( ++firstfree; chk[firstfree] != 0; ++firstfree )
	    ;

    tblend = max( tblend, tbllast );
    }


/* mk1tbl - create table entries for a state (or state fragment) which
 *            has only one out-transition
 *
 * synopsis
 *   int state, sym, onenxt, onedef;
 *   mk1tbl( state, sym, onenxt, onedef );
 */

void mk1tbl( state, sym, onenxt, onedef )
int state, sym, onenxt, onedef;

    {
    if ( firstfree < sym )
	firstfree = sym;

    while ( chk[firstfree] != 0 )
	if ( ++firstfree >= current_max_xpairs )
	    expand_nxt_chk();

    base[state] = firstfree - sym;
    def[state] = onedef;
    chk[firstfree] = state;
    nxt[firstfree] = onenxt;

    if ( firstfree > tblend )
	{
	tblend = firstfree++;

	if ( firstfree >= current_max_xpairs )
	    expand_nxt_chk();
	}
    }


/* mkprot - create new proto entry
 *
 * synopsis
 *   int state[], statenum, comstate;
 *   mkprot( state, statenum, comstate );
 */

void mkprot( state, statenum, comstate )
int state[], statenum, comstate;

    {
    int i, slot, tblbase;

    if ( ++numprots >= MSP || numecs * numprots >= PROT_SAVE_SIZE )
	{
	/* gotta make room for the new proto by dropping last entry in
	 * the queue
	 */
	slot = lastprot;
	lastprot = protprev[lastprot];
	protnext[lastprot] = NIL;
	}

    else
	slot = numprots;

    protnext[slot] = firstprot;

    if ( firstprot != NIL )
	protprev[firstprot] = slot;

    firstprot = slot;
    prottbl[slot] = statenum;
    protcomst[slot] = comstate;

    /* copy state into save area so it can be compared with rapidly */
    tblbase = numecs * (slot - 1);

    for ( i = 1; i <= numecs; ++i )
	protsave[tblbase + i] = state[i];
    }


/* mktemplate - create a template entry based on a state, and connect the state
 *              to it
 *
 * synopsis
 *   int state[], statenum, comstate, totaltrans;
 *   mktemplate( state, statenum, comstate, totaltrans );
 */

void mktemplate( state, statenum, comstate )
int state[], statenum, comstate;

    {
    int i, numdiff, tmpbase, tmp[CSIZE + 1];
    Char transset[CSIZE + 1];
    int tsptr;

    ++numtemps;

    tsptr = 0;

    /* calculate where we will temporarily store the transition table
     * of the template in the tnxt[] array.  The final transition table
     * gets created by cmptmps()
     */

    tmpbase = numtemps * numecs;

    if ( tmpbase + numecs >= current_max_template_xpairs )
	{
	current_max_template_xpairs += MAX_TEMPLATE_XPAIRS_INCREMENT;

	++num_reallocs;

	tnxt = reallocate_integer_array( tnxt, current_max_template_xpairs );
	}

    for ( i = 1; i <= numecs; ++i )
	if ( state[i] == 0 )
	    tnxt[tmpbase + i] = 0;
	else
	    {
	    transset[tsptr++] = i;
	    tnxt[tmpbase + i] = comstate;
	    }

    if ( usemecs )
	mkeccl( transset, tsptr, tecfwd, tecbck, numecs, 0 );

    mkprot( tnxt + tmpbase, -numtemps, comstate );

    /* we rely on the fact that mkprot adds things to the beginning
     * of the proto queue
     */

    numdiff = tbldiff( state, firstprot, tmp );
    mkentry( tmp, numecs, statenum, -numtemps, numdiff );
    }


/* mv2front - move proto queue element to front of queue
 *
 * synopsis
 *   int qelm;
 *   mv2front( qelm );
 */

void mv2front( qelm )
int qelm;

    {
    if ( firstprot != qelm )
	{
	if ( qelm == lastprot )
	    lastprot = protprev[lastprot];

	protnext[protprev[qelm]] = protnext[qelm];

	if ( protnext[qelm] != NIL )
	    protprev[protnext[qelm]] = protprev[qelm];

	protprev[qelm] = NIL;
	protnext[qelm] = firstprot;
	protprev[firstprot] = qelm;
	firstprot = qelm;
	}
    }


/* place_state - place a state into full speed transition table
 *
 * synopsis
 *     int *state, statenum, transnum;
 *     place_state( state, statenum, transnum );
 *
 * State is the statenum'th state.  It is indexed by equivalence class and
 * gives the number of the state to enter for a given equivalence class.
 * Transnum is the number of out-transitions for the state.
 */

void place_state( state, statenum, transnum )
int *state, statenum, transnum;

    {
    register int i;
    register int *state_ptr;
    int position = find_table_space( state, transnum );

    /* base is the table of start positions */
    base[statenum] = position;

    /* put in action number marker; this non-zero number makes sure that
     * find_table_space() knows that this position in chk/nxt is taken
     * and should not be used for another accepting number in another state
     */
    chk[position - 1] = 1;

    /* put in end-of-buffer marker; this is for the same purposes as above */
    chk[position] = 1;

    /* place the state into chk and nxt */
    state_ptr = &state[1];

    for ( i = 1; i <= numecs; ++i, ++state_ptr )
	if ( *state_ptr != 0 )
	    {
	    chk[position + i] = i;
	    nxt[position + i] = *state_ptr;
	    }

    if ( position + numecs > tblend )
	tblend = position + numecs;
    }


/* stack1 - save states with only one out-transition to be processed later
 *
 * synopsis
 *   int statenum, sym, nextstate, deflink;
 *   stack1( statenum, sym, nextstate, deflink );
 *
 * if there's room for another state one the "one-transition" stack, the
 * state is pushed onto it, to be processed later by mk1tbl.  If there's
 * no room, we process the sucker right now.
 */

void stack1( statenum, sym, nextstate, deflink )
int statenum, sym, nextstate, deflink;

    {
    if ( onesp >= ONE_STACK_SIZE - 1 )
	mk1tbl( statenum, sym, nextstate, deflink );

    else
	{
	++onesp;
	onestate[onesp] = statenum;
	onesym[onesp] = sym;
	onenext[onesp] = nextstate;
	onedef[onesp] = deflink;
	}
    }


/* tbldiff - compute differences between two state tables
 *
 * synopsis
 *   int state[], pr, ext[];
 *   int tbldiff, numdifferences;
 *   numdifferences = tbldiff( state, pr, ext )
 *
 * "state" is the state array which is to be extracted from the pr'th
 * proto.  "pr" is both the number of the proto we are extracting from
 * and an index into the save area where we can find the proto's complete
 * state table.  Each entry in "state" which differs from the corresponding
 * entry of "pr" will appear in "ext".
 * Entries which are the same in both "state" and "pr" will be marked
 * as transitions to "SAME_TRANS" in "ext".  The total number of differences
 * between "state" and "pr" is returned as function value.  Note that this
 * number is "numecs" minus the number of "SAME_TRANS" entries in "ext".
 */

int tbldiff( state, pr, ext )
int state[], pr, ext[];

    {
    register int i, *sp = state, *ep = ext, *protp;
    register int numdiff = 0;

    protp = &protsave[numecs * (pr - 1)];

    for ( i = numecs; i > 0; --i )
	{
	if ( *++protp == *++sp )
	    *++ep = SAME_TRANS;
	else
	    {
	    *++ep = *sp;
	    ++numdiff;
	    }
	}

    return ( numdiff );
    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品免费网站在线观看| 这里是久久伊人| 日日夜夜免费精品| 久久精品亚洲乱码伦伦中文 | 麻豆一区二区在线| 亚洲欧美偷拍另类a∨色屁股| 欧美成人乱码一区二区三区| 一本大道久久a久久精品综合| 久久99国产精品尤物| 亚洲国产精品精华液网站 | 香蕉加勒比综合久久| 中文字幕一区不卡| 精品成人私密视频| 欧美精品欧美精品系列| 91日韩精品一区| 国产福利精品导航| 久久福利资源站| 日韩中文字幕不卡| 夜夜夜精品看看| 综合亚洲深深色噜噜狠狠网站| 精品99一区二区| 欧美一级在线视频| 欧美日韩1234| 欧美嫩在线观看| 精品视频全国免费看| 97久久精品人人做人人爽| 国产精品18久久久久久久久久久久 | 91.xcao| 欧美日韩亚洲高清一区二区| 一本一本久久a久久精品综合麻豆| 国产成人在线看| 国产一区二区免费视频| 久久精品99国产精品日本| 欧美色图免费看| 日韩国产精品久久久| 亚洲欧美电影院| 中文字幕中文在线不卡住| 中文字幕不卡在线播放| 国产欧美一区二区三区网站| 久久综合久久99| 久久美女艺术照精彩视频福利播放 | 在线观看中文字幕不卡| 99久久精品国产精品久久| jlzzjlzz亚洲女人18| 成人sese在线| 97久久超碰国产精品| 91麻豆精品在线观看| 一本色道**综合亚洲精品蜜桃冫| 色综合网站在线| 欧美午夜精品电影| 欧美日韩黄色一区二区| 日韩一区二区高清| 精品久久久久久最新网址| 久久色.com| 国产精品灌醉下药二区| 一区二区三区在线免费视频| 午夜欧美一区二区三区在线播放| 首页综合国产亚洲丝袜| 久久精品国产成人一区二区三区| 国模冰冰炮一区二区| 成人精品免费看| 一本大道av伊人久久综合| 欧美人体做爰大胆视频| 日韩一区二区三区观看| 久久久蜜臀国产一区二区| 国产精品久久久久精k8| 一区二区在线观看不卡| 日韩精品一区第一页| 国精产品一区一区三区mba视频 | 91精品国产综合久久精品图片| 91精品国产色综合久久不卡蜜臀 | 一区二区高清视频在线观看| 五月天中文字幕一区二区| 韩国成人福利片在线播放| 豆国产96在线|亚洲| 欧美亚洲综合色| 精品处破学生在线二十三| 国产精品视频一二| 午夜精品久久久久久久久久久| 国产一区二区三区免费观看| 91丨porny丨国产入口| 欧美另类一区二区三区| 国产亚洲欧美日韩俺去了| 亚洲激情欧美激情| 国内外成人在线| 色噜噜狠狠色综合中国| 日韩一级在线观看| 日韩码欧中文字| 美女诱惑一区二区| 97精品国产露脸对白| 7799精品视频| 国产精品三级av| 亚洲18影院在线观看| 国内精品免费在线观看| 成人免费高清视频在线观看| 在线国产亚洲欧美| 国产三级精品在线| 日韩国产精品久久久久久亚洲| www.亚洲在线| 26uuu国产电影一区二区| 香蕉加勒比综合久久| 99久久777色| 久久久久久综合| 五月天欧美精品| 色综合激情久久| 国产亚洲一二三区| 蜜桃在线一区二区三区| 欧美日韩免费在线视频| 中文字幕一区二区三区不卡| 黑人精品欧美一区二区蜜桃| 欧美日韩精品久久久| 一区二区国产视频| 91麻豆.com| 中文字幕制服丝袜一区二区三区 | av在线播放一区二区三区| 日韩视频在线永久播放| 亚洲国产精品麻豆| 色综合中文字幕| 国产精品国产自产拍在线| 国产呦萝稀缺另类资源| 日韩午夜在线影院| 天天综合色天天综合| 欧美在线你懂得| 亚洲一区二区三区影院| 91在线观看高清| 中文字幕一区二| 91婷婷韩国欧美一区二区| 中文字幕精品在线不卡| 国产成人在线观看| 国产拍揄自揄精品视频麻豆| 国产乱码精品一区二区三区av| 日韩欧美在线观看一区二区三区| 视频精品一区二区| 欧美精品第1页| 日韩av一区二| 日韩欧美二区三区| 久久97超碰色| 精品国产免费久久| 国产一区二区三区日韩 | 国产目拍亚洲精品99久久精品| 久久国产婷婷国产香蕉| 精品美女一区二区三区| 看片网站欧美日韩| 久久网这里都是精品| 国产传媒日韩欧美成人| 国产精品青草综合久久久久99| 国产91高潮流白浆在线麻豆| 国产精品嫩草影院av蜜臀| fc2成人免费人成在线观看播放| 亚洲图片激情小说| 欧美主播一区二区三区| 日本午夜一区二区| 久久综合狠狠综合久久综合88| 国产精品99久久久| 亚洲欧美日韩国产综合在线| 色哟哟日韩精品| 天涯成人国产亚洲精品一区av| 欧美一区二区成人6969| 国产精品白丝av| 亚洲精品你懂的| 欧美一区二区观看视频| 国产精一区二区三区| 自拍偷自拍亚洲精品播放| 欧美日韩一级大片网址| 麻豆中文一区二区| 中文字幕一区二区三区不卡在线 | 26uuu亚洲婷婷狠狠天堂| 3751色影院一区二区三区| 亚洲二区在线观看| 日韩一区二区三区视频在线观看 | 蜜臀av性久久久久蜜臀aⅴ四虎| 久久久久久一二三区| 97aⅴ精品视频一二三区| 日韩激情中文字幕| 久久精品免费在线观看| 在线观看91精品国产入口| 韩国精品在线观看| 亚洲精品国产高清久久伦理二区| 日韩一级欧美一级| av在线播放不卡| 蜜桃久久久久久| 国产精品理伦片| 欧美一区二区免费视频| 94-欧美-setu| 久久成人免费网站| 一区二区视频在线| 久久精品这里都是精品| 欧美日本精品一区二区三区| 国产乱子伦一区二区三区国色天香| 一区二区三区影院| 国产天堂亚洲国产碰碰| 91精品1区2区| 国产大片一区二区| 免费成人在线观看| 亚洲一区精品在线| 中文字幕一区二区日韩精品绯色| 91精品国产综合久久久久久漫画| 亚洲欧美综合网| 51久久夜色精品国产麻豆| 成人激情小说乱人伦|