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

📄 cimmof_lex.cpp

📁 Pegasus is an open-source implementationof the DMTF CIM and WBEM standards. It is designed to be por
💻 CPP
📖 第 1 页 / 共 5 页
字号:
/* 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, *yy_bp;	register int yy_act;#line 84 "cimmof.l"#line 923 "cimmof_lex.cpp"	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 >= 298 )					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] != 592 );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 87 "cimmof.l"{                                       cimmofParser::Instance()->increment_lineno(); }	YY_BREAKcase 2:YY_RULE_SETUP#line 89 "cimmof.l"{                                      cimmofParser::Instance()->increment_lineno(); }	YY_BREAKcase 3:YY_RULE_SETUP#line 91 "cimmof.l"{ /* skip white space */ }	YY_BREAKcase 4:YY_RULE_SETUP#line 92 "cimmof.l"{ return(TOK_CLASS); }	YY_BREAKcase 5:YY_RULE_SETUP#line 93 "cimmof.l"{ return(TOK_LEFTCURLYBRACE); }	YY_BREAKcase 6:YY_RULE_SETUP#line 94 "cimmof.l"{ return(TOK_RIGHTCURLYBRACE); }	YY_BREAKcase 7:YY_RULE_SETUP#line 95 "cimmof.l"{ return(TOK_LEFTSQUAREBRACKET); }	YY_BREAKcase 8:YY_RULE_SETUP#line 96 "cimmof.l"{ return(TOK_RIGHTSQUAREBRACKET); }	YY_BREAKcase 9:YY_RULE_SETUP#line 97 "cimmof.l"{ return(TOK_LEFTPAREN); }	YY_BREAKcase 10:YY_RULE_SETUP#line 98 "cimmof.l"{ return(TOK_RIGHTPAREN); }	YY_BREAKcase 11:YY_RULE_SETUP#line 99 "cimmof.l"{ return(TOK_COLON); }	YY_BREAKcase 12:YY_RULE_SETUP#line 100 "cimmof.l"{ return(TOK_SEMICOLON); }	YY_BREAKcase 13:YY_RULE_SETUP#line 101 "cimmof.l"{                                       cimmof_lval.strval = new String(yytext);                                      return(TOK_REAL_VALUE); }	YY_BREAKcase 14:YY_RULE_SETUP#line 104 "cimmof.l"{ cimmof_lval.strval = new String(yytext);                                     return(TOK_OCTAL_VALUE); }	YY_BREAKcase 15:YY_RULE_SETUP#line 106 "cimmof.l"{ cimmof_lval.strval = new String(yytext);                                     return(TOK_HEX_VALUE); }	YY_BREAKcase 16:YY_RULE_SETUP#line 108 "cimmof.l"{ cimmof_lval.strval = new String(yytext);                                     return(TOK_BINARY_VALUE); }	YY_BREAKcase 17:YY_RULE_SETUP#line 110 "cimmof.l"{ cimmof_lval.strval = new String(yytext);                                     return(TOK_POSITIVE_DECIMAL_VALUE); }	YY_BREAKcase 18:YY_RULE_SETUP#line 112 "cimmof.l"{ cimmof_lval.strval = new String(yytext);                                     return(TOK_SIGNED_DECIMAL_VALUE); }	YY_BREAKcase 19:YY_RULE_SETUP#line 114 "cimmof.l"{ return(TOK_EQUAL); }	YY_BREAKcase 20:YY_RULE_SETUP#line 115 "cimmof.l"{ return(TOK_COMMA); }	YY_BREAKcase 21:YY_RULE_SETUP#line 116 "cimmof.l"{ cimmof_lval.strval = new String(yytext);                                      return(TOK_CHAR_VALUE); }	YY_BREAK/*--- bugzilla 544 fix; handle string escapes ---                                                                            an impl. decision: invalid escape sequences                                        are simply ignored, and left in the string.                                       an impl. decision: yyleng is set to the len                                       of resulting string, not the len of the matched                                       token(s), since they are different, with escapes.                                       (but note; cimmof.y does not use yyleng!)                                       an impl. req't: strings are returned to parser                                       with [no kidding!] enclosing "s.                                      */                                               case 22:YY_RULE_SETUP#line 133 "cimmof.l"{ BEGIN(myStr); strbuf_p = strbuf;                                       /**strbuf_p++ = '"';*/ }	YY_BREAKcase 23:YY_RULE_SETUP#line 135 "cimmof.l"{ BEGIN(INITIAL);                                        /**strbuf_p++ = '"';*/  *strbuf_p = '\0';                                      cimmof_leng = strbuf_p - strbuf;                                      cimmof_lval.strval = new String(strbuf);                                      return TOK_STRING_VALUE; }	YY_BREAKcase YY_STATE_EOF(myStr):#line 140 "cimmof.l"case 24:YY_RULE_SETUP#line 141 "cimmof.l"{ BEGIN(INITIAL);                                       /**strbuf_p++ = '"';*/  *strbuf_p = '\0';                                      cimmof_leng = strbuf_p - strbuf;                                      cimmof_lval.strval = new String(strbuf);                                      return TOK_UNEXPECTED_CHAR; }	YY_BREAKcase 25:YY_RULE_SETUP#line 146 "cimmof.l"{ /* backspace */        *strbuf_p++ = '\b'; }	YY_BREAKcase 26:YY_RULE_SETUP#line 147 "cimmof.l"{ /* form feed */        *strbuf_p++ = '\f'; }	YY_BREAKcase 27:YY_RULE_SETUP#line 148 "cimmof.l"{ /* line feed */        *strbuf_p++ = '\n'; }	YY_BREAKcase 28:YY_RULE_SETUP#line 149 "cimmof.l"{ /* carriage return */  *strbuf_p++ = '\r'; }	YY_BREAKcase 29:YY_RULE_SETUP#line 150 "cimmof.l"{ /* horizontal tab */   *strbuf_p++ = '\t'; }	YY_BREAKcase 30:YY_RULE_SETUP#line 151 "cimmof.l"{ /* single quote */     *strbuf_p++ = '\''; }	YY_BREAKcase 31:YY_RULE_SETUP#line 152 "cimmof.l"{ /* double quote */     *strbuf_p++ = '"';  }	YY_BREAKcase 32:YY_RULE_SETUP#line 153 "cimmof.l"{ /* backslash */        *strbuf_p++ = '\\'; }	YY_BREAKcase 33:YY_RULE_SETUP#line 154 "cimmof.l"{ yy_push_state(myHex);                                      memcpy(slashx,yytext,2);                                      }	YY_BREAKcase 34:YY_RULE_SETUP#line 157 "cimmof.l"{ *strbuf_p++ = '\\';                                      *strbuf_p++ = yytext[1]; }	YY_BREAKcase 35:YY_RULE_SETUP#line 159 "cimmof.l"{ char *t = yytext;                                      while( *t ) *strbuf_p++ = *t++;                                      *strbuf_p = '\0'; }	YY_BREAKcase 36:YY_RULE_SETUP#line 162 "cimmof.l"{ /* get escaped hex digits */                                      char  hexfmt[4];   unsigned int n;                                      sprintf( hexfmt, "%%%dx", yyleng );                                      sscanf(yytext, hexfmt, &n);                                      if (n>255) {                                          memcpy(strbuf_p,slashx,2);                                          strbuf_p += 2;                                          char *t = yytext;                                          while( *t ) *strbuf_p++ = *t++;                                          }                                      else *strbuf_p++ = (char)n;                                      yy_pop_state();                                           }	YY_BREAKcase 37:YY_RULE_SETUP#line 175 "cimmof.l"{ memcpy(strbuf_p,slashx,2);                                      strbuf_p += 2;                                      *strbuf_p++ = *yytext;                                      yy_pop_state();                                      }	YY_BREAK/* --- end of bugzilla 544 fix --- */case 38:YY_RULE_SETUP#line 184 "cimmof.l"{   int c1=0, c2=yyinput();                                        for(;;) {                                            if (c2==EOF) break;                                            if (c1=='*' && c2=='/') break;                                            c1=c2;                                            c2=yyinput();                                            }                                        }	YY_BREAKcase YY_STATE_EOF(INITIAL):case YY_STATE_EOF(myHex):#line 192 "cimmof.l"{ yyterminate(); }	YY_BREAKcase 39:YY_RULE_SETUP#line 193 "cimmof.l"{ return(TOK_NULL_VALUE); }	YY_BREAKcase 40:YY_RULE_SETUP#line 194 "cimmof.l"{ return(TOK_TRUE); }	YY_BREAKcase 41:YY_RULE_SETUP#line 195 "cimmof.l"{ return(TOK_FALSE); }	YY_BREAKcase 42:YY_RULE_SETUP#line 196 "cimmof.l"{ return(TOK_PERIOD); }	YY_BREAKcase 43:YY_RULE_SETUP#line 197 "cimmof.l"{ return(TOK_PRAGMA); }	YY_BREAKcase 44:YY_RULE_SETUP#line 198 "cimmof.l"{                                      return(TOK_INSTANCE); }	YY_BREAKcase 45:YY_RULE_SETUP#line 200 "cimmof.l"{                                      return(TOK_OF); }	YY_BREAKcase 46:YY_RULE_SETUP#line 202 "cimmof.l"{return(TOK_QUALIFIER); }	YY_BREAKcase 47:YY_RULE_SETUP#line 203 "cimmof.l"{ return(TOK_SCOPE); }	YY_BREAKcase 48:YY_RULE_SETUP#line 204 "cimmof.l"{ return(TOK_SCHEMA); }	YY_BREAKcase 49:YY_RULE_SETUP#line 205 "cimmof.l"{                                      return(TOK_ASSOCIATION); }

⌨️ 快捷键说明

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