diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2008-06-18 17:08:13 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2008-06-18 17:08:13 +0000 |
commit | 11724267a2a3f24033f05322c4cb37dbe0569a84 (patch) | |
tree | ae8cd4c45ebacc2c1751dc9ad073faccfade90f8 /TAO/TAO_IDL | |
parent | b12241ebed380be7e63eaed0e8c0d9e1d15c2bda (diff) | |
download | ATCD-11724267a2a3f24033f05322c4cb37dbe0569a84.tar.gz |
ChangeLogTag: Wed Jun 18 17:05:50 UTC 2008 William R. Otte <wotte@CHELESTRA>
Diffstat (limited to 'TAO/TAO_IDL')
-rw-r--r-- | TAO/TAO_IDL/fe/lex.yy.cpp | 1383 |
1 files changed, 591 insertions, 792 deletions
diff --git a/TAO/TAO_IDL/fe/lex.yy.cpp b/TAO/TAO_IDL/fe/lex.yy.cpp index f38cfb34743..fac0867ce06 100644 --- a/TAO/TAO_IDL/fe/lex.yy.cpp +++ b/TAO/TAO_IDL/fe/lex.yy.cpp @@ -1,90 +1,32 @@ - -#line 3 "<stdout>" - -#define TAO_YY_INT_ALIGNED short int - /* A lexical scanner generated by flex */ +/* Scanner skeleton version: + * $Id$ + */ + #define FLEX_SCANNER #define TAO_YY_FLEX_MAJOR_VERSION 2 #define TAO_YY_FLEX_MINOR_VERSION 5 -#define TAO_YY_FLEX_SUBMINOR_VERSION 33 -#if TAO_YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ -/* begin standard C headers. */ -#include "ace/os_include/os_stdio.h" +#include "ace/OS_NS_ctype.h" +#include "ace/OS_NS_stdio.h" -/* end standard C headers. */ -/* flex integer type definitions */ -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ - -#if (__STDC_VERSION__ >= 199901L) || defined (__HP_aCC) - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus #endif -#include <inttypes.h> - -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) #endif -#endif /* ! FLEXINT_H */ #ifdef __cplusplus + +/* Use prototypes in function declarations. */ +#define TAO_YY_USE_PROTOS + /* The "const" storage-class-modifier is valid. */ #define TAO_YY_USE_CONST @@ -92,17 +34,32 @@ typedef unsigned int flex_uint32_t; #if __STDC__ +#define TAO_YY_USE_PROTOS #define TAO_YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#define TAO_YY_USE_CONST +#define TAO_YY_USE_PROTOS +#endif + #ifdef TAO_YY_USE_CONST #define tao_yyconst const #else #define tao_yyconst #endif + +#ifdef TAO_YY_USE_PROTOS +#define TAO_YY_PROTO(proto) proto +#else +#define TAO_YY_PROTO(proto) () +#endif + /* Returned upon end-of-file. */ #define TAO_YY_NULL 0 @@ -117,75 +74,71 @@ typedef unsigned int flex_uint32_t; * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ -#define BEGIN (tao_yy_start) = 1 + 2 * +#define BEGIN tao_yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The TAO_YYSTATE alias is for lex * compatibility. */ -#define TAO_YY_START (((tao_yy_start) - 1) / 2) +#define TAO_YY_START ((tao_yy_start - 1) / 2) #define TAO_YYSTATE TAO_YY_START /* Action number for EOF rule of a given start state. */ #define TAO_YY_STATE_EOF(state) (TAO_YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ -#define TAO_YY_NEW_FILE tao_yyrestart(tao_yyin ) +#define TAO_YY_NEW_FILE tao_yyrestart( tao_yyin ) #define TAO_YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ -#ifndef TAO_YY_BUF_SIZE #define TAO_YY_BUF_SIZE 16384 -#endif -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define TAO_YY_STATE_BUF_SIZE ((TAO_YY_BUF_SIZE + 2) * sizeof(tao_yy_state_type)) - -#ifndef TAO_YY_TYPEDEF_TAO_YY_BUFFER_STATE -#define TAO_YY_TYPEDEF_TAO_YY_BUFFER_STATE typedef struct tao_yy_buffer_state *TAO_YY_BUFFER_STATE; -#endif extern int tao_yyleng; - extern FILE *tao_yyin, *tao_yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - #define TAO_YY_LESS_LINENO(n) +/* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * tao_yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the tao_yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ -/* Return all but the first "n" matched characters back to the input stream. */ #define tao_yyless(n) \ do \ { \ /* Undo effects of setting up tao_yytext. */ \ - int tao_yyless_macro_arg = (n); \ - TAO_YY_LESS_LINENO(tao_yyless_macro_arg);\ - *tao_yy_cp = (tao_yy_hold_char); \ + *tao_yy_cp = tao_yy_hold_char; \ TAO_YY_RESTORE_TAO_YY_MORE_OFFSET \ - (tao_yy_c_buf_p) = tao_yy_cp = tao_yy_bp + tao_yyless_macro_arg - TAO_YY_MORE_ADJ; \ + tao_yy_c_buf_p = tao_yy_cp = tao_yy_bp + n - TAO_YY_MORE_ADJ; \ TAO_YY_DO_BEFORE_ACTION; /* set up tao_yytext again */ \ } \ while ( 0 ) -#define unput(c) tao_yyunput( c, (tao_yytext_ptr) ) +#define unput(c) tao_yyunput( c, tao_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). */ - -#ifndef TAO_YY_TYPEDEF_TAO_YY_SIZE_T -#define TAO_YY_TYPEDEF_TAO_YY_SIZE_T typedef unsigned int tao_yy_size_t; -#endif -#ifndef TAO_YY_STRUCT_TAO_YY_BUFFER_STATE -#define TAO_YY_STRUCT_TAO_YY_BUFFER_STATE + struct tao_yy_buffer_state { FILE *tao_yy_input_file; @@ -222,16 +175,12 @@ struct tao_yy_buffer_state */ int tao_yy_at_bol; - int tao_yy_bs_lineno; /**< The line count. */ - int tao_yy_bs_column; /**< The column count. */ - /* Whether to try to fill the input buffer when we reach the * end of it. */ int tao_yy_fill_buffer; int tao_yy_buffer_status; - #define TAO_YY_BUFFER_NEW 0 #define TAO_YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process @@ -245,38 +194,28 @@ struct tao_yy_buffer_state * just pointing tao_yyin at a new input file. */ #define TAO_YY_BUFFER_EOF_PENDING 2 - }; -#endif /* !TAO_YY_STRUCT_TAO_YY_BUFFER_STATE */ -/* Stack of input buffers. */ -static size_t tao_yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t tao_yy_buffer_stack_max = 0; /**< capacity of stack. */ -static TAO_YY_BUFFER_STATE * tao_yy_buffer_stack = 0; /**< Stack as an array. */ +static TAO_YY_BUFFER_STATE tao_yy_current_buffer = 0; /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". - * - * Returns the top of the stack, or 0. */ -#define TAO_YY_CURRENT_BUFFER ( (tao_yy_buffer_stack) \ - ? (tao_yy_buffer_stack)[(tao_yy_buffer_stack_top)] \ - : 0) +#define TAO_YY_CURRENT_BUFFER tao_yy_current_buffer -/* Same as previous macro, but useful when we know that the buffer stack is not - * 0 or when we need an lvalue. For internal use only. - */ -#define TAO_YY_CURRENT_BUFFER_LVALUE (tao_yy_buffer_stack)[(tao_yy_buffer_stack_top)] /* tao_yy_hold_char holds the character lost when tao_yytext is formed. */ static char tao_yy_hold_char; + static int tao_yy_n_chars; /* number of characters read into tao_yy_ch_buf */ + + int tao_yyleng; /* Points to current character in buffer. */ static char *tao_yy_c_buf_p = (char *) 0; -static int tao_yy_init = 0; /* whether we need to initialize */ +static int tao_yy_init = 1; /* whether we need to initialize */ static int tao_yy_start = 0; /* start state number */ /* Flag which is used to allow tao_yywrap()'s to do buffer switches @@ -284,94 +223,69 @@ static int tao_yy_start = 0; /* start state number */ */ static int tao_yy_did_buffer_switch_on_eof; -void tao_yyrestart (FILE *input_file ); -void tao_yy_switch_to_buffer (TAO_YY_BUFFER_STATE new_buffer ); -TAO_YY_BUFFER_STATE tao_yy_create_buffer (FILE *file,int size ); -void tao_yy_delete_buffer (TAO_YY_BUFFER_STATE b ); -void tao_yy_flush_buffer (TAO_YY_BUFFER_STATE b ); -void tao_yypush_buffer_state (TAO_YY_BUFFER_STATE new_buffer ); -void tao_yypop_buffer_state (void ); - -static void tao_yyensure_buffer_stack (void ); -static void tao_yy_load_buffer_state (void ); -static void tao_yy_init_buffer (TAO_YY_BUFFER_STATE b,FILE *file ); +void tao_yyrestart TAO_YY_PROTO(( FILE *input_file )); -#define TAO_YY_FLUSH_BUFFER tao_yy_flush_buffer(TAO_YY_CURRENT_BUFFER ) +void tao_yy_switch_to_buffer TAO_YY_PROTO(( TAO_YY_BUFFER_STATE new_buffer )); +void tao_yy_load_buffer_state TAO_YY_PROTO(( void )); +TAO_YY_BUFFER_STATE tao_yy_create_buffer TAO_YY_PROTO(( FILE *file, int size )); +void tao_yy_delete_buffer TAO_YY_PROTO(( TAO_YY_BUFFER_STATE b )); +void tao_yy_init_buffer TAO_YY_PROTO(( TAO_YY_BUFFER_STATE b, FILE *file )); +void tao_yy_flush_buffer TAO_YY_PROTO(( TAO_YY_BUFFER_STATE b )); +#define TAO_YY_FLUSH_BUFFER tao_yy_flush_buffer( tao_yy_current_buffer ) -TAO_YY_BUFFER_STATE tao_yy_scan_buffer (char *base,tao_yy_size_t size ); -TAO_YY_BUFFER_STATE tao_yy_scan_string (tao_yyconst char *tao_yy_str ); -TAO_YY_BUFFER_STATE tao_yy_scan_bytes (tao_yyconst char *bytes,int len ); +TAO_YY_BUFFER_STATE tao_yy_scan_buffer TAO_YY_PROTO(( char *base, tao_yy_size_t size )); +TAO_YY_BUFFER_STATE tao_yy_scan_string TAO_YY_PROTO(( tao_yyconst char *tao_yy_str )); +TAO_YY_BUFFER_STATE tao_yy_scan_bytes TAO_YY_PROTO(( tao_yyconst char *bytes, int len )); -void *tao_yyalloc (tao_yy_size_t ); -void *tao_yyrealloc (void *,tao_yy_size_t ); -void tao_yyfree (void * ); +static void *tao_yy_flex_alloc TAO_YY_PROTO(( tao_yy_size_t )); +static void *tao_yy_flex_realloc TAO_YY_PROTO(( void *, tao_yy_size_t )); +static void tao_yy_flex_free TAO_YY_PROTO(( void * )); #define tao_yy_new_buffer tao_yy_create_buffer #define tao_yy_set_interactive(is_interactive) \ { \ - if ( ! TAO_YY_CURRENT_BUFFER ){ \ - tao_yyensure_buffer_stack (); \ - TAO_YY_CURRENT_BUFFER_LVALUE = \ - tao_yy_create_buffer(tao_yyin,TAO_YY_BUF_SIZE ); \ - } \ - TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_is_interactive = is_interactive; \ + if ( ! tao_yy_current_buffer ) \ + tao_yy_current_buffer = tao_yy_create_buffer( tao_yyin, TAO_YY_BUF_SIZE ); \ + tao_yy_current_buffer->tao_yy_is_interactive = is_interactive; \ } #define tao_yy_set_bol(at_bol) \ { \ - if ( ! TAO_YY_CURRENT_BUFFER ){\ - tao_yyensure_buffer_stack (); \ - TAO_YY_CURRENT_BUFFER_LVALUE = \ - tao_yy_create_buffer(tao_yyin,TAO_YY_BUF_SIZE ); \ - } \ - TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_at_bol = at_bol; \ + if ( ! tao_yy_current_buffer ) \ + tao_yy_current_buffer = tao_yy_create_buffer( tao_yyin, TAO_YY_BUF_SIZE ); \ + tao_yy_current_buffer->tao_yy_at_bol = at_bol; \ } -#define TAO_YY_AT_BOL() (TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_at_bol) - -/* Begin user sect3 */ +#define TAO_YY_AT_BOL() (tao_yy_current_buffer->tao_yy_at_bol) typedef unsigned char TAO_YY_CHAR; - FILE *tao_yyin = (FILE *) 0, *tao_yyout = (FILE *) 0; - typedef int tao_yy_state_type; - -extern int tao_yylineno; - -int tao_yylineno = 1; - extern char tao_yytext[]; -static tao_yy_state_type tao_yy_get_previous_state (void ); -static tao_yy_state_type tao_yy_try_NUL_trans (tao_yy_state_type current_state ); -static int tao_yy_get_next_buffer (void ); -static void tao_yy_fatal_error (tao_yyconst char msg[] ); + +static tao_yy_state_type tao_yy_get_previous_state TAO_YY_PROTO(( void )); +static tao_yy_state_type tao_yy_try_NUL_trans TAO_YY_PROTO(( tao_yy_state_type current_state )); +static int tao_yy_get_next_buffer TAO_YY_PROTO(( void )); +static void tao_yy_fatal_error TAO_YY_PROTO(( tao_yyconst char msg[] )); /* Done after the current pattern has been matched and before the * corresponding action - sets up tao_yytext. */ #define TAO_YY_DO_BEFORE_ACTION \ - (tao_yytext_ptr) = tao_yy_bp; \ - tao_yyleng = (size_t) (tao_yy_cp - tao_yy_bp); \ - (tao_yy_hold_char) = *tao_yy_cp; \ + tao_yytext_ptr = tao_yy_bp; \ + tao_yyleng = (int) (tao_yy_cp - tao_yy_bp); \ + tao_yy_hold_char = *tao_yy_cp; \ *tao_yy_cp = '\0'; \ if ( tao_yyleng >= TAO_YYLMAX ) \ TAO_YY_FATAL_ERROR( "token too large, exceeds TAO_YYLMAX" ); \ - tao_yy_flex_strncpy( tao_yytext, (tao_yytext_ptr), tao_yyleng + 1 ); \ - (tao_yy_c_buf_p) = tao_yy_cp; + tao_yy_flex_strncpy( tao_yytext, tao_yytext_ptr, tao_yyleng + 1 ); \ + tao_yy_c_buf_p = tao_yy_cp; #define TAO_YY_NUM_RULES 104 #define TAO_YY_END_OF_BUFFER 105 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct tao_yy_trans_info - { - flex_int32_t tao_yy_verify; - flex_int32_t tao_yy_nxt; - }; -static tao_yyconst flex_int16_t tao_yy_accept[562] = +static tao_yyconst short int tao_yy_accept[562] = { 0, 101, 101, 105, 103, 101, 102, 102, 103, 103, 103, 103, 103, 76, 72, 103, 103, 103, 68, 68, 68, @@ -437,7 +351,7 @@ static tao_yyconst flex_int16_t tao_yy_accept[562] = 0 } ; -static tao_yyconst flex_int32_t tao_yy_ec[256] = +static tao_yyconst int tao_yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, @@ -469,7 +383,7 @@ static tao_yyconst flex_int32_t tao_yy_ec[256] = 1, 1, 1, 1, 1 } ; -static tao_yyconst flex_int32_t tao_yy_meta[60] = +static tao_yyconst int tao_yy_meta[60] = { 0, 1, 1, 2, 1, 1, 3, 1, 4, 1, 1, 1, 1, 1, 5, 5, 6, 1, 1, 1, 1, @@ -479,7 +393,7 @@ static tao_yyconst flex_int32_t tao_yy_meta[60] = 7, 8, 7, 8, 9, 8, 7, 8, 7 } ; -static tao_yyconst flex_int16_t tao_yy_base[590] = +static tao_yyconst short int tao_yy_base[590] = { 0, 0, 58, 1129, 1130, 59, 1130, 1130, 56, 1094, 54, 57, 65, 68, 73, 1110, 1108, 1105, 0, 1102, 69, @@ -547,7 +461,7 @@ static tao_yyconst flex_int16_t tao_yy_base[590] = 817, 823, 829, 838, 847, 856, 865, 874, 883 } ; -static tao_yyconst flex_int16_t tao_yy_def[590] = +static tao_yyconst short int tao_yy_def[590] = { 0, 561, 1, 561, 561, 561, 561, 561, 562, 563, 561, 561, 561, 561, 561, 561, 561, 561, 564, 564, 564, @@ -615,7 +529,7 @@ static tao_yyconst flex_int16_t tao_yy_def[590] = 561, 561, 561, 561, 561, 561, 561, 561, 561 } ; -static tao_yyconst flex_int16_t tao_yy_nxt[1190] = +static tao_yyconst short int tao_yy_nxt[1190] = { 0, 4, 5, 6, 7, 5, 8, 4, 9, 4, 4, 10, 11, 12, 13, 14, 14, 15, 16, 4, 17, @@ -749,7 +663,7 @@ static tao_yyconst flex_int16_t tao_yy_nxt[1190] = 561, 561, 561, 561, 561, 561, 561, 561, 561 } ; -static tao_yyconst flex_int16_t tao_yy_chk[1190] = +static tao_yyconst short int tao_yy_chk[1190] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -886,9 +800,6 @@ static tao_yyconst flex_int16_t tao_yy_chk[1190] = static tao_yy_state_type tao_yy_last_accepting_state; static char *tao_yy_last_accepting_cpos; -extern int tao_yy_flex_debug; -int tao_yy_flex_debug = 0; - /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ @@ -902,6 +813,7 @@ int tao_yy_flex_debug = 0; char tao_yytext[TAO_YYLMAX]; char *tao_yytext_ptr; +#define INITIAL 0 /* $Id$ COPYRIGHT @@ -1009,22 +921,7 @@ static AST_Decl * idl_find_node (char *); #endif /*USE_MCPP_BUFFER_LEXING*/ /* SO we don't choke on files that use \r\n */ - -#define INITIAL 0 - -#ifndef TAO_YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include "ace/os_include/os_ctype.h" -#endif - -#ifndef TAO_YY_EXTRA_TYPE -#define TAO_YY_EXTRA_TYPE void * -#endif - -static int tao_yy_init_globals (void ); +#define TAO_YY_NEVER_INTERACTIVE 1 /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1032,30 +929,64 @@ static int tao_yy_init_globals (void ); #ifndef TAO_YY_SKIP_TAO_YYWRAP #ifdef __cplusplus -extern "C" int tao_yywrap (void ); +extern "C" int tao_yywrap TAO_YY_PROTO(( void )); #else -extern int tao_yywrap (void ); +extern int tao_yywrap TAO_YY_PROTO(( void )); #endif #endif - static void tao_yyunput (int c,char *buf_ptr ); +#ifndef TAO_YY_NO_UNPUT +static void tao_yyunput TAO_YY_PROTO(( int c, char *buf_ptr )); +#endif #ifndef tao_yytext_ptr -static void tao_yy_flex_strncpy (char *,tao_yyconst char *,int ); +static void tao_yy_flex_strncpy TAO_YY_PROTO(( char *, tao_yyconst char *, int )); #endif #ifdef TAO_YY_NEED_STRLEN -static int tao_yy_flex_strlen (tao_yyconst char * ); +static int tao_yy_flex_strlen TAO_YY_PROTO(( tao_yyconst char * )); #endif #ifndef TAO_YY_NO_INPUT - #ifdef __cplusplus -static int tao_yyinput (void ); +static int tao_yyinput TAO_YY_PROTO(( void )); #else -static int input (void ); +static int input TAO_YY_PROTO(( void )); +#endif #endif +#if TAO_YY_STACK_USED +static int tao_yy_start_stack_ptr = 0; +static int tao_yy_start_stack_depth = 0; +static int *tao_yy_start_stack = 0; +#ifndef TAO_YY_NO_PUSH_STATE +static void tao_yy_push_state TAO_YY_PROTO(( int new_state )); +#endif +#ifndef TAO_YY_NO_POP_STATE +static void tao_yy_pop_state TAO_YY_PROTO(( void )); +#endif +#ifndef TAO_YY_NO_TOP_STATE +static int tao_yy_top_state TAO_YY_PROTO(( void )); +#endif + +#else +#define TAO_YY_NO_PUSH_STATE 1 +#define TAO_YY_NO_POP_STATE 1 +#define TAO_YY_NO_TOP_STATE 1 +#endif + +#ifdef TAO_YY_MALLOC_DECL +TAO_YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#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. */ @@ -1064,24 +995,26 @@ static int input (void ); #endif /* Copy whatever the last rule matched to the standard output. */ + +//FUZZ: disable check_for_lack_ACE_OS #ifndef TAO_YY_ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define TAO_YY_ECHO (void) fwrite( tao_yytext, tao_yyleng, 1, tao_yyout ) #endif +//FUZZ: enable check_for_lack_ACE_OS /* Gets input and stuffs it into "buf". number of characters read, or TAO_YY_NULL, * is returned in "result". */ #ifndef TAO_YY_INPUT #define TAO_YY_INPUT(buf,result,max_size) \ - if ( TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_is_interactive ) \ + if ( tao_yy_current_buffer->tao_yy_is_interactive ) \ { \ - int c = '*'; \ - int n; \ + int c = '*', n; \ for ( n = 0; n < max_size && \ - (c = getc( tao_yyin )) != EOF && c != '\n'; ++n ) \ + (c = ACE_OS::getc( tao_yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ @@ -1089,22 +1022,9 @@ static int input (void ); TAO_YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ - else \ - { \ - errno=0; \ - while ( (result = static_cast<int> (fread(buf, 1, max_size, tao_yyin)))==0 && ferror(tao_yyin)) \ - { \ - if( errno != EINTR) \ - { \ - TAO_YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(tao_yyin); \ - } \ - }\ -\ - + else if ( ((result = static_cast<int> (ACE_OS::fread( buf, 1, max_size, tao_yyin ))) == 0) \ + && ferror( tao_yyin ) ) \ + TAO_YY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "tao_yyterminate();" - @@ -1125,18 +1045,12 @@ static int input (void ); #define TAO_YY_FATAL_ERROR(msg) tao_yy_fatal_error( msg ) #endif -/* end tables serialization structures and prototypes */ - /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef TAO_YY_DECL -#define TAO_YY_DECL_IS_OURS 1 - -extern int tao_yylex (void); - -#define TAO_YY_DECL int tao_yylex (void) -#endif /* !TAO_YY_DECL */ +#define TAO_YY_DECL int tao_yylex TAO_YY_PROTO(( void )) +#endif /* Code executed at the beginning of each rule, after tao_yytext and tao_yyleng * have been set up. @@ -1152,28 +1066,29 @@ extern int tao_yylex (void); #define TAO_YY_RULE_SETUP \ if ( tao_yyleng > 0 ) \ - TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_at_bol = \ + tao_yy_current_buffer->tao_yy_at_bol = \ (tao_yytext[tao_yyleng - 1] == '\n'); \ TAO_YY_USER_ACTION -/** The main scanner function which does all the work. - */ TAO_YY_DECL -{ + { register tao_yy_state_type tao_yy_current_state; - register char *tao_yy_cp, *tao_yy_bp; + register char *tao_yy_cp = 0, *tao_yy_bp = 0; register int tao_yy_act; - if ( !(tao_yy_init) ) + + + + if ( tao_yy_init ) { - (tao_yy_init) = 1; + tao_yy_init = 0; #ifdef TAO_YY_USER_INIT TAO_YY_USER_INIT; #endif - if ( ! (tao_yy_start) ) - (tao_yy_start) = 1; /* first start state */ + if ( ! tao_yy_start ) + tao_yy_start = 1; /* first start state */ if ( ! tao_yyin ) tao_yyin = stdin; @@ -1181,28 +1096,26 @@ TAO_YY_DECL if ( ! tao_yyout ) tao_yyout = stdout; - if ( ! TAO_YY_CURRENT_BUFFER ) { - tao_yyensure_buffer_stack (); - TAO_YY_CURRENT_BUFFER_LVALUE = - tao_yy_create_buffer(tao_yyin,TAO_YY_BUF_SIZE ); - } + if ( ! tao_yy_current_buffer ) + tao_yy_current_buffer = + tao_yy_create_buffer( tao_yyin, TAO_YY_BUF_SIZE ); - tao_yy_load_buffer_state( ); + tao_yy_load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { - tao_yy_cp = (tao_yy_c_buf_p); + tao_yy_cp = tao_yy_c_buf_p; /* Support of tao_yytext. */ - *tao_yy_cp = (tao_yy_hold_char); + *tao_yy_cp = tao_yy_hold_char; /* tao_yy_bp points to the position in tao_yy_ch_buf of the start of * the current run. */ tao_yy_bp = tao_yy_cp; - tao_yy_current_state = (tao_yy_start); + tao_yy_current_state = tao_yy_start; tao_yy_current_state += TAO_YY_AT_BOL(); tao_yy_match: do @@ -1210,8 +1123,8 @@ tao_yy_match: register TAO_YY_CHAR tao_yy_c = tao_yy_ec[TAO_YY_SC_TO_UI(*tao_yy_cp)]; if ( tao_yy_accept[tao_yy_current_state] ) { - (tao_yy_last_accepting_state) = tao_yy_current_state; - (tao_yy_last_accepting_cpos) = tao_yy_cp; + tao_yy_last_accepting_state = tao_yy_current_state; + tao_yy_last_accepting_cpos = tao_yy_cp; } while ( tao_yy_chk[tao_yy_base[tao_yy_current_state] + tao_yy_c] != tao_yy_current_state ) { @@ -1222,24 +1135,30 @@ tao_yy_match: tao_yy_current_state = tao_yy_nxt[tao_yy_base[tao_yy_current_state] + (unsigned int) tao_yy_c]; ++tao_yy_cp; } - while ( tao_yy_current_state != 561 ); - tao_yy_cp = (tao_yy_last_accepting_cpos); - tao_yy_current_state = (tao_yy_last_accepting_state); + while ( tao_yy_base[tao_yy_current_state] != 1130 ); tao_yy_find_action: tao_yy_act = tao_yy_accept[tao_yy_current_state]; + if ( tao_yy_act == 0 ) + { /* have to back up */ + tao_yy_cp = tao_yy_last_accepting_cpos; + tao_yy_current_state = tao_yy_last_accepting_state; + tao_yy_act = tao_yy_accept[tao_yy_current_state]; + } TAO_YY_DO_BEFORE_ACTION; + do_action: /* This label is used only to access EOF actions. */ + switch ( tao_yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of TAO_YY_DO_BEFORE_ACTION */ - *tao_yy_cp = (tao_yy_hold_char); - tao_yy_cp = (tao_yy_last_accepting_cpos); - tao_yy_current_state = (tao_yy_last_accepting_state); + *tao_yy_cp = tao_yy_hold_char; + tao_yy_cp = tao_yy_last_accepting_cpos; + tao_yy_current_state = tao_yy_last_accepting_state; goto tao_yy_find_action; case 1: @@ -1605,13 +1524,12 @@ TAO_YY_RULE_SETUP } TAO_YY_BREAK case 77: -/* rule 77 can match eol */ TAO_YY_RULE_SETUP { /* Skip the quotes */ char * const tmp = ace_tao_yytext; for(size_t i = ACE_OS::strlen (tmp); i-- != 0; ) { - if (isspace(tmp[i])) { + if (ACE_OS::ace_isspace(tmp[i])) { tmp[i] = '\0'; } else { @@ -1626,13 +1544,12 @@ TAO_YY_RULE_SETUP } TAO_YY_BREAK case 78: -/* rule 78 can match eol */ TAO_YY_RULE_SETUP { /* Skip the bookends */ char * const tmp = ACE_OS::strdup (ace_tao_yytext); for(size_t i = ACE_OS::strlen (tmp); i-- != 0; ) { - if (isspace(tmp[i])) { + if (ACE_OS::ace_isspace(tmp[i])) { tmp[i] = '\0'; } else { @@ -1691,9 +1608,7 @@ TAO_YY_RULE_SETUP } TAO_YY_BREAK case 85: -/* rule 85 can match eol */ case 86: -/* rule 86 can match eol */ TAO_YY_RULE_SETUP {/* remember pragma */ idl_global->set_lineno(idl_global->lineno() + 1); @@ -1701,68 +1616,55 @@ TAO_YY_RULE_SETUP } break; case 87: -/* rule 87 can match eol */ case 88: -/* rule 88 can match eol */ TAO_YY_RULE_SETUP {/* ignore file */ idl_global->set_lineno(idl_global->lineno() + 1); } break; case 89: -/* rule 89 can match eol */ case 90: -/* rule 90 can match eol */ TAO_YY_RULE_SETUP { idl_parse_line_and_file(ace_tao_yytext); } break; case 91: -/* rule 91 can match eol */ case 92: -/* rule 92 can match eol */ TAO_YY_RULE_SETUP { idl_parse_line_and_file(ace_tao_yytext); } break; case 93: -/* rule 93 can match eol */ case 94: -/* rule 94 can match eol */ TAO_YY_RULE_SETUP { idl_parse_line_and_file(ace_tao_yytext); } break; case 95: -/* rule 95 can match eol */ case 96: -/* rule 96 can match eol */ TAO_YY_RULE_SETUP { idl_parse_line_and_file(ace_tao_yytext); } - break; + break; case 97: -/* rule 97 can match eol */ case 98: -/* rule 98 can match eol */ TAO_YY_RULE_SETUP { /* ignore cpp ident */ idl_global->set_lineno(idl_global->lineno() + 1); } - break; + break; case 99: -/* rule 99 can match eol */ TAO_YY_RULE_SETUP { /* ignore comments */ idl_global->set_lineno(idl_global->lineno() + 1); } - break; + break; case 100: TAO_YY_RULE_SETUP { @@ -1780,18 +1682,17 @@ TAO_YY_RULE_SETUP } } } - TAO_YY_BREAK + break; case 101: TAO_YY_RULE_SETUP ; - break; + break; case 102: -/* rule 102 can match eol */ TAO_YY_RULE_SETUP { idl_global->set_lineno(idl_global->lineno() + 1); } - break; + break; case 103: TAO_YY_RULE_SETUP return ace_tao_yytext [0]; @@ -1806,26 +1707,26 @@ case TAO_YY_STATE_EOF(INITIAL): case TAO_YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ - int tao_yy_amount_of_matched_text = (int) (tao_yy_cp - (tao_yytext_ptr)) - 1; + int tao_yy_amount_of_matched_text = (int) (tao_yy_cp - tao_yytext_ptr) - 1; /* Undo the effects of TAO_YY_DO_BEFORE_ACTION. */ - *tao_yy_cp = (tao_yy_hold_char); + *tao_yy_cp = tao_yy_hold_char; TAO_YY_RESTORE_TAO_YY_MORE_OFFSET - if ( TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_buffer_status == TAO_YY_BUFFER_NEW ) + if ( tao_yy_current_buffer->tao_yy_buffer_status == TAO_YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed tao_yyin at a new source and called * tao_yylex(). If so, then we have to assure - * consistency between TAO_YY_CURRENT_BUFFER and our + * consistency between tao_yy_current_buffer and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ - (tao_yy_n_chars) = TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_n_chars; - TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_input_file = tao_yyin; - TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_buffer_status = TAO_YY_BUFFER_NORMAL; + tao_yy_n_chars = tao_yy_current_buffer->tao_yy_n_chars; + tao_yy_current_buffer->tao_yy_input_file = tao_yyin; + tao_yy_current_buffer->tao_yy_buffer_status = TAO_YY_BUFFER_NORMAL; } /* Note that here we test for tao_yy_c_buf_p "<=" to the position @@ -1835,13 +1736,13 @@ case TAO_YY_STATE_EOF(INITIAL): * end-of-buffer state). Contrast this with the test * in input(). */ - if ( (tao_yy_c_buf_p) <= &TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_ch_buf[(tao_yy_n_chars)] ) + if ( tao_yy_c_buf_p <= &tao_yy_current_buffer->tao_yy_ch_buf[tao_yy_n_chars] ) { /* This was really a NUL. */ tao_yy_state_type tao_yy_next_state; - (tao_yy_c_buf_p) = (tao_yytext_ptr) + tao_yy_amount_of_matched_text; + tao_yy_c_buf_p = tao_yytext_ptr + tao_yy_amount_of_matched_text; - tao_yy_current_state = tao_yy_get_previous_state( ); + tao_yy_current_state = tao_yy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have @@ -1854,31 +1755,30 @@ case TAO_YY_STATE_EOF(INITIAL): tao_yy_next_state = tao_yy_try_NUL_trans( tao_yy_current_state ); - tao_yy_bp = (tao_yytext_ptr) + TAO_YY_MORE_ADJ; + tao_yy_bp = tao_yytext_ptr + TAO_YY_MORE_ADJ; if ( tao_yy_next_state ) { /* Consume the NUL. */ - tao_yy_cp = ++(tao_yy_c_buf_p); + tao_yy_cp = ++tao_yy_c_buf_p; tao_yy_current_state = tao_yy_next_state; goto tao_yy_match; } else { - tao_yy_cp = (tao_yy_last_accepting_cpos); - tao_yy_current_state = (tao_yy_last_accepting_state); + tao_yy_cp = tao_yy_c_buf_p; goto tao_yy_find_action; } } - else switch ( tao_yy_get_next_buffer( ) ) + else switch ( tao_yy_get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { - (tao_yy_did_buffer_switch_on_eof) = 0; + tao_yy_did_buffer_switch_on_eof = 0; - if ( tao_yywrap( ) ) + if ( tao_yywrap() ) { /* Note: because we've taken care in * tao_yy_get_next_buffer() to have set up @@ -1889,7 +1789,7 @@ case TAO_YY_STATE_EOF(INITIAL): * TAO_YY_NULL, it'll still work - another * TAO_YY_NULL will get returned. */ - (tao_yy_c_buf_p) = (tao_yytext_ptr) + TAO_YY_MORE_ADJ; + tao_yy_c_buf_p = tao_yytext_ptr + TAO_YY_MORE_ADJ; tao_yy_act = TAO_YY_STATE_EOF(TAO_YY_START); goto do_action; @@ -1897,30 +1797,30 @@ case TAO_YY_STATE_EOF(INITIAL): else { - if ( ! (tao_yy_did_buffer_switch_on_eof) ) + if ( ! tao_yy_did_buffer_switch_on_eof ) TAO_YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: - (tao_yy_c_buf_p) = - (tao_yytext_ptr) + tao_yy_amount_of_matched_text; + tao_yy_c_buf_p = + tao_yytext_ptr + tao_yy_amount_of_matched_text; - tao_yy_current_state = tao_yy_get_previous_state( ); + tao_yy_current_state = tao_yy_get_previous_state(); - tao_yy_cp = (tao_yy_c_buf_p); - tao_yy_bp = (tao_yytext_ptr) + TAO_YY_MORE_ADJ; + tao_yy_cp = tao_yy_c_buf_p; + tao_yy_bp = tao_yytext_ptr + TAO_YY_MORE_ADJ; goto tao_yy_match; case EOB_ACT_LAST_MATCH: - (tao_yy_c_buf_p) = - &TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_ch_buf[(tao_yy_n_chars)]; + tao_yy_c_buf_p = + &tao_yy_current_buffer->tao_yy_ch_buf[tao_yy_n_chars]; - tao_yy_current_state = tao_yy_get_previous_state( ); + tao_yy_current_state = tao_yy_get_previous_state(); - tao_yy_cp = (tao_yy_c_buf_p); - tao_yy_bp = (tao_yytext_ptr) + TAO_YY_MORE_ADJ; + tao_yy_cp = tao_yy_c_buf_p; + tao_yy_bp = tao_yytext_ptr + TAO_YY_MORE_ADJ; goto tao_yy_find_action; } break; @@ -1931,7 +1831,8 @@ case TAO_YY_STATE_EOF(INITIAL): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ -} /* end of tao_yylex */ + } /* end of tao_yylex */ + /* tao_yy_get_next_buffer - try to read in a new buffer * @@ -1940,20 +1841,21 @@ case TAO_YY_STATE_EOF(INITIAL): * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ -static int tao_yy_get_next_buffer (void) -{ - register char *dest = TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_ch_buf; - register char *source = (tao_yytext_ptr); + +static int tao_yy_get_next_buffer() + { + register char *dest = tao_yy_current_buffer->tao_yy_ch_buf; + register char *source = tao_yytext_ptr; register int number_to_move, i; int ret_val; - if ( (tao_yy_c_buf_p) > &TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_ch_buf[(tao_yy_n_chars) + 1] ) + if ( tao_yy_c_buf_p > &tao_yy_current_buffer->tao_yy_ch_buf[tao_yy_n_chars + 1] ) TAO_YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); - if ( TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_fill_buffer == 0 ) + if ( tao_yy_current_buffer->tao_yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (tao_yy_c_buf_p) - (tao_yytext_ptr) - TAO_YY_MORE_ADJ == 1 ) + if ( tao_yy_c_buf_p - tao_yytext_ptr - TAO_YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. @@ -1973,30 +1875,34 @@ static int tao_yy_get_next_buffer (void) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((tao_yy_c_buf_p) - (tao_yytext_ptr)) - 1; + number_to_move = (int) (tao_yy_c_buf_p - tao_yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); - if ( TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_buffer_status == TAO_YY_BUFFER_EOF_PENDING ) + if ( tao_yy_current_buffer->tao_yy_buffer_status == TAO_YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ - TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_n_chars = (tao_yy_n_chars) = 0; + tao_yy_current_buffer->tao_yy_n_chars = tao_yy_n_chars = 0; else { - int num_to_read = - TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_buf_size - number_to_move - 1; + int num_to_read = + tao_yy_current_buffer->tao_yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ +#ifdef TAO_YY_USES_REJECT + TAO_YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else /* just a shorter name for the current buffer */ - TAO_YY_BUFFER_STATE b = TAO_YY_CURRENT_BUFFER; + TAO_YY_BUFFER_STATE b = tao_yy_current_buffer; int tao_yy_c_buf_p_offset = - (int) ((tao_yy_c_buf_p) - b->tao_yy_ch_buf); + (int) (tao_yy_c_buf_p - b->tao_yy_ch_buf); if ( b->tao_yy_is_our_buffer ) { @@ -2009,7 +1915,8 @@ static int tao_yy_get_next_buffer (void) b->tao_yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - tao_yyrealloc((void *) b->tao_yy_ch_buf,b->tao_yy_buf_size + 2 ); + tao_yy_flex_realloc( (void *) b->tao_yy_ch_buf, + b->tao_yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ @@ -2019,35 +1926,35 @@ static int tao_yy_get_next_buffer (void) TAO_YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); - (tao_yy_c_buf_p) = &b->tao_yy_ch_buf[tao_yy_c_buf_p_offset]; + tao_yy_c_buf_p = &b->tao_yy_ch_buf[tao_yy_c_buf_p_offset]; - num_to_read = TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_buf_size - + num_to_read = tao_yy_current_buffer->tao_yy_buf_size - number_to_move - 1; - +#endif } if ( num_to_read > TAO_YY_READ_BUF_SIZE ) num_to_read = TAO_YY_READ_BUF_SIZE; /* Read in more data. */ - TAO_YY_INPUT( (&TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_ch_buf[number_to_move]), - (tao_yy_n_chars), num_to_read ); + TAO_YY_INPUT( (&tao_yy_current_buffer->tao_yy_ch_buf[number_to_move]), + tao_yy_n_chars, num_to_read ); - TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_n_chars = (tao_yy_n_chars); + tao_yy_current_buffer->tao_yy_n_chars = tao_yy_n_chars; } - if ( (tao_yy_n_chars) == 0 ) + if ( tao_yy_n_chars == 0 ) { if ( number_to_move == TAO_YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - tao_yyrestart(tao_yyin ); + tao_yyrestart( tao_yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; - TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_buffer_status = + tao_yy_current_buffer->tao_yy_buffer_status = TAO_YY_BUFFER_EOF_PENDING; } } @@ -2055,32 +1962,33 @@ static int tao_yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; - (tao_yy_n_chars) += number_to_move; - TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_ch_buf[(tao_yy_n_chars)] = TAO_YY_END_OF_BUFFER_CHAR; - TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_ch_buf[(tao_yy_n_chars) + 1] = TAO_YY_END_OF_BUFFER_CHAR; + tao_yy_n_chars += number_to_move; + tao_yy_current_buffer->tao_yy_ch_buf[tao_yy_n_chars] = TAO_YY_END_OF_BUFFER_CHAR; + tao_yy_current_buffer->tao_yy_ch_buf[tao_yy_n_chars + 1] = TAO_YY_END_OF_BUFFER_CHAR; - (tao_yytext_ptr) = &TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_ch_buf[0]; + tao_yytext_ptr = &tao_yy_current_buffer->tao_yy_ch_buf[0]; return ret_val; -} + } + /* tao_yy_get_previous_state - get the state just before the EOB char was reached */ - static tao_yy_state_type tao_yy_get_previous_state (void) -{ +static tao_yy_state_type tao_yy_get_previous_state() + { register tao_yy_state_type tao_yy_current_state; register char *tao_yy_cp; - tao_yy_current_state = (tao_yy_start); + tao_yy_current_state = tao_yy_start; tao_yy_current_state += TAO_YY_AT_BOL(); - for ( tao_yy_cp = (tao_yytext_ptr) + TAO_YY_MORE_ADJ; tao_yy_cp < (tao_yy_c_buf_p); ++tao_yy_cp ) + for ( tao_yy_cp = tao_yytext_ptr + TAO_YY_MORE_ADJ; tao_yy_cp < tao_yy_c_buf_p; ++tao_yy_cp ) { register TAO_YY_CHAR tao_yy_c = (*tao_yy_cp ? tao_yy_ec[TAO_YY_SC_TO_UI(*tao_yy_cp)] : 1); if ( tao_yy_accept[tao_yy_current_state] ) { - (tao_yy_last_accepting_state) = tao_yy_current_state; - (tao_yy_last_accepting_cpos) = tao_yy_cp; + tao_yy_last_accepting_state = tao_yy_current_state; + tao_yy_last_accepting_cpos = tao_yy_cp; } while ( tao_yy_chk[tao_yy_base[tao_yy_current_state] + tao_yy_c] != tao_yy_current_state ) { @@ -2092,23 +2000,30 @@ static int tao_yy_get_next_buffer (void) } return tao_yy_current_state; -} + } + /* tao_yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = tao_yy_try_NUL_trans( current_state ); */ - static tao_yy_state_type tao_yy_try_NUL_trans (tao_yy_state_type tao_yy_current_state ) -{ + +#ifdef TAO_YY_USE_PROTOS +static tao_yy_state_type tao_yy_try_NUL_trans( tao_yy_state_type tao_yy_current_state ) +#else +static tao_yy_state_type tao_yy_try_NUL_trans( tao_yy_current_state ) +tao_yy_state_type tao_yy_current_state; +#endif + { register int tao_yy_is_jam; - register char *tao_yy_cp = (tao_yy_c_buf_p); + register char *tao_yy_cp = tao_yy_c_buf_p; register TAO_YY_CHAR tao_yy_c = 1; if ( tao_yy_accept[tao_yy_current_state] ) { - (tao_yy_last_accepting_state) = tao_yy_current_state; - (tao_yy_last_accepting_cpos) = tao_yy_cp; + tao_yy_last_accepting_state = tao_yy_current_state; + tao_yy_last_accepting_cpos = tao_yy_cp; } while ( tao_yy_chk[tao_yy_base[tao_yy_current_state] + tao_yy_c] != tao_yy_current_state ) { @@ -2120,73 +2035,81 @@ static int tao_yy_get_next_buffer (void) tao_yy_is_jam = (tao_yy_current_state == 561); return tao_yy_is_jam ? 0 : tao_yy_current_state; -} + } - static void tao_yyunput (int c, register char * tao_yy_bp ) -{ - register char *tao_yy_cp; - tao_yy_cp = (tao_yy_c_buf_p); +#ifndef TAO_YY_NO_UNPUT +#ifdef TAO_YY_USE_PROTOS +static void tao_yyunput( int c, register char *tao_yy_bp ) +#else +static void tao_yyunput( c, tao_yy_bp ) +int c; +register char *tao_yy_bp; +#endif + { + register char *tao_yy_cp = tao_yy_c_buf_p; /* undo effects of setting up tao_yytext */ - *tao_yy_cp = (tao_yy_hold_char); + *tao_yy_cp = tao_yy_hold_char; - if ( tao_yy_cp < TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_ch_buf + 2 ) + if ( tao_yy_cp < tao_yy_current_buffer->tao_yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = (tao_yy_n_chars) + 2; - register char *dest = &TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_ch_buf[ - TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_buf_size + 2]; + register int number_to_move = tao_yy_n_chars + 2; + register char *dest = &tao_yy_current_buffer->tao_yy_ch_buf[ + tao_yy_current_buffer->tao_yy_buf_size + 2]; register char *source = - &TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_ch_buf[number_to_move]; + &tao_yy_current_buffer->tao_yy_ch_buf[number_to_move]; - while ( source > TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_ch_buf ) + while ( source > tao_yy_current_buffer->tao_yy_ch_buf ) *--dest = *--source; tao_yy_cp += (int) (dest - source); tao_yy_bp += (int) (dest - source); - TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_n_chars = - (tao_yy_n_chars) = TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_buf_size; + tao_yy_current_buffer->tao_yy_n_chars = + tao_yy_n_chars = tao_yy_current_buffer->tao_yy_buf_size; - if ( tao_yy_cp < TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_ch_buf + 2 ) + if ( tao_yy_cp < tao_yy_current_buffer->tao_yy_ch_buf + 2 ) TAO_YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--tao_yy_cp = (char) c; - (tao_yytext_ptr) = tao_yy_bp; - (tao_yy_hold_char) = *tao_yy_cp; - (tao_yy_c_buf_p) = tao_yy_cp; -} + + tao_yytext_ptr = tao_yy_bp; + tao_yy_hold_char = *tao_yy_cp; + tao_yy_c_buf_p = tao_yy_cp; + } +#endif /* ifndef TAO_YY_NO_UNPUT */ + #ifndef TAO_YY_NO_INPUT #ifdef __cplusplus - static int tao_yyinput (void) +static int tao_yyinput() #else - static int input (void) +static int input() #endif - -{ + { int c; - *(tao_yy_c_buf_p) = (tao_yy_hold_char); + *tao_yy_c_buf_p = tao_yy_hold_char; - if ( *(tao_yy_c_buf_p) == TAO_YY_END_OF_BUFFER_CHAR ) + if ( *tao_yy_c_buf_p == TAO_YY_END_OF_BUFFER_CHAR ) { /* tao_yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ - if ( (tao_yy_c_buf_p) < &TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_ch_buf[(tao_yy_n_chars)] ) + if ( tao_yy_c_buf_p < &tao_yy_current_buffer->tao_yy_ch_buf[tao_yy_n_chars] ) /* This was really a NUL. */ - *(tao_yy_c_buf_p) = '\0'; + *tao_yy_c_buf_p = '\0'; else { /* need more input */ - int offset = (tao_yy_c_buf_p) - (tao_yytext_ptr); - ++(tao_yy_c_buf_p); + int offset = tao_yy_c_buf_p - tao_yytext_ptr; + ++tao_yy_c_buf_p; - switch ( tao_yy_get_next_buffer( ) ) + switch ( tao_yy_get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because tao_yy_g_n_b() @@ -2200,16 +2123,16 @@ static int tao_yy_get_next_buffer (void) */ /* Reset buffer status. */ - tao_yyrestart(tao_yyin ); + tao_yyrestart( tao_yyin ); - /*FALLTHROUGH*/ + /* fall through */ case EOB_ACT_END_OF_FILE: { - if ( tao_yywrap( ) ) - return 0; + if ( tao_yywrap() ) + return EOF; - if ( ! (tao_yy_did_buffer_switch_on_eof) ) + if ( ! tao_yy_did_buffer_switch_on_eof ) TAO_YY_NEW_FILE; #ifdef __cplusplus return tao_yyinput(); @@ -2219,94 +2142,91 @@ static int tao_yy_get_next_buffer (void) } case EOB_ACT_CONTINUE_SCAN: - (tao_yy_c_buf_p) = (tao_yytext_ptr) + offset; + tao_yy_c_buf_p = tao_yytext_ptr + offset; break; } } } - c = *(unsigned char *) (tao_yy_c_buf_p); /* cast for 8-bit char's */ - *(tao_yy_c_buf_p) = '\0'; /* preserve tao_yytext */ - (tao_yy_hold_char) = *++(tao_yy_c_buf_p); + c = *(unsigned char *) tao_yy_c_buf_p; /* cast for 8-bit char's */ + *tao_yy_c_buf_p = '\0'; /* preserve tao_yytext */ + tao_yy_hold_char = *++tao_yy_c_buf_p; - TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_at_bol = (c == '\n'); + tao_yy_current_buffer->tao_yy_at_bol = (c == '\n'); return c; -} -#endif /* ifndef TAO_YY_NO_INPUT */ + } +#endif /* TAO_YY_NO_INPUT */ -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void tao_yyrestart (FILE * input_file ) -{ +#ifdef TAO_YY_USE_PROTOS +void tao_yyrestart( FILE *input_file ) +#else +void tao_yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! tao_yy_current_buffer ) + tao_yy_current_buffer = tao_yy_create_buffer( tao_yyin, TAO_YY_BUF_SIZE ); - if ( ! TAO_YY_CURRENT_BUFFER ){ - tao_yyensure_buffer_stack (); - TAO_YY_CURRENT_BUFFER_LVALUE = - tao_yy_create_buffer(tao_yyin,TAO_YY_BUF_SIZE ); + tao_yy_init_buffer( tao_yy_current_buffer, input_file ); + tao_yy_load_buffer_state(); } - tao_yy_init_buffer(TAO_YY_CURRENT_BUFFER,input_file ); - tao_yy_load_buffer_state( ); -} -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void tao_yy_switch_to_buffer (TAO_YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * tao_yypop_buffer_state(); - * tao_yypush_buffer_state(new_buffer); - */ - tao_yyensure_buffer_stack (); - if ( TAO_YY_CURRENT_BUFFER == new_buffer ) +#ifdef TAO_YY_USE_PROTOS +void tao_yy_switch_to_buffer( TAO_YY_BUFFER_STATE new_buffer ) +#else +void tao_yy_switch_to_buffer( new_buffer ) +TAO_YY_BUFFER_STATE new_buffer; +#endif + { + if ( tao_yy_current_buffer == new_buffer ) return; - if ( TAO_YY_CURRENT_BUFFER ) + if ( tao_yy_current_buffer ) { /* Flush out information for old buffer. */ - *(tao_yy_c_buf_p) = (tao_yy_hold_char); - TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_buf_pos = (tao_yy_c_buf_p); - TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_n_chars = (tao_yy_n_chars); + *tao_yy_c_buf_p = tao_yy_hold_char; + tao_yy_current_buffer->tao_yy_buf_pos = tao_yy_c_buf_p; + tao_yy_current_buffer->tao_yy_n_chars = tao_yy_n_chars; } - TAO_YY_CURRENT_BUFFER_LVALUE = new_buffer; - tao_yy_load_buffer_state( ); + tao_yy_current_buffer = new_buffer; + tao_yy_load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (tao_yywrap()) processing, but the only time this flag * is looked at is after tao_yywrap() is called, so it's safe * to go ahead and always set it. */ - (tao_yy_did_buffer_switch_on_eof) = 1; -} + tao_yy_did_buffer_switch_on_eof = 1; + } -static void tao_yy_load_buffer_state (void) -{ - (tao_yy_n_chars) = TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_n_chars; - (tao_yytext_ptr) = (tao_yy_c_buf_p) = TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_buf_pos; - tao_yyin = TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_input_file; - (tao_yy_hold_char) = *(tao_yy_c_buf_p); -} -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c TAO_YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - TAO_YY_BUFFER_STATE tao_yy_create_buffer (FILE * file, int size ) -{ +#ifdef TAO_YY_USE_PROTOS +void tao_yy_load_buffer_state( void ) +#else +void tao_yy_load_buffer_state() +#endif + { + tao_yy_n_chars = tao_yy_current_buffer->tao_yy_n_chars; + tao_yytext_ptr = tao_yy_c_buf_p = tao_yy_current_buffer->tao_yy_buf_pos; + tao_yyin = tao_yy_current_buffer->tao_yy_input_file; + tao_yy_hold_char = *tao_yy_c_buf_p; + } + + +#ifdef TAO_YY_USE_PROTOS +TAO_YY_BUFFER_STATE tao_yy_create_buffer( FILE *file, int size ) +#else +TAO_YY_BUFFER_STATE tao_yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { TAO_YY_BUFFER_STATE b; - b = (TAO_YY_BUFFER_STATE) tao_yyalloc(sizeof( struct tao_yy_buffer_state ) ); + b = (TAO_YY_BUFFER_STATE) tao_yy_flex_alloc( sizeof( struct tao_yy_buffer_state ) ); if ( ! b ) TAO_YY_FATAL_ERROR( "out of dynamic memory in tao_yy_create_buffer()" ); @@ -2315,71 +2235,75 @@ static void tao_yy_load_buffer_state (void) /* tao_yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->tao_yy_ch_buf = (char *) tao_yyalloc(b->tao_yy_buf_size + 2 ); + b->tao_yy_ch_buf = (char *) tao_yy_flex_alloc( b->tao_yy_buf_size + 2 ); if ( ! b->tao_yy_ch_buf ) TAO_YY_FATAL_ERROR( "out of dynamic memory in tao_yy_create_buffer()" ); b->tao_yy_is_our_buffer = 1; - tao_yy_init_buffer(b,file ); + tao_yy_init_buffer( b, file ); return b; -} + } -/** Destroy the buffer. - * @param b a buffer created with tao_yy_create_buffer() - * - */ - void tao_yy_delete_buffer (TAO_YY_BUFFER_STATE b ) -{ +#ifdef TAO_YY_USE_PROTOS +void tao_yy_delete_buffer( TAO_YY_BUFFER_STATE b ) +#else +void tao_yy_delete_buffer( b ) +TAO_YY_BUFFER_STATE b; +#endif + { if ( ! b ) return; - if ( b == TAO_YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - TAO_YY_CURRENT_BUFFER_LVALUE = (TAO_YY_BUFFER_STATE) 0; + if ( b == tao_yy_current_buffer ) + tao_yy_current_buffer = (TAO_YY_BUFFER_STATE) 0; if ( b->tao_yy_is_our_buffer ) - tao_yyfree((void *) b->tao_yy_ch_buf ); + tao_yy_flex_free( (void *) b->tao_yy_ch_buf ); - tao_yyfree((void *) b ); -} + tao_yy_flex_free( (void *) b ); + } -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a tao_yyrestart() or at EOF. - */ - static void tao_yy_init_buffer (TAO_YY_BUFFER_STATE b, FILE * file ) -{ - int oerrno = errno; - tao_yy_flush_buffer(b ); +#ifdef TAO_YY_USE_PROTOS +void tao_yy_init_buffer( TAO_YY_BUFFER_STATE b, FILE *file ) +#else +void tao_yy_init_buffer( b, file ) +TAO_YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + tao_yy_flush_buffer( b ); b->tao_yy_input_file = file; b->tao_yy_fill_buffer = 1; - /* If b is the current buffer, then tao_yy_init_buffer was _probably_ - * called from tao_yyrestart() or through tao_yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != TAO_YY_CURRENT_BUFFER){ - b->tao_yy_bs_lineno = 1; - b->tao_yy_bs_column = 0; - } - +#if TAO_YY_ALWAYS_INTERACTIVE + b->tao_yy_is_interactive = 1; +#else +#if TAO_YY_NEVER_INTERACTIVE b->tao_yy_is_interactive = 0; +#else + b->tao_yy_is_interactive = file ? (ACE_OS::isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } - errno = oerrno; -} -/** Discard all buffered characters. On the next scan, TAO_YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c TAO_YY_CURRENT_BUFFER. - * - */ - void tao_yy_flush_buffer (TAO_YY_BUFFER_STATE b ) -{ - if ( ! b ) +#ifdef TAO_YY_USE_PROTOS +void tao_yy_flush_buffer( TAO_YY_BUFFER_STATE b ) +#else +void tao_yy_flush_buffer( b ) +TAO_YY_BUFFER_STATE b; +#endif + + { + if ( ! b ) return; b->tao_yy_n_chars = 0; @@ -2396,112 +2320,20 @@ static void tao_yy_load_buffer_state (void) b->tao_yy_at_bol = 1; b->tao_yy_buffer_status = TAO_YY_BUFFER_NEW; - if ( b == TAO_YY_CURRENT_BUFFER ) - tao_yy_load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void tao_yypush_buffer_state (TAO_YY_BUFFER_STATE new_buffer ) -{ - if (new_buffer == 0) - return; - - tao_yyensure_buffer_stack(); - - /* This block is copied from tao_yy_switch_to_buffer. */ - if ( TAO_YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(tao_yy_c_buf_p) = (tao_yy_hold_char); - TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_buf_pos = (tao_yy_c_buf_p); - TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_n_chars = (tao_yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (TAO_YY_CURRENT_BUFFER) - (tao_yy_buffer_stack_top)++; - TAO_YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from tao_yy_switch_to_buffer. */ - tao_yy_load_buffer_state( ); - (tao_yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void tao_yypop_buffer_state (void) -{ - if (!TAO_YY_CURRENT_BUFFER) - return; - - tao_yy_delete_buffer(TAO_YY_CURRENT_BUFFER ); - TAO_YY_CURRENT_BUFFER_LVALUE = 0; - if ((tao_yy_buffer_stack_top) > 0) - --(tao_yy_buffer_stack_top); - - if (TAO_YY_CURRENT_BUFFER) { - tao_yy_load_buffer_state( ); - (tao_yy_did_buffer_switch_on_eof) = 1; + if ( b == tao_yy_current_buffer ) + tao_yy_load_buffer_state(); } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void tao_yyensure_buffer_stack (void) -{ - int num_to_alloc; - if (!(tao_yy_buffer_stack)) { - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; - (tao_yy_buffer_stack) = (struct tao_yy_buffer_state**)tao_yyalloc - (num_to_alloc * sizeof(struct tao_yy_buffer_state*) - ); - - memset((tao_yy_buffer_stack), 0, num_to_alloc * sizeof(struct tao_yy_buffer_state*)); - - (tao_yy_buffer_stack_max) = num_to_alloc; - (tao_yy_buffer_stack_top) = 0; - return; - } - - if ((tao_yy_buffer_stack_top) >= ((tao_yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (tao_yy_buffer_stack_max) + grow_size; - (tao_yy_buffer_stack) = (struct tao_yy_buffer_state**)tao_yyrealloc - ((tao_yy_buffer_stack), - num_to_alloc * sizeof(struct tao_yy_buffer_state*) - ); - - /* zero only the new slots.*/ - memset((tao_yy_buffer_stack) + (tao_yy_buffer_stack_max), 0, grow_size * sizeof(struct tao_yy_buffer_state*)); - (tao_yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -TAO_YY_BUFFER_STATE tao_yy_scan_buffer (char * base, tao_yy_size_t size ) -{ +#ifndef TAO_YY_NO_SCAN_BUFFER +#ifdef TAO_YY_USE_PROTOS +TAO_YY_BUFFER_STATE tao_yy_scan_buffer( char *base, tao_yy_size_t size ) +#else +TAO_YY_BUFFER_STATE tao_yy_scan_buffer( base, size ) +char *base; +tao_yy_size_t size; +#endif + { TAO_YY_BUFFER_STATE b; if ( size < 2 || @@ -2510,7 +2342,7 @@ TAO_YY_BUFFER_STATE tao_yy_scan_buffer (char * base, tao_yy_size_t size ) /* They forgot to leave room for the EOB's. */ return 0; - b = (TAO_YY_BUFFER_STATE) tao_yyalloc(sizeof( struct tao_yy_buffer_state ) ); + b = (TAO_YY_BUFFER_STATE) tao_yy_flex_alloc( sizeof( struct tao_yy_buffer_state ) ); if ( ! b ) TAO_YY_FATAL_ERROR( "out of dynamic memory in tao_yy_scan_buffer()" ); @@ -2524,51 +2356,56 @@ TAO_YY_BUFFER_STATE tao_yy_scan_buffer (char * base, tao_yy_size_t size ) b->tao_yy_fill_buffer = 0; b->tao_yy_buffer_status = TAO_YY_BUFFER_NEW; - tao_yy_switch_to_buffer(b ); + tao_yy_switch_to_buffer( b ); return b; -} + } +#endif -/** Setup the input buffer state to scan a string. The next call to tao_yylex() will - * scan from a @e copy of @a str. - * @param str a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * tao_yy_scan_bytes() instead. - */ -TAO_YY_BUFFER_STATE tao_yy_scan_string (tao_yyconst char * tao_yystr ) -{ - return tao_yy_scan_bytes(tao_yystr,strlen(tao_yystr) ); -} +#ifndef TAO_YY_NO_SCAN_STRING +#ifdef TAO_YY_USE_PROTOS +TAO_YY_BUFFER_STATE tao_yy_scan_string( tao_yyconst char *tao_yy_str ) +#else +TAO_YY_BUFFER_STATE tao_yy_scan_string( tao_yy_str ) +tao_yyconst char *tao_yy_str; +#endif + { + int len; + for ( len = 0; tao_yy_str[len]; ++len ) + ; -/** Setup the input buffer state to scan the given bytes. The next call to tao_yylex() will - * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -TAO_YY_BUFFER_STATE tao_yy_scan_bytes (tao_yyconst char * tao_yybytes, int _tao_yybytes_len ) -{ + return tao_yy_scan_bytes( tao_yy_str, len ); + } +#endif + + +#ifndef TAO_YY_NO_SCAN_BYTES +#ifdef TAO_YY_USE_PROTOS +TAO_YY_BUFFER_STATE tao_yy_scan_bytes( tao_yyconst char *bytes, int len ) +#else +TAO_YY_BUFFER_STATE tao_yy_scan_bytes( bytes, len ) +tao_yyconst char *bytes; +int len; +#endif + { TAO_YY_BUFFER_STATE b; char *buf; tao_yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = _tao_yybytes_len + 2; - buf = (char *) tao_yyalloc(n ); + n = len + 2; + buf = (char *) tao_yy_flex_alloc( n ); if ( ! buf ) TAO_YY_FATAL_ERROR( "out of dynamic memory in tao_yy_scan_bytes()" ); - for ( i = 0; i < _tao_yybytes_len; ++i ) - buf[i] = tao_yybytes[i]; + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; - buf[_tao_yybytes_len] = buf[_tao_yybytes_len+1] = TAO_YY_END_OF_BUFFER_CHAR; + buf[len] = buf[len+1] = TAO_YY_END_OF_BUFFER_CHAR; - b = tao_yy_scan_buffer(buf,n ); + b = tao_yy_scan_buffer( buf, n ); if ( ! b ) TAO_YY_FATAL_ERROR( "bad buffer in tao_yy_scan_bytes()" ); @@ -2578,196 +2415,148 @@ TAO_YY_BUFFER_STATE tao_yy_scan_bytes (tao_yyconst char * tao_yybytes, int _ta b->tao_yy_is_our_buffer = 1; return b; -} - -#ifndef TAO_YY_EXIT_FAILURE -#define TAO_YY_EXIT_FAILURE 2 + } #endif -static void tao_yy_fatal_error (tao_yyconst char* msg ) -{ - (void) fprintf( stderr, "%s\n", msg ); - exit( TAO_YY_EXIT_FAILURE ); -} - -/* Redefine tao_yyless() so it works in section 3 code. */ - -#undef tao_yyless -#define tao_yyless(n) \ - do \ - { \ - /* Undo effects of setting up tao_yytext. */ \ - int tao_yyless_macro_arg = (n); \ - TAO_YY_LESS_LINENO(tao_yyless_macro_arg);\ - tao_yytext[tao_yyleng] = (tao_yy_hold_char); \ - (tao_yy_c_buf_p) = tao_yytext + tao_yyless_macro_arg; \ - (tao_yy_hold_char) = *(tao_yy_c_buf_p); \ - *(tao_yy_c_buf_p) = '\0'; \ - tao_yyleng = tao_yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ -/** Get the current line number. - * - */ -int tao_yyget_lineno (void) -{ +#ifndef TAO_YY_NO_PUSH_STATE +#ifdef TAO_YY_USE_PROTOS +static void tao_yy_push_state( int new_state ) +#else +static void tao_yy_push_state( new_state ) +int new_state; +#endif + { + if ( tao_yy_start_stack_ptr >= tao_yy_start_stack_depth ) + { + tao_yy_size_t new_size; - return tao_yylineno; -} + tao_yy_start_stack_depth += TAO_YY_START_STACK_INCR; + new_size = tao_yy_start_stack_depth * sizeof( int ); -/** Get the input stream. - * - */ -FILE *tao_yyget_in (void) -{ - return tao_yyin; -} + if ( ! tao_yy_start_stack ) + tao_yy_start_stack = (int *) tao_yy_flex_alloc( new_size ); -/** Get the output stream. - * - */ -FILE *tao_yyget_out (void) -{ - return tao_yyout; -} + else + tao_yy_start_stack = (int *) tao_yy_flex_realloc( + (void *) tao_yy_start_stack, new_size ); -/** Get the length of the current token. - * - */ -int tao_yyget_leng (void) -{ - return tao_yyleng; -} + if ( ! tao_yy_start_stack ) + TAO_YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } -/** Get the current token. - * - */ + tao_yy_start_stack[tao_yy_start_stack_ptr++] = TAO_YY_START; -char *tao_yyget_text (void) -{ - return tao_yytext; -} + BEGIN(new_state); + } +#endif -/** Set the current line number. - * @param line_number - * - */ -void tao_yyset_lineno (int line_number ) -{ - tao_yylineno = line_number; -} +#ifndef TAO_YY_NO_POP_STATE +static void tao_yy_pop_state() + { + if ( --tao_yy_start_stack_ptr < 0 ) + TAO_YY_FATAL_ERROR( "start-condition stack underflow" ); -/** Set the input stream. This does not discard the current - * input buffer. - * @param in_str A readable stream. - * - * @see tao_yy_switch_to_buffer - */ -void tao_yyset_in (FILE * in_str ) -{ - tao_yyin = in_str ; -} + BEGIN(tao_yy_start_stack[tao_yy_start_stack_ptr]); + } +#endif -void tao_yyset_out (FILE * out_str ) -{ - tao_yyout = out_str ; -} -int tao_yyget_debug (void) -{ - return tao_yy_flex_debug; -} +#ifndef TAO_YY_NO_TOP_STATE +static int tao_yy_top_state() + { + return tao_yy_start_stack[tao_yy_start_stack_ptr - 1]; + } +#endif -void tao_yyset_debug (int bdebug ) -{ - tao_yy_flex_debug = bdebug ; -} +#ifndef TAO_YY_EXIT_FAILURE +#define TAO_YY_EXIT_FAILURE 2 +#endif -static int tao_yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from tao_yylex_destroy(), so don't allocate here. - */ - - (tao_yy_buffer_stack) = 0; - (tao_yy_buffer_stack_top) = 0; - (tao_yy_buffer_stack_max) = 0; - (tao_yy_c_buf_p) = (char *) 0; - (tao_yy_init) = 0; - (tao_yy_start) = 0; - -/* Defined in main.c */ -#ifdef TAO_YY_STDINIT - tao_yyin = stdin; - tao_yyout = stdout; +#ifdef TAO_YY_USE_PROTOS +static void tao_yy_fatal_error( tao_yyconst char msg[] ) #else - tao_yyin = (FILE *) 0; - tao_yyout = (FILE *) 0; +static void tao_yy_fatal_error( msg ) +char msg[]; #endif + { + (void) ACE_OS::fprintf( stderr, "%s\n", msg ); + ACE_OS::exit( TAO_YY_EXIT_FAILURE ); + } - /* For future reference: Set errno on error, since we are called by - * tao_yylex_init() - */ - return 0; -} - -/* tao_yylex_destroy is for both reentrant and non-reentrant scanners. */ -int tao_yylex_destroy (void) -{ - /* Pop the buffer stack, destroying each element. */ - while(TAO_YY_CURRENT_BUFFER){ - tao_yy_delete_buffer(TAO_YY_CURRENT_BUFFER ); - TAO_YY_CURRENT_BUFFER_LVALUE = 0; - tao_yypop_buffer_state(); - } - /* Destroy the stack itself. */ - tao_yyfree((tao_yy_buffer_stack) ); - (tao_yy_buffer_stack) = 0; +/* Redefine tao_yyless() so it works in section 3 code. */ - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * tao_yylex() is called, initialization will occur. */ - tao_yy_init_globals( ); +#undef tao_yyless +#define tao_yyless(n) \ + do \ + { \ + /* Undo effects of setting up tao_yytext. */ \ + tao_yytext[tao_yyleng] = tao_yy_hold_char; \ + tao_yy_c_buf_p = tao_yytext + n; \ + tao_yy_hold_char = *tao_yy_c_buf_p; \ + *tao_yy_c_buf_p = '\0'; \ + tao_yyleng = n; \ + } \ + while ( 0 ) - return 0; -} -/* - * Internal utility routines. - */ +/* Internal utility routines. */ #ifndef tao_yytext_ptr -static void tao_yy_flex_strncpy (char* s1, tao_yyconst char * s2, int n ) -{ +#ifdef TAO_YY_USE_PROTOS +static void tao_yy_flex_strncpy( char *s1, tao_yyconst char *s2, int n ) +#else +static void tao_yy_flex_strncpy( s1, s2, n ) +char *s1; +tao_yyconst char *s2; +int n; +#endif + { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; -} + } #endif #ifdef TAO_YY_NEED_STRLEN -static int tao_yy_flex_strlen (tao_yyconst char * s ) -{ +#ifdef TAO_YY_USE_PROTOS +static int tao_yy_flex_strlen( tao_yyconst char *s ) +#else +static int tao_yy_flex_strlen( s ) +tao_yyconst char *s; +#endif + { register int n; for ( n = 0; s[n]; ++n ) ; return n; -} + } #endif -void *tao_yyalloc (tao_yy_size_t size ) -{ - return (void *) malloc( size ); -} -void *tao_yyrealloc (void * ptr, tao_yy_size_t size ) -{ +#ifdef TAO_YY_USE_PROTOS +static void *tao_yy_flex_alloc( tao_yy_size_t size ) +#else +static void *tao_yy_flex_alloc( size ) +tao_yy_size_t size; +#endif + { + return (void *) ACE_OS::malloc( size ); + } + +#ifdef TAO_YY_USE_PROTOS +static void *tao_yy_flex_realloc( void *ptr, tao_yy_size_t size ) +#else +static void *tao_yy_flex_realloc( ptr, size ) +void *ptr; +tao_yy_size_t size; +#endif + { /* 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 @@ -2775,15 +2564,26 @@ void *tao_yyrealloc (void * ptr, tao_yy_size_t size ) * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); -} + return (void *) ACE_OS::realloc( (char *) ptr, size ); + } -void tao_yyfree (void * ptr ) -{ - free( (char *) ptr ); /* see tao_yyrealloc() for (char *) cast */ -} +#ifdef TAO_YY_USE_PROTOS +static void tao_yy_flex_free( void *ptr ) +#else +static void tao_yy_flex_free( ptr ) +void *ptr; +#endif + { + ACE_OS::free( ptr ); + } -#define TAO_YYTABLES_NAME "tao_yytables" +#if TAO_YY_MAIN +int main() + { + tao_yylex(); + return 0; + } +#endif /* subroutines */ @@ -2814,14 +2614,14 @@ idl_parse_line_and_file (char *buf) } // Find line number. - while (isspace (*r)) + while (ACE_OS::ace_isspace (*r)) { r++; } h = r; - for (; isdigit (*r); r++) + for (; ACE_OS::ace_isdigit (*r); r++) { continue; } @@ -3157,9 +2957,9 @@ idl_store_pragma (char *buf) // split up data type and key strings char *sample_type = tmp; - while (*tmp && !isspace (*tmp)) + while (*tmp && !ACE_OS::ace_isspace (*tmp)) tmp++; - while (isspace (*tmp)) + while (ACE_OS::ace_isspace (*tmp)) { *tmp = '\0'; tmp++; @@ -3395,7 +3195,7 @@ idl_escape_reader( int i; // hex value - for (i = 2; str[i] != '\0' && isxdigit (str[i]); ++i) + for (i = 2; str[i] != '\0' && ACE_OS::ace_isxdigit (str[i]); ++i) { continue; } @@ -3444,7 +3244,7 @@ idl_wchar_escape_reader (char *str) int i; // get the hex digits - for (i = 2; str[i] != '\0' && isxdigit (str[i]); i++) + for (i = 2; str[i] != '\0' && ACE_OS::ace_isxdigit (str[i]); i++) { continue; } @@ -3523,7 +3323,7 @@ idl_valid_version (char *s) for (i = 0; tmp[i] != '\0'; ++i) { - if (!isdigit (tmp[i])) + if (!ACE_OS::ace_isdigit (tmp[i])) { return 0; } @@ -3533,7 +3333,7 @@ idl_valid_version (char *s) for (i = 0; i < len; ++i) { - if (!isdigit (s[i])) + if (!ACE_OS::ace_isdigit (s[i])) { return 0; } @@ -3571,4 +3371,3 @@ idl_find_node (char *s) return d; } - |