diff --git a/cobc/scanner.c b/cobc/scanner.c index 9912236..95eadb3 100644 --- a/cobc/scanner.c +++ b/cobc/scanner.c @@ -1,6 +1,6 @@ -#line 2 "scanner.c" +#line 1 "scanner.c" -#line 4 "scanner.c" +#line 3 "scanner.c" #define YY_INT_ALIGNED short int @@ -8,8 +8,8 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -54,7 +54,6 @@ 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 @@ -85,63 +84,61 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) +#endif /* ! C99 */ -#define YY_USE_CONST +#endif /* ! FLEXINT_H */ -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ +/* begin standard C++ headers. */ -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin ) - +#define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -153,6 +150,11 @@ typedef unsigned int flex_uint32_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + extern int yyleng; extern FILE *yyin, *yyout; @@ -160,8 +162,9 @@ extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -176,14 +179,8 @@ extern FILE *yyin, *yyout; YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, (yytext_ptr) ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -196,7 +193,7 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. @@ -224,7 +221,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -252,7 +249,7 @@ struct yy_buffer_state /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< 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 @@ -263,7 +260,6 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ @@ -275,7 +271,7 @@ static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; +static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ @@ -284,85 +280,81 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -void yyrestart (FILE *input_file ); -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); -void yy_delete_buffer (YY_BUFFER_STATE b ); -void yy_flush_buffer (YY_BUFFER_STATE b ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state (void ); +void yyrestart ( FILE *input_file ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); +void yy_delete_buffer ( YY_BUFFER_STATE b ); +void yy_flush_buffer ( YY_BUFFER_STATE b ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state ( void ); -static void yyensure_buffer_stack (void ); -static void yy_load_buffer_state (void ); -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); +static void yyensure_buffer_stack ( void ); +static void yy_load_buffer_state ( void ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); - -void *yyalloc (yy_size_t ); -void *yyrealloc (void *,yy_size_t ); -void yyfree (void * ); +void *yyalloc ( yy_size_t ); +void *yyrealloc ( void *, yy_size_t ); +void yyfree ( void * ); #define yy_new_buffer yy_create_buffer - #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ -#define yywrap(n) 1 +#define yywrap() (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; -typedef unsigned char YY_CHAR; - -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; extern int yylineno; - int yylineno = 1; extern char *yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif #define yytext_ptr yytext -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); +static yy_state_type yy_get_previous_state ( void ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); +static int yy_get_next_buffer ( void ); +static void yynoreturn yy_fatal_error ( const char* msg ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; - #define YY_NUM_RULES 105 #define YY_END_OF_BUFFER 106 /* This struct is not used in this scanner, @@ -372,7 +364,7 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[633] = +static const flex_int16_t yy_accept[633] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 106, 100, 21, 1, 10, 18, 19, 100, 99, 20, @@ -446,7 +438,7 @@ static yyconst flex_int16_t yy_accept[633] = 84, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -478,7 +470,7 @@ static yyconst flex_int32_t yy_ec[256] = 79, 79, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[81] = +static const YY_CHAR yy_meta[81] = { 0, 1, 2, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 4, 4, 4, 4, 4, 4, @@ -490,7 +482,7 @@ static yyconst flex_int32_t yy_meta[81] = 6, 6, 6, 6, 6, 6, 6, 6, 7, 7 } ; -static yyconst flex_int16_t yy_base[647] = +static const flex_int16_t yy_base[647] = { 0, 0, 499, 70, 88, 101, 119, 124, 141, 204, 284, 503, 2447, 93, 2447, 2447, 2447, 2447, 492, 2447, 352, @@ -565,7 +557,7 @@ static yyconst flex_int16_t yy_base[647] = 2404, 2411, 2418, 2425, 2432, 2439 } ; -static yyconst flex_int16_t yy_def[647] = +static const flex_int16_t yy_def[647] = { 0, 632, 1, 1, 1, 1, 1, 633, 633, 634, 634, 632, 632, 632, 632, 632, 632, 632, 632, 632, 635, @@ -640,7 +632,7 @@ static yyconst flex_int16_t yy_def[647] = 632, 632, 632, 632, 632, 632 } ; -static yyconst flex_int16_t yy_nxt[2528] = +static const flex_int16_t yy_nxt[2528] = { 0, 12, 13, 14, 13, 15, 12, 15, 16, 17, 18, 12, 12, 12, 19, 20, 20, 20, 20, 20, 20, @@ -922,7 +914,7 @@ static yyconst flex_int16_t yy_nxt[2528] = 632, 632, 632, 632, 632, 632, 632 } ; -static yyconst flex_int16_t yy_chk[2528] = +static const flex_int16_t yy_chk[2528] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -1285,9 +1277,9 @@ static int scan_numeric (char *text); static int scan_picture (char *text); static void count_lines (char *text); +#line 1280 "scanner.c" - -#line 1291 "scanner.c" +#line 1282 "scanner.c" #define INITIAL 0 #define DECIMAL_IS_PERIOD 1 @@ -1299,36 +1291,36 @@ static void count_lines (char *text); #define YY_EXTRA_TYPE void * #endif -static int yy_init_globals (void ); +static int yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int yylex_destroy (void ); +int yylex_destroy ( void ); -int yyget_debug (void ); +int yyget_debug ( void ); -void yyset_debug (int debug_flag ); +void yyset_debug ( int debug_flag ); -YY_EXTRA_TYPE yyget_extra (void ); +YY_EXTRA_TYPE yyget_extra ( void ); -void yyset_extra (YY_EXTRA_TYPE user_defined ); +void yyset_extra ( YY_EXTRA_TYPE user_defined ); -FILE *yyget_in (void ); +FILE *yyget_in ( void ); -void yyset_in (FILE * in_str ); +void yyset_in ( FILE * _in_str ); -FILE *yyget_out (void ); +FILE *yyget_out ( void ); -void yyset_out (FILE * out_str ); +void yyset_out ( FILE * _out_str ); -int yyget_leng (void ); + int yyget_leng ( void ); -char *yyget_text (void ); +char *yyget_text ( void ); -int yyget_lineno (void ); +int yyget_lineno ( void ); -void yyset_lineno (int line_number ); +void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1336,35 +1328,43 @@ void yyset_lineno (int line_number ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap (void ); +extern "C" int yywrap ( void ); #else -extern int yywrap (void ); +extern int yywrap ( void ); #endif #endif - static void yyunput (int c,char *buf_ptr ); +#ifndef YY_NO_UNPUT + + static void yyunput ( int c, char *buf_ptr ); +#endif + #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (void ); +static int yyinput ( void ); #else -static int input (void ); +static int input ( void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1372,7 +1372,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1383,7 +1383,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - unsigned n; \ + int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1396,7 +1396,7 @@ static int input (void ); else \ { \ errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -1451,7 +1451,7 @@ extern int yylex (void); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -1464,13 +1464,41 @@ extern int yylex (void); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + if ( !(yy_init) ) + { + (yy_init) = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE ); + } + + yy_load_buffer_state( ); + } + + { #line 84 "scanner.l" +#line 87 "scanner.l" if (unget_buffer && unget_buffer->count) { --unget_buffer->count; yylval = unget_buffer->lvalue[unget_buffer->count]; @@ -1495,35 +1523,9 @@ YY_DECL -#line 1499 "scanner.c" - - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); - } - - yy_load_buffer_state( ); - } +#line 1526 "scanner.c" - while ( 1 ) /* loops until end-of-file is reached */ + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -1540,7 +1542,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1550,9 +1552,9 @@ YY_DECL { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 633 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_current_state != 632 ); @@ -1578,14 +1580,14 @@ YY_DECL case 1: /* rule 1 can match eol */ YY_RULE_SETUP -#line 110 "scanner.l" +#line 111 "scanner.l" { cb_source_line++; } YY_BREAK case 2: YY_RULE_SETUP -#line 114 "scanner.l" +#line 115 "scanner.l" { /* line directive */ char *endp; @@ -1598,17 +1600,17 @@ YY_RULE_SETUP } YY_BREAK case 3: -#line 126 "scanner.l" +#line 127 "scanner.l" case 4: YY_RULE_SETUP -#line 126 "scanner.l" +#line 127 "scanner.l" { BEGIN PICTURE_STATE; } YY_BREAK case 5: YY_RULE_SETUP -#line 130 "scanner.l" +#line 131 "scanner.l" { if (inside_repository) { return FUNCTION; @@ -1618,7 +1620,7 @@ YY_RULE_SETUP YY_BREAK case 6: YY_RULE_SETUP -#line 137 "scanner.l" +#line 138 "scanner.l" { inside_repository = 0; return DIVISION; @@ -1626,7 +1628,7 @@ YY_RULE_SETUP YY_BREAK case 7: YY_RULE_SETUP -#line 142 "scanner.l" +#line 143 "scanner.l" { inside_repository = 0; cb_force_pid_literal = 1; @@ -1635,7 +1637,7 @@ YY_RULE_SETUP YY_BREAK case 8: YY_RULE_SETUP -#line 148 "scanner.l" +#line 149 "scanner.l" { inside_repository = 0; cb_force_pid_literal = 1; @@ -1644,7 +1646,7 @@ YY_RULE_SETUP YY_BREAK case 9: YY_RULE_SETUP -#line 154 "scanner.l" +#line 155 "scanner.l" { inside_repository = 1; return REPOSITORY; @@ -1652,7 +1654,7 @@ YY_RULE_SETUP YY_BREAK case 10: YY_RULE_SETUP -#line 159 "scanner.l" +#line 160 "scanner.l" { /* string literal */ cb_force_pid_literal = 0; @@ -1661,7 +1663,7 @@ YY_RULE_SETUP YY_BREAK case 11: YY_RULE_SETUP -#line 165 "scanner.l" +#line 166 "scanner.l" { cb_force_pid_literal = 0; return read_literal (yytext[1], CB_CATEGORY_NATIONAL); @@ -1669,7 +1671,7 @@ YY_RULE_SETUP YY_BREAK case 12: YY_RULE_SETUP -#line 170 "scanner.l" +#line 171 "scanner.l" { cb_force_pid_literal = 0; return read_literal (yytext[2], CB_CATEGORY_NATIONAL); @@ -1677,17 +1679,17 @@ YY_RULE_SETUP YY_BREAK case 13: YY_RULE_SETUP -#line 175 "scanner.l" +#line 176 "scanner.l" { cb_force_pid_literal = 0; return read_literal (yytext[2], CB_CATEGORY_NATIONAL); } YY_BREAK case 14: -#line 181 "scanner.l" +#line 182 "scanner.l" case 15: YY_RULE_SETUP -#line 181 "scanner.l" +#line 182 "scanner.l" { /* X string literal */ if (cb_warn_compat) { @@ -1698,10 +1700,10 @@ YY_RULE_SETUP } YY_BREAK case 16: -#line 191 "scanner.l" +#line 192 "scanner.l" case 17: YY_RULE_SETUP -#line 191 "scanner.l" +#line 192 "scanner.l" { /* NX string literal */ if (cb_warn_compat) { @@ -1713,7 +1715,7 @@ YY_RULE_SETUP YY_BREAK case 18: YY_RULE_SETUP -#line 200 "scanner.l" +#line 201 "scanner.l" { inside_bracket++; return '('; @@ -1721,7 +1723,7 @@ YY_RULE_SETUP YY_BREAK case 19: YY_RULE_SETUP -#line 205 "scanner.l" +#line 206 "scanner.l" { if (inside_bracket > 0) { inside_bracket--; @@ -1731,7 +1733,7 @@ YY_RULE_SETUP YY_BREAK case 20: YY_RULE_SETUP -#line 212 "scanner.l" +#line 213 "scanner.l" { cb_force_pid_literal = 0; if (integer_is_label) { @@ -1761,14 +1763,14 @@ YY_RULE_SETUP YY_BREAK case 21: YY_RULE_SETUP -#line 239 "scanner.l" +#line 240 "scanner.l" { /* Ignore */ } YY_BREAK case 22: YY_RULE_SETUP -#line 243 "scanner.l" +#line 244 "scanner.l" { if (inside_bracket) { return SEMI_COLON; @@ -1778,7 +1780,7 @@ YY_RULE_SETUP YY_BREAK case 23: YY_RULE_SETUP -#line 250 "scanner.l" +#line 251 "scanner.l" { /* numeric literal */ return scan_numeric (yytext); @@ -1786,7 +1788,7 @@ YY_RULE_SETUP YY_BREAK case 24: YY_RULE_SETUP -#line 255 "scanner.l" +#line 256 "scanner.l" { if (inside_bracket) { return COMMA_DELIM; @@ -1796,7 +1798,7 @@ YY_RULE_SETUP YY_BREAK case 25: YY_RULE_SETUP -#line 262 "scanner.l" +#line 263 "scanner.l" { /* numeric literal */ return scan_numeric (yytext); @@ -1804,7 +1806,7 @@ YY_RULE_SETUP YY_BREAK case 26: YY_RULE_SETUP -#line 267 "scanner.l" +#line 268 "scanner.l" { /* numeric literal */ return scan_numeric (yytext); @@ -1812,7 +1814,7 @@ YY_RULE_SETUP YY_BREAK case 27: YY_RULE_SETUP -#line 272 "scanner.l" +#line 273 "scanner.l" { /* numeric literal */ return scan_numeric (yytext); @@ -1820,14 +1822,14 @@ YY_RULE_SETUP YY_BREAK case 28: YY_RULE_SETUP -#line 277 "scanner.l" +#line 278 "scanner.l" { unput (','); } YY_BREAK case 29: YY_RULE_SETUP -#line 281 "scanner.l" +#line 282 "scanner.l" { if (inside_bracket) { return COMMA_DELIM; @@ -1836,10 +1838,10 @@ YY_RULE_SETUP } YY_BREAK case 30: -#line 289 "scanner.l" +#line 290 "scanner.l" case 31: YY_RULE_SETUP -#line 289 "scanner.l" +#line 290 "scanner.l" { /* H numeric literal */ cb_force_pid_literal = 0; @@ -1849,7 +1851,7 @@ YY_RULE_SETUP case 32: /* rule 32 can match eol */ YY_RULE_SETUP -#line 295 "scanner.l" +#line 296 "scanner.l" { cb_force_pid_literal = 1; count_lines (yytext); @@ -1859,7 +1861,7 @@ YY_RULE_SETUP case 33: /* rule 33 can match eol */ YY_RULE_SETUP -#line 301 "scanner.l" +#line 302 "scanner.l" { cb_force_pid_literal = 1; count_lines (yytext); @@ -1869,7 +1871,7 @@ YY_RULE_SETUP case 34: /* rule 34 can match eol */ YY_RULE_SETUP -#line 307 "scanner.l" +#line 308 "scanner.l" { count_lines (yytext); return NEXT_SENTENCE; @@ -1878,7 +1880,7 @@ YY_RULE_SETUP case 35: /* rule 35 can match eol */ YY_RULE_SETUP -#line 312 "scanner.l" +#line 313 "scanner.l" { count_lines (yytext); return SCREEN_CONTROL; @@ -1887,7 +1889,7 @@ YY_RULE_SETUP case 36: /* rule 36 can match eol */ YY_RULE_SETUP -#line 317 "scanner.l" +#line 318 "scanner.l" { count_lines (yytext); return EVENT_STATUS; @@ -1896,7 +1898,7 @@ YY_RULE_SETUP case 37: /* rule 37 can match eol */ YY_RULE_SETUP -#line 322 "scanner.l" +#line 323 "scanner.l" { count_lines (yytext); return BLANK_SCREEN; @@ -1905,7 +1907,7 @@ YY_RULE_SETUP case 38: /* rule 38 can match eol */ YY_RULE_SETUP -#line 327 "scanner.l" +#line 328 "scanner.l" { count_lines (yytext); return BLANK_LINE; @@ -1914,7 +1916,7 @@ YY_RULE_SETUP case 39: /* rule 39 can match eol */ YY_RULE_SETUP -#line 332 "scanner.l" +#line 333 "scanner.l" { count_lines (yytext); return CONTROL; @@ -1923,7 +1925,7 @@ YY_RULE_SETUP case 40: /* rule 40 can match eol */ YY_RULE_SETUP -#line 337 "scanner.l" +#line 338 "scanner.l" { count_lines (yytext); return CONTROLS; @@ -1932,7 +1934,7 @@ YY_RULE_SETUP case 41: /* rule 41 can match eol */ YY_RULE_SETUP -#line 342 "scanner.l" +#line 343 "scanner.l" { count_lines (yytext); return CONTROL_HEADING; @@ -1941,7 +1943,7 @@ YY_RULE_SETUP case 42: /* rule 42 can match eol */ YY_RULE_SETUP -#line 347 "scanner.l" +#line 348 "scanner.l" { count_lines (yytext); return CONTROL_FOOTING; @@ -1950,7 +1952,7 @@ YY_RULE_SETUP case 43: /* rule 43 can match eol */ YY_RULE_SETUP -#line 352 "scanner.l" +#line 353 "scanner.l" { count_lines (yytext); return PAGE_HEADING; @@ -1959,7 +1961,7 @@ YY_RULE_SETUP case 44: /* rule 44 can match eol */ YY_RULE_SETUP -#line 357 "scanner.l" +#line 358 "scanner.l" { count_lines (yytext); return PAGE_FOOTING; @@ -1968,7 +1970,7 @@ YY_RULE_SETUP case 45: /* rule 45 can match eol */ YY_RULE_SETUP -#line 362 "scanner.l" +#line 363 "scanner.l" { count_lines (yytext); return REPORT_HEADING; @@ -1977,7 +1979,7 @@ YY_RULE_SETUP case 46: /* rule 46 can match eol */ YY_RULE_SETUP -#line 367 "scanner.l" +#line 368 "scanner.l" { count_lines (yytext); return REPORT_FOOTING; @@ -1986,7 +1988,7 @@ YY_RULE_SETUP case 47: /* rule 47 can match eol */ YY_RULE_SETUP -#line 372 "scanner.l" +#line 373 "scanner.l" { count_lines (yytext); return LAST_DETAIL; @@ -1995,7 +1997,7 @@ YY_RULE_SETUP case 48: /* rule 48 can match eol */ YY_RULE_SETUP -#line 377 "scanner.l" +#line 378 "scanner.l" { count_lines (yytext); return LAST_DETAIL; @@ -2003,14 +2005,14 @@ YY_RULE_SETUP YY_BREAK case 49: YY_RULE_SETUP -#line 382 "scanner.l" +#line 383 "scanner.l" { /* Ignore */ } YY_BREAK case 50: YY_RULE_SETUP -#line 386 "scanner.l" +#line 387 "scanner.l" { /* Ignore */ } @@ -2018,7 +2020,7 @@ YY_RULE_SETUP case 51: /* rule 51 can match eol */ YY_RULE_SETUP -#line 390 "scanner.l" +#line 391 "scanner.l" { count_lines (yytext); return NO_ADVANCING; @@ -2026,11 +2028,11 @@ YY_RULE_SETUP YY_BREAK case 52: /* rule 52 can match eol */ -#line 396 "scanner.l" +#line 397 "scanner.l" case 53: /* rule 53 can match eol */ YY_RULE_SETUP -#line 396 "scanner.l" +#line 397 "scanner.l" { count_lines (yytext); return NOT_SIZE_ERROR; @@ -2038,11 +2040,11 @@ YY_RULE_SETUP YY_BREAK case 54: /* rule 54 can match eol */ -#line 402 "scanner.l" +#line 403 "scanner.l" case 55: /* rule 55 can match eol */ YY_RULE_SETUP -#line 402 "scanner.l" +#line 403 "scanner.l" { count_lines (yytext); return SIZE_ERROR; @@ -2050,11 +2052,11 @@ YY_RULE_SETUP YY_BREAK case 56: /* rule 56 can match eol */ -#line 408 "scanner.l" +#line 409 "scanner.l" case 57: /* rule 57 can match eol */ YY_RULE_SETUP -#line 408 "scanner.l" +#line 409 "scanner.l" { count_lines (yytext); return NOT_EXCEPTION; @@ -2062,11 +2064,11 @@ YY_RULE_SETUP YY_BREAK case 58: /* rule 58 can match eol */ -#line 414 "scanner.l" +#line 415 "scanner.l" case 59: /* rule 59 can match eol */ YY_RULE_SETUP -#line 414 "scanner.l" +#line 415 "scanner.l" { count_lines (yytext); return EXCEPTION; @@ -2074,11 +2076,11 @@ YY_RULE_SETUP YY_BREAK case 60: /* rule 60 can match eol */ -#line 420 "scanner.l" +#line 421 "scanner.l" case 61: /* rule 61 can match eol */ YY_RULE_SETUP -#line 420 "scanner.l" +#line 421 "scanner.l" { count_lines (yytext); return NOT_OVERFLOW; @@ -2086,11 +2088,11 @@ YY_RULE_SETUP YY_BREAK case 62: /* rule 62 can match eol */ -#line 426 "scanner.l" +#line 427 "scanner.l" case 63: /* rule 63 can match eol */ YY_RULE_SETUP -#line 426 "scanner.l" +#line 427 "scanner.l" { count_lines (yytext); return NOT_END; @@ -2099,7 +2101,7 @@ YY_RULE_SETUP case 64: /* rule 64 can match eol */ YY_RULE_SETUP -#line 431 "scanner.l" +#line 432 "scanner.l" { count_lines (yytext); return END; @@ -2107,11 +2109,11 @@ YY_RULE_SETUP YY_BREAK case 65: /* rule 65 can match eol */ -#line 437 "scanner.l" +#line 438 "scanner.l" case 66: /* rule 66 can match eol */ YY_RULE_SETUP -#line 437 "scanner.l" +#line 438 "scanner.l" { count_lines (yytext); return OVERFLOW; @@ -2119,17 +2121,17 @@ YY_RULE_SETUP YY_BREAK case 67: /* rule 67 can match eol */ -#line 443 "scanner.l" +#line 444 "scanner.l" case 68: /* rule 68 can match eol */ -#line 444 "scanner.l" +#line 445 "scanner.l" case 69: /* rule 69 can match eol */ -#line 445 "scanner.l" +#line 446 "scanner.l" case 70: /* rule 70 can match eol */ YY_RULE_SETUP -#line 445 "scanner.l" +#line 446 "scanner.l" { count_lines (yytext); return NOT_EOP; @@ -2137,17 +2139,17 @@ YY_RULE_SETUP YY_BREAK case 71: /* rule 71 can match eol */ -#line 451 "scanner.l" +#line 452 "scanner.l" case 72: /* rule 72 can match eol */ -#line 452 "scanner.l" +#line 453 "scanner.l" case 73: /* rule 73 can match eol */ -#line 453 "scanner.l" +#line 454 "scanner.l" case 74: /* rule 74 can match eol */ YY_RULE_SETUP -#line 453 "scanner.l" +#line 454 "scanner.l" { count_lines (yytext); return EOP; @@ -2156,7 +2158,7 @@ YY_RULE_SETUP case 75: /* rule 75 can match eol */ YY_RULE_SETUP -#line 458 "scanner.l" +#line 459 "scanner.l" { count_lines (yytext); return NOT_INVALID_KEY; @@ -2165,7 +2167,7 @@ YY_RULE_SETUP case 76: /* rule 76 can match eol */ YY_RULE_SETUP -#line 463 "scanner.l" +#line 464 "scanner.l" { count_lines (yytext); return NOT_INVALID_KEY; @@ -2174,7 +2176,7 @@ YY_RULE_SETUP case 77: /* rule 77 can match eol */ YY_RULE_SETUP -#line 468 "scanner.l" +#line 469 "scanner.l" { count_lines (yytext); return INVALID_KEY; @@ -2183,7 +2185,7 @@ YY_RULE_SETUP case 78: /* rule 78 can match eol */ YY_RULE_SETUP -#line 473 "scanner.l" +#line 474 "scanner.l" { count_lines (yytext); return INVALID_KEY; @@ -2192,7 +2194,7 @@ YY_RULE_SETUP case 79: /* rule 79 can match eol */ YY_RULE_SETUP -#line 478 "scanner.l" +#line 479 "scanner.l" { count_lines (yytext); return UPON_ENVIRONMENT_NAME; @@ -2201,7 +2203,7 @@ YY_RULE_SETUP case 80: /* rule 80 can match eol */ YY_RULE_SETUP -#line 483 "scanner.l" +#line 484 "scanner.l" { count_lines (yytext); return UPON_ENVIRONMENT_VALUE; @@ -2210,7 +2212,7 @@ YY_RULE_SETUP case 81: /* rule 81 can match eol */ YY_RULE_SETUP -#line 488 "scanner.l" +#line 489 "scanner.l" { count_lines (yytext); return UPON_ARGUMENT_NUMBER; @@ -2219,24 +2221,24 @@ YY_RULE_SETUP case 82: /* rule 82 can match eol */ YY_RULE_SETUP -#line 493 "scanner.l" +#line 494 "scanner.l" { count_lines (yytext); return UPON_COMMAND_LINE; } YY_BREAK case 83: -#line 499 "scanner.l" +#line 500 "scanner.l" case 84: YY_RULE_SETUP -#line 499 "scanner.l" +#line 500 "scanner.l" { /* Ignore */ } YY_BREAK case 85: YY_RULE_SETUP -#line 503 "scanner.l" +#line 504 "scanner.l" { yylval = cb_build_reference ("SWITCH-1"); SET_LOCATION (yylval); @@ -2245,7 +2247,7 @@ YY_RULE_SETUP YY_BREAK case 86: YY_RULE_SETUP -#line 509 "scanner.l" +#line 510 "scanner.l" { yylval = cb_build_reference ("SWITCH-2"); SET_LOCATION (yylval); @@ -2254,7 +2256,7 @@ YY_RULE_SETUP YY_BREAK case 87: YY_RULE_SETUP -#line 515 "scanner.l" +#line 516 "scanner.l" { yylval = cb_build_reference ("SWITCH-3"); SET_LOCATION (yylval); @@ -2263,7 +2265,7 @@ YY_RULE_SETUP YY_BREAK case 88: YY_RULE_SETUP -#line 521 "scanner.l" +#line 522 "scanner.l" { yylval = cb_build_reference ("SWITCH-4"); SET_LOCATION (yylval); @@ -2272,7 +2274,7 @@ YY_RULE_SETUP YY_BREAK case 89: YY_RULE_SETUP -#line 527 "scanner.l" +#line 528 "scanner.l" { yylval = cb_build_reference ("SWITCH-5"); SET_LOCATION (yylval); @@ -2281,7 +2283,7 @@ YY_RULE_SETUP YY_BREAK case 90: YY_RULE_SETUP -#line 533 "scanner.l" +#line 534 "scanner.l" { yylval = cb_build_reference ("SWITCH-6"); SET_LOCATION (yylval); @@ -2290,7 +2292,7 @@ YY_RULE_SETUP YY_BREAK case 91: YY_RULE_SETUP -#line 539 "scanner.l" +#line 540 "scanner.l" { yylval = cb_build_reference ("SWITCH-7"); SET_LOCATION (yylval); @@ -2299,7 +2301,7 @@ YY_RULE_SETUP YY_BREAK case 92: YY_RULE_SETUP -#line 545 "scanner.l" +#line 546 "scanner.l" { yylval = cb_build_reference ("SWITCH-8"); SET_LOCATION (yylval); @@ -2309,7 +2311,7 @@ YY_RULE_SETUP case 93: /* rule 93 can match eol */ YY_RULE_SETUP -#line 551 "scanner.l" +#line 552 "scanner.l" { count_lines (yytext); return WHEN_OTHER; @@ -2317,7 +2319,7 @@ YY_RULE_SETUP YY_BREAK case 94: YY_RULE_SETUP -#line 557 "scanner.l" +#line 558 "scanner.l" { struct cb_word *word; @@ -2451,7 +2453,7 @@ YY_RULE_SETUP YY_BREAK case 95: YY_RULE_SETUP -#line 687 "scanner.l" +#line 688 "scanner.l" { yylval = NULL; return LE; @@ -2459,7 +2461,7 @@ YY_RULE_SETUP YY_BREAK case 96: YY_RULE_SETUP -#line 692 "scanner.l" +#line 693 "scanner.l" { yylval = NULL; return GE; @@ -2467,7 +2469,7 @@ YY_RULE_SETUP YY_BREAK case 97: YY_RULE_SETUP -#line 697 "scanner.l" +#line 698 "scanner.l" { yylval = NULL; return NE; @@ -2475,7 +2477,7 @@ YY_RULE_SETUP YY_BREAK case 98: YY_RULE_SETUP -#line 702 "scanner.l" +#line 703 "scanner.l" { yylval = NULL; return '^'; @@ -2483,7 +2485,7 @@ YY_RULE_SETUP YY_BREAK case 99: YY_RULE_SETUP -#line 707 "scanner.l" +#line 708 "scanner.l" { last_token_is_dot = 1; yylval = NULL; @@ -2492,7 +2494,7 @@ YY_RULE_SETUP YY_BREAK case 100: YY_RULE_SETUP -#line 713 "scanner.l" +#line 714 "scanner.l" { yylval = NULL; return yytext[0]; @@ -2501,14 +2503,14 @@ YY_RULE_SETUP case 101: YY_RULE_SETUP -#line 720 "scanner.l" +#line 721 "scanner.l" { /* ignore */ } YY_BREAK case 102: YY_RULE_SETUP -#line 723 "scanner.l" +#line 724 "scanner.l" { BEGIN INITIAL; return scan_picture (yytext); @@ -2518,7 +2520,7 @@ YY_RULE_SETUP case 103: YY_RULE_SETUP -#line 730 "scanner.l" +#line 731 "scanner.l" { BEGIN INITIAL; yylval = cb_build_reference (yytext); @@ -2567,7 +2569,7 @@ YY_RULE_SETUP YY_BREAK case 104: YY_RULE_SETUP -#line 775 "scanner.l" +#line 776 "scanner.l" { yylval = NULL; return yytext[0]; @@ -2579,7 +2581,7 @@ case YY_STATE_EOF(DECIMAL_IS_PERIOD): case YY_STATE_EOF(DECIMAL_IS_COMMA): case YY_STATE_EOF(PICTURE_STATE): case YY_STATE_EOF(FUNCTION_STATE): -#line 781 "scanner.l" +#line 782 "scanner.l" { last_token_is_dot = 0; integer_is_label = 0; @@ -2592,10 +2594,10 @@ case YY_STATE_EOF(FUNCTION_STATE): YY_BREAK case 105: YY_RULE_SETUP -#line 791 "scanner.l" +#line 792 "scanner.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 2599 "scanner.c" +#line 2600 "scanner.c" case YY_END_OF_BUFFER: { @@ -2672,7 +2674,7 @@ YY_FATAL_ERROR( "flex scanner jammed" ); { (yy_did_buffer_switch_on_eof) = 0; - if ( yywrap( ) ) + if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -2725,6 +2727,7 @@ YY_FATAL_ERROR( "flex scanner jammed" ); "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -2736,9 +2739,9 @@ YY_FATAL_ERROR( "flex scanner jammed" ); */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -2767,7 +2770,7 @@ static int yy_get_next_buffer (void) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -2787,7 +2790,7 @@ static int yy_get_next_buffer (void) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); @@ -2803,11 +2806,12 @@ static int yy_get_next_buffer (void) b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) ); } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -2825,7 +2829,7 @@ static int yy_get_next_buffer (void) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), (size_t) num_to_read ); + (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -2835,7 +2839,7 @@ static int yy_get_next_buffer (void) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ); + yyrestart( yyin ); } else @@ -2849,12 +2853,15 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; @@ -2870,15 +2877,15 @@ static int yy_get_next_buffer (void) static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -2888,9 +2895,9 @@ static int yy_get_next_buffer (void) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 633 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; @@ -2903,10 +2910,10 @@ static int yy_get_next_buffer (void) */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -2916,17 +2923,19 @@ static int yy_get_next_buffer (void) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 633 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 632); - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } - static void yyunput (int c, register char * yy_bp ) +#ifndef YY_NO_UNPUT + + static void yyunput (int c, char * yy_bp ) { - register char *yy_cp; + char *yy_cp; yy_cp = (yy_c_buf_p); @@ -2936,10 +2945,10 @@ static int yy_get_next_buffer (void) if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + int number_to_move = (yy_n_chars) + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = + char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -2948,7 +2957,7 @@ static int yy_get_next_buffer (void) yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); @@ -2961,6 +2970,8 @@ static int yy_get_next_buffer (void) (yy_c_buf_p) = yy_cp; } +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -2985,7 +2996,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); + int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -3002,14 +3013,14 @@ static int yy_get_next_buffer (void) */ /* Reset buffer status. */ - yyrestart(yyin ); + yyrestart( yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( yywrap( ) ) - return EOF; + if ( yywrap( ) ) + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -3048,11 +3059,11 @@ static int yy_get_next_buffer (void) if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - yy_init_buffer(YY_CURRENT_BUFFER,input_file ); - yy_load_buffer_state( ); + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); } /** Switch to a different input buffer. @@ -3080,7 +3091,7 @@ static int yy_get_next_buffer (void) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); + yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag @@ -3108,7 +3119,7 @@ static void yy_load_buffer_state (void) { YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -3117,13 +3128,13 @@ static void yy_load_buffer_state (void) /* 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->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - yy_init_buffer(b,file ); + yy_init_buffer( b, file ); return b; } @@ -3142,9 +3153,9 @@ static void yy_load_buffer_state (void) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ); + yyfree( (void *) b->yy_ch_buf ); - yyfree((void *) b ); + yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. @@ -3156,7 +3167,7 @@ static void yy_load_buffer_state (void) { int oerrno = errno; - yy_flush_buffer(b ); + yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; @@ -3199,7 +3210,7 @@ static void yy_load_buffer_state (void) b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); + yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes @@ -3230,7 +3241,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } @@ -3249,7 +3260,7 @@ void yypop_buffer_state (void) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } @@ -3259,7 +3270,7 @@ void yypop_buffer_state (void) */ static void yyensure_buffer_stack (void) { - int num_to_alloc; + yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { @@ -3267,15 +3278,15 @@ static void yyensure_buffer_stack (void) * 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; + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; @@ -3284,7 +3295,7 @@ static void yyensure_buffer_stack (void) if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc @@ -3304,7 +3315,7 @@ static void yyensure_buffer_stack (void) * @param base the character buffer * @param size the size in bytes of the character buffer * - * @return the newly allocated buffer state object. + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { @@ -3314,23 +3325,23 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return 0; + return NULL; - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = 0; + b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - yy_switch_to_buffer(b ); + yy_switch_to_buffer( b ); return b; } @@ -3343,20 +3354,20 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ -YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) +YY_BUFFER_STATE yy_scan_string (const char * yystr ) { - return yy_scan_bytes(yystr,strlen(yystr) ); + return yy_scan_bytes( yystr, (int) strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to 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. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; @@ -3364,8 +3375,8 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) int i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) yyalloc(n ); + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); @@ -3374,7 +3385,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = yy_scan_buffer(buf,n ); + b = yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); @@ -3390,9 +3401,9 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg ) +static void yynoreturn yy_fatal_error (const char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -3420,7 +3431,7 @@ static void yy_fatal_error (yyconst char* msg ) */ int yyget_lineno (void) { - + return yylineno; } @@ -3458,29 +3469,29 @@ char *yyget_text (void) } /** Set the current line number. - * @param line_number + * @param _line_number line number * */ -void yyset_lineno (int line_number ) +void yyset_lineno (int _line_number ) { - yylineno = line_number; + yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * * @see yy_switch_to_buffer */ -void yyset_in (FILE * in_str ) +void yyset_in (FILE * _in_str ) { - yyin = in_str ; + yyin = _in_str ; } -void yyset_out (FILE * out_str ) +void yyset_out (FILE * _out_str ) { - yyout = out_str ; + yyout = _out_str ; } int yyget_debug (void) @@ -3488,9 +3499,9 @@ int yyget_debug (void) return yy_flex_debug; } -void yyset_debug (int bdebug ) +void yyset_debug (int _bdebug ) { - yy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } static int yy_init_globals (void) @@ -3499,10 +3510,10 @@ static int yy_init_globals (void) * This function is called from yylex_destroy(), so don't allocate here. */ - (yy_buffer_stack) = 0; + (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; + (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; @@ -3511,8 +3522,8 @@ static int yy_init_globals (void) yyin = stdin; yyout = stdout; #else - yyin = (FILE *) 0; - yyout = (FILE *) 0; + yyin = NULL; + yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by @@ -3527,7 +3538,7 @@ int yylex_destroy (void) /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ - yy_delete_buffer(YY_CURRENT_BUFFER ); + yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } @@ -3548,18 +3559,19 @@ int yylex_destroy (void) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +static void yy_flex_strncpy (char* s1, const char * s2, int n ) { - register int i; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) +static int yy_flex_strlen (const char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -3569,11 +3581,12 @@ static int yy_flex_strlen (yyconst char * s ) void *yyalloc (yy_size_t size ) { - return (void *) malloc( size ); + return malloc(size); } void *yyrealloc (void * ptr, 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 @@ -3581,18 +3594,17 @@ void *yyrealloc (void * ptr, 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 realloc(ptr, size); } void yyfree (void * ptr ) { - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" -#line 791 "scanner.l" - +#line 792 "scanner.l" static int @@ -3607,6 +3619,9 @@ read_literal (int mark, enum cb_category category) } while ((c = input ()) != EOF) { +#if EOF != 0 + if (unlikely (c == 0)) break; /* fixes unexpected error case */ +#endif plexbuff[i++] = c; if (c == mark && (c = input ()) != mark) { i--; diff --git a/cobc/scanner.l b/cobc/scanner.l index 0547a7e..7b09736 100644 --- a/cobc/scanner.l +++ b/cobc/scanner.l @@ -802,6 +802,9 @@ read_literal (int mark, enum cb_category category) } while ((c = input ()) != EOF) { +#if EOF != 0 + if (unlikely (c == 0)) break; /* fixes unexpected error case */ +#endif plexbuff[i++] = c; if (c == mark && (c = input ()) != mark) { i--;