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

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

?? dfa.c

?? 編譯原理(Flex):生成詞法和語法分析程序的源代碼的程序。
?? C
?? 第 1 頁 / 共 2 頁
字號:
	/* Create the first states. */

	num_start_states = lastsc * 2;

	for ( i = 1; i <= num_start_states; ++i )
		{
		numstates = 1;

		/* For each start condition, make one state for the case when
		 * we're at the beginning of the line (the '^' operator) and
		 * one for the case when we're not.
		 */
		if ( i % 2 == 1 )
			nset[numstates] = scset[(i / 2) + 1];
		else
			nset[numstates] =
				mkbranch( scbol[i / 2], scset[i / 2] );

		nset = epsclosure( nset, &numstates, accset, &nacc, &hashval );

		if ( snstods( nset, numstates, accset, nacc, hashval, &ds ) )
			{
			numas += nacc;
			totnst += numstates;
			++todo_next;

			if ( variable_trailing_context_rules && nacc > 0 )
				check_trailing_context( nset, numstates,
							accset, nacc );
			}
		}

	if ( ! fullspd )
		{
		if ( ! snstods( nset, 0, accset, 0, 0, &end_of_buffer_state ) )
			flexfatal(
			_( "could not create unique end-of-buffer state" ) );

		++numas;
		++num_start_states;
		++todo_next;
		}

	while ( todo_head < todo_next )
		{
		targptr = 0;
		totaltrans = 0;

		for ( i = 1; i <= numecs; ++i )
			state[i] = 0;

		ds = ++todo_head;

		dset = dss[ds];
		dsize = dfasiz[ds];

		if ( trace )
			fprintf( stderr, _( "state # %d:\n" ), ds );

		sympartition( dset, dsize, symlist, duplist );

		for ( sym = 1; sym <= numecs; ++sym )
			{
			if ( symlist[sym] )
				{
				symlist[sym] = 0;

				if ( duplist[sym] == NIL )
					{
					/* Symbol has unique out-transitions. */
					numstates = symfollowset( dset, dsize,
								sym, nset );
					nset = epsclosure( nset, &numstates,
						accset, &nacc, &hashval );

					if ( snstods( nset, numstates, accset,
						nacc, hashval, &newds ) )
						{
						totnst = totnst + numstates;
						++todo_next;
						numas += nacc;

						if (
					variable_trailing_context_rules &&
							nacc > 0 )
							check_trailing_context(
								nset, numstates,
								accset, nacc );
						}

					state[sym] = newds;

					if ( trace )
						fprintf( stderr, "\t%d\t%d\n",
							sym, newds );

					targfreq[++targptr] = 1;
					targstate[targptr] = newds;
					++numuniq;
					}

				else
					{
					/* sym's equivalence class has the same
					 * transitions as duplist(sym)'s
					 * equivalence class.
					 */
					targ = state[duplist[sym]];
					state[sym] = targ;

					if ( trace )
						fprintf( stderr, "\t%d\t%d\n",
							sym, targ );

					/* Update frequency count for
					 * destination state.
					 */

					i = 0;
					while ( targstate[++i] != targ )
						;

					++targfreq[i];
					++numdup;
					}

				++totaltrans;
				duplist[sym] = NIL;
				}
			}

		if ( caseins && ! useecs )
			{
			register int j;

			for ( i = 'A', j = 'a'; i <= 'Z'; ++i, ++j )
				{
				if ( state[i] == 0 && state[j] != 0 )
					/* We're adding a transition. */
					++totaltrans;

				else if ( state[i] != 0 && state[j] == 0 )
					/* We're taking away a transition. */
					--totaltrans;

				state[i] = state[j];
				}
			}

		numsnpairs += totaltrans;

		if ( ds > num_start_states )
			check_for_backing_up( ds, state );

		if ( nultrans )
			{
			nultrans[ds] = state[NUL_ec];
			state[NUL_ec] = 0;	/* remove transition */
			}

		if ( fulltbl )
			{
			outn( "    {" );

			/* Supply array's 0-element. */
			if ( ds == end_of_buffer_state )
				mk2data( -end_of_buffer_state );
			else
				mk2data( end_of_buffer_state );

			for ( i = 1; i < num_full_table_rows; ++i )
				/* Jams are marked by negative of state
				 * number.
				 */
				mk2data( state[i] ? state[i] : -ds );

			dataflush();
			outn( "    },\n" );
			}

		else if ( fullspd )
			place_state( state, ds, totaltrans );

		else if ( ds == end_of_buffer_state )
			/* Special case this state to make sure it does what
			 * it's supposed to, i.e., jam on end-of-buffer.
			 */
			stack1( ds, 0, 0, JAMSTATE );

		else /* normal, compressed state */
			{
			/* Determine which destination state is the most
			 * common, and how many transitions to it there are.
			 */

			comfreq = 0;
			comstate = 0;

			for ( i = 1; i <= targptr; ++i )
				if ( targfreq[i] > comfreq )
					{
					comfreq = targfreq[i];
					comstate = targstate[i];
					}

			bldtbl( state, ds, totaltrans, comstate, comfreq );
			}
		}

	if ( fulltbl )
		dataend();

	else if ( ! fullspd )
		{
		cmptmps();  /* create compressed template entries */

		/* Create tables for all the states with only one
		 * out-transition.
		 */
		while ( onesp > 0 )
			{
			mk1tbl( onestate[onesp], onesym[onesp], onenext[onesp],
			onedef[onesp] );
			--onesp;
			}

		mkdeftbl();
		}

	flex_free( (void *) accset );
	flex_free( (void *) nset );
	}


/* snstods - converts a set of ndfa states into a dfa state
 *
 * synopsis
 *    is_new_state = snstods( int sns[numstates], int numstates,
 *				int accset[num_rules+1], int nacc,
 *				int hashval, int *newds_addr );
 *
 * On return, the dfa state number is in newds.
 */

int snstods( sns, numstates, accset, nacc, hashval, newds_addr )
int sns[], numstates, accset[], nacc, hashval, *newds_addr;
	{
	int didsort = 0;
	register int i, j;
	int newds, *oldsns;

	for ( i = 1; i <= lastdfa; ++i )
		if ( hashval == dhash[i] )
			{
			if ( numstates == dfasiz[i] )
				{
				oldsns = dss[i];

				if ( ! didsort )
					{
					/* We sort the states in sns so we
					 * can compare it to oldsns quickly.
					 * We use bubble because there probably
					 * aren't very many states.
					 */
					bubble( sns, numstates );
					didsort = 1;
					}

				for ( j = 1; j <= numstates; ++j )
					if ( sns[j] != oldsns[j] )
						break;

				if ( j > numstates )
					{
					++dfaeql;
					*newds_addr = i;
					return 0;
					}

				++hshcol;
				}

			else
				++hshsave;
			}

	/* Make a new dfa. */

	if ( ++lastdfa >= current_max_dfas )
		increase_max_dfas();

	newds = lastdfa;

	dss[newds] = allocate_integer_array( numstates + 1 );

	/* If we haven't already sorted the states in sns, we do so now,
	 * so that future comparisons with it can be made quickly.
	 */

	if ( ! didsort )
		bubble( sns, numstates );

	for ( i = 1; i <= numstates; ++i )
		dss[newds][i] = sns[i];

	dfasiz[newds] = numstates;
	dhash[newds] = hashval;

	if ( nacc == 0 )
		{
		if ( reject )
			dfaacc[newds].dfaacc_set = (int *) 0;
		else
			dfaacc[newds].dfaacc_state = 0;

		accsiz[newds] = 0;
		}

	else if ( reject )
		{
		/* We sort the accepting set in increasing order so the
		 * disambiguating rule that the first rule listed is considered
		 * match in the event of ties will work.  We use a bubble
		 * sort since the list is probably quite small.
		 */

		bubble( accset, nacc );

		dfaacc[newds].dfaacc_set = allocate_integer_array( nacc + 1 );

		/* Save the accepting set for later */
		for ( i = 1; i <= nacc; ++i )
			{
			dfaacc[newds].dfaacc_set[i] = accset[i];

			if ( accset[i] <= num_rules )
				/* Who knows, perhaps a REJECT can yield
				 * this rule.
				 */
				rule_useful[accset[i]] = true;
			}

		accsiz[newds] = nacc;
		}

	else
		{
		/* Find lowest numbered rule so the disambiguating rule
		 * will work.
		 */
		j = num_rules + 1;

		for ( i = 1; i <= nacc; ++i )
			if ( accset[i] < j )
				j = accset[i];

		dfaacc[newds].dfaacc_state = j;

		if ( j <= num_rules )
			rule_useful[j] = true;
		}

	*newds_addr = newds;

	return 1;
	}


/* symfollowset - follow the symbol transitions one step
 *
 * synopsis
 *    numstates = symfollowset( int ds[current_max_dfa_size], int dsize,
 *				int transsym, int nset[current_max_dfa_size] );
 */

int symfollowset( ds, dsize, transsym, nset )
int ds[], dsize, transsym, nset[];
	{
	int ns, tsp, sym, i, j, lenccl, ch, numstates, ccllist;

	numstates = 0;

	for ( i = 1; i <= dsize; ++i )
		{ /* for each nfa state ns in the state set of ds */
		ns = ds[i];
		sym = transchar[ns];
		tsp = trans1[ns];

		if ( sym < 0 )
			{ /* it's a character class */
			sym = -sym;
			ccllist = cclmap[sym];
			lenccl = ccllen[sym];

			if ( cclng[sym] )
				{
				for ( j = 0; j < lenccl; ++j )
					{
					/* Loop through negated character
					 * class.
					 */
					ch = ccltbl[ccllist + j];

					if ( ch == 0 )
						ch = NUL_ec;

					if ( ch > transsym )
						/* Transsym isn't in negated
						 * ccl.
						 */
						break;

					else if ( ch == transsym )
						/* next 2 */ goto bottom;
					}

				/* Didn't find transsym in ccl. */
				nset[++numstates] = tsp;
				}

			else
				for ( j = 0; j < lenccl; ++j )
					{
					ch = ccltbl[ccllist + j];

					if ( ch == 0 )
						ch = NUL_ec;

					if ( ch > transsym )
						break;
					else if ( ch == transsym )
						{
						nset[++numstates] = tsp;
						break;
						}
					}
			}

		else if ( sym >= 'A' && sym <= 'Z' && caseins )
			flexfatal(
			_( "consistency check failed in symfollowset" ) );

		else if ( sym == SYM_EPSILON )
			{ /* do nothing */
			}

		else if ( ABS( ecgroup[sym] ) == transsym )
			nset[++numstates] = tsp;

		bottom: ;
		}

	return numstates;
	}


/* sympartition - partition characters with same out-transitions
 *
 * synopsis
 *    sympartition( int ds[current_max_dfa_size], int numstates,
 *			int symlist[numecs], int duplist[numecs] );
 */

void sympartition( ds, numstates, symlist, duplist )
int ds[], numstates;
int symlist[], duplist[];
	{
	int tch, i, j, k, ns, dupfwd[CSIZE + 1], lenccl, cclp, ich;

	/* Partitioning is done by creating equivalence classes for those
	 * characters which have out-transitions from the given state.  Thus
	 * we are really creating equivalence classes of equivalence classes.
	 */

	for ( i = 1; i <= numecs; ++i )
		{ /* initialize equivalence class list */
		duplist[i] = i - 1;
		dupfwd[i] = i + 1;
		}

	duplist[1] = NIL;
	dupfwd[numecs] = NIL;

	for ( i = 1; i <= numstates; ++i )
		{
		ns = ds[i];
		tch = transchar[ns];

		if ( tch != SYM_EPSILON )
			{
			if ( tch < -lastccl || tch >= csize )
				{
				flexfatal(
		_( "bad transition character detected in sympartition()" ) );
				}

			if ( tch >= 0 )
				{ /* character transition */
				int ec = ecgroup[tch];

				mkechar( ec, dupfwd, duplist );
				symlist[ec] = 1;
				}

			else
				{ /* character class */
				tch = -tch;

				lenccl = ccllen[tch];
				cclp = cclmap[tch];
				mkeccl( ccltbl + cclp, lenccl, dupfwd,
					duplist, numecs, NUL_ec );

				if ( cclng[tch] )
					{
					j = 0;

					for ( k = 0; k < lenccl; ++k )
						{
						ich = ccltbl[cclp + k];

						if ( ich == 0 )
							ich = NUL_ec;

						for ( ++j; j < ich; ++j )
							symlist[j] = 1;
						}

					for ( ++j; j <= numecs; ++j )
						symlist[j] = 1;
					}

				else
					for ( k = 0; k < lenccl; ++k )
						{
						ich = ccltbl[cclp + k];

						if ( ich == 0 )
							ich = NUL_ec;

						symlist[ich] = 1;
						}
				}
			}
		}
	}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人性视频免费网站| 日韩激情中文字幕| 不卡的av网站| 中文字幕制服丝袜成人av| www.亚洲在线| 亚洲激情校园春色| 在线91免费看| 免费不卡在线视频| 久久亚洲精华国产精华液| 成人中文字幕合集| 亚洲精品免费看| 欧美一级日韩免费不卡| 国产一区二区伦理片| 国产精品白丝在线| 欧美蜜桃一区二区三区| 国内偷窥港台综合视频在线播放| 国产亚洲美州欧州综合国| 99视频精品全部免费在线| 午夜激情一区二区| 欧美精品一区在线观看| 91在线观看地址| 蜜臀91精品一区二区三区| 国产精品视频麻豆| 欧美日韩国产在线观看| 国产成人免费视频一区| 亚洲一二三区视频在线观看| 精品国产伦一区二区三区观看方式| 不卡一卡二卡三乱码免费网站| 亚洲成人av一区二区| 国产三级精品三级在线专区| 91久久精品国产91性色tv| 久久精品国产精品亚洲综合| 亚洲黄色免费网站| 久久综合久久鬼色中文字| 色综合久久久久久久久| 国产永久精品大片wwwapp | 成人一区在线观看| 亚洲国产精品一区二区www| 久久午夜免费电影| 欧美三级电影网| 成人av午夜电影| 久久成人18免费观看| 亚洲成av人综合在线观看| 中文字幕av免费专区久久| 欧美一级夜夜爽| 欧美色电影在线| 99在线视频精品| 国产成人精品免费在线| 免费国产亚洲视频| 亚洲国产欧美日韩另类综合 | 中文字幕av资源一区| 欧美卡1卡2卡| 日本精品视频一区二区三区| 国产成人激情av| 狠狠色狠狠色综合系列| 日韩精品成人一区二区三区| 一区二区三区在线视频观看58 | 99久久国产免费看| 国产精品中文字幕欧美| 韩国精品主播一区二区在线观看| 日韩极品在线观看| 日韩精品一卡二卡三卡四卡无卡| 亚洲另类一区二区| 中文字幕亚洲在| 中文字幕精品一区二区三区精品| 欧美变态凌虐bdsm| 日韩一区二区电影| 日韩限制级电影在线观看| 欧美日韩成人激情| 欧美日韩免费观看一区三区| 在线视频你懂得一区| 色综合天天天天做夜夜夜夜做| 成人免费视频播放| aaa欧美大片| jlzzjlzz亚洲日本少妇| 97国产一区二区| 91日韩精品一区| 色域天天综合网| 欧洲一区在线电影| 欧美伦理视频网站| 欧美一区二区三区四区五区| 在线不卡的av| 日韩女优av电影| 久久久午夜电影| 国产精品素人视频| 亚洲精品国久久99热| 亚洲一区二区五区| 午夜久久久影院| 日本v片在线高清不卡在线观看| 免费视频一区二区| 精品一区二区久久久| 国产精品中文字幕一区二区三区| 成人精品国产福利| 日本高清不卡一区| 欧美精品18+| 久久色在线观看| 综合在线观看色| 三级欧美韩日大片在线看| 久久不见久久见免费视频7| 国产露脸91国语对白| www.99精品| 欧美挠脚心视频网站| 久久欧美一区二区| 亚洲欧美激情小说另类| 视频一区在线视频| 国产福利一区二区三区视频 | 国产成人自拍在线| 91在线观看免费视频| 91精品国产色综合久久不卡电影 | 免费成人在线影院| 成人一级视频在线观看| 欧美日韩一卡二卡三卡 | 日韩欧美激情一区| 中文字幕一区二区三区av| 亚洲韩国一区二区三区| 激情综合网天天干| 色综合一个色综合| 久久久噜噜噜久久中文字幕色伊伊| 亚洲欧洲精品天堂一级| 亚洲高清在线视频| 国产精品 日产精品 欧美精品| 日本福利一区二区| 久久久久久久久久电影| 亚洲午夜久久久久久久久电影院| 久久99精品久久久久久| 在线中文字幕一区| 国产三级欧美三级| 视频一区欧美日韩| 91在线精品一区二区| 精品国产一区二区亚洲人成毛片| 亚洲自拍偷拍网站| 成人精品免费视频| 日韩无一区二区| 亚洲一区在线观看网站| 大胆欧美人体老妇| 欧美本精品男人aⅴ天堂| 亚洲精品美腿丝袜| 成人av一区二区三区| 欧美精品一区二区三区蜜桃 | 精品理论电影在线| 亚洲444eee在线观看| 99vv1com这只有精品| 久久精品欧美日韩精品| 日韩精品高清不卡| 欧美在线不卡视频| 亚洲欧洲制服丝袜| 粉嫩绯色av一区二区在线观看| 日韩精品自拍偷拍| 日本成人在线视频网站| 精品视频免费在线| 一区二区三区日韩在线观看| 成人av电影在线观看| 久久久777精品电影网影网| 美女视频黄久久| 欧美一区二区三区公司| 亚洲6080在线| 欧美精品在线视频| 午夜欧美电影在线观看| 欧美日韩中文字幕一区二区| 亚洲精品菠萝久久久久久久| 成人激情文学综合网| 国产精品福利在线播放| 成人精品一区二区三区中文字幕| 欧美国产97人人爽人人喊| 国产suv精品一区二区883| 国产亚洲一区二区三区| 国产一区二区0| 国产无一区二区| 国产一区二区三区久久久| 久久夜色精品一区| 国产激情一区二区三区四区| 国产性色一区二区| 成人精品免费看| 亚洲日韩欧美一区二区在线| 91视视频在线观看入口直接观看www | 欧美成人精品二区三区99精品| 免费成人在线观看视频| 精品国产凹凸成av人导航| 国产一区二区三区观看| 久久精品人人爽人人爽| 99视频精品在线| 亚洲国产日韩一级| 亚洲国产精品黑人久久久| 99久久免费精品高清特色大片| 自拍偷拍国产亚洲| 欧美日本一区二区三区四区| 日韩黄色片在线观看| 日韩免费一区二区三区在线播放| 国产九九视频一区二区三区| 国产精品麻豆视频| 欧美唯美清纯偷拍| 美女视频网站久久| 国产欧美日韩综合精品一区二区| aaa亚洲精品一二三区| 日韩激情在线观看| 国产日韩成人精品| 欧美四级电影网| 国产一区二区电影| 亚洲欧美日韩人成在线播放| 88在线观看91蜜桃国自产|