Updates to lex/yacc: bison 3.8.2

This commit is contained in:
Shahram Najm 2023-01-29 12:48:55 +00:00
parent b68ff72386
commit bf80a67c0a
3 changed files with 1155 additions and 1197 deletions

View File

@ -1,6 +1,6 @@
#line 1 "gribl.c"
#line 1 "gribl.cpp"
#line 3 "gribl.c"
#line 3 "gribl.cpp"
#define YY_INT_ALIGNED short int
@ -47,6 +47,7 @@ typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
typedef uint64_t flex_uint64_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
@ -155,7 +156,7 @@ typedef struct grib_yy_buffer_state *YY_BUFFER_STATE;
typedef size_t grib_yy_size_t;
#endif
extern int grib_yyleng;
extern grib_yy_size_t grib_yyleng;
extern FILE *grib_yyin, *grib_yyout;
@ -198,7 +199,7 @@ struct grib_yy_buffer_state
/* Number of characters read into grib_yy_ch_buf, not including EOB
* characters.
*/
int grib_yy_n_chars;
grib_yy_size_t grib_yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
@ -267,8 +268,8 @@ static YY_BUFFER_STATE * grib_yy_buffer_stack = NULL; /**< Stack as an array. */
/* grib_yy_hold_char holds the character lost when grib_yytext is formed. */
static char grib_yy_hold_char;
static int grib_yy_n_chars; /* number of characters read into grib_yy_ch_buf */
int grib_yyleng;
static grib_yy_size_t grib_yy_n_chars; /* number of characters read into grib_yy_ch_buf */
grib_yy_size_t grib_yyleng;
/* Points to current character in buffer. */
static char *grib_yy_c_buf_p = NULL;
@ -295,7 +296,7 @@ static void grib_yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
YY_BUFFER_STATE grib_yy_scan_buffer ( char *base, grib_yy_size_t size );
YY_BUFFER_STATE grib_yy_scan_string ( const char *grib_yy_str );
YY_BUFFER_STATE grib_yy_scan_bytes ( const char *bytes, int len );
YY_BUFFER_STATE grib_yy_scan_bytes ( const char *bytes, grib_yy_size_t len );
void *grib_yyalloc ( grib_yy_size_t );
void *grib_yyrealloc ( void *, grib_yy_size_t );
@ -348,7 +349,7 @@ static void grib_yynoreturn grib_yy_fatal_error ( const char* msg );
*/
#define YY_DO_BEFORE_ACTION \
(grib_yytext_ptr) = grib_yy_bp; \
grib_yyleng = (int) (grib_yy_cp - grib_yy_bp); \
grib_yyleng = (grib_yy_size_t) (grib_yy_cp - grib_yy_bp); \
(grib_yy_hold_char) = *grib_yy_cp; \
*grib_yy_cp = '\0'; \
(grib_yy_c_buf_p) = grib_yy_cp;
@ -1198,8 +1199,8 @@ void _grib_ignore_grib_yyunput_unused_error() { grib_yyunput(0,0); }
#define GET_INPUT input
#endif
#line 1201 "gribl.c"
#line 1202 "gribl.c"
#line 1202 "gribl.cpp"
#line 1203 "gribl.cpp"
#define INITIAL 0
@ -1238,7 +1239,7 @@ FILE *grib_yyget_out ( void );
void grib_yyset_out ( FILE * _out_str );
int grib_yyget_leng ( void );
grib_yy_size_t grib_yyget_leng ( void );
char *grib_yyget_text ( void );
@ -1307,7 +1308,7 @@ static int input ( void );
if ( YY_CURRENT_BUFFER_LVALUE->grib_yy_is_interactive ) \
{ \
int c = '*'; \
int n; \
grib_yy_size_t n; \
for ( n = 0; n < max_size && \
(c = getc( grib_yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@ -1420,7 +1421,7 @@ YY_DECL
#line 1423 "gribl.c"
#line 1424 "gribl.cpp"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
@ -2216,7 +2217,7 @@ YY_RULE_SETUP
#line 284 "gribl.l"
ECHO;
YY_BREAK
#line 2219 "gribl.c"
#line 2220 "gribl.cpp"
case YY_STATE_EOF(INITIAL):
grib_yyterminate();
@ -2403,7 +2404,7 @@ static int grib_yy_get_next_buffer (void)
else
{
int num_to_read =
grib_yy_size_t num_to_read =
YY_CURRENT_BUFFER_LVALUE->grib_yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
@ -2417,7 +2418,7 @@ static int grib_yy_get_next_buffer (void)
if ( b->grib_yy_is_our_buffer )
{
int new_size = b->grib_yy_buf_size * 2;
grib_yy_size_t new_size = b->grib_yy_buf_size * 2;
if ( new_size <= 0 )
b->grib_yy_buf_size += b->grib_yy_buf_size / 8;
@ -2475,7 +2476,7 @@ static int grib_yy_get_next_buffer (void)
if (((grib_yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->grib_yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
int new_size = (grib_yy_n_chars) + number_to_move + ((grib_yy_n_chars) >> 1);
grib_yy_size_t new_size = (grib_yy_n_chars) + number_to_move + ((grib_yy_n_chars) >> 1);
YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf = (char *) grib_yyrealloc(
(void *) YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf, (grib_yy_size_t) new_size );
if ( ! YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf )
@ -2564,7 +2565,7 @@ static int grib_yy_get_next_buffer (void)
if ( grib_yy_cp < YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
int number_to_move = (grib_yy_n_chars) + 2;
grib_yy_size_t number_to_move = (grib_yy_n_chars) + 2;
char *dest = &YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf[
YY_CURRENT_BUFFER_LVALUE->grib_yy_buf_size + 2];
char *source =
@ -2615,7 +2616,7 @@ static int grib_yy_get_next_buffer (void)
else
{ /* need more input */
int offset = (int) ((grib_yy_c_buf_p) - (grib_yytext_ptr));
grib_yy_size_t offset = (grib_yy_c_buf_p) - (grib_yytext_ptr);
++(grib_yy_c_buf_p);
switch ( grib_yy_get_next_buffer( ) )
@ -2984,12 +2985,12 @@ YY_BUFFER_STATE grib_yy_scan_string (const char * grib_yystr )
*
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE grib_yy_scan_bytes (const char * grib_yybytes, int _grib_yybytes_len )
YY_BUFFER_STATE grib_yy_scan_bytes (const char * grib_yybytes, grib_yy_size_t _grib_yybytes_len )
{
YY_BUFFER_STATE b;
char *buf;
grib_yy_size_t n;
int i;
grib_yy_size_t i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = (grib_yy_size_t) (_grib_yybytes_len + 2);
@ -3031,7 +3032,7 @@ static void grib_yynoreturn grib_yy_fatal_error (const char* msg )
do \
{ \
/* Undo effects of setting up grib_yytext. */ \
int grib_yyless_macro_arg = (n); \
grib_yy_size_t grib_yyless_macro_arg = (n); \
YY_LESS_LINENO(grib_yyless_macro_arg);\
grib_yytext[grib_yyleng] = (grib_yy_hold_char); \
(grib_yy_c_buf_p) = grib_yytext + grib_yyless_macro_arg; \
@ -3071,7 +3072,7 @@ FILE *grib_yyget_out (void)
/** Get the length of the current token.
*
*/
int grib_yyget_leng (void)
grib_yy_size_t grib_yyget_leng (void)
{
return grib_yyleng;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
/* A Bison parser, made by GNU Bison 3.5.4. */
/* A Bison parser, made by GNU Bison 3.8.2. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
@ -16,7 +16,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@ -31,8 +31,9 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Undocumented macros, especially those whose name start with YY_,
are private implementation details. Do not rely on them. */
/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
especially those whose name start with YY_ or grib_yy_. They are
private implementation details that can be changed or removed. */
#ifndef YY_YY_Y_TAB_H_INCLUDED
# define YY_YY_Y_TAB_H_INCLUDED
@ -44,138 +45,147 @@
extern int grib_yydebug;
#endif
/* Token type. */
/* Token kinds. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum grib_yytokentype
{
LOWERCASE = 258,
IF = 259,
IF_TRANSIENT = 260,
ELSE = 261,
END = 262,
CLOSE = 263,
UNSIGNED = 264,
TEMPLATE = 265,
TEMPLATE_NOFAIL = 266,
TRIGGER = 267,
ASCII = 268,
GROUP = 269,
NON_ALPHA = 270,
KSEC1EXPVER = 271,
LABEL = 272,
LIST = 273,
IS_IN_LIST = 274,
IS_IN_DICT = 275,
IS_INTEGER = 276,
TO_INTEGER = 277,
TO_STRING = 278,
SEX2DEC = 279,
WHILE = 280,
IBMFLOAT = 281,
SIGNED = 282,
UINT8 = 283,
INT8 = 284,
UINT16 = 285,
INT16 = 286,
UINT16_LITTLE_ENDIAN = 287,
INT16_LITTLE_ENDIAN = 288,
UINT32 = 289,
INT32 = 290,
UINT32_LITTLE_ENDIAN = 291,
INT32_LITTLE_ENDIAN = 292,
UINT64 = 293,
INT64 = 294,
UINT64_LITTLE_ENDIAN = 295,
INT64_LITTLE_ENDIAN = 296,
BLOB = 297,
BYTE = 298,
CODETABLE = 299,
SMART_TABLE = 300,
DICTIONARY = 301,
COMPLEX_CODETABLE = 302,
LOOKUP = 303,
ALIAS = 304,
UNALIAS = 305,
META = 306,
POS = 307,
INTCONST = 308,
TRANS = 309,
FLAGBIT = 310,
CONCEPT = 311,
GETENV = 312,
HASH_ARRAY = 313,
CONCEPT_NOFAIL = 314,
NIL = 315,
DUMMY = 316,
MODIFY = 317,
READ_ONLY = 318,
STRING_TYPE = 319,
LONG_TYPE = 320,
DOUBLE_TYPE = 321,
NO_COPY = 322,
DUMP = 323,
JSON = 324,
XML = 325,
NO_FAIL = 326,
EDITION_SPECIFIC = 327,
OVERRIDE = 328,
HIDDEN = 329,
CAN_BE_MISSING = 330,
MISSING = 331,
CONSTRAINT = 332,
COPY_OK = 333,
WHEN = 334,
SET = 335,
SET_NOFAIL = 336,
WRITE = 337,
APPEND = 338,
PRINT = 339,
EXPORT = 340,
REMOVE = 341,
RENAME = 342,
SKIP = 343,
PAD = 344,
SECTION_PADDING = 345,
MESSAGE = 346,
MESSAGE_COPY = 347,
PADTO = 348,
PADTOEVEN = 349,
PADTOMULTIPLE = 350,
G1_HALF_BYTE = 351,
G1_MESSAGE_LENGTH = 352,
G1_SECTION4_LENGTH = 353,
SECTION_LENGTH = 354,
LENGTH = 355,
FLAG = 356,
ITERATOR = 357,
NEAREST = 358,
BOX = 359,
KSEC = 360,
ASSERT = 361,
SUBSTR = 362,
CASE = 363,
SWITCH = 364,
DEFAULT = 365,
EQ = 366,
NE = 367,
GE = 368,
LE = 369,
LT = 370,
GT = 371,
BIT = 372,
BITOFF = 373,
AND = 374,
OR = 375,
NOT = 376,
IS = 377,
IDENT = 378,
STRING = 379,
INTEGER = 380,
FLOAT = 381
YYEMPTY = -2,
YYEOF = 0, /* "end of file" */
YYerror = 256, /* error */
YYUNDEF = 257, /* "invalid token" */
LOWERCASE = 258, /* LOWERCASE */
IF = 259, /* IF */
IF_TRANSIENT = 260, /* IF_TRANSIENT */
ELSE = 261, /* ELSE */
END = 262, /* END */
CLOSE = 263, /* CLOSE */
UNSIGNED = 264, /* UNSIGNED */
TEMPLATE = 265, /* TEMPLATE */
TEMPLATE_NOFAIL = 266, /* TEMPLATE_NOFAIL */
TRIGGER = 267, /* TRIGGER */
ASCII = 268, /* ASCII */
GROUP = 269, /* GROUP */
NON_ALPHA = 270, /* NON_ALPHA */
KSEC1EXPVER = 271, /* KSEC1EXPVER */
LABEL = 272, /* LABEL */
LIST = 273, /* LIST */
IS_IN_LIST = 274, /* IS_IN_LIST */
IS_IN_DICT = 275, /* IS_IN_DICT */
IS_INTEGER = 276, /* IS_INTEGER */
TO_INTEGER = 277, /* TO_INTEGER */
TO_STRING = 278, /* TO_STRING */
SEX2DEC = 279, /* SEX2DEC */
WHILE = 280, /* WHILE */
IBMFLOAT = 281, /* IBMFLOAT */
SIGNED = 282, /* SIGNED */
UINT8 = 283, /* UINT8 */
INT8 = 284, /* INT8 */
UINT16 = 285, /* UINT16 */
INT16 = 286, /* INT16 */
UINT16_LITTLE_ENDIAN = 287, /* UINT16_LITTLE_ENDIAN */
INT16_LITTLE_ENDIAN = 288, /* INT16_LITTLE_ENDIAN */
UINT32 = 289, /* UINT32 */
INT32 = 290, /* INT32 */
UINT32_LITTLE_ENDIAN = 291, /* UINT32_LITTLE_ENDIAN */
INT32_LITTLE_ENDIAN = 292, /* INT32_LITTLE_ENDIAN */
UINT64 = 293, /* UINT64 */
INT64 = 294, /* INT64 */
UINT64_LITTLE_ENDIAN = 295, /* UINT64_LITTLE_ENDIAN */
INT64_LITTLE_ENDIAN = 296, /* INT64_LITTLE_ENDIAN */
BLOB = 297, /* BLOB */
BYTE = 298, /* BYTE */
CODETABLE = 299, /* CODETABLE */
SMART_TABLE = 300, /* SMART_TABLE */
DICTIONARY = 301, /* DICTIONARY */
COMPLEX_CODETABLE = 302, /* COMPLEX_CODETABLE */
LOOKUP = 303, /* LOOKUP */
ALIAS = 304, /* ALIAS */
UNALIAS = 305, /* UNALIAS */
META = 306, /* META */
POS = 307, /* POS */
INTCONST = 308, /* INTCONST */
TRANS = 309, /* TRANS */
FLAGBIT = 310, /* FLAGBIT */
CONCEPT = 311, /* CONCEPT */
GETENV = 312, /* GETENV */
HASH_ARRAY = 313, /* HASH_ARRAY */
CONCEPT_NOFAIL = 314, /* CONCEPT_NOFAIL */
NIL = 315, /* NIL */
DUMMY = 316, /* DUMMY */
MODIFY = 317, /* MODIFY */
READ_ONLY = 318, /* READ_ONLY */
STRING_TYPE = 319, /* STRING_TYPE */
LONG_TYPE = 320, /* LONG_TYPE */
DOUBLE_TYPE = 321, /* DOUBLE_TYPE */
NO_COPY = 322, /* NO_COPY */
DUMP = 323, /* DUMP */
JSON = 324, /* JSON */
XML = 325, /* XML */
NO_FAIL = 326, /* NO_FAIL */
EDITION_SPECIFIC = 327, /* EDITION_SPECIFIC */
OVERRIDE = 328, /* OVERRIDE */
HIDDEN = 329, /* HIDDEN */
CAN_BE_MISSING = 330, /* CAN_BE_MISSING */
MISSING = 331, /* MISSING */
CONSTRAINT = 332, /* CONSTRAINT */
COPY_OK = 333, /* COPY_OK */
WHEN = 334, /* WHEN */
SET = 335, /* SET */
SET_NOFAIL = 336, /* SET_NOFAIL */
WRITE = 337, /* WRITE */
APPEND = 338, /* APPEND */
PRINT = 339, /* PRINT */
EXPORT = 340, /* EXPORT */
REMOVE = 341, /* REMOVE */
RENAME = 342, /* RENAME */
SKIP = 343, /* SKIP */
PAD = 344, /* PAD */
SECTION_PADDING = 345, /* SECTION_PADDING */
MESSAGE = 346, /* MESSAGE */
MESSAGE_COPY = 347, /* MESSAGE_COPY */
PADTO = 348, /* PADTO */
PADTOEVEN = 349, /* PADTOEVEN */
PADTOMULTIPLE = 350, /* PADTOMULTIPLE */
G1_HALF_BYTE = 351, /* G1_HALF_BYTE */
G1_MESSAGE_LENGTH = 352, /* G1_MESSAGE_LENGTH */
G1_SECTION4_LENGTH = 353, /* G1_SECTION4_LENGTH */
SECTION_LENGTH = 354, /* SECTION_LENGTH */
LENGTH = 355, /* LENGTH */
FLAG = 356, /* FLAG */
ITERATOR = 357, /* ITERATOR */
NEAREST = 358, /* NEAREST */
BOX = 359, /* BOX */
KSEC = 360, /* KSEC */
ASSERT = 361, /* ASSERT */
SUBSTR = 362, /* SUBSTR */
CASE = 363, /* CASE */
SWITCH = 364, /* SWITCH */
DEFAULT = 365, /* DEFAULT */
EQ = 366, /* EQ */
NE = 367, /* NE */
GE = 368, /* GE */
LE = 369, /* LE */
LT = 370, /* LT */
GT = 371, /* GT */
BIT = 372, /* BIT */
BITOFF = 373, /* BITOFF */
AND = 374, /* AND */
OR = 375, /* OR */
NOT = 376, /* NOT */
IS = 377, /* IS */
IDENT = 378, /* IDENT */
STRING = 379, /* STRING */
INTEGER = 380, /* INTEGER */
FLOAT = 381 /* FLOAT */
};
typedef enum grib_yytokentype grib_yytoken_kind_t;
#endif
/* Tokens. */
/* Token kinds. */
#define YYEMPTY -2
#define YYEOF 0
#define YYerror 256
#define YYUNDEF 257
#define LOWERCASE 258
#define IF 259
#define IF_TRANSIENT 260
@ -319,11 +329,11 @@ union YYSTYPE
grib_concept_condition *concept_condition;
grib_concept_value *concept_value;
grib_hash_array_value *hash_array_value;
grib_case *case_value;
grib_case *case_value;
grib_rule *rules;
grib_rule_entry *rule_entry;
#line 327 "y.tab.h"
#line 337 "y.tab.h"
};
typedef union YYSTYPE YYSTYPE;
@ -334,6 +344,8 @@ typedef union YYSTYPE YYSTYPE;
extern YYSTYPE grib_yylval;
int grib_yyparse (void);
#endif /* !YY_YY_Y_TAB_H_INCLUDED */