From 1498c7edb2109cf1c3bc5d49f005480fc6678b68 Mon Sep 17 00:00:00 2001 From: parsons Date: Wed, 16 Nov 2005 22:10:20 +0000 Subject: ChangeLogTag: Wed Nov 16 21:53:08 UTC 2005 Jeff Parsons --- TAO/ChangeLog | 16 +- TAO/TAO_IDL/fe/lex.yy.cpp | 1316 +++++++++++++++++++++++----------------- TAO/TAO_IDL/fe/lex.yy.cpp.diff | 69 +-- 3 files changed, 785 insertions(+), 616 deletions(-) diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 1b50d69fedc..ba8297385b9 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,17 @@ +Wed Nov 16 21:53:08 UTC 2005 Jeff Parsons + + * TAO_IDL/fe/lex.yy.cpp: + * TAO_IDL/fe/lex.yy.cpp.diff: + + Since the change of + + Wed Nov 16 11:23:15 2005 Jeff Parsons + + checked in a version of lex.yy.cpp that had been generated + elsewhere, regenerated this file with the version of flex + that's on tango.dre.vanderbilt.edu, and updated the + corresponding diff file. + Wed Nov 16 14:12:08 USMST 2005 Yan Dai * tests/CSD_Strategy_Tests/TP_Foo_B/Foo_B.idl: @@ -19,7 +33,7 @@ Wed Nov 16 11:23:15 2005 Jeff Parsons Applied patches submitted by Thomas Lockhart to enable the IDL compiler's lexer to handle extra numeric fields produced by the gcc - 4.0.1 perprocessor. + 4.0.1 preprocessor. Closes [BUGID:2294]. Wed Nov 16 09:14:21 2005 Ossama Othman diff --git a/TAO/TAO_IDL/fe/lex.yy.cpp b/TAO/TAO_IDL/fe/lex.yy.cpp index 3d7d81fec6e..3eced1f1902 100644 --- a/TAO/TAO_IDL/fe/lex.yy.cpp +++ b/TAO/TAO_IDL/fe/lex.yy.cpp @@ -1,31 +1,81 @@ -/* A lexical scanner generated by flex */ -/* Scanner skeleton version: - * $Id$ - */ +#line 3 "" + +#define TAO_YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ #define FLEX_SCANNER #define TAO_YY_FLEX_MAJOR_VERSION 2 #define TAO_YY_FLEX_MINOR_VERSION 5 +#define TAO_YY_FLEX_SUBMINOR_VERSION 31 +#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_include/os_ctype.h" +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L +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 */ -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus +/* 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 @@ -33,32 +83,17 @@ #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 @@ -73,71 +108,71 @@ * 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 +#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 -/* 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. */ + #define TAO_YY_LESS_LINENO(n) +/* 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. */ \ - *tao_yy_cp = tao_yy_hold_char; \ + int tao_yyless_macro_arg = (n); \ + TAO_YY_LESS_LINENO(tao_yyless_macro_arg);\ + *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 + n - TAO_YY_MORE_ADJ; \ + (tao_yy_c_buf_p) = tao_yy_cp = tao_yy_bp + tao_yyless_macro_arg - 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). */ -typedef unsigned int tao_yy_size_t; +#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; @@ -174,12 +209,16 @@ 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 @@ -193,23 +232,33 @@ 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 */ -static TAO_YY_BUFFER_STATE tao_yy_current_buffer = 0; +/* 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. */ /* 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_current_buffer +#define TAO_YY_CURRENT_BUFFER ( (tao_yy_buffer_stack) \ + ? (tao_yy_buffer_stack)[(tao_yy_buffer_stack_top)] \ + : 0) +/* 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. */ @@ -222,69 +271,94 @@ static int tao_yy_start = 0; /* start state number */ */ static int tao_yy_did_buffer_switch_on_eof; -void tao_yyrestart TAO_YY_PROTO(( FILE *input_file )); +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 ); -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 ) +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 ); -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 )); +#define TAO_YY_FLUSH_BUFFER tao_yy_flush_buffer(TAO_YY_CURRENT_BUFFER ) -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 * )); +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 ); + +void *tao_yyalloc (tao_yy_size_t ); +void *tao_yyrealloc (void *,tao_yy_size_t ); +void tao_yyfree (void * ); #define tao_yy_new_buffer tao_yy_create_buffer #define tao_yy_set_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; \ + 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; \ } #define tao_yy_set_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; \ + 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; \ } -#define TAO_YY_AT_BOL() (tao_yy_current_buffer->tao_yy_at_bol) +#define TAO_YY_AT_BOL() (TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_at_bol) + +/* Begin user sect3 */ typedef unsigned char TAO_YY_CHAR; + FILE *tao_yyin = (FILE *) 0, *tao_yyout = (FILE *) 0; + typedef int tao_yy_state_type; -extern char tao_yytext[]; +extern int tao_yylineno; -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[] )); +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[] ); /* 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 = (int) (tao_yy_cp - tao_yy_bp); \ - tao_yy_hold_char = *tao_yy_cp; \ + (tao_yytext_ptr) = tao_yy_bp; \ + tao_yyleng = (size_t) (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 -static tao_yyconst short int tao_yy_accept[558] = +/* 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[558] = { 0, 101, 101, 105, 103, 101, 102, 102, 103, 103, 103, 103, 103, 76, 72, 103, 103, 103, 68, 68, 68, @@ -349,7 +423,7 @@ static tao_yyconst short int tao_yy_accept[558] = 0, 40, 94, 0, 86, 86, 0 } ; -static tao_yyconst int tao_yy_ec[256] = +static tao_yyconst flex_int32_t 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, @@ -381,7 +455,7 @@ static tao_yyconst int tao_yy_ec[256] = 1, 1, 1, 1, 1 } ; -static tao_yyconst int tao_yy_meta[60] = +static tao_yyconst flex_int32_t 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, @@ -391,7 +465,7 @@ static tao_yyconst int tao_yy_meta[60] = 7, 8, 7, 8, 9, 8, 7, 8, 7 } ; -static tao_yyconst short int tao_yy_base[586] = +static tao_yyconst flex_int16_t tao_yy_base[586] = { 0, 0, 58, 1094, 1095, 59, 1095, 1095, 56, 1059, 54, 57, 65, 68, 73, 1075, 1073, 1070, 0, 1067, 69, @@ -459,7 +533,7 @@ static tao_yyconst short int tao_yy_base[586] = 803, 812, 821, 830, 839 } ; -static tao_yyconst short int tao_yy_def[586] = +static tao_yyconst flex_int16_t tao_yy_def[586] = { 0, 557, 1, 557, 557, 557, 557, 557, 558, 559, 557, 557, 557, 557, 557, 557, 557, 557, 560, 560, 560, @@ -527,7 +601,7 @@ static tao_yyconst short int tao_yy_def[586] = 557, 557, 557, 557, 557 } ; -static tao_yyconst short int tao_yy_nxt[1155] = +static tao_yyconst flex_int16_t tao_yy_nxt[1155] = { 0, 4, 5, 6, 7, 5, 8, 4, 9, 4, 4, 10, 11, 12, 13, 14, 14, 15, 16, 4, 17, @@ -658,7 +732,7 @@ static tao_yyconst short int tao_yy_nxt[1155] = 557, 557, 557, 557 } ; -static tao_yyconst short int tao_yy_chk[1155] = +static tao_yyconst flex_int16_t tao_yy_chk[1155] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -792,6 +866,9 @@ static tao_yyconst short int tao_yy_chk[1155] = 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. */ @@ -805,8 +882,7 @@ static char *tao_yy_last_accepting_cpos; char tao_yytext[TAO_YYLMAX]; char *tao_yytext_ptr; -#define INITIAL 0 -/* idl.ll,v 1.98 2005/07/07 19:55:08 gmaxey Exp +/* $Id: idl.ll,v 1.99 2005/11/16 17:33:12 parsons Exp $ COPYRIGHT @@ -908,7 +984,20 @@ static AST_Decl * idl_find_node (char *); #define ace_tao_yytext tao_yytext /* SO we don't choke on files that use \r\n */ -#define TAO_YY_NEVER_INTERACTIVE 1 + +#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 /* Macros after this point can all be overridden by user definitions in * section 1. @@ -916,64 +1005,30 @@ static AST_Decl * idl_find_node (char *); #ifndef TAO_YY_SKIP_TAO_YYWRAP #ifdef __cplusplus -extern "C" int tao_yywrap TAO_YY_PROTO(( void )); +extern "C" int tao_yywrap (void ); #else -extern int tao_yywrap TAO_YY_PROTO(( void )); +extern int tao_yywrap (void ); #endif #endif -#ifndef TAO_YY_NO_UNPUT -static void tao_yyunput TAO_YY_PROTO(( int c, char *buf_ptr )); -#endif + static void tao_yyunput (int c,char *buf_ptr ); #ifndef tao_yytext_ptr -static void tao_yy_flex_strncpy TAO_YY_PROTO(( char *, tao_yyconst char *, int )); +static void tao_yy_flex_strncpy (char *,tao_yyconst char *,int ); #endif #ifdef TAO_YY_NEED_STRLEN -static int tao_yy_flex_strlen TAO_YY_PROTO(( tao_yyconst char * )); +static int tao_yy_flex_strlen (tao_yyconst char * ); #endif #ifndef TAO_YY_NO_INPUT -#ifdef __cplusplus -static int tao_yyinput TAO_YY_PROTO(( void )); -#else -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 +#ifdef __cplusplus +static int tao_yyinput (void ); #else -#define TAO_YY_NO_PUSH_STATE 1 -#define TAO_YY_NO_POP_STATE 1 -#define TAO_YY_NO_TOP_STATE 1 +static int input (void ); #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. */ @@ -982,7 +1037,6 @@ TAO_YY_MALLOC_DECL #endif /* Copy whatever the last rule matched to the standard output. */ - #ifndef TAO_YY_ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). @@ -995,9 +1049,10 @@ TAO_YY_MALLOC_DECL */ #ifndef TAO_YY_INPUT #define TAO_YY_INPUT(buf,result,max_size) \ - if ( tao_yy_current_buffer->tao_yy_is_interactive ) \ + if ( TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_is_interactive ) \ { \ - int c = '*', n; \ + int c = '*'; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( tao_yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1007,9 +1062,22 @@ TAO_YY_MALLOC_DECL TAO_YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ - else if ( ((result = static_cast (fread( buf, 1, max_size, tao_yyin ))) == 0) \ - && ferror( tao_yyin ) ) \ - TAO_YY_FATAL_ERROR( "input in flex scanner failed" ); + else \ + { \ + errno=0; \ + while ( (result = static_cast (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); \ + } \ + }\ +\ + #endif /* No semi-colon after return; correct usage is to write "tao_yyterminate();" - @@ -1030,12 +1098,18 @@ TAO_YY_MALLOC_DECL #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 int tao_yylex TAO_YY_PROTO(( void )) -#endif +#define TAO_YY_DECL_IS_OURS 1 + +extern int tao_yylex (void); + +#define TAO_YY_DECL int tao_yylex (void) +#endif /* !TAO_YY_DECL */ /* Code executed at the beginning of each rule, after tao_yytext and tao_yyleng * have been set up. @@ -1051,29 +1125,28 @@ TAO_YY_MALLOC_DECL #define TAO_YY_RULE_SETUP \ if ( tao_yyleng > 0 ) \ - tao_yy_current_buffer->tao_yy_at_bol = \ + TAO_YY_CURRENT_BUFFER_LVALUE->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 = 0, *tao_yy_bp = 0; register int tao_yy_act; - - - - if ( tao_yy_init ) + if ( (tao_yy_init) ) { - tao_yy_init = 0; + (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; @@ -1081,26 +1154,28 @@ TAO_YY_DECL if ( ! tao_yyout ) tao_yyout = stdout; - 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_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 @@ -1108,8 +1183,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 ) { @@ -1120,30 +1195,24 @@ 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_base[tao_yy_current_state] != 1095 ); + while ( tao_yy_current_state != 557 ); + tao_yy_cp = (tao_yy_last_accepting_cpos); + tao_yy_current_state = (tao_yy_last_accepting_state); 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: @@ -1509,6 +1578,7 @@ TAO_YY_RULE_SETUP } TAO_YY_BREAK case 77: +/* rule 77 can match eol */ TAO_YY_RULE_SETUP { /* Skip the quotes */ @@ -1529,6 +1599,7 @@ TAO_YY_RULE_SETUP } TAO_YY_BREAK case 78: +/* rule 78 can match eol */ TAO_YY_RULE_SETUP { /* Skip the bookends */ @@ -1585,7 +1656,9 @@ 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); @@ -1593,55 +1666,68 @@ 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; + TAO_YY_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; + TAO_YY_BREAK case 99: +/* rule 99 can match eol */ TAO_YY_RULE_SETUP { /* ignore comments */ idl_global->set_lineno(idl_global->lineno() + 1); } - break; + TAO_YY_BREAK case 100: TAO_YY_RULE_SETUP { @@ -1658,17 +1744,18 @@ TAO_YY_RULE_SETUP } } } - break; + TAO_YY_BREAK case 101: TAO_YY_RULE_SETUP ; - break; + TAO_YY_BREAK case 102: +/* rule 102 can match eol */ TAO_YY_RULE_SETUP { idl_global->set_lineno(idl_global->lineno() + 1); } - break; + TAO_YY_BREAK case 103: TAO_YY_RULE_SETUP return ace_tao_yytext [0]; @@ -1676,33 +1763,33 @@ return ace_tao_yytext [0]; case 104: TAO_YY_RULE_SETUP TAO_YY_ECHO; - break; + TAO_YY_BREAK case TAO_YY_STATE_EOF(INITIAL): tao_yyterminate(); 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->tao_yy_buffer_status == TAO_YY_BUFFER_NEW ) + if ( TAO_YY_CURRENT_BUFFER_LVALUE->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->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; + (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; } /* Note that here we test for tao_yy_c_buf_p "<=" to the position @@ -1712,13 +1799,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->tao_yy_ch_buf[tao_yy_n_chars] ) + if ( (tao_yy_c_buf_p) <= &TAO_YY_CURRENT_BUFFER_LVALUE->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 @@ -1731,30 +1818,31 @@ 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_c_buf_p; + tao_yy_cp = (tao_yy_last_accepting_cpos); + tao_yy_current_state = (tao_yy_last_accepting_state); 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 @@ -1765,7 +1853,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; @@ -1773,30 +1861,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->tao_yy_ch_buf[tao_yy_n_chars]; + (tao_yy_c_buf_p) = + &TAO_YY_CURRENT_BUFFER_LVALUE->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; @@ -1807,8 +1895,7 @@ 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 * @@ -1817,21 +1904,20 @@ 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() - { - register char *dest = tao_yy_current_buffer->tao_yy_ch_buf; - register char *source = tao_yytext_ptr; +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); register int number_to_move, i; int ret_val; - if ( tao_yy_c_buf_p > &tao_yy_current_buffer->tao_yy_ch_buf[tao_yy_n_chars + 1] ) + if ( (tao_yy_c_buf_p) > &TAO_YY_CURRENT_BUFFER_LVALUE->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->tao_yy_fill_buffer == 0 ) + if ( TAO_YY_CURRENT_BUFFER_LVALUE->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. @@ -1851,34 +1937,30 @@ static int tao_yy_get_next_buffer() /* 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->tao_yy_buffer_status == TAO_YY_BUFFER_EOF_PENDING ) + if ( TAO_YY_CURRENT_BUFFER_LVALUE->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->tao_yy_n_chars = tao_yy_n_chars = 0; + TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_n_chars = (tao_yy_n_chars) = 0; else { - int num_to_read = - tao_yy_current_buffer->tao_yy_buf_size - number_to_move - 1; + size_t num_to_read = + TAO_YY_CURRENT_BUFFER_LVALUE->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 ) { @@ -1891,8 +1973,7 @@ static int tao_yy_get_next_buffer() b->tao_yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - tao_yy_flex_realloc( (void *) b->tao_yy_ch_buf, - b->tao_yy_buf_size + 2 ); + tao_yyrealloc((void *) b->tao_yy_ch_buf,b->tao_yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ @@ -1902,35 +1983,35 @@ static int tao_yy_get_next_buffer() 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->tao_yy_buf_size - + num_to_read = TAO_YY_CURRENT_BUFFER_LVALUE->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->tao_yy_ch_buf[number_to_move]), - tao_yy_n_chars, num_to_read ); + TAO_YY_INPUT( (&TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_ch_buf[number_to_move]), + (tao_yy_n_chars), num_to_read ); - tao_yy_current_buffer->tao_yy_n_chars = tao_yy_n_chars; + TAO_YY_CURRENT_BUFFER_LVALUE->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->tao_yy_buffer_status = + TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_buffer_status = TAO_YY_BUFFER_EOF_PENDING; } } @@ -1938,33 +2019,32 @@ static int tao_yy_get_next_buffer() else ret_val = EOB_ACT_CONTINUE_SCAN; - 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_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_yytext_ptr = &tao_yy_current_buffer->tao_yy_ch_buf[0]; + (tao_yytext_ptr) = &TAO_YY_CURRENT_BUFFER_LVALUE->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() - { + static tao_yy_state_type tao_yy_get_previous_state (void) +{ 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 ) { @@ -1976,30 +2056,23 @@ static tao_yy_state_type tao_yy_get_previous_state() } 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 ); */ - -#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 - { + static tao_yy_state_type tao_yy_try_NUL_trans (tao_yy_state_type tao_yy_current_state ) +{ 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 ) { @@ -2011,81 +2084,73 @@ tao_yy_state_type tao_yy_current_state; tao_yy_is_jam = (tao_yy_current_state == 557); 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; -#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; + 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->tao_yy_ch_buf + 2 ) + if ( tao_yy_cp < TAO_YY_CURRENT_BUFFER_LVALUE->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->tao_yy_ch_buf[ - tao_yy_current_buffer->tao_yy_buf_size + 2]; + 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 char *source = - &tao_yy_current_buffer->tao_yy_ch_buf[number_to_move]; + &TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_ch_buf[number_to_move]; - while ( source > tao_yy_current_buffer->tao_yy_ch_buf ) + while ( source > TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_ch_buf ) *--dest = *--source; tao_yy_cp += (int) (dest - source); tao_yy_bp += (int) (dest - source); - tao_yy_current_buffer->tao_yy_n_chars = - tao_yy_n_chars = tao_yy_current_buffer->tao_yy_buf_size; + TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_n_chars = + (tao_yy_n_chars) = TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_buf_size; - if ( tao_yy_cp < tao_yy_current_buffer->tao_yy_ch_buf + 2 ) + if ( tao_yy_cp < TAO_YY_CURRENT_BUFFER_LVALUE->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; - } -#endif /* ifndef TAO_YY_NO_UNPUT */ - + (tao_yytext_ptr) = tao_yy_bp; + (tao_yy_hold_char) = *tao_yy_cp; + (tao_yy_c_buf_p) = tao_yy_cp; +} #ifndef TAO_YY_NO_INPUT #ifdef __cplusplus -static int tao_yyinput() + static int tao_yyinput (void) #else -static int input() + static int input (void) #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->tao_yy_ch_buf[tao_yy_n_chars] ) + if ( (tao_yy_c_buf_p) < &TAO_YY_CURRENT_BUFFER_LVALUE->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() @@ -2099,16 +2164,16 @@ static int input() */ /* Reset buffer status. */ - tao_yyrestart( tao_yyin ); + tao_yyrestart(tao_yyin ); - /* fall through */ + /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( tao_yywrap() ) + 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(); @@ -2118,91 +2183,94 @@ static int input() } 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->tao_yy_at_bol = (c == '\n'); + TAO_YY_CURRENT_BUFFER_LVALUE->tao_yy_at_bol = (c == '\n'); return c; - } -#endif /* TAO_YY_NO_INPUT */ +} +#endif /* ifndef TAO_YY_NO_INPUT */ -#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 ); +/** 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 ) +{ - tao_yy_init_buffer( tao_yy_current_buffer, input_file ); - tao_yy_load_buffer_state(); + 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( ); +} -#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 ) +/** 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 ) 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->tao_yy_buf_pos = tao_yy_c_buf_p; - tao_yy_current_buffer->tao_yy_n_chars = tao_yy_n_chars; + *(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_current_buffer = new_buffer; - tao_yy_load_buffer_state(); + TAO_YY_CURRENT_BUFFER_LVALUE = 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; - } - - -#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; - } + (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); +} -#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 - { +/** 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 ) +{ TAO_YY_BUFFER_STATE b; - b = (TAO_YY_BUFFER_STATE) tao_yy_flex_alloc( sizeof( struct tao_yy_buffer_state ) ); + b = (TAO_YY_BUFFER_STATE) tao_yyalloc(sizeof( struct tao_yy_buffer_state ) ); if ( ! b ) TAO_YY_FATAL_ERROR( "out of dynamic memory in tao_yy_create_buffer()" ); @@ -2211,75 +2279,71 @@ int size; /* 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_yy_flex_alloc( b->tao_yy_buf_size + 2 ); + b->tao_yy_ch_buf = (char *) tao_yyalloc(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 ) - tao_yy_current_buffer = (TAO_YY_BUFFER_STATE) 0; + 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_is_our_buffer ) - tao_yy_flex_free( (void *) b->tao_yy_ch_buf ); - - tao_yy_flex_free( (void *) b ); - } - + tao_yyfree((void *) b->tao_yy_ch_buf ); + tao_yyfree((void *) 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 +/* 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 ); + tao_yy_flush_buffer(b ); b->tao_yy_input_file = file; b->tao_yy_fill_buffer = 1; -#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 ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } + /* 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; + } + b->tao_yy_is_interactive = 0; -#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 + errno = oerrno; +} - { - if ( ! b ) +/** 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 ) return; b->tao_yy_n_chars = 0; @@ -2296,20 +2360,112 @@ TAO_YY_BUFFER_STATE b; 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(); + 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; } +} +/* 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; -#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 - { + 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 ) +{ TAO_YY_BUFFER_STATE b; if ( size < 2 || @@ -2318,7 +2474,7 @@ tao_yy_size_t size; /* They forgot to leave room for the EOB's. */ return 0; - b = (TAO_YY_BUFFER_STATE) tao_yy_flex_alloc( sizeof( struct tao_yy_buffer_state ) ); + b = (TAO_YY_BUFFER_STATE) tao_yyalloc(sizeof( struct tao_yy_buffer_state ) ); if ( ! b ) TAO_YY_FATAL_ERROR( "out of dynamic memory in tao_yy_scan_buffer()" ); @@ -2332,39 +2488,34 @@ 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 - - -#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 ) - ; +} - return tao_yy_scan_bytes( tao_yy_str, len ); - } -#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_yy_str ) +{ + return tao_yy_scan_bytes(tao_yy_str,strlen(tao_yy_str) ); +} -#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 - { +/** 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 * bytes, int len ) +{ TAO_YY_BUFFER_STATE b; char *buf; tao_yy_size_t n; @@ -2372,7 +2523,7 @@ int len; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; - buf = (char *) tao_yy_flex_alloc( n ); + buf = (char *) tao_yyalloc(n ); if ( ! buf ) TAO_YY_FATAL_ERROR( "out of dynamic memory in tao_yy_scan_bytes()" ); @@ -2381,7 +2532,7 @@ int len; 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()" ); @@ -2391,148 +2542,164 @@ int len; 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 ); +} -#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; +/* Redefine tao_yyless() so it works in section 3 code. */ - tao_yy_start_stack_depth += TAO_YY_START_STACK_INCR; - new_size = tao_yy_start_stack_depth * sizeof( int ); +#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 ) - if ( ! tao_yy_start_stack ) - tao_yy_start_stack = (int *) tao_yy_flex_alloc( new_size ); +/* Accessor methods (get/set functions) to struct members. */ - else - tao_yy_start_stack = (int *) tao_yy_flex_realloc( - (void *) tao_yy_start_stack, new_size ); +/** Get the current line number. + * + */ +int tao_yyget_lineno (void) +{ - if ( ! tao_yy_start_stack ) - TAO_YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } + return tao_yylineno; +} - tao_yy_start_stack[tao_yy_start_stack_ptr++] = TAO_YY_START; +/** Get the input stream. + * + */ +FILE *tao_yyget_in (void) +{ + return tao_yyin; +} - BEGIN(new_state); - } -#endif +/** Get the output stream. + * + */ +FILE *tao_yyget_out (void) +{ + return tao_yyout; +} +/** Get the length of the current token. + * + */ +int tao_yyget_leng (void) +{ + return tao_yyleng; +} -#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" ); +/** Get the current token. + * + */ - BEGIN(tao_yy_start_stack[tao_yy_start_stack_ptr]); - } -#endif +char *tao_yyget_text (void) +{ + return tao_yytext; +} +/** Set the current line number. + * @param line_number + * + */ +void tao_yyset_lineno (int line_number ) +{ -#ifndef TAO_YY_NO_TOP_STATE -static int tao_yy_top_state() - { - return tao_yy_start_stack[tao_yy_start_stack_ptr - 1]; - } -#endif + tao_yylineno = line_number; +} -#ifndef TAO_YY_EXIT_FAILURE -#define TAO_YY_EXIT_FAILURE 2 -#endif +/** 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 ; +} -#ifdef TAO_YY_USE_PROTOS -static void tao_yy_fatal_error( tao_yyconst char msg[] ) -#else -static void tao_yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( TAO_YY_EXIT_FAILURE ); - } +void tao_yyset_out (FILE * out_str ) +{ + tao_yyout = out_str ; +} +int tao_yyget_debug (void) +{ + return tao_yy_flex_debug; +} +void tao_yyset_debug (int bdebug ) +{ + tao_yy_flex_debug = bdebug ; +} -/* Redefine tao_yyless() so it works in section 3 code. */ +/* tao_yylex_destroy is for both reentrant and non-reentrant scanners. */ +int tao_yylex_destroy (void) +{ -#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 ) + /* 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; + return 0; +} -/* Internal utility routines. */ +/* + * Internal utility routines. + */ #ifndef tao_yytext_ptr -#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 - { +static void tao_yy_flex_strncpy (char* s1, tao_yyconst char * s2, int n ) +{ register int i; - for ( i = 0; i < n; ++i ) + for ( i = 0; i < n; ++i ) s1[i] = s2[i]; - } +} #endif #ifdef TAO_YY_NEED_STRLEN -#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 - { +static int tao_yy_flex_strlen (tao_yyconst char * s ) +{ register int n; - for ( n = 0; s[n]; ++n ) + for ( n = 0; s[n]; ++n ) ; return n; - } +} #endif - -#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 - { +void *tao_yyalloc (tao_yy_size_t size ) +{ return (void *) 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 - { +void *tao_yyrealloc (void * ptr, tao_yy_size_t 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 @@ -2541,24 +2708,26 @@ tao_yy_size_t size; * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); - } +} -#ifdef TAO_YY_USE_PROTOS -static void tao_yy_flex_free( void *ptr ) -#else -static void tao_yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } +void tao_yyfree (void * ptr ) +{ + free( (char *) ptr ); /* see tao_yyrealloc() for (char *) cast */ +} -#if TAO_YY_MAIN -int main() - { - tao_yylex(); - return 0; - } +#define TAO_YYTABLES_NAME "tao_yytables" + +#undef TAO_YY_NEW_FILE +#undef TAO_YY_FLUSH_BUFFER +#undef tao_yy_set_bol +#undef tao_yy_new_buffer +#undef tao_yy_set_interactive +#undef tao_yytext_ptr +#undef TAO_YY_DO_BEFORE_ACTION + +#ifdef TAO_YY_DECL_IS_OURS +#undef TAO_YY_DECL_IS_OURS +#undef TAO_YY_DECL #endif /* subroutines */ @@ -3281,3 +3450,4 @@ idl_find_node (char *s) return d; } + diff --git a/TAO/TAO_IDL/fe/lex.yy.cpp.diff b/TAO/TAO_IDL/fe/lex.yy.cpp.diff index 16ba056ee02..82b0b590534 100644 --- a/TAO/TAO_IDL/fe/lex.yy.cpp.diff +++ b/TAO/TAO_IDL/fe/lex.yy.cpp.diff @@ -1,6 +1,6 @@ --- lex.yy.cpp.orig 2005-07-07 11:05:08.066403000 -0700 +++ lex.yy.cpp 2005-07-07 10:51:41.804932200 -0700 -@@ -1058,7 +1058,7 @@ +@@ -1134,7 +1134,7 @@ TAO_YY_DECL { register tao_yy_state_type tao_yy_current_state; @@ -9,14 +9,16 @@ register int tao_yy_act; -@@ -1591,42 +1591,42 @@ +@@ -1664,42 +1664,42 @@ idl_global->set_lineno(idl_global->lineno() + 1); idl_store_pragma(ace_tao_yytext); } - TAO_YY_BREAK + 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); @@ -24,7 +26,9 @@ - TAO_YY_BREAK + 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); @@ -32,7 +36,9 @@ - TAO_YY_BREAK + 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); @@ -40,7 +46,9 @@ - TAO_YY_BREAK + 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); @@ -48,7 +56,9 @@ - TAO_YY_BREAK + 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); @@ -56,15 +66,18 @@ - TAO_YY_BREAK + break; case 97: + /* rule 97 can match eol */ case 98: + /* rule 98 can match eol */ TAO_YY_RULE_SETUP -@@ -1634,14 +1634,14 @@ + { /* ignore cpp ident */ idl_global->set_lineno(idl_global->lineno() + 1); } - TAO_YY_BREAK + break; case 99: + /* rule 99 can match eol */ TAO_YY_RULE_SETUP { /* ignore comments */ @@ -75,7 +88,16 @@ case 100: TAO_YY_RULE_SETUP { -@@ -1658,17 +1658,17 @@ + for(;;) { + char c = tao_yyinput(); + if (c == '*') { + char next = tao_yyinput(); + if (next == '/') + break; + else + tao_yyunput(c, 0); + if (c == '\n') + idl_global->set_lineno(idl_global->lineno() + 1); } } } @@ -87,6 +109,7 @@ - TAO_YY_BREAK + break; case 102: + /* rule 102 can match eol */ TAO_YY_RULE_SETUP { idl_global->set_lineno(idl_global->lineno() + 1); @@ -96,41 +119,3 @@ case 103: TAO_YY_RULE_SETUP return ace_tao_yytext [0]; -@@ -1676,7 +1676,7 @@ - case 104: - TAO_YY_RULE_SETUP - TAO_YY_ECHO; -- TAO_YY_BREAK -+ break; - case TAO_YY_STATE_EOF(INITIAL): - tao_yyterminate(); - -@@ -2059,6 +2059,7 @@ - #endif /* ifndef TAO_YY_NO_UNPUT */ - - -+#ifndef TAO_YY_NO_INPUT - #ifdef __cplusplus - static int tao_yyinput() - #else -@@ -2131,7 +2132,7 @@ - - return c; - } -- -+#endif /* TAO_YY_NO_INPUT */ - - #ifdef TAO_YY_USE_PROTOS - void tao_yyrestart( FILE *input_file ) -@@ -2242,11 +2243,6 @@ - } - - --#ifndef TAO_YY_ALWAYS_INTERACTIVE --#ifndef TAO_YY_NEVER_INTERACTIVE --extern int isatty TAO_YY_PROTO(( int )); --#endif --#endif - - #ifdef TAO_YY_USE_PROTOS - void tao_yy_init_buffer( TAO_YY_BUFFER_STATE b, FILE *file ) -- cgit v1.2.1