diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-04-01 13:50:15 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-04-01 13:50:15 (GMT) |
commit | 43ad413390820e78c0240cd5c1a61fae11336618 (patch) | |
tree | 3960612dc3a982c45233f386baf9dfcc9358edff /hl | |
parent | e629c5c6168ff4959baf0fd8b730aa0d8d9c97b5 (diff) | |
download | hdf5-43ad413390820e78c0240cd5c1a61fae11336618.zip hdf5-43ad413390820e78c0240cd5c1a61fae11336618.tar.gz hdf5-43ad413390820e78c0240cd5c1a61fae11336618.tar.bz2 |
Update LT files
Diffstat (limited to 'hl')
-rw-r--r-- | hl/src/H5LTanalyze.c | 154 | ||||
-rw-r--r-- | hl/src/H5LTanalyze.l | 11 | ||||
-rw-r--r-- | hl/src/H5LTparse.c | 181 | ||||
-rw-r--r-- | hl/src/H5LTparse.h | 2 | ||||
-rw-r--r-- | hl/src/H5LTparse.y | 19 |
5 files changed, 206 insertions, 161 deletions
diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c index e49795a..85f499b 100644 --- a/hl/src/H5LTanalyze.c +++ b/hl/src/H5LTanalyze.c @@ -876,12 +876,22 @@ char *H5LTyytext; * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#line 15 "H5LTanalyze.l" +/* NOTE! + * + * If you make any changes to H5LTanalyze.l, please run bin/genparser to + * recreate the output files. + */ +#line 21 "H5LTanalyze.l" #include <stdlib.h> #include <string.h> #include <hdf5.h> #include "H5LTparse.h" +/* Turn off suggest const attribute warning in gcc */ +#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2 +#pragma GCC diagnostic ignored "-Wsuggest-attribute=const" +#endif + int my_yyinput(char *, int); #undef YY_INPUT #define YY_INPUT(b, r, ms) (r=my_yyinput(b, ms)) @@ -930,7 +940,7 @@ extern hbool_t is_opq_tag; hbool_t first_quote = 1; -#line 915 "H5LTanalyze.c" +#line 925 "H5LTanalyze.c" #define INITIAL 0 #define TAG_STRING 1 @@ -1105,10 +1115,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 71 "H5LTanalyze.l" +#line 82 "H5LTanalyze.l" -#line 1093 "H5LTanalyze.c" +#line 1103 "H5LTanalyze.c" if ( !(yy_init) ) { @@ -1202,277 +1212,277 @@ do_action: /* This label is used only to access EOF actions. */ { /* beginning of action switch */ case 1: YY_RULE_SETUP -#line 73 "H5LTanalyze.l" +#line 84 "H5LTanalyze.l" {return hid(H5T_STD_I8BE_TOKEN);} YY_BREAK case 2: YY_RULE_SETUP -#line 74 "H5LTanalyze.l" +#line 85 "H5LTanalyze.l" {return hid(H5T_STD_I8LE_TOKEN);} YY_BREAK case 3: YY_RULE_SETUP -#line 75 "H5LTanalyze.l" +#line 86 "H5LTanalyze.l" {return hid(H5T_STD_I16BE_TOKEN);} YY_BREAK case 4: YY_RULE_SETUP -#line 76 "H5LTanalyze.l" +#line 87 "H5LTanalyze.l" {return hid(H5T_STD_I16LE_TOKEN);} YY_BREAK case 5: YY_RULE_SETUP -#line 77 "H5LTanalyze.l" +#line 88 "H5LTanalyze.l" {return hid(H5T_STD_I32BE_TOKEN);} YY_BREAK case 6: YY_RULE_SETUP -#line 78 "H5LTanalyze.l" +#line 89 "H5LTanalyze.l" {return hid(H5T_STD_I32LE_TOKEN);} YY_BREAK case 7: YY_RULE_SETUP -#line 79 "H5LTanalyze.l" +#line 90 "H5LTanalyze.l" {return hid(H5T_STD_I64BE_TOKEN);} YY_BREAK case 8: YY_RULE_SETUP -#line 80 "H5LTanalyze.l" +#line 91 "H5LTanalyze.l" {return hid(H5T_STD_I64LE_TOKEN);} YY_BREAK case 9: YY_RULE_SETUP -#line 82 "H5LTanalyze.l" +#line 93 "H5LTanalyze.l" {return hid(H5T_STD_U8BE_TOKEN);} YY_BREAK case 10: YY_RULE_SETUP -#line 83 "H5LTanalyze.l" +#line 94 "H5LTanalyze.l" {return hid(H5T_STD_U8LE_TOKEN);} YY_BREAK case 11: YY_RULE_SETUP -#line 84 "H5LTanalyze.l" +#line 95 "H5LTanalyze.l" {return hid(H5T_STD_U16BE_TOKEN);} YY_BREAK case 12: YY_RULE_SETUP -#line 85 "H5LTanalyze.l" +#line 96 "H5LTanalyze.l" {return hid(H5T_STD_U16LE_TOKEN);} YY_BREAK case 13: YY_RULE_SETUP -#line 86 "H5LTanalyze.l" +#line 97 "H5LTanalyze.l" {return hid(H5T_STD_U32BE_TOKEN);} YY_BREAK case 14: YY_RULE_SETUP -#line 87 "H5LTanalyze.l" +#line 98 "H5LTanalyze.l" {return hid(H5T_STD_U32LE_TOKEN);} YY_BREAK case 15: YY_RULE_SETUP -#line 88 "H5LTanalyze.l" +#line 99 "H5LTanalyze.l" {return hid(H5T_STD_U64BE_TOKEN);} YY_BREAK case 16: YY_RULE_SETUP -#line 89 "H5LTanalyze.l" +#line 100 "H5LTanalyze.l" {return hid(H5T_STD_U64LE_TOKEN);} YY_BREAK case 17: YY_RULE_SETUP -#line 91 "H5LTanalyze.l" +#line 102 "H5LTanalyze.l" {return hid(H5T_NATIVE_CHAR_TOKEN);} YY_BREAK case 18: YY_RULE_SETUP -#line 92 "H5LTanalyze.l" +#line 103 "H5LTanalyze.l" {return hid(H5T_NATIVE_SCHAR_TOKEN);} YY_BREAK case 19: YY_RULE_SETUP -#line 93 "H5LTanalyze.l" +#line 104 "H5LTanalyze.l" {return hid(H5T_NATIVE_UCHAR_TOKEN);} YY_BREAK case 20: YY_RULE_SETUP -#line 94 "H5LTanalyze.l" +#line 105 "H5LTanalyze.l" {return hid(H5T_NATIVE_SHORT_TOKEN);} YY_BREAK case 21: YY_RULE_SETUP -#line 95 "H5LTanalyze.l" +#line 106 "H5LTanalyze.l" {return hid(H5T_NATIVE_USHORT_TOKEN);} YY_BREAK case 22: YY_RULE_SETUP -#line 96 "H5LTanalyze.l" +#line 107 "H5LTanalyze.l" {return hid(H5T_NATIVE_INT_TOKEN);} YY_BREAK case 23: YY_RULE_SETUP -#line 97 "H5LTanalyze.l" +#line 108 "H5LTanalyze.l" {return hid(H5T_NATIVE_UINT_TOKEN);} YY_BREAK case 24: YY_RULE_SETUP -#line 98 "H5LTanalyze.l" +#line 109 "H5LTanalyze.l" {return hid(H5T_NATIVE_LONG_TOKEN);} YY_BREAK case 25: YY_RULE_SETUP -#line 99 "H5LTanalyze.l" +#line 110 "H5LTanalyze.l" {return hid(H5T_NATIVE_ULONG_TOKEN);} YY_BREAK case 26: YY_RULE_SETUP -#line 100 "H5LTanalyze.l" +#line 111 "H5LTanalyze.l" {return hid(H5T_NATIVE_LLONG_TOKEN);} YY_BREAK case 27: YY_RULE_SETUP -#line 101 "H5LTanalyze.l" +#line 112 "H5LTanalyze.l" {return hid(H5T_NATIVE_ULLONG_TOKEN);} YY_BREAK case 28: YY_RULE_SETUP -#line 103 "H5LTanalyze.l" +#line 114 "H5LTanalyze.l" {return hid(H5T_IEEE_F32BE_TOKEN);} YY_BREAK case 29: YY_RULE_SETUP -#line 104 "H5LTanalyze.l" +#line 115 "H5LTanalyze.l" {return hid(H5T_IEEE_F32LE_TOKEN);} YY_BREAK case 30: YY_RULE_SETUP -#line 105 "H5LTanalyze.l" +#line 116 "H5LTanalyze.l" {return hid(H5T_IEEE_F64BE_TOKEN);} YY_BREAK case 31: YY_RULE_SETUP -#line 106 "H5LTanalyze.l" +#line 117 "H5LTanalyze.l" {return hid(H5T_IEEE_F64LE_TOKEN);} YY_BREAK case 32: YY_RULE_SETUP -#line 107 "H5LTanalyze.l" +#line 118 "H5LTanalyze.l" {return hid(H5T_NATIVE_FLOAT_TOKEN);} YY_BREAK case 33: YY_RULE_SETUP -#line 108 "H5LTanalyze.l" +#line 119 "H5LTanalyze.l" {return hid(H5T_NATIVE_DOUBLE_TOKEN);} YY_BREAK case 34: YY_RULE_SETUP -#line 109 "H5LTanalyze.l" +#line 120 "H5LTanalyze.l" {return hid(H5T_NATIVE_LDOUBLE_TOKEN);} YY_BREAK case 35: YY_RULE_SETUP -#line 111 "H5LTanalyze.l" +#line 122 "H5LTanalyze.l" {return token(H5T_STRING_TOKEN);} YY_BREAK case 36: YY_RULE_SETUP -#line 112 "H5LTanalyze.l" +#line 123 "H5LTanalyze.l" {return token(STRSIZE_TOKEN);} YY_BREAK case 37: YY_RULE_SETUP -#line 113 "H5LTanalyze.l" +#line 124 "H5LTanalyze.l" {return token(STRPAD_TOKEN);} YY_BREAK case 38: YY_RULE_SETUP -#line 114 "H5LTanalyze.l" +#line 125 "H5LTanalyze.l" {return token(CSET_TOKEN);} YY_BREAK case 39: YY_RULE_SETUP -#line 115 "H5LTanalyze.l" +#line 126 "H5LTanalyze.l" {return token(CTYPE_TOKEN);} YY_BREAK case 40: YY_RULE_SETUP -#line 116 "H5LTanalyze.l" +#line 127 "H5LTanalyze.l" {return token(H5T_STR_NULLTERM_TOKEN);} YY_BREAK case 41: YY_RULE_SETUP -#line 117 "H5LTanalyze.l" +#line 128 "H5LTanalyze.l" {return token(H5T_STR_NULLPAD_TOKEN);} YY_BREAK case 42: YY_RULE_SETUP -#line 118 "H5LTanalyze.l" +#line 129 "H5LTanalyze.l" {return token(H5T_STR_SPACEPAD_TOKEN);} YY_BREAK case 43: YY_RULE_SETUP -#line 119 "H5LTanalyze.l" +#line 130 "H5LTanalyze.l" {return token(H5T_CSET_ASCII_TOKEN);} YY_BREAK case 44: YY_RULE_SETUP -#line 120 "H5LTanalyze.l" +#line 131 "H5LTanalyze.l" {return token(H5T_CSET_UTF8_TOKEN);} YY_BREAK case 45: YY_RULE_SETUP -#line 121 "H5LTanalyze.l" +#line 132 "H5LTanalyze.l" {return token(H5T_C_S1_TOKEN);} YY_BREAK case 46: YY_RULE_SETUP -#line 122 "H5LTanalyze.l" +#line 133 "H5LTanalyze.l" {return token(H5T_FORTRAN_S1_TOKEN);} YY_BREAK case 47: YY_RULE_SETUP -#line 123 "H5LTanalyze.l" +#line 134 "H5LTanalyze.l" {return token(H5T_VARIABLE_TOKEN);} YY_BREAK case 48: YY_RULE_SETUP -#line 125 "H5LTanalyze.l" +#line 136 "H5LTanalyze.l" {return token(H5T_COMPOUND_TOKEN);} YY_BREAK case 49: YY_RULE_SETUP -#line 126 "H5LTanalyze.l" +#line 137 "H5LTanalyze.l" {return token(H5T_ENUM_TOKEN);} YY_BREAK case 50: YY_RULE_SETUP -#line 127 "H5LTanalyze.l" +#line 138 "H5LTanalyze.l" {return token(H5T_ARRAY_TOKEN);} YY_BREAK case 51: YY_RULE_SETUP -#line 128 "H5LTanalyze.l" +#line 139 "H5LTanalyze.l" {return token(H5T_VLEN_TOKEN);} YY_BREAK case 52: YY_RULE_SETUP -#line 130 "H5LTanalyze.l" +#line 141 "H5LTanalyze.l" {return token(H5T_OPAQUE_TOKEN);} YY_BREAK case 53: YY_RULE_SETUP -#line 131 "H5LTanalyze.l" +#line 142 "H5LTanalyze.l" {return token(OPQ_SIZE_TOKEN);} YY_BREAK case 54: YY_RULE_SETUP -#line 132 "H5LTanalyze.l" +#line 143 "H5LTanalyze.l" {return token(OPQ_TAG_TOKEN);} YY_BREAK case 55: YY_RULE_SETUP -#line 134 "H5LTanalyze.l" +#line 145 "H5LTanalyze.l" { if( is_str_size || (is_enum && is_enum_memb) || is_opq_size || (asindex>-1 && arr_stack[asindex].is_dim) || @@ -1485,7 +1495,7 @@ YY_RULE_SETUP YY_BREAK case 56: YY_RULE_SETUP -#line 144 "H5LTanalyze.l" +#line 155 "H5LTanalyze.l" { /*if it's first quote, and is a compound field name or an enum symbol*/ if((is_opq_tag || is_enum || (csindex>-1 && cmpd_stack[csindex].is_field)) @@ -1500,7 +1510,7 @@ YY_RULE_SETUP case 57: /* rule 57 can match eol */ YY_RULE_SETUP -#line 154 "H5LTanalyze.l" +#line 165 "H5LTanalyze.l" { #ifdef H5_HAVE_WIN32_API H5LTyylval.sval = _strdup(H5LTyytext); @@ -1513,52 +1523,52 @@ YY_RULE_SETUP YY_BREAK case 58: YY_RULE_SETUP -#line 164 "H5LTanalyze.l" +#line 175 "H5LTanalyze.l" {return token('{');} YY_BREAK case 59: YY_RULE_SETUP -#line 165 "H5LTanalyze.l" +#line 176 "H5LTanalyze.l" {return token('}');} YY_BREAK case 60: YY_RULE_SETUP -#line 166 "H5LTanalyze.l" +#line 177 "H5LTanalyze.l" {return token('[');} YY_BREAK case 61: YY_RULE_SETUP -#line 167 "H5LTanalyze.l" +#line 178 "H5LTanalyze.l" {return token(']');} YY_BREAK case 62: YY_RULE_SETUP -#line 168 "H5LTanalyze.l" +#line 179 "H5LTanalyze.l" {return token(':');} YY_BREAK case 63: YY_RULE_SETUP -#line 169 "H5LTanalyze.l" +#line 180 "H5LTanalyze.l" {return token(';');} YY_BREAK case 64: /* rule 64 can match eol */ YY_RULE_SETUP -#line 170 "H5LTanalyze.l" +#line 181 "H5LTanalyze.l" ; YY_BREAK case 65: /* rule 65 can match eol */ YY_RULE_SETUP -#line 171 "H5LTanalyze.l" +#line 182 "H5LTanalyze.l" { return 0; } YY_BREAK case 66: YY_RULE_SETUP -#line 173 "H5LTanalyze.l" +#line 184 "H5LTanalyze.l" ECHO; YY_BREAK -#line 1543 "H5LTanalyze.c" +#line 1553 "H5LTanalyze.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(TAG_STRING): yyterminate(); @@ -2527,7 +2537,7 @@ void H5LTyyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 173 "H5LTanalyze.l" +#line 184 "H5LTanalyze.l" int my_yyinput(char *buf, int max_size) diff --git a/hl/src/H5LTanalyze.l b/hl/src/H5LTanalyze.l index 0470d9f..b9b492e 100644 --- a/hl/src/H5LTanalyze.l +++ b/hl/src/H5LTanalyze.l @@ -11,12 +11,23 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* NOTE! + * + * If you make any changes to H5LTanalyze.l, please run bin/genparser to + * recreate the output files. + */ + %{ #include <stdlib.h> #include <string.h> #include <hdf5.h> #include "H5LTparse.h" +/* Turn off suggest const attribute warning in gcc */ +#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2 +#pragma GCC diagnostic ignored "-Wsuggest-attribute=const" +#endif + int my_yyinput(char *, int); #undef YY_INPUT #define YY_INPUT(b, r, ms) (r=my_yyinput(b, ms)) diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 16a0bcf..b85f9a0 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -89,7 +89,7 @@ /* Copy the first part of user declarations. */ /* Line 371 of yacc.c */ -#line 14 "H5LTparse.y" +#line 20 "H5LTparse.y" #include <stdio.h> #include <string.h> @@ -243,7 +243,7 @@ extern int H5LTyydebug; typedef union YYSTYPE { /* Line 387 of yacc.c */ -#line 66 "H5LTparse.y" +#line 72 "H5LTparse.y" int ival; /*for integer token*/ char *sval; /*for name string*/ @@ -603,16 +603,16 @@ static const yytype_int8 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 99, 99, 100, 102, 103, 104, 105, 107, 108, - 109, 110, 111, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 143, 144, 145, 146, 147, 148, 149, 153, 152, 161, - 162, 164, 164, 198, 204, 205, 208, 210, 210, 219, - 220, 222, 223, 222, 230, 233, 239, 240, 245, 246, - 237, 252, 254, 258, 259, 267, 276, 283, 256, 307, - 308, 310, 311, 312, 314, 315, 317, 318, 322, 321, - 326, 327, 329, 329, 381, 383 + 0, 105, 105, 106, 108, 109, 110, 111, 113, 114, + 115, 116, 117, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 149, 150, 151, 152, 153, 154, 155, 159, 158, 167, + 168, 170, 170, 207, 215, 216, 219, 221, 221, 230, + 231, 233, 234, 233, 241, 244, 250, 251, 256, 257, + 248, 265, 267, 271, 272, 280, 289, 296, 269, 320, + 321, 323, 324, 325, 327, 328, 330, 331, 335, 334, + 339, 340, 342, 342, 396, 398 }; #endif @@ -1642,229 +1642,229 @@ yyreduce: { case 2: /* Line 1792 of yacc.c */ -#line 99 "H5LTparse.y" +#line 105 "H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } break; case 3: /* Line 1792 of yacc.c */ -#line 100 "H5LTparse.y" +#line 106 "H5LTparse.y" { return (yyval.hid);} break; case 13: /* Line 1792 of yacc.c */ -#line 114 "H5LTparse.y" +#line 120 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } break; case 14: /* Line 1792 of yacc.c */ -#line 115 "H5LTparse.y" +#line 121 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } break; case 15: /* Line 1792 of yacc.c */ -#line 116 "H5LTparse.y" +#line 122 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } break; case 16: /* Line 1792 of yacc.c */ -#line 117 "H5LTparse.y" +#line 123 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } break; case 17: /* Line 1792 of yacc.c */ -#line 118 "H5LTparse.y" +#line 124 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } break; case 18: /* Line 1792 of yacc.c */ -#line 119 "H5LTparse.y" +#line 125 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } break; case 19: /* Line 1792 of yacc.c */ -#line 120 "H5LTparse.y" +#line 126 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } break; case 20: /* Line 1792 of yacc.c */ -#line 121 "H5LTparse.y" +#line 127 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } break; case 21: /* Line 1792 of yacc.c */ -#line 122 "H5LTparse.y" +#line 128 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } break; case 22: /* Line 1792 of yacc.c */ -#line 123 "H5LTparse.y" +#line 129 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } break; case 23: /* Line 1792 of yacc.c */ -#line 124 "H5LTparse.y" +#line 130 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } break; case 24: /* Line 1792 of yacc.c */ -#line 125 "H5LTparse.y" +#line 131 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } break; case 25: /* Line 1792 of yacc.c */ -#line 126 "H5LTparse.y" +#line 132 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } break; case 26: /* Line 1792 of yacc.c */ -#line 127 "H5LTparse.y" +#line 133 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } break; case 27: /* Line 1792 of yacc.c */ -#line 128 "H5LTparse.y" +#line 134 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } break; case 28: /* Line 1792 of yacc.c */ -#line 129 "H5LTparse.y" +#line 135 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } break; case 29: /* Line 1792 of yacc.c */ -#line 130 "H5LTparse.y" +#line 136 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } break; case 30: /* Line 1792 of yacc.c */ -#line 131 "H5LTparse.y" +#line 137 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } break; case 31: /* Line 1792 of yacc.c */ -#line 132 "H5LTparse.y" +#line 138 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } break; case 32: /* Line 1792 of yacc.c */ -#line 133 "H5LTparse.y" +#line 139 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } break; case 33: /* Line 1792 of yacc.c */ -#line 134 "H5LTparse.y" +#line 140 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } break; case 34: /* Line 1792 of yacc.c */ -#line 135 "H5LTparse.y" +#line 141 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } break; case 35: /* Line 1792 of yacc.c */ -#line 136 "H5LTparse.y" +#line 142 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } break; case 36: /* Line 1792 of yacc.c */ -#line 137 "H5LTparse.y" +#line 143 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } break; case 37: /* Line 1792 of yacc.c */ -#line 138 "H5LTparse.y" +#line 144 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } break; case 38: /* Line 1792 of yacc.c */ -#line 139 "H5LTparse.y" +#line 145 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } break; case 39: /* Line 1792 of yacc.c */ -#line 140 "H5LTparse.y" +#line 146 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } break; case 40: /* Line 1792 of yacc.c */ -#line 143 "H5LTparse.y" +#line 149 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } break; case 41: /* Line 1792 of yacc.c */ -#line 144 "H5LTparse.y" +#line 150 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } break; case 42: /* Line 1792 of yacc.c */ -#line 145 "H5LTparse.y" +#line 151 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } break; case 43: /* Line 1792 of yacc.c */ -#line 146 "H5LTparse.y" +#line 152 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } break; case 44: /* Line 1792 of yacc.c */ -#line 147 "H5LTparse.y" +#line 153 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } break; case 45: /* Line 1792 of yacc.c */ -#line 148 "H5LTparse.y" +#line 154 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } break; case 46: /* Line 1792 of yacc.c */ -#line 149 "H5LTparse.y" +#line 155 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } break; case 47: /* Line 1792 of yacc.c */ -#line 153 "H5LTparse.y" +#line 159 "H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } break; case 48: /* Line 1792 of yacc.c */ -#line 155 "H5LTparse.y" +#line 161 "H5LTparse.y" { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; cmpd_stack[csindex].first_memb = 1; @@ -1874,13 +1874,13 @@ yyreduce: case 51: /* Line 1792 of yacc.c */ -#line 164 "H5LTparse.y" +#line 170 "H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } break; case 52: /* Line 1792 of yacc.c */ -#line 166 "H5LTparse.y" +#line 172 "H5LTparse.y" { size_t origin_size, new_size; hid_t dtype_id = cmpd_stack[csindex].id; @@ -1906,7 +1906,10 @@ yyreduce: H5Tinsert(dtype_id, (yyvsp[(4) - (7)].sval), (yyvsp[(6) - (7)].ival), (yyvsp[(1) - (7)].hid)); } } - + if((yyvsp[(4) - (7)].sval)) { + free((yyvsp[(4) - (7)].sval)); + (yyvsp[(4) - (7)].sval) = NULL; + } cmpd_stack[csindex].is_field = 0; H5Tclose((yyvsp[(1) - (7)].hid)); @@ -1916,33 +1919,35 @@ yyreduce: case 53: /* Line 1792 of yacc.c */ -#line 199 "H5LTparse.y" +#line 208 "H5LTparse.y" { - (yyval.sval) = yylval.sval; + (yyval.sval) = strdup(yylval.sval); + free(yylval.sval); + yylval.sval = NULL; } break; case 54: /* Line 1792 of yacc.c */ -#line 204 "H5LTparse.y" +#line 215 "H5LTparse.y" { (yyval.ival) = 0; } break; case 55: /* Line 1792 of yacc.c */ -#line 206 "H5LTparse.y" +#line 217 "H5LTparse.y" { (yyval.ival) = yylval.ival; } break; case 57: /* Line 1792 of yacc.c */ -#line 210 "H5LTparse.y" +#line 221 "H5LTparse.y" { asindex++; /*pushd onto the stack*/ } break; case 58: /* Line 1792 of yacc.c */ -#line 212 "H5LTparse.y" +#line 223 "H5LTparse.y" { (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); arr_stack[asindex].ndims = 0; @@ -1953,13 +1958,13 @@ yyreduce: case 61: /* Line 1792 of yacc.c */ -#line 222 "H5LTparse.y" +#line 233 "H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } break; case 62: /* Line 1792 of yacc.c */ -#line 223 "H5LTparse.y" +#line 234 "H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; arr_stack[asindex].ndims++; @@ -1969,19 +1974,19 @@ yyreduce: case 65: /* Line 1792 of yacc.c */ -#line 234 "H5LTparse.y" +#line 245 "H5LTparse.y" { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 66: /* Line 1792 of yacc.c */ -#line 239 "H5LTparse.y" +#line 250 "H5LTparse.y" { is_opq_size = 1; } break; case 67: /* Line 1792 of yacc.c */ -#line 240 "H5LTparse.y" +#line 251 "H5LTparse.y" { size_t size = (size_t)yylval.ival; (yyval.hid) = H5Tcreate(H5T_OPAQUE, size); @@ -1991,34 +1996,36 @@ yyreduce: case 68: /* Line 1792 of yacc.c */ -#line 245 "H5LTparse.y" +#line 256 "H5LTparse.y" { is_opq_tag = 1; } break; case 69: /* Line 1792 of yacc.c */ -#line 246 "H5LTparse.y" +#line 257 "H5LTparse.y" { H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); + free(yylval.sval); + yylval.sval = NULL; is_opq_tag = 0; } break; case 70: /* Line 1792 of yacc.c */ -#line 250 "H5LTparse.y" +#line 263 "H5LTparse.y" { (yyval.hid) = (yyvsp[(7) - (15)].hid); } break; case 73: /* Line 1792 of yacc.c */ -#line 258 "H5LTparse.y" +#line 271 "H5LTparse.y" { is_str_size = 1; } break; case 74: /* Line 1792 of yacc.c */ -#line 259 "H5LTparse.y" +#line 272 "H5LTparse.y" { if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) is_variable = 1; @@ -2030,7 +2037,7 @@ yyreduce: case 75: /* Line 1792 of yacc.c */ -#line 267 "H5LTparse.y" +#line 280 "H5LTparse.y" { if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) str_pad = H5T_STR_NULLTERM; @@ -2043,7 +2050,7 @@ yyreduce: case 76: /* Line 1792 of yacc.c */ -#line 276 "H5LTparse.y" +#line 289 "H5LTparse.y" { if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) str_cset = H5T_CSET_ASCII; @@ -2054,7 +2061,7 @@ yyreduce: case 77: /* Line 1792 of yacc.c */ -#line 283 "H5LTparse.y" +#line 296 "H5LTparse.y" { if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) (yyval.hid) = H5Tcopy(H5T_C_S1); @@ -2065,7 +2072,7 @@ yyreduce: case 78: /* Line 1792 of yacc.c */ -#line 290 "H5LTparse.y" +#line 303 "H5LTparse.y" { hid_t str_id = (yyvsp[(19) - (20)].hid); @@ -2086,67 +2093,67 @@ yyreduce: case 79: /* Line 1792 of yacc.c */ -#line 307 "H5LTparse.y" +#line 320 "H5LTparse.y" {(yyval.ival) = H5T_VARIABLE_TOKEN;} break; case 81: /* Line 1792 of yacc.c */ -#line 310 "H5LTparse.y" +#line 323 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} break; case 82: /* Line 1792 of yacc.c */ -#line 311 "H5LTparse.y" +#line 324 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} break; case 83: /* Line 1792 of yacc.c */ -#line 312 "H5LTparse.y" +#line 325 "H5LTparse.y" {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} break; case 84: /* Line 1792 of yacc.c */ -#line 314 "H5LTparse.y" +#line 327 "H5LTparse.y" {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} break; case 85: /* Line 1792 of yacc.c */ -#line 315 "H5LTparse.y" +#line 328 "H5LTparse.y" {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} break; case 86: /* Line 1792 of yacc.c */ -#line 317 "H5LTparse.y" +#line 330 "H5LTparse.y" {(yyval.hid) = H5T_C_S1_TOKEN;} break; case 87: /* Line 1792 of yacc.c */ -#line 318 "H5LTparse.y" +#line 331 "H5LTparse.y" {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} break; case 88: /* Line 1792 of yacc.c */ -#line 322 "H5LTparse.y" +#line 335 "H5LTparse.y" { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 89: /* Line 1792 of yacc.c */ -#line 324 "H5LTparse.y" +#line 337 "H5LTparse.y" { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } break; case 92: /* Line 1792 of yacc.c */ -#line 329 "H5LTparse.y" +#line 342 "H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ #ifdef H5_HAVE_WIN32_API @@ -2154,12 +2161,14 @@ yyreduce: #else /* H5_HAVE_WIN32_API */ enum_memb_symbol = strdup(yylval.sval); #endif /* H5_HAVE_WIN32_API */ + free(yylval.sval); + yylval.sval = NULL; } break; case 93: /* Line 1792 of yacc.c */ -#line 338 "H5LTparse.y" +#line 353 "H5LTparse.y" { char char_val=(char)yylval.ival; short short_val=(short)yylval.ival; @@ -2206,7 +2215,7 @@ yyreduce: /* Line 1792 of yacc.c */ -#line 2191 "H5LTparse.c" +#line 2200 "H5LTparse.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 7481a45..71e520d 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -110,7 +110,7 @@ extern int H5LTyydebug; typedef union YYSTYPE { /* Line 2058 of yacc.c */ -#line 66 "H5LTparse.y" +#line 72 "H5LTparse.y" int ival; /*for integer token*/ char *sval; /*for name string*/ diff --git a/hl/src/H5LTparse.y b/hl/src/H5LTparse.y index 0022174..66a8556 100644 --- a/hl/src/H5LTparse.y +++ b/hl/src/H5LTparse.y @@ -11,6 +11,12 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* NOTE! + * + * If you make any changes to H5LTparse.y, please run bin/genparser to + * recreate the output files. + */ + %{ #include <stdio.h> #include <string.h> @@ -188,7 +194,10 @@ memb_def : ddl_type { cmpd_stack[csindex].is_field = 1; /*notify le H5Tinsert(dtype_id, $<sval>4, $<ival>6, $<hid>1); } } - + if($<sval>4) { + free($<sval>4); + $<sval>4 = NULL; + } cmpd_stack[csindex].is_field = 0; H5Tclose($<hid>1); @@ -197,7 +206,9 @@ memb_def : ddl_type { cmpd_stack[csindex].is_field = 1; /*notify le ; field_name : STRING { - $<sval>$ = yylval.sval; + $<sval>$ = strdup(yylval.sval); + free(yylval.sval); + yylval.sval = NULL; } ; field_offset : /*empty*/ @@ -245,6 +256,8 @@ opaque_type : H5T_OPAQUE_TOKEN OPQ_TAG_TOKEN { is_opq_tag = 1; } '"' opaque_tag '"' ';' { H5Tset_tag($<hid>7, yylval.sval); + free(yylval.sval); + yylval.sval = NULL; is_opq_tag = 0; } '}' { $<hid>$ = $<hid>7; } @@ -333,6 +346,8 @@ enum_def : '"' enum_symbol '"' { #else /* H5_HAVE_WIN32_API */ enum_memb_symbol = strdup(yylval.sval); #endif /* H5_HAVE_WIN32_API */ + free(yylval.sval); + yylval.sval = NULL; } enum_val ';' { |