⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vtc.c

📁 使用BorlandC++4.5编译的一个MUD客户端程序
💻 C
📖 第 1 页 / 共 4 页
字号:
	",",	44,	"=",	61,	"TA",	272,	"DA",	273,	"MA",	274,	"AA",	275,	"SA",	276,	"SLA",	277,	"SRA",	278,	"BAA",	279,	"BXA",	280,	"BOA",	281,	"CONDA",	282,	"?",	63,	":",	58,	"DEREF",	283,	"OR",	284,	"AND",	285,	"|",	124,	"^",	94,	"&",	38,	"EQ",	286,	"NE",	287,	"<",	60,	"LE",	288,	">",	62,	"GE",	289,	"SL",	290,	"SR",	291,	"+",	43,	"-",	45,	"*",	42,	"/",	47,	"%",	37,	"!",	33,	"~",	126,	"INC",	292,	"DEC",	293,	"(",	40,	")",	41,	"[",	91,	"]",	93,	"-unknown-",	-1	/* ends search */};__YYSCLASS char * yyreds[] ={	"-no such reduction-",	"directive : fdecl FASSIGN expr",	"directive : fdecl tdecl compound",	"directive : tdecl command",	"command : stmt",	"command : command stmt",	"fdecl : FUNC unreserved adecl",	"adecl : '(' optargs ')'",	"adecl : '(' params",	"adecl : '(' params optargs ')'",	"tdecl : /* empty */",	"tdecl : '[' ']'",	"tdecl : '[' locals ']'",	"optargs : /* empty */",	"optargs : '/' params",	"params : unreserved",	"params : params ',' unreserved",	"locals : unreserved",	"locals : locals ',' unreserved",	"post : postlval",	"post : postfix",	"postlval : IDENT",	"postlval : BOBJ",	"postlval : post DEREF IDENT",	"postlval : post '[' expr ']'",	"postlval : post '[' ICONST ']'",	"postlval : '(' lval ')'",	"lval : postlval",	"lval : '*' unary",	"atom : ICONST",	"atom : SCONST",	"atom : '.' unreserved",	"atom : IDENT '(' args ')'",	"atom : '(' lval ')' '(' args ')'",	"atom : '(' expr ')'",	"postfix : atom",	"postfix : postlval INC",	"postfix : postlval DEC",	"unary : postfix",	"unary : lval",	"unary : INC lval",	"unary : DEC lval",	"unary : '!' unary",	"unary : '~' unary",	"unary : '-' unary",	"unary : '+' unary",	"unary : '&' lval",	"binary : unary",	"binary : binary OR",	"binary : binary OR binary",	"binary : binary AND",	"binary : binary AND binary",	"binary : binary '|' binary",	"binary : binary '^' binary",	"binary : binary '&' binary",	"binary : binary EQ binary",	"binary : binary NE binary",	"binary : binary '<' binary",	"binary : binary LE binary",	"binary : binary '>' binary",	"binary : binary GE binary",	"binary : binary SL binary",	"binary : binary SR binary",	"binary : binary '+' binary",	"binary : binary '-' binary",	"binary : binary '*' binary",	"binary : binary '/' binary",	"binary : binary '%' binary",	"binary : binary '?'",	"binary : binary '?' binary ':'",	"binary : binary '?' binary ':' binary",	"binary : binary '?' ':'",	"binary : binary '?' ':' binary",	"assign : binary",	"assign : lval '=' assign",	"assign : lval asn_op",	"assign : lval asn_op assign",	"assign : lval CONDA",	"assign : lval CONDA assign",	"asn_op : TA",	"asn_op : DA",	"asn_op : MA",	"asn_op : AA",	"asn_op : SA",	"asn_op : SLA",	"asn_op : SRA",	"asn_op : BAA",	"asn_op : BXA",	"asn_op : BOA",	"expr : assign",	"expr : expr ','",	"expr : expr ',' assign",	"exprv : assign",	"exprv : exprv ',' assign",	"args : /* empty */",	"args : exprv",	"oexprn : /* empty */",	"oexprn : expr",	"oexprv : /* empty */",	"oexprv : expr",	"compound : '{' stmtlist '}'",	"stmtlist : /* empty */",	"stmtlist : stmtlist stmt",	"ifcond : IF '(' expr ')'",	"stmt : compound",	"stmt : oexprn ';'",	"stmt : ifcond stmt",	"stmt : ifcond stmt ELSE",	"stmt : ifcond stmt ELSE stmt",	"stmt : WHILE",	"stmt : WHILE '(' expr ')'",	"stmt : WHILE '(' expr ')' stmt",	"stmt : DO",	"stmt : DO stmt",	"stmt : DO stmt WHILE '(' expr ')'",	"stmt : FOR '(' oexprn ';'",	"stmt : FOR '(' oexprn ';' oexprv ';'",	"stmt : FOR '(' oexprn ';' oexprv ';' oexprn ')'",	"stmt : FOR '(' oexprn ';' oexprv ';' oexprn ')' stmt",	"stmt : IDENT ':'",	"stmt : IDENT ':' stmt",	"stmt : GOTO IDENT ';'",	"stmt : BREAK ';'",	"stmt : CONTINUE ';'",	"stmt : RETURN ';'",	"stmt : RETURN expr ';'",	"unreserved : IDENT",	"unreserved : reserved",	"reserved : BOBJ",	"reserved : DO",	"reserved : WHILE",	"reserved : IF",	"reserved : ELSE",	"reserved : FOR",	"reserved : FUNC",	"reserved : GOTO",	"reserved : BREAK",	"reserved : CONTINUE",	"reserved : RETURN",	"reserved : ICONST",};#endif /* YYDEBUG */#define YYFLAG  (-3000)/* @(#) $Revision: 2.1 $ */    /*** Skeleton parser driver for yacc output*/#if defined(NLS) && !defined(NL_SETN)#include <msgbuf.h>#endif#ifndef nl_msg#define nl_msg(i,s) (s)#endif/*** yacc user known macros and defines*/#define YYERROR		goto yyerrlab#ifndef __RUNTIME_YYMAXDEPTH#define YYACCEPT	return(0)#define YYABORT		return(1)#else#define YYACCEPT	{free_stacks(); return(0);}#define YYABORT		{free_stacks(); return(1);}#endif#define YYBACKUP( newtoken, newvalue )\{\	if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\	{\		yyerror( (nl_msg(30001,"syntax error - cannot backup")) );\		goto yyerrlab;\	}\	yychar = newtoken;\	yystate = *yyps;\	yylval = newvalue;\	goto yynewstate;\}#define YYRECOVERING()	(!!yyerrflag)#ifndef YYDEBUG#	define YYDEBUG	1	/* make debugging available */#endif/*** user known globals*/int yydebug;			/* set to 1 to get debugging *//*** driver internal defines*//* define for YYFLAG now generated by yacc program. *//*#define YYFLAG		(FLAGVAL)*//*** global variables used by the parser*/# ifndef __RUNTIME_YYMAXDEPTH__YYSCLASS YYSTYPE yyv[ YYMAXDEPTH ];	/* value stack */__YYSCLASS int yys[ YYMAXDEPTH ];		/* state stack */# else__YYSCLASS YYSTYPE *yyv;			/* pointer to malloc'ed value stack */__YYSCLASS int *yys;			/* pointer to malloc'ed stack stack */#if defined(__STDC__) || defined (__cplusplus)#include <stdlib.h>#else	extern char *malloc();	extern char *realloc();	extern void free();#endif /* __STDC__ or __cplusplus */static int allocate_stacks(); static void free_stacks();# ifndef YYINCREMENT# define YYINCREMENT (YYMAXDEPTH/2) + 10# endif# endif	/* __RUNTIME_YYMAXDEPTH */long  yymaxdepth = YYMAXDEPTH;__YYSCLASS YYSTYPE *yypv;			/* top of value stack */__YYSCLASS int *yyps;			/* top of state stack */__YYSCLASS int yystate;			/* current state */__YYSCLASS int yytmp;			/* extra var (lasts between blocks) */int yynerrs;			/* number of errors */__YYSCLASS int yyerrflag;			/* error recovery flag */int yychar;			/* current input token number *//*** yyparse - return 0 if worked, 1 if syntax error not recovered from*/intyyparse(){	register YYSTYPE *yypvt;	/* top of value stack for $vars */	/*	** Initialize externals - yyparse may be called more than once	*/# ifdef __RUNTIME_YYMAXDEPTH	if (allocate_stacks()) YYABORT;# endif	yypv = &yyv[-1];	yyps = &yys[-1];	yystate = 0;	yytmp = 0;	yynerrs = 0;	yyerrflag = 0;	yychar = -1;	goto yystack;	{		register YYSTYPE *yy_pv;	/* top of value stack */		register int *yy_ps;		/* top of state stack */		register int yy_state;		/* current state */		register int  yy_n;		/* internal state number info */		/*		** get globals into registers.		** branch to here only if YYBACKUP was called.		*/	yynewstate:		yy_pv = yypv;		yy_ps = yyps;		yy_state = yystate;		goto yy_newstate;		/*		** get globals into registers.		** either we just started, or we just finished a reduction		*/	yystack:		yy_pv = yypv;		yy_ps = yyps;		yy_state = yystate;		/*		** top of for (;;) loop while no reductions done		*/	yy_stack:		/*		** put a state and value onto the stacks		*/#if YYDEBUG		/*		** if debugging, look up token value in list of value vs.		** name pairs.  0 and negative (-1) are special values.		** Note: linear search is used since time is not a real		** consideration while debugging.		*/		if ( yydebug )		{			register int yy_i;			printf( "State %d, token ", yy_state );			if ( yychar == 0 )				printf( "end-of-file\n" );			else if ( yychar < 0 )				printf( "-none-\n" );			else			{				for ( yy_i = 0; yytoks[yy_i].t_val >= 0;					yy_i++ )				{					if ( yytoks[yy_i].t_val == yychar )						break;				}				printf( "%s\n", yytoks[yy_i].t_name );			}		}#endif /* YYDEBUG */		if ( ++yy_ps >= &yys[ yymaxdepth ] )	/* room on stack? */		{# ifndef __RUNTIME_YYMAXDEPTH			yyerror( (nl_msg(30002,"yacc stack overflow")) );			YYABORT;# else			/* save old stack bases to recalculate pointers */			YYSTYPE * yyv_old = yyv;			int * yys_old = yys;			yymaxdepth += YYINCREMENT;			yys = (int *) realloc(yys, yymaxdepth * sizeof(int));			yyv = (YYSTYPE *) realloc(yyv, yymaxdepth * sizeof(YYSTYPE));			if (yys==0 || yyv==0) {			    yyerror( (nl_msg(30002,"yacc stack overflow")) );			    YYABORT;			    }			/* Reset pointers into stack */			yy_ps = (yy_ps - yys_old) + yys;			yyps = (yyps - yys_old) + yys;			yy_pv = (yy_pv - yyv_old) + yyv;			yypv = (yypv - yyv_old) + yyv;# endif		}		*yy_ps = yy_state;		*++yy_pv = yyval;		/*		** we have a new state - find out what to do		*/	yy_newstate:		if ( ( yy_n = yypact[ yy_state ] ) <= YYFLAG )			goto yydefault;		/* simple state */#if YYDEBUG		/*		** if debugging, need to mark whether new token grabbed		*/		yytmp = yychar < 0;#endif		if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )			yychar = 0;		/* reached EOF */#if YYDEBUG		if ( yydebug && yytmp )		{			register int yy_i;			printf( "Received token " );			if ( yychar == 0 )				printf( "end-of-file\n" );			else if ( yychar < 0 )				printf( "-none-\n" );			else			{				for ( yy_i = 0; yytoks[yy_i].t_val >= 0;					yy_i++ )				{					if ( yytoks[yy_i].t_val == yychar )						break;				}				printf( "%s\n", yytoks[yy_i].t_name );			}		}#endif /* YYDEBUG */		if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) )			goto yydefault;		if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar )	/*valid shift*/		{			yychar = -1;			yyval = yylval;			yy_state = yy_n;			if ( yyerrflag > 0 )				yyerrflag--;			goto yy_stack;		}	yydefault:		if ( ( yy_n = yydef[ yy_state ] ) == -2 )		{#if YYDEBUG			yytmp = yychar < 0;#endif			if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )				yychar = 0;		/* reached EOF */#if YYDEBUG			if ( yydebug && yytmp )			{				register int yy_i;				printf( "Received token " );				if ( yychar == 0 )					printf( "end-of-file\n" );				else if ( yychar < 0 )					printf( "-none-\n" );				else				{					for ( yy_i = 0;						yytoks[yy_i].t_val >= 0;						yy_i++ )					{						if ( yytoks[yy_i].t_val							== yychar )						{							break;						}					}					printf( "%s\n", yytoks[yy_i].t_name );				}			}#endif /* YYDEBUG */			/*			** look through exception table			*/			{				register int *yyxi = yyexca;				while ( ( *yyxi != -1 ) ||					( yyxi[1] != yy_state ) )				{					yyxi += 2;				}				while ( ( *(yyxi += 2) >= 0 ) &&					( *yyxi != yychar ) )					;				if ( ( yy_n = yyxi[1] ) < 0 )					YYACCEPT;			}		}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -