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

📄 lex.yy.c

📁 Ho Chi Minh City University of Technology Computer Science Department Distributed Computing E
💻 C
字号:
#include <stdio.h># define U(x) x# define NLSTATE yyprevious=YYNEWLINE# define BEGIN yybgin = yysvec + 1 +# define INITIAL 0# define YYLERR yysvec# define YYSTATE (yyestate-yysvec-1)# define YYOPTIM 1# define YYLMAX BUFSIZ#ifndef __cplusplus# define output(c) (void)putc(c,yyout)#else# define lex_output(c) (void)putc(c,yyout)#endif#if defined(__cplusplus) || defined(__STDC__)#if defined(__cplusplus) && defined(__EXTERN_C__)extern "C" {#endif	int yyback(int *, int);	int yyinput(void);	int yylook(void);	void yyoutput(int);	int yyracc(int);	int yyreject(void);	void yyunput(int);	int yylex(void);#ifdef YYLEX_E	void yywoutput(wchar_t);	wchar_t yywinput(void);#endif#ifndef yyless	int yyless(int);#endif#ifndef yywrap	int yywrap(void);#endif#ifdef LEXDEBUG	void allprint(char);	void sprint(char *);#endif#if defined(__cplusplus) && defined(__EXTERN_C__)}#endif#ifdef __cplusplusextern "C" {#endif	void exit(int);#ifdef __cplusplus}#endif#endif# define unput(c) {yytchar= (c);if(yytchar=='\n')yylineno--;*yysptr++=yytchar;}# define yymore() (yymorfg=1)#ifndef __cplusplus# define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)#else# define lex_input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)#endif#define ECHO fprintf(yyout, "%s",yytext)# define REJECT { nstr = yyreject(); goto yyfussy;}int yyleng;char yytext[YYLMAX];int yymorfg;extern char *yysptr, yysbuf[];int yytchar;FILE *yyin = {stdin}, *yyout = {stdout};extern int yylineno;struct yysvf { 	struct yywork *yystoff;	struct yysvf *yyother;	int *yystops;};struct yysvf *yyestate;extern struct yysvf yysvec[], *yybgin;#include <stdlib.h>#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include "dce_def.h"#define PORT  1#define MADDR 2#define EQUAL 3#define NUM   4#define ADDR  5#define TIME  6int  TIMEOUT_IAMALIVE;# define YYNEWLINE 10yylex(){int nstr; extern int yyprevious;#ifdef __cplusplus/* to avoid CC and lint complaining yyfussy not being used ...*/static int __lex_hack = 0;if (__lex_hack) goto yyfussy;#endifwhile((nstr = yylook()) >= 0)yyfussy: switch(nstr){case 0:if(yywrap()) return(0); break;case 1:# line 21 "/home/e9406114/_project/src/core/dceconf.l" while (input()!='\n');break;case 2:# line 22 "/home/e9406114/_project/src/core/dceconf.l" return EQUAL;break;case 3:# line 23 "/home/e9406114/_project/src/core/dceconf.l"return MADDR;break;case 4:# line 24 "/home/e9406114/_project/src/core/dceconf.l"return PORT;break;case 5:# line 25 "/home/e9406114/_project/src/core/dceconf.l" return TIME;break;case 6:# line 26 "/home/e9406114/_project/src/core/dceconf.l" return ADDR;break;case 7:# line 27 "/home/e9406114/_project/src/core/dceconf.l"  return NUM;break;case 8:# line 28 "/home/e9406114/_project/src/core/dceconf.l"{}break;case -1:break;default:(void)fprintf(yyout,"bad switch yylook %d",nstr);} return(0); }/* end of yylex */intdce_readconf (u_long * maddr, int *mport){  static int nPort;  static u_long uAddr;  int nToken;  char buf[256];  if (nPort)    {      *maddr = uAddr;      *mport = nPort;      return 1;    }  sprintf (buf, "%s/dce.conf", getenv ("DCE_ROOT"));  if ((yyin = fopen (buf, "rt")))    while ((nToken = yylex ()) > 0)      switch (nToken)	{	case MADDR:	  if ((yylex () == EQUAL) && (yylex () == ADDR))	    uAddr = inet_addr (yytext);	  break;	case PORT:	  if ((yylex () == EQUAL) && (yylex () == NUM))	    nPort = atol (yytext);	  break;	case TIME:	  if ((yylex()==EQUAL) && (yylex () == NUM))	  TIMEOUT_IAMALIVE = atoi (yytext);	  break;	}  if (yyin)    fclose (yyin);  if ((IN_MULTICAST (ntohl (uAddr))) && (nPort > 1024))    {      *maddr = uAddr;      *mport = nPort;      if (TIMEOUT_IAMALIVE<_TIMEOUT_IAMALIVE) TIMEOUT_IAMALIVE=_TIMEOUT_IAMALIVE;      return 1;    }  fprintf (stderr, "Error in Read file %s or DCE_ROOT variable not found\n", buf);  exit (-1);}int yyvstop[] = {0,8,0,8,0,8,0,1,0,7,0,2,0,5,0,3,0,4,0,6,0,0};# define YYTYPE unsigned charstruct yywork { YYTYPE verify, advance; } yycrank[] = {0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	1,3,	1,3,	1,3,	3,3,	3,3,	3,3,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	1,4,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	13,17,	21,24,	1,5,	1,5,	1,5,	1,5,	1,5,	1,5,	1,5,	1,5,	1,5,	1,5,	0,0,	0,0,	5,9,	1,6,	5,5,	5,5,	5,5,	5,5,	5,5,	5,5,	5,5,	5,5,	5,5,	5,5,	9,13,	9,13,	9,13,	9,13,	9,13,	9,13,	9,13,	9,13,	9,13,	9,13,	17,21,	17,21,	17,21,	17,21,	17,21,	17,21,	17,21,	17,21,	17,21,	17,21,	0,0,	0,0,	0,0,	0,0,	0,0,	7,10,	0,0,	0,0,	10,14,	14,18,	16,20,	0,0,	0,0,	8,12,	0,0,	0,0,	0,0,	1,7,	12,16,	11,15,	7,11,	0,0,	15,19,	18,22,	1,8,	19,23,	0,0,	0,0,	0,0,	0,0,	0,0,	0,0,	1,3,	0,0,	0,0,	3,3,	24,25,	24,25,	24,25,	24,25,	24,25,	24,25,	24,25,	24,25,	24,25,	24,25,	0,0,	0,0};struct yysvf yysvec[] = {0,	0,	0,yycrank+1,	0,		yyvstop+1,yycrank+0,	yysvec+1,	yyvstop+3,yycrank+4,	0,		yyvstop+5,yycrank+0,	0,		yyvstop+7,yycrank+15,	0,		yyvstop+9,yycrank+0,	0,		yyvstop+11,yycrank+1,	0,		0,	yycrank+1,	0,		0,	yycrank+25,	0,		0,	yycrank+1,	0,		0,	yycrank+1,	0,		0,	yycrank+2,	0,		0,	yycrank+1,	yysvec+9,	0,	yycrank+2,	0,		0,	yycrank+1,	0,		0,	yycrank+2,	0,		0,	yycrank+35,	0,		0,	yycrank+2,	0,		0,	yycrank+2,	0,		0,	yycrank+0,	0,		yyvstop+13,yycrank+2,	yysvec+17,	0,	yycrank+0,	0,		yyvstop+15,yycrank+0,	0,		yyvstop+17,yycrank+81,	0,		0,	yycrank+0,	yysvec+24,	yyvstop+19,0,	0,	0};struct yywork *yytop = yycrank+138;struct yysvf *yybgin = yysvec+1;char yymatch[] = {  0,   1,   1,   1,   1,   1,   1,   1,   8,   8,   8,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,  48,  48,  48,  48,  48,  48,  48,  48,  48,  48,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   8,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1, 0};char yyextra[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};/*	Copyright (c) 1989 AT&T	*//*	  All Rights Reserved  	*//*	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T	*//*	The copyright notice above does not evidence any   	*//*	actual or intended publication of such source code.	*/#pragma ident	"@(#)ncform	6.8	95/02/11 SMI"int yylineno =1;# define YYU(x) x# define NLSTATE yyprevious=YYNEWLINEstruct yysvf *yylstate [YYLMAX], **yylsp, **yyolsp;char yysbuf[YYLMAX];char *yysptr = yysbuf;int *yyfnd;extern struct yysvf *yyestate;int yyprevious = YYNEWLINE;#if defined(__cplusplus) || defined(__STDC__)int yylook(void)#elseyylook()#endif{	register struct yysvf *yystate, **lsp;	register struct yywork *yyt;	struct yysvf *yyz;	int yych, yyfirst;	struct yywork *yyr;# ifdef LEXDEBUG	int debug;# endif	char *yylastch;	/* start off machines */# ifdef LEXDEBUG	debug = 0;# endif	yyfirst=1;	if (!yymorfg)		yylastch = yytext;	else {		yymorfg=0;		yylastch = yytext+yyleng;		}	for(;;){		lsp = yylstate;		yyestate = yystate = yybgin;		if (yyprevious==YYNEWLINE) yystate++;		for (;;){# ifdef LEXDEBUG			if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1);# endif			yyt = yystate->yystoff;			if(yyt == yycrank && !yyfirst){  /* may not be any transitions */				yyz = yystate->yyother;				if(yyz == 0)break;				if(yyz->yystoff == yycrank)break;				}#ifndef __cplusplus			*yylastch++ = yych = input();#else			*yylastch++ = yych = lex_input();#endif			if(yylastch > &yytext[YYLMAX]) {				fprintf(yyout,"Input string too long, limit %d\n",YYLMAX);				exit(1);			}			yyfirst=0;		tryagain:# ifdef LEXDEBUG			if(debug){				fprintf(yyout,"char ");				allprint(yych);				putchar('\n');				}# endif			yyr = yyt;			if ( (int)yyt > (int)yycrank){				yyt = yyr + yych;				if (yyt <= yytop && yyt->verify+yysvec == yystate){					if(yyt->advance+yysvec == YYLERR)	/* error transitions */						{unput(*--yylastch);break;}					*lsp++ = yystate = yyt->advance+yysvec;					if(lsp > &yylstate[YYLMAX]) {						fprintf(yyout,"Input string too long, limit %d\n",YYLMAX);						exit(1);					}					goto contin;					}				}# ifdef YYOPTIM			else if((int)yyt < (int)yycrank) {		/* r < yycrank */				yyt = yyr = yycrank+(yycrank-yyt);# ifdef LEXDEBUG				if(debug)fprintf(yyout,"compressed state\n");# endif				yyt = yyt + yych;				if(yyt <= yytop && yyt->verify+yysvec == yystate){					if(yyt->advance+yysvec == YYLERR)	/* error transitions */						{unput(*--yylastch);break;}					*lsp++ = yystate = yyt->advance+yysvec;					if(lsp > &yylstate[YYLMAX]) {						fprintf(yyout,"Input string too long, limit %d\n",YYLMAX);						exit(1);					}					goto contin;					}				yyt = yyr + YYU(yymatch[yych]);# ifdef LEXDEBUG				if(debug){					fprintf(yyout,"try fall back character ");					allprint(YYU(yymatch[yych]));					putchar('\n');					}# endif				if(yyt <= yytop && yyt->verify+yysvec == yystate){					if(yyt->advance+yysvec == YYLERR)	/* error transition */						{unput(*--yylastch);break;}					*lsp++ = yystate = yyt->advance+yysvec;					if(lsp > &yylstate[YYLMAX]) {						fprintf(yyout,"Input string too long, limit %d\n",YYLMAX);						exit(1);					}					goto contin;					}				}			if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){# ifdef LEXDEBUG				if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1);# endif				goto tryagain;				}# endif			else				{unput(*--yylastch);break;}		contin:# ifdef LEXDEBUG			if(debug){				fprintf(yyout,"state %d char ",yystate-yysvec-1);				allprint(yych);				putchar('\n');				}# endif			;			}# ifdef LEXDEBUG		if(debug){			fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1);			allprint(yych);			putchar('\n');			}# endif		while (lsp-- > yylstate){			*yylastch-- = 0;			if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){				yyolsp = lsp;				if(yyextra[*yyfnd]){		/* must backup */					while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){						lsp--;						unput(*yylastch--);						}					}				yyprevious = YYU(*yylastch);				yylsp = lsp;				yyleng = yylastch-yytext+1;				yytext[yyleng] = 0;# ifdef LEXDEBUG				if(debug){					fprintf(yyout,"\nmatch ");					sprint(yytext);					fprintf(yyout," action %d\n",*yyfnd);					}# endif				return(*yyfnd++);				}			unput(*yylastch);			}		if (yytext[0] == 0  /* && feof(yyin) */)			{			yysptr=yysbuf;			return(0);			}#ifndef __cplusplus		yyprevious = yytext[0] = input();		if (yyprevious>0)			output(yyprevious);#else		yyprevious = yytext[0] = lex_input();		if (yyprevious>0)			lex_output(yyprevious);#endif		yylastch=yytext;# ifdef LEXDEBUG		if(debug)putchar('\n');# endif		}	}#if defined(__cplusplus) || defined(__STDC__)int yyback(int *p, int m)#elseyyback(p, m)	int *p;#endif{	if (p==0) return(0);	while (*p) {		if (*p++ == m)			return(1);	}	return(0);}	/* the following are only used in the lex library */#if defined(__cplusplus) || defined(__STDC__)int yyinput(void)#elseyyinput()#endif{#ifndef __cplusplus	return(input());#else	return(lex_input());#endif	}#if defined(__cplusplus) || defined(__STDC__)void yyoutput(int c)#elseyyoutput(c)  int c; #endif{#ifndef __cplusplus	output(c);#else	lex_output(c);#endif	}#if defined(__cplusplus) || defined(__STDC__)void yyunput(int c)#elseyyunput(c)   int c; #endif{	unput(c);	}

⌨️ 快捷键说明

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