diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-12-04 12:34:54 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-12-04 12:34:54 +0000 |
commit | 9acaf176a0019401c833a42fdc9a5cb27d01f60c (patch) | |
tree | 3217b2216b825b3e018203b353e25f2a6b6d6ed7 /TAO/TAO_IDL/fe | |
parent | 5ef879d29b98620cf27b3439e8f094001f577e0d (diff) | |
download | ATCD-9acaf176a0019401c833a42fdc9a5cb27d01f60c.tar.gz |
*** empty log message ***
Diffstat (limited to 'TAO/TAO_IDL/fe')
-rw-r--r-- | TAO/TAO_IDL/fe/lex.yy.cpp | 781 |
1 files changed, 524 insertions, 257 deletions
diff --git a/TAO/TAO_IDL/fe/lex.yy.cpp b/TAO/TAO_IDL/fe/lex.yy.cpp index ca89291620e..e4a00b6544b 100644 --- a/TAO/TAO_IDL/fe/lex.yy.cpp +++ b/TAO/TAO_IDL/fe/lex.yy.cpp @@ -1,10 +1,12 @@ /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/flex-2.4.7/RCS/flex.skl,v 1.2 94/08/03 11:13:24 vern Exp $ + * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ */ #define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 #include /**/ <stdio.h> @@ -30,7 +32,7 @@ #else /* ! __cplusplus */ -#ifdef __STDC__ +#if __STDC__ #define YY_USE_PROTOS #define YY_USE_CONST @@ -38,16 +40,19 @@ #endif /* __STDC__ */ #endif /* ! __cplusplus */ - #ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include /**/ <io.h> +#include /**/ <stdlib.h> #define YY_USE_CONST +#define YY_USE_PROTOS #endif - -#ifndef YY_USE_CONST -#ifndef const -#define const -#endif +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst #endif @@ -74,16 +79,16 @@ #define BEGIN yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. */ #define YY_START ((yy_start - 1) / 2) +#define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) -/* Special action meaning "start processing a new file". Now included - * only for backward compatibility with previous versions of flex. - */ +/* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 @@ -96,14 +101,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; extern int yyleng; extern FILE *yyin, *yyout; -#ifdef __cplusplus -extern "C" { -#endif - extern int yywrap YY_PROTO(( void )); -#ifdef __cplusplus - } -#endif - #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 @@ -129,6 +126,7 @@ extern "C" { { \ /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ @@ -136,6 +134,12 @@ extern "C" { #define unput(c) yyunput( c, yytext_ptr ) +/* The following is because we cannot portably get our hands on size_t + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ +typedef unsigned int yy_size_t; + struct yy_buffer_state { @@ -147,13 +151,19 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - int yy_buf_size; + yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after @@ -161,6 +171,12 @@ struct yy_buffer_state */ int yy_is_interactive; + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -209,55 +225,59 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -static void yyunput YY_PROTO(( int c, char *buf_ptr )); void yyrestart YY_PROTO(( FILE *input_file )); + void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); void yy_load_buffer_state YY_PROTO(( void )); YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -static void yy_push_state YY_PROTO(( int new_state )); -static void yy_pop_state YY_PROTO(( void )); -static int yy_top_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); -static void *yy_flex_alloc YY_PROTO(( unsigned int )); -static void *yy_flex_realloc YY_PROTO(( void *, unsigned int )); +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer yy_create_buffer -#define INITIAL 0 +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + typedef unsigned char YY_CHAR; -typedef int yy_state_type; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; extern char yytext[]; -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, const char *, int )); -#endif - -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif - static yy_state_type yy_get_previous_state YY_PROTO(( void )); static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( const char msg[] )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yytext_ptr = yy_bp; \ - yyleng = yy_cp - yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ if ( yyleng >= YYLMAX ) \ @@ -265,8 +285,9 @@ static void yy_fatal_error YY_PROTO(( const char msg[] )); yy_flex_strncpy( yytext, yytext_ptr, yyleng + 1 ); \ yy_c_buf_p = yy_cp; +#define YY_NUM_RULES 60 #define YY_END_OF_BUFFER 61 -static const short int yy_accept[278] = +static yyconst short int yy_accept[278] = { 0, 57, 57, 61, 59, 57, 58, 59, 59, 59, 59, 44, 42, 59, 59, 59, 39, 39, 39, 39, 39, @@ -300,7 +321,7 @@ static const short int yy_accept[278] = 6, 8, 14, 52, 0, 49, 0 } ; -static const int yy_ec[256] = +static yyconst int yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -332,7 +353,7 @@ static const int yy_ec[256] = 1, 1, 1, 1, 1 } ; -static const int yy_meta[55] = +static yyconst int yy_meta[55] = { 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 1, 1, 1, 3, 3, @@ -342,7 +363,7 @@ static const int yy_meta[55] = 4, 4, 4, 4 } ; -static const short int yy_base[288] = +static yyconst short int yy_base[288] = { 0, 0, 439, 444, 446, 53, 446, 438, 412, 45, 53, 53, 58, 425, 423, 421, 0, 419, 412, 13, 392, @@ -377,7 +398,7 @@ static const short int yy_base[288] = 276, 280, 75, 284, 288, 292, 296 } ; -static const short int yy_def[288] = +static yyconst short int yy_def[288] = { 0, 277, 1, 277, 277, 277, 277, 278, 279, 277, 277, 277, 277, 277, 277, 277, 280, 280, 280, 280, 280, @@ -412,7 +433,7 @@ static const short int yy_def[288] = 277, 277, 277, 277, 277, 277, 277 } ; -static const short int yy_nxt[501] = +static yyconst short int yy_nxt[501] = { 0, 4, 5, 6, 5, 7, 4, 8, 4, 4, 9, 4, 10, 11, 12, 12, 13, 14, 15, 16, 16, @@ -471,7 +492,7 @@ static const short int yy_nxt[501] = } ; -static const short int yy_chk[501] = +static yyconst short int yy_chk[501] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -539,14 +560,16 @@ static char *yy_last_accepting_cpos; #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET #ifndef YYLMAX #define YYLMAX 8192 #endif char yytext[YYLMAX]; char *yytext_ptr; -# line 1 "idl.ll" -# line 3 "idl.ll" +#line 1 "idl.ll" +#define INITIAL 0 +#line 3 "idl.ll" /* COPYRIGHT @@ -645,6 +668,54 @@ inline char *__yytext() * section 1. */ +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static 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_DECL YY_MALLOC_DECL #else @@ -681,9 +752,15 @@ YY_MALLOC_DECL #define YY_INPUT(buf,result,max_size) \ if ( yy_current_buffer->yy_is_interactive ) \ { \ - int c = getc( yyin ); \ - result = c == EOF ? 0 : 1; \ - buf[0] = (char) c; \ + 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 ) ) \ @@ -727,18 +804,26 @@ YY_MALLOC_DECL #define YY_BREAK break; #endif +#define YY_RULE_SETUP \ + if ( yyleng > 0 ) \ + yy_current_buffer->yy_at_bol = \ + (yytext[yyleng - 1] == '\n'); \ + YY_USER_ACTION + YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; -# line 100 "idl.ll" +#line 100 "idl.ll" if ( yy_init ) { + yy_init = 0; + #ifdef YY_USER_INIT YY_USER_INIT; #endif @@ -752,15 +837,11 @@ YY_DECL if ( ! yyout ) yyout = stdout; - if ( yy_current_buffer ) - yy_init_buffer( yy_current_buffer, yyin ); - else + if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_load_buffer_state(); - - yy_init = 0; } while ( 1 ) /* loops until end-of-file is reached */ @@ -776,8 +857,7 @@ YY_DECL yy_bp = yy_cp; yy_current_state = yy_start; - if ( yy_bp[-1] == '\n' ) - ++yy_current_state; + yy_current_state += YY_AT_BOL(); yy_match: do { @@ -800,6 +880,12 @@ yy_match: yy_find_action: yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + yy_act = yy_accept[yy_current_state]; + } YY_DO_BEFORE_ACTION; @@ -817,201 +903,201 @@ do_action: /* This label is used only to access EOF actions. */ goto yy_find_action; case 1: -YY_USER_ACTION -# line 102 "idl.ll" +YY_RULE_SETUP +#line 102 "idl.ll" return IDL_ANY; YY_BREAK case 2: -YY_USER_ACTION -# line 103 "idl.ll" +YY_RULE_SETUP +#line 103 "idl.ll" return IDL_MODULE; YY_BREAK case 3: -YY_USER_ACTION -# line 104 "idl.ll" +YY_RULE_SETUP +#line 104 "idl.ll" return IDL_RAISES; YY_BREAK case 4: -YY_USER_ACTION -# line 105 "idl.ll" +YY_RULE_SETUP +#line 105 "idl.ll" return IDL_READONLY; YY_BREAK case 5: -YY_USER_ACTION -# line 106 "idl.ll" +YY_RULE_SETUP +#line 106 "idl.ll" return IDL_ATTRIBUTE; YY_BREAK case 6: -YY_USER_ACTION -# line 107 "idl.ll" +YY_RULE_SETUP +#line 107 "idl.ll" return IDL_EXCEPTION; YY_BREAK case 7: -YY_USER_ACTION -# line 108 "idl.ll" +YY_RULE_SETUP +#line 108 "idl.ll" return IDL_CONTEXT; YY_BREAK case 8: -YY_USER_ACTION -# line 109 "idl.ll" +YY_RULE_SETUP +#line 109 "idl.ll" return IDL_INTERFACE; YY_BREAK case 9: -YY_USER_ACTION -# line 110 "idl.ll" +YY_RULE_SETUP +#line 110 "idl.ll" return IDL_CONST; YY_BREAK case 10: -YY_USER_ACTION -# line 111 "idl.ll" +YY_RULE_SETUP +#line 111 "idl.ll" return IDL_TYPEDEF; YY_BREAK case 11: -YY_USER_ACTION -# line 112 "idl.ll" +YY_RULE_SETUP +#line 112 "idl.ll" return IDL_STRUCT; YY_BREAK case 12: -YY_USER_ACTION -# line 113 "idl.ll" +YY_RULE_SETUP +#line 113 "idl.ll" return IDL_ENUM; YY_BREAK case 13: -YY_USER_ACTION -# line 114 "idl.ll" +YY_RULE_SETUP +#line 114 "idl.ll" return IDL_STRING; YY_BREAK case 14: -YY_USER_ACTION -# line 115 "idl.ll" +YY_RULE_SETUP +#line 115 "idl.ll" return IDL_WSTRING; YY_BREAK case 15: -YY_USER_ACTION -# line 116 "idl.ll" +YY_RULE_SETUP +#line 116 "idl.ll" return IDL_SEQUENCE; YY_BREAK case 16: -YY_USER_ACTION -# line 117 "idl.ll" +YY_RULE_SETUP +#line 117 "idl.ll" return IDL_UNION; YY_BREAK case 17: -YY_USER_ACTION -# line 118 "idl.ll" +YY_RULE_SETUP +#line 118 "idl.ll" return IDL_SWITCH; YY_BREAK case 18: -YY_USER_ACTION -# line 119 "idl.ll" +YY_RULE_SETUP +#line 119 "idl.ll" return IDL_CASE; YY_BREAK case 19: -YY_USER_ACTION -# line 120 "idl.ll" +YY_RULE_SETUP +#line 120 "idl.ll" return IDL_DEFAULT; YY_BREAK case 20: -YY_USER_ACTION -# line 121 "idl.ll" +YY_RULE_SETUP +#line 121 "idl.ll" return IDL_FLOAT; YY_BREAK case 21: -YY_USER_ACTION -# line 122 "idl.ll" +YY_RULE_SETUP +#line 122 "idl.ll" return IDL_DOUBLE; YY_BREAK case 22: -YY_USER_ACTION -# line 123 "idl.ll" +YY_RULE_SETUP +#line 123 "idl.ll" return IDL_LONG; YY_BREAK case 23: -YY_USER_ACTION -# line 124 "idl.ll" +YY_RULE_SETUP +#line 124 "idl.ll" return IDL_SHORT; YY_BREAK case 24: -YY_USER_ACTION -# line 125 "idl.ll" +YY_RULE_SETUP +#line 125 "idl.ll" return IDL_UNSIGNED; YY_BREAK case 25: -YY_USER_ACTION -# line 126 "idl.ll" +YY_RULE_SETUP +#line 126 "idl.ll" return IDL_CHAR; YY_BREAK case 26: -YY_USER_ACTION -# line 127 "idl.ll" +YY_RULE_SETUP +#line 127 "idl.ll" return IDL_WCHAR; YY_BREAK case 27: -YY_USER_ACTION -# line 128 "idl.ll" +YY_RULE_SETUP +#line 128 "idl.ll" return IDL_BOOLEAN; YY_BREAK case 28: -YY_USER_ACTION -# line 129 "idl.ll" +YY_RULE_SETUP +#line 129 "idl.ll" return IDL_OCTET; YY_BREAK case 29: -YY_USER_ACTION -# line 130 "idl.ll" +YY_RULE_SETUP +#line 130 "idl.ll" return IDL_VOID; YY_BREAK case 30: -YY_USER_ACTION -# line 132 "idl.ll" +YY_RULE_SETUP +#line 132 "idl.ll" return IDL_TRUETOK; YY_BREAK case 31: -YY_USER_ACTION -# line 133 "idl.ll" +YY_RULE_SETUP +#line 133 "idl.ll" return IDL_FALSETOK; YY_BREAK case 32: -YY_USER_ACTION -# line 135 "idl.ll" +YY_RULE_SETUP +#line 135 "idl.ll" return IDL_INOUT; YY_BREAK case 33: -YY_USER_ACTION -# line 136 "idl.ll" +YY_RULE_SETUP +#line 136 "idl.ll" return IDL_IN; YY_BREAK case 34: -YY_USER_ACTION -# line 137 "idl.ll" +YY_RULE_SETUP +#line 137 "idl.ll" return IDL_OUT; YY_BREAK case 35: -YY_USER_ACTION -# line 138 "idl.ll" +YY_RULE_SETUP +#line 138 "idl.ll" return IDL_ONEWAY; YY_BREAK case 36: -YY_USER_ACTION -# line 140 "idl.ll" +YY_RULE_SETUP +#line 140 "idl.ll" return IDL_LEFT_SHIFT; YY_BREAK case 37: -YY_USER_ACTION -# line 141 "idl.ll" +YY_RULE_SETUP +#line 141 "idl.ll" return IDL_RIGHT_SHIFT; YY_BREAK case 38: -YY_USER_ACTION -# line 142 "idl.ll" +YY_RULE_SETUP +#line 142 "idl.ll" { yylval.strval = "::"; return IDL_SCOPE_DELIMITOR; } YY_BREAK case 39: -YY_USER_ACTION -# line 147 "idl.ll" +YY_RULE_SETUP +#line 147 "idl.ll" { char *z = (char *) malloc(strlen(ace_yytext) + 1); strcpy(z, ace_yytext); @@ -1020,48 +1106,48 @@ YY_USER_ACTION } YY_BREAK case 40: -YY_USER_ACTION -# line 154 "idl.ll" +YY_RULE_SETUP +#line 154 "idl.ll" { yylval.dval = idl_atof(ace_yytext); return IDL_FLOATING_PT_LITERAL; } YY_BREAK case 41: -YY_USER_ACTION -# line 158 "idl.ll" +YY_RULE_SETUP +#line 158 "idl.ll" { yylval.dval = idl_atof(ace_yytext); return IDL_FLOATING_PT_LITERAL; } YY_BREAK case 42: -YY_USER_ACTION -# line 163 "idl.ll" +YY_RULE_SETUP +#line 163 "idl.ll" { yylval.ival = idl_atoi(ace_yytext, 10); return IDL_INTEGER_LITERAL; } YY_BREAK case 43: -YY_USER_ACTION -# line 167 "idl.ll" +YY_RULE_SETUP +#line 167 "idl.ll" { yylval.ival = idl_atoi(ace_yytext, 16); return IDL_INTEGER_LITERAL; } YY_BREAK case 44: -YY_USER_ACTION -# line 171 "idl.ll" +YY_RULE_SETUP +#line 171 "idl.ll" { yylval.ival = idl_atoi(ace_yytext, 8); return IDL_INTEGER_LITERAL; } YY_BREAK case 45: -YY_USER_ACTION -# line 176 "idl.ll" +YY_RULE_SETUP +#line 176 "idl.ll" { /* Skip the quotes */ char *tmp = ace_yytext; @@ -1071,16 +1157,16 @@ YY_USER_ACTION } YY_BREAK case 46: -YY_USER_ACTION -# line 183 "idl.ll" +YY_RULE_SETUP +#line 183 "idl.ll" { yylval.cval = ace_yytext [1]; return IDL_CHARACTER_LITERAL; } YY_BREAK case 47: -YY_USER_ACTION -# line 187 "idl.ll" +YY_RULE_SETUP +#line 187 "idl.ll" { // octal character constant yylval.cval = idl_escape_reader(ace_yytext + 1); @@ -1088,68 +1174,68 @@ YY_USER_ACTION } YY_BREAK case 48: -YY_USER_ACTION -# line 192 "idl.ll" +YY_RULE_SETUP +#line 192 "idl.ll" { yylval.cval = idl_escape_reader(ace_yytext + 1); return IDL_CHARACTER_LITERAL; } YY_BREAK case 49: -YY_USER_ACTION -# line 196 "idl.ll" +YY_RULE_SETUP +#line 196 "idl.ll" {/* remember pragma */ idl_global->set_lineno(idl_global->lineno() + 1); idl_store_pragma(ace_yytext); } YY_BREAK case 50: -YY_USER_ACTION -# line 200 "idl.ll" +YY_RULE_SETUP +#line 200 "idl.ll" { idl_parse_line_and_file(ace_yytext); } YY_BREAK case 51: -YY_USER_ACTION -# line 203 "idl.ll" +YY_RULE_SETUP +#line 203 "idl.ll" { idl_parse_line_and_file(ace_yytext); } YY_BREAK case 52: -YY_USER_ACTION -# line 206 "idl.ll" +YY_RULE_SETUP +#line 206 "idl.ll" { idl_parse_line_and_file(ace_yytext); } YY_BREAK case 53: -YY_USER_ACTION -# line 209 "idl.ll" +YY_RULE_SETUP +#line 209 "idl.ll" { idl_parse_line_and_file(ace_yytext); } YY_BREAK case 54: -YY_USER_ACTION -# line 212 "idl.ll" +YY_RULE_SETUP +#line 212 "idl.ll" { /* ignore cpp ident */ idl_global->set_lineno(idl_global->lineno() + 1); } YY_BREAK case 55: -YY_USER_ACTION -# line 216 "idl.ll" +YY_RULE_SETUP +#line 216 "idl.ll" { /* ignore comments */ idl_global->set_lineno(idl_global->lineno() + 1); } YY_BREAK case 56: -YY_USER_ACTION -# line 220 "idl.ll" +YY_RULE_SETUP +#line 220 "idl.ll" { for(;;) { char c = yyinput(); @@ -1166,25 +1252,25 @@ YY_USER_ACTION } YY_BREAK case 57: -YY_USER_ACTION -# line 234 "idl.ll" +YY_RULE_SETUP +#line 234 "idl.ll" ; YY_BREAK case 58: -YY_USER_ACTION -# line 235 "idl.ll" +YY_RULE_SETUP +#line 235 "idl.ll" { idl_global->set_lineno(idl_global->lineno() + 1); } YY_BREAK case 59: -YY_USER_ACTION -# line 238 "idl.ll" +YY_RULE_SETUP +#line 238 "idl.ll" return ace_yytext [0]; YY_BREAK case 60: -YY_USER_ACTION -# line 240 "idl.ll" +YY_RULE_SETUP +#line 240 "idl.ll" TAO_ECHO; YY_BREAK case YY_STATE_EOF(INITIAL): @@ -1193,10 +1279,11 @@ case YY_STATE_EOF(INITIAL): case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = yy_cp - yytext_ptr - 1; + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) { @@ -1252,7 +1339,7 @@ case YY_STATE_EOF(INITIAL): else { - yy_cp = yy_c_buf_p; + yy_cp = yy_c_buf_p; goto yy_find_action; } } @@ -1330,7 +1417,7 @@ case YY_STATE_EOF(INITIAL): static int yy_get_next_buffer() { register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr - 1; /* copy prev. char, too */ + register char *source = yytext_ptr; register int number_to_move, i; int ret_val; @@ -1342,7 +1429,7 @@ static int yy_get_next_buffer() { /* Don't try to fill the buffer, so this is an EOF. */ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) { - /* We matched a singled characater, the EOB, so + /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; @@ -1360,7 +1447,7 @@ static int yy_get_next_buffer() /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = yy_c_buf_p - yytext_ptr; + number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1369,7 +1456,7 @@ static int yy_get_next_buffer() /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ - yy_n_chars = 0; + yy_current_buffer->yy_n_chars = yy_n_chars = 0; else { @@ -1386,12 +1473,26 @@ static int yy_get_next_buffer() /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = yy_current_buffer; - int yy_c_buf_p_offset = yy_c_buf_p - b->yy_ch_buf; + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; - b->yy_buf_size *= 2; - b->yy_ch_buf = (char *) - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size ); + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -1410,11 +1511,13 @@ static int yy_get_next_buffer() /* Read in more data. */ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), yy_n_chars, num_to_read ); + + yy_current_buffer->yy_n_chars = yy_n_chars; } if ( yy_n_chars == 0 ) { - if ( number_to_move - YY_MORE_ADJ == 1 ) + if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); @@ -1435,13 +1538,7 @@ static int yy_get_next_buffer() yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - /* yytext begins at the second character in yy_ch_buf; the first - * character is the one which preceded it before reading in the latest - * buffer; it needs to be kept around in case it's a newline, so - * yy_get_previous_state() will have with '^' rules active. - */ - - yytext_ptr = &yy_current_buffer->yy_ch_buf[1]; + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; return ret_val; } @@ -1454,11 +1551,8 @@ static yy_state_type yy_get_previous_state() register yy_state_type yy_current_state; register char *yy_cp; - register char *yy_bp = yytext_ptr; - yy_current_state = yy_start; - if ( yy_bp[-1] == '\n' ) - ++yy_current_state; + yy_current_state += YY_AT_BOL(); for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) { @@ -1516,6 +1610,7 @@ yy_state_type yy_current_state; } +#ifndef YY_NO_UNPUT #ifdef YY_USE_PROTOS static void yyunput( int c, register char *yy_bp ) #else @@ -1541,25 +1636,23 @@ register char *yy_bp; while ( source > yy_current_buffer->yy_ch_buf ) *--dest = *--source; - yy_cp += dest - source; - yy_bp += dest - source; - yy_n_chars = yy_current_buffer->yy_buf_size; + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } - if ( yy_cp > yy_bp && yy_cp[-1] == '\n' ) - yy_cp[-2] = '\n'; - *--yy_cp = (char) c; - /* Note: the formal parameter *must* be called "yy_bp" for this - * macro to now work correctly. - */ - YY_DO_BEFORE_ACTION; /* set up yytext again */ + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; } +#endif /* ifndef YY_NO_UNPUT */ #ifdef __cplusplus @@ -1584,21 +1677,34 @@ static int input() else { /* need more input */ - yytext_ptr = yy_c_buf_p; + int offset = yy_c_buf_p - yytext_ptr; ++yy_c_buf_p; switch ( yy_get_next_buffer() ) { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /* fall through */ + case EOB_ACT_END_OF_FILE: { if ( yywrap() ) - { - yy_c_buf_p = - yytext_ptr + YY_MORE_ADJ; return EOF; - } - YY_NEW_FILE; + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else @@ -1607,17 +1713,8 @@ static int input() } case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + yy_c_buf_p = yytext_ptr + offset; break; - - case EOB_ACT_LAST_MATCH: -#ifdef __cplusplus - YY_FATAL_ERROR( - "unexpected last match in yyinput()" ); -#else - YY_FATAL_ERROR( - "unexpected last match in input()" ); -#endif } } } @@ -1626,6 +1723,8 @@ static int input() *yy_c_buf_p = '\0'; /* preserve yytext */ yy_hold_char = *++yy_c_buf_p; + yy_current_buffer->yy_at_bol = (c == '\n'); + return c; } @@ -1699,7 +1798,6 @@ int size; YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -1709,10 +1807,11 @@ int size; * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + b->yy_is_our_buffer = 1; + yy_init_buffer( b, file ); return b; @@ -1726,14 +1825,25 @@ void yy_delete_buffer( b ) YY_BUFFER_STATE b; #endif { + if ( ! b ) + return; + if ( b == yy_current_buffer ) yy_current_buffer = (YY_BUFFER_STATE) 0; - yy_flex_free( (void *) b->yy_ch_buf ); + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + yy_flex_free( (void *) b ); } +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif + #ifdef YY_USE_PROTOS void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) #else @@ -1741,33 +1851,151 @@ void yy_init_buffer( b, file ) YY_BUFFER_STATE b; FILE *file; #endif + + { + yy_flush_buffer( b ); + b->yy_input_file = file; + b->yy_fill_buffer = 1; - /* We put in the '\n' and start reading from [1] so that an - * initial match-at-newline will be true. - */ +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + if ( ! b ) + return; - b->yy_ch_buf[0] = '\n'; - b->yy_n_chars = 1; + b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR; - b->yy_buf_pos = &b->yy_ch_buf[1]; + b->yy_buf_pos = &b->yy_ch_buf[0]; - b->yy_is_interactive = file ? isatty( fileno(file) ) : 0; + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; - b->yy_fill_buffer = 1; + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; } +#endif +#ifndef YY_NO_PUSH_STATE #ifdef YY_USE_PROTOS static void yy_push_state( int new_state ) #else @@ -1777,7 +2005,7 @@ int new_state; { if ( yy_start_stack_ptr >= yy_start_stack_depth ) { - int new_size; + yy_size_t new_size; yy_start_stack_depth += YY_START_STACK_INCR; new_size = yy_start_stack_depth * sizeof( int ); @@ -1798,8 +2026,10 @@ int new_state; BEGIN(new_state); } +#endif +#ifndef YY_NO_POP_STATE static void yy_pop_state() { if ( --yy_start_stack_ptr < 0 ) @@ -1807,23 +2037,29 @@ static void yy_pop_state() BEGIN(yy_start_stack[yy_start_stack_ptr]); } +#endif +#ifndef YY_NO_TOP_STATE static int yy_top_state() { return yy_start_stack[yy_start_stack_ptr - 1]; } +#endif +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif #ifdef YY_USE_PROTOS -static void yy_fatal_error( const char msg[] ) +static void yy_fatal_error( yyconst char msg[] ) #else static void yy_fatal_error( msg ) char msg[]; #endif { (void) fprintf( stderr, "%s\n", msg ); - exit( 1 ); + exit( YY_EXIT_FAILURE ); } @@ -1836,7 +2072,7 @@ char msg[]; { \ /* Undo effects of setting up yytext. */ \ yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n - YY_MORE_ADJ; \ + yy_c_buf_p = yytext + n; \ yy_hold_char = *yy_c_buf_p; \ *yy_c_buf_p = '\0'; \ yyleng = n; \ @@ -1848,11 +2084,11 @@ char msg[]; #ifndef yytext_ptr #ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, const char *s2, int n ) +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) #else static void yy_flex_strncpy( s1, s2, n ) char *s1; -const char *s2; +yyconst char *s2; int n; #endif { @@ -1862,26 +2098,49 @@ int n; } #endif +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } +#endif + #ifdef YY_USE_PROTOS -static void *yy_flex_alloc( unsigned int size ) +static void *yy_flex_alloc( yy_size_t size ) #else static void *yy_flex_alloc( size ) -unsigned int size; +yy_size_t size; #endif { return (void *) malloc( size ); } #ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, unsigned int size ) +static void *yy_flex_realloc( void *ptr, yy_size_t size ) #else static void *yy_flex_realloc( ptr, size ) void *ptr; -unsigned int size; +yy_size_t size; #endif { - return (void *) realloc( ptr, size ); + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); } #ifdef YY_USE_PROTOS @@ -1893,7 +2152,15 @@ void *ptr; { free( ptr ); } -# line 240 "idl.ll" + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 240 "idl.ll" /* subroutines */ |