From 1f20c19d8b393947f30ffadbe6ae42c6f7cd875f Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Tue, 20 Dec 2016 17:12:50 +0000 Subject: [PATCH] trac5017: regen parsers --- src/bin/dhcp4/location.hh | 2 +- src/bin/dhcp4/position.hh | 2 +- src/bin/dhcp4/stack.hh | 2 +- src/bin/dhcp6/dhcp6_lexer.cc | 103 +++++++++++++++-------------------- src/bin/dhcp6/location.hh | 1 + src/bin/dhcp6/position.hh | 1 + src/bin/dhcp6/stack.hh | 1 + 7 files changed, 50 insertions(+), 62 deletions(-) diff --git a/src/bin/dhcp4/location.hh b/src/bin/dhcp4/location.hh index aa58c3e3cc..5fa0df8e9c 100644 --- a/src/bin/dhcp4/location.hh +++ b/src/bin/dhcp4/location.hh @@ -1,4 +1,4 @@ -// Generated 201612171456 +// Generated 201612201711 // A Bison parser, made by GNU Bison 3.0.4. // Locations for Bison parsers in C++ diff --git a/src/bin/dhcp4/position.hh b/src/bin/dhcp4/position.hh index f4d5414e3d..90205858a4 100644 --- a/src/bin/dhcp4/position.hh +++ b/src/bin/dhcp4/position.hh @@ -1,4 +1,4 @@ -// Generated 201612171456 +// Generated 201612201711 // A Bison parser, made by GNU Bison 3.0.4. // Positions for Bison parsers in C++ diff --git a/src/bin/dhcp4/stack.hh b/src/bin/dhcp4/stack.hh index c82de0ac93..3f47b56e18 100644 --- a/src/bin/dhcp4/stack.hh +++ b/src/bin/dhcp4/stack.hh @@ -1,4 +1,4 @@ -// Generated 201612171456 +// Generated 201612201711 // A Bison parser, made by GNU Bison 3.0.4. // Stack handling for Bison parsers in C++ diff --git a/src/bin/dhcp6/dhcp6_lexer.cc b/src/bin/dhcp6/dhcp6_lexer.cc index 1e64dc713f..525316377f 100644 --- a/src/bin/dhcp6/dhcp6_lexer.cc +++ b/src/bin/dhcp6/dhcp6_lexer.cc @@ -36,7 +36,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 0 +#define YY_FLEX_SUBMINOR_VERSION 1 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -136,25 +136,13 @@ typedef unsigned int flex_uint32_t; /* %if-c++-only */ /* %endif */ -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#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 /* %not-for-header */ @@ -229,7 +217,7 @@ typedef size_t yy_size_t; #endif /* %if-not-reentrant */ -extern yy_size_t parser6_leng; +extern int parser6_leng; /* %endif */ /* %if-c-only */ @@ -278,7 +266,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. @@ -339,7 +327,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. */ /* %endif */ /* %ok-for-header */ @@ -368,10 +356,10 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when parser6_text is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ -yy_size_t parser6_leng; +int parser6_leng; /* 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 */ @@ -399,7 +387,7 @@ static void parser6__init_buffer (YY_BUFFER_STATE b,FILE *file ); YY_BUFFER_STATE parser6__scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE parser6__scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE parser6__scan_bytes (yyconst char *bytes,yy_size_t len ); +YY_BUFFER_STATE parser6__scan_bytes (yyconst char *bytes,int len ); /* %endif */ @@ -441,7 +429,7 @@ void parser6_free (void * ); typedef unsigned char YY_CHAR; -FILE *parser6_in = (FILE *) 0, *parser6_out = (FILE *) 0; +FILE *parser6_in = NULL, *parser6_out = NULL; typedef int yy_state_type; @@ -462,10 +450,7 @@ extern char *parser6_text; 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 ); -#if defined(__GNUC__) && __GNUC__ >= 3 -__attribute__((__noreturn__)) -#endif -static void yy_fatal_error (yyconst char msg[] ); +static void yynoreturn yy_fatal_error (yyconst char* msg ); /* %endif */ @@ -475,7 +460,7 @@ static void yy_fatal_error (yyconst char msg[] ); #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ /* %% [2.0] code to fiddle parser6_text and parser6_leng for yymore() goes here \ */\ - parser6_leng = (size_t) (yy_cp - yy_bp); \ + parser6_leng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ /* %% [3.0] code to copy yytext_ptr to parser6_text[] goes here, if %array \ */\ @@ -2117,7 +2102,7 @@ unsigned int comment_start_line = 0; // by moving it ahead by parser6_leng bytes. parser6_leng specifies the length of the // currently matched token. #define YY_USER_ACTION driver.loc_.columns(parser6_leng); -#line 2121 "dhcp6_lexer.cc" +#line 2106 "dhcp6_lexer.cc" #define INITIAL 0 #define COMMENT 1 @@ -2173,7 +2158,7 @@ FILE *parser6_get_out (void ); void parser6_set_out (FILE * _out_str ); -yy_size_t parser6_get_leng (void ); + int parser6_get_leng (void ); char *parser6_get_text (void ); @@ -2247,7 +2232,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( parser6_text, parser6_leng, 1, parser6_out )) {} } while (0) +#define ECHO do { if (fwrite( parser6_text, (size_t) parser6_leng, 1, parser6_out )) {} } while (0) /* %endif */ /* %if-c++-only C++ definition */ /* %endif */ @@ -2275,7 +2260,7 @@ static int input (void ); else \ { \ errno=0; \ - while ( (result = fread(buf, 1, max_size, parser6_in))==0 && ferror(parser6_in)) \ + while ( (result = (int) fread(buf, 1, max_size, parser6_in))==0 && ferror(parser6_in)) \ { \ if( errno != EINTR) \ { \ @@ -2443,7 +2428,7 @@ YY_DECL } -#line 2447 "dhcp6_lexer.cc" +#line 2432 "dhcp6_lexer.cc" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -2475,7 +2460,7 @@ yy_match: if ( yy_current_state >= 766 ) yy_c = yy_meta[(unsigned int) 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] + (flex_int16_t) yy_c]; ++yy_cp; } while ( yy_current_state != 765 ); @@ -3835,7 +3820,7 @@ YY_RULE_SETUP #line 1101 "dhcp6_lexer.ll" ECHO; YY_BREAK -#line 3839 "dhcp6_lexer.cc" +#line 3824 "dhcp6_lexer.cc" case YY_END_OF_BUFFER: { @@ -4038,7 +4023,7 @@ static int yy_get_next_buffer (void) else { - yy_size_t num_to_read = + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -4052,7 +4037,7 @@ static int yy_get_next_buffer (void) if ( b->yy_is_our_buffer ) { - yy_size_t new_size = b->yy_buf_size * 2; + int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -4065,7 +4050,7 @@ static int yy_get_next_buffer (void) } 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( @@ -4155,7 +4140,7 @@ static int yy_get_next_buffer (void) if ( yy_current_state >= 766 ) yy_c = yy_meta[(unsigned int) 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] + (flex_int16_t) yy_c]; } return yy_current_state; @@ -4188,7 +4173,7 @@ static int yy_get_next_buffer (void) if ( yy_current_state >= 766 ) yy_c = yy_meta[(unsigned int) 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] + (flex_int16_t) yy_c]; yy_is_jam = (yy_current_state == 765); return yy_is_jam ? 0 : yy_current_state; @@ -4228,7 +4213,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + int offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -4252,7 +4237,7 @@ static int yy_get_next_buffer (void) case EOB_ACT_END_OF_FILE: { if ( parser6_wrap( ) ) - return EOF; + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -4568,7 +4553,7 @@ static void parser6_ensure_buffer_stack (void) /* %if-c++-only */ /* %endif */ { - yy_size_t num_to_alloc; + int num_to_alloc; if (!(yy_buffer_stack)) { @@ -4576,7 +4561,7 @@ static void parser6_ensure_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; /* After all that talk, this was set to 1 anyways... */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)parser6_alloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); @@ -4625,7 +4610,7 @@ YY_BUFFER_STATE parser6__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) parser6_alloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) @@ -4634,7 +4619,7 @@ YY_BUFFER_STATE parser6__scan_buffer (char * base, yy_size_t size ) b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = 0; + b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; @@ -4659,7 +4644,7 @@ YY_BUFFER_STATE parser6__scan_buffer (char * base, yy_size_t size ) YY_BUFFER_STATE parser6__scan_string (yyconst char * yystr ) { - return parser6__scan_bytes(yystr,strlen(yystr) ); + return parser6__scan_bytes(yystr,(int) strlen(yystr) ); } /* %endif */ @@ -4671,7 +4656,7 @@ YY_BUFFER_STATE parser6__scan_string (yyconst char * yystr ) * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE parser6__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +YY_BUFFER_STATE parser6__scan_bytes (yyconst char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; @@ -4679,7 +4664,7 @@ YY_BUFFER_STATE parser6__scan_bytes (yyconst char * yybytes, yy_size_t _yybyte yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; + n = (yy_size_t) _yybytes_len + 2; buf = (char *) parser6_alloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in parser6__scan_bytes()" ); @@ -4707,7 +4692,7 @@ YY_BUFFER_STATE parser6__scan_bytes (yyconst char * yybytes, yy_size_t _yybyte #endif /* %if-c-only */ -static void yy_fatal_error (yyconst char* msg ) +static void yynoreturn yy_fatal_error (yyconst char* msg ) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); @@ -4767,7 +4752,7 @@ FILE *parser6_get_out (void) /** Get the length of the current token. * */ -yy_size_t parser6_get_leng (void) +int parser6_get_leng (void) { return parser6_leng; } @@ -4834,10 +4819,10 @@ static int yy_init_globals (void) * This function is called from parser6_lex_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; @@ -4846,8 +4831,8 @@ static int yy_init_globals (void) parser6_in = stdin; parser6_out = stdout; #else - parser6_in = (FILE *) 0; - parser6_out = (FILE *) 0; + parser6_in = NULL; + parser6_out = NULL; #endif /* For future reference: Set errno on error, since we are called by @@ -4910,7 +4895,7 @@ static int yy_flex_strlen (yyconst char * s ) void *parser6_alloc (yy_size_t size ) { - return (void *) malloc( size ); + return malloc(size); } void *parser6_realloc (void * ptr, yy_size_t size ) @@ -4923,7 +4908,7 @@ void *parser6_realloc (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 parser6_free (void * ptr ) diff --git a/src/bin/dhcp6/location.hh b/src/bin/dhcp6/location.hh index 239704683c..8cfe848f23 100644 --- a/src/bin/dhcp6/location.hh +++ b/src/bin/dhcp6/location.hh @@ -1,3 +1,4 @@ +// Generated 201612201711 // A Bison parser, made by GNU Bison 3.0.4. // Locations for Bison parsers in C++ diff --git a/src/bin/dhcp6/position.hh b/src/bin/dhcp6/position.hh index 2ee80e6d0a..085c486a17 100644 --- a/src/bin/dhcp6/position.hh +++ b/src/bin/dhcp6/position.hh @@ -1,3 +1,4 @@ +// Generated 201612201711 // A Bison parser, made by GNU Bison 3.0.4. // Positions for Bison parsers in C++ diff --git a/src/bin/dhcp6/stack.hh b/src/bin/dhcp6/stack.hh index db2863a06e..b5e1bf8eea 100644 --- a/src/bin/dhcp6/stack.hh +++ b/src/bin/dhcp6/stack.hh @@ -1,3 +1,4 @@ +// Generated 201612201711 // A Bison parser, made by GNU Bison 3.0.4. // Stack handling for Bison parsers in C++