📄 lex.yy.cc
字号:
// idl.ll Created on: 1999/10/05// Author : Duncan Grisby (dpg1)//// Copyright (C) 1999 AT&T Laboratories Cambridge//// This file is part of omniidl.//// omniidl is free software; you can redistribute it and/or modify it// under the terms of the GNU General Public License as published by// the Free Software Foundation; either version 2 of the License, or// (at your option) any later version.//// This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU// General Public License for more details.//// You should have received a copy of the GNU General Public License// along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA// 02111-1307, USA.//// Description:// // Flex lexical analyser// $Id: lex.yy.cc,v 1.10.2.11 2004/10/17 20:14:34 dgrisby Exp $// $Log: lex.yy.cc,v $// Revision 1.10.2.11 2004/10/17 20:14:34 dgrisby// Updated support for OpenVMS. Many thanks to Bruce Visscher.//// Revision 1.9.2.8 2001/10/22 10:48:22 dpg1// Cope with DOS line endings in all IDL situations.//// Revision 1.9.2.7 2001/10/17 16:48:32 dpg1// Minor error message tweaks//// Revision 1.9.2.6 2001/06/13 11:28:20 dpg1// Proper omniidl support for wchar/wstring constants.//// Revision 1.9.2.5 2001/03/13 10:32:10 dpg1// Fixed point support.//// Revision 1.9.2.4 2000/11/01 12:45:55 dpg1// Update to CORBA 2.4 specification.//// Revision 1.9.2.3 2000/10/27 16:31:07 dpg1// Clean up of omniidl dependencies and types, from omni3_develop.//// Revision 1.9.2.2 2000/10/10 10:18:50 dpg1// Update omniidl front-end from omni3_develop.//// Revision 1.7.2.8 2000/08/07 15:34:35 dpg1// Partial back-port of long long from omni3_1_develop.//// Revision 1.7.2.7 2000/06/09 11:20:47 dpg1// Last fix put __omni_pragma line numbers off by one...//// Revision 1.7.2.6 2000/06/08 14:58:19 dpg1// Line numbers for #pragmas and // comments were off by one//// Revision 1.7.2.5 2000/06/08 14:36:19 dpg1// Comments and pragmas are now objects rather than plain strings, so// they can have file,line associated with them.//// Revision 1.7.2.4 2000/06/05 18:12:25 dpg1// Support for __omni_pragma//// Revision 1.7.2.3 2000/04/26 09:55:48 dpg1// cccp escapes characters like \ in line directives, so// parseLineDirective() needs to use escapedStringToString().//// Revision 1.7.2.2 2000/03/06 15:03:49 dpg1// Minor bug fixes to omniidl. New -nf and -k flags.//// Revision 1.7.2.1 2000/02/16 16:30:54 dpg1// #pragma ID was misspelled #pragma id. Oops.//// Revision 1.7 2000/02/04 12:17:10 dpg1// Support for VMS.//// Revision 1.6 1999/12/28 17:44:01 dpg1// Stupid string allocation bug.//// Revision 1.5 1999/11/19 16:03:40 dpg1// Flex scanner now accepts \r as whitespace.//// Revision 1.4 1999/11/05 10:36:42 dpg1// Sorted out isatty() problems.//// Revision 1.3 1999/11/02 17:07:28 dpg1// Changes to compile on Solaris.//// Revision 1.2 1999/11/01 10:05:00 dpg1// New file attribute to AST.//// Revision 1.1 1999/10/27 14:06:00 dpg1// *** empty log message ***//#define YY_NEVER_INTERACTIVE 1#include <stdlib.h>#include <string.h>#include <ctype.h>#include <errno.h>#include <idlerr.h>#include <idlutil.h>#include <idlrepoId.h>#include <idlscope.h>#include <idlexpr.h>#include <idlast.h>#include <y.tab.h>char* currentFile;IDL_Boolean mainFile = 1; // Are we processing the main fileint nestDepth = 0; // #include nesting depthchar octalToChar(char* s);char hexToChar(char* s);char escapeToChar(char* s);IDL_UShort octalToWChar(char* s);IDL_UShort hexToWChar(char* s);IDL_UShort escapeToWChar(char* s);char* escapedStringToString(char* s);IDL_UShort* escapedStringToWString(char* s);void parseLineDirective(char* s);#define comment 1#define known_pragma 2#define unknown_pragma 3#define omni_pragma 4/* 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 \ if ( yyleng > 0 ) \ yy_current_buffer->yy_at_bol = \ (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTIONYY_DECL { register yy_state_type yy_current_state; register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act;#line 158 "../../../../../src/tool/omniidl/cxx/idl.ll" 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_current_state += YY_AT_BOL(); 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 >= 491 ) 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] != 924 );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 160 "../../../../../src/tool/omniidl/cxx/idl.ll"return ABSTRACT; YY_BREAKcase 2:YY_RULE_SETUP#line 161 "../../../../../src/tool/omniidl/cxx/idl.ll"return ANY; YY_BREAKcase 3:YY_RULE_SETUP#line 162 "../../../../../src/tool/omniidl/cxx/idl.ll"return ATTRIBUTE; YY_BREAKcase 4:YY_RULE_SETUP#line 163 "../../../../../src/tool/omniidl/cxx/idl.ll"return BOOLEAN; YY_BREAKcase 5:YY_RULE_SETUP#line 164 "../../../../../src/tool/omniidl/cxx/idl.ll"return CASE; YY_BREAK
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -