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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? nfa.c

?? 編譯原理(Flex):生成詞法和語法分析程序的源代碼的程序。
?? C
?? 第 1 頁 / 共 2 頁
字號(hào):
/* nfa - NFA construction routines */

/*-
 * Copyright (c) 1990 The Regents of the University of California.
 * All rights reserved.
 *
 * This code is derived from software contributed to Berkeley by
 * Vern Paxson.
 * 
 * The United States Government has rights in this work pursuant
 * to contract no. DE-AC03-76SF00098 between the United States
 * Department of Energy and the University of California.
 *
 * Redistribution and use in source and binary forms are permitted provided
 * that: (1) source distributions retain this entire copyright notice and
 * comment, and (2) distributions including binaries display the following
 * acknowledgement:  ``This product includes software developed by the
 * University of California, Berkeley and its contributors'' in the
 * documentation or other materials provided with the distribution and in
 * all advertising materials mentioning features or use of this software.
 * Neither the name of the University nor the names of its contributors may
 * be used to endorse or promote products derived from this software without
 * specific prior written permission.
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

/* $Header: /home/daffy/u0/vern/flex/RCS/nfa.c,v 2.17 95/03/04 16:11:42 vern Exp $ */

#include "flexdef.h"


/* declare functions that have forward references */

int dupmachine PROTO((int));
void mkxtion PROTO((int, int));


/* add_accept - add an accepting state to a machine
 *
 * accepting_number becomes mach's accepting number.
 */

void add_accept( mach, accepting_number )
int mach, accepting_number;
	{
	/* Hang the accepting number off an epsilon state.  if it is associated
	 * with a state that has a non-epsilon out-transition, then the state
	 * will accept BEFORE it makes that transition, i.e., one character
	 * too soon.
	 */

	if ( transchar[finalst[mach]] == SYM_EPSILON )
		accptnum[finalst[mach]] = accepting_number;

	else
		{
		int astate = mkstate( SYM_EPSILON );
		accptnum[astate] = accepting_number;
		(void) link_machines( mach, astate );
		}
	}


/* copysingl - make a given number of copies of a singleton machine
 *
 * synopsis
 *
 *   newsng = copysingl( singl, num );
 *
 *     newsng - a new singleton composed of num copies of singl
 *     singl  - a singleton machine
 *     num    - the number of copies of singl to be present in newsng
 */

int copysingl( singl, num )
int singl, num;
	{
	int copy, i;

	copy = mkstate( SYM_EPSILON );

	for ( i = 1; i <= num; ++i )
		copy = link_machines( copy, dupmachine( singl ) );

	return copy;
	}


/* dumpnfa - debugging routine to write out an nfa */

void dumpnfa( state1 )
int state1;

	{
	int sym, tsp1, tsp2, anum, ns;

	fprintf( stderr,
	_( "\n\n********** beginning dump of nfa with start state %d\n" ),
		state1 );

	/* We probably should loop starting at firstst[state1] and going to
	 * lastst[state1], but they're not maintained properly when we "or"
	 * all of the rules together.  So we use our knowledge that the machine
	 * starts at state 1 and ends at lastnfa.
	 */

	/* for ( ns = firstst[state1]; ns <= lastst[state1]; ++ns ) */
	for ( ns = 1; ns <= lastnfa; ++ns )
		{
		fprintf( stderr, _( "state # %4d\t" ), ns );

		sym = transchar[ns];
		tsp1 = trans1[ns];
		tsp2 = trans2[ns];
		anum = accptnum[ns];

		fprintf( stderr, "%3d:  %4d, %4d", sym, tsp1, tsp2 );

		if ( anum != NIL )
			fprintf( stderr, "  [%d]", anum );

		fprintf( stderr, "\n" );
		}

	fprintf( stderr, _( "********** end of dump\n" ) );
	}


/* dupmachine - make a duplicate of a given machine
 *
 * synopsis
 *
 *   copy = dupmachine( mach );
 *
 *     copy - holds duplicate of mach
 *     mach - machine to be duplicated
 *
 * note that the copy of mach is NOT an exact duplicate; rather, all the
 * transition states values are adjusted so that the copy is self-contained,
 * as the original should have been.
 *
 * also note that the original MUST be contiguous, with its low and high
 * states accessible by the arrays firstst and lastst
 */

int dupmachine( mach )
int mach;
	{
	int i, init, state_offset;
	int state = 0;
	int last = lastst[mach];

	for ( i = firstst[mach]; i <= last; ++i )
		{
		state = mkstate( transchar[i] );

		if ( trans1[i] != NO_TRANSITION )
			{
			mkxtion( finalst[state], trans1[i] + state - i );

			if ( transchar[i] == SYM_EPSILON &&
			     trans2[i] != NO_TRANSITION )
				mkxtion( finalst[state],
					trans2[i] + state - i );
			}

		accptnum[state] = accptnum[i];
		}

	if ( state == 0 )
		flexfatal( _( "empty machine in dupmachine()" ) );

	state_offset = state - i + 1;

	init = mach + state_offset;
	firstst[init] = firstst[mach] + state_offset;
	finalst[init] = finalst[mach] + state_offset;
	lastst[init] = lastst[mach] + state_offset;

	return init;
	}


/* finish_rule - finish up the processing for a rule
 *
 * An accepting number is added to the given machine.  If variable_trail_rule
 * is true then the rule has trailing context and both the head and trail
 * are variable size.  Otherwise if headcnt or trailcnt is non-zero then
 * the machine recognizes a pattern with trailing context and headcnt is
 * the number of characters in the matched part of the pattern, or zero
 * if the matched part has variable length.  trailcnt is the number of
 * trailing context characters in the pattern, or zero if the trailing
 * context has variable length.
 */

void finish_rule( mach, variable_trail_rule, headcnt, trailcnt )
int mach, variable_trail_rule, headcnt, trailcnt;
	{
	char action_text[MAXLINE];

	add_accept( mach, num_rules );

	/* We did this in new_rule(), but it often gets the wrong
	 * number because we do it before we start parsing the current rule.
	 */
	rule_linenum[num_rules] = linenum;

	/* If this is a continued action, then the line-number has already
	 * been updated, giving us the wrong number.
	 */
	if ( continued_action )
		--rule_linenum[num_rules];

	sprintf( action_text, "case %d:\n", num_rules );
	add_action( action_text );

	if ( variable_trail_rule )
		{
		rule_type[num_rules] = RULE_VARIABLE;

		if ( performance_report > 0 )
			fprintf( stderr,
			_( "Variable trailing context rule at line %d\n" ),
				rule_linenum[num_rules] );

		variable_trailing_context_rules = true;
		}

	else
		{
		rule_type[num_rules] = RULE_NORMAL;

		if ( headcnt > 0 || trailcnt > 0 )
			{
			/* Do trailing context magic to not match the trailing
			 * characters.
			 */
			char *scanner_cp = "yy_c_buf_p = yy_cp";
			char *scanner_bp = "yy_bp";

			add_action(
	"*yy_cp = yy_hold_char; /* undo effects of setting up yytext */\n" );

			if ( headcnt > 0 )
				{
				sprintf( action_text, "%s = %s + %d;\n",
				scanner_cp, scanner_bp, headcnt );
				add_action( action_text );
				}

			else
				{
				sprintf( action_text, "%s -= %d;\n",
					scanner_cp, trailcnt );
				add_action( action_text );
				}

			add_action(
			"YY_DO_BEFORE_ACTION; /* set up yytext again */\n" );
			}
		}

	/* Okay, in the action code at this point yytext and yyleng have
	 * their proper final values for this rule, so here's the point
	 * to do any user action.  But don't do it for continued actions,
	 * as that'll result in multiple YY_RULE_SETUP's.
	 */
	if ( ! continued_action )
		add_action( "YY_RULE_SETUP\n" );

	line_directive_out( (FILE *) 0, 1 );
	}


/* link_machines - connect two machines together
 *
 * synopsis
 *
 *   new = link_machines( first, last );
 *
 *     new    - a machine constructed by connecting first to last
 *     first  - the machine whose successor is to be last
 *     last   - the machine whose predecessor is to be first
 *
 * note: this routine concatenates the machine first with the machine
 *  last to produce a machine new which will pattern-match first first
 *  and then last, and will fail if either of the sub-patterns fails.
 *  FIRST is set to new by the operation.  last is unmolested.
 */

int link_machines( first, last )
int first, last;
	{
	if ( first == NIL )
		return last;

	else if ( last == NIL )
		return first;

	else
		{
		mkxtion( finalst[first], last );
		finalst[first] = finalst[last];
		lastst[first] = MAX( lastst[first], lastst[last] );
		firstst[first] = MIN( firstst[first], firstst[last] );

		return first;
		}
	}


/* mark_beginning_as_normal - mark each "beginning" state in a machine
 *                            as being a "normal" (i.e., not trailing context-
 *                            associated) states
 *
 * The "beginning" states are the epsilon closure of the first state
 */

void mark_beginning_as_normal( mach )
register int mach;
	{
	switch ( state_type[mach] )
		{
		case STATE_NORMAL:
			/* Oh, we've already visited here. */
			return;

		case STATE_TRAILING_CONTEXT:
			state_type[mach] = STATE_NORMAL;

			if ( transchar[mach] == SYM_EPSILON )
				{
				if ( trans1[mach] != NO_TRANSITION )
					mark_beginning_as_normal(
						trans1[mach] );

				if ( trans2[mach] != NO_TRANSITION )
					mark_beginning_as_normal(
						trans2[mach] );
				}
			break;

		default:
			flexerror(
			_( "bad state type in mark_beginning_as_normal()" ) );
			break;
		}
	}


/* mkbranch - make a machine that branches to two machines
 *
 * synopsis

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区在线观看视频| 欧美撒尿777hd撒尿| 色一区在线观看| 欧美美女黄视频| 久久婷婷久久一区二区三区| 日韩伦理免费电影| 免费在线观看视频一区| 丁香亚洲综合激情啪啪综合| 在线观看区一区二| 欧美电影免费提供在线观看| 国产精品成人免费| 蜜桃av噜噜一区| 99久久久久久99| 欧美一区二区三区在线电影| 中文字幕精品三区| 香蕉久久一区二区不卡无毒影院| 国产精品一区二区男女羞羞无遮挡| 91国偷自产一区二区使用方法| 欧美另类z0zxhd电影| 日本一二三四高清不卡| 日日欢夜夜爽一区| 久久先锋影音av| 亚洲欧美区自拍先锋| 久久99国产精品免费网站| 一本色道久久综合精品竹菊| 亚洲精品一线二线三线无人区| 亚洲老司机在线| 国产精品99精品久久免费| 欧美精品色一区二区三区| 亚洲欧洲av在线| 精品亚洲成a人在线观看| 91美女片黄在线观看91美女| 精品成人一区二区三区| 亚洲曰韩产成在线| 成人理论电影网| 精品福利一二区| 亚洲超碰97人人做人人爱| 波多野洁衣一区| 久久青草欧美一区二区三区| 日韩高清在线观看| 日本电影欧美片| 欧美韩国日本综合| 久久99精品久久久久| 911国产精品| 亚洲综合色网站| 91蜜桃在线免费视频| 久久精品视频一区二区| 久久精品72免费观看| 欧美日韩中文字幕一区二区| 亚洲精选在线视频| 99这里只有精品| 国产日产欧美一区二区三区| 久久91精品久久久久久秒播| 7777女厕盗摄久久久| 亚洲图片自拍偷拍| 色香蕉成人二区免费| 国产精品久久久久久久久晋中 | 欧美成人乱码一区二区三区| 亚洲成av人片在www色猫咪| 91久久精品日日躁夜夜躁欧美| 国产精品伦一区二区三级视频| 国产一区二区调教| 欧美大胆一级视频| 美美哒免费高清在线观看视频一区二区 | 91精品国产一区二区| 亚洲一区二区不卡免费| 色婷婷综合久色| 亚洲欧美激情视频在线观看一区二区三区| 国产999精品久久久久久| 日本一区二区三级电影在线观看| 国产精品影视天天线| 国产亚洲精品资源在线26u| 韩国女主播一区| 久久亚洲捆绑美女| 国产一区二区伦理片| 久久免费偷拍视频| 国产美女av一区二区三区| 亚洲.国产.中文慕字在线| 欧美三级乱人伦电影| 午夜精品福利一区二区蜜股av| 欧美日韩一二三区| 天涯成人国产亚洲精品一区av| 91精品国产色综合久久| 久久精品国产成人一区二区三区| 精品动漫一区二区三区在线观看| 国产精品一区在线| 国产精品色婷婷久久58| 91小视频免费观看| 亚洲大片精品永久免费| 欧美一区二区免费| 国产一区二区剧情av在线| 中文字幕精品—区二区四季| 在线一区二区三区四区| 婷婷久久综合九色综合绿巨人| 日韩欧美一级精品久久| 国产成人免费av在线| 综合网在线视频| 欧美日韩一区三区四区| 久久99深爱久久99精品| 国产精品你懂的| 欧美系列一区二区| 日韩成人午夜电影| www国产精品av| 成人精品高清在线| 亚洲综合色成人| 精品日韩欧美在线| 99免费精品视频| 午夜电影一区二区三区| 久久久www免费人成精品| 一本大道av一区二区在线播放| 婷婷成人综合网| 中文乱码免费一区二区| 欧美午夜电影一区| 国产精品亚洲一区二区三区在线| ...av二区三区久久精品| 在线成人午夜影院| 成人av网站在线| 日韩av电影免费观看高清完整版在线观看 | 亚洲女同ⅹxx女同tv| 欧美肥妇free| 成av人片一区二区| 日韩成人精品在线观看| 国产精品美女久久久久久久网站| 欧美日韩一级二级| 成人av网址在线观看| 日本不卡中文字幕| 亚洲欧洲日韩av| 欧美一级精品在线| 色婷婷av一区二区| 国产成人综合精品三级| 五月天丁香久久| 国产精品国产三级国产aⅴ入口| 91精品国产欧美一区二区成人| 高清成人在线观看| 日韩**一区毛片| 亚洲欧美综合色| 精品国产凹凸成av人网站| 色婷婷久久一区二区三区麻豆| 国产精品综合二区| 日韩精品成人一区二区在线| 亚洲女爱视频在线| 久久免费视频色| 欧美一级xxx| 欧洲色大大久久| 日韩视频在线你懂得| 色婷婷综合视频在线观看| 成人一级黄色片| 精品综合免费视频观看| 亚洲成a人片在线观看中文| 中文字幕一区二区日韩精品绯色| 欧美成人一区二区三区| 精品视频123区在线观看| 99久久精品国产一区二区三区| 国产在线不卡视频| 麻豆精品国产传媒mv男同| 亚洲va中文字幕| 亚洲乱码国产乱码精品精的特点| 亚洲国产成人一区二区三区| 日韩精品中午字幕| 91精品免费观看| 在线成人av网站| 欧美无人高清视频在线观看| 91小宝寻花一区二区三区| 成人午夜伦理影院| 国产乱码精品一区二区三区忘忧草| 日韩高清在线电影| 性做久久久久久| 香蕉影视欧美成人| 亚洲一区二区三区激情| 一区二区三区在线免费观看| 亚洲猫色日本管| 亚洲欧美日韩中文播放| 亚洲视频资源在线| 中文字幕一区二区三区色视频| 国产精品国产精品国产专区不蜜 | 成人一级黄色片| 国产激情视频一区二区在线观看| 久99久精品视频免费观看| 极品销魂美女一区二区三区| 久久av老司机精品网站导航| 久久精品国产亚洲高清剧情介绍 | 久久先锋影音av鲁色资源网| 精品福利在线导航| 久久久久九九视频| 国产日产亚洲精品系列| 国产精品国产精品国产专区不蜜| 国产精品久99| 亚洲男同性视频| 亚洲自拍欧美精品| 丝袜诱惑制服诱惑色一区在线观看 | 国产精品亚洲视频| 国产成人一级电影| 成人黄色电影在线| 91亚洲大成网污www| 日本福利一区二区| 欧美日本乱大交xxxxx| 日韩欧美国产小视频| 精品99一区二区| 中文欧美字幕免费| 亚洲精品美腿丝袜|