lex.yy.c

来自「circuit calculation program」· C语言 代码 · 共 1,942 行 · 第 1/4 页

C
1,942
字号
       84,    9,   10,   17,    1,    2,    2,    2,    2,    2,        9,   10,   17,   63,   63,   75,   73,   71,    2,    3,        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,        3,    3,    3,    3,    3,    3,    3,    3,    5,    5,        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,        5,    5,    5,    5,    5,    5,    5,    7,    7,    7,        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,        7,    7,    7,    7,    7,    7,   11,   69,   64,   18,       83,   65,   62,   61,   55,   11,   11,   12,   18,   64,       53,   83,   51,   49,   47,   44,   12,   12,   13,   13,       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,       13,   13,   13,   13,   13,   13,   13,   15,   42,   15,       40,   34,   31,   28,   23,   21,   15,   16,    0,   16,        0,    0,    0,    0,    0,    0,   16,   19,   19,   19,       19,   19,   19,   19,   19,   19,   19,   19,   19,   19,       19,   19,   19,   19,   19,   19,   36,   36,    0,   36,        0,   36,   36,   36,   36,   36,   36,   36,   36,   36,       36,   36,   36,   36,   36,   37,    0,    0,    0,    0,        0,    0,   37,   37,    0,    0,   37,    0,   37,   54,       54,    0,    0,    0,   54,   54,   57,   57,   57,   57,       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,       57,   57,   57,   57,   57,   58,   58,   58,   58,   58,       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,       58,   58,   58,   58,   59,   59,   59,   59,   59,   59,       59,   59,   59,   59,   59,   59,   59,   59,   59,   59,       59,   59,   59,   60,    0,    0,    0,    0,    0,    0,       60,   60,    0,    0,   60,    0,   60,   74,   74,   74,       74,   74,   74,   74,   74,   74,   74,   74,   74,   74,       74,   74,   74,   74,   74,   74,   82,   82,   82,   82,       82,   82,   82,   82,   82,   82,   82,   82,   82,   82,       82,   82,   82,   82,   82,   85,   85,   85,   85,   85,       85,   85,   85,   85,   85,   85,   85,   85,   85,   85,       85,   85,   85,   85,   86,   86,   86,   86,   86,   86,       86,   86,   86,   86,   86,   86,   86,   86,   86,   86,       86,   86,   86,   87,   87,   87,   87,   87,   87,   87,       87,   87,   87,   87,   87,   87,   87,   87,   87,   87,       87,   87,   88,   88,   88,   88,   88,   88,   88,   88,       88,   88,   88,   88,   88,   88,   88,   88,   88,   88,       88,   89,    0,    0,    0,    0,    0,    0,    0,   89,        0,    0,   89,  105,    0,    0,    0,    0,    0,    0,        0,  105,    0,    0,  105,  126,  126,  126,  126,  127,        0,  127,  127,  128,    0,  128,  128,  129,    0,  129,      129,  130,    0,  130,  130,  131,  131,  131,  131,  132,        0,    0,  132,  133,  133,  133,  134,    0,  134,  134,      135,    0,  135,  135,  136,    0,  136,  136,  137,    0,      137,  137,  138,    0,  138,  138,  139,    0,  139,  139,      140,    0,  140,  140,  141,    0,  141,  141,  142,    0,      142,  142,  143,    0,  143,  143,  144,    0,  144,  144,      145,    0,  145,  145,  146,    0,  146,  146,  147,    0,      147,  147,  148,    0,  148,  148,  149,    0,  149,  149,      150,    0,  150,  150,  151,    0,  151,  151,  152,    0,      152,  152,  153,    0,  153,  153,  125,  125,  125,  125,      125,  125,  125,  125,  125,  125,  125,  125,  125,  125,      125,  125,  125,  125,  125,  125    } ;static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;static char *yy_full_match;static int yy_lp;#define REJECT \{ \*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \yy_cp = yy_full_match; /* restore poss. backed-over text */ \++yy_lp; \goto find_rule; \}static int yy_more_offset = 0;static int yy_prev_more_offset = 0;#define yymore() (yy_more_offset = yy_flex_strlen( yytext ))#define YY_NEED_STRLEN#define YY_MORE_ADJ 0#define YY_RESTORE_YY_MORE_OFFSET \	{ \	yy_more_offset = yy_prev_more_offset; \	yyleng -= yy_more_offset; \	}#ifndef YYLMAX#define YYLMAX 8192#endifchar yytext[YYLMAX];char *yytext_ptr;#line 1 "netlist.l"#define INITIAL 0#line 2 "netlist.l"#include "component.h"
#include "y.tab.h"

extern YYSTYPE yyval, yylval;

#define read_to_eol() do {char c;while ((c = input()) && !strchr("\r\n\f",c) ); }while(0)

#ifdef __DEBUG
#define DBG(a) printf (#a "-%s\n",yytext)
#else
#define DBG(a) 
#endif

#define id1 1#define id2 2#define value 3#define unit 4#define post_unit 5
#define net 6#define pin 7#define pin_detect 8#define net2 9
#line 602 "lex.yy.c"/* Macros after this point can all be overridden by user definitions in * section 1. */#ifndef YY_SKIP_YYWRAP#ifdef __cplusplusextern "C" int yywrap YY_PROTO(( void ));#elseextern int yywrap YY_PROTO(( void ));#endif#endif#ifndef YY_NO_UNPUTstatic void yyunput YY_PROTO(( int c, char *buf_ptr ));#endif#ifndef yytext_ptrstatic void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));#endif#ifdef YY_NEED_STRLENstatic int yy_flex_strlen YY_PROTO(( yyconst char * ));#endif#ifndef YY_NO_INPUT#ifdef __cplusplusstatic int yyinput YY_PROTO(( void ));#elsestatic int input YY_PROTO(( void ));#endif#endif#if YY_STACK_USEDstatic int yy_start_stack_ptr = 0;static int yy_start_stack_depth = 0;static int *yy_start_stack = 0;#ifndef YY_NO_PUSH_STATEstatic void yy_push_state YY_PROTO(( int new_state ));#endif#ifndef YY_NO_POP_STATEstatic void yy_pop_state YY_PROTO(( void ));#endif#ifndef YY_NO_TOP_STATEstatic int yy_top_state YY_PROTO(( void ));#endif#else#define YY_NO_PUSH_STATE 1#define YY_NO_POP_STATE 1#define YY_NO_TOP_STATE 1#endif#ifdef YY_MALLOC_DECLYY_MALLOC_DECL#else#if __STDC__#ifndef __cplusplus#include <stdlib.h>#endif#else/* Just try to get by without declaring the routines.  This will fail * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) * or sizeof(void*) != sizeof(int). */#endif#endif/* Amount of stuff to slurp up with each read. */#ifndef YY_READ_BUF_SIZE#define YY_READ_BUF_SIZE 8192#endif/* Copy whatever the last rule matched to the standard output. */#ifndef ECHO/* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )#endif/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL, * is returned in "result". */#ifndef YY_INPUT#define YY_INPUT(buf,result,max_size) \	if ( yy_current_buffer->yy_is_interactive ) \		{ \		int c = '*', n; \		for ( n = 0; n < max_size && \			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \			buf[n] = (char) c; \		if ( c == '\n' ) \			buf[n++] = (char) c; \		if ( c == EOF && ferror( yyin ) ) \			YY_FATAL_ERROR( "input in flex scanner failed" ); \		result = n; \		} \	else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \		  && ferror( yyin ) ) \		YY_FATAL_ERROR( "input in flex scanner failed" );#endif/* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */#ifndef yyterminate#define yyterminate() return YY_NULL#endif/* Number of entries by which start-condition stack grows. */#ifndef YY_START_STACK_INCR#define YY_START_STACK_INCR 25#endif/* Report a fatal error. */#ifndef YY_FATAL_ERROR#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )#endif/* Default declaration of generated scanner - a define so the user can * easily add parameters. */#ifndef YY_DECL#define YY_DECL int yylex YY_PROTO(( void ))#endif/* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */#ifndef YY_USER_ACTION#define YY_USER_ACTION#endif/* Code executed at the end of each rule. */#ifndef YY_BREAK#define YY_BREAK break;#endif#define YY_RULE_SETUP \	YY_USER_ACTIONYY_DECL	{	register yy_state_type yy_current_state;	register char *yy_cp = NULL, *yy_bp = NULL;	register int yy_act;#line 21 "netlist.l"#line 755 "lex.yy.c"	if ( yy_init )		{		yy_init = 0;#ifdef YY_USER_INIT		YY_USER_INIT;#endif		if ( ! yy_start )			yy_start = 1;	/* first start state */		if ( ! yyin )			yyin = stdin;		if ( ! yyout )			yyout = stdout;		if ( ! yy_current_buffer )			yy_current_buffer =				yy_create_buffer( yyin, YY_BUF_SIZE );		yy_load_buffer_state();		}	while ( 1 )		/* loops until end-of-file is reached */		{		yy_cp = yy_c_buf_p;		/* Support of yytext. */		*yy_cp = yy_hold_char;		/* yy_bp points to the position in yy_ch_buf of the start of		 * the current run.		 */		yy_bp = yy_cp;		yy_current_state = yy_start;		yy_state_ptr = yy_state_buf;		*yy_state_ptr++ = yy_current_state;yy_match:		do			{			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )				{				yy_current_state = (int) yy_def[yy_current_state];				if ( yy_current_state >= 126 )					yy_c = yy_meta[(unsigned int) yy_c];				}			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];			*yy_state_ptr++ = yy_current_state;			++yy_cp;			}		while ( yy_base[yy_current_state] != 527 );yy_find_action:		yy_current_state = *--yy_state_ptr;		yy_lp = yy_accept[yy_current_state];find_rule: /* we branch to this label when backing up */		for ( ; ; ) /* until we find what rule we matched */			{			if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )				{				yy_act = yy_acclist[yy_lp];					{					yy_full_match = yy_cp;					break;					}				}			--yy_cp;			yy_current_state = *--yy_state_ptr;			yy_lp = yy_accept[yy_current_state];			}		YY_DO_BEFORE_ACTION;		if ( yy_act != YY_END_OF_BUFFER )			{			int yyl;			for ( yyl = 0; yyl < yyleng; ++yyl )				if ( yytext[yyl] == '\n' )					++yylineno;			}do_action:	/* This label is used only to access EOF actions. */		switch ( yy_act )	{ /* beginning of action switch */case 1:YY_RULE_SETUP#line 22 "netlist.l"{BEGIN(id1);return COMPONENT_START;}
	YY_BREAKcase 2:YY_RULE_SETUP#line 24 "netlist.l"{BEGIN(0);return COMPONENT_END;}
	YY_BREAKcase 3:YY_RULE_SETUP#line 26 "netlist.l";
	YY_BREAKcase 4:YY_RULE_SETUP#line 28 "netlist.l";
	YY_BREAKcase 5:YY_RULE_SETUP#line 30 "netlist.l"{
		BEGIN(id2);
		strcpy (yylval.svalue,yytext); 
		DBG(0);
		return IDENTIFIER;
	}
	YY_BREAKcase 6:YY_RULE_SETUP#line 37 "netlist.l"{
		BEGIN(value);
		strcpy (yylval.svalue,yytext); 
		DBG(1);
		return IDENTIFIER;
	}
	YY_BREAKcase 7:YY_RULE_SETUP#line 45 "netlist.l"{
		BEGIN(post_unit);
		
		yylval.fvalue = atof (yytext) * 1e-9; 
		DBG(2);
		return CAPACITOR;		
	}
	YY_BREAKcase 8:YY_RULE_SETUP#line 53 "netlist.l"{
		BEGIN(post_unit);
		
		yylval.fvalue = atof (yytext); 
		DBG(3);
		return CAPACITOR;		
	}
	YY_BREAKcase 9:YY_RULE_SETUP#line 61 "netlist.l"{
		BEGIN(post_unit);
		
		yylval.fvalue = atof (yytext) * 1e-6; 
		DBG(4);
		return CAPACITOR;		
	}
	YY_BREAKcase 10:YY_RULE_SETUP#line 69 "netlist.l"{
		BEGIN(post_unit);
		
		yylval.fvalue = atof (yytext); 
		DBG(5);
		return INDUCTOR;		
	}
	YY_BREAKcase 11:YY_RULE_SETUP#line 77 "netlist.l"{
		BEGIN(post_unit);
		
		yylval.fvalue = atof (yytext) * 1e-3; 
		DBG(6);
		return INDUCTOR;		
	}
	YY_BREAKcase 12:YY_RULE_SETUP#line 85 "netlist.l"{
		BEGIN(post_unit);
		
		yylval.fvalue = atof (yytext) * 1e-6; 
		DBG(7);
		return INDUCTOR;		
	}
	YY_BREAKcase 13:YY_RULE_SETUP#line 93 "netlist.l"{
		BEGIN(post_unit);
		
		yylval.fvalue = atof (yytext) * 1e3; 
		DBG(8);
		return RESISTOR;		
	}				
	YY_BREAKcase 14:YY_RULE_SETUP#line 101 "netlist.l"{
		BEGIN(post_unit);
		
		strcpy (yylval.svalue,yytext); 
		DBG(9);
		return RESISTOR;		
	}				
	YY_BREAK

⌨️ 快捷键说明

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