diff options
Diffstat (limited to 'hl/src/H5LTparse.c')
-rw-r--r-- | hl/src/H5LTparse.c | 252 |
1 files changed, 139 insertions, 113 deletions
diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 10c6bb2..b146046 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -13,12 +13,12 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* This file was generated by Yacc with the command "yacc -o H5LTparse.c -d H5LTparse.y" +/* This file was generated by Yacc with the command "yacc -pH5LTyy -o H5LTparse.c -d H5LTparse.y" * Do NOT modify it by hand. */ #ifndef lint -static char const +static char const yyrcsid[] = "$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.28 2000/01/17 02:04:06 bde Exp $"; #endif #include <stdlib.h> @@ -31,8 +31,34 @@ yyrcsid[] = "$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.28 2000/01/17 02:04:06 bd #define yyerrok (yyerrflag=0) #define YYRECOVERING() (yyerrflag!=0) static int yygrowstack(); -#define YYPREFIX "yy" -#line 16 "H5LTparse.y" +#define yyparse H5LTyyparse +#define yylex H5LTyylex +#define yyerror H5LTyyerror +#define yychar H5LTyychar +#define yyval H5LTyyval +#define yylval H5LTyylval +#define yydebug H5LTyydebug +#define yynerrs H5LTyynerrs +#define yyerrflag H5LTyyerrflag +#define yyss H5LTyyss +#define yyssp H5LTyyssp +#define yyvs H5LTyyvs +#define yyvsp H5LTyyvsp +#define yylhs H5LTyylhs +#define yylen H5LTyylen +#define yydefred H5LTyydefred +#define yydgoto H5LTyydgoto +#define yysindex H5LTyysindex +#define yyrindex H5LTyyrindex +#define yygindex H5LTyygindex +#define yytable H5LTyytable +#define yycheck H5LTyycheck +#define yyname H5LTyyname +#define yyrule H5LTyyrule +#define yysslim H5LTyysslim +#define yystacksize H5LTyystacksize +#define YYPREFIX "H5LTyy" +#line 17 "H5LTparse.y" #include<stdio.h> #include<string.h> #include<hdf5.h> @@ -66,7 +92,7 @@ struct arr_info { }; /*stack for nested array type*/ struct arr_info arr_stack[STACK_SIZE]; -int asindex = -1; /*pointer to the top of array stack*/ +int asindex = -1; /*pointer to the top of array stack*/ hbool_t is_str_size = 0; /*flag to lexer for string size*/ hbool_t is_str_pad = 0; /*flag to lexer for string padding*/ @@ -74,7 +100,7 @@ H5T_pad_t str_pad; /*variable for string padding*/ H5T_cset_t str_cset; /*variable for string character set*/ hbool_t is_variable = 0; /*variable for variable-length string*/ size_t str_size; /*variable for string size*/ - + hid_t enum_id; /*type ID*/ hbool_t is_enum = 0; /*flag to lexer for enum type*/ hbool_t is_enum_memb = 0; /*flag to lexer for enum member*/ @@ -83,12 +109,12 @@ char* enum_memb_symbol; /*enum member symbol string*/ hbool_t is_opq_size = 0; /*flag to lexer for opaque type size*/ hbool_t is_opq_tag = 0; /*flag to lexer for opaque type tag*/ -#line 67 "H5LTparse.y" +#line 68 "H5LTparse.y" typedef union { int ival; /*for integer token*/ char *sval; /*for name string*/ } YYSTYPE; -#line 73 "H5LTparse.c" +#line 99 "H5LTparse.c" #define YYERRCODE 256 #define H5T_STD_I8BE_TOKEN 257 #define H5T_STD_I8LE_TOKEN 258 @@ -146,7 +172,7 @@ typedef union { #define H5T_VLEN_TOKEN 310 #define STRING 311 #define NUMBER 312 -const short yylhs[] = { -1, +const short H5LTyylhs[] = { -1, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, @@ -158,7 +184,7 @@ const short yylhs[] = { -1, 33, 33, 35, 35, 37, 37, 40, 9, 39, 39, 44, 41, 42, 43, }; -const short yylen[] = { 2, +const short H5LTyylen[] = { 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -170,7 +196,7 @@ const short yylen[] = { 2, 1, 1, 1, 1, 1, 1, 0, 7, 0, 2, 0, 6, 1, 1, }; -const short yydefred[] = { 0, +const short H5LTyydefred[] = { 0, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, @@ -187,14 +213,14 @@ const short yydefred[] = { 0, 75, 0, 0, 69, 0, 85, 86, 0, 76, 0, 77, }; -const short yydgoto[] = { 41, +const short H5LTyydgoto[] = { 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 54, 66, 77, 84, 99, 114, 120, 56, 68, 81, 95, 86, 102, 74, 65, 89, 107, 118, 132, 72, 64, 88, 106, 116, 129, 133, 138, 140, 85, 78, 93, 101, 123, 115, }; -const short yysindex[] = { -255, +const short H5LTyysindex[] = { -255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -211,7 +237,7 @@ const short yysindex[] = { -255, 0, -7, -176, 0, -252, 0, 0, 61, 0, -4, 0, }; -const short yyrindex[] = { 122, +const short H5LTyyrindex[] = { 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -228,7 +254,7 @@ const short yyrindex[] = { 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; -const short yygindex[] = { 0, +const short H5LTyygindex[] = { 0, -20, 0, 0, 0, 0, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -236,7 +262,7 @@ const short yygindex[] = { 0, 0, 0, 0, 0, }; #define YYTABLESIZE 273 -const short yytable[] = { 79, +const short H5LTyytable[] = { 79, 92, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, @@ -266,7 +292,7 @@ const short yytable[] = { 79, 0, 0, 0, 0, 0, 0, 36, 0, 0, 37, 38, 39, 40, }; -const short yycheck[] = { 91, +const short H5LTyycheck[] = { 91, 34, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, @@ -302,7 +328,7 @@ const short yycheck[] = { 91, #endif #define YYMAXTOKEN 312 #if YYDEBUG -const char * const yyname[] = { +const char * const H5LTyyname[] = { "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, "'\"'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"':'","';'",0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'['",0,"']'",0,0,0,0,0,0,0,0,0, @@ -328,7 +354,7 @@ const char * const yyname[] = { "H5T_OPAQUE_TOKEN","OPQ_SIZE_TOKEN","OPQ_TAG_TOKEN","H5T_COMPOUND_TOKEN", "H5T_ENUM_TOKEN","H5T_ARRAY_TOKEN","H5T_VLEN_TOKEN","STRING","NUMBER", }; -const char * const yyrule[] = { +const char * const H5LTyyrule[] = { "$accept : start", "start :", "start : ddl_type", @@ -648,168 +674,168 @@ yyreduce: switch (yyn) { case 1: -#line 99 "H5LTparse.y" +#line 100 "H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } break; case 2: -#line 100 "H5LTparse.y" +#line 101 "H5LTparse.y" { return yyval.ival;} break; case 12: -#line 114 "H5LTparse.y" +#line 115 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_STD_I8BE); } break; case 13: -#line 115 "H5LTparse.y" +#line 116 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_STD_I8LE); } break; case 14: -#line 116 "H5LTparse.y" +#line 117 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_STD_I16BE); } break; case 15: -#line 117 "H5LTparse.y" +#line 118 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_STD_I16LE); } break; case 16: -#line 118 "H5LTparse.y" +#line 119 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_STD_I32BE); } break; case 17: -#line 119 "H5LTparse.y" +#line 120 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_STD_I32LE); } break; case 18: -#line 120 "H5LTparse.y" +#line 121 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_STD_I64BE); } break; case 19: -#line 121 "H5LTparse.y" +#line 122 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_STD_I64LE); } break; case 20: -#line 122 "H5LTparse.y" +#line 123 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_STD_U8BE); } break; case 21: -#line 123 "H5LTparse.y" +#line 124 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_STD_U8LE); } break; case 22: -#line 124 "H5LTparse.y" +#line 125 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_STD_U16BE); } break; case 23: -#line 125 "H5LTparse.y" +#line 126 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_STD_U16LE); } break; case 24: -#line 126 "H5LTparse.y" +#line 127 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_STD_U32BE); } break; case 25: -#line 127 "H5LTparse.y" +#line 128 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_STD_U32LE); } break; case 26: -#line 128 "H5LTparse.y" +#line 129 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_STD_U64BE); } break; case 27: -#line 129 "H5LTparse.y" +#line 130 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_STD_U64LE); } break; case 28: -#line 130 "H5LTparse.y" +#line 131 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_NATIVE_CHAR); } break; case 29: -#line 131 "H5LTparse.y" +#line 132 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_NATIVE_SCHAR); } break; case 30: -#line 132 "H5LTparse.y" +#line 133 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_NATIVE_UCHAR); } break; case 31: -#line 133 "H5LTparse.y" +#line 134 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_NATIVE_SHORT); } break; case 32: -#line 134 "H5LTparse.y" +#line 135 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_NATIVE_USHORT); } break; case 33: -#line 135 "H5LTparse.y" +#line 136 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_NATIVE_INT); } break; case 34: -#line 136 "H5LTparse.y" +#line 137 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_NATIVE_UINT); } break; case 35: -#line 137 "H5LTparse.y" +#line 138 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_NATIVE_LONG); } break; case 36: -#line 138 "H5LTparse.y" +#line 139 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_NATIVE_ULONG); } break; case 37: -#line 139 "H5LTparse.y" +#line 140 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_NATIVE_LLONG); } break; case 38: -#line 140 "H5LTparse.y" +#line 141 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_NATIVE_ULLONG); } break; case 39: -#line 143 "H5LTparse.y" +#line 144 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_IEEE_F32BE); } break; case 40: -#line 144 "H5LTparse.y" +#line 145 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_IEEE_F32LE); } break; case 41: -#line 145 "H5LTparse.y" +#line 146 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_IEEE_F64BE); } break; case 42: -#line 146 "H5LTparse.y" +#line 147 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_IEEE_F64LE); } break; case 43: -#line 147 "H5LTparse.y" +#line 148 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_NATIVE_FLOAT); } break; case 44: -#line 148 "H5LTparse.y" +#line 149 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_NATIVE_DOUBLE); } break; case 45: -#line 149 "H5LTparse.y" +#line 150 "H5LTparse.y" { yyval.ival = H5Tcopy(H5T_NATIVE_LDOUBLE); } break; case 46: -#line 153 "H5LTparse.y" +#line 154 "H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } break; case 47: -#line 155 "H5LTparse.y" -{ yyval.ival = cmpd_stack[csindex].id; +#line 156 "H5LTparse.y" +{ yyval.ival = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; - cmpd_stack[csindex].first_memb = 1; + cmpd_stack[csindex].first_memb = 1; csindex--; } break; case 50: -#line 164 "H5LTparse.y" +#line 165 "H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } break; case 51: -#line 166 "H5LTparse.y" -{ +#line 167 "H5LTparse.y" +{ size_t origin_size, new_size; hid_t dtype_id = cmpd_stack[csindex].id; @@ -823,7 +849,7 @@ case 51: cmpd_stack[csindex].first_memb = 0; } else { origin_size = H5Tget_size(dtype_id); - + if(yyvsp[-1].ival == 0) { new_size = origin_size + H5Tget_size(yyvsp[-6].ival); H5Tset_size(dtype_id, new_size); @@ -834,34 +860,34 @@ case 51: H5Tinsert(dtype_id, yyvsp[-3].sval, yyvsp[-1].ival, yyvsp[-6].ival); } } - + cmpd_stack[csindex].is_field = 0; H5Tclose(yyvsp[-6].ival); - + new_size = H5Tget_size(dtype_id); } break; case 52: -#line 199 "H5LTparse.y" +#line 200 "H5LTparse.y" { yyval.sval = yylval.sval; } break; case 53: -#line 204 "H5LTparse.y" +#line 205 "H5LTparse.y" { yyval.ival = 0; } break; case 54: -#line 206 "H5LTparse.y" +#line 207 "H5LTparse.y" { yyval.ival = yylval.ival; } break; case 56: -#line 210 "H5LTparse.y" +#line 211 "H5LTparse.y" { asindex++; /*pushd onto the stack*/ } break; case 57: -#line 212 "H5LTparse.y" -{ +#line 213 "H5LTparse.y" +{ yyval.ival = H5Tarray_create(yyvsp[-1].ival, arr_stack[asindex].ndims, arr_stack[asindex].dims, NULL); arr_stack[asindex].ndims = 0; asindex--; @@ -869,64 +895,64 @@ case 57: } break; case 60: -#line 222 "H5LTparse.y" +#line 223 "H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } break; case 61: -#line 223 "H5LTparse.y" +#line 224 "H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; - arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; + arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; arr_stack[asindex].ndims++; - arr_stack[asindex].is_dim = 0; + arr_stack[asindex].is_dim = 0; } break; case 64: -#line 234 "H5LTparse.y" +#line 235 "H5LTparse.y" { yyval.ival = H5Tvlen_create(yyvsp[-1].ival); H5Tclose(yyvsp[-1].ival); } break; case 65: -#line 239 "H5LTparse.y" +#line 240 "H5LTparse.y" { is_opq_size = 1; } break; case 66: -#line 240 "H5LTparse.y" -{ +#line 241 "H5LTparse.y" +{ size_t size = (size_t)yylval.ival; yyval.ival = H5Tcreate(H5T_OPAQUE, size); - is_opq_size = 0; + is_opq_size = 0; } break; case 67: -#line 245 "H5LTparse.y" +#line 246 "H5LTparse.y" { is_opq_tag = 1; } break; case 68: -#line 246 "H5LTparse.y" -{ +#line 247 "H5LTparse.y" +{ H5Tset_tag(yyvsp[-6].ival, yylval.sval); is_opq_tag = 0; } break; case 69: -#line 250 "H5LTparse.y" +#line 251 "H5LTparse.y" { yyval.ival = yyvsp[-8].ival; } break; case 72: -#line 258 "H5LTparse.y" +#line 259 "H5LTparse.y" { is_str_size = 1; } break; case 73: -#line 259 "H5LTparse.y" -{ +#line 260 "H5LTparse.y" +{ if(yyvsp[-1].ival == H5T_VARIABLE_TOKEN) is_variable = 1; - else + else str_size = yylval.ival; - is_str_size = 0; + is_str_size = 0; } break; case 74: -#line 267 "H5LTparse.y" +#line 268 "H5LTparse.y" { if(yyvsp[-1].ival == H5T_STR_NULLTERM_TOKEN) str_pad = H5T_STR_NULLTERM; @@ -937,8 +963,8 @@ case 74: } break; case 75: -#line 276 "H5LTparse.y" -{ +#line 277 "H5LTparse.y" +{ if(yyvsp[-1].ival == H5T_CSET_ASCII_TOKEN) str_cset = H5T_CSET_ASCII; else if(yyvsp[-1].ival == H5T_CSET_UTF8_TOKEN) @@ -946,7 +972,7 @@ case 75: } break; case 76: -#line 283 "H5LTparse.y" +#line 284 "H5LTparse.y" { if(yyvsp[-1].ival == H5T_C_S1_TOKEN) yyval.ival = H5Tcopy(H5T_C_S1); @@ -955,8 +981,8 @@ case 76: } break; case 77: -#line 290 "H5LTparse.y" -{ +#line 291 "H5LTparse.y" +{ hid_t str_id = yyvsp[-1].ival; /*set string size*/ @@ -965,63 +991,63 @@ case 77: is_variable = 0; } else H5Tset_size(str_id, str_size); - + /*set string padding and character set*/ H5Tset_strpad(str_id, str_pad); H5Tset_cset(str_id, str_cset); - yyval.ival = str_id; + yyval.ival = str_id; } break; case 78: -#line 307 "H5LTparse.y" +#line 308 "H5LTparse.y" {yyval.ival = H5T_VARIABLE_TOKEN;} break; case 80: -#line 310 "H5LTparse.y" +#line 311 "H5LTparse.y" {yyval.ival = H5T_STR_NULLTERM_TOKEN;} break; case 81: -#line 311 "H5LTparse.y" +#line 312 "H5LTparse.y" {yyval.ival = H5T_STR_NULLPAD_TOKEN;} break; case 82: -#line 312 "H5LTparse.y" +#line 313 "H5LTparse.y" {yyval.ival = H5T_STR_SPACEPAD_TOKEN;} break; case 83: -#line 314 "H5LTparse.y" +#line 315 "H5LTparse.y" {yyval.ival = H5T_CSET_ASCII_TOKEN;} break; case 84: -#line 315 "H5LTparse.y" +#line 316 "H5LTparse.y" {yyval.ival = H5T_CSET_UTF8_TOKEN;} break; case 85: -#line 317 "H5LTparse.y" +#line 318 "H5LTparse.y" {yyval.ival = H5T_C_S1_TOKEN;} break; case 86: -#line 318 "H5LTparse.y" +#line 319 "H5LTparse.y" {yyval.ival = H5T_FORTRAN_S1_TOKEN;} break; case 87: -#line 322 "H5LTparse.y" +#line 323 "H5LTparse.y" { is_enum = 1; enum_id = H5Tenum_create(yyvsp[-1].ival); H5Tclose(yyvsp[-1].ival); } break; case 88: -#line 324 "H5LTparse.y" +#line 325 "H5LTparse.y" { is_enum = 0; /*reset*/ yyval.ival = enum_id; } break; case 91: -#line 329 "H5LTparse.y" +#line 330 "H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ - enum_memb_symbol = strdup(yylval.sval); + enum_memb_symbol = strdup(yylval.sval); } break; case 92: -#line 334 "H5LTparse.y" +#line 335 "H5LTparse.y" { char char_val=(char)yylval.ival; short short_val=(short)yylval.ival; @@ -1030,7 +1056,7 @@ case 92: long_long llong_val=(long_long)yylval.ival; hid_t super = H5Tget_super(enum_id); hid_t native = H5Tget_native_type(super, H5T_DIR_ASCEND); - + if(is_enum && is_enum_memb) { /*if it's an enum member*/ /*To handle machines of different endianness*/ if(H5Tequal(native, H5T_NATIVE_SCHAR) || H5Tequal(native, H5T_NATIVE_UCHAR)) @@ -1044,7 +1070,7 @@ case 92: else if(H5Tequal(native, H5T_NATIVE_LLONG) || H5Tequal(native, H5T_NATIVE_ULLONG)) H5Tenum_insert(enum_id, enum_memb_symbol, &llong_val); - is_enum_memb = 0; + is_enum_memb = 0; if(enum_memb_symbol) free(enum_memb_symbol); } @@ -1052,7 +1078,7 @@ case 92: H5Tclose(native); } break; -#line 1037 "H5LTparse.c" +#line 1063 "H5LTparse.c" } yyssp -= yym; yystate = *yyssp; |