From 3766923ecf5cf109e0639ac348a15d46e66f64d2 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 13 Nov 2015 10:33:08 -0700 Subject: [PATCH 01/39] Added test for [NCF-345] --- ncgen/ncf345.cdl | 1743 ++++++++++++++++++++++++++++++++++++++++++++ ncgen/run_tests.sh | 6 + 2 files changed, 1749 insertions(+) create mode 100644 ncgen/ncf345.cdl diff --git a/ncgen/ncf345.cdl b/ncgen/ncf345.cdl new file mode 100644 index 000000000..c80576abd --- /dev/null +++ b/ncgen/ncf345.cdl @@ -0,0 +1,1743 @@ +// -*-C++-*- + +// Purpose: CDL file to generate netCDF test file for NCO + +// Usage: +// netCDF4: ncgen arguments depend on version: +// "-k netCDF-4" for netCDF >= 3.6.3, "-k hdf5" for netCDF < 3.6.3 +// "-k netCDF-4 classic model" for netCDF >= 3.6.3, "-k hdf5-nc3" for netCDF < 3.6.3 +// /usr/local/bin/ncgen -k netCDF-4 -b -o in_4.nc in.cdl +// /usr/local/bin/ncgen -k netCDF-4 -b -o ${HOME}/nco/data/in_4.nc ${HOME}/nco/data/in.cdl +// NB: netCDF-classic files will be enormous unless/until _ChunkSizes attributes added to time +// /usr/local/bin/ncgen -k hdf5-nc3 -b -o in_4c.nc in.cdl +// /usr/local/bin/ncgen -k hdf5-nc3 -b -o ${HOME}/nco/data/in_4c.nc ${HOME}/nco/data/in.cdl + +// URL: +// http://dust.ess.uci.edu/nco/in.nc +// http://dust.ess.uci.edu/nco/in_4.nc +// http://thredds-test.ucar.edu/thredds/dodsC/testdods/in.nc +// http://thredds-test.ucar.edu/thredds/dodsC/testdods/in_4.nc + +// netCDF3: +// ncgen -b -o in.nc in.cdl +// ncgen -b -o ${HOME}/nco/data/in.nc ${HOME}/nco/data/in.cdl +// scp ~/nco/data/in.cdl ~/nco/data/in_4.nc dust.ess.uci.edu:nco/data +// scp ~/nco/data/in.nc ~/nco/data/in_4.nc dust.ess.uci.edu:/var/www/html/nco +// scp ~/nco/data/in.nc ~/nco/data/in_4.nc dust.ess.uci.edu:/var/www/html/dodsdata +// mswrite -t 365 ~/nco/data/in.nc /ZENDER/tmp/in.nc +// mswrite -t 365 ~/nco/data/in.nc /ZENDER/tmp/h0001.nc +// mswrite -t 365 ~/nco/data/in.nc /ZENDER/tmp/h0002.nc +// mswrite -t 365 ~/nco/data/in.nc /ZENDER/tmp/h0003.nc +// mswrite -t 365 ~/nco/data/in.nc /ZENDER/tmp/h0004.nc +// msrcp -period 365 ~/nco/data/in.nc mss:/ZENDER/tmp/in.nc +// msrcp -period 365 ~/nco/data/in.nc mss:/ZENDER/tmp/h0001.nc +// msrcp -period 365 ~/nco/data/in.nc mss:/ZENDER/tmp/h0002.nc +// msrcp -period 365 ~/nco/data/in.nc mss:/ZENDER/tmp/h0003.nc +// msrcp -period 365 ~/nco/data/in.nc mss:/ZENDER/tmp/h0004.nc + +// WARNING: Changing values of variables below, especially coordinate variables, affects outcome of nco_tst.pl test script +// Other programs, e.g., ~/f/fff.F90, ~/c++/ccc.cc, ~/c/c.c may also break +// In particular, do not change number of elements in record coordinate, time, without simultaneously changing number of data in all record variables +// My (and NCO's) convention is that the _FillValue, if any, of any packed variable should be of the same type as the expanded variable. Hence _FillValue, add_offset, and scale_factor should all be of the same type. Variables that do not adhere to this convention are not supported. + +// Bugs: +// Some triggering bugs were moved to buggy.cdl to prevent non-builds +// ncgen 4.0.0--4.3.2 crashes on 'l' or 'L' syntax when generating netCDF4-classic (but not netCDF3 or netCDF4) files until 20141010 (NCF-318) + +// CDL Data constants: +// http://www.unidata.ucar.edu/software/netcdf/docs/netcdf/CDL-Syntax.html +// byte: 'a' +// char: "a" +// short: 1s +// int: 1 (no decimal point) +// long: 1 (_not_ 1l;) (long is synonym for int in netCDF3) +// float: 1.f (decimal point is required, f is required to distinguish from double) +// double: 1.0, 1.d, 1.0e-20 (decimal point is required, d is not required) +// CDL complex types: +// roulee:/data/zender/tmp/netcdf-4.2.1/nc_test/ref_tst_diskless2.cdl + +// NCL usage: +// id_in=addfile("/home/zender/nco/data/in.nc","r") +// print(id_in) +// list_filevars(id_in) + +netcdf ncf345 { +dimensions: + dgn=1,bnd=2,lat=2,lat_grd=3,lev=3,rlev=3,ilev=4,lon=4,lon_grd=5,char_dmn_lng80=80,char_dmn_lng26=26,char_dmn_lng04=4,date_dmn=5,fl_dmn=3,lsmlev=6,wvl=2,time_udunits=3;lon_T42=128,lat_T42=64,lat_times_lon=8,gds_crd=8,gds_ncd=8,vrt_nbr=2,lon_cal=10,lat_cal=10,Lon=4,Lat=2,time=unlimited; +variables: + :Conventions = "CF-1.5"; + :history = "History global attribute.\nTextual attributes like history often have embedded newlines like this.\nSuch newlines should serve as linebreaks on the screen to enhance legibility like this.\nFriendly CDL converters print a single NC_CHAR attribute as a comma-separated list of strings where each embedded delimiter marks a linebreak. This makes poetry embedded in CDL much nicer to read:\n\nA POET by Hafiz\n\nA poet is someone\nWho can pour light into a cup,\nThen raise it to nourish\nYour beautiful parched, holy mouth\n"; + :lorem_ipsum = "The Lorem Ipsum attribute demonstrates the legibility of text without embedded linebreaks:\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lady Gaga amat indueris vestimento laetus. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; + :julian_day = 200000.04; + :RCS_Header = "$Header$"; + + int date_int(date_dmn); + date_int:long_name = "Date (as array of ints: YYYY,MM,DD,HH,MM)"; + + float dgn(dgn); + dgn:long_name = "degenerate coordinate (dgn means degenerate, i.e., of size 1)"; + + float dgn_var(dgn); + dgn_var:long_name = "degenerate variable (dgn means degenerate, i.e., of size 1)"; + + float lat(lat); + lat:long_name = "Latitude (typically midpoints)"; + lat:units = "degrees_north"; + lat:bounds = "lat_bnd"; + + float lat_bnd(lat,vrt_nbr); + lat_bnd:purpose = "Cell boundaries for lat coordinate"; + + float lat_grd(lat_grd); + lat_grd:long_name = "Latitude grid (typically interfaces)"; + lat_grd:units = "degrees_north"; + + float lat_cpy(lat); + float lev_cpy(lev); + float lat_var(lat); + float lat_wgt(lat); + float lon_T42(lon_T42); + float lat_T42(lat_T42); + + float lat_1D_rct(lat_times_lon); + lat_1D_rct:long_name = "Latitude for 2D rectangular grid stored as 1D arrays"; + lat_1D_rct:units = "degrees_north"; + + float lon_1D_rct(lat_times_lon); + lon_1D_rct:long_name = "Longitude for 2D rectangular grid stored as 1D arrays"; + lon_1D_rct:units = "degrees_east"; + + float lat_1D_rrg(lat_times_lon); + lat_1D_rrg:long_name = "Latitude for 2D irregular grid stored as 1D arrays"; + lat_1D_rrg:units = "degrees_north"; + + float lon_1D_rrg(lat_times_lon); + lon_1D_rrg:long_name = "Longitude for 2D irregular grid stored as 1D arrays"; + lon_1D_rrg:units = "degrees_east"; + + int lat_times_lon(lat_times_lon); + lat_times_lon:long_name = "Element index (i.e., C-based storage order) for 2D coordinate grids stored as 1D arrays"; + + float lat_2D_rct(lat,lon); + lat_2D_rct:long_name = "Latitude for 2D rectangular grid stored as 2D array"; + lat_2D_rct:units = "degrees_north"; + + float lon_2D_rct(lat,lon); + lon_2D_rct:long_name = "Longitude for 2D rectangular grid stored as 2D array"; + lon_2D_rct:units = "degrees_east"; + + float lat_2D_rrg(lat,lon); + lat_2D_rrg:long_name = "Latitude for 2D irregular grid stored as 2D array"; + lat_2D_rrg:units = "degrees_north"; + + float lon_2D_rrg(lat,lon); + lon_2D_rrg:long_name = "Longitude for 2D irregular grid stored as 2D array"; + lon_2D_rrg:units = "degrees_east"; + + int lat_times_lon_nbr; + lat_times_lon_nbr:long_name = "Number of elements in 2D coordinate grids. Rectangular and irregular test grids have this many total elements. The coordinates and elements are stored as 1D or 2D arrays for grid types 1D and 2D respectively."; + + float lev(lev); + lev:purpose = "Monotonically increasing coordinate pressure"; + lev:long_name = "hybrid level at midpoints (1000*(A+B))"; + lev:units = "hPa"; + lev:positive = "down"; + lev:A_var = "hyam"; + lev:B_var = "hybm"; + lev:P0_var = "P0"; + lev:PS_var = "PS"; + lev:bounds = "lev_bnd"; + lev:standard_name = "atmosphere_hybrid_sigma_pressure_coordinate"; + lev:formula_terms = "a: hyam b: hybm p0: P0 ps: PS"; + lev:formula_readable = "prs_mdp[time,lat,lon,lev]=P0*hyam+PS*hybm"; + + float ilev(ilev); + ilev:purpose = "Monotonically increasing coordinate pressure"; + ilev:long_name = "hybrid level at interfaces (1000*(A+B))"; + ilev:units = "hPa"; + ilev:positive = "down"; + ilev:A_var = "hyai"; + ilev:B_var = "hybi"; + ilev:P0_var = "P0"; + ilev:PS_var = "PS"; + ilev:standard_name = "atmosphere_hybrid_sigma_pressure_coordinate"; + ilev:formula_terms = "a: hyai b: hybi p0: P0 ps: PS"; + ilev:formula_readable = "prs_ntf[time,lat,lon,ilev]=P0*hyai+PS*hybi"; + + float lev_bnd(lev,vrt_nbr); + lev_bnd:purpose = "Cell boundaries for lev coordinate"; + + float rlev(rlev); + rlev:purpose = "Monotonically decreasing coordinate pressure"; + + float lon(lon); + lon:long_name = "Longitude (typically midpoints)"; + lon:units = "degrees_east"; + + double Lon(Lon); + Lon:long_name = "Longitude"; + Lon:units = "degrees"; + Lon:purpose = "Longitude coordinate originally stored as -180 to 180"; + Lon:notes = "Longitude = [-180.0,180.0) is not CF-compliant, yet is common"; + + double LatLon(Lat,Lon); + LatLon:long_name = "2D variable originally stored on -180 to 180 longitude grid"; + LatLon:units = "fraction"; + LatLon:purpose = "Demonstrate remapping of [-180,180) to [0,360) longitude-grid data"; + + double Lat(Lat); + Lat:long_name = "Latitude"; + Lat:units = "degrees_north"; + Lat:purpose = "Latitude paired with Longitude coordinate originally stored as -180 to 180."; + + double lond(lon); + lond:long_name = "Longitude (typically midpoints), double precision"; + lond:units = "degrees_east"; + + float lonf(lon); + lonf:long_name = "Longitude (typically midpoints), single precision"; + lonf:units = "degrees_east"; + + float lon_grd(lon_grd); + lon_grd:long_name = "Longitude grid (typically interfaces)"; + lon_grd:units = "degrees_east"; + + double time(time); + time:long_name = "time"; + time:units = "days since 1964-03-12 12:09:00 -9:00"; + time:calendar = "gregorian"; + time:bounds = "time_bnds"; + time:climatology = "climatology_bounds"; + + float time_bnds(time,vrt_nbr); + time_bnds:purpose = "Cell boundaries for time coordinate"; + + float climatology_bounds(time,vrt_nbr); + climatology_bounds:purpose = "Variable containing CF-compliant climatology bounds for time dimension"; + + double lon_cal(lon_cal); + lon_cal:long_name = "lon_cal"; + lon_cal:units = "days since 1964-2-28"; + lon_cal:calendar = "365_day"; + + double lat_cal(lat_cal); + lat_cal:long_name = "lat_cal"; + lat_cal:units = "days since 1964-2-28"; + lat_cal:calendar = "360_day"; + + double tm_std; + tm_std:units = "days since 2013-01-01"; + + double tm_grg; + tm_grg:units = "days since 2013-01-01"; + tm_grg:calendar = "gregorian"; // Same as "standard" + + double tm_jln; + tm_jln:units = "days since 2013-01-01"; + tm_jln:calendar = "julian"; + + double tm_360; + tm_360:units = "days since 2013-01-01"; + tm_360:calendar = "360_day"; + + double tm_365; + tm_365:units = "days since 2013-01-01"; + tm_365:calendar = "365_day"; // Same as "noleap" + + double tm_366; + tm_366:units = "days since 2013-01-01"; + tm_366:calendar = "366_day"; // Same as "all_leap" + + float lsmlev(lsmlev); + lsmlev:purpose = "Homebrew level coordinate for LSM"; + lsmlev:long_name = "Soil depth"; + lsmlev:units = "meter"; + float wvl(wvl); + wvl:long_name = "Wavelength"; + wvl:units = "meter"; + + int od(time); + + float area(lat); + area:long_name = "area"; + area:units = "meter2"; + + float area2(lat); + area2:long_name = "area version 2"; + area2:units = "meter2"; + + float area_asm(lat); + area_asm:long_name = "area asymmetric"; + area_asm:units = "meter2"; + + float hyam(lev); + hyam:long_name = "hybrid A coefficient at layer midpoints"; + + float hybm(lev); + hybm:long_name = "hybrid B coefficient at layer midpoints"; + + float hyai(ilev); + hyai:long_name = "hybrid A coefficient at layer interfaces"; + + float hybi(ilev); + hybi:long_name = "hybrid B coefficient at layer interfaces"; + + float P0; + P0:long_name = "reference pressure"; + P0:units = "pascal"; + + float cnv_CF_crd(gds_crd); + cnv_CF_crd:long_name = "test CF coordinates conventions"; + cnv_CF_crd:coordinates = "lat_gds lon_gds "; + cnv_CF_crd:reason = "Test whether coordinates attribute strings that end with a space break after nco_var_lst_crd_ass_add() call to nco_lst_prs_2d()"; + + float cnv_CF_ncl(time); + cnv_CF_ncl:long_name = "test CF ancillary_variables convention"; + cnv_CF_ncl:standard_name = "specific_humidity"; + cnv_CF_ncl:ancillary_variables = "cnv_CF_ncl_var_1 cnv_CF_ncl_var_2"; + cnv_CF_ncl:purpose = "Main variable that has ancillary variables named cnv_CF_ncl_var_1 and cnv_CF_ncl_var_2"; + + float cnv_CF_ncl_var_1(time); + cnv_CF_ncl_var_1:long_name = "test CF ancillary_variables convention"; + cnv_CF_ncl_var_1:standard_name = "specific_humidity standard_error"; + cnv_CF_ncl_var_1:purpose = "Ancillary variable for cnv_CF_ncl. Other ancillary variable is cnv_CF_ncl_var_2."; + + float cnv_CF_ncl_var_2(time); + cnv_CF_ncl_var_2:long_name = "test CF ancillary_variables convention"; + cnv_CF_ncl_var_2:standard_name = "specific_humidity detection_limit"; + cnv_CF_ncl_var_2:purpose = "Ancillary variable for cnv_CF_ncl. Other ancillary variable is cnv_CF_ncl_var_1."; + + float PS(time,lat,lon); + PS:long_name = "surface pressure"; + PS:units = "pascal"; + + char fl_dmn(fl_dmn); + fl_dmn:long_name = "Character coordinate"; + fl_dmn:units = "[chr]"; + + double lat_gds(gds_crd); + lat_gds:long_name = "Latitude"; + lat_gds:standard_name = "latitude"; + lat_gds:units="degree"; + lat_gds:purpose = "1-D latitude coordinate referred to by geodesic grid variables"; + + double lon_gds(gds_crd); + lon_gds:long_name = "Longitude"; + lon_gds:standard_name = "longitude"; + lon_gds:units="degree"; + lon_gds:purpose = "1-D longitude coordinate referred to by geodesic grid variables"; + + float gds_crd(gds_crd); + gds_crd:long_name = "Geodesic coordinate"; + gds_crd:units = "degree"; + gds_crd:purpose = "enumerated coordinate like those that might define points in a geodesic grid"; + gds_crd:coordinates = "lat_gds lon_gds"; + + float gds_var(gds_crd); + gds_var:long_name = "Geodesic variable"; + gds_var:units = "meter"; + gds_var:purpose = "Test auxiliary coordinates like those that define geodesic grids"; + gds_var:coordinates = "lat_gds lon_gds"; + + float gds_3dvar(time,gds_crd); + gds_3dvar:long_name = "Geodesic variable"; + gds_3dvar:units = "meter"; + gds_3dvar:coordinates = "lat_gds lon_gds"; + gds_3dvar:purpose = "Test auxiliary coordinates like those that define geodesic grids"; + + float gds_var_ncd(gds_ncd); + gds_var_ncd:long_name = "Geodesic variable on non-coordinate grid"; + gds_var_ncd:units = "meter"; + gds_var_ncd:purpose = "Test auxiliary coordinates like those that define geodesic grids but where underlying dimension is a non-coordinate dimension"; + gds_var_ncd:coordinates = "lat_gds_ncd lon_gds_ncd"; + + double lat_gds_ncd(gds_ncd); + lat_gds_ncd:long_name = "Latitude"; + lat_gds_ncd:standard_name = "latitude"; + lat_gds_ncd:units="degree"; + lat_gds_ncd:purpose = "1-D latitude coordinate referred to by \"non-coordinate\" (ncd) geodesic grid variables"; + + double lon_gds_ncd(gds_ncd); + lon_gds_ncd:long_name = "Longitude"; + lon_gds_ncd:standard_name = "longitude"; + lon_gds_ncd:units="degree"; + lon_gds_ncd:purpose = "1-D longitude coordinate referred to by \"non-coordinate\" (ncd) geodesic grid variables"; + + int nbdate; + nbdate:long_name = "base date as 6- or 8-digit integer (YYMMDD or YYYYMMDD)"; + + int date(time); + date:long_name = "current date as 6- or 8-digit integer (YYMMDD or YYYYMMDD)"; + + float lon_wgt(lon); + lon_wgt:long_name = "Gaussian weights"; + lon_wgt:purpose = "Gaussian weights which sum to two for n = 4. These weights are all have floor of 0.0 so should cause SIGFPE when applied to integer types in weighted average."; + + double ppc_dbl(time); + ppc_dbl:long_name = "Precision-Preserving Compression, double precision"; + ppc_dbl:purpose = "test --ppc switches"; + ppc_dbl:original_values="0.0,0.1,0.12,0.123,0.1234,0.12345,0.123456,0.1234567,0.12345678,0.123456789"; + + float ppc_flt(time); + ppc_flt:long_name = "Precision-Preserving Compression, single precision"; + ppc_flt:purpose = "test --ppc switches"; + ppc_flt:original_values="0.0,0.1,0.12,0.123,0.1234,0.12345,0.123456,0.1234567,0.12345678,0.123456789"; + + double ppc_big(time); + ppc_big:long_name = "Precision-Preserving Compression, big numbers"; + ppc_big:purpose = "test --ppc switches"; + ppc_big:original_values="123456789e-10,123456789e-9,123456789e-8,123456789e-7,123456789e-6,123456789e-5,123456789e-4,123456789e-3,123456789e-2,123456789e-1"; + + float ppc_bgr(time); + ppc_bgr:long_name = "Precision-Preserving Compression, bigger numbers"; + ppc_bgr:purpose = "test --ppc switches"; + ppc_bgr:original_values="1234567890e20,1234567890e19,1234567890e18,1234567890e17,1234567890e16,1234567890e15,1234567890e14,1234567890e13,1234567890e12,1234567890e11"; + + float ppc_bgr_scl; + ppc_bgr_scl:long_name = "Precision-Preserving Compression, bigger numbers, scalar"; + ppc_bgr_scl:purpose = "test --ppc switches"; + ppc_bgr_scl:original_value="1234567890e11"; + + double ppc_hgh(time); + ppc_hgh:long_name = "Precision-Preserving Compression, high precision"; + ppc_hgh:purpose = "test --ppc switches"; + + double ppc_hgr(time); + ppc_hgr:long_name = "Precision-Preserving Compression, higher precision"; + ppc_hgr:purpose = "test --ppc switches"; + + char md5_a; + md5_a:long_name = "the letter a"; + md5_a:purpose = "String with known MD5 digest"; + md5_a:MD5_known_checksum = "0cc175b9c0f1b6a831c399e269772661"; + + char md5_abc(lev); + md5_abc:long_name = "the letters abc"; + md5_abc:purpose = "String with known MD5 digest"; + md5_abc:MD5_known_checksum = "900150983cd24fb0d6963f7d28e17f72"; + + float msk_prt_mss_prt(lon); + msk_prt_mss_prt:long_name = "partial mask, partial missing value example"; + msk_prt_mss_prt:_FillValue = 1.0e36f; + + float mss_val(lon); + mss_val:long_name = "partial missing value example"; + mss_val:_FillValue = 1.0e36f; + + float mss_val_scl; + mss_val_scl:long_name = "scalar missing value"; + mss_val_scl:_FillValue = 1.0e36f; + + float mss_val_fst(lon); + mss_val_fst:long_name = "offset partial missing value example"; + mss_val_fst:_FillValue = -999.0f; + + float fll_val(lon); + fll_val:long_name = "_FillValue example"; + fll_val:_FillValue = -999.0f; + + float fll_val_mss_val(lon); + fll_val_mss_val:long_name = "_FillValue example"; + fll_val_mss_val:_FillValue = -999.0f; + fll_val_mss_val:missing_value = -999.0f; + + float nan_arr(lat); + nan_arr:long_name = "Intended for array representation of IEEE NaN"; + nan_arr:note = "20120308 Apparently netCDF ncgen chokes on variable names of nan and NaN"; + nan_arr:note2 = "20120330 netCDF ncgen on AIX/bluefire chokes on variable/attribute values of nan"; + nan_arr:note3 = "20120625 netCDF ncgen on netCDF 4.1.1 on apparently chokes on variable/attribute values of nan"; + nan_arr:note4 = "If your NCO build fails because your version of netCDF does not support nan, then cd to the directory that contains the file nco/data/in.cdl and run the command in note5 first and then try to build again"; + nan_arr:note5 = "sed -e 's/nan;/1.0f;/' in.cdl > foo.cdl;ncgen -b -o in.nc foo.cdl"; + nan_arr:note6 = "It is too troublesome to distribute in.cdl with references to NaNs because users always build with old netCDF versions that do not support it. So just comment out nan's for now."; + // nan_arr:_FillValue = nan; + nan_arr:_FillValue = 1.0f; + + float nan_scl; + nan_scl:long_name = "Intended for scalar representation of IEEE NaN"; + nan_scl:note = "20120308 Apparently netCDF ncgen chokes on variable names of nan and NaN"; + nan_scl:note2 = "20120330 netCDF ncgen on AIX/bluefire chokes on variable/attribute values of nan"; + nan_scl:note3 = "20120625 netCDF ncgen on netCDF 4.1.1 on apparently chokes on variable/attribute values of nan"; + nan_scl:note6 = "It is too troublesome to distribute in.cdl with references to NaNs because users always build with old netCDF versions that do not support it. So just comment out nan's for now."; + // nan_scl:_FillValue = nan; + nan_scl:_FillValue = 1.0f; + + float nm_spc; + nm_spc:long_name = "Variable name with space (invalid)"; + + float nm_pnd; + nm_pnd:long_name = "Variable name with pound symbol (invalid)"; + + float no_mss_val(lon); + no_mss_val:long_name = "no missing value"; + + float val_one_mss(lat); + val_one_mss:long_name = "one regular value, one missing value"; + val_one_mss:_FillValue = 1.0e36f; + + short rec_var_pck_scale_factor_only(time); + rec_var_pck_scale_factor_only:long_name = "Array packed with scale factor only"; + rec_var_pck_scale_factor_only:note = "Original packed value was 1s..10s with scale_factor = 10.0d no add_offset. Unpacked value should be 10.0 = 10.0d*1s + 0.0d through 100 = 10.0d*1s + 0.0d. Average value should be 55."; + rec_var_pck_scale_factor_only:scale_factor = 10.0d; + + short pck; + pck:long_name = "Scalar variable, double, packed as short"; + pck:note = "Original packed value was 1s with scale_factor = 2.0d and add_offset = 1.0d. Unpacked value (netCDF convention) should be 3.0 = 2.0d*1s + 1.0d. Unpacked value (HDF convention) should be 0.0 = 2.0d*(1s-1.0d). NCO algorithms would pack this variable as scale_factor = 0.0d and add_offset = 3.0d."; + pck:scale_factor = 2.0d; + pck:add_offset = 1.0d; + + short pck_3; + pck_3:long_name = "Scalar variable, double, packed as short"; + pck_3:note = "Original packed value was 1s with scale_factor = 2.0d and add_offset = 1.0d. Unpacked value (netCDF convention) should be 3.0 = 2.0d*1s + 1.0d. Unpacked value (HDF convention) should be 0.0 = 2.0d*(1s-1.0d). NCO algorithms would pack this variable as scale_factor = 0.0d and add_offset = 3.0d."; + pck_3:scale_factor = 2.0d; + pck_3:add_offset = 1.0d; + + short pck_5; + pck_5:long_name = "Scalar variable, double, packed as short"; + pck_5:note = "Original packed value was 2s with scale_factor = 2.0d and add_offset = 1.0d. Unpacked value (netCDF convention) should be 5.0 = 2.0d*2s + 1.0d. Unpacked value (HDF convention) should be 2.0 = 2.0d*(2s-1.0d). NCO algorithms would pack this variable as scale_factor = 0.0d and add_offset = 5.0d."; + pck_5:scale_factor = 2.0d; + pck_5:add_offset = 1.0d; + + short pck_7; + pck_7:long_name = "Scalar variable, double, packed as short"; + pck_7:note = "Original packed value was 1s with scale_factor = 4.0d and add_offset = 3.0d. Unpacked value (netCDF convention) should be 7.0 = 4.0d*1s + 3.0d. Unpacked value (HDF convention) should be -8.0 = 4.0d*(1s-3.0d). NCO algorithms would pack this variable as scale_factor = 0.0d and add_offset = 7.0d."; + pck_7:scale_factor = 4.0d; + pck_7:add_offset = 3.0d; + + short pck_arr(lon); + pck_arr:long_name = "Array variable, double, packed as short"; + pck_arr:note = "Packed value is -32767s, 0s, 1s, 32767s, unpacked is same in double"; + pck_arr:scale_factor = 1.0d; + pck_arr:add_offset = 0.0d; + + double upk; + upk:long_name = "Unpacked scalar variable"; + upk:note = "Unpacked value is 3.0d0, upk=unpack(pck)= 2.0d0*1s + 1.0d0 = 3.0d0. Packing this variable should create an NC_SHORT scalar = 0s with packing attribute add_offset=3.0d and either no scale_factor (ncap) or scale_factor = 0.0d (ncpdq)."; + + double upk_arr(lon); + upk_arr:long_name = "Unpacked array"; + upk_arr:note = "Unpacked value is -32767.d, 0.d, 1.d, 32767.d, packed is same in short. Packing algorithm should yield an NC_SHORT array = [] with packing attributes scale_factor=1.0d, add_offset=0.0d"; + + float val_eminusten; + val_eminusten:long_name = "Floating point number with exponent ending in zero to test sng_trm_trl_zro()"; + val_eminusten:att_eminusten = 1.1e-10f; + + int val_one_int; + val_one_int:long_name = "scalar integer equal to 1"; + val_one_int:_FillValue = -99l; + + int val_one_one_int(lat); + val_one_one_int:long_name = "1, 1"; + val_one_one_int:_FillValue = -99l; + + short val_max_max_sht(lat); + val_max_max_sht:long_name = "17000, 17000"; + val_max_max_sht:_FillValue = -99s; + + int val_one_mss_int(lat); + val_one_mss_int:long_name = "1, mss_val"; + val_one_mss_int:_FillValue = -99l; + + float val_half; + val_half:long_name = "Scalar with value 0.5"; + val_half:_FillValue = 1.0e36f; + + float val_half_half(lat); + val_half_half:long_name = "0.5,0.5"; + val_half_half:_FillValue = 1.0e36f; + + float wgt_one(lat); + wgt_one:long_name = "all values are one"; + + float mss_val_all(lon); + mss_val_all:long_name = "all missing values example"; + mss_val_all:_FillValue = 1.0e36f; + + float scalar_var; + scalar_var:long_name = "scalar variable"; + scalar_var:units = "fraction"; + + float float_var; + float_var:long_name = "float"; + + double double_var; + double_var:long_name = "double"; + + double double_var2; + double_var2:long_name = "double"; + double_var2:_FillValue = 1.0e36; + + double pi; + pi:long_name = "Pi"; + pi:units = "fraction"; + + int int_var; + int_var:long_name = "int"; + + long long_var; + long_var:long_name = "long"; + long_var:purpose = "Variable of CDL type=long, which is deprecated for int. Included to test back-compatibility"; + + short short_var; + short_var:long_name = "short"; + + char char_var; + char_var:long_name = "char"; + + char char_var_space; + char_var_space:long_name = "Character variable with whitespace on ends"; + + char char_var_nul; + char_var_nul:long_name = "Character variable containing one NUL"; + + // 20131015: This confuses the XML parser. Omit it for now. + // char char_var_multinul(lev); + // char_var_multinul:long_name = "Character variable containing multiple NULs"; + + char fl_nm(char_dmn_lng80); + fl_nm:long_name = "Variable contains a file name"; + + char fl_nm_arr(fl_dmn,char_dmn_lng80); + fl_nm_arr:long_name = "Variable that contains a short array of file names"; + fl_nm_arr:units = "[sng]"; + + char fl_nm_rec(time,char_dmn_lng80); + fl_nm_rec:long_name = "A record variable of file names"; + fl_nm_rec:units = "[sng]"; + + char date_rec(time,char_dmn_lng26); + date_rec:long_name = "A record variable of date strings"; + date_rec:units = "[sng]"; + + char non_nul_trm_char_one_dmn(char_dmn_lng04); + non_nul_trm_char_one_dmn:long_name = "Variable contains a one-dimensional array of characters that is not NUL-terminated"; + non_nul_trm_char_one_dmn:units = "[chr]"; + + char non_nul_trm_char_two_dmn(fl_dmn,char_dmn_lng04); + non_nul_trm_char_two_dmn:long_name = "Variable contains a two-dimensional array of characters that are not NUL-terminated"; + non_nul_trm_char_two_dmn:units = "[chr]"; + + byte byt_arr(lat,lon); + byt_arr:long_name = "byte array"; + + byte byt_2D(lat,lon); + + byte byt_3D(lat,lev,lon); + + byte byt_3D_rec(time,lat,lon); + + byte byte_var; + byte_var:long_name = "byte"; + + byte byte_var_neg; + byte_var_neg:long_name = "negative byte"; + + float zero; + zero:long_name = "zero"; + + float ppc_zro_flt(time); + zero:long_name = "array of single precision floating point zeros"; + + double ppc_zro_dbl(time); + zero:long_name = "array of double precision floating point zeros"; + + int ppc_zro_int(time); + zero:long_name = "array of integer zeros"; + + float one; + one:long_name = "one"; + + float two; + two:long_name = "two"; + + double e_dbl; + e_dbl:long_name = "e, natural logarithm base"; + + float e_flt; + e_flt:long_name = "e, natural logarithm base"; + + float three; + three:long_name = "three"; + + float four; + four:long_name = "four"; + + float negative_one; + negative_one:long_name = "negative one"; + + float lev_var(lev); + lev_var:long_name = "lev_var"; + + float lev_wgt(lev); + lev_wgt:long_name = "lev_wgt"; + + float g; + g:long_name = "g"; + + float dps_dry; + dps_dry:long_name = "Dry Deposition"; + + float dps_wet; + dps_wet:long_name = "Wet Deposition"; + + float dps_ttl; + dps_ttl:long_name = "Total Deposition"; + + float z(lev); + z:long_name = "Height"; + z:units = "meter"; + z:purpose = "Height stored with a monotonically increasing coordinate"; + + float rz(rlev); + rz:long_name = "Height"; + rz:units = "meter"; + rz:purpose = "Height stored with a monotonically decreasing coordinate"; + + float one_dmn_var(bnd); + + int one_dmn_int_val_one(lat); + int one_dmn_int_val_two(lat); + + float att_var(time); + att_var:byte_att = '\000','\001','\002','\177','\200','\201','\376','\377'; + att_var:char_att = "Sentence one.\nSentence two.\n"; + att_var:short_att = 37s; + att_var:int_att = 73; + att_var:long_att = 73l; + att_var:float_att = 73.0f,72.0f,71.0f,70.010f,69.0010f,68.010000f,67.01000100f; + att_var:double_att = 73.0,72.0,71.0,70.010,69.0010,68.010000,67.01000100; + + int bnd_var(lev,bnd); + bnd_var:byte_att = '\0'; + bnd_var:char_att = "Sentence one.\nSentence two.\n"; + bnd_var:short_att = 37s; + bnd_var:int_att = 73; + bnd_var:long_att = 73l; + bnd_var:float_att = 73.f; + bnd_var:double_att = 73.d; + + float three_dmn_var(lat,lev,lon); + three_dmn_var:long_name = "three dimensional variable with CCM coordinate convention C=[lat,lev,lon], Fortran=(lon,lev,lat)"; + three_dmn_var:units = "fraction"; + + float three_dmn_var_crd(lev,lat,lon); + three_dmn_var_crd:long_name = "three dimensional variable with COORDS coordinate convention C=[lev,lat,lon], Fortran=(lon,lat,lev)"; + three_dmn_var_crd:units = "fraction"; + + float prs_sfc(time,lat,lon); + prs_sfc:long_name = "Surface pressure"; + prs_sfc:units = "pascal"; + + float H2O; + float H2OH2O; + float H2SO4; + float H2O_lqd; + float H2O_ice; + float Q; + float Q1; + float AQ01; + float QQ01; + float QA01; + float Q01Q; + float Q01; + float Q02; + float Q03; + float Q04; + float Q05; + float Q06; + float Q07; + float Q08; + float Q09; + float Q10; + float Q11; + float Q12; + float Q13; + float Q14; + float Q15; + float Q16; + float Q17; + float Q18; + float Q19; + float Q20; + float Q21; + float Q22; + float Q23; + float Q24; + float Q25; + float Q26; + float Q27; + float Q28; + float Q29; + float Q30; + float Q31; + float Q32; + float Q33; + float Q34; + float Q35; + float Q36; + float Q37; + float Q38; + float Q39; + float Q40; + float Q41; + float Q42; + float Q43; + float Q44; + float Q45; + float Q46; + float Q47; + float Q48; + float Q49; + float Q50; + float Q51; + float Q52; + float Q53; + float Q54; + float Q55; + float Q56; + float Q57; + float Q58; + float Q59; + float Q60; + float Q61; + float Q62; + float Q63; + float Q64; + float Q65; + float Q66; + float Q67; + float Q68; + float Q69; + float Q70; + float Q71; + float Q72; + float Q73; + float Q74; + float Q75; + float Q76; + float Q77; + float Q78; + float Q79; + float Q80; + float Q81; + float Q82; + float Q83; + float Q84; + float Q85; + float Q86; + float Q87; + float Q88; + float Q89; + float Q90; + float Q91; + float Q92; + float Q93; + float Q94; + float Q95; + float Q96; + float Q97; + float Q98; + float Q99; + float Q100; + + float two_dmn_var(lat,lev); + two_dmn_var:long_name = "two dimensional variable"; + two_dmn_var:units = "fraction"; + + float var_msk(lat,lon); + var_msk:long_name = "Float field for testing masks and wheres"; + var_msk:units = "fraction"; + + float mask(lat,lon); + mask:long_name = "Purpose is to mask a variable like ORO"; + mask:units = "fraction"; + + float ORO(lat,lon); + ORO:long_name = "Orography, an enumerated yet continuous type: ocean=0.0, land=1.0, sea ice=2.0"; + ORO:units = "fraction"; + + float weight(lat); + weight:long_name = "Gaussian weight"; + weight:units = "fraction"; + + float gw(lat); + gw:long_name = "gw variable like gw"; + gw:units = "fraction"; + + float gw_T42(lat_T42); + gw_T42:long_name = "gw variable like gw_T42"; + gw_T42:units = "fraction"; + + float rec_var_flt(time); + rec_var_flt:long_name = "record variable, float"; + + double rec_var_dbl(time); + rec_var_dbl:long_name = "record variable, double"; + + int one_dmn_rec_var(time); + one_dmn_rec_var:long_name = "one dimensional record variable"; + one_dmn_rec_var:coordinates = "time"; + one_dmn_rec_var:units = "kelvin"; + + double one_dmn_rec_wgt(time); + one_dmn_rec_wgt:long_name = "one dimensional record variable weight"; + + int one_dmn_rec_var_mdn(time); + one_dmn_rec_var_mdn:long_name = "one dimensional record variable to test median"; + + int one_dmn_rec_var_mdn__FillValue(time); + one_dmn_rec_var_mdn__FillValue:long_name = "one dimensional record variable to test median with _FillValue"; + one_dmn_rec_var_mdn__FillValue:_FillValue = -999; + + int one_dmn_rec_var_unsorted(time); + one_dmn_rec_var_unsorted:long_name = "one dimensional record variable, unsorted"; + + float one_dmn_rec_var_flt(time); + one_dmn_rec_var_flt:long_name = "one dimensional record variable, single precision"; + + float one_dmn_rec_var_flt_mss(time); + one_dmn_rec_var_flt_mss:long_name = "one dimensional record variable, single precision, missing values"; + one_dmn_rec_var_flt_mss:_FillValue = 1.0e36f; + + float one_dmn_rec_var_flt_scl(time); + one_dmn_rec_var_flt_scl:long_name = "one dimensional record variable, single precision, scaled"; + one_dmn_rec_var_flt_scl:scale_factor = 1.0f; + + float one_dmn_rec_var_flt_mss_scl(time); + one_dmn_rec_var_flt_mss_scl:long_name = "one dimensional record variable, single precision, missing values, scaled"; + one_dmn_rec_var_flt_mss_scl:scale_factor = 1.0f; + one_dmn_rec_var_flt_mss_scl:_FillValue = 1.0e36f; + + float one_dmn_rec_var_dbl(time); + one_dmn_rec_var_dbl:long_name = "one dimensional record variable, double precision"; + one_dmn_rec_var_dbl:units = "second"; + + float one_dmn_rec_var_missing_value(time); + one_dmn_rec_var_missing_value:long_name = "One dimensional record variable with missing data indicated by missing_value attribute only. No _FillValue attribute exists."; + one_dmn_rec_var_missing_value:missing_value = 1.0e36f; + + float one_dmn_rec_var_mss_val(time); + one_dmn_rec_var_mss_val:long_name = "One dimensional record variable with all missing data."; + one_dmn_rec_var_mss_val:_FillValue = 1.0e36f; + + float one_dmn_rec_var__FillValue(time); + one_dmn_rec_var__FillValue:long_name = "One dimensional record variable with missing data indicated by _FillValue attribute only. No missing_value attribute exists."; + one_dmn_rec_var__FillValue:_FillValue = 1.0e36f; + + float one_dmn_rec_var_unsorted__FillValue(time); + one_dmn_rec_var_unsorted__FillValue:long_name = "Unsorted, one dimensional record variable with missing data indicated by _FillValue attribute only. No missing_value attribute exists."; + one_dmn_rec_var_unsorted__FillValue:_FillValue = 1.0e36f; + + float one_dmn_rec_var_mss_val_arr(time); + one_dmn_rec_var_mss_val_arr:long_name = "One dimensional record variable with missing data indicated by a _FillValue attribute that is an array. This can be tested with ncrcat. 20120905: ncgen chokes on _FillValue arrays and produces this error: _FillValue: must be a single (possibly compound) value. Deprecate the array for normal use since it prevents ncgen from completing. Uncommment following line when testing for compatibility with software changes."; +// one_dmn_rec_var_mss_val_arr:_FillValue = 1.0f,2.0f,3.0f; + one_dmn_rec_var_mss_val_arr:_FillValue = 1.0f; + + int RDM(time); + + float tpt(time); + tpt:long_name = "Temperature"; + tpt:units = "kelvin"; + tpt:hieght = "Leave hieght mispelled for NCO User's guide example"; + + double tpt_dbl(time); + tpt_dbl:long_name = "Temperature stored as double precision floating point"; + tpt_dbl:units = "kelvin"; + + float tpt_flt(time); + tpt_flt:long_name = "Temperature stored as single precision floating point"; + tpt_flt:units = "kelvin"; + + double rec_var_dbl_mss_val_dbl_upk(time); + rec_var_dbl_mss_val_dbl_upk:long_name = "record variable, double, with double missing values"; + rec_var_dbl_mss_val_dbl_upk:purpose = "This variable is used to generate the packed variable rec_var_dbl_mss_val_dbl_pck, so its _FillValue should not be out of range, i.e., it should be representable by a short. However, the _FillValue should itself be the same type as the unpacked variable, NC_DOUBLE in this case."; + rec_var_dbl_mss_val_dbl_upk:_FillValue = -999.; + rec_var_dbl_mss_val_dbl_upk:missing_value = -999.; + + double rec_var_dbl_mss_val_sht_upk(time); + rec_var_dbl_mss_val_sht_upk:long_name = "record variable, double, with double missing values"; + rec_var_dbl_mss_val_sht_upk:purpose = "This variable is used to generate the packed variable rec_var_dbl_mss_val_sht_pck, so its _FillValue should not be out of range, i.e., it should be representable by a short. However, the _FillValue should itself be the same type as the unpacked variable, NC_DOUBLE in this case."; +// Using intended _FillValue type breaks ncgen (with "_FillValue type mismatch")in netCDF 4.1.1 so comment-out for simplicity +// rec_var_dbl_mss_val_sht_upk:_FillValue = -999s; + rec_var_dbl_mss_val_sht_upk:_FillValue = -999.0; + rec_var_dbl_mss_val_sht_upk:missing_value = -999s; + + short rec_var_dbl_mss_val_dbl_pck(time); + rec_var_dbl_mss_val_dbl_pck:long_name = "record variable, double, packed as short, with double missing values"; + rec_var_dbl_mss_val_dbl_pck:purpose = "Packed version of rec_var_dbl_mss_val_dbl_upk"; +// Using intended _FillValue type breaks ncgen (with "_FillValue type mismatch")in netCDF 4.1.1 so comment-out for simplicity +// rec_var_dbl_mss_val_dbl_pck:_FillValue = -999.; + rec_var_dbl_mss_val_dbl_pck:_FillValue = -999s; + rec_var_dbl_mss_val_dbl_pck:missing_value = -999.; + rec_var_dbl_mss_val_dbl_pck:scale_factor = -9.15541313801785e-05; + rec_var_dbl_mss_val_dbl_pck:add_offset = 5.; + + short rec_var_dbl_mss_val_sht_pck(time); + rec_var_dbl_mss_val_sht_pck:long_name = "record variable, double, packed as short, with short missing values"; + rec_var_dbl_mss_val_sht_pck:purpose = "Packed version of rec_var_dbl_mss_val_sht_upk"; + rec_var_dbl_mss_val_sht_pck:_FillValue = -999s; + rec_var_dbl_mss_val_sht_pck:missing_value = -999s; + rec_var_dbl_mss_val_sht_pck:scale_factor = -9.15541313801785e-05; + rec_var_dbl_mss_val_sht_pck:add_offset = 5.; + + short scl_dbl_pck; + scl_dbl_pck:long_name = "scalar variable, double, packed"; + scl_dbl_pck:purpose = "Packed version of number with ncdiff subtraction bug"; + scl_dbl_pck:scale_factor = -9.15541313801785e-05; + scl_dbl_pck:add_offset = 5.; + + float rec_var_flt_mss_val_flt(time); + rec_var_flt_mss_val_flt:long_name = "record variable, float, with float missing values"; + rec_var_flt_mss_val_flt:_FillValue = 1.0e36f; + + float rec_var_flt_mss_val_flt_all(time); + rec_var_flt_mss_val_flt_all:long_name = "record variable, float, with float missing values in every position"; + rec_var_flt_mss_val_flt_all:_FillValue = 1.0e36f; + + float rec_var_flt_mss_val_flt_all_but_one(time); + rec_var_flt_mss_val_flt_all_but_one:long_name = "record variable, float, with float missing values in every position but one"; + rec_var_flt_mss_val_flt_all_but_one:_FillValue = 1.0e36f; + + float rec_var_flt_mss_val_flt_all_but_two(time); + rec_var_flt_mss_val_flt_all_but_two:long_name = "record variable, float, with float missing values in every position but two"; + rec_var_flt_mss_val_flt_all_but_two:_FillValue = 1.0e36f; + + short rec_var_flt_pck(time); + rec_var_flt_pck:long_name = "record variable, float, packed into short"; + rec_var_flt_pck:purpose = "Demonstrate that rounding of means of packed data are handled correctly"; + rec_var_flt_pck:scale_factor = 0.1f; + rec_var_flt_pck:add_offset = 100.0f; + + short rec_var_dbl_pck(time); + rec_var_dbl_pck:long_name = "record variable, double, packed into short"; + rec_var_dbl_pck:purpose = "Demonstrate that rounding of means of packed data are handled correctly"; + rec_var_dbl_pck:scale_factor = 0.1; + rec_var_dbl_pck:add_offset = 100.0; + + short non_rec_var_flt_pck(lon); + non_rec_var_flt_pck:long_name = "regular variable, float, packed into short"; + non_rec_var_flt_pck:purpose = "Demonstrate that non-rec dim packed vars are handled correctly"; + non_rec_var_flt_pck:scale_factor = 0.1f; + non_rec_var_flt_pck:add_offset = 100.0f; + + float rec_var_flt_mss_val_dbl(time); + rec_var_flt_mss_val_dbl:long_name = "record variable, float, with double missing values"; + rec_var_flt_mss_val_dbl:_FillValue = 1.0e36f; + rec_var_flt_mss_val_dbl:missing_value = 1.0e36f; + rec_var_flt_mss_val_dbl:note = "The correct average of this variable is 5.0. The correct sum of this variable is 35."; + + float rec_var_flt_mss_val_int(time); + rec_var_flt_mss_val_int:long_name = "record variable, float, with integer missing values"; +// Using intended _FillValue type breaks ncgen (with "_FillValue type mismatch")in netCDF 4.1.1 so comment-out for simplicity +// rec_var_flt_mss_val_int:_FillValue = -999; + rec_var_flt_mss_val_int:_FillValue = -999.0f; + rec_var_flt_mss_val_int:missing_value = -999; + + int rec_var_int_mss_val_int(time); + rec_var_int_mss_val_int:long_name = "record variable, integer, with integer missing values"; + rec_var_int_mss_val_int:_FillValue = -999; + + int rec_var_int_mss_val_flt(time); + rec_var_int_mss_val_flt:long_name = "record variable, integer, with float missing values"; +// Using intended _FillValue type breaks ncgen (with "_FillValue type mismatch")in netCDF 4.1.1 so comment-out for simplicity +// rec_var_int_mss_val_flt:_FillValue = -999.0f; + rec_var_int_mss_val_flt:_FillValue = -999; + rec_var_int_mss_val_flt:missing_value = -999.0f; + + int rec_var_int_mss_val_dbl(time); + rec_var_int_mss_val_dbl:long_name = "record variable, integer, with double missing values"; +// Using intended _FillValue type breaks ncgen (with "_FillValue type mismatch")in netCDF 4.1.1 so comment-out for simplicity +// rec_var_int_mss_val_dbl:_FillValue = -999.0; + rec_var_int_mss_val_dbl:_FillValue = -999; + rec_var_int_mss_val_dbl:missing_value = -999.0; + + int rec_var_dbl_mss_val_dbl_pck_lng(time); + rec_var_dbl_mss_val_dbl_pck_lng:long_name = "record variable, double packed as long, with double missing values"; + rec_var_dbl_mss_val_dbl_pck_lng:purpose = "although not usual, packing doubles into longs (rather than shorts) offers considerable space savings"; +// Using intended _FillValue type breaks ncgen (with "_FillValue type mismatch")in netCDF 4.1.1 so comment-out for simplicity +// rec_var_dbl_mss_val_dbl_pck_lng:_FillValue = -999.0; + rec_var_dbl_mss_val_dbl_pck_lng:_FillValue = -999; + rec_var_dbl_mss_val_dbl_pck_lng:missing_value = -999.0; + rec_var_dbl_mss_val_dbl_pck_lng:scale_factor = -9.15541313801785e-05; + rec_var_dbl_mss_val_dbl_pck_lng:add_offset = 5.; + + short rec_var_dbl_mss_val_sht_pck_sht(time); + rec_var_dbl_mss_val_sht_pck_sht:long_name = "record variable, double packed as short, with short missing values"; + rec_var_dbl_mss_val_sht_pck_sht:_FillValue = -999s; + rec_var_dbl_mss_val_sht_pck_sht:scale_factor = -9.15541313801785e-05; + rec_var_dbl_mss_val_sht_pck_sht:add_offset = 5.; + + char one_dmn_rec_var_sng(time); + one_dmn_rec_var_sng:long_name = "one dimensional record variable of string"; + one_dmn_rec_var_sng:NB = "20131222: HDF4 ncgen fails on this variable: /usr/bin/hncgen -b -o ~/in.hdf ~/nco/data/in.cdl produces error message that \"string won't fit in this variable\""; + + float time_lon(time,lon); + time_lon:long_name = "Record variable of longitude coordinate"; + + char two_dmn_rec_var_sng(time,lev); + two_dmn_rec_var_sng:long_name = "two dimensional record variable of string"; + + float two_dmn_rec_var(time,lev); + two_dmn_rec_var:long_name = "two dimensional record variable"; + two_dmn_rec_var:units = "watt meter-2"; + + float three_dmn_rec_var(time,lat,lon); + three_dmn_rec_var:long_name = "three dimensional record variable"; + three_dmn_rec_var:units = "watt meter-2"; + three_dmn_rec_var:coordinates = "time lat lon"; + + double three_dmn_var_dbl(time,lat,lon); + three_dmn_var_dbl:long_name = "three dimensional record variable of type double"; + three_dmn_var_dbl:units = "watt meter-2"; + three_dmn_var_dbl:_FillValue = -99.; + + int three_dmn_var_int(time,lat,lon); + three_dmn_var_int:long_name = "three dimensional record variable of type int"; + three_dmn_var_int:units = "watt meter-2"; + three_dmn_var_int:_FillValue = -99; + + short three_dmn_var_sht(time,lat,lon); + three_dmn_var_sht:long_name = "three dimensional record variable"; + three_dmn_var_sht:units = "watt meter-2"; + three_dmn_var_sht:_FillValue = -99s; + + int th(time,lat,lon); + th:long_name = "three dimensional record variable"; + th:units = "watt meter-2"; + th:_FillValue = -99; + + float td(time,dgn); + td:long_name = "two dimensional record variable stored in td (time,dgn) order (dgn means degenerate, i.e., of size 1)"; + + float tx(time,lon); + tx:long_name = "two dimensional record variable stored in tx (time,lon) order"; + + float ty(time,lat); + ty:long_name = "two dimensional record variable stored in ty (time,lat) order"; + + float tz(time,lev); + tz:long_name = "two dimensional record variable stored in tz (time,lev) order"; + + float txyz(time,lon,lat,lev); + txyz:long_name = "four dimensional record variable stored in txyz (time,lon,lat,lev) order"; + + float four_dmn_rec_var(time,lat,lev,lon); + four_dmn_rec_var:long_name = "four dimensional record variable"; + four_dmn_rec_var:units = "watt meter-2"; + four_dmn_rec_var:coordinates = "time lat lev lon"; + +// double three_double_dmn(time,lon,lon); + + double time_udunits(time_udunits); + time_udunits:units = "hours since 1900-01-01 00:00:0.0"; + time_udunits:delta_t = "0000-00-00 06:00:0.0"; + time_udunits:purpose = "The dates specified in this variable are ~1999-12-08"; + + float u(time); + u:long_name = "Zonal wind speed"; + u:units = "meter second-1"; + + float v(time); + v:long_name = "Meridional wind speed"; + v:units = "meter second-1"; + + float var_1D_rct(lat_times_lon); + var_1D_rct:long_name = "Variable for 2D rectangular grid stored as 1D arrays"; + + float var_1D_rrg(lat_times_lon); + var_1D_rrg:long_name = "Variable for 2D irregular grid stored as 1D arrays"; + + float var_2D_rct(lat,lon); + var_2D_rct:long_name = "Variable for 2D rectangular grid stored as 2D array"; + + float var_2D_rrg(lat,lon); + var_2D_rrg:long_name = "Variable for 2D irregular grid stored as 2D array"; + + float var_nm-dash; + var_nm-dash:long_name = "Variable and attribute names include dash characters"; + var_nm-dash:att_nm-dash = 1.0e36f; + + float vld_rng(time); + vld_rng:long_name = "Temperature"; + vld_rng:purpose = "Array containing _FillValue at some locations, out-of-range values at other locations, and valid data in the remainder"; + vld_rng:_FillValue = -999.0f; + vld_rng:valid_min = 180.f; + vld_rng:valid_max = 360.f; + +// float var_nm.dot; +// var_nm.dot:long_name = "Variable and attribute names include dot characters"; +// 20070102: Periods in attribute names choke OPeNDAP from FC7 RPM TODO nco911 +// 20091105: Periods in attribute names choke ncgen from RHEL5 TODO nco911 +// var_nm.dot:att_nm.dot = 1.0e36f; + + float wnd_spd(time,lat,lon); + wnd_spd:long_name = "wind speed"; + wnd_spd:units = "meter second-1"; + wnd_spd:_FillValue = -999.0f; + +data: +// netCDF4-specific atomic types: +// None in this file +// netCDF3 atomic types: + att_var=10.0,10.1,10.20,10.3000,10.40101,10.500001,10.60000001,10.7000001,10.80,10.9900; + area=10.,10.; + area2=20.,5.; + area_asm=1.,2.; + bnd_var=1,2,3,4,5,6; + byt_arr=0,1,2,3,4,5,6,7; + byt_2D=0,1,2,3,4,5,6,7; + byt_3D=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23; + byt_3D_rec= 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,30,31,32, + 33,34,35,36,37,38,39,40, + 41,42,43,44,45,46,47,48, + 49,50,51,52,53,54,55,56, + 57,58,59,60,61,62,63,64, + 65,66,67,68,69,70,71,72, + 73,74,75,76,77,78,79,80; + byte_var='z'; + byte_var_neg=-122; + char_var="z"; + // 20131015: This confuses the XML parser + // char_var_multinul="\b\n\0"; + // char_var_multinul='0','\n','\0'; + char_var_nul='\0'; + char_var_space=" "; + cnv_CF_crd=273.1,273.2,273.3,273.4,273.5,273.6,273.7,273.8; + cnv_CF_ncl=1.,2.,3.,4.,5.,6.,7.,8.,9.,10.; + cnv_CF_ncl_var_1=11.,22.,23.,24.,25.,26.,27.,28.,29.,30.; + cnv_CF_ncl_var_2=21.,32.,33.,34.,35.,36.,37.,38.,39.,40.; + date_int=1964,3,12,12,9; + dgn=73; + dgn_var=73; + double_var=10.; + double_var2=10.; + dps_dry=73; + dps_wet=73; + dps_ttl=73; + e_dbl=2.71828182846; + e_flt=2.71828182846; +// 20100809: Single quotes around NC_CHAR coordinates required as of 4.1.2-beta1-snapshot2010080820 +// 20100809: Double quotes cause "String constant too long" error in ncgen + fl_dmn='a','b','3'; + fl_nm="/home/zender/nco/data/in.cdl"; + float_var=10.; + four=4.; + g=9.8; + gw=10.,10.; + gw_T42=-87.863799,-85.096527,-82.312913,-79.525607,-76.736900,-73.947515,-71.157752,-68.367756,-65.577607,-62.787352,-59.997020,-57.206632,-54.416200,-51.625734,-48.835241,-46.044727,-43.254195,-40.463648,-37.673090,-34.882521,-32.091944,-29.301360,-26.510769,-23.720174,-20.929574,-18.138971,-15.348365,-12.557756,-9.767146,-6.976534,-4.185921,-1.395307,1.395307,4.185921,6.976534,9.767146,12.557756,15.348365,18.138971,20.929574,23.720174,26.510769,29.301360,32.091944,34.882521,37.673090,40.463648,43.254195,46.044727,48.835241,51.625734,54.416200,57.206632,59.997020,62.787352,65.577607,68.367756,71.157752,73.947515,76.736900,79.525607,82.312913,85.096527,87.863799; + hyam=0.0036,0.0019894,0.0; + hyai=0.002255,0.0438226,0.0,0.0; + hybm=0.0,0.52,0.992; + hybi=0.0,0.457453,0.985,1.0; + P0=100000; + gds_crd=0,1,2,3,4,5,6,7; + gds_var=273.1,273.2,273.3,273.4,273.5,273.6,273.7,273.8; + gds_var_ncd=273.1,273.2,273.3,273.4,273.5,273.6,273.7,273.8; + gds_3dvar=273.1,273.2,273.3,273.4,273.5,273.6,273.7,273.8, + 274.1,274.2,274.3,274.4,274.5,274.6,274.7,274.8, + 275.1,275.2,275.3,275.4,275.5,274.5,275.7,275.8, + 276.1,276.2,276.3,276.4,276.5,276.5,276.7,276.8, + 277.1,277.2,277.3,277.4,277.5,277.5,277.7,277.8, + 278.1,278.2,278.3,278.4,278.5,278.6,278.7,278.8, + 279.1,279.2,279.3,279.4,279.5,279.9,279.7,279.8, + 280.1,280.2,280.3,280.4,280.5,280.9,280.7,280.8, + 281.1,281.2,281.3,281.4,281.5,281.9,281.7,281.8, + 282.1,282.2,282.3,282.4,282.5,282.9,282.7,282.8; + lat_gds=-90, -30, -30, 0, 0, 30, 30, 90; + lon_gds= 0, 0, 180, 0, 180, 0, 180, 0; + lat_gds_ncd=-90, -30, -30, 0, 0, 30, 30, 90; + lon_gds_ncd= 0, 0, 180, 0, 180, 0, 180, 0; + lat=-90,90; + lat_bnd=-90,0,0,90; + lat_cal=1.,2.,3.,4.,5.,6.,7.,8.,9.,10.; + lon_cal=1.,2.,3.,4.,5.,6.,7.,8.,9.,10.; + lat_times_lon=0,1,2,3,4,5,6,7; + lat_times_lon_nbr=8; + lat_1D_rct=-90, -90, -90, -90, 90, 90, 90, 90; + lon_1D_rct= 0, 90, 180, 270, 0, 90, 180, 270; + lat_1D_rrg=-90, -30, -30, 0, 0, 30, 30, 90; + lon_1D_rrg= 0, 0, 180, 0, 180, 0, 180, 0; + lat_2D_rct=-90, -90, -90, -90, 90, 90, 90, 90; + lon_2D_rct= 0, 90, 180, 270, 0, 90, 180, 270; + lat_2D_rrg=-90, -30, -30, 0, 0, 30, 30, 90; + lon_2D_rrg= 0, 0, 180, 0, 180, 0, 180, 0; + lat_grd=-90,0,90; + lat_cpy=-90,90; + lat_var=1.,2.; + lat_wgt=1.,2.; +// lat_T42=0,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,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63; + lat_T42=-88.240089,-85.092445,-82.311981,-79.525253,-76.736732,-73.947418,-71.157700,-68.367722,-65.577576,-62.787331,-59.997005,-57.206619,-54.416191,-51.625729,-48.835236,-46.044724,-43.254192,-40.463646,-37.673088,-34.882519,-32.091942,-29.301357,-26.510769,-23.720173,-20.929573,-18.138969,-15.348364,-12.557755,-9.767145,-6.976533,-4.185921,-1.395307,1.395307,4.185921,6.976533,9.767145,12.557755,15.348364,18.138969,20.929573,23.720173,26.510769,29.301357,32.091942,34.882519,37.673088,40.463646,43.254192,46.044724,48.835236,51.625729,54.416191,57.206619,59.997005,62.787331,65.577576,68.367722,71.157700,73.947418,76.736732,79.525253,82.311981,85.092445,88.240089; + lsmlev=0.05,0.1,0.2,0.5,1.0,3.0; + lev=100,500,1000; + ilev=50,200,750,1005; + lev_bnd=0,300,300,750,750,1013.25; + lev_cpy=100,500,1000; + lev_var=100.,500.,1000.; + lev_wgt=10,2,1; + lon=0,90,180,270; + Lon=-180,-90,0,90; + Lat=-45,45; + LatLon=0,1,2,3,4,5,6,7; + lond=0,90,180,270; + lonf=0,90,180,270; + lon_grd=-45,45,135,225,315; + lon_wgt=0.347855,0.652145,0.652145,0.347855; +// lon_T42=0,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,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127; + lon_T42=0.000000,2.812500,5.625000,8.437500,11.250000,14.062500,16.875000,19.687500,22.500000,25.312500,28.125000,30.937500,33.750000,36.562500,39.375000,42.187500,45.000000,47.812500,50.625000,53.437500,56.250000,59.062500,61.875000,64.687500,67.500000,70.312500,73.125000,75.937500,78.750000,81.562500,84.375000,87.187500,90.000000,92.812500,95.625000,98.437500,101.250000,104.062500,106.875000,109.687500,112.500000,115.312500,118.125000,120.937500,123.750000,126.562500,129.375000,132.187500,135.000000,137.812500,140.625000,143.437500,146.250000,149.062500,151.875000,154.687500,157.500000,160.312500,163.125000,165.937500,168.750000,171.562500,174.375000,177.187500,180.000000,182.812500,185.625000,188.437500,191.250000,194.062500,196.875000,199.687500,202.500000,205.312500,208.125000,210.937500,213.750000,216.562500,219.375000,222.187500,225.000000,227.812500,230.625000,233.437500,236.250000,239.062500,241.875000,244.687500,247.500000,250.312500,253.125000,255.937500,258.750000,261.562500,264.375000,267.187500,270.000000,272.812500,275.625000,278.437500,281.250000,284.062500,286.875000,289.687500,292.500000,295.312500,298.125000,300.937500,303.750000,306.562500,309.375000,312.187500,315.000000,317.812500,320.625000,323.437500,326.250000,329.062500,331.875000,334.687500,337.500000,340.312500,343.125000,345.937500,348.750000,351.562500,354.375000,357.187500; + ppc_dbl=0.0,0.1,0.12,0.123,0.1234,0.12345,0.123456,0.1234567,0.12345678,0.123456789; + ppc_flt=0.0,0.1,0.12,0.123,0.1234,0.12345,0.123456,0.1234567,0.12345678,0.123456789; + ppc_big=123456789e-10,123456789e-9,123456789e-8,123456789e-7,123456789e-6,123456789e-5,123456789e-4,123456789e-3,123456789e-2,123456789e-1; + ppc_bgr=1234567890e20,1234567890e19,1234567890e18,1234567890e17,1234567890e16,1234567890e15,1234567890e14,1234567890e13,1234567890e12,1234567890e11; + ppc_bgr_scl=1234567890e11; + ppc_hgh=0.00000000000000000000,0.10000000000000000000,0.12000000000000000000,0.123000000000000000000,0.1234000000000000000,0.12345000000000000000,0.123456000000000000000000,0.12345670000000000000000000,0.123456780000000000000,0.123456789000000000000; + ppc_hgr=0.123456789000000000000,0.1234567890100000000000,0.1234567890120000000000,0.12345678901230000000000,0.123456789012340000000,0.12345678901234500000,0.12345678901234560000,0.12345678901234567000,0.12345678901234567800,0.12345678901234567890; + ppc_zro_flt=0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0; + ppc_zro_dbl=0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0; + ppc_zro_int=0,0,0,0,0,0,0,0,0,0; + var_msk=0.,1.,0.,0.,1.,1.,0.,2.; + ORO=0.,1.,0.,0.,1.,1.,0.,2.; + mask=0.,1.,0.,0.,1.,1.,0.,2.; +// mask=0.,0.,0.,0.,0.,0.,0.,0.; +// mask=1.,1.,1.,1.,1.,1.,1.,1.; + fll_val=73,-999,73,-999; + fll_val_mss_val=73,-999,73,-999; + md5_a="a"; + md5_abc="abc"; + msk_prt_mss_prt=0.5,1.0e36,1.5,1.0e36; + mss_val=73,1.0e36,73,1.0e36; + mss_val_all=1.0e36,1.0e36,1.0e36,1.0e36; + mss_val_fst=-999,73,-999,73; + mss_val_scl=1.0e36; + // nan_arr=0,nan; + nan_arr=0,73; +// nan_scl=nan; + nan_scl=1; + negative_one=-1.; + nm_pnd=1; + nm_spc=1; + no_mss_val=73,1.0e36,73,1.0e36; + non_nul_trm_char_one_dmn='a','b'; + non_nul_trm_char_two_dmn="abcd","efgh","ijkm"; + one=1.; + one_dmn_rec_var=1,2,3,4,5,6,7,8,9,10; + one_dmn_rec_wgt=2,1,0,0,0,0,0,0,0,0; + one_dmn_rec_var_unsorted=10,4,6,2,8,1,9,7,3,5; + one_dmn_rec_var_flt=1,2,3,4,5,6,7,8,9,10; + one_dmn_rec_var_flt_mss=_,2,3,4,5,6,7,8,9,_; + one_dmn_rec_var_flt_scl=1,2,3,4,5,6,7,8,9,10; +// First use of underscore to indicate _FillValue in in.cdl is here in one_dmn_rec_var_flt_mss_scl on 20140916 + one_dmn_rec_var_flt_mss_scl=_,2,3,4,5,6,7,8,9,_; + one_dmn_rec_var_dbl=1,2,3,4,5,6,7,8,9,10; + one_dmn_rec_var_missing_value=1,2,3,4,5,6,7,8,9,1.0e36; + one_dmn_rec_var_mss_val=1.0e36,1.0e36,1.0e36,1.0e36,1.0e36,1.0e36,1.0e36,1.0e36,1.0e36,1.0e36; + one_dmn_rec_var_mss_val_arr=1,2,3,4,5,6,7,8,9,10; + one_dmn_rec_var__FillValue=1,2,3,4,5,6,7,8,9,1.0e36; + one_dmn_rec_var_unsorted__FillValue=1.0e36,4,6,2,8,1,9,7,3,5; + one_dmn_rec_var_mdn=1,1,2,2,2,2,10,10,10,10; + one_dmn_rec_var_mdn__FillValue=1,-999,2,2,-999,-999,10,10,10,-999; + RDM=1,9,36,84,126,126,84,36,9,1; + one_dmn_rec_var_sng="Hello Worl"; + one_dmn_var=1.,10.; + one_dmn_int_val_one=1,1; + one_dmn_int_val_two=2,2; + pck=1; + pck_3=1; + pck_5=2; + pck_7=1; + rec_var_pck_scale_factor_only=1,2,3,4,5,6,7,8,9,10; + pck_arr=-32767,0,1,32767; + pi=3.1415926535897932384626433832795029; + upk=3.; + upk_arr=-32767.,0.,1.,32767.; + H2O=1.0; + H2OH2O=1.0; + H2SO4=1.0; + H2O_lqd=1.0; + H2O_ice=1.0; + Q=1.0e36; + Q1=1.0e36; + AQ01=1.0e36; + QQ01=1.0e36; + QA01=1.0e36; + Q01Q=1.0e36; + Q01=1; + Q02=2; + Q03=3; + Q04=4; + Q05=5; + Q06=6; + Q07=7; + Q08=8; + Q09=9; + Q10=10; + Q11=11; + Q12=12; + Q13=13; + Q14=14; + Q15=15; + Q16=16; + Q17=17; + Q18=18; + Q19=19; + Q20=20; + Q21=21; + Q22=22; + Q23=23; + Q24=24; + Q25=25; + Q26=26; + Q27=27; + Q28=28; + Q29=29; + Q30=30; + Q31=31; + Q32=32; + Q33=33; + Q34=34; + Q35=35; + Q36=36; + Q37=37; + Q38=38; + Q39=39; + Q40=40; + Q41=41; + Q42=42; + Q43=43; + Q44=44; + Q45=45; + Q46=46; + Q47=47; + Q48=48; + Q49=49; + Q50=50; + Q51=51; + Q52=52; + Q53=53; + Q54=54; + Q55=55; + Q56=56; + Q57=57; + Q58=58; + Q59=59; + Q60=60; + Q61=61; + Q62=62; + Q63=63; + Q64=64; + Q65=65; + Q66=66; + Q67=67; + Q68=68; + Q69=69; + Q70=70; + Q71=71; + Q72=72; + Q73=73; + Q74=74; + Q75=75; + Q76=76; + Q77=77; + Q78=78; + Q79=79; + Q80=80; + Q81=81; + Q82=82; + Q83=83; + Q84=84; + Q85=85; + Q86=86; + Q87=87; + Q88=88; + Q89=89; + Q90=90; + Q91=91; + Q92=92; + Q93=93; + Q94=94; + Q95=95; + Q96=96; + Q97=97; + Q98=98; + Q99=99; + Q100=100; + non_rec_var_flt_pck=1,2,3,4; + rec_var_dbl=1.,2.,3.,4.,5.,6.,7.,8.,9.,10.; + rec_var_dbl_mss_val_dbl_pck=-999,32767,21845,10922,0,-10922,-21845,-32767,-999,-999; + rec_var_dbl_mss_val_dbl_pck_lng=-999,32767,21845,10922,0,-10922,-21845,-32767,-999,-999; + rec_var_dbl_mss_val_sht_pck_sht=-999,32767,21845,10922,0,-10922,-21845,-32767,-999,-999; + rec_var_dbl_mss_val_dbl_upk=-999.,2.,3.,4.,5.,6.,7.,8.,-999.,-999.; + rec_var_dbl_mss_val_sht_pck=-999,32767,21845,10922,0,-10922,-21845,-32767,-999,-999; + rec_var_dbl_mss_val_sht_upk=-999.,2.,3.,4.,5.,6.,7.,8.,-999.,-999.; + rec_var_dbl_pck=1,2,3,4,5,6,7,8,9,10; + rec_var_flt=1.,2.,3.,4.,5.,6.,7.,8.,9.,10.; + rec_var_flt_mss_val_dbl=1.0e36,2.,3.,4.,5.,6.,7.,8.,1.0e36,1.0e36; + rec_var_flt_mss_val_flt=1.0e36,2.,3.,4.,5.,6.,7.,8.,1.0e36,1.0e36; + rec_var_flt_mss_val_flt_all=1.0e36,1.0e36,1.0e36,1.0e36,1.0e36,1.0e36,1.0e36,1.0e36,1.0e36,1.0e36; + rec_var_flt_mss_val_flt_all_but_one=1.0e36,1.0e36,1.0e36,1.0e36,5.0,1.0e36,1.0e36,1.0e36,1.0e36,1.0e36; + rec_var_flt_mss_val_flt_all_but_two=1.0e36,1.0e36,1.0e36,1.0e36,5.0,1.0e36,1.0e36,1.0e36,1.0e36,10.0; + rec_var_flt_mss_val_int=-999.,2.,3.,4.,5.,6.,7.,8.,-999.,-999.; + rec_var_flt_pck=1,2,3,4,5,6,7,8,9,10; + rec_var_int_mss_val_dbl=-999,2,3,4,5,6,7,8,-999,-999; + rec_var_int_mss_val_flt=-999,2,3,4,5,6,7,8,-999,-999; + rec_var_int_mss_val_int=-999,2,3,4,5,6,7,8,-999,-999; + rlev=1000,500,100; + rz=0,5000,17000; + scl_dbl_pck=10922; + scalar_var=10.; + short_var=10; + three=3.; + three_dmn_var=0.,1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,11.,12.,13.,14.,15.,16.,17.,18.,19.,20.,21.,22.,23.; + three_dmn_var_crd=0.,1.,2.,3.,12.,13.,14.,15.,4.,5.,6.,7.,16.,17.,18.,19.,8.,9.,10.,11.,20.,21.,22.,23.; + time=1.,2.,3.,4.,5.,6.,7.,8.,9.,10.; + time_bnds=0.5,1.5,1.5,2.5,2.5,3.5,3.5,4.5,4.5,5.5,5.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5,9.5,10.5; + climatology_bounds=0.5,1.5,1.5,2.5,2.5,3.5,3.5,4.5,4.5,5.5,5.5,6.5,6.5,7.5,7.5,8.5,8.5,9.5,9.5,10.5; + tm_std=59; + tm_grg=59; + tm_jln=59; + tm_360=59; + tm_365=59; + tm_366=59; + od=20,22,24,26,28,30,32,34,36,38; + tpt=273.1,273.2,273.3,273.4,273.5,273.6,273.7,273.8,273.9,274.0; + tpt_flt=273.1,273.2,273.3,273.4,273.5,273.6,273.7,273.8,273.9,274.0; + tpt_dbl=273.1,273.2,273.3,273.4,273.5,273.6,273.7,273.8,273.9,274.0; + two=2.; + two_dmn_var=1.5,5.5,9.5,13.5,17.5,21.5; + u=1.,0.,1.,0.,1.,0.,1.,0.,1.,0.; + v=0.,1.,0.,1.,0.,1.,0.,1.,0.,1.; + val_half=0.5; + val_half_half=0.5,0.5; + val_max_max_sht=17000,17000; + val_eminusten=1.1e-10; + val_one_int=1; + val_one_mss=1.,1.0e36; + val_one_mss_int=1,-99; + val_one_one_int=1,1; + var_nm-dash=1.0; +// var_nm.dot=1.0; + var_1D_rct=0.,1.,0.,0.,1.,1.,0.,2.; + var_1D_rrg=0.,1.,0.,0.,1.,1.,0.,2.; + var_2D_rct=0.,1.,0.,0.,1.,1.,0.,2.; + var_2D_rrg=0.,1.,0.,0.,1.,1.,0.,2.; + weight=10.,10.; + wgt_one=1.,1.; + wvl=0.5e-6,1.0e-6; + z=17000,5000,0; + zero=0.; +// date=640312,640313,640314,640315,640316,640317,640318,640319,640320,640321; + date=640224,640225,640226,640227,640228,640301,640302,640303,640304,640305; + int_var=10; + long_var=10; + nbdate=640224; + fl_nm_arr="/data/zender/dstccm04/dstccm04_8589_01.nc", + "/data/zender/dstccm04/dstccm04_8589_02.nc", + "/data/zender/dstccm04/dstccm04_8589_03.nc"; + fl_nm_rec="/data/zender/dstccm04/dstccm04_8589_01.nc", + "/data/zender/dstccm04/dstccm04_8589_02.nc", + "/data/zender/dstccm04/dstccm04_8589_03.nc", + "/data/zender/dstccm04/dstccm04_8589_04.nc", + "/data/zender/dstccm04/dstccm04_8589_05.nc", + "/data/zender/dstccm04/dstccm04_8589_06.nc", + "/data/zender/dstccm04/dstccm04_8589_07.nc", + "/data/zender/dstccm04/dstccm04_8589_08.nc", + "/data/zender/dstccm04/dstccm04_8589_09.nc", + "/data/zender/dstccm04/dstccm04_8589_10.nc"; + date_rec="2010-11-01T00:00:00.000000", + "2010-11-01T01:00:00.000000", + "2010-11-01T02:00:00.000000", + "2010-11-01T03:00:00.000000", + "2010-11-01T04:00:00.000000", + "2010-11-01T05:00:00.000000", + "2010-11-01T06:00:00.000000", + "2010-11-01T07:00:00.000000", + "2010-11-01T08:00:00.000000", + "2010-11-01T09:00:00.000000"; + time_lon=0.0,90.0,180.0,270.0, + 0.0,90.0,180.0,270.0, + 0.0,90.0,180.0,270.0, + 0.0,90.0,180.0,270.0, + 0.0,90.0,180.0,270.0, + 0.0,90.0,180.0,270.0, + 0.0,90.0,180.0,270.0, + 0.0,90.0,180.0,270.0, + 0.0,90.0,180.0,270.0, + 0.0,90.0,180.0,270.0; + two_dmn_rec_var_sng="abc", + "bcd", + "cde", + "def", + "efg", + "fgh", + "ghi", + "hij", + "jkl", + "klm"; + two_dmn_rec_var=1.,2.0,3., + 1.,2.1,3., + 1.,2.2,3., + 1.,2.3,3., + 1.,2.4,3., + 1.,2.5,3., + 1.,2.6,3., + 1.,2.7,3., + 1.,2.8,3., + 1.,2.9,3.; + three_dmn_rec_var= 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,30,31,32, + 33,34,35,36,37,38,39,40, + 41,42,43,44,45,46,47,48, + 49,50,51,52,53,54,55,56, + 57,58,59,60,61,62,63,64, + 65,66,67,68,69,70,71,72, + 73,74,75,76,77,78,79,80; + prs_sfc= 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,30,31,32, + 33,34,35,36,37,38,39,40, + 41,42,43,44,45,46,47,48, + 49,50,51,52,53,54,55,56, + 57,58,59,60,61,62,63,64, + 65,66,67,68,69,70,71,72, + 73,74,75,76,77,78,79,80; + PS= 101325,101325,101325,101325,101325,101325,101325,101325, + 101325,101325,101325,101325,101325,101325,101325,101325, + 101325,101325,101325,101325,101325,101325,101325,101325, + 101325,101325,101325,101325,101325,101325,101325,101325, + 101325,101325,101325,101325,101325,101325,101325,101325, + 101325,101325,101325,101325,101325,101325,101325,101325, + 101325,101325,101325,101325,101325,101325,101325,101325, + 101325,101325,101325,101325,101325,101325,101325,101325, + 101325,101325,101325,101325,101325,101325,101325,101325, + 101325,101325,101325,101325,101325,101325,101325,101325; + three_dmn_var_dbl= 1, 2, 3, 4, 5, 6, 7, 8, + 9,10,11,12,13,14,15,16, + 17,18,19,20,21,22,23,24, + -99,-99,-99,-99,-99,-99,-99,-99, + 33,34,35,36,37,38,39,40, + 41,42,43,44,45,46,47,48, + 49,50,51,52,53,54,55,56, + -99,58,59,60,61,62,63,64, + 65,66,67,68,69,70,71,72, + -99,74,75,76,77,78,79,-99; + three_dmn_var_int= 1, 2, 3, 4, 5, 6, 7, 8, + 9,10,11,12,13,14,15,16, + -99,-99,-99,-99,-99,-99,-99,-99, + 25,26,27,28,29,30,31,32, + 33,34,35,36,37,38,39,40, + 41,-99,43,44,45,46,47,48, + 49,50,51,52,53,54,55,56, + -99,58,59,60,-99,62,63,64, + 65,-99,67,68,69,70,71,72, + -99,74,75,-99,77,78,79,80; + three_dmn_var_sht= 1, 2, 3, 4, 5, 6, 7, 8, + -99,10,11,12,13,14,15,16, + 17,18,19,20,21,22,23,24, + 25,26,27,28,29,30,31,32, + -99,34,35,-99,37,38,39,40, + 41,42,43,44,-99,46,47,48, + 49,50,51,52,53,54,55,56, + 57,58,59,-99,61,62,63,64, + 65,66,67,68,69,70,71,72, + -99,-99,-99,-99,-99,-99,-99,-99; + th= 1, 2, 3, 4, 5, 6, 7, 8, + 9,10,11,12,13,14,15,16, + 17,18,19,20,21,22,23,24, + -99,-99,-99,-99,-99,-99,-99,-99, + 33,34,35,36,37,38,39,40, + 41,42,43,44,45,46,47,48, + 49,50,51,52,53,54,55,56, + -99,58,59,60,61,62,63,64, + 65,66,67,68,69,70,71,72, + -99,74,75,76,77,78,79,-99; + four_dmn_rec_var= 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, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99,100,101,102,103,104,105,106,107,108, + 109,110,111,112,113,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,141,142,143,144, + 145,146,147,148,149,150,151,152,153,154,155,156, + 157,158,159,160,161,162,163,164,165,166,167,168, + 169,170,171,172,173,174,175,176,177,178,179,180, + 181,182,183,184,185,186,187,188,189,190,191,192, + 193,194,195,196,197,198,199,200,201,202,203,204, + 205,206,207,208,209,210,211,212,213,214,215,216, + 217,218,219,220,221,222,223,224,225,226,227,228, + 229,230,231,232,233,234,235,236,237,238,239,240; + td= 1,2,3,4,5,6,7,8,9,10; + tx= 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,30, + 31,32,33,34,35,36,37,38,39,40; + ty= 1,2,3,4,5,6,7,8,9,10, + 11,12,13,14,15,16,17,18,19,20; + tz= 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,30; + txyz= 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, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99,100,101,102,103,104,105,106,107,108, + 109,110,111,112,113,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,141,142,143,144, + 145,146,147,148,149,150,151,152,153,154,155,156, + 157,158,159,160,161,162,163,164,165,166,167,168, + 169,170,171,172,173,174,175,176,177,178,179,180, + 181,182,183,184,185,186,187,188,189,190,191,192, + 193,194,195,196,197,198,199,200,201,202,203,204, + 205,206,207,208,209,210,211,212,213,214,215,216, + 217,218,219,220,221,222,223,224,225,226,227,228, + 229,230,231,232,233,234,235,236,237,238,239,240; + +// three_double_dmn= 1, 2, 3, 4, 5, 6, 7, 8, +// 9,10,11,12,13,14,15,16, +// 17,18,19,20,21,22,23,24, +// -99,-99,-99,-99,-99,-99,-99,-99, +// 33,34,35,36,37,38,39,40, +// 41,42,43,44,45,46,47,48, +// 49,50,51,52,53,54,55,56, +// -99,58,59,60,61,62,63,64, +// 65,66,67,68,69,70,71,72, +// -99,74,75,76,77,78,79,-99, +// 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, +// 9.5,10.5,11.5,12.5,13.5,14.5,15.5,16.5, +// 17.5,18.5,19.5,20.5,21.5,22.5,23.5,24.5, +// -99.5,-99.5,-99.5,-99.5,-99.5,-99.5,-99.5,-99.5, +// 33.5,34.5,35.5,36.5,37.5,38.5,39.5,40.5, +// 41.5,42.5,43.5,44.5,45.5,46.5,47.5,48.5, +// 49.5,50.5,51.5,52.5,53.5,54.5,55.5,56.5, +// -99.5,58.5,59.5,60.5,61.5,62.5,63.5,64.5, +// 65.5,66.5,67.5,68.5,69.5,70.5,71.5,72.5, +// -99.5,74.5,75.5,76.5,77.5,78.5,79.5,-99.5; + + time_udunits = 876012, 876018, 876024; + + vld_rng= 273.,-999.,180.,179.,273.,360.,361.,1.0e36,-1.0e36,273.; + + wnd_spd= -999,0.5,1.5,0.5,1.5,0.5,1.5,0.5, + 0.5,-999,0.5,0.5,0.5,0.5,0.5,0.5, + 0.5,1.5,-999,1.5,0.5,1.5,0.5,1.5, + 0.5,0.5,0.5,-999,0.5,0.5,0.5,0.5, + 1.5,1.5,1.5,1.5,-999,1.5,1.5,1.5, + 0.5,0.5,0.5,0.5,0.5,-999,0.5,0.5, + 2.5,2.5,2.5,2.5,2.5,2.5,-999,2.5, + 0.5,0.5,0.5,0.5,0.5,0.5,0.5,-999, + 0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5, + 0.5,0.5,2.5,0.5,0.5,2.5,0.5,0.5; +} // end netcdf diff --git a/ncgen/run_tests.sh b/ncgen/run_tests.sh index fc1bdc8e5..1ecadb52e 100755 --- a/ncgen/run_tests.sh +++ b/ncgen/run_tests.sh @@ -29,6 +29,12 @@ if [ ! -f c5.nc ]; then exit 1 fi +echo "**** creating file to test ncf-345..." +./ncgen -b -o ncf345.nc $srcdir/ncf345.cdl +if [ ! -f ncf345.nc ]; then + echo "Failure." + exit 1 +fi echo "*** Test successful!" exit 0 From 0438339a8d58b5deb6d6265e7e3f17415972fb56 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 13 Nov 2015 10:49:32 -0700 Subject: [PATCH 02/39] Fleshed out test script. --- ncf345-mytest.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 ncf345-mytest.sh diff --git a/ncf345-mytest.sh b/ncf345-mytest.sh new file mode 100755 index 000000000..277611488 --- /dev/null +++ b/ncf345-mytest.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# +# git-bisect script for ncf-345. Note you need to put it outside +# the netcdf directory or it will disappear when git does its thing. +# + +mkdir -p build +cd build +cmake .. -DENABLE_TESTS=OFF -DBUILD_SHARED_LIBS=OFF +make -j 4 +ncgen/ncgen -b -o ~/Desktop/in.nc ~/Desktop/in.cdl +RES=$? +rm -f ~/Desktop/in.nc +cd .. +echo "Exiting: $RES" +exit $RES From c053de5d0c8871d272458a80d8d665fac4df754b Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Tue, 17 Nov 2015 11:26:38 -0700 Subject: [PATCH 03/39] Corrected a static-analysis detected error state where a null pointer could be passed to strcmp --- libdap2/ncd2dispatch.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libdap2/ncd2dispatch.c b/libdap2/ncd2dispatch.c index b33f2114a..6b1336c5c 100644 --- a/libdap2/ncd2dispatch.c +++ b/libdap2/ncd2dispatch.c @@ -1165,14 +1165,15 @@ fprintf(stderr,"conflict: %s[%lu] %s[%lu]\n", PANIC1("missing dim names: %s",dim1->ocname); /* search backward so we can delete duplicates */ for(j=nclistlength(basedims)-1;j>i;j--) { - CDFnode* dim2 = (CDFnode*)nclistget(basedims,j); - if(strcmp(dim1->ncfullname,dim2->ncfullname)==0) { + if(!dim1->ncfullname) continue; + CDFnode* dim2 = (CDFnode*)nclistget(basedims,j); + if(strcmp(dim1->ncfullname,dim2->ncfullname)==0) { /* complain and suppress one of them */ fprintf(stderr,"duplicate dim names: %s[%lu] %s[%lu]\n", - dim1->ncfullname,(unsigned long)dim1->dim.declsize, - dim2->ncfullname,(unsigned long)dim2->dim.declsize); + dim1->ncfullname,(unsigned long)dim1->dim.declsize, + dim2->ncfullname,(unsigned long)dim2->dim.declsize); nclistremove(basedims,j); - } + } } } From d72b1084946da808d0f40d255b881a2a3338ea6f Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Tue, 17 Nov 2015 16:31:29 -0700 Subject: [PATCH 04/39] Cleaning up netcdf status message. --- CMakeLists.txt | 1 + libnetcdf.settings.in | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a691170a..40239c32c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1604,6 +1604,7 @@ is_enabled(ENABLE_NETCDF_4 HAS_HDF5) is_enabled(USE_SZIP HAS_SZIP) is_enabled(STATUS_PNETCDF HAS_PNETCDF) is_enabled(STATUS_PARALLEL HAS_PARALLEL) +is_enabled(HDF5_IS_PARALLEL HAS_PARALLEL4) is_enabled(USE_DAP HAS_DAP) is_enabled(USE_DISKLESS HAS_DISKLESS) is_enabled(USE_MMAP HAS_MMAP) diff --git a/libnetcdf.settings.in b/libnetcdf.settings.in index 32f565eb0..b18624792 100644 --- a/libnetcdf.settings.in +++ b/libnetcdf.settings.in @@ -25,13 +25,12 @@ Extra libraries: @LIBS@ # Features -------- NetCDF-2 API: @HAS_NC2@ -NetCDF-4 API: @HAS_NC4@ CDF-5 Support: yes HDF4 Support: @HAS_HDF4@ -HDF5 Support: @HAS_HDF5@ +NetCDF-4 API: @HAS_NC4@ HDF5/SZIP Support: @HAS_SZIP@ -PNetCDF Support: @HAS_PNETCDF@ NC-4 Parallel Support: @HAS_PARALLEL4@ +PNetCDF Support: @HAS_PNETCDF@ DAP Support: @HAS_DAP@ Diskless Support: @HAS_DISKLESS@ MMap Support: @HAS_MMAP@ From 05034bfd57da959977a70d4820307893b9af990e Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Tue, 17 Nov 2015 17:14:22 -0700 Subject: [PATCH 05/39] More cleaning up of configuration status messages. --- CMakeLists.txt | 5 +++-- configure.ac | 13 +++++++------ libnetcdf.settings.in | 2 -- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 40239c32c..78c8434d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -454,7 +454,6 @@ IF(ENABLE_NETCDF_4) SET(USE_NETCDF4 ON CACHE BOOL "") SET(ENABLE_NETCDF_4 ON CACHE BOOL "") SET(ENABLE_NETCDF4 ON CACHE BOOL "") - ENDIF() # Option for building RPC @@ -506,6 +505,8 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4) CHECK_LIBRARY_EXISTS(hdf5 H5Pget_fapl_mpio "" HDF5_IS_PARALLEL_MPIO) IF(HDF5_IS_PARALLEL_MPIPOSIX OR HDF5_IS_PARALLEL_MPIO) SET(HDF5_IS_PARALLEL ON) + ELSE() + SET(HDF5_IS_PARALLEL OFF) ENDIF() IF(HDF5_IS_PARALLEL_MPIO) @@ -1604,7 +1605,7 @@ is_enabled(ENABLE_NETCDF_4 HAS_HDF5) is_enabled(USE_SZIP HAS_SZIP) is_enabled(STATUS_PNETCDF HAS_PNETCDF) is_enabled(STATUS_PARALLEL HAS_PARALLEL) -is_enabled(HDF5_IS_PARALLEL HAS_PARALLEL4) +is_enabled(ENABLE_PARALLEL4 HAS_PARALLEL4) is_enabled(USE_DAP HAS_DAP) is_enabled(USE_DISKLESS HAS_DISKLESS) is_enabled(USE_MMAP HAS_MMAP) diff --git a/configure.ac b/configure.ac index 561153893..1d1fb2b88 100644 --- a/configure.ac +++ b/configure.ac @@ -929,8 +929,10 @@ if test "x$enable_netcdf_4" = xyes; then # The user may have built HDF5 with the SZLIB library. if test "x$ac_cv_func_H5Z_SZIP" = xyes; then - AC_SEARCH_LIBS([SZ_Compress], [szip sz], [], []) + AC_SEARCH_LIBS([SZ_Compress], [szip sz], [], []) AC_DEFINE([USE_SZIP], [1], [if true, compile in szip compression in netCDF-4 variables]) + else + AC_DEFINE([USE_SZIP], [0], [if true, compile in szip compression in netCDF-4 variables]) fi if test "x$ac_cv_func_H5free_memory" = xyes; then @@ -960,9 +962,9 @@ fi # Should we suppress parallel io for netcdf-4? if test "x$enable_netcdf_4" = xyes ; then - AC_MSG_CHECKING([whether parallel I/O is enabled for netcdf-4]) - AC_ARG_ENABLE([parallel4], [AS_HELP_STRING([--disable-parallel4], - [disable parallel I/O for netcdf-4, even if it's enabled in libhdf5])]) + AC_MSG_CHECKING([whether parallel I/O is enabled for netcdf-4]) + AC_ARG_ENABLE([parallel4], [AS_HELP_STRING([--disable-parallel4], + [disable parallel I/O for netcdf-4, even if it's enabled in libhdf5] )]) test "x$enable_parallel4" = xno || enable_parallel4=yes AC_MSG_RESULT($enable_parallel4) else @@ -1199,12 +1201,11 @@ if test "x$enable_jna" = xyes ; then AC_DEFINE([JNA], [1], [if true, include JNA bug fix]) fi - AC_SUBST(NC_LIBS,[$NC_LIBS]) AC_SUBST(HAS_DAP,[$enable_dap]) AC_SUBST(HAS_NC2,[$nc_build_v2]) AC_SUBST(HAS_NC4,[$enable_netcdf_4]) -AC_SUBST(HAS_SZIP,[$ac_cv_func_H5Z_SZIP]) +AC_SUBST(HAS_SZIP,[$USE_SZIP]) AC_SUBST(HAS_HDF4,[$enable_hdf4]) AC_SUBST(HAS_PNETCDF,[$enable_pnetcdf]) AC_SUBST(HAS_HDF5,[$enable_netcdf_4]) diff --git a/libnetcdf.settings.in b/libnetcdf.settings.in index b18624792..5d7f5e0a8 100644 --- a/libnetcdf.settings.in +++ b/libnetcdf.settings.in @@ -25,10 +25,8 @@ Extra libraries: @LIBS@ # Features -------- NetCDF-2 API: @HAS_NC2@ -CDF-5 Support: yes HDF4 Support: @HAS_HDF4@ NetCDF-4 API: @HAS_NC4@ -HDF5/SZIP Support: @HAS_SZIP@ NC-4 Parallel Support: @HAS_PARALLEL4@ PNetCDF Support: @HAS_PNETCDF@ DAP Support: @HAS_DAP@ From 47e10591b4f3bf548fd9a2791c7814a16bd56a69 Mon Sep 17 00:00:00 2001 From: dmh Date: Thu, 19 Nov 2015 13:44:07 -0700 Subject: [PATCH 06/39] ckp --- RELEASE_NOTES.md | 10 +- cf | 4 +- cf.cmake | 2 +- configure.ac | 6 +- include/netcdf.h | 2 +- libdap2/ncd2dispatch.c | 3 +- ncdump/CMakeLists.txt | 5 + ncdump/Makefile.am | 15 +- ncdump/cdl/ref_tst_solar_1.cdl | 4 +- ncdump/ctests.sh | 2 +- ncdump/expected/c0.dmp | 4 +- ncdump/expected/ref_ctest1_nc4.dmp | 4 +- ncdump/expected/ref_ctest1_nc4c.dmp | 4 +- ncdump/expected/ref_tst_solar_1.dmp | 4 +- ncdump/inttags.cdl | 15 + ncdump/inttags4.cdl | 23 + ncdump/ncdump.c | 4 +- ncdump/ref_ctest1_nc4.cdl | 4 +- ncdump/ref_inttags.cdl | 15 + ncdump/ref_inttags4.cdl | 24 + ncdump/ref_tst_solar_1.cdl | 4 +- ncdump/run_back_comp_tests.sh | 1 + ncdump/run_tests.sh | 1 + ncdump/run_utf8_nc4_tests.sh | 1 + ncdump/run_utf8_tests.sh | 1 + ncdump/tst_64bit.sh | 1 + ncdump/tst_bom.sh | 1 + ncdump/tst_calendars.sh | 1 + ncdump/tst_charfill.sh | 1 + ncdump/tst_fillbug.sh | 1 + ncdump/tst_formatx3.sh | 1 + ncdump/tst_formatx4.sh | 1 + ncdump/tst_grp_spec.sh | 1 + ncdump/tst_h_scalar.sh | 1 + ncdump/tst_inmemory_nc3.sh | 2 +- ncdump/tst_inmemory_nc4.sh | 2 +- ncdump/tst_inttags.sh | 20 + ncdump/tst_inttags4.sh | 21 + ncdump/tst_iter.sh | 1 + ncdump/tst_lengths.sh | 2 +- ncdump/tst_mud.sh | 1 + ncdump/tst_nccopy3.sh | 1 + ncdump/tst_nccopy4.sh | 1 + ncdump/tst_ncgen4.sh | 1 + ncdump/tst_ncgen4_classic.sh | 1 + ncdump/tst_ncgen4_cycle.sh | 1 + ncdump/tst_ncgen4_diff.sh | 11 +- ncdump/tst_ncgen_shared.sh | 1 + ncdump/tst_netcdf4.sh | 2 + ncdump/tst_netcdf4_4.sh | 1 + ncdump/tst_output.sh | 1 + ncgen/CMakeLists.txt | 24 +- ncgen/Makefile.am | 21 +- ncgen/c0_4.cdl | 10 +- ncgen/cdata.c | 6 +- ncgen/data.c | 6 + ncgen/data.h | 2 + ncgen/generr.c | 20 +- ncgen/generr.h | 6 + ncgen/genlib.h | 7 - ncgen/main.c | 79 +- ncgen/ncgen.1 | 14 +- ncgen/ncgen.l | 330 +++--- ncgen/ncgen.y | 2 +- ncgen/{ncgenyy.c => ncgenl.c} | 1457 +++++++++++++-------------- ncgen/{ncgentab.c => ncgeny.c} | 10 +- ncgen/{ncgentab.h => ncgeny.h} | 2 +- ncgen/run_nc4_tests.sh | 5 + ncgen/run_tests.sh | 1 + ncgen/semantics.c | 118 ++- ncgen/util.c | 59 ++ ncgen/util.h | 7 +- 72 files changed, 1420 insertions(+), 1007 deletions(-) create mode 100644 ncdump/inttags.cdl create mode 100644 ncdump/inttags4.cdl create mode 100644 ncdump/ref_inttags.cdl create mode 100644 ncdump/ref_inttags4.cdl create mode 100755 ncdump/tst_inttags.sh create mode 100755 ncdump/tst_inttags4.sh rename ncgen/{ncgenyy.c => ncgenl.c} (63%) rename ncgen/{ncgentab.c => ncgeny.c} (99%) rename ncgen/{ncgentab.h => ncgeny.h} (99%) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 52ee3552c..ab0955ea4 100755 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -7,12 +7,20 @@ This file contains a high-level description of this package's evolution. Release ## 4.4.0 Released TBD +* Modified ncgen to properly handle the L and UL suffixes for integer constants + to keep backward compatibility. Now it is the case the single L suffix + (e.g. 111L) is treated as a 32 bit integer. This makes it consistent with + the fact that NC_LONG (netcdf.h) is an alias for NC_INT. Existing .cdl + files should be examined for occurrences of the L prefix to ensure that + this change will not affect them. + (see Github issue 156[https://github.com/Unidata/netcdf-c/issues/156]). + * Updated documentation to reference the new `NodeJS` interface to netcdf4, by Sven Willner. It is available from [https://www.npmjs.com/package/netcdf4](https://www.npmjs.com/package/netcdf4) or from the GitHub repository at [https://github.com/swillner/netcdf4-js](https://github.com/swillner/netcdf4-js). * Incorporated pull request https://github.com/Unidata/netcdf-c/pull/150 from Greg Sjaardema to remove the internal hard-wired use of `NC_MAX_DIMS`, instead using a dynamic memory allocation. ### 4.4.0-RC5 Released - November 11, 2015 - + * Added a fix for https://github.com/Unidata/netcdf-c/issues/149, which was reported several times in quick succession within an hour of the RC4 release. ### 4.4.0-RC4 Released - November 10, 2015 diff --git a/cf b/cf index 8594f83e9..907656400 100644 --- a/cf +++ b/cf @@ -7,8 +7,8 @@ FAST=1 FAST=1 -#HDF5=1 -#DAP=1 +HDF5=1 +DAP=1 #PNETCDF=1 #PAR4=1 diff --git a/cf.cmake b/cf.cmake index 92358dc3a..38c4eafd3 100644 --- a/cf.cmake +++ b/cf.cmake @@ -5,7 +5,7 @@ UL=/usr/local PPATH="$UL" ZLIB="-DZLIB_LIBRARY=${UL}/lib/libz.so -DZLIB_INCLUDE_DIR=${UL}/include" HDF5="-DHDF5_LIB=${UL}/lib/libhdf5.so -DHDF5_HL_LIB=${UL}/lib/libhdf5_hl.so -DHDF5_INCLUDE_DIR=${UL}/include" -CURL="-DCURL_LIBRARY=${UL}/lib/libcurl.so -DCURL_INCLUDE_DIR=${UL}/include" +CURL="-DCURL_LIBRARY=${UL}/lib/libcurl.so -DCURL_INCLUDE_DIR=${UL}/include -DCURL_INCLUDE_DIRS=${UL}/include" FLAGS="-DCMAKE_PREFIX_PATH=$PPATH" FLAGS="$FLAGS -DCMAKE_INSTALL_PREFIX=${UL}" FLAGS="$FLAGS -DCMAKE_PREFIX_PATH=$PPATH" diff --git a/configure.ac b/configure.ac index 561153893..742169f27 100644 --- a/configure.ac +++ b/configure.ac @@ -835,20 +835,22 @@ $SLEEPCMD AC_CHECK_SIZEOF(size_t) $SLEEPCMD AC_CHECK_SIZEOF(unsigned long long) -$SLEEPCMD +$SLEEPCMD if test "$ac_cv_type_ushort" = yes ; then AC_CHECK_SIZEOF(ushort) else AC_CHECK_SIZEOF(unsigned short int) fi -sleep 3 + +$SLEEPCMD if test "$ac_cv_type_uint" = yes ; then AC_CHECK_SIZEOF(uint) else AC_CHECK_SIZEOF(unsigned int) fi +$SLEEPCMD AC_CHECK_SIZEOF(unsigned long long) $SLEEPCMD diff --git a/include/netcdf.h b/include/netcdf.h index 4dd1e94a8..9ea8756e0 100644 --- a/include/netcdf.h +++ b/include/netcdf.h @@ -177,8 +177,8 @@ Use this in mode flags for both nc_create() and nc_open(). */ Note that the name in the contributed code NC_FORMAT_64BIT was renamed to NC_FORMAT_CDF2 */ -#define NC_FORMAT_64BIT (2) /**< \deprecated Saved for compatibility. Use NC_FORMAT_64BIT_OFFSET or NC_FORMAT_64BIT_DATA, from netCDF 4.4.0 onwards. */ #define NC_FORMAT_64BIT_OFFSET (2) +#define NC_FORMAT_64BIT (NC_FORMAT_64BIT_OFFSET) /**< \deprecated Saved for compatibility. Use NC_FORMAT_64BIT_OFFSET or NC_FORMAT_64BIT_DATA, from netCDF 4.4.0 onwards. */ #define NC_FORMAT_NETCDF4 (3) #define NC_FORMAT_NETCDF4_CLASSIC (4) #define NC_FORMAT_64BIT_DATA (5) diff --git a/libdap2/ncd2dispatch.c b/libdap2/ncd2dispatch.c index 6b1336c5c..66c7bc979 100644 --- a/libdap2/ncd2dispatch.c +++ b/libdap2/ncd2dispatch.c @@ -1160,13 +1160,14 @@ fprintf(stderr,"conflict: %s[%lu] %s[%lu]\n", /* Verify unique and defined names for dimensions*/ for(i=0;idim.basedim != NULL) PANIC1("nonbase basedim: %s\n",dim1->ncbasename); if(dim1->ncbasename == NULL || dim1->ncfullname == NULL) PANIC1("missing dim names: %s",dim1->ocname); /* search backward so we can delete duplicates */ for(j=nclistlength(basedims)-1;j>i;j--) { if(!dim1->ncfullname) continue; - CDFnode* dim2 = (CDFnode*)nclistget(basedims,j); + dim2 = (CDFnode*)nclistget(basedims,j); if(strcmp(dim1->ncfullname,dim2->ncfullname)==0) { /* complain and suppress one of them */ fprintf(stderr,"duplicate dim names: %s[%lu] %s[%lu]\n", diff --git a/ncdump/CMakeLists.txt b/ncdump/CMakeLists.txt index a7ebdd111..41dbc12ac 100644 --- a/ncdump/CMakeLists.txt +++ b/ncdump/CMakeLists.txt @@ -175,6 +175,11 @@ ENDIF() add_sh_test(ncdump tst_ncgen4) ENDIF() + add_sh_test(ncdump tst_inttags) + IF(USE_NETCDF4) + add_sh_test(ncdump tst_inttags4) + ENDIF() + ENDIF() diff --git a/ncdump/Makefile.am b/ncdump/Makefile.am index 5c6548adf..3ab3c8b87 100644 --- a/ncdump/Makefile.am +++ b/ncdump/Makefile.am @@ -29,7 +29,7 @@ if BUILD_TESTSETS #if !BUILD_DLL # These tests are run for both netCDF-4 and non-netCDF-4 builds. check_PROGRAMS = rewrite-scalar ctest ctest64 ncdump tst_utf8 bom -TESTS = run_tests.sh tst_64bit.sh ctest ctest64 tst_output.sh \ +TESTS = tst_inttags.sh run_tests.sh tst_64bit.sh ctest ctest64 tst_output.sh \ tst_lengths.sh tst_calendars.sh tst_utf8 run_utf8_tests.sh \ tst_nccopy3.sh tst_charfill.sh tst_iter.sh tst_formatx3.sh tst_bom.sh @@ -51,7 +51,7 @@ tst_enum_data tst_opaque_data tst_string_data tst_vlen_data tst_comp \ tst_comp2 tst_nans tst_special_atts tst_unicode tst_fillbug tst_compress \ tst_chunking tst_h_scalar tst_bug324 -TESTS += tst_create_files tst_group_data tst_enum_data tst_opaque_data \ +TESTS += tst_inttags4.sh tst_create_files tst_group_data tst_enum_data tst_opaque_data \ tst_string_data tst_vlen_data tst_comp tst_comp2 tst_nans \ tst_special_atts tst_netcdf4.sh tst_h_rdc0 tst_unicode tst_fillbug \ tst_fillbug.sh tst_netcdf4_4.sh tst_compress tst_nccopy4.sh \ @@ -109,9 +109,10 @@ tst_vlen_data.cdl tst_solar_1.cdl tst_format_att.cdl tst_inflated.nc \ tmp_subset.cdl tst_inflated4.nc tst_deflated.nc tst_chunking.nc tmp*.nc \ tst_charfill.nc tmp_tst_charfill.cdl \ iter.* \ -tst_nc_test_netcdf4_4_0.cdl tst_mud4.nc tst_mud4.cdl tst_mud4-bc.cdl \ -tst_ncf213.cdl tst_ncf213.nc tst_h_scalar.cdl tst_h_scalar.nc \ -tst_mud4_chars.cdl tst_mud4_chars.nc +tst_nc_test_netcdf4_4_0.cdl tst_mud4.nc tst_mud4.cdl tst_mud4-bc.cdl \ +tst_ncf213.cdl tst_ncf213.nc tst_h_scalar.cdl tst_h_scalar.nc \ +tst_mud4_chars.cdl tst_mud4_chars.nc \ +inttags.nc inttags4.nc tst_inttags.cdl tst_inttags4.cdl # These files all have to be included with the distribution. EXTRA_DIST = run_tests.sh tst_64bit.sh tst_output.sh test0.cdl \ @@ -132,10 +133,12 @@ ref_nc_test_netcdf4.cdl ref_tst_special_atts3.cdl tst_brecs.cdl \ ref_tst_grp_spec0.cdl ref_tst_grp_spec.cdl tst_grp_spec.sh \ ref_tst_charfill.cdl tst_charfill.cdl tst_charfill.sh \ tst_iter.sh tst_mud.sh ref_tst_mud4.cdl ref_tst_mud4-bc.cdl \ -ref_tst_mud4_chars.cdl \ +ref_tst_mud4_chars.cdl \ +inttags.cdl inttags4.cdl ref_inttags.cdl ref_inttags4.cdl \ ref_tst_ncf213.cdl tst_h_scalar.sh \ run_utf8_nc4_tests.sh \ tst_formatx3.sh tst_formatx4.sh ref_tst_utf8_4.cdl \ +tst_inttags.sh tst_inttags4.sh \ CMakeLists.txt XGetopt.c tst_bom.sh tst_inmemory_nc3.sh tst_inmemory_nc4.sh # CDL files and Expected results diff --git a/ncdump/cdl/ref_tst_solar_1.cdl b/ncdump/cdl/ref_tst_solar_1.cdl index c0e34bc62..5f2597428 100755 --- a/ncdump/cdl/ref_tst_solar_1.cdl +++ b/ncdump/cdl/ref_tst_solar_1.cdl @@ -4,14 +4,14 @@ dimensions: // global attributes: :Number_of_vogons = 2ub, 23ub, 230ub ; - :Number_of_vogon_poems = 23232244UL, 1214124123423UL, 2353424234UL ; + :Number_of_vogon_poems = 23232244ULL, 1214124123423ULL, 2353424234ULL ; group: solar_system { group: Earth { // global attributes: - :alien_concept_number_which_cannot_be_understood_by_humans = -23232244L, 1214124123423L, -2353424234L ; + :alien_concept_number_which_cannot_be_understood_by_humans = -23232244, 1214124123423, -2353424234 ; group: Luna { variables: diff --git a/ncdump/ctests.sh b/ncdump/ctests.sh index af507cff2..809ce98a0 100755 --- a/ncdump/ctests.sh +++ b/ncdump/ctests.sh @@ -1,6 +1,6 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi #set -e -set -x echo "*** ctests.sh: testing ncgen4 -c" KFLAG=3 diff --git a/ncdump/expected/c0.dmp b/ncdump/expected/c0.dmp index 10654ed5a..8a26bd3a3 100644 --- a/ncdump/expected/c0.dmp +++ b/ncdump/expected/c0.dmp @@ -20,7 +20,7 @@ variables: s:b = 0b, 127b, -128b, -1b ; s:s = -32768s, 0s, 32767s ; int i ; - i:i = -2147483647L, 0L, 2147483647L ; + i:i = -2147483647, 0, 2147483647 ; i:f = -1.e+36f, 0.f, 1.e+36f ; i:d = -1.e+308, 0., 1.e+308 ; float f ; @@ -102,7 +102,7 @@ variables: :Gc = "" ; :Gb = -128b, 127b ; :Gs = -32768s, 0s, 32767s ; - :Gi = -2147483647L, 0L, 2147483647L ; + :Gi = -2147483647, 0, 2147483647 ; :Gf = -1.e+36f, 0.f, 1.e+36f ; :Gd = -1.e+308, 0., 1.e+308 ; :Gatt-name-dashes = -1 ; diff --git a/ncdump/expected/ref_ctest1_nc4.dmp b/ncdump/expected/ref_ctest1_nc4.dmp index 8f355f095..52a0fab84 100644 --- a/ncdump/expected/ref_ctest1_nc4.dmp +++ b/ncdump/expected/ref_ctest1_nc4.dmp @@ -20,7 +20,7 @@ variables: s:b = 0b, 127b, -128b, -1b ; s:s = -32768s, 0s, 32767s ; int i ; - i:i = -2147483647L, 0L, 2147483647L ; + i:i = -2147483647, 0, 2147483647 ; i:f = -1.e+36f, 0.f, 1.e+36f ; i:d = -1.e+308, 0., 1.e+308 ; float f ; @@ -102,7 +102,7 @@ variables: :Gc = "" ; :Gb = -128b, 127b ; :Gs = -32768s, 0s, 32767s ; - :Gi = -2147483647L, 0L, 2147483647L ; + :Gi = -2147483647, 0, 2147483647 ; :Gf = -1.e+36f, 0.f, 1.e+36f ; :Gd = -1.e+308, 0., 1.e+308 ; :Gatt-name-dashes = -1 ; diff --git a/ncdump/expected/ref_ctest1_nc4c.dmp b/ncdump/expected/ref_ctest1_nc4c.dmp index d09facead..6f918c2f3 100644 --- a/ncdump/expected/ref_ctest1_nc4c.dmp +++ b/ncdump/expected/ref_ctest1_nc4c.dmp @@ -20,7 +20,7 @@ variables: s:b = 0b, 127b, -128b, -1b ; s:s = -32768s, 0s, 32767s ; int i ; - i:i = -2147483647L, 0L, 2147483647L ; + i:i = -2147483647, 0, 2147483647 ; i:f = -1.e+36f, 0.f, 1.e+36f ; i:d = -1.e+308, 0., 1.e+308 ; float f ; @@ -102,7 +102,7 @@ variables: :Gc = "" ; :Gb = -128b, 127b ; :Gs = -32768s, 0s, 32767s ; - :Gi = -2147483647L, 0L, 2147483647L ; + :Gi = -2147483647, 0, 2147483647 ; :Gf = -1.e+36f, 0.f, 1.e+36f ; :Gd = -1.e+308, 0., 1.e+308 ; :Gatt-name-dashes = -1 ; diff --git a/ncdump/expected/ref_tst_solar_1.dmp b/ncdump/expected/ref_tst_solar_1.dmp index 4ee0bc234..0c0e9f25a 100644 --- a/ncdump/expected/ref_tst_solar_1.dmp +++ b/ncdump/expected/ref_tst_solar_1.dmp @@ -4,14 +4,14 @@ dimensions: // global attributes: :Number_of_vogons = 2UB, 23UB, 230UB ; - :Number_of_vogon_poems = 23232244UL, 1214124123423UL, 2353424234UL ; + :Number_of_vogon_poems = 23232244ULL, 1214124123423ULL, 2353424234ULL ; group: solar_system { group: Earth { // group attributes: - :alien_concept_number_which_cannot_be_understood_by_humans = -23232244L, 1214124123423L, -2353424234L ; + :alien_concept_number_which_cannot_be_understood_by_humans = -23232244LL, 1214124123423LL, -2353424234LL ; group: Luna { variables: diff --git a/ncdump/inttags.cdl b/ncdump/inttags.cdl new file mode 100644 index 000000000..222665a75 --- /dev/null +++ b/ncdump/inttags.cdl @@ -0,0 +1,15 @@ +netcdf inttags { +dimensions: + d = 3 ; +variables: + byte b(d); + short s(d); + int i(d); +data: + + b = -127B, 127b, 255b ; + + s = 32767S, -32766s, 65535s; + + i = -2147483646L, 2147483647l, 4294967295l; +} diff --git a/ncdump/inttags4.cdl b/ncdump/inttags4.cdl new file mode 100644 index 000000000..806469c1d --- /dev/null +++ b/ncdump/inttags4.cdl @@ -0,0 +1,23 @@ +netcdf inttags64 { +dimensions: + d = 3 ; +variables: + ubyte ub(d); + ushort us(d); + uint ui(d); + int64 i64(d); + uint64 ui64(d); +// global attributes: + :attrll = -23232244LL, 1214124123423LL, -2353424234LL ; +data: + + ub = 255UB, 255ub, 255u ; + + us = 65534US, 65534us, 65534u ; + + ui = 4294967294UL, 4294967294ul, 4294967294u ; + + i64 = 9223372036854775807LL, 9223372036854775807ll, 9223372036854775807 ; + + ui64 = 18446744073709551615ULL, 18446744073709551615ull, 18446744073709551615u ; +} diff --git a/ncdump/ncdump.c b/ncdump/ncdump.c index 7e1c5ace2..d257cd754 100644 --- a/ncdump/ncdump.c +++ b/ncdump/ncdump.c @@ -606,11 +606,11 @@ pr_att_valgs( break; case NC_INT64: i64 = ((int64_t *) vals)[iel]; - printf ("%lldL%s", i64, delim); + printf ("%lldLL%s", i64, delim); break; case NC_UINT64: ui64 = ((uint64_t *) vals)[iel]; - printf ("%lluUL%s", ui64, delim); + printf ("%lluULL%s", ui64, delim); break; #ifdef USE_NETCDF4 case NC_STRING: diff --git a/ncdump/ref_ctest1_nc4.cdl b/ncdump/ref_ctest1_nc4.cdl index e6727dab7..ef6bbed95 100644 --- a/ncdump/ref_ctest1_nc4.cdl +++ b/ncdump/ref_ctest1_nc4.cdl @@ -28,9 +28,9 @@ variables: double d ; d:c = "abcd\tZ$&" ; int64 i64 ; - i64:att_int64 = 1L ; + i64:att_int64 = 1LL ; uint64 ui64 ; - ui64:att_uint64 = 1UL ; + ui64:att_uint64 = 1ULL ; char cr(Dr) ; byte br(Dr) ; short sr(Dr) ; diff --git a/ncdump/ref_inttags.cdl b/ncdump/ref_inttags.cdl new file mode 100644 index 000000000..5d70a4579 --- /dev/null +++ b/ncdump/ref_inttags.cdl @@ -0,0 +1,15 @@ +netcdf inttags { +dimensions: + d = 3 ; +variables: + byte b(d) ; + short s(d) ; + int i(d) ; +data: + + b = -127, 127, -1 ; + + s = 32767, -32766, -1 ; + + i = -2147483646, 2147483647, -1 ; +} diff --git a/ncdump/ref_inttags4.cdl b/ncdump/ref_inttags4.cdl new file mode 100644 index 000000000..92eb3338c --- /dev/null +++ b/ncdump/ref_inttags4.cdl @@ -0,0 +1,24 @@ +netcdf inttags4 { +dimensions: + d = 3 ; +variables: + ubyte ub(d) ; + ushort us(d) ; + uint ui(d) ; + int i64(d) ; + uint64 ui64(d) ; + +// global attributes: + :attrll = -23232244LL, 1214124123423LL, -2353424234LL ; +data: + + ub = 255, 255, 255 ; + + us = 65534, 65534, 65534 ; + + ui = 4294967294, 4294967294, 4294967294 ; + + i64 = -1, -1, -1 ; + + ui64 = 18446744073709551615, 18446744073709551615, 18446744073709551615 ; +} diff --git a/ncdump/ref_tst_solar_1.cdl b/ncdump/ref_tst_solar_1.cdl index deda1a896..5ff111cf0 100644 --- a/ncdump/ref_tst_solar_1.cdl +++ b/ncdump/ref_tst_solar_1.cdl @@ -4,14 +4,14 @@ dimensions: // global attributes: :Number_of_vogons = 2UB, 23UB, 230UB ; - :Number_of_vogon_poems = 23232244UL, 1214124123423UL, 2353424234UL ; + :Number_of_vogon_poems = 23232244ULL, 1214124123423ULL, 2353424234ULL ; group: solar_system { group: Earth { // group attributes: - :alien_concept_number_which_cannot_be_understood_by_humans = -23232244L, 1214124123423L, -2353424234L ; + :alien_concept_number_which_cannot_be_understood_by_humans = -23232244LL, 1214124123423LL, -2353424234LL ; group: Luna { variables: diff --git a/ncdump/run_back_comp_tests.sh b/ncdump/run_back_comp_tests.sh index c37ad02e5..14e554de1 100755 --- a/ncdump/run_back_comp_tests.sh +++ b/ncdump/run_back_comp_tests.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi # This shell script runs the backward compatibility tests. set -e diff --git a/ncdump/run_tests.sh b/ncdump/run_tests.sh index 4afaca411..cbf9c0aee 100755 --- a/ncdump/run_tests.sh +++ b/ncdump/run_tests.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi # This shell script runs the ncdump tests. # $Id: run_tests.sh,v 1.18 2010/05/19 13:43:39 ed Exp $ diff --git a/ncdump/run_utf8_nc4_tests.sh b/ncdump/run_utf8_nc4_tests.sh index 05a1f8645..000d808c6 100755 --- a/ncdump/run_utf8_nc4_tests.sh +++ b/ncdump/run_utf8_nc4_tests.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi # # Moving some netcdf-4 only tests here, out of tst_nccopy and run_utf8_tests. # Without this, the tests fail when netcdf-4 is disabled. diff --git a/ncdump/run_utf8_tests.sh b/ncdump/run_utf8_tests.sh index 7d9e8efe0..a40951355 100755 --- a/ncdump/run_utf8_tests.sh +++ b/ncdump/run_utf8_tests.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi # This shell script runs ncdump tests relating to the new UTF8 name stuff. # $Id:$ diff --git a/ncdump/tst_64bit.sh b/ncdump/tst_64bit.sh index b8a54680a..b8e871ebe 100755 --- a/ncdump/tst_64bit.sh +++ b/ncdump/tst_64bit.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi # This shell script runs the ncdump tests. # $Id: tst_64bit.sh,v 1.9 2006/03/04 18:50:15 ed Exp $ diff --git a/ncdump/tst_bom.sh b/ncdump/tst_bom.sh index bd9b4eb3e..53d2f89b1 100755 --- a/ncdump/tst_bom.sh +++ b/ncdump/tst_bom.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi # This shell script tests BOM support in ncgen set -e diff --git a/ncdump/tst_calendars.sh b/ncdump/tst_calendars.sh index 17ebbf993..8d2313f11 100755 --- a/ncdump/tst_calendars.sh +++ b/ncdump/tst_calendars.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi # This shell script tests ncdump -t option for CF calendar attributes # $Id $ diff --git a/ncdump/tst_charfill.sh b/ncdump/tst_charfill.sh index e9e42caa4..96b790965 100755 --- a/ncdump/tst_charfill.sh +++ b/ncdump/tst_charfill.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi # This shell script runs an ncgen buf in handling character _Fillvalue. set -e echo "" diff --git a/ncdump/tst_fillbug.sh b/ncdump/tst_fillbug.sh index 5a852003b..90361a02e 100755 --- a/ncdump/tst_fillbug.sh +++ b/ncdump/tst_fillbug.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi # This shell script runs an ncdump bug test for netcdf-4 # $Id: tst_fillbug.sh,v 1.1 2008/10/02 19:49:52 russ Exp $ diff --git a/ncdump/tst_formatx3.sh b/ncdump/tst_formatx3.sh index ef0bf38ab..8105ec6f8 100755 --- a/ncdump/tst_formatx3.sh +++ b/ncdump/tst_formatx3.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi # This shell script tests the output several previous tests. # $Id: tst_output.sh,v 1.17 2010/05/14 16:21:15 ed Exp $ diff --git a/ncdump/tst_formatx4.sh b/ncdump/tst_formatx4.sh index 3a0b176e1..fb666c5d2 100755 --- a/ncdump/tst_formatx4.sh +++ b/ncdump/tst_formatx4.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi # This shell script tests the output several previous tests. # $Id: tst_output.sh,v 1.17 2010/05/14 16:21:15 ed Exp $ diff --git a/ncdump/tst_grp_spec.sh b/ncdump/tst_grp_spec.sh index c334595d9..02c49bba5 100755 --- a/ncdump/tst_grp_spec.sh +++ b/ncdump/tst_grp_spec.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi # This shell script tests ncdump -g option for specifying groups for # which data is to be output. # $Id$ diff --git a/ncdump/tst_h_scalar.sh b/ncdump/tst_h_scalar.sh index 62b16dcdd..896ee64f3 100755 --- a/ncdump/tst_h_scalar.sh +++ b/ncdump/tst_h_scalar.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi # This shell script runs ncdump to verify scalar attribute and variable output set -e diff --git a/ncdump/tst_inmemory_nc3.sh b/ncdump/tst_inmemory_nc3.sh index 315a946aa..569f9427f 100755 --- a/ncdump/tst_inmemory_nc3.sh +++ b/ncdump/tst_inmemory_nc3.sh @@ -1,7 +1,7 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi verbose=1 set -e -set -x if test "x$builddir" = "x"; then builddir=`pwd`; fi if test "x$srcdir" = "x"; then srcdir=`dirname $0`; fi diff --git a/ncdump/tst_inmemory_nc4.sh b/ncdump/tst_inmemory_nc4.sh index 2283392bf..5e467616b 100755 --- a/ncdump/tst_inmemory_nc4.sh +++ b/ncdump/tst_inmemory_nc4.sh @@ -1,7 +1,7 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi verbose=1 set -e -set -x if test "x$builddir" = "x"; then builddir=`pwd`; fi if test "x$srcdir" = "x"; then srcdir=`dirname $0`; fi diff --git a/ncdump/tst_inttags.sh b/ncdump/tst_inttags.sh new file mode 100755 index 000000000..e8d53bc23 --- /dev/null +++ b/ncdump/tst_inttags.sh @@ -0,0 +1,20 @@ +#!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi + +set -e + +if test "x$srcdir" = x ; then +srcdir=`pwd` +fi + +echo "*** Test integer constant suffixes" +echo "*** creating inttags.nc from inttags.cdl..." +../ncgen/ncgen -lb -o inttags.nc $srcdir/inttags.cdl +echo "*** creating tst_inttags.cdl from inttags.nc..." +./ncdump inttags.nc > tst_inttags.cdl +echo "*** comparing tst_inttags.cdl to ref_inttags.nc..." +diff -b -w tst_inttags.cdl $srcdir/ref_inttags.cdl + +rm inttags.nc tst_inttags.cdl + +exit 0 diff --git a/ncdump/tst_inttags4.sh b/ncdump/tst_inttags4.sh new file mode 100755 index 000000000..8fa40e726 --- /dev/null +++ b/ncdump/tst_inttags4.sh @@ -0,0 +1,21 @@ +#!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi + +set -e + +if test "x$srcdir" = x ; then +srcdir=`pwd` +fi + +echo "*** Test netcdf-4 integer constant suffixes" + +echo "*** creating inttags4.nc from inttags4.cdl..." +../ncgen/ncgen -lb -o inttags4.nc $srcdir/inttags4.cdl +echo "*** creating tst_inttags4.cdl from inttags4.nc..." +./ncdump inttags4.nc > tst_inttags4.cdl +echo "*** comparing tst_inttags4.cdl to ref_inttags4.nc..." +diff -b -w tst_inttags4.cdl $srcdir/ref_inttags4.cdl + +rm inttags4.nc tst_inttags4.cdl + +exit 0 diff --git a/ncdump/tst_iter.sh b/ncdump/tst_iter.sh index 68327a6bc..3f9b16557 100755 --- a/ncdump/tst_iter.sh +++ b/ncdump/tst_iter.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi # This shell script runs an ncdump bug test for netcdf # Test if the nciter code is working [NCF-154] diff --git a/ncdump/tst_lengths.sh b/ncdump/tst_lengths.sh index dead6b2c6..9fe1cff90 100755 --- a/ncdump/tst_lengths.sh +++ b/ncdump/tst_lengths.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi # This shell script tests lengths of small netcdf files and tests # that rewriting a numeric value doesn't change file length # $Id: tst_lengths.sh,v 1.10 2008/08/07 00:07:52 ed Exp $ @@ -19,7 +20,6 @@ # } # EOF # cat > test-len.sh << 'EOF' -# #!/bin/sh # # test that length of file $1 is $2 # len=`ls -l $1|awk '{print $5}'` # if [ $len = $2 ]; then diff --git a/ncdump/tst_mud.sh b/ncdump/tst_mud.sh index 2b63484e3..83bbaa028 100755 --- a/ncdump/tst_mud.sh +++ b/ncdump/tst_mud.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi # This shell script tests ncdump and ncgen on netCDF-4 variables with multiple # unlimited dimensions. # $Id $ diff --git a/ncdump/tst_nccopy3.sh b/ncdump/tst_nccopy3.sh index b2d39ea63..1482891c8 100755 --- a/ncdump/tst_nccopy3.sh +++ b/ncdump/tst_nccopy3.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi # For a netCDF-3 build, test nccopy on netCDF files in this directory set -e diff --git a/ncdump/tst_nccopy4.sh b/ncdump/tst_nccopy4.sh index d861927f7..6b738ff82 100755 --- a/ncdump/tst_nccopy4.sh +++ b/ncdump/tst_nccopy4.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi # For a netCDF-4 build, test nccopy on netCDF files in this directory set -e diff --git a/ncdump/tst_ncgen4.sh b/ncdump/tst_ncgen4.sh index a047e7205..39d74f45e 100755 --- a/ncdump/tst_ncgen4.sh +++ b/ncdump/tst_ncgen4.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi verbose=1 set -e diff --git a/ncdump/tst_ncgen4_classic.sh b/ncdump/tst_ncgen4_classic.sh index ac15c2960..e483f190a 100755 --- a/ncdump/tst_ncgen4_classic.sh +++ b/ncdump/tst_ncgen4_classic.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi set -e echo "" diff --git a/ncdump/tst_ncgen4_cycle.sh b/ncdump/tst_ncgen4_cycle.sh index 5fb2ef161..c97d9a395 100755 --- a/ncdump/tst_ncgen4_cycle.sh +++ b/ncdump/tst_ncgen4_cycle.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi . ${srcdir}/tst_ncgen_shared.sh diff --git a/ncdump/tst_ncgen4_diff.sh b/ncdump/tst_ncgen4_diff.sh index 5a67143cf..1a2c3f31c 100755 --- a/ncdump/tst_ncgen4_diff.sh +++ b/ncdump/tst_ncgen4_diff.sh @@ -1,4 +1,11 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi + +if test "x$srcdir" = "x"; then srcdir=`pwd`; fi +if test "x$builddir" = "x"; then builddir=`pwd`; fi +#for sunos +export srcdir; +export builddir; . ${srcdir}/tst_ncgen_shared.sh @@ -18,7 +25,7 @@ echo "*** Testing ncgen with -k${KFLAG}" cd ${RESULTSDIR} for x in ${TESTSET} ; do - test $verbose = 1 && echo "*** Testing: ${x}" + if test $verbose = 1 ; then echo "*** Testing: ${x}" ; fi # determine if we need the specflag set specflag= headflag= @@ -56,7 +63,7 @@ cd .. totalcount=`expr $passcount + $failcount + $xfailcount` okcount=`expr $passcount + $xfailcount` -#set -x + echo "*** PASSED: ${okcount}/${totalcount} ; ${xfailcount} expected failures ; ${failcount} unexpected failures" if test $failcount -gt 0 ; then diff --git a/ncdump/tst_ncgen_shared.sh b/ncdump/tst_ncgen_shared.sh index c8ffd2f17..eeb21885b 100755 --- a/ncdump/tst_ncgen_shared.sh +++ b/ncdump/tst_ncgen_shared.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi # To add a new test, # 1. put the .cdl file in the 'cdl' directory diff --git a/ncdump/tst_netcdf4.sh b/ncdump/tst_netcdf4.sh index 4bce8cbb6..36ba2d79c 100755 --- a/ncdump/tst_netcdf4.sh +++ b/ncdump/tst_netcdf4.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi # This shell script tests ncdump for netcdf-4 # $Id: tst_netcdf4.sh,v 1.34 2009/09/25 18:22:10 dmh Exp $ @@ -14,6 +15,7 @@ echo "" echo "*** Testing ncgen and ncdump test output for netCDF-4 format." # echo "*** creating netcdf-4 file c0_4.nc from c0_4.cdl..." ../ncgen/ncgen -k nc4 -b -o c0_4.nc $srcdir/../ncgen/c0_4.cdl + # echo "*** creating c1_4.cdl from c0_4.nc..." ./ncdump -n c1 c0_4.nc | sed 's/e+0/e+/g' > c1_4.cdl # echo "*** comparing c1_4.cdl with ref_ctest1_nc4.cdl..." diff --git a/ncdump/tst_netcdf4_4.sh b/ncdump/tst_netcdf4_4.sh index 9e25fd857..b76da76f9 100755 --- a/ncdump/tst_netcdf4_4.sh +++ b/ncdump/tst_netcdf4_4.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi # This shell script runs extra tests ncdump for netcdf-4 # $Id: tst_netcdf4_4.sh,v 1.13 2009/05/06 14:51:52 ed Exp $ diff --git a/ncdump/tst_output.sh b/ncdump/tst_output.sh index 1ce461f9e..641d40e52 100755 --- a/ncdump/tst_output.sh +++ b/ncdump/tst_output.sh @@ -1,4 +1,5 @@ #!/bin/sh +if test "x$SETX" = x1 ; then echo "file=$0"; set -x ; fi # This shell script tests the output from several previous tests. set -e diff --git a/ncgen/CMakeLists.txt b/ncgen/CMakeLists.txt index dc0d5e38d..7024b46a0 100644 --- a/ncgen/CMakeLists.txt +++ b/ncgen/CMakeLists.txt @@ -1,4 +1,4 @@ -SET(ncgen_FILES generate.c main.c cdata.c bindata.c genchar.c cvt.c data.c debug.c escapes.c genc.c genbin.c generr.c genlib.c getfill.c odom.c offsets.c semantics.c ncgentab.c dump.c util.c bytebuffer.c list.c genf77.c f77data.c genj.c jdata.c nc_iter.c ConvertUTF.c ) +SET(ncgen_FILES generate.c main.c cdata.c bindata.c genchar.c cvt.c data.c debug.c escapes.c genc.c genbin.c generr.c genlib.c getfill.c odom.c offsets.c semantics.c ncgeny.c dump.c util.c bytebuffer.c list.c genf77.c f77data.c genj.c jdata.c nc_iter.c ConvertUTF.c ) IF(USE_X_GETOPT) SET(ncgen_FILES ${ncgen_FILES} XGetopt.c) @@ -46,7 +46,7 @@ ENDIF() SET(CLEANFILES c0.nc c0_64.nc c0_4.nc c0_4c.nc ref_camrun.c) SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CLEANFILES}") -# These rules are used if someone wants to rebuild ncgenyy.c or ncgentab.c +# These rules are used if someone wants to rebuild ncgeny.c or ncgenl.c # Otherwise never invoked, but records how to do it. # BTW: note that renaming is essential because otherwise # autoconf will forcibly delete files of the name *.tab.* @@ -54,20 +54,20 @@ SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CLEANFILES}") ADD_CUSTOM_COMMAND( OUTPUT ncgentab.h COMMAND flex -Pncg -B ncgen.l - COMMAND rm -f ncgenyy.c - COMMAND mv lex.ncg.c ncgenyy.c + COMMAND rm -f ncgenl.c + COMMAND mv lex.ncg.c ncgenl.c COMMAND bison -pncg -t -d ncgen.y - COMMAND rm -f ncgentab.c ncgentab.h - COMMAND mv ncgen.tab.c ncgentab.c - COMMAND mv ncgen.tab.h ncgentab.h - COMMAND mv ncgentab.h ${CMAKE_CURRENT_SOURCE_DIR} - COMMAND mv ncgentab.c ${CMAKE_CURRENT_SOURCE_DIR} - COMMAND mv ncgenyy.c ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND rm -f ncgeny.c ncgeny.h + COMMAND mv ncgen.tab.c ncgeny.c + COMMAND mv ncgen.tab.h ncgeny.h + COMMAND mv ncgeny.h ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND mv ncgeny.c ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND mv ncgenl.c ${CMAKE_CURRENT_SOURCE_DIR} ) -ADD_CUSTOM_TARGET(makeparser DEPENDS ncgentab.h) +ADD_CUSTOM_TARGET(makeparser DEPENDS ncgeny.h) ## Specify files to be distributed by 'make dist' FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.c ${CMAKE_CURRENT_SOURCE_DIR}/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*.sh) -SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} ncgen.y ncgenyy.c ncgen.l internals.html c0.cdl c0_4.cdl ref_camrun.cdl ncf199.cdl CMakeLists.txt Makefile.am ncgen.1) +SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} ncgen.y ncgenl.c ncgen.l internals.html c0.cdl c0_4.cdl ref_camrun.cdl ncf199.cdl CMakeLists.txt Makefile.am ncgen.1) ADD_EXTRA_DIST("${CUR_EXTRA_DIST}") diff --git a/ncgen/Makefile.am b/ncgen/Makefile.am index e27b25854..6c36e2e04 100644 --- a/ncgen/Makefile.am +++ b/ncgen/Makefile.am @@ -11,16 +11,17 @@ bin_PROGRAMS = ncgen ncgen_SOURCES=generate.c main.c cdata.c bindata.c genchar.c cvt.c data.c debug.c \ escapes.c genc.c genbin.c generr.c genlib.c getfill.c odom.c offsets.c \ -semantics.c ncgentab.c dump.c util.c bytebuffer.c list.c data.h \ +semantics.c dump.c util.c bytebuffer.c list.c data.h \ debug.h generr.h genlib.h includes.h ncgen.h odom.h offsets.h dump.h \ util.h bytebuffer.h list.h genf77.c f77data.c genj.c jdata.c nc_iter.h \ -nc_iter.c ConvertUTF.c ConvertUTF.h +nc_iter.c ConvertUTF.c ConvertUTF.h \ +ncgeny.c ncgeny.h # This is the man page. man_MANS = ncgen.1 # These files all need to be distributed. -EXTRA_DIST = ncgen.y ncgenyy.c ncgen.l $(man_MANS) internals.html \ +EXTRA_DIST = ncgen.y ncgen.l ncgenl.c $(man_MANS) internals.html \ run_tests.sh run_nc4_tests.sh c0.cdl c0_4.cdl ref_camrun.cdl \ ncf199.cdl CMakeLists.txt XGetopt.c c5.cdl @@ -36,16 +37,16 @@ endif # USE_NETCDF4 CLEANFILES = c0.nc c0_64.nc c0_4.nc c0_4c.nc ref_camrun.c \ ncf199.nc c5.nc -# These rules are used if someone wants to rebuild ncgenyy.c or ncgentab.c +# These rules are used if someone wants to rebuild ncgenl.c or ncgeny.c # Otherwise never invoked, but records how to do it. # BTW: note that renaming is essential because otherwise # autoconf will forcibly delete files of the name *.tab.* makeparser:: - flex -Pncg -8 ncgen.l - rm -f ncgenyy.c - sed -e s/lex.ncg.c/ncgenyy.c/g ncgenyy.c + flex -L -Pncg -8 ncgen.l + rm -f ncgenl.c + sed -e s/lex.ncg.c/ncgenl.c/g ncgenl.c bison -pncg -t -d ncgen.y - rm -f ncgentab.c ncgentab.h - sed -e s/ncgen.tab.c/ncgentab.c/g -e s/ncgen.tab.h/ncgentab.h/g ncgentab.c - sed -e s/ncgen.tab.c/ncgentab.c/g -e s/ncgen.tab.h/ncgentab.h/g ncgentab.h + rm -f ncgeny.c ncgeny.h + sed -e s/ncgen.tab.c/ncgeny.c/g -e s/ncgen.tab.h/ncgeny.h/g ncgeny.c + sed -e s/ncgen.tab.c/ncgeny.c/g -e s/ncgen.tab.h/ncgeny.h/g ncgeny.h diff --git a/ncgen/c0_4.cdl b/ncgen/c0_4.cdl index dd425f7d7..7e9dfc690 100644 --- a/ncgen/c0_4.cdl +++ b/ncgen/c0_4.cdl @@ -20,7 +20,7 @@ variables: s:b = 0b, 127b, -128b, -1b ; s:s = -32768s, 0s, 32767s ; int i ; - i:i = -2147483647, 0, 2147483647 ; + i:i = -2147483647, 0, 2147483647L ; i:f = -1.e+36f, 0.f, 1.e+36f ; i:d = -1.e+308, 0., 1.e+308 ; float f ; @@ -28,9 +28,9 @@ variables: double d ; d:c = "abcd\tZ$&" ; int64 i64 ; - i64:att_int64 = 1L ; + i64:att_int64 = 1LL ; uint64 ui64 ; - ui64:att_uint64 = 1UL ; + ui64:att_uint64 = 1ULL ; char cr(Dr) ; byte br(Dr) ; short sr(Dr) ; @@ -127,9 +127,9 @@ data: d = -10 ; - i64 = 9223372036854775807L; + i64 = 9223372036854775807LL; - ui64 = 18446744073709551615UL; + ui64 = 18446744073709551615ULL; cr = "ab" ; diff --git a/ncgen/cdata.c b/ncgen/cdata.c index a15d5fd35..63c8930c1 100644 --- a/ncgen/cdata.c +++ b/ncgen/cdata.c @@ -64,10 +64,10 @@ c_constant(Generator* generator, NCConstant* con, Bytebuffer* buf,...) bbprintf(codetmp,"%lf",con->value.doublev); break; case NC_UBYTE: - bbprintf(codetmp,"%hhu",con->value.uint8v); + bbprintf(codetmp,"%hhuU",con->value.uint8v); break; case NC_USHORT: - bbprintf(codetmp,"%hu",con->value.uint16v); + bbprintf(codetmp,"%huU",con->value.uint16v); break; case NC_UINT: bbprintf(codetmp,"%uU",con->value.uint32v); @@ -76,7 +76,7 @@ c_constant(Generator* generator, NCConstant* con, Bytebuffer* buf,...) bbprintf(codetmp,"%lldLL",con->value.int64v); break; case NC_UINT64: - bbprintf(codetmp,"%lluLLU",con->value.uint64v); + bbprintf(codetmp,"%lluULL",con->value.uint64v); break; case NC_ECONST: bbprintf(codetmp,"%s",cname(con->value.enumv)); diff --git a/ncgen/data.c b/ncgen/data.c index 3c8fd6f9c..178803371 100644 --- a/ncgen/data.c +++ b/ncgen/data.c @@ -153,6 +153,12 @@ srcpeek(Datasrc* ds) return NULL; } +void +srcreset(Datasrc* ds) +{ + ds->index = 0; +} + NCConstant* srcnext(Datasrc* ds) { diff --git a/ncgen/data.h b/ncgen/data.h index 2fde09aa8..58502f311 100644 --- a/ncgen/data.h +++ b/ncgen/data.h @@ -122,6 +122,8 @@ void srcsetfill(Datasrc* ds, Datalist* list); NCConstant* srcnext(Datasrc*); int srcmore(Datasrc*); int srcline(Datasrc* ds); +void srcreset(Datasrc* ds); +#define srclen(s) ((s)==NULL?0:(s)->length) #define islistconst(con) ((con)!=NULL && (con)->nctype == NC_COMPOUND) #define isfillconst(con) ((con)!=NULL && (con)->nctype == NC_FILLVALUE) diff --git a/ncgen/generr.c b/ncgen/generr.c index b1ec97325..348816f43 100644 --- a/ncgen/generr.c +++ b/ncgen/generr.c @@ -27,11 +27,27 @@ vderror(const char *fmt, va_list argv) void vderror(fmt,va_alist) const char* fmt; va_dcl #endif +{ + (void) vdwarn(fmt,argv); + error_count++; +} + +/* + * For logging error conditions. + * Designed to be called by other vararg procedures + */ +#ifndef NO_STDARG +void +vdwarn(const char *fmt, va_list argv) +#else +/* Technically illegal; va_alist should be only arg */ +void +vdwarn(fmt,va_alist) const char* fmt; va_dcl +#endif { (void) vfprintf(stderr,fmt,argv) ; (void) fputc('\n',stderr) ; (void) fflush(stderr); /* to ensure log files are current */ - error_count++; } #ifndef NO_STDARG @@ -76,7 +92,7 @@ semwarn(lno,fmt,va_alist) const int lno; const char* fmt; va_dcl va_list argv; vastart(argv,fmt); (void)fprintf(stderr,"%s: %s line %d: ", progname, cdlname, lno); - vderror(fmt,argv); + vdwarn(fmt,argv); } #ifndef NO_STDARG diff --git a/ncgen/generr.h b/ncgen/generr.h index 298189256..96b0094d0 100644 --- a/ncgen/generr.h +++ b/ncgen/generr.h @@ -19,17 +19,23 @@ extern int error_count; #ifndef NO_STDARG #include extern void vderror(const char *fmt, va_list argv); +extern void vdwarn(const char *fmt, va_list argv); extern void derror(const char *fmt, ...); extern int panic(const char* fmt, ...); extern void nprintf(char* buffer, size_t size, const char *fmt, ...); +extern void semerror(const int, const char *fmt, ...); +extern void semwarn(const int, const char *fmt, ...); #else #include /* Technically illegal; va_alist should be only arg */ extern void vderror(fmt,va_alist) const char* fmt; va_dcl; +extern void vdwarn(fmt,va_alist) const char* fmt; va_dcl; extern void derror(fmt,va_alist) const char* fmt; va_dcl; extern void panic(fmt,va_alist) const char* fmt; va_dcl; extern void nprintf(buffer,size,fmt) char* buffer; size_t size; const char* fmt; va_dcl; +extern void semerror(lno,fmt,va_alist) const int lno; const char* fmt; va_dcl; +extern void semwarnlno,fmt,va_alist) const int lno; const char* fmt; va_dcl; #endif #endif /*GENERR_H*/ diff --git a/ncgen/genlib.h b/ncgen/genlib.h index 2c6c87e27..6645ecdca 100644 --- a/ncgen/genlib.h +++ b/ncgen/genlib.h @@ -97,13 +97,6 @@ extern Symbol* locate(Symbol* refsym); extern Symbol* lookup(nc_class objectclass, Symbol* pattern); extern Symbol* lookupingroup(nc_class objectclass, char* name, Symbol* grp); extern Symbol* lookupgroup(List* prefix); -#ifndef NO_STDARG -extern void semerror(const int, const char *fmt, ...); -extern void semwarn(const int, const char *fmt, ...); -#else -extern void semerror(lno,fmt,va_alist) const int lno; const char* fmt; va_dcl; -extern void semwarnlno,fmt,va_alist) const int lno; const char* fmt; va_dcl; -#endif extern int nounlimited(Dimset* dimset, int from); extern int lastunlimited(Dimset* dimset); extern void padstring(NCConstant* con, size_t desiredlength, int fillchar); diff --git a/ncgen/main.c b/ncgen/main.c index 8181b613e..ff1087201 100644 --- a/ncgen/main.c +++ b/ncgen/main.c @@ -244,7 +244,7 @@ main( (void) par_io_init(32, 32); #endif - while ((c = getopt(argc, argv, "134567bB:cdD:fhk:l:M:no:Pv:x")) != EOF) + while ((c = getopt(argc, argv, "134567bB:cdD:fhHk:l:M:no:Pv:x")) != EOF) switch(c) { case 'd': debug = 1; @@ -278,6 +278,9 @@ main( case 'h': header_only = 1; break; + case 'H': + usage(); + exit(0); case 'l': /* specify language, instead of using -c or -f or -b */ { if(l_flag != 0) { @@ -317,7 +320,7 @@ main( break; case 'v': /* a deprecated alias for "kind" option */ /*FALLTHRU*/ - case 'k': /* for specifying variant of netCDF format to be generated + case 'k': { /* for specifying variant of netCDF format to be generated Possible values are: Format names: "classic" or "nc3" @@ -333,28 +336,27 @@ main( 4 (=> netCDF-4 classic model) 5 (=> classic 64 bit data aka CDF-5) */ - { - struct Kvalues* kvalue; - char *kind_name = (optarg != NULL ? (char *) emalloc(strlen(optarg)+1) - : emalloc(1)); - if (! kind_name) { - derror ("%s: out of memory", progname); - return(1); - } - if(optarg != NULL) - (void)strcpy(kind_name, optarg); - for(kvalue=legalkinds;kvalue->name;kvalue++) { - if(strcmp(kind_name,kvalue->name) == 0) { - k_flag = kvalue->k_flag; - break; - } - } - if(kvalue->name == NULL) { - derror("Invalid format: %s",kind_name); - return 2; - } + struct Kvalues* kvalue; + char *kind_name = (optarg != NULL + ? (char *) emalloc(strlen(optarg)+1) + : emalloc(1)); + if (! kind_name) { + derror ("%s: out of memory", progname); + return(1); } - break; + if(optarg != NULL) + (void)strcpy(kind_name, optarg); + for(kvalue=legalkinds;kvalue->name;kvalue++) { + if(strcmp(kind_name,kvalue->name) == 0) { + k_flag = kvalue->k_flag; + break; + } + } + if(kvalue->name == NULL) { + derror("Invalid format: %s",kind_name); + return 2; + } + } break; case '3': /* output format is classic (netCDF-3) */ k_flag = NC_FORMAT_CLASSIC; break; @@ -479,8 +481,6 @@ main( } } - /* Standard Unidata java interface => usingclassic */ - parse_init(); ncgin = fp; if(debug >= 2) {ncgdebug=1;} @@ -529,15 +529,32 @@ main( if(k_flag == 0) k_flag = 1; - usingclassic = (k_flag <= 2 || k_flag == 4 || k_flag == 5)?1:0; + /* Figure out usingclassic */ + switch (k_flag) { + case NC_FORMAT_64BIT_DATA: + case NC_FORMAT_CLASSIC: + case NC_FORMAT_64BIT_OFFSET: + case NC_FORMAT_NETCDF4_CLASSIC: + usingclassic = 1; + break; + case NC_FORMAT_NETCDF4: + default: + usingclassic = 0; + break; + } /* compute cmode_modifier */ switch (k_flag) { - case 1: cmode_modifier = 0; break; - case 2: cmode_modifier = NC_64BIT_OFFSET; break; - case 3: cmode_modifier = NC_NETCDF4; break; - case 4: cmode_modifier = NC_NETCDF4 | NC_CLASSIC_MODEL; break; - case 5: cmode_modifier = NC_CDF5; break; + case NC_FORMAT_CLASSIC: + cmode_modifier = 0; break; + case NC_FORMAT_64BIT_OFFSET: + cmode_modifier = NC_64BIT_OFFSET; break; + case NC_FORMAT_NETCDF4: + cmode_modifier = NC_NETCDF4; break; + case NC_FORMAT_NETCDF4_CLASSIC: + cmode_modifier = NC_NETCDF4 | NC_CLASSIC_MODEL; break; + case NC_FORMAT_64BIT_DATA: + cmode_modifier = NC_CDF5; break; default: ASSERT(0); /* cannot happen */ } diff --git a/ncgen/ncgen.1 b/ncgen/ncgen.1 index 5015d07ba..e29dbcbfc 100644 --- a/ncgen/ncgen.1 +++ b/ncgen/ncgen.1 @@ -490,7 +490,7 @@ except that type suffixes must be appended to shorts and floats to distinguish them from longs and doubles. .LP A \fIbyte\fP constant is represented by - an integer constant with a `b' (or +an integer constant with a `b' (or `B') appended. In the old netCDF-2 API, byte constants could also be represented using single characters or standard C character escape sequences such as `a' or `\n'. This is still supported for backward @@ -520,8 +520,11 @@ begins with `0', it is interpreted as octal, except that if it begins with .LP \fIint\fP integer constants are intended for representing 32-bit signed quantities. The form of an \fIint\fP constant is an ordinary integer -constant, although it is acceptable to append an optional `l' or -`L' (again, deprecated). +constant, although it is acceptable to optionally append a single `l' or +`L' (again, deprecated). Be careful, though, the L suffix is interpreted +as a 32 bit integer, and never as a 64 bit integer. This can be confusing +since the C long type can ambigously be either 32 bit or 64 bit. +.LP If an \fIint\fP constant begins with `0', it is interpreted as octal, except that if it begins with `0x', it is interpreted as a hexadecimal constant (but see opaque constants below). @@ -578,8 +581,9 @@ For example the following are all acceptable \fIdouble\fP constants: .LP Unsigned integer constants can be created by appending the character 'U' or 'u' between the constant and any trailing -size specifier. Thus one could say -10U, 100us, 100000ul, or 1000000ull, for example. +size specifier, or immediately at the end of the size specifier. +Thus one could say +10U, 100su, 100000ul, or 1000000llu, for example. .LP Single character constants may be enclosed in single quotes. If a sequence of one or more characters is enclosed diff --git a/ncgen/ncgen.l b/ncgen/ncgen.l index 31a4dc0b1..4a62b7ded 100644 --- a/ncgen/ncgen.l +++ b/ncgen/ncgen.l @@ -73,13 +73,17 @@ static unsigned int MAX_UINT = NC_MAX_UINT; #define NC_MAX_UINT MAX_UINT #endif -#define TAG "BbSsLl" +#define TAGCHARS "BbSsLlUu" #define tstdecimal(ch) ((ch) >= '0' && (ch) <= '9') /*Mnemonics*/ #define ISIDENT 1 +/* Define a fake constant indicating that + no tag was specified */ +#define NC_NOTAG (-1) + char errstr[100]; /* for short error messages */ int lineno; /* line number for error messages */ @@ -106,9 +110,10 @@ unsigned char ubyte_val; /* last byte value read */ static Symbol* makepath(char* text); static int lexdebug(int); static unsigned long long parseULL(char* text, int*); -static nc_type downconvert(unsigned long long uint64, int, int, int); -static int tagmatch(nc_type nct, int tag, int hasU); +static nc_type downconvert(unsigned long long uint64, int*, int, int); +static int tagmatch(nc_type nct, int tag); static int nct2lexeme(nc_type nct); +static int collecttag(char* text, char** stagp); static struct Specialtoken { char* name; @@ -196,8 +201,8 @@ OPAQUESTRING (0[xX][0-9A-Fa-f][0-9A-Fa-f]*) PATH ([/]|([/]{ID})([/]{ID})*) -XUNUMBER {OPAQUESTRING}[SsLl] -NUMBER [+-]?[0-9][0-9]*[Uu]?[BbSsLl]? +XUNUMBER {OPAQUESTRING}([Ss]|[Ll]|[Ll][Ll])? +NUMBER [+-]?[0-9][0-9]*[Uu]?([BbSs]|[Ll]|[Ll][Ll])? DBLNUMBER [+-]?[0-9]*\.[0-9]*{exp}?[LlDd]?|[+-]?[0-9]*{exp}[LlDd]? FLTNUMBER [+-]?[0-9]*\.[0-9]*{exp}?[Ff]|[+-]?[0-9]*{exp}[Ff] @@ -246,7 +251,7 @@ yytext[MAXTRST-1] = '\0'; if((len % 2) == 1) bbAppend(lextext,'0'); bbNull(lextext); /* convert all chars to lower case */ - for(p=bbContents(lextext);*p;p++) *p = tolower(*p); + for(p=bbContents(lextext);(int)*p;p++) *p = tolower(*p); return lexdebug(OPAQUESTRING); } @@ -364,33 +369,37 @@ NIL|nil|Nil { } {NUMBER} { -/* -We need to try to see what size of integer ((u)int). -Technically, the user should specify, but... -If out of any integer range, then complain -*/ + /* + We need to try to see what size of integer ((u)int). + Technically, the user should specify, but... + If out of any integer range, then complain + */ int slen = strlen(ncgtext); - int tag = ncgtext[slen-1]; - int hasU = 0; + char* stag = NULL; + int tag = NC_NAT; int signchar = 0; int isneg = 0; int c = ncgtext[0]; int fail = 0; nc_type nct = 0; char* pos = NULL; + int hasU = 0; + /* capture the tag string */ + tag = collecttag(ncgtext,&stag); + if(tag == NC_NAT) { + sprintf(errstr,"Illegal integer suffix: %s",stag); + yyerror(errstr); + goto done; + } + /* drop the tag from the input text */ + ncgtext[slen - strlen(stag)] = '\0'; + hasU = isuinttype(tag); if(!tstdecimal(c)) { pos = ncgtext+1; isneg = (c == '-'); } else pos = ncgtext; - if(tag != '\0' && strchr(TAG,tag) != NULL) { - if(slen > 2) { - c = ncgtext[slen-2]; - hasU = (c == 'U' || c == 'u') ? 1 : 0; - } - } else - tag = 0; if(isneg && hasU) { sprintf(errstr,"Unsigned integer cannot be signed: %s",ncgtext); yyerror(errstr); @@ -403,7 +412,7 @@ If out of any integer range, then complain goto done; } /* Down convert to smallest possible range */ - nct = downconvert(uint64_val,isneg,tag,hasU); + nct = downconvert(uint64_val,&tag,isneg,hasU); switch (k_flag) { case NC_FORMAT_64BIT_DATA: case NC_FORMAT_NETCDF4: @@ -417,10 +426,9 @@ If out of any integer range, then complain goto done; } } - if(!tagmatch(nct,tag,hasU)) { - sprintf(errstr,"Integer out of range for tag: %s",ncgtext); - yyerror(errstr); - goto done; + + if(!tagmatch(nct,tag)) { + semwarn(lineno,"Warning: Integer out of range for tag: %s; tag treated as changed.",ncgtext); } return lexdebug(nct2lexeme(nct)); done: return 0; @@ -430,10 +438,20 @@ done: return 0; int c; int token = 0; int slen = strlen(yytext); - int tag = yytext[slen-1]; + char* stag = NULL; + int tag = NC_NAT; char* hex = yytext+2; /* point to first true hex digit */ int xlen = (slen - 3); /* true hex length */ + yytext[slen-1] = '\0'; + /* capture the tag string */ + tag = collecttag(yytext,&stag); + if(tag == NC_NAT) { + sprintf(errstr,"Illegal integer suffix: %s",stag); + yyerror(errstr); + goto done; + } + yytext[slen - strlen(stag)] = '\0'; if(xlen > 16) { /* truncate hi order digits */ hex += (xlen - 16); } @@ -444,11 +462,14 @@ done: return 0; uint64_val = ((uint64_val << 4) | hexdigit); } switch (tag) { - case 'S': case 's': + case NC_USHORT: uint16_val = (unsigned short)uint64_val; token = USHORT_CONST; break; - case 'L': case 'l': + case NC_UINT: + token = UINT_CONST; + break; + case NC_UINT64: token = UINT64_CONST; break; default: /* should never happen */ @@ -624,7 +645,7 @@ makepath(char* text0) } /* -Parse a simple string of digitis into an unsigned long long +Parse a simple string of digits into an unsigned long long Return the value. */ static unsigned long long @@ -654,122 +675,114 @@ parseULL(char* text, int* failp) /** Given the raw bits, the sign char, the tag, and hasU fill in the appropriate *_val field -and return the type +and return the type. +Note that we cannot return unsigned types if running pure netcdf classic. +The rule is to pick the smallest enclosing type. + +The rule used here is that the tag (the suffix, if any) +always takes precedence and the value is modified to conform +if possible, otherwise out-of-range is signalled. +For historical reasons (ncgen3), values that fit as unsigned +are acceptable for the signed tag and conversion is attempted; +e.g. 65535s; is legal and is return as a negative short. */ static nc_type -downconvert(unsigned long long uint64, int isneg, int tag, int hasU) +downconvert(unsigned long long uint64, int* tagp, int isneg, int hasU) { nc_type nct = NC_NAT; - int bit64 = (uint64 >> 63); - int allones = (uint64 == 0xffffffffffffffffUL); + int tag = *tagp; + int bit63set = (uint64 >> 63); long long int64 = *((long long*)&uint64); - if(isneg && hasU) - return NC_NAT; - /* Special cases: all (u)int64 values */ - if(allones && (hasU || !isneg)) /* bare max uint64 value */ - return NC_UINT64; - if((int64 < NC_MIN_INT) || (int64 > NC_MAX_INT)) { - if(isneg && !hasU) { - int64_val = - int64; - return NC_INT64; - } - if(!isneg && hasU) { - uint64_val = uint64; - return NC_UINT64; - } - /* Bare big integer, assume int64 unless sign bit set */ - if(!isneg && !hasU && bit64) { - uint64_val = uint64; - return NC_UINT64; - } else if(!bit64) { - int64_val = int64; - return NC_INT64; - } - /*assert(!isneg)*/ + if(isneg && hasU) { + return (*tagp = NC_NAT); + } + /* To simplify the code, we look for special case of NC_UINT64 + constants that will not fit into an NC_INT64 constant. + */ + if(tag == NC_UINT64 && bit63set) { uint64_val = uint64; - return NC_UINT64; + return tag; } + /* At this point we need deal only with int64 value */ + /* Apply the isneg */ + if(isneg) + int64 = - int64; - if(isneg) int64 = -int64; - - /* special case: - If there is no tag and the size is ok, - then always return NC_INT or NC_UINT. - */ - if(!tag) { - if(!hasU) { - if((int64 >= NC_MIN_INT) && (int64 <= NC_MAX_INT)) { - int32_val = (int)int64; - return NC_INT; - } - } - if(uint64 <= NC_MAX_UINT) { - uint32_val = (unsigned int)uint64; - return NC_INT; + if(tag == NC_NOTAG) { + /* If we have no other info, then assume NC_(U)INT(64) */ + if(int64 >= NC_MIN_INT && int64 <= NC_MAX_INT) { + nct = (tag = NC_INT); + int32_val = (signed int)int64; + } else if(int64 >= 0 && int64 <= NC_MAX_UINT) { + nct = (tag = NC_UINT); + uint32_val = (unsigned int)int64; + } else if(int64 < 0) { + nct = (tag = NC_INT64); + int64_val = (signed long long)int64; + } else { + nct = (tag = NC_UINT64); + uint64_val = (unsigned long long)int64; } + goto done; } - /* assert (tag != 0) */ - - /* Pick smallest enclosing type; - for historical reasons (ncgen3), technically out of range - values are allowed and conversion is attempted; - e.g. 65535s; is legal and is return as an unsigned short. - */ - if(hasU) { - switch (tag) { - case 'B': case 'b': - if((int64 >= 0) && (int64 <= NC_MAX_UBYTE)) { + if(isuinttype(tag) && int64 < 0) + goto outofrange; + switch (tag) { + case NC_UBYTE: + if(int64 <= NC_MAX_UBYTE) { nct = NC_UBYTE; ubyte_val = (unsigned char)int64; - }; break; - case 'S': case 's': - if((int64 >= 0) && (int64 <= NC_MAX_USHORT)) { + } else + goto outofrange; + break; + case NC_USHORT: + if(int64 <= NC_MAX_USHORT) { nct = NC_USHORT; uint16_val = (unsigned short)int64; - } break; - case 'L': case 'l': - if((int64 >= 0) && (int64 <= NC_MAX_UINT64)) { + } else + goto outofrange; + break; + case NC_UINT: + if(int64 <= NC_MAX_UINT) { + nct = NC_UINT; + uint32_val = (unsigned int)int64; + } else + goto outofrange; + break; + case NC_UINT64: + if(int64 <= NC_MAX_UINT64) { nct = NC_UINT64; uint64_val = uint64; - } break; - default: - return NC_NAT; - } - } else { /* !hasU */ - switch (tag) { - case 'B': case 'b': - if((int64 >= NC_MIN_BYTE) && (int64 <= NC_MAX_BYTE)) { - nct = NC_BYTE; - byte_val = (signed char)int64; - } else {/* force to unsigned value */ - uint64_val = uint64 & 0xff; - nct = NC_UBYTE; - } + } else + goto outofrange; break; - case 'S': case 's': - if((int64 >= NC_MIN_SHORT) && (int64 <= NC_MAX_SHORT)) { - nct = NC_SHORT; - int16_val = (signed short)int64; - } else {/* force to unsigned value */ - uint64_val = uint64 & 0xffff; - nct = NC_USHORT; - } + case NC_INT64: + nct = NC_INT64; + int64_val = int64; break; - case 'L': case 'l': - if((uint64 <= NC_MAX_INT64)) { - nct = NC_INT64; - int64_val = int64; - } else {/* force to unsigned value */ - uint64_val = uint64; - nct = NC_UINT64; - } + case NC_BYTE: + nct = NC_BYTE; + byte_val = (signed char)int64; break; - default: - return NC_NAT; - } + case NC_SHORT: + nct = NC_SHORT; + int16_val = (signed short)int64; + break; + case NC_INT: + nct = NC_INT; + int32_val = (signed int)int64; + break; + default: + goto outofrange; } + +done: + *tagp = tag; return nct; +outofrange: + yyerror("Value out of range"); + return NC_NAT; } static int @@ -789,23 +802,62 @@ nct2lexeme(nc_type nct) return 0; } - static int -tagmatch(nc_type nct, int tag, int hasU) +tagmatch(nc_type nct, int tag) { - if(hasU) switch(nct) { - case NC_UBYTE: return (tag == 0 || tag == 'B' || tag == 'b'); - case NC_USHORT: return (tag == 0 || tag == 'S' || tag == 's'); - case NC_UINT: return (tag == 0); - case NC_UINT64: return (tag == 0 || tag == 'L' || tag == 'l'); - default: return 0; - } else switch(nct) { - case NC_BYTE: return (tag == 0 || tag == 'B' || tag == 'b'); - case NC_SHORT: return (tag == 0 || tag == 'S' || tag == 's'); - case NC_INT: return (tag == 0); - case NC_INT64: return (tag == 0 || tag == 'L' || tag == 'l'); - default: return 0; - } - return 0; + if(tag == NC_NAT || tag == NC_NOTAG) + return 1; + return nct == tag; } +/* capture the tag string */ +static int +collecttag(char* text, char** stagp) +{ + char* stag0; +#define MAXTAGLEN 3 + char stag[MAXTAGLEN+1]; + int slen = strlen(text); + int staglen; + int tag = NC_NAT; + int hasU = 0; + + for(stag0 = text+(slen-1);stag0 > 0;stag0--) { + if(strchr(TAGCHARS,*stag0) == NULL) {stag0++; break;} + } + if(stagp) *stagp = stag0; + staglen = strlen(stag0); + if(staglen == 0) + return NC_NOTAG; + if(staglen > MAXTAGLEN) + return tag; + strncpy(stag,stag0,sizeof(stag)); + stag[MAXTAGLEN] = '\0'; + if(stag[0] == 'U' || stag[0] == 'u') { + hasU = 1; + strncpy(stag,stag+1,MAXTAGLEN+1); + staglen--; + } else if(stag[staglen-1] == 'U' || stag[staglen-1] == 'u') { + hasU = 1; + staglen--; + stag[staglen] = '\0'; + } + if(strlen(stag) == 0 && hasU) { + tag = NC_UINT64; + } else if(strlen(stag) == 1) { + switch (stag[0]) { + case 'B': case 'b': tag = (hasU ? NC_UBYTE : NC_BYTE); break; + case 'S': case 's': tag = (hasU ? NC_USHORT : NC_SHORT); break; + case 'L': case 'l': tag = (hasU ? NC_UINT : NC_INT); break; + default: break; + } + } else if(strcasecmp(stag,"ll") == 0) { + tag = (hasU ? NC_UINT64 : NC_INT64); + } + if(tag == NC_NAT) { + if(strlen(stag) > 0) + return tag; + tag = NC_NAT; + } + return tag; +} diff --git a/ncgen/ncgen.y b/ncgen/ncgen.y index 2dd12f706..8fd8a3e02 100644 --- a/ncgen/ncgen.y +++ b/ncgen/ncgen.y @@ -903,7 +903,7 @@ ncgwrap(void) /* returns 1 on EOF if no more input */ } /* get lexical input routine generated by lex */ -#include "ncgenyy.c" +#include "ncgenl.c" /* Really should init our data within this file */ void diff --git a/ncgen/ncgenyy.c b/ncgen/ncgenl.c similarity index 63% rename from ncgen/ncgenyy.c rename to ncgen/ncgenl.c index ee8c86f3b..d6354ce2a 100644 --- a/ncgen/ncgenyy.c +++ b/ncgen/ncgenl.c @@ -1,5 +1,5 @@ -#line 3 "ncgenyy.c" +#line 3 "ncgenl.c" #define YY_INT_ALIGNED short int @@ -387,7 +387,7 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[382] = +static yyconst flex_int16_t yy_accept[384] = { 0, 0, 0, 45, 45, 0, 0, 49, 47, 1, 43, 47, 47, 47, 47, 37, 31, 35, 35, 34, 34, @@ -396,41 +396,41 @@ static yyconst flex_int16_t yy_accept[382] = 34, 34, 47, 47, 47, 45, 48, 33, 48, 1, 0, 3, 0, 0, 0, 37, 35, 0, 0, 37, 37, 0, 38, 44, 2, 31, 0, 0, 0, 0, - 35, 35, 35, 0, 34, 0, 0, 0, 0, 34, + 35, 35, 35, 35, 0, 34, 0, 0, 0, 0, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, - 34, 0, 0, 45, 0, 46, 33, 39, 0, 0, - 0, 0, 37, 0, 0, 37, 2, 31, 0, 0, - 0, 0, 0, 0, 0, 4, 0, 0, 34, 34, - 34, 34, 34, 34, 30, 27, 34, 34, 34, 34, + 34, 34, 0, 0, 45, 0, 46, 33, 39, 0, + 0, 0, 0, 37, 0, 0, 37, 2, 31, 0, + 0, 0, 0, 0, 0, 0, 4, 0, 0, 34, + 34, 34, 34, 34, 34, 30, 27, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, - 34, 34, 34, 34, 34, 14, 34, 27, 34, 34, + 34, 34, 34, 34, 34, 34, 14, 34, 27, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, - 0, 42, 0, 0, 37, 0, 31, 0, 0, 0, + 34, 0, 42, 0, 0, 37, 0, 31, 0, 0, - 0, 0, 0, 0, 4, 36, 0, 34, 34, 28, - 34, 34, 29, 34, 34, 34, 34, 34, 34, 34, - 34, 34, 34, 10, 9, 34, 34, 34, 34, 6, - 34, 34, 34, 34, 14, 34, 34, 34, 8, 34, - 34, 34, 34, 15, 34, 34, 34, 34, 0, 0, - 28, 0, 31, 0, 0, 0, 0, 0, 0, 0, - 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, - 34, 34, 34, 34, 34, 23, 34, 34, 34, 16, - 34, 34, 34, 34, 12, 34, 34, 11, 34, 34, - 15, 34, 34, 34, 40, 41, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 4, 36, 36, 0, 34, + 34, 28, 34, 34, 29, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 10, 9, 34, 34, 34, + 34, 6, 34, 34, 34, 34, 14, 34, 34, 34, + 8, 34, 34, 34, 34, 15, 34, 34, 34, 34, + 0, 0, 28, 0, 31, 0, 0, 0, 0, 0, + 0, 0, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 23, 34, 34, + 34, 16, 34, 34, 34, 34, 12, 34, 34, 11, + 34, 34, 15, 34, 34, 34, 40, 41, 0, 0, - 34, 34, 34, 25, 34, 34, 34, 34, 34, 34, - 34, 34, 34, 34, 34, 34, 18, 24, 34, 7, - 5, 20, 17, 34, 34, 13, 34, 0, 0, 34, - 34, 34, 34, 34, 34, 34, 34, 34, 32, 34, - 34, 34, 34, 34, 34, 34, 34, 0, 34, 26, - 34, 34, 34, 34, 34, 34, 5, 34, 34, 34, - 34, 26, 26, 19, 34, 34, 34, 34, 34, 34, - 34, 34, 34, 34, 34, 34, 22, 34, 21, 34, - 0 + 0, 0, 34, 34, 34, 25, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 18, 24, + 34, 7, 5, 20, 17, 34, 34, 13, 34, 0, + 0, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 32, 34, 34, 34, 34, 34, 34, 34, 34, 0, + 34, 26, 34, 34, 34, 34, 34, 34, 5, 34, + 34, 34, 34, 26, 26, 19, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 22, 34, + 21, 34, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -476,100 +476,102 @@ static yyconst flex_int32_t yy_meta[68] = 11, 11, 14, 1, 11, 11, 11 } ; -static yyconst flex_int16_t yy_base[400] = +static yyconst flex_int16_t yy_base[402] = { 0, - 0, 0, 336, 331, 274, 273, 331, 2153, 66, 2153, - 63, 289, 60, 61, 93, 83, 140, 285, 50, 60, + 0, 0, 345, 343, 285, 283, 344, 2153, 66, 2153, + 63, 301, 60, 61, 93, 83, 140, 300, 50, 60, 191, 64, 95, 154, 102, 198, 198, 180, 195, 228, - 269, 188, 213, 221, 232, 252, 237, 245, 267, 263, - 297, 275, 256, 252, 245, 300, 295, 0, 2153, 78, - 86, 2153, 303, 277, 342, 0, 245, 356, 225, 0, - 2153, 367, 2153, 2153, 0, 340, 374, 210, 208, 207, - 230, 2153, 141, 0, 329, 393, 188, 186, 185, 370, - 74, 400, 373, 396, 381, 386, 417, 404, 427, 420, - 430, 434, 437, 460, 452, 473, 476, 483, 486, 497, + 284, 188, 213, 221, 232, 252, 237, 245, 267, 263, + 297, 275, 267, 263, 258, 313, 308, 0, 2153, 78, + 86, 2153, 313, 302, 342, 0, 271, 356, 255, 0, + 2153, 367, 2153, 2153, 0, 340, 374, 242, 220, 218, + 240, 2153, 53, 141, 0, 329, 393, 210, 208, 207, + 370, 75, 400, 373, 396, 381, 386, 417, 404, 427, + 420, 430, 434, 437, 460, 452, 473, 476, 483, 486, - 494, 506, 509, 516, 532, 528, 539, 549, 542, 546, - 552, 582, 572, 565, 586, 589, 605, 608, 626, 620, - 639, 180, 179, 232, 227, 2153, 0, 2153, 230, 683, - 228, 665, 694, 189, 712, 732, 0, 650, 491, 748, - 168, 164, 163, 131, 129, 146, 125, 124, 700, 704, - 722, 734, 747, 740, 743, 752, 755, 764, 787, 790, - 777, 796, 803, 799, 808, 833, 838, 822, 841, 845, - 852, 856, 863, 875, 878, 908, 889, 893, 915, 896, - 882, 912, 926, 932, 929, 945, 948, 968, 952, 982, - 123, 2153, 1008, 0, 2153, 48, 989, 1023, 122, 121, + 497, 494, 506, 509, 516, 532, 528, 539, 549, 542, + 546, 552, 582, 572, 565, 586, 589, 605, 608, 626, + 620, 639, 203, 188, 242, 237, 2153, 0, 2153, 237, + 683, 236, 665, 694, 195, 712, 732, 0, 650, 491, + 748, 175, 173, 171, 170, 168, 146, 164, 163, 700, + 704, 722, 734, 747, 740, 743, 752, 755, 764, 787, + 790, 777, 796, 803, 799, 808, 833, 838, 822, 841, + 845, 852, 856, 863, 875, 878, 908, 889, 893, 915, + 896, 882, 912, 926, 932, 929, 945, 948, 968, 952, + 982, 131, 2153, 1008, 0, 2153, 48, 989, 1023, 129, - 114, 108, 101, 88, 293, 2153, 82, 993, 1006, 1012, - 1015, 1027, 1019, 1030, 1024, 1037, 1050, 1061, 1067, 1070, - 1074, 1085, 1082, 1091, 1104, 1107, 1123, 1115, 1126, 1130, - 1140, 1145, 1137, 1148, 1162, 1183, 1179, 1171, 1186, 1196, - 1193, 1209, 1226, 1239, 1233, 1229, 1246, 1249, 138, 137, - 2153, 90, 1243, 1313, 77, 75, 71, 68, 64, 58, - 1259, 1293, 1289, 1263, 1303, 1296, 1300, 1306, 1312, 1315, - 1345, 1336, 1349, 1352, 1361, 2153, 1366, 1369, 1386, 1383, - 1399, 1402, 1409, 1417, 1392, 1422, 1425, 1406, 1439, 1432, - 1443, 1447, 1458, 1462, 2153, 2153, 55, 36, 35, 33, + 125, 124, 123, 122, 121, 293, 92, 2153, 114, 993, + 1006, 1012, 1015, 1027, 1019, 1030, 1024, 1037, 1050, 1061, + 1067, 1070, 1074, 1085, 1082, 1091, 1104, 1107, 1123, 1115, + 1126, 1130, 1140, 1145, 1137, 1148, 1162, 1183, 1179, 1171, + 1186, 1196, 1193, 1209, 1226, 1239, 1233, 1229, 1246, 1249, + 165, 158, 2153, 100, 1243, 1313, 82, 81, 80, 77, + 75, 71, 1259, 1293, 1289, 1263, 1303, 1296, 1300, 1306, + 1312, 1315, 1345, 1336, 1349, 1352, 1361, 2153, 1366, 1369, + 1386, 1383, 1399, 1402, 1409, 1417, 1392, 1422, 1425, 1406, + 1439, 1432, 1443, 1447, 1458, 1462, 2153, 2153, 84, 64, - 1473, 1455, 1477, 1480, 1492, 1498, 1495, 1503, 1510, 1533, - 1516, 1528, 1541, 1546, 1549, 1571, 1558, 2153, 1564, 1567, - 1580, 2153, 1583, 1597, 1602, 1588, 1606, 36, 25, 1613, - 1621, 1632, 1651, 1636, 1647, 1643, 1654, 1662, 1658, 1667, - 1692, 1688, 1684, 1700, 1704, 1697, 1708, 24, 1723, 1734, - 1753, 1742, 1746, 1749, 1758, 1765, 1768, 1784, 1799, 1802, - 1789, 36, 1806, 1809, 1814, 1819, 1832, 1839, 1844, 1850, - 1858, 1855, 1870, 1862, 1875, 1894, 2153, 1900, 2153, 1905, - 2153, 1972, 1986, 2000, 2014, 2023, 2032, 2041, 2054, 2068, - 2081, 2095, 2105, 2111, 2119, 2121, 2127, 2133, 2139 + 36, 35, 1473, 1455, 1477, 1480, 1492, 1498, 1495, 1503, + 1510, 1533, 1516, 1528, 1541, 1546, 1549, 1571, 1558, 2153, + 1564, 1567, 1580, 2153, 1583, 1597, 1602, 1588, 1606, 39, + 30, 1613, 1621, 1632, 1651, 1636, 1647, 1643, 1654, 1662, + 1658, 1667, 1692, 1688, 1684, 1700, 1704, 1697, 1708, 28, + 1723, 1734, 1753, 1742, 1746, 1749, 1758, 1765, 1768, 1784, + 1799, 1802, 1789, 36, 1806, 1809, 1814, 1819, 1832, 1839, + 1844, 1850, 1858, 1855, 1870, 1862, 1875, 1894, 2153, 1900, + 2153, 1905, 2153, 1972, 1986, 2000, 2014, 2023, 2032, 2041, + 2054, 2068, 2081, 2095, 2105, 2111, 2119, 2121, 2127, 2133, + 2139 } ; -static yyconst flex_int16_t yy_def[400] = +static yyconst flex_int16_t yy_def[402] = { 0, - 381, 1, 382, 382, 383, 383, 381, 381, 381, 381, - 384, 385, 381, 386, 381, 387, 381, 17, 388, 388, - 388, 388, 388, 388, 388, 381, 388, 388, 388, 388, - 21, 388, 388, 388, 388, 388, 388, 388, 388, 388, - 388, 388, 381, 381, 381, 389, 389, 390, 381, 381, - 384, 381, 384, 381, 391, 15, 17, 381, 381, 15, - 381, 381, 381, 381, 392, 393, 381, 381, 381, 381, - 17, 381, 381, 394, 388, 381, 381, 381, 381, 388, - 21, 21, 388, 388, 388, 388, 388, 388, 388, 388, - 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, + 383, 1, 384, 384, 385, 385, 383, 383, 383, 383, + 386, 387, 383, 388, 383, 389, 383, 17, 390, 390, + 390, 390, 390, 390, 390, 383, 390, 390, 390, 390, + 21, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 383, 383, 383, 391, 391, 392, 383, 383, + 386, 383, 386, 383, 393, 15, 17, 383, 383, 15, + 383, 383, 383, 383, 394, 395, 383, 383, 383, 383, + 17, 383, 383, 383, 396, 390, 383, 383, 383, 383, + 390, 21, 21, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, - 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, - 388, 381, 381, 389, 389, 381, 390, 381, 381, 381, - 395, 381, 381, 381, 381, 381, 392, 393, 396, 381, - 381, 381, 381, 381, 381, 397, 381, 381, 388, 388, - 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, - 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, - 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, - 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, - 381, 381, 381, 398, 381, 381, 399, 381, 381, 381, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 383, 383, 391, 391, 383, 392, 383, 383, + 383, 397, 383, 383, 383, 383, 383, 394, 395, 398, + 383, 383, 383, 383, 383, 383, 399, 383, 383, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 383, 383, 383, 400, 383, 383, 401, 383, 383, - 381, 381, 381, 381, 397, 381, 381, 388, 388, 388, - 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, - 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, - 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, - 388, 388, 388, 388, 388, 388, 388, 388, 381, 381, - 381, 381, 399, 381, 381, 381, 381, 381, 381, 381, - 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, - 388, 388, 388, 388, 388, 381, 388, 388, 388, 388, - 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, - 388, 388, 388, 388, 381, 381, 381, 381, 381, 381, + 383, 383, 383, 383, 383, 399, 383, 383, 383, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 383, 383, 383, 383, 401, 383, 383, 383, 383, 383, + 383, 383, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 383, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 383, 383, 383, 383, - 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, - 388, 388, 388, 388, 388, 388, 388, 381, 388, 388, - 388, 381, 388, 388, 388, 388, 388, 381, 381, 388, - 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, - 388, 388, 388, 388, 388, 388, 388, 381, 388, 388, - 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, - 388, 381, 388, 388, 388, 388, 388, 388, 388, 388, - 388, 388, 388, 388, 388, 388, 381, 388, 381, 388, - 0, 381, 381, 381, 381, 381, 381, 381, 381, 381, - 381, 381, 381, 381, 381, 381, 381, 381, 381 + 383, 383, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 383, + 390, 390, 390, 383, 390, 390, 390, 390, 390, 383, + 383, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 383, + 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 383, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 390, 390, 390, 390, 383, 390, + 383, 390, 0, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383 } ; static yyconst flex_int16_t yy_nxt[2221] = @@ -582,242 +584,242 @@ static yyconst flex_int16_t yy_nxt[2221] = 19, 36, 37, 19, 19, 38, 39, 40, 41, 42, 19, 19, 8, 8, 43, 44, 45, 50, 52, 50, 56, 56, 57, 57, 57, 57, 57, 57, 57, 50, - 251, 50, 75, 75, 362, 58, 58, 76, 253, 59, - 64, 52, 251, 348, 65, 252, 197, 76, 329, 253, + 253, 50, 72, 76, 76, 58, 58, 77, 364, 59, + 64, 52, 253, 255, 65, 254, 350, 77, 198, 331, - 53, 76, 328, 58, 58, 60, 60, 60, 60, 60, - 60, 60, 80, 83, 77, 78, 79, 61, 62, 63, - 67, 138, 61, 53, 77, 78, 79, 300, 77, 78, - 79, 197, 76, 89, 299, 61, 62, 63, 298, 76, - 253, 297, 61, 296, 295, 75, 84, 68, 69, 70, - 56, 66, 71, 71, 71, 71, 71, 71, 71, 77, - 78, 79, 72, 72, 260, 58, 77, 78, 79, 72, - 72, 138, 72, 72, 73, 206, 74, 259, 206, 85, - 72, 72, 86, 58, 258, 197, 90, 207, 75, 72, - 72, 76, 204, 87, 66, 206, 72, 72, 73, 81, + 53, 77, 72, 58, 58, 60, 60, 60, 60, 60, + 60, 60, 81, 84, 78, 79, 80, 61, 62, 63, + 67, 208, 61, 53, 78, 79, 80, 255, 78, 79, + 80, 330, 77, 90, 139, 61, 62, 63, 302, 77, + 198, 208, 61, 301, 300, 255, 85, 68, 69, 70, + 56, 299, 71, 71, 71, 71, 71, 71, 71, 78, + 79, 80, 72, 72, 298, 58, 78, 79, 80, 73, + 73, 297, 72, 72, 74, 207, 75, 76, 208, 86, + 72, 72, 87, 58, 66, 262, 139, 261, 260, 73, + 73, 77, 198, 88, 91, 207, 72, 72, 74, 82, - 81, 88, 206, 82, 82, 82, 82, 82, 82, 82, - 90, 90, 90, 90, 90, 90, 90, 76, 77, 78, - 79, 91, 92, 93, 94, 76, 203, 202, 76, 95, - 96, 138, 76, 196, 192, 76, 192, 104, 381, 125, - 97, 98, 191, 90, 77, 78, 79, 99, 148, 147, - 76, 75, 77, 78, 79, 77, 78, 79, 76, 77, - 78, 79, 77, 78, 79, 76, 381, 100, 105, 76, - 145, 144, 106, 66, 76, 101, 134, 77, 78, 79, - 102, 381, 76, 128, 107, 77, 78, 79, 112, 76, - 111, 108, 77, 78, 79, 109, 77, 78, 79, 110, + 82, 89, 208, 83, 83, 83, 83, 83, 83, 83, + 91, 91, 91, 91, 91, 91, 91, 77, 78, 79, + 80, 92, 93, 94, 95, 77, 209, 76, 77, 96, + 97, 205, 77, 66, 204, 77, 203, 105, 139, 197, + 98, 99, 193, 193, 78, 79, 80, 100, 383, 126, + 77, 192, 78, 79, 80, 78, 79, 80, 77, 78, + 79, 80, 78, 79, 80, 77, 91, 101, 106, 77, + 149, 148, 107, 76, 77, 102, 383, 78, 79, 80, + 103, 146, 77, 145, 108, 78, 79, 80, 113, 77, + 112, 109, 78, 79, 80, 110, 78, 79, 80, 111, - 76, 77, 78, 79, 76, 381, 126, 125, 123, 77, - 78, 79, 76, 113, 121, 122, 77, 78, 79, 90, - 103, 381, 206, 115, 114, 206, 55, 77, 78, 79, - 381, 77, 78, 79, 76, 49, 49, 116, 47, 77, - 78, 79, 206, 47, 117, 381, 118, 381, 119, 206, - 381, 139, 381, 120, 130, 130, 130, 130, 130, 130, - 381, 77, 78, 79, 132, 132, 76, 381, 133, 133, - 133, 133, 133, 133, 133, 135, 135, 140, 131, 136, - 136, 136, 136, 136, 136, 136, 66, 66, 66, 66, - 66, 66, 66, 77, 78, 79, 75, 75, 75, 75, + 77, 78, 79, 80, 77, 66, 135, 383, 129, 78, + 79, 80, 77, 114, 122, 383, 78, 79, 80, 127, + 126, 124, 207, 116, 115, 208, 123, 78, 79, 80, + 91, 78, 79, 80, 77, 104, 383, 117, 55, 78, + 79, 80, 207, 383, 118, 49, 119, 49, 120, 208, + 47, 140, 47, 121, 131, 131, 131, 131, 131, 131, + 383, 78, 79, 80, 133, 133, 77, 383, 134, 134, + 134, 134, 134, 134, 134, 136, 136, 141, 132, 137, + 137, 137, 137, 137, 137, 137, 66, 66, 66, 66, + 66, 66, 66, 78, 79, 80, 76, 76, 76, 76, - 75, 381, 381, 381, 141, 142, 143, 76, 75, 75, - 76, 381, 75, 381, 154, 155, 381, 381, 76, 381, - 381, 381, 381, 76, 150, 152, 151, 381, 149, 150, - 75, 381, 381, 76, 77, 78, 79, 77, 78, 79, - 153, 76, 150, 381, 151, 77, 78, 79, 156, 150, - 77, 78, 79, 155, 76, 75, 157, 76, 381, 381, - 77, 78, 79, 381, 76, 381, 381, 76, 77, 78, - 79, 76, 381, 381, 76, 381, 158, 159, 381, 381, - 381, 77, 78, 79, 77, 78, 79, 381, 160, 76, - 381, 77, 78, 79, 77, 78, 79, 76, 77, 78, + 76, 383, 383, 383, 142, 143, 144, 77, 76, 76, + 77, 383, 76, 383, 155, 156, 383, 383, 77, 383, + 383, 383, 383, 77, 151, 153, 152, 383, 150, 151, + 76, 383, 383, 77, 78, 79, 80, 78, 79, 80, + 154, 77, 151, 383, 152, 78, 79, 80, 157, 151, + 78, 79, 80, 156, 77, 76, 158, 77, 383, 383, + 78, 79, 80, 383, 77, 383, 383, 77, 78, 79, + 80, 77, 383, 383, 77, 383, 159, 160, 383, 383, + 383, 78, 79, 80, 78, 79, 80, 383, 161, 77, + 383, 78, 79, 80, 78, 79, 80, 77, 78, 79, - 79, 77, 78, 79, 164, 381, 381, 161, 381, 162, - 76, 381, 163, 76, 381, 381, 77, 78, 79, 165, - 76, 381, 168, 76, 77, 78, 79, 381, 198, 381, - 166, 76, 381, 167, 76, 381, 169, 77, 78, 79, - 77, 78, 79, 76, 171, 381, 76, 77, 78, 79, - 77, 78, 79, 76, 170, 199, 200, 201, 77, 78, - 79, 77, 78, 79, 172, 76, 381, 173, 174, 76, - 77, 78, 79, 77, 78, 79, 76, 381, 381, 76, - 77, 78, 79, 76, 175, 176, 76, 381, 381, 76, - 177, 180, 77, 78, 79, 155, 77, 78, 79, 179, + 80, 78, 79, 80, 165, 383, 383, 162, 383, 163, + 77, 383, 164, 77, 383, 383, 78, 79, 80, 166, + 77, 383, 169, 77, 78, 79, 80, 383, 199, 383, + 167, 77, 383, 168, 77, 383, 170, 78, 79, 80, + 78, 79, 80, 77, 172, 383, 77, 78, 79, 80, + 78, 79, 80, 77, 171, 200, 201, 202, 78, 79, + 80, 78, 79, 80, 173, 77, 383, 174, 175, 77, + 78, 79, 80, 78, 79, 80, 77, 383, 383, 77, + 78, 79, 80, 77, 176, 177, 77, 383, 383, 77, + 178, 181, 78, 79, 80, 156, 78, 79, 80, 180, - 178, 381, 76, 77, 78, 79, 77, 78, 79, 76, - 77, 78, 79, 77, 78, 79, 77, 78, 79, 76, - 183, 181, 381, 76, 182, 381, 76, 381, 381, 77, - 78, 79, 381, 381, 381, 381, 77, 78, 79, 184, - 381, 381, 76, 381, 381, 76, 77, 78, 79, 185, - 77, 78, 79, 77, 78, 79, 186, 76, 381, 381, - 187, 139, 381, 76, 381, 381, 189, 381, 381, 77, - 78, 79, 77, 78, 79, 188, 76, 133, 133, 133, - 133, 133, 133, 133, 77, 78, 79, 140, 381, 192, - 77, 78, 79, 381, 190, 193, 193, 193, 193, 193, + 179, 383, 77, 78, 79, 80, 78, 79, 80, 77, + 78, 79, 80, 78, 79, 80, 78, 79, 80, 77, + 184, 182, 383, 77, 183, 383, 77, 383, 383, 78, + 79, 80, 383, 383, 383, 383, 78, 79, 80, 185, + 383, 383, 77, 383, 383, 77, 78, 79, 80, 186, + 78, 79, 80, 78, 79, 80, 187, 77, 383, 383, + 188, 140, 383, 77, 383, 383, 190, 383, 383, 78, + 79, 80, 78, 79, 80, 189, 77, 134, 134, 134, + 134, 134, 134, 134, 78, 79, 80, 141, 383, 193, + 78, 79, 80, 383, 191, 194, 194, 194, 194, 194, - 193, 381, 381, 77, 78, 79, 133, 133, 133, 133, - 133, 133, 133, 381, 141, 142, 143, 381, 195, 381, - 63, 381, 381, 195, 136, 136, 136, 136, 136, 136, - 136, 381, 381, 381, 381, 381, 195, 76, 63, 381, - 208, 76, 381, 195, 136, 136, 136, 136, 136, 136, - 136, 138, 138, 138, 138, 138, 61, 381, 63, 76, - 381, 61, 381, 212, 77, 78, 79, 138, 77, 78, - 79, 76, 381, 209, 61, 381, 63, 76, 381, 381, - 76, 61, 381, 214, 76, 138, 77, 78, 79, 76, - 381, 210, 76, 381, 211, 381, 213, 381, 77, 78, + 194, 383, 383, 78, 79, 80, 134, 134, 134, 134, + 134, 134, 134, 383, 142, 143, 144, 383, 196, 383, + 63, 383, 383, 196, 137, 137, 137, 137, 137, 137, + 137, 383, 383, 383, 383, 383, 196, 77, 63, 383, + 210, 77, 383, 196, 137, 137, 137, 137, 137, 137, + 137, 139, 139, 139, 139, 139, 61, 383, 63, 77, + 383, 61, 383, 214, 78, 79, 80, 139, 78, 79, + 80, 77, 383, 211, 61, 383, 63, 77, 383, 383, + 77, 61, 383, 216, 77, 139, 78, 79, 80, 77, + 383, 212, 77, 383, 213, 383, 215, 383, 78, 79, - 79, 76, 381, 381, 77, 78, 79, 77, 78, 79, - 138, 77, 78, 79, 76, 381, 77, 78, 79, 77, - 78, 79, 215, 381, 76, 221, 218, 76, 77, 78, - 79, 216, 217, 76, 381, 381, 76, 381, 381, 219, - 76, 77, 78, 79, 381, 76, 381, 381, 381, 381, - 381, 77, 78, 79, 77, 78, 79, 381, 220, 76, - 77, 78, 79, 77, 78, 79, 222, 77, 78, 79, - 76, 381, 77, 78, 79, 76, 381, 225, 76, 381, - 381, 224, 76, 381, 227, 223, 77, 78, 79, 76, - 381, 381, 381, 76, 226, 228, 229, 77, 78, 79, + 80, 77, 383, 383, 78, 79, 80, 78, 79, 80, + 139, 78, 79, 80, 77, 383, 78, 79, 80, 78, + 79, 80, 217, 383, 77, 223, 220, 77, 78, 79, + 80, 218, 219, 77, 383, 383, 77, 383, 383, 221, + 77, 78, 79, 80, 383, 77, 383, 383, 383, 383, + 383, 78, 79, 80, 78, 79, 80, 383, 222, 77, + 78, 79, 80, 78, 79, 80, 224, 78, 79, 80, + 77, 383, 78, 79, 80, 77, 383, 227, 77, 383, + 383, 226, 77, 383, 229, 225, 78, 79, 80, 77, + 383, 383, 383, 77, 228, 230, 231, 78, 79, 80, - 76, 381, 77, 78, 79, 77, 78, 79, 381, 77, - 78, 79, 76, 230, 231, 76, 77, 78, 79, 76, - 77, 78, 79, 381, 381, 233, 76, 77, 78, 79, - 76, 239, 381, 76, 235, 381, 232, 213, 236, 77, - 78, 79, 77, 78, 79, 76, 77, 78, 79, 76, - 238, 234, 76, 77, 78, 79, 237, 77, 78, 79, - 77, 78, 79, 76, 381, 381, 76, 240, 381, 76, - 381, 381, 77, 78, 79, 242, 77, 78, 79, 77, - 78, 79, 76, 381, 241, 76, 243, 381, 381, 76, - 77, 78, 79, 77, 78, 79, 77, 78, 79, 245, + 77, 383, 78, 79, 80, 78, 79, 80, 383, 78, + 79, 80, 77, 232, 233, 77, 78, 79, 80, 77, + 78, 79, 80, 383, 383, 235, 77, 78, 79, 80, + 77, 241, 383, 77, 237, 383, 234, 215, 238, 78, + 79, 80, 78, 79, 80, 77, 78, 79, 80, 77, + 240, 236, 77, 78, 79, 80, 239, 78, 79, 80, + 78, 79, 80, 77, 383, 383, 77, 242, 383, 77, + 383, 383, 78, 79, 80, 244, 78, 79, 80, 78, + 79, 80, 77, 383, 243, 77, 245, 383, 383, 77, + 78, 79, 80, 78, 79, 80, 78, 79, 80, 247, - 139, 381, 244, 381, 247, 76, 381, 381, 381, 77, - 78, 79, 77, 78, 79, 246, 77, 78, 79, 76, - 249, 249, 249, 249, 249, 249, 254, 381, 381, 248, - 76, 381, 77, 78, 79, 197, 197, 197, 197, 197, - 197, 197, 261, 76, 381, 381, 77, 78, 79, 76, - 381, 264, 76, 255, 256, 257, 76, 77, 78, 79, - 265, 76, 381, 262, 76, 381, 263, 76, 381, 381, - 77, 78, 79, 381, 76, 266, 77, 78, 79, 77, - 78, 79, 381, 77, 78, 79, 267, 76, 77, 78, - 79, 77, 78, 79, 77, 78, 79, 268, 76, 381, + 140, 383, 246, 383, 249, 77, 383, 383, 383, 78, + 79, 80, 78, 79, 80, 248, 78, 79, 80, 77, + 251, 251, 251, 251, 251, 251, 256, 383, 383, 250, + 77, 383, 78, 79, 80, 198, 198, 198, 198, 198, + 198, 198, 263, 77, 383, 383, 78, 79, 80, 77, + 383, 266, 77, 257, 258, 259, 77, 78, 79, 80, + 267, 77, 383, 264, 77, 383, 265, 77, 383, 383, + 78, 79, 80, 383, 77, 268, 78, 79, 80, 78, + 79, 80, 383, 78, 79, 80, 269, 77, 78, 79, + 80, 78, 79, 80, 78, 79, 80, 270, 77, 383, - 381, 77, 78, 79, 76, 381, 381, 76, 381, 381, - 269, 76, 381, 381, 77, 78, 79, 381, 381, 76, - 271, 272, 76, 381, 270, 77, 78, 79, 76, 273, - 381, 77, 78, 79, 77, 78, 79, 274, 77, 78, - 79, 76, 276, 381, 76, 381, 77, 78, 79, 77, - 78, 79, 76, 280, 381, 77, 78, 79, 381, 275, - 76, 381, 381, 76, 381, 381, 277, 76, 77, 78, - 79, 77, 78, 79, 76, 278, 381, 76, 381, 77, - 78, 79, 76, 381, 381, 76, 381, 77, 78, 79, - 77, 78, 79, 281, 77, 78, 79, 239, 279, 76, + 383, 78, 79, 80, 77, 383, 383, 77, 383, 383, + 271, 77, 383, 383, 78, 79, 80, 383, 383, 77, + 273, 274, 77, 383, 272, 78, 79, 80, 77, 275, + 383, 78, 79, 80, 78, 79, 80, 276, 78, 79, + 80, 77, 278, 383, 77, 383, 78, 79, 80, 78, + 79, 80, 77, 282, 383, 78, 79, 80, 383, 277, + 77, 383, 383, 77, 383, 383, 279, 77, 78, 79, + 80, 78, 79, 80, 77, 280, 383, 77, 383, 78, + 79, 80, 77, 383, 383, 77, 383, 78, 79, 80, + 78, 79, 80, 283, 78, 79, 80, 241, 281, 77, - 381, 77, 78, 79, 77, 78, 79, 282, 76, 77, - 78, 79, 77, 78, 79, 381, 76, 381, 381, 381, - 76, 283, 381, 76, 381, 381, 77, 78, 79, 284, - 76, 381, 381, 76, 286, 77, 78, 79, 381, 381, - 381, 381, 381, 77, 78, 79, 76, 77, 78, 79, - 77, 78, 79, 285, 139, 381, 289, 77, 78, 79, - 77, 78, 79, 76, 381, 287, 76, 381, 381, 288, - 76, 381, 381, 77, 78, 79, 76, 381, 291, 292, - 254, 381, 290, 76, 381, 381, 76, 381, 294, 304, - 77, 78, 79, 77, 78, 79, 76, 77, 78, 79, + 383, 78, 79, 80, 78, 79, 80, 284, 77, 78, + 79, 80, 78, 79, 80, 383, 77, 383, 383, 383, + 77, 285, 383, 77, 383, 383, 78, 79, 80, 286, + 77, 383, 383, 77, 288, 78, 79, 80, 383, 383, + 383, 383, 383, 78, 79, 80, 77, 78, 79, 80, + 78, 79, 80, 287, 140, 383, 291, 78, 79, 80, + 78, 79, 80, 77, 383, 289, 77, 383, 383, 290, + 77, 383, 383, 78, 79, 80, 77, 383, 293, 294, + 256, 383, 292, 77, 383, 383, 77, 383, 296, 306, + 78, 79, 80, 78, 79, 80, 77, 78, 79, 80, - 76, 293, 301, 77, 78, 79, 381, 255, 256, 257, - 77, 78, 79, 77, 78, 79, 253, 253, 253, 253, - 253, 302, 381, 77, 78, 79, 76, 77, 78, 79, - 76, 305, 253, 76, 381, 381, 303, 76, 381, 307, - 76, 381, 381, 76, 306, 308, 381, 309, 381, 76, - 253, 381, 76, 77, 78, 79, 310, 77, 78, 79, - 77, 78, 79, 381, 77, 78, 79, 77, 78, 79, - 77, 78, 79, 76, 381, 253, 77, 78, 79, 77, - 78, 79, 76, 381, 311, 312, 76, 381, 381, 76, - 381, 314, 381, 313, 381, 381, 381, 381, 76, 381, + 77, 295, 303, 78, 79, 80, 383, 257, 258, 259, + 78, 79, 80, 78, 79, 80, 255, 255, 255, 255, + 255, 304, 383, 78, 79, 80, 77, 78, 79, 80, + 77, 307, 255, 77, 383, 383, 305, 77, 383, 309, + 77, 383, 383, 77, 308, 310, 383, 311, 383, 77, + 255, 383, 77, 78, 79, 80, 312, 78, 79, 80, + 78, 79, 80, 383, 78, 79, 80, 78, 79, 80, + 78, 79, 80, 77, 383, 255, 78, 79, 80, 78, + 79, 80, 77, 383, 313, 314, 77, 383, 383, 77, + 383, 316, 383, 315, 383, 383, 383, 383, 77, 383, - 77, 78, 79, 76, 381, 318, 76, 381, 381, 77, - 78, 79, 317, 77, 78, 79, 77, 78, 79, 315, - 76, 381, 316, 76, 381, 77, 78, 79, 304, 76, - 77, 78, 79, 77, 78, 79, 76, 381, 381, 76, - 381, 381, 319, 76, 322, 381, 76, 77, 78, 79, - 77, 78, 79, 304, 76, 323, 77, 78, 79, 76, - 320, 381, 76, 77, 78, 79, 77, 78, 79, 76, - 77, 78, 79, 77, 78, 79, 76, 324, 381, 321, - 76, 77, 78, 79, 76, 381, 77, 78, 79, 77, - 78, 79, 76, 381, 325, 76, 77, 78, 79, 76, + 78, 79, 80, 77, 383, 320, 77, 383, 383, 78, + 79, 80, 319, 78, 79, 80, 78, 79, 80, 317, + 77, 383, 318, 77, 383, 78, 79, 80, 306, 77, + 78, 79, 80, 78, 79, 80, 77, 383, 383, 77, + 383, 383, 321, 77, 324, 383, 77, 78, 79, 80, + 78, 79, 80, 306, 77, 325, 78, 79, 80, 77, + 322, 383, 77, 78, 79, 80, 78, 79, 80, 77, + 78, 79, 80, 78, 79, 80, 77, 326, 383, 323, + 77, 78, 79, 80, 77, 383, 78, 79, 80, 78, + 79, 80, 77, 383, 327, 77, 78, 79, 80, 77, - 381, 330, 327, 77, 78, 79, 331, 77, 78, 79, - 76, 77, 78, 79, 76, 326, 381, 76, 381, 77, - 78, 79, 77, 78, 79, 333, 77, 78, 79, 76, - 334, 381, 76, 381, 332, 76, 381, 77, 78, 79, - 76, 77, 78, 79, 77, 78, 79, 76, 381, 337, - 381, 381, 335, 76, 336, 381, 77, 78, 79, 77, - 78, 79, 77, 78, 79, 76, 381, 77, 78, 79, - 76, 381, 381, 339, 77, 78, 79, 339, 76, 338, - 77, 78, 79, 76, 381, 381, 76, 381, 381, 381, - 340, 341, 77, 78, 79, 76, 381, 77, 78, 79, + 383, 332, 329, 78, 79, 80, 333, 78, 79, 80, + 77, 78, 79, 80, 77, 328, 383, 77, 383, 78, + 79, 80, 78, 79, 80, 335, 78, 79, 80, 77, + 336, 383, 77, 383, 334, 77, 383, 78, 79, 80, + 77, 78, 79, 80, 78, 79, 80, 77, 383, 339, + 383, 383, 337, 77, 338, 383, 78, 79, 80, 78, + 79, 80, 78, 79, 80, 77, 383, 78, 79, 80, + 77, 383, 383, 341, 78, 79, 80, 341, 77, 340, + 78, 79, 80, 77, 383, 383, 77, 383, 383, 383, + 342, 343, 78, 79, 80, 77, 383, 78, 79, 80, - 342, 76, 381, 381, 76, 77, 78, 79, 76, 381, - 77, 78, 79, 77, 78, 79, 381, 76, 343, 235, - 76, 381, 77, 78, 79, 76, 381, 381, 77, 78, - 79, 77, 78, 79, 76, 77, 78, 79, 344, 76, - 345, 381, 381, 76, 77, 78, 79, 77, 78, 79, - 76, 381, 77, 78, 79, 347, 381, 381, 76, 346, - 381, 77, 78, 79, 349, 210, 77, 78, 79, 76, - 77, 78, 79, 76, 381, 381, 351, 77, 78, 79, - 76, 381, 381, 352, 76, 77, 78, 79, 76, 381, - 353, 76, 350, 381, 354, 76, 77, 78, 79, 76, + 344, 77, 383, 383, 77, 78, 79, 80, 77, 383, + 78, 79, 80, 78, 79, 80, 383, 77, 345, 237, + 77, 383, 78, 79, 80, 77, 383, 383, 78, 79, + 80, 78, 79, 80, 77, 78, 79, 80, 346, 77, + 347, 383, 383, 77, 78, 79, 80, 78, 79, 80, + 77, 383, 78, 79, 80, 349, 383, 383, 77, 348, + 383, 78, 79, 80, 351, 212, 78, 79, 80, 77, + 78, 79, 80, 77, 383, 383, 353, 78, 79, 80, + 77, 383, 383, 354, 77, 78, 79, 80, 77, 383, + 355, 77, 352, 383, 356, 77, 78, 79, 80, 77, - 77, 78, 79, 355, 76, 356, 381, 77, 78, 79, - 339, 77, 78, 79, 381, 77, 78, 79, 77, 78, - 79, 76, 77, 78, 79, 76, 77, 78, 79, 76, - 357, 77, 78, 79, 76, 339, 358, 76, 381, 381, - 360, 76, 381, 381, 381, 76, 381, 381, 77, 78, - 79, 361, 77, 78, 79, 359, 77, 78, 79, 291, - 76, 77, 78, 79, 77, 78, 79, 363, 77, 78, - 79, 76, 77, 78, 79, 366, 381, 364, 210, 76, - 381, 381, 381, 76, 381, 381, 76, 77, 78, 79, - 76, 381, 367, 381, 381, 76, 381, 381, 77, 78, + 78, 79, 80, 357, 77, 358, 383, 78, 79, 80, + 341, 78, 79, 80, 383, 78, 79, 80, 78, 79, + 80, 77, 78, 79, 80, 77, 78, 79, 80, 77, + 359, 78, 79, 80, 77, 341, 360, 77, 383, 383, + 362, 77, 383, 383, 383, 77, 383, 383, 78, 79, + 80, 363, 78, 79, 80, 361, 78, 79, 80, 293, + 77, 78, 79, 80, 78, 79, 80, 365, 78, 79, + 80, 77, 78, 79, 80, 368, 383, 366, 212, 77, + 383, 383, 383, 77, 383, 383, 77, 78, 79, 80, + 77, 383, 369, 383, 383, 77, 383, 383, 78, 79, - 79, 381, 76, 365, 381, 76, 77, 78, 79, 381, - 77, 78, 79, 77, 78, 79, 368, 77, 78, 79, - 369, 76, 77, 78, 79, 381, 76, 381, 381, 77, - 78, 79, 77, 78, 79, 370, 76, 381, 381, 76, - 381, 381, 357, 76, 364, 371, 76, 381, 77, 78, - 79, 76, 381, 77, 78, 79, 76, 372, 381, 375, - 381, 381, 373, 77, 78, 79, 77, 78, 79, 76, - 77, 78, 79, 77, 78, 79, 76, 377, 77, 78, - 79, 76, 339, 77, 78, 79, 381, 76, 374, 339, - 381, 381, 76, 381, 381, 76, 77, 78, 79, 76, + 80, 383, 77, 367, 383, 77, 78, 79, 80, 383, + 78, 79, 80, 78, 79, 80, 370, 78, 79, 80, + 371, 77, 78, 79, 80, 383, 77, 383, 383, 78, + 79, 80, 78, 79, 80, 372, 77, 383, 383, 77, + 383, 383, 359, 77, 366, 373, 77, 383, 78, 79, + 80, 77, 383, 78, 79, 80, 77, 374, 383, 377, + 383, 383, 375, 78, 79, 80, 78, 79, 80, 77, + 78, 79, 80, 78, 79, 80, 77, 379, 78, 79, + 80, 77, 341, 78, 79, 80, 383, 77, 376, 341, + 383, 383, 77, 383, 383, 77, 78, 79, 80, 77, - 381, 381, 381, 77, 78, 79, 376, 76, 77, 78, - 79, 339, 76, 379, 77, 78, 79, 381, 339, 77, - 78, 79, 77, 78, 79, 381, 77, 78, 79, 378, - 381, 76, 381, 381, 77, 78, 79, 76, 381, 77, - 78, 79, 76, 380, 381, 381, 381, 381, 381, 381, - 381, 381, 381, 381, 339, 381, 381, 381, 77, 78, - 79, 381, 381, 381, 77, 78, 79, 381, 381, 77, - 78, 79, 46, 46, 46, 46, 46, 46, 46, 46, + 383, 383, 383, 78, 79, 80, 378, 77, 78, 79, + 80, 341, 77, 381, 78, 79, 80, 383, 341, 78, + 79, 80, 78, 79, 80, 383, 78, 79, 80, 380, + 383, 77, 383, 383, 78, 79, 80, 77, 383, 78, + 79, 80, 77, 382, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 341, 383, 383, 383, 78, 79, + 80, 383, 383, 383, 78, 79, 80, 383, 383, 78, + 79, 80, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 54, 54, 54, 54, 54, 54, - 54, 54, 54, 54, 54, 54, 54, 54, 57, 381, - 57, 381, 57, 381, 57, 66, 381, 381, 66, 381, - 66, 66, 66, 66, 66, 75, 75, 381, 75, 75, - 75, 75, 75, 75, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 127, 127, - 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, - 127, 129, 381, 129, 129, 129, 129, 129, 129, 129, - 129, 129, 129, 129, 129, 137, 381, 137, 137, 137, + 54, 54, 54, 54, 54, 54, 54, 54, 57, 383, + 57, 383, 57, 383, 57, 66, 383, 383, 66, 383, + 66, 66, 66, 66, 66, 76, 76, 383, 76, 76, + 76, 76, 76, 76, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 130, 383, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 130, 138, 383, 138, 138, 138, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 138, - 138, 138, 138, 138, 138, 138, 138, 138, 146, 146, - 146, 194, 381, 381, 381, 381, 194, 194, 194, 197, - 197, 197, 197, 197, 205, 205, 205, 381, 381, 205, - 250, 250, 250, 253, 253, 253, 253, 253, 253, 253, - 253, 253, 7, 381, 381, 381, 381, 381, 381, 381, - 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, - 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, - 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, - 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 147, 147, + 147, 195, 383, 383, 383, 383, 195, 195, 195, 198, + 198, 198, 198, 198, 206, 206, 206, 383, 383, 206, + 252, 252, 252, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 7, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, - 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, - 381, 381, 381, 381, 381, 381, 381, 381, 381, 381 + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383 } ; static yyconst flex_int16_t yy_chk[2221] = @@ -830,242 +832,242 @@ static yyconst flex_int16_t yy_chk[2221] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 11, 9, 13, 14, 13, 13, 13, 13, 13, 13, 13, 50, - 362, 50, 81, 81, 348, 13, 14, 19, 329, 14, - 16, 51, 196, 328, 16, 196, 300, 20, 299, 298, + 364, 50, 73, 82, 82, 13, 14, 19, 350, 14, + 16, 51, 197, 331, 16, 197, 330, 20, 302, 301, - 11, 22, 297, 13, 14, 15, 15, 15, 15, 15, + 11, 22, 73, 13, 14, 15, 15, 15, 15, 15, 15, 15, 20, 22, 19, 19, 19, 15, 15, 15, - 16, 260, 15, 51, 20, 20, 20, 259, 22, 22, - 22, 258, 23, 25, 257, 15, 15, 15, 256, 25, - 255, 252, 15, 250, 249, 207, 23, 16, 16, 16, - 17, 204, 17, 17, 17, 17, 17, 17, 17, 23, - 23, 23, 17, 73, 203, 17, 25, 25, 25, 17, - 73, 202, 17, 73, 17, 146, 17, 201, 146, 24, - 17, 73, 24, 17, 200, 199, 191, 148, 147, 17, - 73, 24, 145, 24, 144, 146, 17, 73, 17, 21, + 16, 207, 15, 51, 20, 20, 20, 300, 22, 22, + 22, 299, 23, 25, 262, 15, 15, 15, 261, 25, + 260, 207, 15, 259, 258, 257, 23, 16, 16, 16, + 17, 254, 17, 17, 17, 17, 17, 17, 17, 23, + 23, 23, 17, 74, 252, 17, 25, 25, 25, 17, + 74, 251, 17, 74, 17, 147, 17, 209, 147, 24, + 17, 74, 24, 17, 205, 204, 203, 202, 201, 17, + 74, 24, 200, 24, 192, 147, 17, 74, 17, 21, - 21, 24, 146, 21, 21, 21, 21, 21, 21, 21, + 21, 24, 147, 21, 21, 21, 21, 21, 21, 21, 26, 26, 26, 26, 26, 26, 26, 28, 24, 24, - 24, 27, 27, 27, 27, 32, 143, 142, 21, 27, - 27, 141, 29, 134, 131, 27, 129, 32, 125, 124, - 28, 29, 123, 122, 28, 28, 28, 29, 79, 78, - 33, 77, 32, 32, 32, 21, 21, 21, 34, 29, - 29, 29, 27, 27, 27, 30, 71, 30, 33, 35, - 70, 69, 34, 68, 37, 30, 59, 33, 33, 33, - 30, 57, 38, 54, 35, 34, 34, 34, 38, 36, + 24, 27, 27, 27, 27, 32, 149, 148, 21, 27, + 27, 146, 29, 145, 144, 27, 143, 32, 142, 135, + 28, 29, 132, 130, 28, 28, 28, 29, 126, 125, + 33, 124, 32, 32, 32, 21, 21, 21, 34, 29, + 29, 29, 27, 27, 27, 30, 123, 30, 33, 35, + 80, 79, 34, 78, 37, 30, 71, 33, 33, 33, + 30, 70, 38, 69, 35, 34, 34, 34, 38, 36, 37, 36, 30, 30, 30, 36, 35, 35, 35, 36, - 40, 37, 37, 37, 39, 53, 47, 46, 45, 38, - 38, 38, 42, 39, 42, 44, 36, 36, 36, 43, - 31, 18, 205, 40, 39, 205, 12, 40, 40, 40, - 7, 39, 39, 39, 41, 6, 5, 41, 4, 42, - 42, 42, 205, 3, 41, 0, 41, 0, 41, 205, - 0, 66, 0, 41, 55, 55, 55, 55, 55, 55, - 0, 41, 41, 41, 58, 58, 75, 0, 58, 58, + 40, 37, 37, 37, 39, 68, 59, 57, 54, 38, + 38, 38, 42, 39, 42, 53, 36, 36, 36, 47, + 46, 45, 206, 40, 39, 206, 44, 40, 40, 40, + 43, 39, 39, 39, 41, 31, 18, 41, 12, 42, + 42, 42, 206, 7, 41, 6, 41, 5, 41, 206, + 4, 66, 3, 41, 55, 55, 55, 55, 55, 55, + 0, 41, 41, 41, 58, 58, 76, 0, 58, 58, 58, 58, 58, 58, 58, 62, 62, 66, 55, 62, 62, 62, 62, 62, 62, 62, 67, 67, 67, 67, - 67, 67, 67, 75, 75, 75, 76, 76, 76, 76, + 67, 67, 67, 76, 76, 76, 77, 77, 77, 77, - 76, 0, 0, 0, 66, 66, 66, 80, 82, 82, - 83, 0, 76, 0, 85, 86, 0, 0, 85, 0, - 0, 0, 0, 86, 82, 83, 82, 0, 80, 82, - 76, 0, 0, 84, 80, 80, 80, 83, 83, 83, - 84, 88, 82, 0, 82, 85, 85, 85, 87, 82, - 86, 86, 86, 88, 87, 76, 89, 90, 0, 0, - 84, 84, 84, 0, 89, 0, 0, 91, 88, 88, - 88, 92, 0, 0, 93, 0, 91, 92, 0, 0, - 0, 87, 87, 87, 90, 90, 90, 0, 93, 95, - 0, 89, 89, 89, 91, 91, 91, 94, 92, 92, + 77, 0, 0, 0, 66, 66, 66, 81, 83, 83, + 84, 0, 77, 0, 86, 87, 0, 0, 86, 0, + 0, 0, 0, 87, 83, 84, 83, 0, 81, 83, + 77, 0, 0, 85, 81, 81, 81, 84, 84, 84, + 85, 89, 83, 0, 83, 86, 86, 86, 88, 83, + 87, 87, 87, 89, 88, 77, 90, 91, 0, 0, + 85, 85, 85, 0, 90, 0, 0, 92, 89, 89, + 89, 93, 0, 0, 94, 0, 92, 93, 0, 0, + 0, 88, 88, 88, 91, 91, 91, 0, 94, 96, + 0, 90, 90, 90, 92, 92, 92, 95, 93, 93, - 92, 93, 93, 93, 95, 0, 0, 94, 0, 94, - 96, 0, 94, 97, 0, 0, 95, 95, 95, 96, - 98, 0, 98, 99, 94, 94, 94, 0, 139, 0, - 96, 101, 0, 97, 100, 0, 99, 96, 96, 96, - 97, 97, 97, 102, 101, 0, 103, 98, 98, 98, - 99, 99, 99, 104, 100, 139, 139, 139, 101, 101, - 101, 100, 100, 100, 102, 106, 0, 103, 104, 105, - 102, 102, 102, 103, 103, 103, 107, 0, 0, 109, - 104, 104, 104, 110, 105, 106, 108, 0, 0, 111, - 107, 111, 106, 106, 106, 110, 105, 105, 105, 109, + 93, 94, 94, 94, 96, 0, 0, 95, 0, 95, + 97, 0, 95, 98, 0, 0, 96, 96, 96, 97, + 99, 0, 99, 100, 95, 95, 95, 0, 140, 0, + 97, 102, 0, 98, 101, 0, 100, 97, 97, 97, + 98, 98, 98, 103, 102, 0, 104, 99, 99, 99, + 100, 100, 100, 105, 101, 140, 140, 140, 102, 102, + 102, 101, 101, 101, 103, 107, 0, 104, 105, 106, + 103, 103, 103, 104, 104, 104, 108, 0, 0, 110, + 105, 105, 105, 111, 106, 107, 109, 0, 0, 112, + 108, 112, 107, 107, 107, 111, 106, 106, 106, 110, - 108, 0, 114, 107, 107, 107, 109, 109, 109, 113, - 110, 110, 110, 108, 108, 108, 111, 111, 111, 112, - 114, 112, 0, 115, 113, 0, 116, 0, 0, 114, - 114, 114, 0, 0, 0, 0, 113, 113, 113, 115, - 0, 0, 117, 0, 0, 118, 112, 112, 112, 116, - 115, 115, 115, 116, 116, 116, 117, 120, 0, 0, - 118, 138, 0, 119, 0, 0, 120, 0, 0, 117, - 117, 117, 118, 118, 118, 119, 121, 132, 132, 132, - 132, 132, 132, 132, 120, 120, 120, 138, 0, 130, - 119, 119, 119, 0, 121, 130, 130, 130, 130, 130, + 109, 0, 115, 108, 108, 108, 110, 110, 110, 114, + 111, 111, 111, 109, 109, 109, 112, 112, 112, 113, + 115, 113, 0, 116, 114, 0, 117, 0, 0, 115, + 115, 115, 0, 0, 0, 0, 114, 114, 114, 116, + 0, 0, 118, 0, 0, 119, 113, 113, 113, 117, + 116, 116, 116, 117, 117, 117, 118, 121, 0, 0, + 119, 139, 0, 120, 0, 0, 121, 0, 0, 118, + 118, 118, 119, 119, 119, 120, 122, 133, 133, 133, + 133, 133, 133, 133, 121, 121, 121, 139, 0, 131, + 120, 120, 120, 0, 122, 131, 131, 131, 131, 131, - 130, 0, 0, 121, 121, 121, 133, 133, 133, 133, - 133, 133, 133, 0, 138, 138, 138, 0, 133, 0, - 133, 0, 0, 133, 135, 135, 135, 135, 135, 135, - 135, 0, 0, 0, 0, 0, 133, 149, 133, 0, - 149, 150, 0, 133, 136, 136, 136, 136, 136, 136, - 136, 140, 140, 140, 140, 140, 136, 0, 136, 151, - 0, 136, 0, 154, 149, 149, 149, 140, 150, 150, - 150, 152, 0, 152, 136, 0, 136, 154, 0, 0, - 155, 136, 0, 157, 153, 140, 151, 151, 151, 156, - 0, 153, 157, 0, 153, 0, 156, 0, 152, 152, + 131, 0, 0, 122, 122, 122, 134, 134, 134, 134, + 134, 134, 134, 0, 139, 139, 139, 0, 134, 0, + 134, 0, 0, 134, 136, 136, 136, 136, 136, 136, + 136, 0, 0, 0, 0, 0, 134, 150, 134, 0, + 150, 151, 0, 134, 137, 137, 137, 137, 137, 137, + 137, 141, 141, 141, 141, 141, 137, 0, 137, 152, + 0, 137, 0, 155, 150, 150, 150, 141, 151, 151, + 151, 153, 0, 153, 137, 0, 137, 155, 0, 0, + 156, 137, 0, 158, 154, 141, 152, 152, 152, 157, + 0, 154, 158, 0, 154, 0, 157, 0, 153, 153, - 152, 158, 0, 0, 154, 154, 154, 155, 155, 155, - 140, 153, 153, 153, 161, 0, 156, 156, 156, 157, - 157, 157, 158, 0, 159, 164, 161, 160, 158, 158, - 158, 159, 160, 162, 0, 0, 164, 0, 0, 162, - 163, 161, 161, 161, 0, 165, 0, 0, 0, 0, - 0, 159, 159, 159, 160, 160, 160, 0, 163, 168, - 162, 162, 162, 164, 164, 164, 165, 163, 163, 163, - 166, 0, 165, 165, 165, 167, 0, 168, 169, 0, - 0, 167, 170, 0, 170, 166, 168, 168, 168, 171, - 0, 0, 0, 172, 169, 171, 172, 166, 166, 166, + 153, 159, 0, 0, 155, 155, 155, 156, 156, 156, + 141, 154, 154, 154, 162, 0, 157, 157, 157, 158, + 158, 158, 159, 0, 160, 165, 162, 161, 159, 159, + 159, 160, 161, 163, 0, 0, 165, 0, 0, 163, + 164, 162, 162, 162, 0, 166, 0, 0, 0, 0, + 0, 160, 160, 160, 161, 161, 161, 0, 164, 169, + 163, 163, 163, 165, 165, 165, 166, 164, 164, 164, + 167, 0, 166, 166, 166, 168, 0, 169, 170, 0, + 0, 168, 171, 0, 171, 167, 169, 169, 169, 172, + 0, 0, 0, 173, 170, 172, 173, 167, 167, 167, - 173, 0, 167, 167, 167, 169, 169, 169, 0, 170, - 170, 170, 174, 173, 174, 175, 171, 171, 171, 181, - 172, 172, 172, 0, 0, 176, 177, 173, 173, 173, - 178, 181, 0, 180, 177, 0, 175, 178, 179, 174, - 174, 174, 175, 175, 175, 176, 181, 181, 181, 182, - 180, 176, 179, 177, 177, 177, 179, 178, 178, 178, - 180, 180, 180, 183, 0, 0, 185, 182, 0, 184, - 0, 0, 176, 176, 176, 184, 182, 182, 182, 179, - 179, 179, 186, 0, 183, 187, 185, 0, 0, 189, - 183, 183, 183, 185, 185, 185, 184, 184, 184, 187, + 174, 0, 168, 168, 168, 170, 170, 170, 0, 171, + 171, 171, 175, 174, 175, 176, 172, 172, 172, 182, + 173, 173, 173, 0, 0, 177, 178, 174, 174, 174, + 179, 182, 0, 181, 178, 0, 176, 179, 180, 175, + 175, 175, 176, 176, 176, 177, 182, 182, 182, 183, + 181, 177, 180, 178, 178, 178, 180, 179, 179, 179, + 181, 181, 181, 184, 0, 0, 186, 183, 0, 185, + 0, 0, 177, 177, 177, 185, 183, 183, 183, 180, + 180, 180, 187, 0, 184, 188, 186, 0, 0, 190, + 184, 184, 184, 186, 186, 186, 185, 185, 185, 188, - 197, 0, 186, 0, 189, 188, 0, 0, 0, 186, - 186, 186, 187, 187, 187, 188, 189, 189, 189, 190, - 193, 193, 193, 193, 193, 193, 197, 0, 0, 190, - 208, 0, 188, 188, 188, 198, 198, 198, 198, 198, - 198, 198, 208, 209, 0, 0, 190, 190, 190, 210, - 0, 212, 211, 197, 197, 197, 213, 208, 208, 208, - 214, 215, 0, 209, 212, 0, 211, 214, 0, 0, - 209, 209, 209, 0, 216, 215, 210, 210, 210, 211, - 211, 211, 0, 213, 213, 213, 216, 217, 215, 215, - 215, 212, 212, 212, 214, 214, 214, 217, 218, 0, + 198, 0, 187, 0, 190, 189, 0, 0, 0, 187, + 187, 187, 188, 188, 188, 189, 190, 190, 190, 191, + 194, 194, 194, 194, 194, 194, 198, 0, 0, 191, + 210, 0, 189, 189, 189, 199, 199, 199, 199, 199, + 199, 199, 210, 211, 0, 0, 191, 191, 191, 212, + 0, 214, 213, 198, 198, 198, 215, 210, 210, 210, + 216, 217, 0, 211, 214, 0, 213, 216, 0, 0, + 211, 211, 211, 0, 218, 217, 212, 212, 212, 213, + 213, 213, 0, 215, 215, 215, 218, 219, 217, 217, + 217, 214, 214, 214, 216, 216, 216, 219, 220, 0, - 0, 216, 216, 216, 219, 0, 0, 220, 0, 0, - 218, 221, 0, 0, 217, 217, 217, 0, 0, 223, - 220, 221, 222, 0, 219, 218, 218, 218, 224, 222, - 0, 219, 219, 219, 220, 220, 220, 223, 221, 221, - 221, 225, 227, 0, 226, 0, 223, 223, 223, 222, - 222, 222, 228, 233, 0, 224, 224, 224, 0, 226, - 227, 0, 0, 229, 0, 0, 228, 230, 225, 225, - 225, 226, 226, 226, 233, 229, 0, 231, 0, 228, - 228, 228, 232, 0, 0, 234, 0, 227, 227, 227, - 229, 229, 229, 234, 230, 230, 230, 231, 232, 235, + 0, 218, 218, 218, 221, 0, 0, 222, 0, 0, + 220, 223, 0, 0, 219, 219, 219, 0, 0, 225, + 222, 223, 224, 0, 221, 220, 220, 220, 226, 224, + 0, 221, 221, 221, 222, 222, 222, 225, 223, 223, + 223, 227, 229, 0, 228, 0, 225, 225, 225, 224, + 224, 224, 230, 235, 0, 226, 226, 226, 0, 228, + 229, 0, 0, 231, 0, 0, 230, 232, 227, 227, + 227, 228, 228, 228, 235, 231, 0, 233, 0, 230, + 230, 230, 234, 0, 0, 236, 0, 229, 229, 229, + 231, 231, 231, 236, 232, 232, 232, 233, 234, 237, - 0, 233, 233, 233, 231, 231, 231, 236, 238, 232, - 232, 232, 234, 234, 234, 0, 237, 0, 0, 0, - 236, 237, 0, 239, 0, 0, 235, 235, 235, 238, - 241, 0, 0, 240, 241, 238, 238, 238, 0, 0, - 0, 0, 0, 237, 237, 237, 242, 236, 236, 236, - 239, 239, 239, 240, 253, 0, 244, 241, 241, 241, - 240, 240, 240, 243, 0, 242, 246, 0, 0, 243, - 245, 0, 0, 242, 242, 242, 244, 0, 245, 246, - 253, 0, 244, 247, 0, 0, 248, 0, 248, 264, - 243, 243, 243, 246, 246, 246, 261, 245, 245, 245, + 0, 235, 235, 235, 233, 233, 233, 238, 240, 234, + 234, 234, 236, 236, 236, 0, 239, 0, 0, 0, + 238, 239, 0, 241, 0, 0, 237, 237, 237, 240, + 243, 0, 0, 242, 243, 240, 240, 240, 0, 0, + 0, 0, 0, 239, 239, 239, 244, 238, 238, 238, + 241, 241, 241, 242, 255, 0, 246, 243, 243, 243, + 242, 242, 242, 245, 0, 244, 248, 0, 0, 245, + 247, 0, 0, 244, 244, 244, 246, 0, 247, 248, + 255, 0, 246, 249, 0, 0, 250, 0, 250, 266, + 245, 245, 245, 248, 248, 248, 263, 247, 247, 247, - 264, 247, 261, 244, 244, 244, 0, 253, 253, 253, - 247, 247, 247, 248, 248, 248, 254, 254, 254, 254, - 254, 262, 0, 261, 261, 261, 263, 264, 264, 264, - 262, 265, 254, 266, 0, 0, 263, 267, 0, 267, - 265, 0, 0, 268, 266, 268, 0, 269, 0, 269, - 254, 0, 270, 263, 263, 263, 270, 262, 262, 262, - 266, 266, 266, 0, 267, 267, 267, 265, 265, 265, - 268, 268, 268, 272, 0, 254, 269, 269, 269, 270, - 270, 270, 271, 0, 271, 272, 273, 0, 0, 274, - 0, 274, 0, 273, 0, 0, 0, 0, 275, 0, + 266, 249, 263, 246, 246, 246, 0, 255, 255, 255, + 249, 249, 249, 250, 250, 250, 256, 256, 256, 256, + 256, 264, 0, 263, 263, 263, 265, 266, 266, 266, + 264, 267, 256, 268, 0, 0, 265, 269, 0, 269, + 267, 0, 0, 270, 268, 270, 0, 271, 0, 271, + 256, 0, 272, 265, 265, 265, 272, 264, 264, 264, + 268, 268, 268, 0, 269, 269, 269, 267, 267, 267, + 270, 270, 270, 274, 0, 256, 271, 271, 271, 272, + 272, 272, 273, 0, 273, 274, 275, 0, 0, 276, + 0, 276, 0, 275, 0, 0, 0, 0, 277, 0, - 272, 272, 272, 277, 0, 279, 278, 0, 0, 271, - 271, 271, 278, 273, 273, 273, 274, 274, 274, 275, - 280, 0, 277, 279, 0, 275, 275, 275, 282, 285, - 277, 277, 277, 278, 278, 278, 281, 0, 0, 282, - 0, 0, 281, 288, 287, 0, 283, 280, 280, 280, - 279, 279, 279, 283, 284, 289, 285, 285, 285, 286, - 284, 0, 287, 281, 281, 281, 282, 282, 282, 290, - 288, 288, 288, 283, 283, 283, 289, 290, 0, 286, - 291, 284, 284, 284, 292, 0, 286, 286, 286, 287, - 287, 287, 302, 0, 292, 293, 290, 290, 290, 294, + 274, 274, 274, 279, 0, 281, 280, 0, 0, 273, + 273, 273, 280, 275, 275, 275, 276, 276, 276, 277, + 282, 0, 279, 281, 0, 277, 277, 277, 284, 287, + 279, 279, 279, 280, 280, 280, 283, 0, 0, 284, + 0, 0, 283, 290, 289, 0, 285, 282, 282, 282, + 281, 281, 281, 285, 286, 291, 287, 287, 287, 288, + 286, 0, 289, 283, 283, 283, 284, 284, 284, 292, + 290, 290, 290, 285, 285, 285, 291, 292, 0, 288, + 293, 286, 286, 286, 294, 0, 288, 288, 288, 289, + 289, 289, 304, 0, 294, 295, 292, 292, 292, 296, - 0, 301, 294, 289, 289, 289, 302, 291, 291, 291, - 301, 292, 292, 292, 303, 293, 0, 304, 0, 302, - 302, 302, 293, 293, 293, 305, 294, 294, 294, 305, - 306, 0, 307, 0, 303, 306, 0, 301, 301, 301, - 308, 303, 303, 303, 304, 304, 304, 309, 0, 309, - 0, 0, 307, 311, 308, 0, 305, 305, 305, 307, - 307, 307, 306, 306, 306, 312, 0, 308, 308, 308, - 310, 0, 0, 311, 309, 309, 309, 312, 313, 310, - 311, 311, 311, 314, 0, 0, 315, 0, 0, 0, - 313, 314, 312, 312, 312, 317, 0, 310, 310, 310, + 0, 303, 296, 291, 291, 291, 304, 293, 293, 293, + 303, 294, 294, 294, 305, 295, 0, 306, 0, 304, + 304, 304, 295, 295, 295, 307, 296, 296, 296, 307, + 308, 0, 309, 0, 305, 308, 0, 303, 303, 303, + 310, 305, 305, 305, 306, 306, 306, 311, 0, 311, + 0, 0, 309, 313, 310, 0, 307, 307, 307, 309, + 309, 309, 308, 308, 308, 314, 0, 310, 310, 310, + 312, 0, 0, 313, 311, 311, 311, 314, 315, 312, + 313, 313, 313, 316, 0, 0, 317, 0, 0, 0, + 315, 316, 314, 314, 314, 319, 0, 312, 312, 312, - 315, 319, 0, 0, 320, 313, 313, 313, 316, 0, - 314, 314, 314, 315, 315, 315, 0, 321, 316, 319, - 323, 0, 317, 317, 317, 326, 0, 0, 319, 319, - 319, 320, 320, 320, 324, 316, 316, 316, 321, 325, - 324, 0, 0, 327, 321, 321, 321, 323, 323, 323, - 330, 0, 326, 326, 326, 327, 0, 0, 331, 325, - 0, 324, 324, 324, 330, 331, 325, 325, 325, 332, - 327, 327, 327, 334, 0, 0, 333, 330, 330, 330, - 336, 0, 0, 334, 335, 331, 331, 331, 333, 0, - 335, 337, 332, 0, 336, 339, 332, 332, 332, 338, + 317, 321, 0, 0, 322, 315, 315, 315, 318, 0, + 316, 316, 316, 317, 317, 317, 0, 323, 318, 321, + 325, 0, 319, 319, 319, 328, 0, 0, 321, 321, + 321, 322, 322, 322, 326, 318, 318, 318, 323, 327, + 326, 0, 0, 329, 323, 323, 323, 325, 325, 325, + 332, 0, 328, 328, 328, 329, 0, 0, 333, 327, + 0, 326, 326, 326, 332, 333, 327, 327, 327, 334, + 329, 329, 329, 336, 0, 0, 335, 332, 332, 332, + 338, 0, 0, 336, 337, 333, 333, 333, 335, 0, + 337, 339, 334, 0, 338, 341, 334, 334, 334, 340, - 334, 334, 334, 337, 340, 338, 0, 336, 336, 336, - 340, 335, 335, 335, 0, 333, 333, 333, 337, 337, - 337, 343, 339, 339, 339, 342, 338, 338, 338, 341, - 342, 340, 340, 340, 346, 341, 343, 344, 0, 0, - 346, 345, 0, 0, 0, 347, 0, 0, 343, 343, - 343, 347, 342, 342, 342, 344, 341, 341, 341, 345, - 349, 346, 346, 346, 344, 344, 344, 349, 345, 345, - 345, 350, 347, 347, 347, 353, 0, 351, 350, 352, - 0, 0, 0, 353, 0, 0, 354, 349, 349, 349, - 351, 0, 354, 0, 0, 355, 0, 0, 350, 350, + 336, 336, 336, 339, 342, 340, 0, 338, 338, 338, + 342, 337, 337, 337, 0, 335, 335, 335, 339, 339, + 339, 345, 341, 341, 341, 344, 340, 340, 340, 343, + 344, 342, 342, 342, 348, 343, 345, 346, 0, 0, + 348, 347, 0, 0, 0, 349, 0, 0, 345, 345, + 345, 349, 344, 344, 344, 346, 343, 343, 343, 347, + 351, 348, 348, 348, 346, 346, 346, 351, 347, 347, + 347, 352, 349, 349, 349, 355, 0, 353, 352, 354, + 0, 0, 0, 355, 0, 0, 356, 351, 351, 351, + 353, 0, 356, 0, 0, 357, 0, 0, 352, 352, - 350, 0, 356, 352, 0, 357, 352, 352, 352, 0, - 353, 353, 353, 354, 354, 354, 355, 351, 351, 351, - 356, 358, 355, 355, 355, 0, 361, 0, 0, 356, - 356, 356, 357, 357, 357, 358, 359, 0, 0, 360, - 0, 0, 359, 363, 360, 361, 364, 0, 358, 358, - 358, 365, 0, 361, 361, 361, 366, 365, 0, 369, - 0, 0, 366, 359, 359, 359, 360, 360, 360, 367, - 363, 363, 363, 364, 364, 364, 368, 371, 365, 365, - 365, 369, 368, 366, 366, 366, 0, 370, 367, 375, - 0, 0, 372, 0, 0, 371, 367, 367, 367, 374, + 352, 0, 358, 354, 0, 359, 354, 354, 354, 0, + 355, 355, 355, 356, 356, 356, 357, 353, 353, 353, + 358, 360, 357, 357, 357, 0, 363, 0, 0, 358, + 358, 358, 359, 359, 359, 360, 361, 0, 0, 362, + 0, 0, 361, 365, 362, 363, 366, 0, 360, 360, + 360, 367, 0, 363, 363, 363, 368, 367, 0, 371, + 0, 0, 368, 361, 361, 361, 362, 362, 362, 369, + 365, 365, 365, 366, 366, 366, 370, 373, 367, 367, + 367, 371, 370, 368, 368, 368, 0, 372, 369, 377, + 0, 0, 374, 0, 0, 373, 369, 369, 369, 376, - 0, 0, 0, 368, 368, 368, 370, 373, 369, 369, - 369, 372, 375, 376, 370, 370, 370, 0, 374, 372, - 372, 372, 371, 371, 371, 0, 374, 374, 374, 373, - 0, 376, 0, 0, 373, 373, 373, 378, 0, 375, - 375, 375, 380, 378, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 380, 0, 0, 0, 376, 376, - 376, 0, 0, 0, 378, 378, 378, 0, 0, 380, - 380, 380, 382, 382, 382, 382, 382, 382, 382, 382, - 382, 382, 382, 382, 382, 382, 383, 383, 383, 383, + 0, 0, 0, 370, 370, 370, 372, 375, 371, 371, + 371, 374, 377, 378, 372, 372, 372, 0, 376, 374, + 374, 374, 373, 373, 373, 0, 376, 376, 376, 375, + 0, 378, 0, 0, 375, 375, 375, 380, 0, 377, + 377, 377, 382, 380, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 382, 0, 0, 0, 378, 378, + 378, 0, 0, 0, 380, 380, 380, 0, 0, 382, + 382, 382, 384, 384, 384, 384, 384, 384, 384, 384, + 384, 384, 384, 384, 384, 384, 385, 385, 385, 385, + 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + + 386, 386, 386, 386, 386, 386, 386, 386, 386, 386, + 386, 386, 386, 386, 387, 387, 387, 387, 387, 387, + 387, 387, 387, 387, 387, 387, 387, 387, 388, 0, + 388, 0, 388, 0, 388, 389, 0, 0, 389, 0, + 389, 389, 389, 389, 389, 390, 390, 0, 390, 390, + 390, 390, 390, 390, 391, 391, 391, 391, 391, 391, + 391, 391, 391, 391, 391, 391, 391, 391, 392, 392, + 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, + 392, 393, 0, 393, 393, 393, 393, 393, 393, 393, + 393, 393, 393, 393, 393, 394, 0, 394, 394, 394, + + 394, 394, 394, 394, 394, 394, 394, 394, 394, 395, + 395, 395, 395, 395, 395, 395, 395, 395, 396, 396, + 396, 397, 0, 0, 0, 0, 397, 397, 397, 398, + 398, 398, 398, 398, 399, 399, 399, 0, 0, 399, + 400, 400, 400, 401, 401, 401, 401, 401, 401, 401, + 401, 401, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, - 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, - 384, 384, 384, 384, 385, 385, 385, 385, 385, 385, - 385, 385, 385, 385, 385, 385, 385, 385, 386, 0, - 386, 0, 386, 0, 386, 387, 0, 0, 387, 0, - 387, 387, 387, 387, 387, 388, 388, 0, 388, 388, - 388, 388, 388, 388, 389, 389, 389, 389, 389, 389, - 389, 389, 389, 389, 389, 389, 389, 389, 390, 390, - 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - 390, 391, 0, 391, 391, 391, 391, 391, 391, 391, - 391, 391, 391, 391, 391, 392, 0, 392, 392, 392, - - 392, 392, 392, 392, 392, 392, 392, 392, 392, 393, - 393, 393, 393, 393, 393, 393, 393, 393, 394, 394, - 394, 395, 0, 0, 0, 0, 395, 395, 395, 396, - 396, 396, 396, 396, 397, 397, 397, 0, 0, 397, - 398, 398, 398, 399, 399, 399, 399, 399, 399, 399, - 399, 399, 381, 381, 381, 381, 381, 381, 381, 381, - 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, - 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, - 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, - 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, - - 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, - 381, 381, 381, 381, 381, 381, 381, 381, 381, 381 + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383 } ; static yy_state_type yy_last_accepting_state; @@ -1082,8 +1084,6 @@ int ncg_flex_debug = 0; #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *ncgtext; -#line 1 "ncgen.l" -#line 2 "ncgen.l" /********************************************************************* * Copyright 1993, UCAR/Unidata * See netcdf/COPYRIGHT file for copying and redistribution conditions. @@ -1158,13 +1158,17 @@ static unsigned int MAX_UINT = NC_MAX_UINT; #define NC_MAX_UINT MAX_UINT #endif -#define TAG "BbSsLl" +#define TAGCHARS "BbSsLlUu" #define tstdecimal(ch) ((ch) >= '0' && (ch) <= '9') /*Mnemonics*/ #define ISIDENT 1 +/* Define a fake constant indicating that + no tag was specified */ +#define NC_NOTAG (-1) + char errstr[100]; /* for short error messages */ int lineno; /* line number for error messages */ @@ -1191,9 +1195,10 @@ unsigned char ubyte_val; /* last byte value read */ static Symbol* makepath(char* text); static int lexdebug(int); static unsigned long long parseULL(char* text, int*); -static nc_type downconvert(unsigned long long uint64, int, int, int); -static int tagmatch(nc_type nct, int tag, int hasU); +static nc_type downconvert(unsigned long long uint64, int*, int, int); +static int tagmatch(nc_type nct, int tag); static int nct2lexeme(nc_type nct); +static int collecttag(char* text, char** stagp); static struct Specialtoken { char* name; @@ -1211,8 +1216,6 @@ static struct Specialtoken { {NULL,0} /* null terminate */ }; - - /* The most correct (validating) version of UTF8 character set (Taken from: http://www.w3.org/2005/03/23-lex-U) @@ -1254,7 +1257,6 @@ ID ([A-Za-z_]|{UTF8})([A-Z.@#\[\]a-z_0-9+-]|{UTF8})* /* Note: this definition of string will work for utf8 as well, although it is a very relaxed definition */ -#line 1258 "ncgenyy.c" #define INITIAL 0 #define ST_C_COMMENT 1 @@ -1438,10 +1440,6 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 208 "ncgen.l" - -#line 1444 "ncgenyy.c" - if ( !(yy_init) ) { (yy_init) = 1; @@ -1493,7 +1491,7 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 382 ) + if ( yy_current_state >= 384 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1525,14 +1523,12 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 209 "ncgen.l" { /* whitespace */ break; } YY_BREAK case 2: YY_RULE_SETUP -#line 213 "ncgen.l" { /* comment */ break; } @@ -1540,7 +1536,6 @@ YY_RULE_SETUP case 3: /* rule 3 can match eol */ YY_RULE_SETUP -#line 217 "ncgen.l" {int len; /* In netcdf4, this will be used in a variety of places, so only remove escapes */ @@ -1567,7 +1562,6 @@ ncgtext[MAXTRST-1] = '\0'; YY_BREAK case 4: YY_RULE_SETUP -#line 241 "ncgen.l" { /* drop leading 0x; pad to even number of chars */ char* p = ncgtext+2; int len = ncgleng - 2; @@ -1576,119 +1570,97 @@ YY_RULE_SETUP if((len % 2) == 1) bbAppend(lextext,'0'); bbNull(lextext); /* convert all chars to lower case */ - for(p=bbContents(lextext);*p;p++) *p = tolower(*p); + for(p=bbContents(lextext);(int)*p;p++) *p = tolower(*p); return lexdebug(OPAQUESTRING); } YY_BREAK case 5: YY_RULE_SETUP -#line 253 "ncgen.l" {return lexdebug(COMPOUND);} YY_BREAK case 6: YY_RULE_SETUP -#line 254 "ncgen.l" {return lexdebug(ENUM);} YY_BREAK case 7: YY_RULE_SETUP -#line 255 "ncgen.l" {return lexdebug(OPAQUE);} YY_BREAK case 8: YY_RULE_SETUP -#line 257 "ncgen.l" {return lexdebug(FLOAT_K);} YY_BREAK case 9: YY_RULE_SETUP -#line 258 "ncgen.l" {return lexdebug(CHAR_K);} YY_BREAK case 10: YY_RULE_SETUP -#line 259 "ncgen.l" {return lexdebug(BYTE_K);} YY_BREAK case 11: YY_RULE_SETUP -#line 260 "ncgen.l" {return lexdebug(UBYTE_K);} YY_BREAK case 12: YY_RULE_SETUP -#line 261 "ncgen.l" {return lexdebug(SHORT_K);} YY_BREAK case 13: YY_RULE_SETUP -#line 262 "ncgen.l" {return lexdebug(USHORT_K);} YY_BREAK case 14: YY_RULE_SETUP -#line 263 "ncgen.l" {return lexdebug(INT_K);} YY_BREAK case 15: YY_RULE_SETUP -#line 264 "ncgen.l" {return lexdebug(UINT_K);} YY_BREAK case 16: YY_RULE_SETUP -#line 265 "ncgen.l" {return lexdebug(INT64_K);} YY_BREAK case 17: YY_RULE_SETUP -#line 266 "ncgen.l" {return lexdebug(UINT64_K);} YY_BREAK case 18: YY_RULE_SETUP -#line 267 "ncgen.l" {return lexdebug(DOUBLE_K);} YY_BREAK case 19: YY_RULE_SETUP -#line 268 "ncgen.l" {int32_val = -1; return lexdebug(NC_UNLIMITED_K);} YY_BREAK case 20: YY_RULE_SETUP -#line 271 "ncgen.l" {return lexdebug(TYPES);} YY_BREAK case 21: YY_RULE_SETUP -#line 272 "ncgen.l" {return lexdebug(DIMENSIONS);} YY_BREAK case 22: YY_RULE_SETUP -#line 273 "ncgen.l" {return lexdebug(VARIABLES);} YY_BREAK case 23: YY_RULE_SETUP -#line 274 "ncgen.l" {return lexdebug(DATA);} YY_BREAK case 24: YY_RULE_SETUP -#line 275 "ncgen.l" {return lexdebug(GROUP);} YY_BREAK case 25: YY_RULE_SETUP -#line 277 "ncgen.l" {BEGIN(TEXT);return lexdebug(NETCDF);} YY_BREAK case 26: YY_RULE_SETUP -#line 279 "ncgen.l" { /* missing value (pre-2.4 backward compatibility) */ if (ncgtext[0] == '-') { double_val = NEGNC_INFINITE; @@ -1701,7 +1673,6 @@ YY_RULE_SETUP YY_BREAK case 27: YY_RULE_SETUP -#line 288 "ncgen.l" { /* missing value (pre-2.4 backward compatibility) */ double_val = NAN; specialconstants = 1; @@ -1710,7 +1681,6 @@ YY_RULE_SETUP YY_BREAK case 28: YY_RULE_SETUP -#line 294 "ncgen.l" {/* missing value (pre-2.4 backward compatibility)*/ if (ncgtext[0] == '-') { float_val = NEGNC_INFINITEF; @@ -1723,7 +1693,6 @@ YY_RULE_SETUP YY_BREAK case 29: YY_RULE_SETUP -#line 303 "ncgen.l" { /* missing value (pre-2.4 backward compatibility) */ float_val = NANF; specialconstants = 1; @@ -1732,7 +1701,6 @@ YY_RULE_SETUP YY_BREAK case 30: YY_RULE_SETUP -#line 309 "ncgen.l" { #ifdef USE_NETCDF4 if(l_flag == L_C || l_flag == L_BINARY) @@ -1745,7 +1713,6 @@ YY_RULE_SETUP YY_BREAK case 31: YY_RULE_SETUP -#line 319 "ncgen.l" { bbClear(lextext); bbAppendn(lextext,(char*)ncgtext,ncgleng+1); /* include null */ @@ -1756,7 +1723,6 @@ YY_RULE_SETUP YY_BREAK case 32: YY_RULE_SETUP -#line 328 "ncgen.l" {struct Specialtoken* st; bbClear(lextext); bbAppendn(lextext,(char*)ncgtext,ncgleng+1); /* include null */ @@ -1770,7 +1736,6 @@ YY_RULE_SETUP case 33: /* rule 33 can match eol */ YY_RULE_SETUP -#line 338 "ncgen.l" { int c; char* p; char* q; @@ -1789,7 +1754,6 @@ YY_RULE_SETUP YY_BREAK case 34: YY_RULE_SETUP -#line 354 "ncgen.l" { char* id; int len; bbClear(lextext); bbAppendn(lextext,(char*)ncgtext,ncgleng+1); /* include null */ @@ -1804,35 +1768,38 @@ YY_RULE_SETUP YY_BREAK case 35: YY_RULE_SETUP -#line 366 "ncgen.l" { -/* -We need to try to see what size of integer ((u)int). -Technically, the user should specify, but... -If out of any integer range, then complain -*/ + /* + We need to try to see what size of integer ((u)int). + Technically, the user should specify, but... + If out of any integer range, then complain + */ int slen = strlen(ncgtext); - int tag = ncgtext[slen-1]; - int hasU = 0; + char* stag = NULL; + int tag = NC_NAT; int signchar = 0; int isneg = 0; int c = ncgtext[0]; int fail = 0; nc_type nct = 0; char* pos = NULL; + int hasU = 0; + /* capture the tag string */ + tag = collecttag(ncgtext,&stag); + if(tag == NC_NAT) { + sprintf(errstr,"Illegal integer suffix: %s",stag); + yyerror(errstr); + goto done; + } + /* drop the tag from the input text */ + ncgtext[slen - strlen(stag)] = '\0'; + hasU = isuinttype(tag); if(!tstdecimal(c)) { pos = ncgtext+1; isneg = (c == '-'); } else pos = ncgtext; - if(tag != '\0' && strchr(TAG,tag) != NULL) { - if(slen > 2) { - c = ncgtext[slen-2]; - hasU = (c == 'U' || c == 'u') ? 1 : 0; - } - } else - tag = 0; if(isneg && hasU) { sprintf(errstr,"Unsigned integer cannot be signed: %s",ncgtext); yyerror(errstr); @@ -1845,7 +1812,7 @@ If out of any integer range, then complain goto done; } /* Down convert to smallest possible range */ - nct = downconvert(uint64_val,isneg,tag,hasU); + nct = downconvert(uint64_val,&tag,isneg,hasU); switch (k_flag) { case NC_FORMAT_64BIT_DATA: case NC_FORMAT_NETCDF4: @@ -1859,10 +1826,9 @@ If out of any integer range, then complain goto done; } } - if(!tagmatch(nct,tag,hasU)) { - sprintf(errstr,"Integer out of range for tag: %s",ncgtext); - yyerror(errstr); - goto done; + + if(!tagmatch(nct,tag)) { + semwarn(lineno,"Warning: Integer out of range for tag: %s; tag treated as changed.",ncgtext); } return lexdebug(nct2lexeme(nct)); done: return 0; @@ -1870,15 +1836,24 @@ done: return 0; YY_BREAK case 36: YY_RULE_SETUP -#line 429 "ncgen.l" { int c; int token = 0; int slen = strlen(ncgtext); - int tag = ncgtext[slen-1]; + char* stag = NULL; + int tag = NC_NAT; char* hex = ncgtext+2; /* point to first true hex digit */ int xlen = (slen - 3); /* true hex length */ + ncgtext[slen-1] = '\0'; + /* capture the tag string */ + tag = collecttag(ncgtext,&stag); + if(tag == NC_NAT) { + sprintf(errstr,"Illegal integer suffix: %s",stag); + yyerror(errstr); + goto done; + } + ncgtext[slen - strlen(stag)] = '\0'; if(xlen > 16) { /* truncate hi order digits */ hex += (xlen - 16); } @@ -1889,11 +1864,14 @@ YY_RULE_SETUP uint64_val = ((uint64_val << 4) | hexdigit); } switch (tag) { - case 'S': case 's': + case NC_USHORT: uint16_val = (unsigned short)uint64_val; token = USHORT_CONST; break; - case 'L': case 'l': + case NC_UINT: + token = UINT_CONST; + break; + case NC_UINT64: token = UINT64_CONST; break; default: /* should never happen */ @@ -1908,7 +1886,6 @@ YY_RULE_SETUP YY_BREAK case 37: YY_RULE_SETUP -#line 463 "ncgen.l" { if (sscanf((char*)ncgtext, "%le", &double_val) != 1) { sprintf(errstr,"bad long or double constant: %s",(char*)ncgtext); @@ -1919,7 +1896,6 @@ YY_RULE_SETUP YY_BREAK case 38: YY_RULE_SETUP -#line 470 "ncgen.l" { if (sscanf((char*)ncgtext, "%e", &float_val) != 1) { sprintf(errstr,"bad float constant: %s",(char*)ncgtext); @@ -1931,7 +1907,6 @@ YY_RULE_SETUP case 39: /* rule 39 can match eol */ YY_RULE_SETUP -#line 477 "ncgen.l" { (void) sscanf((char*)&ncgtext[1],"%c",&byte_val); return lexdebug(BYTE_CONST); @@ -1939,7 +1914,6 @@ YY_RULE_SETUP YY_BREAK case 40: YY_RULE_SETUP -#line 481 "ncgen.l" { int oct = unescapeoct(&ncgtext[2]); if(oct < 0) { @@ -1952,7 +1926,6 @@ YY_RULE_SETUP YY_BREAK case 41: YY_RULE_SETUP -#line 490 "ncgen.l" { int hex = unescapehex(&ncgtext[3]); if(byte_val < 0) { @@ -1965,7 +1938,6 @@ YY_RULE_SETUP YY_BREAK case 42: YY_RULE_SETUP -#line 499 "ncgen.l" { switch ((char)ncgtext[2]) { case 'a': byte_val = '\007'; break; /* not everyone under- @@ -1987,7 +1959,6 @@ YY_RULE_SETUP case 43: /* rule 43 can match eol */ YY_RULE_SETUP -#line 517 "ncgen.l" { lineno++ ; break; @@ -1995,7 +1966,6 @@ YY_RULE_SETUP YY_BREAK case 44: YY_RULE_SETUP -#line 522 "ncgen.l" {/*initial*/ BEGIN(ST_C_COMMENT); break; @@ -2004,21 +1974,18 @@ YY_RULE_SETUP case 45: /* rule 45 can match eol */ YY_RULE_SETUP -#line 527 "ncgen.l" {/* continuation */ break; } YY_BREAK case 46: YY_RULE_SETUP -#line 531 "ncgen.l" {/* final */ BEGIN(INITIAL); break; } YY_BREAK case YY_STATE_EOF(ST_C_COMMENT): -#line 536 "ncgen.l" {/* final, error */ fprintf(stderr,"unterminated /**/ comment"); BEGIN(INITIAL); @@ -2027,17 +1994,14 @@ case YY_STATE_EOF(ST_C_COMMENT): YY_BREAK case 47: YY_RULE_SETUP -#line 542 "ncgen.l" {/* Note: this next rule will not work for UTF8 characters */ return lexdebug(ncgtext[0]) ; } YY_BREAK case 48: YY_RULE_SETUP -#line 545 "ncgen.l" ECHO; YY_BREAK -#line 2041 "ncgenyy.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(TEXT): yyterminate(); @@ -2330,7 +2294,7 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 382 ) + if ( yy_current_state >= 384 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2358,11 +2322,11 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 382 ) + if ( yy_current_state >= 384 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 381); + yy_is_jam = (yy_current_state == 383); return yy_is_jam ? 0 : yy_current_state; } @@ -3036,9 +3000,6 @@ void ncgfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 545 "ncgen.l" - - static int lexdebug(int token) { @@ -3120,7 +3081,7 @@ makepath(char* text0) } /* -Parse a simple string of digitis into an unsigned long long +Parse a simple string of digits into an unsigned long long Return the value. */ static unsigned long long @@ -3146,126 +3107,117 @@ parseULL(char* text, int* failp) return uint64; } - /** Given the raw bits, the sign char, the tag, and hasU fill in the appropriate *_val field -and return the type +and return the type. +Note that we cannot return unsigned types if running pure netcdf classic. +The rule is to pick the smallest enclosing type. + +The rule used here is that the tag (the suffix, if any) +always takes precedence and the value is modified to conform +if possible, otherwise out-of-range is signalled. +For historical reasons (ncgen3), values that fit as unsigned +are acceptable for the signed tag and conversion is attempted; +e.g. 65535s; is legal and is return as a negative short. */ static nc_type -downconvert(unsigned long long uint64, int isneg, int tag, int hasU) +downconvert(unsigned long long uint64, int* tagp, int isneg, int hasU) { nc_type nct = NC_NAT; - int bit64 = (uint64 >> 63); - int allones = (uint64 == 0xffffffffffffffffUL); + int tag = *tagp; + int bit63set = (uint64 >> 63); long long int64 = *((long long*)&uint64); - if(isneg && hasU) - return NC_NAT; - /* Special cases: all (u)int64 values */ - if(allones && (hasU || !isneg)) /* bare max uint64 value */ - return NC_UINT64; - if((int64 < NC_MIN_INT) || (int64 > NC_MAX_INT)) { - if(isneg && !hasU) { - int64_val = - int64; - return NC_INT64; - } - if(!isneg && hasU) { - uint64_val = uint64; - return NC_UINT64; - } - /* Bare big integer, assume int64 unless sign bit set */ - if(!isneg && !hasU && bit64) { - uint64_val = uint64; - return NC_UINT64; - } else if(!bit64) { - int64_val = int64; - return NC_INT64; - } - /*assert(!isneg)*/ + if(isneg && hasU) { + return (*tagp = NC_NAT); + } + /* To simplify the code, we look for special case of NC_UINT64 + constants that will not fit into an NC_INT64 constant. + */ + if(tag == NC_UINT64 && bit63set) { uint64_val = uint64; - return NC_UINT64; + return tag; } + /* At this point we need deal only with int64 value */ + /* Apply the isneg */ + if(isneg) + int64 = - int64; - if(isneg) int64 = -int64; - - /* special case: - If there is no tag and the size is ok, - then always return NC_INT or NC_UINT. - */ - if(!tag) { - if(!hasU) { - if((int64 >= NC_MIN_INT) && (int64 <= NC_MAX_INT)) { - int32_val = (int)int64; - return NC_INT; - } - } - if(uint64 <= NC_MAX_UINT) { - uint32_val = (unsigned int)uint64; - return NC_INT; + if(tag == NC_NOTAG) { + /* If we have no other info, then assume NC_(U)INT(64) */ + if(int64 >= NC_MIN_INT && int64 <= NC_MAX_INT) { + nct = (tag = NC_INT); + int32_val = (signed int)int64; + } else if(int64 >= 0 && int64 <= NC_MAX_UINT) { + nct = (tag = NC_UINT); + uint32_val = (unsigned int)int64; + } else if(int64 < 0) { + nct = (tag = NC_INT64); + int64_val = (signed long long)int64; + } else { + nct = (tag = NC_UINT64); + uint64_val = (unsigned long long)int64; } + goto done; } - /* assert (tag != 0) */ - - /* Pick smallest enclosing type; - for historical reasons (ncgen3), technically out of range - values are allowed and conversion is attempted; - e.g. 65535s; is legal and is return as an unsigned short. - */ - if(hasU) { - switch (tag) { - case 'B': case 'b': - if((int64 >= 0) && (int64 <= NC_MAX_UBYTE)) { + if(isuinttype(tag) && int64 < 0) + goto outofrange; + switch (tag) { + case NC_UBYTE: + if(int64 <= NC_MAX_UBYTE) { nct = NC_UBYTE; ubyte_val = (unsigned char)int64; - }; break; - case 'S': case 's': - if((int64 >= 0) && (int64 <= NC_MAX_USHORT)) { + } else + goto outofrange; + break; + case NC_USHORT: + if(int64 <= NC_MAX_USHORT) { nct = NC_USHORT; uint16_val = (unsigned short)int64; - } break; - case 'L': case 'l': - if((int64 >= 0) && (int64 <= NC_MAX_UINT64)) { + } else + goto outofrange; + break; + case NC_UINT: + if(int64 <= NC_MAX_UINT) { + nct = NC_UINT; + uint32_val = (unsigned int)int64; + } else + goto outofrange; + break; + case NC_UINT64: + if(int64 <= NC_MAX_UINT64) { nct = NC_UINT64; uint64_val = uint64; - } break; - default: - return NC_NAT; - } - } else { /* !hasU */ - switch (tag) { - case 'B': case 'b': - if((int64 >= NC_MIN_BYTE) && (int64 <= NC_MAX_BYTE)) { - nct = NC_BYTE; - byte_val = (signed char)int64; - } else {/* force to unsigned value */ - uint64_val = uint64 & 0xff; - nct = NC_UBYTE; - } + } else + goto outofrange; break; - case 'S': case 's': - if((int64 >= NC_MIN_SHORT) && (int64 <= NC_MAX_SHORT)) { - nct = NC_SHORT; - int16_val = (signed short)int64; - } else {/* force to unsigned value */ - uint64_val = uint64 & 0xffff; - nct = NC_USHORT; - } + case NC_INT64: + nct = NC_INT64; + int64_val = int64; break; - case 'L': case 'l': - if((uint64 <= NC_MAX_INT64)) { - nct = NC_INT64; - int64_val = int64; - } else {/* force to unsigned value */ - uint64_val = uint64; - nct = NC_UINT64; - } + case NC_BYTE: + nct = NC_BYTE; + byte_val = (signed char)int64; break; - default: - return NC_NAT; - } + case NC_SHORT: + nct = NC_SHORT; + int16_val = (signed short)int64; + break; + case NC_INT: + nct = NC_INT; + int32_val = (signed int)int64; + break; + default: + goto outofrange; } + +done: + *tagp = tag; return nct; +outofrange: + yyerror("Value out of range"); + return NC_NAT; } static int @@ -3285,24 +3237,63 @@ nct2lexeme(nc_type nct) return 0; } - static int -tagmatch(nc_type nct, int tag, int hasU) +tagmatch(nc_type nct, int tag) { - if(hasU) switch(nct) { - case NC_UBYTE: return (tag == 0 || tag == 'B' || tag == 'b'); - case NC_USHORT: return (tag == 0 || tag == 'S' || tag == 's'); - case NC_UINT: return (tag == 0); - case NC_UINT64: return (tag == 0 || tag == 'L' || tag == 'l'); - default: return 0; - } else switch(nct) { - case NC_BYTE: return (tag == 0 || tag == 'B' || tag == 'b'); - case NC_SHORT: return (tag == 0 || tag == 'S' || tag == 's'); - case NC_INT: return (tag == 0); - case NC_INT64: return (tag == 0 || tag == 'L' || tag == 'l'); - default: return 0; - } - return 0; + if(tag == NC_NAT || tag == NC_NOTAG) + return 1; + return nct == tag; } +/* capture the tag string */ +static int +collecttag(char* text, char** stagp) +{ + char* stag0; +#define MAXTAGLEN 3 + char stag[MAXTAGLEN+1]; + int slen = strlen(text); + int staglen; + int tag = NC_NAT; + int hasU = 0; + + for(stag0 = text+(slen-1);stag0 > 0;stag0--) { + if(strchr(TAGCHARS,*stag0) == NULL) {stag0++; break;} + } + if(stagp) *stagp = stag0; + staglen = strlen(stag0); + if(staglen == 0) + return NC_NOTAG; + if(staglen > MAXTAGLEN) + return tag; + strncpy(stag,stag0,sizeof(stag)); + stag[MAXTAGLEN] = '\0'; + if(stag[0] == 'U' || stag[0] == 'u') { + hasU = 1; + strncpy(stag,stag+1,MAXTAGLEN+1); + staglen--; + } else if(stag[staglen-1] == 'U' || stag[staglen-1] == 'u') { + hasU = 1; + staglen--; + stag[staglen] = '\0'; + } + if(strlen(stag) == 0 && hasU) { + tag = NC_UINT64; + } else if(strlen(stag) == 1) { + switch (stag[0]) { + case 'B': case 'b': tag = (hasU ? NC_UBYTE : NC_BYTE); break; + case 'S': case 's': tag = (hasU ? NC_USHORT : NC_SHORT); break; + case 'L': case 'l': tag = (hasU ? NC_UINT : NC_INT); break; + default: break; + } + } else if(strcasecmp(stag,"ll") == 0) { + tag = (hasU ? NC_UINT64 : NC_INT64); + } + if(tag == NC_NAT) { + if(strlen(stag) > 0) + return tag; + tag = NC_NAT; + } + return tag; +} diff --git a/ncgen/ncgentab.c b/ncgen/ncgeny.c similarity index 99% rename from ncgen/ncgentab.c rename to ncgen/ncgeny.c index 96915ddcc..535e0442c 100644 --- a/ncgen/ncgentab.c +++ b/ncgen/ncgeny.c @@ -194,7 +194,7 @@ extern int lex_init(void); /* Line 268 of yacc.c */ -#line 198 "ncgentab.c" +#line 198 "ncgeny.c" /* Enabling traces. */ #ifndef YYDEBUG @@ -291,7 +291,7 @@ NCConstant constant; /* Line 293 of yacc.c */ -#line 295 "ncgentab.c" +#line 295 "ncgeny.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -303,7 +303,7 @@ NCConstant constant; /* Line 343 of yacc.c */ -#line 307 "ncgentab.c" +#line 307 "ncgeny.c" #ifdef short # undef short @@ -2971,7 +2971,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); /* Line 1806 of yacc.c */ -#line 2975 "ncgentab.c" +#line 2975 "ncgeny.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -3231,7 +3231,7 @@ ncgwrap(void) /* returns 1 on EOF if no more input */ } /* get lexical input routine generated by lex */ -#include "ncgenyy.c" +#include "ncgenl.c" /* Really should init our data within this file */ void diff --git a/ncgen/ncgentab.h b/ncgen/ncgeny.h similarity index 99% rename from ncgen/ncgentab.h rename to ncgen/ncgeny.h index 09bc5fa3e..c3d83a86c 100644 --- a/ncgen/ncgentab.h +++ b/ncgen/ncgeny.h @@ -107,7 +107,7 @@ NCConstant constant; /* Line 2068 of yacc.c */ -#line 111 "ncgentab.h" +#line 111 "ncgeny.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff --git a/ncgen/run_nc4_tests.sh b/ncgen/run_nc4_tests.sh index 72de82b23..794c15ad9 100755 --- a/ncgen/run_nc4_tests.sh +++ b/ncgen/run_nc4_tests.sh @@ -2,12 +2,17 @@ # This shell script runs the ncdump tests. # $Id: run_nc4_tests.sh,v 1.4 2010/05/18 20:05:23 dmh Exp $ +if test "x$srcdir" = x ; then srcdir="."; fi + echo "*** Testing ncgen for netCDF-4." set -e + echo "*** creating netCDF-4 file c0_4.nc from c0_4.cdl..." ./ncgen -k nc4 -b -o c0_4.nc $srcdir/c0_4.cdl + echo "*** creating netCDF-4 classic model file c0_4c.nc from c0.cdl..." ./ncgen -k nc7 -b -o c0_4c.nc $srcdir/c0.cdl + echo "*** creating C code for CAM file ref_camrun.cdl..." ./ncgen -lc $srcdir/ref_camrun.cdl >ref_camrun.c diff --git a/ncgen/run_tests.sh b/ncgen/run_tests.sh index fc1bdc8e5..648e3305d 100755 --- a/ncgen/run_tests.sh +++ b/ncgen/run_tests.sh @@ -8,6 +8,7 @@ fi echo "*** Testing ncgen." set -e + echo "*** creating classic file c0.nc from c0.cdl..." ./ncgen -b -o c0.nc $srcdir/c0.cdl if [ ! -f c0.nc ]; then diff --git a/ncgen/semantics.c b/ncgen/semantics.c index 5a941f975..f0357ad49 100644 --- a/ncgen/semantics.c +++ b/ncgen/semantics.c @@ -774,29 +774,111 @@ processattributes(void) } /* - Look at the first primitive value of the - attribute's datalist to infer the type of the attribute. - There is a potential ambiguity when that value is a string. - Is the attribute type NC_CHAR or NC_STRING? - The answer is we always assume it is NC_CHAR in order to - be back compatible with ncgen. +Given two types, attempt to upgrade to the "bigger type" +Rules: +- type size has precedence over signed/unsigned: + e.g. NC_INT over NC_UBYTE */ +static nc_type +infertype(nc_type prior, nc_type next, int hasneg) +{ + nc_type sp, sn; + /* assert isinttype(prior) && isinttype(next) */ + if(prior == NC_NAT) return next; + if(prior == next) return next; + sp = signedtype(prior); + sn = signedtype(next); + if(sp <= sn) + return next; + if(sn < sp) + return prior; + return NC_NAT; /* all other cases illegal */ +} +/* +Collect info by repeated walking of the attribute value list. +*/ static nc_type inferattributetype1(Datasrc* src) { nc_type result = NC_NAT; - /* Recurse down any enclosing compound markers to find first non-fill "primitive"*/ - while(result == NC_NAT && srcmore(src)) { - if(issublist(src)) { - srcpush(src); - result = inferattributetype1(src); - srcpop(src); - } else { - NCConstant* con = srcnext(src); - if(isprimplus(con->nctype)) result = con->nctype; - /* else keep looking*/ + int hasneg = 0; + int stringcount = 0; + int charcount = 0; + int forcefloat = 0; + int forcedouble = 0; + int forceuint64 = 0; + + /* Walk the top level set of attribute values to ensure non-nesting */ + while(srcmore(src)) { + NCConstant* con = srcnext(src); + if(con == NULL) return NC_NAT; + if(con->nctype > NC_MAX_ATOMIC_TYPE) { /* illegal */ + return NC_NAT; } + srcnext(src); + } + /* Walk repeatedly to get info for inference (loops could be combined) */ + + /* Compute: all strings or chars? */ + srcreset(src); + stringcount = 0; + charcount = 0; + while(srcmore(src)) { + NCConstant* con = srcnext(src); + if(con->nctype == NC_STRING) stringcount++; + else if(con->nctype == NC_CHAR) charcount++; + } + if((stringcount+charcount) > 0) { + if((stringcount+charcount) < srclen(src)) + return NC_NAT; /* not all textual */ + return NC_CHAR; + } + + /* Compute: any floats/doubles? */ + srcreset(src); + forcefloat = 0; + forcedouble = 0; + while(srcmore(src)) { + NCConstant* con = srcnext(src); + if(con->nctype == NC_FLOAT) forcefloat = 1; + else if(con->nctype == NC_DOUBLE) {forcedouble=1; break;} + } + if(forcedouble) return NC_DOUBLE; + if(forcefloat) return NC_FLOAT; + + /* At this point all the constants should be integers */ + + /* Compute: are there any uint64 values > NC_MAX_INT64? */ + srcreset(src); + forceuint64 = 0; + while(srcmore(src)) { + NCConstant* con = srcnext(src); + if(con->nctype != NC_UINT64) continue; + if(con->value.uint64v > NC_MAX_INT64) {forceuint64=1; break;} + } + if(forceuint64) + return NC_UINT64; + + /* Compute: are there any negative constants? */ + srcreset(src); + hasneg = 0; + while(srcmore(src)) { + NCConstant* con = srcnext(src); + switch (con->nctype) { + case NC_BYTE : if(con->value.int8v < 0) {hasneg = 1;} break; + case NC_SHORT: if(con->value.int16v < 0) {hasneg = 1;} break; + case NC_INT: if(con->value.int32v < 0) {hasneg = 1;} break; + } + } + + /* Compute: inferred integer type */ + srcreset(src); + result = NC_NAT; + while(srcmore(src)) { + NCConstant* con = srcnext(src); + result = infertype(result,con->nctype,hasneg); + if(result == NC_NAT) break; /* something wrong */ } return result; } @@ -817,6 +899,10 @@ inferattributetype(Symbol* asym) src = datalist2src(datalist); nctype = inferattributetype1(src); freedatasrc(src); + if(nctype == NC_NAT) { /* Illegal attribute value list */ + semerror(asym->lineno,"Non-simple list of values for untyped attribute: %s",fullname(asym)); + return; + } /* get the corresponding primitive type built-in symbol*/ /* special case for string*/ if(nctype == NC_STRING) diff --git a/ncgen/util.c b/ncgen/util.c index 56a254397..2f07b5035 100644 --- a/ncgen/util.c +++ b/ncgen/util.c @@ -254,6 +254,65 @@ isbounded(Dimset* dimset) return 1; } +int +signedtype(nc_type nctype) +{ + switch (nctype) { + case NC_BYTE: + case NC_SHORT: + case NC_INT: + case NC_INT64: + return nctype; + case NC_UBYTE: return NC_BYTE; + case NC_USHORT: return NC_SHORT; + case NC_UINT: return NC_INT; + case NC_UINT64: return NC_INT64; + default: break; + } + return nctype; +} + +int +unsignedtype(nc_type nctype) +{ + switch (nctype) { + case NC_UBYTE: + case NC_USHORT: + case NC_UINT: + case NC_UINT64: + return nctype; + case NC_BYTE: return NC_UBYTE; + case NC_SHORT: return NC_USHORT; + case NC_INT: return NC_UINT; + case NC_INT64: return NC_UINT64; + default: break; + } + return nctype; +} + +int +isinttype(nc_type nctype) +{ + return (nctype != NC_CHAR) + && ((nctype >= NC_BYTE && nctype <= NC_INT) + || (nctype >= NC_UBYTE && nctype <= NC_UINT64)); +} + +int +isuinttype(nc_type t) +{ + return isinttype(t) + && t >= NC_UBYTE + && t <= NC_UINT64 + && t != NC_INT64; +} + +int +isfloattype(nc_type nctype) +{ + return (nctype == NC_FLOAT || nctype <= NC_DOUBLE); +} + int isclassicprim(nc_type nctype) { diff --git a/ncgen/util.h b/ncgen/util.h index 7b5f9fa62..8aa9dfdf4 100644 --- a/ncgen/util.h +++ b/ncgen/util.h @@ -8,7 +8,6 @@ #define MAX(x,y) ((x)>(y)?(x):(y)) - extern void expe2d(char*); extern int pow2(int); extern void tztrim(char*); @@ -27,7 +26,13 @@ extern char* nctypename(nc_type); extern char* ncclassname(nc_class); extern int ncsize(nc_type); +extern nc_type signedtype(nc_type nctype); +extern nc_type unsignedtype(nc_type nctype); + /* We have several versions of primitive testing*/ +extern int isinttype(nc_type nctype); /* some kind of integer*/ +extern int isuinttype(nc_type nctype); /* some kind of integer*/ +extern int isfloattype(nc_type nctype); /* some kind of float*/ extern int isclassicprim(nc_type); /* a classic primitive type*/ extern int isclassicprimplus(nc_type); /* classic + String*/ extern int isprim(nc_type); /* a netcdf4 primitive type*/ From 4e24acc377135c217cd41c7a7587ca68660c53c5 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 12:32:30 -0700 Subject: [PATCH 07/39] Reconfigured travis to run a test via docker. --- .travis.yml | 52 +++++----------------------------------------------- 1 file changed, 5 insertions(+), 47 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5c0001b16..1d33b7c88 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,52 +1,10 @@ -sudo: false +sudo: required language: c -compiler: - - gcc - - clang - -addons: - apt: - packages: - - libcurl4-openssl-dev - - m4 - - wget - - autoconf - - libtool - - gfortran - - git - - doxygen - - graphviz +services: + - docker before_install: - -before_script: - - ### - # Install dependencies from a pre-built binary. - ### - - cd $HOME - - wget http://www.unidata.ucar.edu/downloads/netcdf/ftp/travisdeps.tar.bz2 - - - tar -jxf travisdeps.tar.bz2 - - export LD_LIBRARY_PATH=$HOME/usr/lib - - export PATH=$HOME/usr/bin:$PATH - - cd - - - - mkdir build-all - - mkdir build-min - - - cd build-min - - cmake .. -DENABLE_NETCDF_4=OFF -DENABLE_DAP=OFF -DCMAKE_PREFIX_PATH=$HOME/usr-min - - cd .. - - - cd build-all - - cmake .. -DENABLE_MMAP=ON -DENABLE_DOXYGEN=ON -DENABLE_EXTRA_TESTS=ON -DENABLE_HDF4=ON -DCMAKE_PREFIX_PATH=$HOME/usr - - cd .. + - docker pull unidata/nctests:serial script: - - cd build-min - - make -j 4 - - make test - - cd ../build-all - - make -j 4 - - make test \ No newline at end of file + - docker run -e USEDASH=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNNCO=OFF -v $(pwd):/netcdf-c unidata/nctests:serial \ No newline at end of file From 995bc29b2a98d1643e8f5a89569315e1d1edc247 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 12:38:06 -0700 Subject: [PATCH 08/39] Turned off Python test, turned on autoconf build/test as well. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1d33b7c88..7a87ab4e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,4 +7,4 @@ before_install: - docker pull unidata/nctests:serial script: - - docker run -e USEDASH=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNNCO=OFF -v $(pwd):/netcdf-c unidata/nctests:serial \ No newline at end of file + - docker run -e USEDASH=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USEAC=ON -v $(pwd):/netcdf-c unidata/nctests:serial \ No newline at end of file From fc1528acf1d624585c340d8a4f746aca51371002 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 12:43:47 -0700 Subject: [PATCH 09/39] Quick test for introducing a basic test matrix. --- .travis.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7a87ab4e0..c1e49dc6a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,13 @@ language: c services: - docker +env + - NCTESTIMG=unidata/nctests:serial + - NCTESTIMG=unidata/nctests:serial32 + + before_install: - - docker pull unidata/nctests:serial + - docker pull $NCTESTIMG script: - - docker run -e USEDASH=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USEAC=ON -v $(pwd):/netcdf-c unidata/nctests:serial \ No newline at end of file + - docker run -e USEDASH=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USEAC=OFF -v $(pwd):/netcdf-c $NCTESTIMG \ No newline at end of file From 513285026473ff6dacbd6f3619af85711dbd13fe Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 12:45:37 -0700 Subject: [PATCH 10/39] Working out some syntax for travis-ci test matrix. --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c1e49dc6a..0d354e0bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,5 +11,4 @@ env before_install: - docker pull $NCTESTIMG -script: - - docker run -e USEDASH=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USEAC=OFF -v $(pwd):/netcdf-c $NCTESTIMG \ No newline at end of file +script: "docker run -e USEDASH=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USEAC=OFF -v $(pwd):/netcdf-c $NCTESTIMG" \ No newline at end of file From 0bfa0ad7673e2f09c2c7e85d9641d16534e17394 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 12:46:12 -0700 Subject: [PATCH 11/39] Working out some syntax for travis-ci test matrix. --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0d354e0bf..948de3c82 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ env before_install: - - docker pull $NCTESTIMG + - docker pull unidata/nctests:serial + - docker pull unidata/nctests:serial32 script: "docker run -e USEDASH=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USEAC=OFF -v $(pwd):/netcdf-c $NCTESTIMG" \ No newline at end of file From cc20ba00b775d2d6360e9c611f370500dbc70258 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 12:51:26 -0700 Subject: [PATCH 12/39] Working out some syntax for travis-ci test matrix. --- .travis.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 948de3c82..9c61103ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,11 +5,9 @@ services: env - NCTESTIMG=unidata/nctests:serial - - NCTESTIMG=unidata/nctests:serial32 - before_install: - docker pull unidata/nctests:serial - - docker pull unidata/nctests:serial32 -script: "docker run -e USEDASH=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USEAC=OFF -v $(pwd):/netcdf-c $NCTESTIMG" \ No newline at end of file +script: + - docker run -e USEDASH=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USEAC=OFF -v $(pwd):/netcdf-c $NCTESTIMG \ No newline at end of file From e6c5b5c5679146bc148823c21de3ffca0ed56b54 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 12:53:14 -0700 Subject: [PATCH 13/39] Working out some syntax for travis-ci test matrix. --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9c61103ce..3b3b95885 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,8 @@ services: - docker env - - NCTESTIMG=unidata/nctests:serial + matrix: + - NCTESTIMG=unidata/nctests:serial before_install: - docker pull unidata/nctests:serial From 7c95c62733c9f7b99d26d8a0552c8562a3c3f897 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 12:59:28 -0700 Subject: [PATCH 14/39] Offloading some stuff to a test script. --- .travis.yml | 7 +++++-- run_travis.sh | 8 ++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100755 run_travis.sh diff --git a/.travis.yml b/.travis.yml index 3b3b95885..9443a5b09 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,10 +5,13 @@ services: env matrix: - - NCTESTIMG=unidata/nctests:serial + - DOCKIMG=unidata/nctests:serial + before_install: - docker pull unidata/nctests:serial script: - - docker run -e USEDASH=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USEAC=OFF -v $(pwd):/netcdf-c $NCTESTIMG \ No newline at end of file + - ./run_travis.sh + +- docker run -e USEDASH=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USEAC=OFF -v $(pwd):/netcdf-c unidata/nctests:serial \ No newline at end of file diff --git a/run_travis.sh b/run_travis.sh new file mode 100755 index 000000000..851b31fc4 --- /dev/null +++ b/run_travis.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +### +# Travis script, so that we can more easily +# create a test matrix using travis-ci and docker. +### + +docker run -e USEDASH=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USEAC=OFF -v $(pwd):/netcdf-c $DOCKIMG From 4b2cb987f911cbf1149635895cc1d18aa1c55edf Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 12:59:45 -0700 Subject: [PATCH 15/39] Removed dangling configuration. --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9443a5b09..b2c92be38 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,4 @@ before_install: - docker pull unidata/nctests:serial script: - - ./run_travis.sh - -- docker run -e USEDASH=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USEAC=OFF -v $(pwd):/netcdf-c unidata/nctests:serial \ No newline at end of file + - ./run_travis.sh \ No newline at end of file From d75841ab8176520de2c30d01acb96da4e2a96ef4 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 13:00:30 -0700 Subject: [PATCH 16/39] Hah. Fixed a missing colon. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b2c92be38..d6413aecd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ language: c services: - docker -env +env: matrix: - DOCKIMG=unidata/nctests:serial From 5dcb05fbfd4ef9fb9171cc9ef541ef24912dfcae Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 13:01:47 -0700 Subject: [PATCH 17/39] Trying matrix without utility script to see if the missing colon was the main issue. --- .travis.yml | 2 +- run_travis.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d6413aecd..5106d2d09 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,4 +12,4 @@ before_install: - docker pull unidata/nctests:serial script: - - ./run_travis.sh \ No newline at end of file + - docker run --rm -it -e USEDASH=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USEAC=OFF -v $(pwd):/netcdf-c $DOCKIMG \ No newline at end of file diff --git a/run_travis.sh b/run_travis.sh index 851b31fc4..d4af5b5bb 100755 --- a/run_travis.sh +++ b/run_travis.sh @@ -5,4 +5,4 @@ # create a test matrix using travis-ci and docker. ### -docker run -e USEDASH=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USEAC=OFF -v $(pwd):/netcdf-c $DOCKIMG +docker run --rm -it -e USEDASH=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USEAC=OFF -v $(pwd):/netcdf-c $DOCKIMG From 50d117cae63a637a1e7ce766801e5570d37a932d Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 13:03:13 -0700 Subject: [PATCH 18/39] Testing to see if we can use a build matrix in the before_install script stanza as well. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5106d2d09..8319748b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ env: before_install: - - docker pull unidata/nctests:serial + - docker pull $DOCKIMG script: - docker run --rm -it -e USEDASH=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USEAC=OFF -v $(pwd):/netcdf-c $DOCKIMG \ No newline at end of file From a5204fb450e61be56c5613e91cbc9e71706b3fc0 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 13:03:38 -0700 Subject: [PATCH 19/39] Adding 32-bit to test matrix. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8319748b3..4b19f03b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ services: env: matrix: - DOCKIMG=unidata/nctests:serial - + - DOCKIMG=unidata/nctests:serial32 before_install: - docker pull $DOCKIMG From b2b2200c469bb9c5b74a25dd13e48e214ce31ad6 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 13:11:35 -0700 Subject: [PATCH 20/39] Testing to see if you can define multiple entries per line for a matrix. --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4b19f03b9..e8d68f5c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,9 +7,13 @@ env: matrix: - DOCKIMG=unidata/nctests:serial - DOCKIMG=unidata/nctests:serial32 + - USECMAKE=TRUE USEAC=FALSE + - USECMAKE=TRUE USEAC=TRUE + - USECMAKE=FALSE USEAC=TRUE + before_install: - docker pull $DOCKIMG script: - - docker run --rm -it -e USEDASH=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USEAC=OFF -v $(pwd):/netcdf-c $DOCKIMG \ No newline at end of file + - docker run --rm -it -e USEDASH=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USECMAKE=$USECMAKE -e USEAC=$USEAC -v $(pwd):/netcdf-c $DOCKIMG \ No newline at end of file From 26e4f04a78650c2f84a068418d7bc3391e8a5793 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 13:38:31 -0700 Subject: [PATCH 21/39] Refactoring build matrix. --- .travis.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index e8d68f5c2..3a45e5e34 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,13 +4,11 @@ services: - docker env: + global: + - USECMAKE=TRUE USEAC=TRUE matrix: - DOCKIMG=unidata/nctests:serial - DOCKIMG=unidata/nctests:serial32 - - USECMAKE=TRUE USEAC=FALSE - - USECMAKE=TRUE USEAC=TRUE - - USECMAKE=FALSE USEAC=TRUE - before_install: - docker pull $DOCKIMG From ae303f545898e23efbff62023772443e01aa0d81 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 13:42:30 -0700 Subject: [PATCH 22/39] Further complicated build matrix :). --- .travis.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3a45e5e34..e8ecc67f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,11 +4,14 @@ services: - docker env: - global: - - USECMAKE=TRUE USEAC=TRUE matrix: - - DOCKIMG=unidata/nctests:serial - - DOCKIMG=unidata/nctests:serial32 + - DOCKIMG=unidata/nctests:serial USECMAKE=TRUE USEAC=TRUE USE_CC=gcc + - DOCKIMG=unidata/nctests:serial USECMAKE=TRUE USEAC=TRUE USE_CC=clang + + - DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=TRUE USE_CC=gcc + - DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=TRUE USE_CC=clang + + before_install: - docker pull $DOCKIMG From 5bdb1cb8c3a175d5eac4bfb858dbc6095a3822c1 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 13:46:55 -0700 Subject: [PATCH 23/39] Attempting to make the travis script output a bit more verbose. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index e8ecc67f8..e2a3ad3b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,9 @@ env: before_install: + - echo "Running $DOCKIMG : $USE_CC" - docker pull $DOCKIMG script: + - docker run --rm -it -e USEDASH=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USECMAKE=$USECMAKE -e USEAC=$USEAC -v $(pwd):/netcdf-c $DOCKIMG \ No newline at end of file From 3718ee0a0a4a2618936f478e5da755f61adcb9cb Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 13:46:55 -0700 Subject: [PATCH 24/39] Attempting to make the travis script output a bit more verbose. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index e8ecc67f8..e2a3ad3b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,9 @@ env: before_install: + - echo "Running $DOCKIMG : $USE_CC" - docker pull $DOCKIMG script: + - docker run --rm -it -e USEDASH=OFF -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USECMAKE=$USECMAKE -e USEAC=$USEAC -v $(pwd):/netcdf-c $DOCKIMG \ No newline at end of file From c62d3fa93e5a8f5e36cf51a90ff559e91ea6ea1b Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 13:52:45 -0700 Subject: [PATCH 25/39] Added old travis configuration for reference. --- .travis.yml.old | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .travis.yml.old diff --git a/.travis.yml.old b/.travis.yml.old new file mode 100644 index 000000000..5c0001b16 --- /dev/null +++ b/.travis.yml.old @@ -0,0 +1,52 @@ +sudo: false +language: c +compiler: + - gcc + - clang + +addons: + apt: + packages: + - libcurl4-openssl-dev + - m4 + - wget + - autoconf + - libtool + - gfortran + - git + - doxygen + - graphviz + +before_install: + +before_script: + + ### + # Install dependencies from a pre-built binary. + ### + - cd $HOME + - wget http://www.unidata.ucar.edu/downloads/netcdf/ftp/travisdeps.tar.bz2 + + - tar -jxf travisdeps.tar.bz2 + - export LD_LIBRARY_PATH=$HOME/usr/lib + - export PATH=$HOME/usr/bin:$PATH + - cd - + + - mkdir build-all + - mkdir build-min + + - cd build-min + - cmake .. -DENABLE_NETCDF_4=OFF -DENABLE_DAP=OFF -DCMAKE_PREFIX_PATH=$HOME/usr-min + - cd .. + + - cd build-all + - cmake .. -DENABLE_MMAP=ON -DENABLE_DOXYGEN=ON -DENABLE_EXTRA_TESTS=ON -DENABLE_HDF4=ON -DCMAKE_PREFIX_PATH=$HOME/usr + - cd .. + +script: + - cd build-min + - make -j 4 + - make test + - cd ../build-all + - make -j 4 + - make test \ No newline at end of file From 1fc5ec8849980f10fd5b983e2232f59314aeccba Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 13:57:56 -0700 Subject: [PATCH 26/39] Correcting mistake in travis.yml syntax. --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e2a3ad3b9..8d837150a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,6 @@ env: before_install: - - echo "Running $DOCKIMG : $USE_CC" - docker pull $DOCKIMG script: From 478dbec2453e3a1bf16f75ab5dc645df327ddda9 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 14:40:39 -0700 Subject: [PATCH 27/39] Temporarily removed 32-bit tests until we fix issue [158] --- .travis.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8d837150a..4329824c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,11 +8,6 @@ env: - DOCKIMG=unidata/nctests:serial USECMAKE=TRUE USEAC=TRUE USE_CC=gcc - DOCKIMG=unidata/nctests:serial USECMAKE=TRUE USEAC=TRUE USE_CC=clang - - DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=TRUE USE_CC=gcc - - DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=TRUE USE_CC=clang - - - before_install: - docker pull $DOCKIMG From 9b9fb791d4c09400f24f99e20535c33abe8a3f5e Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 21:58:23 +0000 Subject: [PATCH 28/39] Added a fix for how autodist was checking for szip with libhdf5 [158] --- configure.ac | 3 --- 1 file changed, 3 deletions(-) diff --git a/configure.ac b/configure.ac index 1d1fb2b88..f4bb47f14 100644 --- a/configure.ac +++ b/configure.ac @@ -931,8 +931,6 @@ if test "x$enable_netcdf_4" = xyes; then if test "x$ac_cv_func_H5Z_SZIP" = xyes; then AC_SEARCH_LIBS([SZ_Compress], [szip sz], [], []) AC_DEFINE([USE_SZIP], [1], [if true, compile in szip compression in netCDF-4 variables]) - else - AC_DEFINE([USE_SZIP], [0], [if true, compile in szip compression in netCDF-4 variables]) fi if test "x$ac_cv_func_H5free_memory" = xyes; then @@ -1205,7 +1203,6 @@ AC_SUBST(NC_LIBS,[$NC_LIBS]) AC_SUBST(HAS_DAP,[$enable_dap]) AC_SUBST(HAS_NC2,[$nc_build_v2]) AC_SUBST(HAS_NC4,[$enable_netcdf_4]) -AC_SUBST(HAS_SZIP,[$USE_SZIP]) AC_SUBST(HAS_HDF4,[$enable_hdf4]) AC_SUBST(HAS_PNETCDF,[$enable_pnetcdf]) AC_SUBST(HAS_HDF5,[$enable_netcdf_4]) From a531926b67461f33661af5160db969ff7b5fe5f9 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 20 Nov 2015 15:03:26 -0700 Subject: [PATCH 29/39] Added 32-bit tests back in now that issue is fixed. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 4329824c3..d639a07e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,8 @@ env: - DOCKIMG=unidata/nctests:serial USECMAKE=TRUE USEAC=TRUE USE_CC=gcc - DOCKIMG=unidata/nctests:serial USECMAKE=TRUE USEAC=TRUE USE_CC=clang + - DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=TRUE USE_CC=gcc + - DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=TRUE USE_CC=clang before_install: - docker pull $DOCKIMG From e6e4851364207138b6ceac874ae8ed7353050855 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Mon, 23 Nov 2015 14:39:29 -0600 Subject: [PATCH 30/39] Added a link in the documentation to the scinetcdf interface, https://atoms.scilab.org/toolboxes/scinetcdf --- docs/software.md | 91 ++++++++++++++++++------------------------------ 1 file changed, 34 insertions(+), 57 deletions(-) diff --git a/docs/software.md b/docs/software.md index 67bb5f996..43ec5ab4a 100644 --- a/docs/software.md +++ b/docs/software.md @@ -16,76 +16,27 @@ Freely Available Software {#freely} ANDX and ANAX {#ANDX} ------------------------------------ -The ARM Program has developed [ANDX (ARM NetCDF Data -eXtract)](http://engineering.arm.gov/~sbeus/andx-web/html/), a -command-line utility designed for routine examination and extraction of -data from netcdf files. Data can be displayed graphically (line-plot, -scatter-plot, overlay, color-intensity, etc.) or extracted as ASCII -data. Whether displayed graphically or extracted as ASCII, results can -be saved to disk or viewed on screen. +The ARM Program has developed [ANDX (ARM NetCDF Data eXtract)](http://engineering.arm.gov/~sbeus/andx-web/html/), a command-line utility designed for routine examination and extraction of data from netcdf files. Data can be displayed graphically (line-plot, scatter-plot, overlay, color-intensity, etc.) or extracted as ASCII data. Whether displayed graphically or extracted as ASCII, results can be saved to disk or viewed on screen. -[ANAX (ARM NetCDF ASCII -eXtract)](http://science.arm.gov/~cflynn/ARM_Tested_Tools/) is a -scaled-down version of ANDX -- it is designed to only extract ASCII -data. All features of ANDX pertaining to non-graphic data extraction are -included in ANAX. +[ANAX (ARM NetCDF ASCII eXtract)](http://science.arm.gov/~cflynn/ARM_Tested_Tools/) is a scaled-down version of ANDX -- it is designed to only extract ASCII data. All features of ANDX pertaining to non-graphic data extraction are included in ANAX. ANTS {#ANTS} --------------------------- -The ARM Program has developed [ANTS (ARM NetCDF Tool -Suite)](http://science.arm.gov/~cflynn/ANTS/), a collection of netCDF -tools and utilities providing various means of creating and modifying -netcdf files. ANTS is based on nctools written by Chuck Denham. The -utilities within nctools were modified to compile with version 3.5 of -the netCDF library, the command syntax was modified for consistency with -other tools, and changes were made to accommodate ARM standard netCDF. +The ARM Program has developed [ANTS (ARM NetCDF Tool Suite)](http://science.arm.gov/~cflynn/ANTS/), a collection of netCDF tools and utilities providing various means of creating and modifying netcdf files. ANTS is based on nctools written by Chuck Denham. The utilities within nctools were modified to compile with version 3.5 of the netCDF library, the command syntax was modified for consistency with other tools, and changes were made to accommodate ARM standard netCDF. -The original functions from nctools were intended mainly for the -creation, definition, and copying of fundamental netCDF elements. ARM -added others which focus on manipulation of data within existing netCDF -files. Additional functions have special support for multi-dimensional -data such as "slicing" cross sections from multi-dimensional variable -data or joining lesser-dimensional fields to form multi-dimensional -structures. Functions have been added to support execution of arithmetic -and logical operations, bundling or splitting netCDF files, comparing -the structure or content of files, and so on. +The original functions from nctools were intended mainly for the creation, definition, and copying of fundamental netCDF elements. ARM added others which focus on manipulation of data within existing netCDF files. Additional functions have special support for multi-dimensional data such as "slicing" cross sections from multi-dimensional variable data or joining lesser-dimensional fields to form multi-dimensional structures. Functions have been added to support execution of arithmetic and logical operations, bundling or splitting netCDF files, comparing the structure or content of files, and so on. -Essentially every type of netCDF library function call is exercised in -ANTS. In this way then, this open-source collection of tools also -represents a library of coding examples for fundamental netCDF tasks. -See the [website](http://science.arm.gov/~cflynn/ANTS/) for more -information. +Essentially every type of netCDF library function call is exercised in ANTS. In this way then, this open-source collection of tools also represents a library of coding examples for fundamental netCDF tasks. See the [website](http://science.arm.gov/~cflynn/ANTS/) for more information. ARGOS {#ARGOS} ----------------------------- -[ARGOS](http://www.lapeth.ethz.ch/argos/index.html) (interActive -thRee-dimensional Graphics ObServatory) is a new IDL-based interactive -3D visualization tool, developed by [David N. -Bresch](http://www.lapeth.ethz.ch/~david/index.html) and [Mark A. -Liniger](http://www.lapeth.ethz.ch/~mark/index.html) at the Institute -for Atmospheric Science at the Swiss Federal Institute of Technology, -ETH, Zürich. +[ARGOS](http://www.lapeth.ethz.ch/argos/index.html) (interActive thRee-dimensional Graphics ObServatory) is a new IDL-based interactive 3D visualization tool, developed by [David N. Bresch](http://www.lapeth.ethz.ch/~david/index.html) and [Mark A. Liniger](http://www.lapeth.ethz.ch/~mark/index.html) at the Institute for Atmospheric Science at the Swiss Federal Institute of Technology, ETH, Zürich. -A highly optimized graphical user interface allows quick and elegant -creation of even complex 3D graphics (volume rendering, -isosurfaces,...), including Z-buffered overlays (with hidden lines), -light and data shading, Xray images, 3D trajectories, animations and -virtual flights around your data, all documented in a full on-line -[html-help](http://www.lapeth.ethz.ch/argos/argos_general.html). The -netCDF data format is preferred, but any other format can be read by -providing an IDL (or FORTRAN or C or C++) interface. Some toolboxes (for -atmospheric model output, trajectory display, radar data) have already -been written, others might easily be added (in IDL, FORTRAN or C code). -All interactive activities are tracked in a script, allowing quick -reconstruction of anything done as well as running ARGOS in batch script -mode. +A highly optimized graphical user interface allows quick and elegant creation of even complex 3D graphics (volume rendering, isosurfaces,...), including Z-buffered overlays (with hidden lines), light and data shading, Xray images, 3D trajectories, animations and virtual flights around your data, all documented in a full on-line [html-help](http://www.lapeth.ethz.ch/argos/argos_general.html). The netCDF data format is preferred, but any other format can be read by providing an IDL (or FORTRAN or C or C++) interface. Some toolboxes (for atmospheric model output, trajectory display, radar data) have already been written, others might easily be added (in IDL, FORTRAN or C code). All interactive activities are tracked in a script, allowing quick reconstruction of anything done as well as running ARGOS in batch script mode. -Information about [copyright and licensing -conditions](http://www.lapeth.ethz.ch/argos/argos_copyright.html) are -available. For further information and installation, please E-mail to: -bresch@atmos.umnw.ethz.ch +Information about [copyright and licensing conditions](http://www.lapeth.ethz.ch/argos/argos_copyright.html) are available. For further information and installation, please E-mail to: bresch@atmos.umnw.ethz.ch CDAT {#CDAT} --------------------------- @@ -1829,6 +1780,32 @@ The SDS project is in beta phase and keeps evolving. You are welcome to join discussions or report issues at the CodePlex site: . +sciNetCDF {#scinetcdf} +------------------------------------------------------------- +[sciNetCDF](https://atoms.scilab.org/toolboxes/scinetcdf) + +In the context of the IASI-NG project, CNES is responsible for the development +of a Scilab/NetCDF4 interface, which CNES wanted to make available to the entire +scientific community. + +The toolbox sciNetCDF is the result of this collaboration. It can read and write +NetCDF files of any version (version 4 of the format is used by default for +writing). + +The toolbox provides high level functions to read/write NetCDF files natively in +Scilab in a friendly manner (data is converted automatically from Scilab to +NetCDF and inversely). +These functions are: +- nccreate +- ncwrite +- ncread +- ncwriteatt +- ncreadatt +- ncdisp + +It provides also a low level interface to all the NetCDF C library functions + + Apache Spatial Information System (SIS) {#SIS} ------------------------------------------------------------- From c000899df25f0a5c4b37b6a695843d1db2cfebb7 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Mon, 23 Nov 2015 15:42:22 -0600 Subject: [PATCH 31/39] Added a test in support of issue https://github.com/Unidata/netcdf-c/issues/160. --- nc_test4/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nc_test4/CMakeLists.txt b/nc_test4/CMakeLists.txt index 2f727f813..18eb4c948 100644 --- a/nc_test4/CMakeLists.txt +++ b/nc_test4/CMakeLists.txt @@ -8,7 +8,8 @@ SET(NC4_TESTS tst_dims tst_dims2 tst_dims3 tst_files tst_files4 tst_vars tst_xplatform tst_xplatform2 tst_h_atts2 tst_endian_fill tst_atts t_type cdm_sea_soundings tst_vl tst_atts1 tst_atts2 tst_vars2 tst_files5 tst_files6 tst_sync tst_h_strbug tst_h_refs - tst_h_scalar tst_rename tst_h5_endians tst_atts_string_rewrite) + tst_h_scalar tst_rename tst_h5_endians tst_atts_string_rewrite + tst_put_vars_two_unlim_dim) # Note, renamegroup needs to be compiled before run_grp_rename build_bin_test(renamegroup) @@ -85,5 +86,3 @@ ENDIF() FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.c ${CMAKE_CURRENT_SOURCE_DIR}/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*.sh) SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am) SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} ref_chunks1.cdl ref_chunks2.cdl ref_tst_compounds.nc ref_tst_xplatform2_1.nc ref_tst_xplatform2_2.nc ref_tst_dims.nc ref_tst_interops4.nc ref_grp_rename.cdl ref_tst_nvars.nc contig.hdf4 chunked.hdf4) - -ADD_EXTRA_DIST("${CUR_EXTRA_DIST}") From bf0279e229b13e654204143feb86d741145927e7 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Mon, 23 Nov 2015 15:48:24 -0600 Subject: [PATCH 32/39] Added new test in support of https://github.com/Unidata/netcdf-c/issues/160 --- nc_test4/tst_put_vars_two_unlim_dim.c | 67 +++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 nc_test4/tst_put_vars_two_unlim_dim.c diff --git a/nc_test4/tst_put_vars_two_unlim_dim.c b/nc_test4/tst_put_vars_two_unlim_dim.c new file mode 100644 index 000000000..d41b49ca2 --- /dev/null +++ b/nc_test4/tst_put_vars_two_unlim_dim.c @@ -0,0 +1,67 @@ +/* + * Test contributed in support of netCDF issue + * https://github.com/Unidata/netcdf-c/issues/160 + */ + +#include "netcdf.h" + +#include + +int main(int argc, char* argv[]) +{ + int ret; + int ncid; + int dim1id, dim2id; + int var1id, var2id; + size_t start = 0; + size_t count = 5; + double vals[] = { 1.0, 2.0, 3.0, 4.0, 5.0 }; + + if ((ret = nc_create("tst_put_vars_two_unlim_dim.nc" + printf("nc_create(...): error code = %d\n", ret); + return -1; + } + + if ((ret = nc_def_dim(ncid, "dim1", NC_UNLIMITED, &dim1id))) { + printf("nc_def_dim(...\"dim1\"...): error code = %d\n", ret); + nc_close(ncid); + return -1; + } + + if ((ret = nc_def_dim(ncid, "dim2", NC_UNLIMITED, &dim2id))) { + printf("nc_def_dim(...\"dim1\"...): error code = %d\n", ret); + nc_close(ncid); + return -1; + } + + if ((ret = nc_def_var(ncid, "var1", NC_DOUBLE, 1, &dim1id, &var1id))) { + printf("nc_def_var(...\"var1\"...): error code = %d\n", ret); + nc_close(ncid); + return -1; + } + + if ((ret = nc_def_var(ncid, "var2", NC_DOUBLE, 1, &dim2id, &var2id))) { + printf("nc_def_var(...\"var2\"...): error code = %d\n", ret); + nc_close(ncid); + return -1; + } + + if ((ret = nc_put_vars_double(ncid, var1id, &start, &count, NULL, &vals[0]))) { + printf("nc_put_var_double(...var1id...): error code = %d\n", ret); + nc_close(ncid); + return -1; + } + + if ((ret = nc_put_vars_double(ncid, var2id, &start, &count, NULL, &vals[0]))) { + printf("nc_put_var_double(...var2id...): error code = %d\n", ret); + nc_close(ncid); + return -1; + } + + if ((ret = nc_close(ncid))) { + printf("nc_close(...): error code = %d\n", ret); + return -1; + } + + return 0; +} From 03f7b568790bcf2ae1ea0181fdf3595650de6356 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Mon, 23 Nov 2015 15:49:24 -0600 Subject: [PATCH 33/39] Cleaned up a sloppy cut-and-paste on my part. --- nc_test4/tst_put_vars_two_unlim_dim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nc_test4/tst_put_vars_two_unlim_dim.c b/nc_test4/tst_put_vars_two_unlim_dim.c index d41b49ca2..98a9b13e4 100644 --- a/nc_test4/tst_put_vars_two_unlim_dim.c +++ b/nc_test4/tst_put_vars_two_unlim_dim.c @@ -17,7 +17,7 @@ int main(int argc, char* argv[]) size_t count = 5; double vals[] = { 1.0, 2.0, 3.0, 4.0, 5.0 }; - if ((ret = nc_create("tst_put_vars_two_unlim_dim.nc" + if ((ret = nc_create("tst_put_vars_two_unlim_dim.nc", NC_NETCDF4 | NC_CLOBBER, &ncid))) { printf("nc_create(...): error code = %d\n", ret); return -1; } From 499a29fd4c1fdc62353793ec58753e7cb159e679 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Mon, 23 Nov 2015 16:42:56 -0600 Subject: [PATCH 34/39] Broke out travis build matrix a bit more. --- .travis.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index d639a07e8..60091aa25 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,11 +5,16 @@ services: env: matrix: - - DOCKIMG=unidata/nctests:serial USECMAKE=TRUE USEAC=TRUE USE_CC=gcc - - DOCKIMG=unidata/nctests:serial USECMAKE=TRUE USEAC=TRUE USE_CC=clang + - DOCKIMG=unidata/nctests:serial USECMAKE=TRUE USEAC=OFF USE_CC=gcc + - DOCKIMG=unidata/nctests:serial USECMAKE=TRUE USEAC=OFF USE_CC=clang + - DOCKIMG=unidata/nctests:serial USECMAKE=OFF USEAC=TRUE USE_CC=gcc + - DOCKIMG=unidata/nctests:serial USECMAKE=OFF USEAC=TRUE USE_CC=clang + + - DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=OFF USE_CC=gcc + - DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=OFF USE_CC=clang + - DOCKIMG=unidata/nctests:serial32 USECMAKE=OFF USEAC=TRUE USE_CC=gcc + - DOCKIMG=unidata/nctests:serial32 USECMAKE=OFF USEAC=TRUE USE_CC=clang - - DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=TRUE USE_CC=gcc - - DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=TRUE USE_CC=clang before_install: - docker pull $DOCKIMG From 4cb66307b05ce77134db57bd3c42734e5960440e Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Mon, 23 Nov 2015 17:53:32 -0600 Subject: [PATCH 35/39] Collaped travis test matrix. --- .travis.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 60091aa25..9f44b312a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,16 +5,10 @@ services: env: matrix: - - DOCKIMG=unidata/nctests:serial USECMAKE=TRUE USEAC=OFF USE_CC=gcc - - DOCKIMG=unidata/nctests:serial USECMAKE=TRUE USEAC=OFF USE_CC=clang - - DOCKIMG=unidata/nctests:serial USECMAKE=OFF USEAC=TRUE USE_CC=gcc - - DOCKIMG=unidata/nctests:serial USECMAKE=OFF USEAC=TRUE USE_CC=clang - - - DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=OFF USE_CC=gcc - - DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=OFF USE_CC=clang - - DOCKIMG=unidata/nctests:serial32 USECMAKE=OFF USEAC=TRUE USE_CC=gcc - - DOCKIMG=unidata/nctests:serial32 USECMAKE=OFF USEAC=TRUE USE_CC=clang - + - DOCKIMG=unidata/nctests:serial USECMAKE=TRUE USEAC=TRUE USE_CC=gcc + - DOCKIMG=unidata/nctests:serial USECMAKE=TRUE USEAC=TRUE USE_CC=clang + - DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=TRUE USE_CC=gcc + - DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=TRUE USE_CC=clang before_install: - docker pull $DOCKIMG From 1e564aa721d819e0717ff40ce7451a5fb584e855 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Mon, 23 Nov 2015 18:17:16 -0600 Subject: [PATCH 36/39] Redirected docker pull output to /dev/null for travis-ci, to prevent the command from blowing out the log (which is limited to 10k lines). --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9f44b312a..57c1cce96 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ env: - DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=TRUE USE_CC=gcc - DOCKIMG=unidata/nctests:serial32 USECMAKE=TRUE USEAC=TRUE USE_CC=clang before_install: - - docker pull $DOCKIMG + - docker pull $DOCKIMG > /dev/null script: From 8ebbd2a9c571f925c9922e169ebfb419c8b57e63 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Tue, 24 Nov 2015 16:16:23 -0600 Subject: [PATCH 37/39] Updated makeparser target. --- ncgen/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ncgen/CMakeLists.txt b/ncgen/CMakeLists.txt index 7024b46a0..41a8d6b4e 100644 --- a/ncgen/CMakeLists.txt +++ b/ncgen/CMakeLists.txt @@ -14,9 +14,9 @@ TARGET_LINK_LIBRARIES(ncgen netcdf ${ALL_TLL_LIBS}) # test scripts to work. #### IF(MSVC) - SET_TARGET_PROPERTIES(ncgen PROPERTIES RUNTIME_OUTPUT_DIRECTORY + SET_TARGET_PROPERTIES(ncgen PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - SET_TARGET_PROPERTIES(ncgen PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG + SET_TARGET_PROPERTIES(ncgen PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}) SET_TARGET_PROPERTIES(ncgen PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}) @@ -31,7 +31,7 @@ FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) # Stuff to build if tests are enabled. IF(ENABLE_TESTS) FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.cdl ${CMAKE_CURRENT_SOURCE_DIR}/*.sh) - FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE) + FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE) add_sh_test(ncgen run_tests) IF(USE_NETCDF4) add_sh_test(ncgen run_nc4_tests) @@ -65,7 +65,7 @@ ADD_CUSTOM_COMMAND( COMMAND mv ncgenl.c ${CMAKE_CURRENT_SOURCE_DIR} ) -ADD_CUSTOM_TARGET(makeparser DEPENDS ncgeny.h) +ADD_CUSTOM_TARGET(makeparser DEPENDS ncgentab.h) ## Specify files to be distributed by 'make dist' FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.c ${CMAKE_CURRENT_SOURCE_DIR}/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*.sh) From dd2201621e68a6b0d206eb44db259756af98ae14 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Tue, 24 Nov 2015 17:19:36 -0600 Subject: [PATCH 38/39] Addressed an API-related usage of strncmp. --- ncgen/ncgen.l | 14 +- ncgen/ncgenl.c | 142 ++++-- ncgen/ncgeny.c | 1314 +++++++++++++++++++----------------------------- ncgen/ncgeny.h | 96 +++- 4 files changed, 710 insertions(+), 856 deletions(-) diff --git a/ncgen/ncgen.l b/ncgen/ncgen.l index 4a62b7ded..da82caa29 100644 --- a/ncgen/ncgen.l +++ b/ncgen/ncgen.l @@ -391,7 +391,7 @@ NIL|nil|Nil { sprintf(errstr,"Illegal integer suffix: %s",stag); yyerror(errstr); goto done; - } + } /* drop the tag from the input text */ ncgtext[slen - strlen(stag)] = '\0'; hasU = isuinttype(tag); @@ -450,7 +450,7 @@ done: return 0; sprintf(errstr,"Illegal integer suffix: %s",stag); yyerror(errstr); goto done; - } + } yytext[slen - strlen(stag)] = '\0'; if(xlen > 16) { /* truncate hi order digits */ hex += (xlen - 16); @@ -740,7 +740,7 @@ downconvert(unsigned long long uint64, int* tagp, int isneg, int hasU) if(int64 <= NC_MAX_USHORT) { nct = NC_USHORT; uint16_val = (unsigned short)int64; - } else + } else goto outofrange; break; case NC_UINT: @@ -817,6 +817,7 @@ collecttag(char* text, char** stagp) char* stag0; #define MAXTAGLEN 3 char stag[MAXTAGLEN+1]; + char stagtmp[MAXTAGLEN+1]; int slen = strlen(text); int staglen; int tag = NC_NAT; @@ -835,7 +836,8 @@ collecttag(char* text, char** stagp) stag[MAXTAGLEN] = '\0'; if(stag[0] == 'U' || stag[0] == 'u') { hasU = 1; - strncpy(stag,stag+1,MAXTAGLEN+1); + strncpy(stagtmp,stag+1,MAXTAGLEN+1); + strncpy(stag,stagtmp,MAXTAGLEN+1); staglen--; } else if(stag[staglen-1] == 'U' || stag[staglen-1] == 'u') { hasU = 1; @@ -855,9 +857,9 @@ collecttag(char* text, char** stagp) tag = (hasU ? NC_UINT64 : NC_INT64); } if(tag == NC_NAT) { - if(strlen(stag) > 0) + if(strlen(stag) > 0) return tag; tag = NC_NAT; - } + } return tag; } diff --git a/ncgen/ncgenl.c b/ncgen/ncgenl.c index d6354ce2a..d8a64cd4f 100644 --- a/ncgen/ncgenl.c +++ b/ncgen/ncgenl.c @@ -1,5 +1,5 @@ -#line 3 "ncgenl.c" +#line 3 "lex.ncg.c" #define YY_INT_ALIGNED short int @@ -65,6 +65,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; @@ -171,7 +172,12 @@ typedef unsigned int flex_uint32_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -extern int ncgleng; +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t ncgleng; extern FILE *ncgin, *ncgout; @@ -197,11 +203,6 @@ extern FILE *ncgin, *ncgout; #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 @@ -219,7 +220,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t 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 @@ -289,8 +290,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when ncgtext is formed. */ static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int ncgleng; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t ncgleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; @@ -318,7 +319,7 @@ static void ncg_init_buffer (YY_BUFFER_STATE b,FILE *file ); YY_BUFFER_STATE ncg_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE ncg_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE ncg_scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE ncg_scan_bytes (yyconst char *bytes,yy_size_t len ); void *ncgalloc (yy_size_t ); void *ncgrealloc (void *,yy_size_t ); @@ -373,7 +374,7 @@ static void yy_fatal_error (yyconst char msg[] ); */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - ncgleng = (size_t) (yy_cp - yy_bp); \ + ncgleng = (yy_size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; @@ -1084,6 +1085,8 @@ int ncg_flex_debug = 0; #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *ncgtext; +#line 1 "ncgen.l" +#line 2 "ncgen.l" /********************************************************************* * Copyright 1993, UCAR/Unidata * See netcdf/COPYRIGHT file for copying and redistribution conditions. @@ -1216,6 +1219,8 @@ static struct Specialtoken { {NULL,0} /* null terminate */ }; + + /* The most correct (validating) version of UTF8 character set (Taken from: http://www.w3.org/2005/03/23-lex-U) @@ -1257,6 +1262,7 @@ ID ([A-Za-z_]|{UTF8})([A-Z.@#\[\]a-z_0-9+-]|{UTF8})* /* Note: this definition of string will work for utf8 as well, although it is a very relaxed definition */ +#line 1266 "lex.ncg.c" #define INITIAL 0 #define ST_C_COMMENT 1 @@ -1297,7 +1303,7 @@ FILE *ncgget_out (void ); void ncgset_out (FILE * out_str ); -int ncgget_leng (void ); +yy_size_t ncgget_leng (void ); char *ncgget_text (void ); @@ -1347,7 +1353,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( ncgtext, ncgleng, 1, ncgout )) {} } while (0) +#define ECHO fwrite( ncgtext, ncgleng, 1, ncgout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1358,7 +1364,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - unsigned n; \ + yy_size_t n; \ for ( n = 0; n < max_size && \ (c = getc( ncgin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1440,6 +1446,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; +#line 213 "ncgen.l" + +#line 1452 "lex.ncg.c" + if ( !(yy_init) ) { (yy_init) = 1; @@ -1497,16 +1507,12 @@ yy_match: yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 2153 ); + while ( yy_current_state != 383 ); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); yy_find_action: yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - yy_act = yy_accept[yy_current_state]; - } YY_DO_BEFORE_ACTION; @@ -1523,12 +1529,14 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP +#line 214 "ncgen.l" { /* whitespace */ break; } YY_BREAK case 2: YY_RULE_SETUP +#line 218 "ncgen.l" { /* comment */ break; } @@ -1536,6 +1544,7 @@ YY_RULE_SETUP case 3: /* rule 3 can match eol */ YY_RULE_SETUP +#line 222 "ncgen.l" {int len; /* In netcdf4, this will be used in a variety of places, so only remove escapes */ @@ -1562,6 +1571,7 @@ ncgtext[MAXTRST-1] = '\0'; YY_BREAK case 4: YY_RULE_SETUP +#line 246 "ncgen.l" { /* drop leading 0x; pad to even number of chars */ char* p = ncgtext+2; int len = ncgleng - 2; @@ -1576,91 +1586,113 @@ YY_RULE_SETUP YY_BREAK case 5: YY_RULE_SETUP +#line 258 "ncgen.l" {return lexdebug(COMPOUND);} YY_BREAK case 6: YY_RULE_SETUP +#line 259 "ncgen.l" {return lexdebug(ENUM);} YY_BREAK case 7: YY_RULE_SETUP +#line 260 "ncgen.l" {return lexdebug(OPAQUE);} YY_BREAK case 8: YY_RULE_SETUP +#line 262 "ncgen.l" {return lexdebug(FLOAT_K);} YY_BREAK case 9: YY_RULE_SETUP +#line 263 "ncgen.l" {return lexdebug(CHAR_K);} YY_BREAK case 10: YY_RULE_SETUP +#line 264 "ncgen.l" {return lexdebug(BYTE_K);} YY_BREAK case 11: YY_RULE_SETUP +#line 265 "ncgen.l" {return lexdebug(UBYTE_K);} YY_BREAK case 12: YY_RULE_SETUP +#line 266 "ncgen.l" {return lexdebug(SHORT_K);} YY_BREAK case 13: YY_RULE_SETUP +#line 267 "ncgen.l" {return lexdebug(USHORT_K);} YY_BREAK case 14: YY_RULE_SETUP +#line 268 "ncgen.l" {return lexdebug(INT_K);} YY_BREAK case 15: YY_RULE_SETUP +#line 269 "ncgen.l" {return lexdebug(UINT_K);} YY_BREAK case 16: YY_RULE_SETUP +#line 270 "ncgen.l" {return lexdebug(INT64_K);} YY_BREAK case 17: YY_RULE_SETUP +#line 271 "ncgen.l" {return lexdebug(UINT64_K);} YY_BREAK case 18: YY_RULE_SETUP +#line 272 "ncgen.l" {return lexdebug(DOUBLE_K);} YY_BREAK case 19: YY_RULE_SETUP +#line 273 "ncgen.l" {int32_val = -1; return lexdebug(NC_UNLIMITED_K);} YY_BREAK case 20: YY_RULE_SETUP +#line 276 "ncgen.l" {return lexdebug(TYPES);} YY_BREAK case 21: YY_RULE_SETUP +#line 277 "ncgen.l" {return lexdebug(DIMENSIONS);} YY_BREAK case 22: YY_RULE_SETUP +#line 278 "ncgen.l" {return lexdebug(VARIABLES);} YY_BREAK case 23: YY_RULE_SETUP +#line 279 "ncgen.l" {return lexdebug(DATA);} YY_BREAK case 24: YY_RULE_SETUP +#line 280 "ncgen.l" {return lexdebug(GROUP);} YY_BREAK case 25: YY_RULE_SETUP +#line 282 "ncgen.l" {BEGIN(TEXT);return lexdebug(NETCDF);} YY_BREAK case 26: YY_RULE_SETUP +#line 284 "ncgen.l" { /* missing value (pre-2.4 backward compatibility) */ if (ncgtext[0] == '-') { double_val = NEGNC_INFINITE; @@ -1673,6 +1705,7 @@ YY_RULE_SETUP YY_BREAK case 27: YY_RULE_SETUP +#line 293 "ncgen.l" { /* missing value (pre-2.4 backward compatibility) */ double_val = NAN; specialconstants = 1; @@ -1681,6 +1714,7 @@ YY_RULE_SETUP YY_BREAK case 28: YY_RULE_SETUP +#line 299 "ncgen.l" {/* missing value (pre-2.4 backward compatibility)*/ if (ncgtext[0] == '-') { float_val = NEGNC_INFINITEF; @@ -1693,6 +1727,7 @@ YY_RULE_SETUP YY_BREAK case 29: YY_RULE_SETUP +#line 308 "ncgen.l" { /* missing value (pre-2.4 backward compatibility) */ float_val = NANF; specialconstants = 1; @@ -1701,6 +1736,7 @@ YY_RULE_SETUP YY_BREAK case 30: YY_RULE_SETUP +#line 314 "ncgen.l" { #ifdef USE_NETCDF4 if(l_flag == L_C || l_flag == L_BINARY) @@ -1713,6 +1749,7 @@ YY_RULE_SETUP YY_BREAK case 31: YY_RULE_SETUP +#line 324 "ncgen.l" { bbClear(lextext); bbAppendn(lextext,(char*)ncgtext,ncgleng+1); /* include null */ @@ -1723,6 +1760,7 @@ YY_RULE_SETUP YY_BREAK case 32: YY_RULE_SETUP +#line 333 "ncgen.l" {struct Specialtoken* st; bbClear(lextext); bbAppendn(lextext,(char*)ncgtext,ncgleng+1); /* include null */ @@ -1736,6 +1774,7 @@ YY_RULE_SETUP case 33: /* rule 33 can match eol */ YY_RULE_SETUP +#line 343 "ncgen.l" { int c; char* p; char* q; @@ -1754,6 +1793,7 @@ YY_RULE_SETUP YY_BREAK case 34: YY_RULE_SETUP +#line 359 "ncgen.l" { char* id; int len; bbClear(lextext); bbAppendn(lextext,(char*)ncgtext,ncgleng+1); /* include null */ @@ -1768,6 +1808,7 @@ YY_RULE_SETUP YY_BREAK case 35: YY_RULE_SETUP +#line 371 "ncgen.l" { /* We need to try to see what size of integer ((u)int). @@ -1791,7 +1832,7 @@ YY_RULE_SETUP sprintf(errstr,"Illegal integer suffix: %s",stag); yyerror(errstr); goto done; - } + } /* drop the tag from the input text */ ncgtext[slen - strlen(stag)] = '\0'; hasU = isuinttype(tag); @@ -1836,6 +1877,7 @@ done: return 0; YY_BREAK case 36: YY_RULE_SETUP +#line 437 "ncgen.l" { int c; int token = 0; @@ -1852,7 +1894,7 @@ YY_RULE_SETUP sprintf(errstr,"Illegal integer suffix: %s",stag); yyerror(errstr); goto done; - } + } ncgtext[slen - strlen(stag)] = '\0'; if(xlen > 16) { /* truncate hi order digits */ hex += (xlen - 16); @@ -1886,6 +1928,7 @@ YY_RULE_SETUP YY_BREAK case 37: YY_RULE_SETUP +#line 484 "ncgen.l" { if (sscanf((char*)ncgtext, "%le", &double_val) != 1) { sprintf(errstr,"bad long or double constant: %s",(char*)ncgtext); @@ -1896,6 +1939,7 @@ YY_RULE_SETUP YY_BREAK case 38: YY_RULE_SETUP +#line 491 "ncgen.l" { if (sscanf((char*)ncgtext, "%e", &float_val) != 1) { sprintf(errstr,"bad float constant: %s",(char*)ncgtext); @@ -1907,6 +1951,7 @@ YY_RULE_SETUP case 39: /* rule 39 can match eol */ YY_RULE_SETUP +#line 498 "ncgen.l" { (void) sscanf((char*)&ncgtext[1],"%c",&byte_val); return lexdebug(BYTE_CONST); @@ -1914,6 +1959,7 @@ YY_RULE_SETUP YY_BREAK case 40: YY_RULE_SETUP +#line 502 "ncgen.l" { int oct = unescapeoct(&ncgtext[2]); if(oct < 0) { @@ -1926,6 +1972,7 @@ YY_RULE_SETUP YY_BREAK case 41: YY_RULE_SETUP +#line 511 "ncgen.l" { int hex = unescapehex(&ncgtext[3]); if(byte_val < 0) { @@ -1938,6 +1985,7 @@ YY_RULE_SETUP YY_BREAK case 42: YY_RULE_SETUP +#line 520 "ncgen.l" { switch ((char)ncgtext[2]) { case 'a': byte_val = '\007'; break; /* not everyone under- @@ -1959,6 +2007,7 @@ YY_RULE_SETUP case 43: /* rule 43 can match eol */ YY_RULE_SETUP +#line 538 "ncgen.l" { lineno++ ; break; @@ -1966,6 +2015,7 @@ YY_RULE_SETUP YY_BREAK case 44: YY_RULE_SETUP +#line 543 "ncgen.l" {/*initial*/ BEGIN(ST_C_COMMENT); break; @@ -1974,18 +2024,21 @@ YY_RULE_SETUP case 45: /* rule 45 can match eol */ YY_RULE_SETUP +#line 548 "ncgen.l" {/* continuation */ break; } YY_BREAK case 46: YY_RULE_SETUP +#line 552 "ncgen.l" {/* final */ BEGIN(INITIAL); break; } YY_BREAK case YY_STATE_EOF(ST_C_COMMENT): +#line 557 "ncgen.l" {/* final, error */ fprintf(stderr,"unterminated /**/ comment"); BEGIN(INITIAL); @@ -1994,14 +2047,17 @@ case YY_STATE_EOF(ST_C_COMMENT): YY_BREAK case 47: YY_RULE_SETUP +#line 563 "ncgen.l" {/* Note: this next rule will not work for UTF8 characters */ return lexdebug(ncgtext[0]) ; } YY_BREAK case 48: YY_RULE_SETUP +#line 566 "ncgen.l" ECHO; YY_BREAK +#line 2061 "lex.ncg.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(TEXT): yyterminate(); @@ -2069,7 +2125,8 @@ case YY_STATE_EOF(TEXT): else { - yy_cp = (yy_c_buf_p); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); goto yy_find_action; } } @@ -2188,7 +2245,7 @@ static int yy_get_next_buffer (void) else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -2202,7 +2259,7 @@ static int yy_get_next_buffer (void) if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -2233,7 +2290,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); } @@ -2343,7 +2400,7 @@ 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 yy_size_t number_to_move = (yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = @@ -2392,7 +2449,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -2416,7 +2473,7 @@ static int yy_get_next_buffer (void) case EOB_ACT_END_OF_FILE: { if ( ncgwrap( ) ) - return EOF; + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -2668,7 +2725,7 @@ void ncgpop_buffer_state (void) */ static void ncgensure_buffer_stack (void) { - int num_to_alloc; + yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { @@ -2765,12 +2822,11 @@ YY_BUFFER_STATE ncg_scan_string (yyconst char * yystr ) * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE ncg_scan_bytes (yyconst char * yybytes, int _yybytes_len ) +YY_BUFFER_STATE ncg_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; - yy_size_t n; - int i; + yy_size_t n, i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -2852,7 +2908,7 @@ FILE *ncgget_out (void) /** Get the length of the current token. * */ -int ncgget_leng (void) +yy_size_t ncgget_leng (void) { return ncgleng; } @@ -3000,6 +3056,9 @@ void ncgfree (void * ptr ) #define YYTABLES_NAME "yytables" +#line 566 "ncgen.l" + + static int lexdebug(int token) { @@ -3107,6 +3166,7 @@ parseULL(char* text, int* failp) return uint64; } + /** Given the raw bits, the sign char, the tag, and hasU fill in the appropriate *_val field @@ -3175,7 +3235,7 @@ downconvert(unsigned long long uint64, int* tagp, int isneg, int hasU) if(int64 <= NC_MAX_USHORT) { nct = NC_USHORT; uint16_val = (unsigned short)int64; - } else + } else goto outofrange; break; case NC_UINT: @@ -3252,6 +3312,7 @@ collecttag(char* text, char** stagp) char* stag0; #define MAXTAGLEN 3 char stag[MAXTAGLEN+1]; + char stagtmp[MAXTAGLEN+1]; int slen = strlen(text); int staglen; int tag = NC_NAT; @@ -3270,7 +3331,8 @@ collecttag(char* text, char** stagp) stag[MAXTAGLEN] = '\0'; if(stag[0] == 'U' || stag[0] == 'u') { hasU = 1; - strncpy(stag,stag+1,MAXTAGLEN+1); + strncpy(stagtmp,stag+1,MAXTAGLEN+1); + strncpy(stag,stagtmp,MAXTAGLEN+1); staglen--; } else if(stag[staglen-1] == 'U' || stag[staglen-1] == 'u') { hasU = 1; @@ -3290,10 +3352,10 @@ collecttag(char* text, char** stagp) tag = (hasU ? NC_UINT64 : NC_INT64); } if(tag == NC_NAT) { - if(strlen(stag) > 0) + if(strlen(stag) > 0) return tag; tag = NC_NAT; - } + } return tag; } diff --git a/ncgen/ncgeny.c b/ncgen/ncgeny.c index 535e0442c..e43896ea5 100644 --- a/ncgen/ncgeny.c +++ b/ncgen/ncgeny.c @@ -1,21 +1,24 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - + the Free Software Foundation; either version 2, or (at your option) + any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 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 . */ + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -26,7 +29,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -44,7 +47,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.5" +#define YYBISON_VERSION "2.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -52,28 +55,129 @@ /* Pure parsers. */ #define YYPURE 0 -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - /* Using locations. */ #define YYLSP_NEEDED 0 /* Substitute the variable and function names. */ -#define yyparse ncgparse -#define yylex ncglex -#define yyerror ncgerror -#define yylval ncglval -#define yychar ncgchar -#define yydebug ncgdebug -#define yynerrs ncgnerrs +#define yyparse ncgparse +#define yylex ncglex +#define yyerror ncgerror +#define yylval ncglval +#define yychar ncgchar +#define yydebug ncgdebug +#define yynerrs ncgnerrs + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + NC_UNLIMITED_K = 258, + CHAR_K = 259, + BYTE_K = 260, + SHORT_K = 261, + INT_K = 262, + FLOAT_K = 263, + DOUBLE_K = 264, + UBYTE_K = 265, + USHORT_K = 266, + UINT_K = 267, + INT64_K = 268, + UINT64_K = 269, + IDENT = 270, + TERMSTRING = 271, + CHAR_CONST = 272, + BYTE_CONST = 273, + SHORT_CONST = 274, + INT_CONST = 275, + INT64_CONST = 276, + UBYTE_CONST = 277, + USHORT_CONST = 278, + UINT_CONST = 279, + UINT64_CONST = 280, + FLOAT_CONST = 281, + DOUBLE_CONST = 282, + DIMENSIONS = 283, + VARIABLES = 284, + NETCDF = 285, + DATA = 286, + TYPES = 287, + COMPOUND = 288, + ENUM = 289, + OPAQUE = 290, + OPAQUESTRING = 291, + GROUP = 292, + PATH = 293, + FILLMARKER = 294, + NIL = 295, + _FILLVALUE = 296, + _FORMAT = 297, + _STORAGE = 298, + _CHUNKSIZES = 299, + _DEFLATELEVEL = 300, + _SHUFFLE = 301, + _ENDIANNESS = 302, + _NOFILL = 303, + _FLETCHER32 = 304, + DATASETID = 305 + }; +#endif +/* Tokens. */ +#define NC_UNLIMITED_K 258 +#define CHAR_K 259 +#define BYTE_K 260 +#define SHORT_K 261 +#define INT_K 262 +#define FLOAT_K 263 +#define DOUBLE_K 264 +#define UBYTE_K 265 +#define USHORT_K 266 +#define UINT_K 267 +#define INT64_K 268 +#define UINT64_K 269 +#define IDENT 270 +#define TERMSTRING 271 +#define CHAR_CONST 272 +#define BYTE_CONST 273 +#define SHORT_CONST 274 +#define INT_CONST 275 +#define INT64_CONST 276 +#define UBYTE_CONST 277 +#define USHORT_CONST 278 +#define UINT_CONST 279 +#define UINT64_CONST 280 +#define FLOAT_CONST 281 +#define DOUBLE_CONST 282 +#define DIMENSIONS 283 +#define VARIABLES 284 +#define NETCDF 285 +#define DATA 286 +#define TYPES 287 +#define COMPOUND 288 +#define ENUM 289 +#define OPAQUE 290 +#define OPAQUESTRING 291 +#define GROUP 292 +#define PATH 293 +#define FILLMARKER 294 +#define NIL 295 +#define _FILLVALUE 296 +#define _FORMAT 297 +#define _STORAGE 298 +#define _CHUNKSIZES 299 +#define _DEFLATELEVEL 300 +#define _SHUFFLE 301 +#define _ENDIANNESS 302 +#define _NOFILL 303 +#define _FLETCHER32 304 +#define DATASETID 305 + + /* Copy the first part of user declarations. */ - -/* Line 268 of yacc.c */ #line 11 "ncgen.y" /* @@ -193,9 +297,6 @@ extern int lex_init(void); -/* Line 268 of yacc.c */ -#line 198 "ncgeny.c" - /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 1 @@ -214,96 +315,32 @@ extern int lex_init(void); # define YYTOKEN_TABLE 0 #endif - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - NC_UNLIMITED_K = 258, - CHAR_K = 259, - BYTE_K = 260, - SHORT_K = 261, - INT_K = 262, - FLOAT_K = 263, - DOUBLE_K = 264, - UBYTE_K = 265, - USHORT_K = 266, - UINT_K = 267, - INT64_K = 268, - UINT64_K = 269, - IDENT = 270, - TERMSTRING = 271, - CHAR_CONST = 272, - BYTE_CONST = 273, - SHORT_CONST = 274, - INT_CONST = 275, - INT64_CONST = 276, - UBYTE_CONST = 277, - USHORT_CONST = 278, - UINT_CONST = 279, - UINT64_CONST = 280, - FLOAT_CONST = 281, - DOUBLE_CONST = 282, - DIMENSIONS = 283, - VARIABLES = 284, - NETCDF = 285, - DATA = 286, - TYPES = 287, - COMPOUND = 288, - ENUM = 289, - OPAQUE = 290, - OPAQUESTRING = 291, - GROUP = 292, - PATH = 293, - FILLMARKER = 294, - NIL = 295, - _FILLVALUE = 296, - _FORMAT = 297, - _STORAGE = 298, - _CHUNKSIZES = 299, - _DEFLATELEVEL = 300, - _SHUFFLE = 301, - _ENDIANNESS = 302, - _NOFILL = 303, - _FLETCHER32 = 304, - DATASETID = 305 - }; -#endif - - - #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -{ - -/* Line 293 of yacc.c */ #line 131 "ncgen.y" - +{ Symbol* sym; unsigned long size; /* allow for zero size to indicate e.g. UNLIMITED*/ long mark; /* track indices into the sequence*/ int nctype; /* for tracking attribute list type*/ Datalist* datalist; NCConstant constant; - - - -/* Line 293 of yacc.c */ -#line 295 "ncgeny.c" -} YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 +} +/* Line 193 of yacc.c. */ +#line 331 "ncgen.tab.c" + YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 #endif + /* Copy the second part of user declarations. */ -/* Line 343 of yacc.c */ -#line 307 "ncgeny.c" +/* Line 216 of yacc.c. */ +#line 344 "ncgen.tab.c" #ifdef short # undef short @@ -378,14 +415,14 @@ typedef short int yytype_int16; #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int -YYID (int yyi) +YYID (int i) #else static int -YYID (yyi) - int yyi; +YYID (i) + int i; #endif { - return yyi; + return i; } #endif @@ -406,11 +443,11 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 +# ifndef _STDLIB_H +# define _STDLIB_H 1 # endif # endif # endif @@ -433,24 +470,24 @@ YYID (yyi) # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ +# if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 +# ifndef _STDLIB_H +# define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif @@ -466,9 +503,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; + yytype_int16 yyss; + YYSTYPE yyvs; + }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) @@ -479,27 +516,6 @@ union yyalloc ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY @@ -517,7 +533,24 @@ union yyalloc while (YYID (0)) # endif # endif -#endif /* !YYCOPY_NEEDED */ + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 5 @@ -687,7 +720,7 @@ static const char *const yytname[] = "_DEFLATELEVEL", "_SHUFFLE", "_ENDIANNESS", "_NOFILL", "_FLETCHER32", "DATASETID", "'{'", "'}'", "';'", "','", "'='", "'('", "')'", "'*'", "':'", "$accept", "ncdesc", "datasetid", "rootgroup", "groupbody", - "subgrouplist", "namedgroup", "$@1", "$@2", "typesection", "typedecls", + "subgrouplist", "namedgroup", "@1", "@2", "typesection", "typedecls", "typename", "type_or_attr_decl", "typedecl", "optsemicolon", "enumdecl", "enumidlist", "enumid", "opaquedecl", "vlendecl", "compounddecl", "fields", "field", "primtype", "dimsection", "dimdecls", @@ -758,8 +791,8 @@ static const yytype_uint8 yyr2[] = 1 }; -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { @@ -850,7 +883,8 @@ static const yytype_int16 yypgoto[] = /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -105 static const yytype_int16 yytable[] = { @@ -893,12 +927,6 @@ static const yytype_int16 yytable[] = 0, 0, 0, 0, 0, 0, 0, 20 }; -#define yypact_value_is_default(yystate) \ - ((yystate) == (-124)) - -#define yytable_value_is_error(yytable_value) \ - YYID (0) - static const yytype_int16 yycheck[] = { 37, 21, 85, 24, 38, 101, 102, 39, 131, 15, @@ -984,18 +1012,9 @@ static const yytype_uint8 yystos[] = /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ + Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif #define YYRECOVERING() (!!yyerrstatus) @@ -1005,6 +1024,7 @@ do \ { \ yychar = (Token); \ yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ @@ -1046,10 +1066,19 @@ while (YYID (0)) #endif -/* This macro is provided for backward compatibility. */ +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif #endif @@ -1153,20 +1182,17 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; +yy_stack_print (bottom, top) + yytype_int16 *bottom; + yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } + for (; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } @@ -1200,11 +1226,11 @@ yy_reduce_print (yyvsp, yyrule) /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { - YYFPRINTF (stderr, " $%d = ", yyi + 1); + fprintf (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) ); - YYFPRINTF (stderr, "\n"); + fprintf (stderr, "\n"); } } @@ -1241,6 +1267,7 @@ int yydebug; # define YYMAXDEPTH 10000 #endif + #if YYERROR_VERBOSE @@ -1343,142 +1370,115 @@ yytnamerr (char *yyres, const char *yystr) } # endif -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) { - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = 0; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; + int yyn = yypact[yystate]; - /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; } #endif /* YYERROR_VERBOSE */ + /*-----------------------------------------------. | Release the memory associated to this symbol. | @@ -1510,9 +1510,10 @@ yydestruct (yymsg, yytype, yyvaluep) break; } } - + /* Prevent warnings from -Wmissing-prototypes. */ + #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); @@ -1528,16 +1529,18 @@ int yyparse (); #endif /* ! YYPARSE_PARAM */ -/* The lookahead symbol. */ + +/* The look-ahead symbol. */ int yychar; -/* The semantic value of the lookahead symbol. */ +/* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; + /*----------. | yyparse. | `----------*/ @@ -1564,37 +1567,14 @@ yyparse () #endif #endif { - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - + + int yystate; int yyn; int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; @@ -1602,28 +1582,51 @@ yyparse () YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + + #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; - yystacksize = YYINITDEPTH; - YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ + yyssp = yyss; yyvsp = yyvs; @@ -1653,6 +1656,7 @@ yyparse () YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; + /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might @@ -1660,6 +1664,7 @@ yyparse () yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); yyss = yyss1; @@ -1682,8 +1687,9 @@ yyparse () (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); @@ -1694,6 +1700,7 @@ yyparse () yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; + YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); @@ -1703,9 +1710,6 @@ yyparse () YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - if (yystate == YYFINAL) - YYACCEPT; - goto yybackup; /*-----------. @@ -1714,16 +1718,16 @@ yyparse () yybackup: /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ + look-ahead token if we need one and don't already have one. */ - /* First try to decide what to do without reference to lookahead token. */ + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) + if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ + /* Not known => get a look-ahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -1749,22 +1753,26 @@ yybackup: yyn = yytable[yyn]; if (yyn <= 0) { - if (yytable_value_is_error (yyn)) - goto yyerrlab; + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; yyn = -yyn; goto yyreduce; } + if (yyn == YYFINAL) + YYACCEPT; + /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; - /* Shift the lookahead token. */ + /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the shifted token. */ - yychar = YYEMPTY; + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; @@ -1804,22 +1812,16 @@ yyreduce: switch (yyn) { case 2: - -/* Line 1806 of yacc.c */ #line 211 "ncgen.y" - {if (error_count > 0) YYABORT;} + {if (error_count > 0) YYABORT;;} break; case 3: - -/* Line 1806 of yacc.c */ #line 214 "ncgen.y" - {createrootgroup(datasetname);} + {createrootgroup(datasetname);;} break; case 8: - -/* Line 1806 of yacc.c */ #line 233 "ncgen.y" { Symbol* id = (yyvsp[(2) - (3)].sym); @@ -1827,33 +1829,25 @@ yyreduce: if(creategroup(id) == NULL) yyerror("duplicate group declaration within parent group for %s", id->name); - } + ;} break; case 9: - -/* Line 1806 of yacc.c */ #line 242 "ncgen.y" - {listpop(groupstack);} + {listpop(groupstack);;} break; case 12: - -/* Line 1806 of yacc.c */ #line 248 "ncgen.y" - {} + {;} break; case 13: - -/* Line 1806 of yacc.c */ #line 250 "ncgen.y" - {markcdf4("Type specification");} + {markcdf4("Type specification");;} break; case 16: - -/* Line 1806 of yacc.c */ #line 256 "ncgen.y" { /* Use when defining a type */ (yyvsp[(1) - (1)].sym)->objectclass = NC_TYPE; @@ -1861,26 +1855,20 @@ yyreduce: yyerror("duplicate type declaration for %s", (yyvsp[(1) - (1)].sym)->name); listpush(typdefs,(void*)(yyvsp[(1) - (1)].sym)); - } + ;} break; case 17: - -/* Line 1806 of yacc.c */ #line 265 "ncgen.y" - {} + {;} break; case 18: - -/* Line 1806 of yacc.c */ #line 265 "ncgen.y" - {} + {;} break; case 25: - -/* Line 1806 of yacc.c */ #line 279 "ncgen.y" { int i; @@ -1907,19 +1895,15 @@ yyreduce: eid->typ.basetype = (yyvsp[(3) - (6)].sym)->typ.basetype; } listsetlength(stack,stackbase);/* remove stack nodes*/ - } + ;} break; case 26: - -/* Line 1806 of yacc.c */ #line 308 "ncgen.y" - {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[(1) - (1)].sym));} + {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[(1) - (1)].sym));;} break; case 27: - -/* Line 1806 of yacc.c */ #line 310 "ncgen.y" { int i; @@ -1934,24 +1918,20 @@ yyreduce: elem->name); } listpush(stack,(void*)(yyvsp[(3) - (3)].sym)); - } + ;} break; case 28: - -/* Line 1806 of yacc.c */ #line 327 "ncgen.y" { (yyvsp[(1) - (3)].sym)->objectclass=NC_TYPE; (yyvsp[(1) - (3)].sym)->subclass=NC_ECONST; (yyvsp[(1) - (3)].sym)->typ.econst=(yyvsp[(3) - (3)].constant); (yyval.sym)=(yyvsp[(1) - (3)].sym); - } + ;} break; case 29: - -/* Line 1806 of yacc.c */ #line 336 "ncgen.y" { vercheck(NC_OPAQUE); @@ -1961,12 +1941,10 @@ yyreduce: (yyvsp[(5) - (5)].sym)->typ.typecode=NC_OPAQUE; (yyvsp[(5) - (5)].sym)->typ.size=int32_val; (yyvsp[(5) - (5)].sym)->typ.alignment=nctypealignment(NC_OPAQUE); - } + ;} break; case 30: - -/* Line 1806 of yacc.c */ #line 348 "ncgen.y" { Symbol* basetype = (yyvsp[(1) - (5)].sym); @@ -1978,12 +1956,10 @@ yyreduce: (yyvsp[(5) - (5)].sym)->typ.typecode=NC_VLEN; (yyvsp[(5) - (5)].sym)->typ.size=VLENSIZE; (yyvsp[(5) - (5)].sym)->typ.alignment=nctypealignment(NC_VLEN); - } + ;} break; case 31: - -/* Line 1806 of yacc.c */ #line 362 "ncgen.y" { int i,j; @@ -2013,26 +1989,20 @@ yyreduce: listpush((yyvsp[(2) - (5)].sym)->subnodes,(void*)fsym); } listsetlength(stack,stackbase);/* remove stack nodes*/ - } + ;} break; case 32: - -/* Line 1806 of yacc.c */ #line 394 "ncgen.y" - {(yyval.mark)=(yyvsp[(1) - (2)].mark);} + {(yyval.mark)=(yyvsp[(1) - (2)].mark);;} break; case 33: - -/* Line 1806 of yacc.c */ #line 395 "ncgen.y" - {(yyval.mark)=(yyvsp[(1) - (3)].mark);} + {(yyval.mark)=(yyvsp[(1) - (3)].mark);;} break; case 34: - -/* Line 1806 of yacc.c */ #line 399 "ncgen.y" { int i; @@ -2044,129 +2014,95 @@ yyreduce: Symbol* f = (Symbol*)listget(stack,i); f->typ.basetype = (yyvsp[(1) - (2)].sym); } - } + ;} break; case 35: - -/* Line 1806 of yacc.c */ #line 412 "ncgen.y" - { (yyval.sym) = primsymbols[NC_CHAR]; } + { (yyval.sym) = primsymbols[NC_CHAR]; ;} break; case 36: - -/* Line 1806 of yacc.c */ #line 413 "ncgen.y" - { (yyval.sym) = primsymbols[NC_BYTE]; } + { (yyval.sym) = primsymbols[NC_BYTE]; ;} break; case 37: - -/* Line 1806 of yacc.c */ #line 414 "ncgen.y" - { (yyval.sym) = primsymbols[NC_SHORT]; } + { (yyval.sym) = primsymbols[NC_SHORT]; ;} break; case 38: - -/* Line 1806 of yacc.c */ #line 415 "ncgen.y" - { (yyval.sym) = primsymbols[NC_INT]; } + { (yyval.sym) = primsymbols[NC_INT]; ;} break; case 39: - -/* Line 1806 of yacc.c */ #line 416 "ncgen.y" - { (yyval.sym) = primsymbols[NC_FLOAT]; } + { (yyval.sym) = primsymbols[NC_FLOAT]; ;} break; case 40: - -/* Line 1806 of yacc.c */ #line 417 "ncgen.y" - { (yyval.sym) = primsymbols[NC_DOUBLE]; } + { (yyval.sym) = primsymbols[NC_DOUBLE]; ;} break; case 41: - -/* Line 1806 of yacc.c */ #line 418 "ncgen.y" - { vercheck(NC_UBYTE); (yyval.sym) = primsymbols[NC_UBYTE]; } + { vercheck(NC_UBYTE); (yyval.sym) = primsymbols[NC_UBYTE]; ;} break; case 42: - -/* Line 1806 of yacc.c */ #line 419 "ncgen.y" - { vercheck(NC_USHORT); (yyval.sym) = primsymbols[NC_USHORT]; } + { vercheck(NC_USHORT); (yyval.sym) = primsymbols[NC_USHORT]; ;} break; case 43: - -/* Line 1806 of yacc.c */ #line 420 "ncgen.y" - { vercheck(NC_UINT); (yyval.sym) = primsymbols[NC_UINT]; } + { vercheck(NC_UINT); (yyval.sym) = primsymbols[NC_UINT]; ;} break; case 44: - -/* Line 1806 of yacc.c */ #line 421 "ncgen.y" - { vercheck(NC_INT64); (yyval.sym) = primsymbols[NC_INT64]; } + { vercheck(NC_INT64); (yyval.sym) = primsymbols[NC_INT64]; ;} break; case 45: - -/* Line 1806 of yacc.c */ #line 422 "ncgen.y" - { vercheck(NC_UINT64); (yyval.sym) = primsymbols[NC_UINT64]; } + { vercheck(NC_UINT64); (yyval.sym) = primsymbols[NC_UINT64]; ;} break; case 47: - -/* Line 1806 of yacc.c */ #line 426 "ncgen.y" - {} + {;} break; case 48: - -/* Line 1806 of yacc.c */ #line 427 "ncgen.y" - {} + {;} break; case 51: - -/* Line 1806 of yacc.c */ #line 434 "ncgen.y" - {} + {;} break; case 52: - -/* Line 1806 of yacc.c */ #line 434 "ncgen.y" - {} + {;} break; case 55: - -/* Line 1806 of yacc.c */ #line 442 "ncgen.y" { (yyvsp[(1) - (3)].sym)->dim.declsize = (size_t)uint32_val; #ifdef GENDEBUG1 fprintf(stderr,"dimension: %s = %lu\n",(yyvsp[(1) - (3)].sym)->name,(unsigned long)(yyvsp[(1) - (3)].sym)->dim.declsize); #endif - } + ;} break; case 56: - -/* Line 1806 of yacc.c */ #line 449 "ncgen.y" { if(int32_val <= 0) { @@ -2177,12 +2113,10 @@ fprintf(stderr,"dimension: %s = %lu\n",(yyvsp[(1) - (3)].sym)->name,(unsigned lo #ifdef GENDEBUG1 fprintf(stderr,"dimension: %s = %lu\n",(yyvsp[(1) - (3)].sym)->name,(unsigned long)(yyvsp[(1) - (3)].sym)->dim.declsize); #endif - } + ;} break; case 57: - -/* Line 1806 of yacc.c */ #line 460 "ncgen.y" { /* for rare case where 2^31 < dimsize < 2^32 */ if (double_val <= 0) @@ -2195,12 +2129,10 @@ fprintf(stderr,"dimension: %s = %lu\n",(yyvsp[(1) - (3)].sym)->name,(unsigned lo #ifdef GENDEBUG1 fprintf(stderr,"dimension: %s = %lu\n",(yyvsp[(1) - (3)].sym)->name,(unsigned long)(yyvsp[(1) - (3)].sym)->dim.declsize); #endif - } + ;} break; case 58: - -/* Line 1806 of yacc.c */ #line 473 "ncgen.y" { (yyvsp[(1) - (3)].sym)->dim.declsize = NC_UNLIMITED; @@ -2208,12 +2140,10 @@ fprintf(stderr,"dimension: %s = %lu\n",(yyvsp[(1) - (3)].sym)->name,(unsigned lo #ifdef GENDEBUG1 fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); #endif - } + ;} break; case 59: - -/* Line 1806 of yacc.c */ #line 483 "ncgen.y" { (yyvsp[(1) - (1)].sym)->objectclass=NC_DIM; @@ -2223,40 +2153,30 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); addtogroup((yyvsp[(1) - (1)].sym)); (yyval.sym)=(yyvsp[(1) - (1)].sym); listpush(dimdefs,(void*)(yyvsp[(1) - (1)].sym)); - } + ;} break; case 61: - -/* Line 1806 of yacc.c */ #line 495 "ncgen.y" - {} + {;} break; case 62: - -/* Line 1806 of yacc.c */ #line 496 "ncgen.y" - {} + {;} break; case 65: - -/* Line 1806 of yacc.c */ #line 503 "ncgen.y" - {} + {;} break; case 66: - -/* Line 1806 of yacc.c */ #line 503 "ncgen.y" - {} + {;} break; case 67: - -/* Line 1806 of yacc.c */ #line 506 "ncgen.y" { int i; @@ -2276,28 +2196,22 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); } } listsetlength(stack,stackbase);/* remove stack nodes*/ - } + ;} break; case 68: - -/* Line 1806 of yacc.c */ #line 528 "ncgen.y" {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[(1) - (1)].sym)); - } + ;} break; case 69: - -/* Line 1806 of yacc.c */ #line 532 "ncgen.y" - {(yyval.mark)=(yyvsp[(1) - (3)].mark); listpush(stack,(void*)(yyvsp[(3) - (3)].sym));} + {(yyval.mark)=(yyvsp[(1) - (3)].mark); listpush(stack,(void*)(yyvsp[(3) - (3)].sym));;} break; case 70: - -/* Line 1806 of yacc.c */ #line 536 "ncgen.y" { int i; @@ -2322,40 +2236,30 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); (yyvsp[(1) - (2)].sym)->typ.basetype = NULL; /* not yet known*/ (yyvsp[(1) - (2)].sym)->objectclass=NC_VAR; listsetlength(stack,stackbase);/* remove stack nodes*/ - } + ;} break; case 71: - -/* Line 1806 of yacc.c */ #line 562 "ncgen.y" - {(yyval.mark)=listlength(stack);} + {(yyval.mark)=listlength(stack);;} break; case 72: - -/* Line 1806 of yacc.c */ #line 563 "ncgen.y" - {(yyval.mark)=(yyvsp[(2) - (3)].mark);} + {(yyval.mark)=(yyvsp[(2) - (3)].mark);;} break; case 73: - -/* Line 1806 of yacc.c */ #line 566 "ncgen.y" - {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[(1) - (1)].sym));} + {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[(1) - (1)].sym));;} break; case 74: - -/* Line 1806 of yacc.c */ #line 568 "ncgen.y" - {(yyval.mark)=(yyvsp[(1) - (3)].mark); listpush(stack,(void*)(yyvsp[(3) - (3)].sym));} + {(yyval.mark)=(yyvsp[(1) - (3)].mark); listpush(stack,(void*)(yyvsp[(3) - (3)].sym));;} break; case 75: - -/* Line 1806 of yacc.c */ #line 572 "ncgen.y" {Symbol* dimsym = (yyvsp[(1) - (1)].sym); dimsym->objectclass = NC_DIM; @@ -2366,28 +2270,22 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); YYABORT; } (yyval.sym)=dimsym; - } + ;} break; case 76: - -/* Line 1806 of yacc.c */ #line 586 "ncgen.y" {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[(1) - (1)].sym)); - } + ;} break; case 77: - -/* Line 1806 of yacc.c */ #line 590 "ncgen.y" - {(yyval.mark)=(yyvsp[(1) - (3)].mark); listpush(stack,(void*)(yyvsp[(3) - (3)].sym));} + {(yyval.mark)=(yyvsp[(1) - (3)].mark); listpush(stack,(void*)(yyvsp[(3) - (3)].sym));;} break; case 78: - -/* Line 1806 of yacc.c */ #line 595 "ncgen.y" { int i; @@ -2414,40 +2312,30 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); (yyvsp[(1) - (2)].sym)->subclass=NC_FIELD; listsetlength(stack,stackbase);/* remove stack nodes*/ (yyval.sym) = (yyvsp[(1) - (2)].sym); - } + ;} break; case 79: - -/* Line 1806 of yacc.c */ #line 623 "ncgen.y" - {(yyval.mark)=listlength(stack);} + {(yyval.mark)=listlength(stack);;} break; case 80: - -/* Line 1806 of yacc.c */ #line 624 "ncgen.y" - {(yyval.mark)=(yyvsp[(2) - (3)].mark);} + {(yyval.mark)=(yyvsp[(2) - (3)].mark);;} break; case 81: - -/* Line 1806 of yacc.c */ #line 628 "ncgen.y" - {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[(1) - (1)].sym));} + {(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[(1) - (1)].sym));;} break; case 82: - -/* Line 1806 of yacc.c */ #line 630 "ncgen.y" - {(yyval.mark)=(yyvsp[(1) - (3)].mark); listpush(stack,(void*)(yyvsp[(3) - (3)].sym));} + {(yyval.mark)=(yyvsp[(1) - (3)].mark); listpush(stack,(void*)(yyvsp[(3) - (3)].sym));;} break; case 83: - -/* Line 1806 of yacc.c */ #line 635 "ncgen.y" { /* Anonymous integer dimension. Can only occur in type definitions*/ @@ -2457,12 +2345,10 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); (yyval.sym)->objectclass = NC_DIM; (yyval.sym)->dim.isconstant = 1; (yyval.sym)->dim.declsize = uint32_val; - } + ;} break; case 84: - -/* Line 1806 of yacc.c */ #line 645 "ncgen.y" { /* Anonymous integer dimension. Can only occur in type definitions*/ @@ -2476,12 +2362,10 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); (yyval.sym)->objectclass = NC_DIM; (yyval.sym)->dim.isconstant = 1; (yyval.sym)->dim.declsize = int32_val; - } + ;} break; case 85: - -/* Line 1806 of yacc.c */ #line 665 "ncgen.y" {Symbol* vsym = (yyvsp[(1) - (1)].sym); if(vsym->objectclass != NC_VAR) { @@ -2489,12 +2373,10 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); YYABORT; } (yyval.sym)=vsym; - } + ;} break; case 86: - -/* Line 1806 of yacc.c */ #line 676 "ncgen.y" {Symbol* tsym = (yyvsp[(1) - (1)].sym); if(tsym->objectclass != NC_TYPE) { @@ -2502,12 +2384,10 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); YYABORT; } (yyval.sym)=tsym; - } + ;} break; case 87: - -/* Line 1806 of yacc.c */ #line 687 "ncgen.y" {Symbol* tvsym = (yyvsp[(1) - (1)].sym); Symbol* sym; /* disambiguate*/ @@ -2526,40 +2406,30 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); YYABORT; } (yyval.sym)=tvsym; - } + ;} break; case 88: - -/* Line 1806 of yacc.c */ #line 705 "ncgen.y" - {(yyval.sym)=(yyvsp[(1) - (1)].sym);} + {(yyval.sym)=(yyvsp[(1) - (1)].sym);;} break; case 89: - -/* Line 1806 of yacc.c */ #line 712 "ncgen.y" - {} + {;} break; case 90: - -/* Line 1806 of yacc.c */ #line 712 "ncgen.y" - {} + {;} break; case 91: - -/* Line 1806 of yacc.c */ #line 716 "ncgen.y" - { (yyval.sym)=makeattribute((yyvsp[(2) - (4)].sym),NULL,NULL,(yyvsp[(4) - (4)].datalist),ATTRGLOBAL);} + { (yyval.sym)=makeattribute((yyvsp[(2) - (4)].sym),NULL,NULL,(yyvsp[(4) - (4)].datalist),ATTRGLOBAL);;} break; case 92: - -/* Line 1806 of yacc.c */ #line 718 "ncgen.y" {Symbol* tsym = (yyvsp[(1) - (6)].sym); Symbol* vsym = (yyvsp[(2) - (6)].sym); Symbol* asym = (yyvsp[(4) - (6)].sym); if(vsym->objectclass == NC_VAR) { @@ -2568,12 +2438,10 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); derror("Doubly typed attribute: %s",asym->name); YYABORT; } - } + ;} break; case 93: - -/* Line 1806 of yacc.c */ #line 727 "ncgen.y" {Symbol* sym = (yyvsp[(1) - (5)].sym); Symbol* asym = (yyvsp[(3) - (5)].sym); if(sym->objectclass == NC_VAR) { @@ -2584,407 +2452,289 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); derror("Attribute prefix not a variable or type: %s",asym->name); YYABORT; } - } + ;} break; case 94: - -/* Line 1806 of yacc.c */ #line 738 "ncgen.y" - {(yyval.sym) = makespecial(_FILLVALUE_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)(yyvsp[(5) - (5)].datalist),0);} + {(yyval.sym) = makespecial(_FILLVALUE_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)(yyvsp[(5) - (5)].datalist),0);;} break; case 95: - -/* Line 1806 of yacc.c */ #line 740 "ncgen.y" - {(yyval.sym) = makespecial(_FILLVALUE_FLAG,(yyvsp[(2) - (6)].sym),(yyvsp[(1) - (6)].sym),(void*)(yyvsp[(6) - (6)].datalist),0);} + {(yyval.sym) = makespecial(_FILLVALUE_FLAG,(yyvsp[(2) - (6)].sym),(yyvsp[(1) - (6)].sym),(void*)(yyvsp[(6) - (6)].datalist),0);;} break; case 96: - -/* Line 1806 of yacc.c */ #line 742 "ncgen.y" - {(yyval.sym) = makespecial(_STORAGE_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);} + {(yyval.sym) = makespecial(_STORAGE_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);;} break; case 97: - -/* Line 1806 of yacc.c */ #line 744 "ncgen.y" - {(yyval.sym) = makespecial(_CHUNKSIZES_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)(yyvsp[(5) - (5)].datalist),0);} + {(yyval.sym) = makespecial(_CHUNKSIZES_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)(yyvsp[(5) - (5)].datalist),0);;} break; case 98: - -/* Line 1806 of yacc.c */ #line 746 "ncgen.y" - {(yyval.sym) = makespecial(_FLETCHER32_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);} + {(yyval.sym) = makespecial(_FLETCHER32_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);;} break; case 99: - -/* Line 1806 of yacc.c */ #line 748 "ncgen.y" - {(yyval.sym) = makespecial(_DEFLATE_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);} + {(yyval.sym) = makespecial(_DEFLATE_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);;} break; case 100: - -/* Line 1806 of yacc.c */ #line 750 "ncgen.y" - {(yyval.sym) = makespecial(_SHUFFLE_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);} + {(yyval.sym) = makespecial(_SHUFFLE_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);;} break; case 101: - -/* Line 1806 of yacc.c */ #line 752 "ncgen.y" - {(yyval.sym) = makespecial(_ENDIAN_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);} + {(yyval.sym) = makespecial(_ENDIAN_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);;} break; case 102: - -/* Line 1806 of yacc.c */ #line 754 "ncgen.y" - {(yyval.sym) = makespecial(_NOFILL_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);} + {(yyval.sym) = makespecial(_NOFILL_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);;} break; case 103: - -/* Line 1806 of yacc.c */ #line 756 "ncgen.y" - {(yyval.sym) = makespecial(_FORMAT_FLAG,NULL,NULL,(void*)&(yyvsp[(4) - (4)].constant),1);} + {(yyval.sym) = makespecial(_FORMAT_FLAG,NULL,NULL,(void*)&(yyvsp[(4) - (4)].constant),1);;} break; case 104: - -/* Line 1806 of yacc.c */ #line 761 "ncgen.y" { (yyval.sym)=(yyvsp[(1) - (1)].sym); (yyvsp[(1) - (1)].sym)->ref.is_ref=1; (yyvsp[(1) - (1)].sym)->is_prefixed=0; setpathcurrent((yyvsp[(1) - (1)].sym)); - } + ;} break; case 105: - -/* Line 1806 of yacc.c */ #line 768 "ncgen.y" { (yyval.sym)=(yyvsp[(1) - (1)].sym); (yyvsp[(1) - (1)].sym)->ref.is_ref=1; (yyvsp[(1) - (1)].sym)->is_prefixed=1; /* path is set in ncgen.l*/ - } + ;} break; case 107: - -/* Line 1806 of yacc.c */ #line 777 "ncgen.y" - {} + {;} break; case 108: - -/* Line 1806 of yacc.c */ #line 778 "ncgen.y" - {} + {;} break; case 111: - -/* Line 1806 of yacc.c */ #line 786 "ncgen.y" - {(yyvsp[(1) - (3)].sym)->data = (yyvsp[(3) - (3)].datalist);} + {(yyvsp[(1) - (3)].sym)->data = (yyvsp[(3) - (3)].datalist);;} break; case 112: - -/* Line 1806 of yacc.c */ #line 789 "ncgen.y" - {(yyval.datalist) = (yyvsp[(1) - (1)].datalist);} + {(yyval.datalist) = (yyvsp[(1) - (1)].datalist);;} break; case 113: - -/* Line 1806 of yacc.c */ #line 790 "ncgen.y" - {(yyval.datalist) = (yyvsp[(1) - (1)].datalist);} + {(yyval.datalist) = (yyvsp[(1) - (1)].datalist);;} break; case 114: - -/* Line 1806 of yacc.c */ #line 794 "ncgen.y" - {(yyval.datalist) = builddatalist(0);} + {(yyval.datalist) = builddatalist(0);;} break; case 115: - -/* Line 1806 of yacc.c */ #line 798 "ncgen.y" - {(yyval.datalist) = builddatalist(0); datalistextend((yyval.datalist),&((yyvsp[(1) - (1)].constant)));} + {(yyval.datalist) = builddatalist(0); datalistextend((yyval.datalist),&((yyvsp[(1) - (1)].constant)));;} break; case 116: - -/* Line 1806 of yacc.c */ #line 800 "ncgen.y" - {datalistextend((yyvsp[(1) - (3)].datalist),&((yyvsp[(3) - (3)].constant))); (yyval.datalist)=(yyvsp[(1) - (3)].datalist);} + {datalistextend((yyvsp[(1) - (3)].datalist),&((yyvsp[(3) - (3)].constant))); (yyval.datalist)=(yyvsp[(1) - (3)].datalist);;} break; case 117: - -/* Line 1806 of yacc.c */ #line 804 "ncgen.y" - {(yyval.constant)=(yyvsp[(1) - (1)].constant);} + {(yyval.constant)=(yyvsp[(1) - (1)].constant);;} break; case 118: - -/* Line 1806 of yacc.c */ #line 805 "ncgen.y" - {(yyval.constant)=builddatasublist((yyvsp[(2) - (3)].datalist));} + {(yyval.constant)=builddatasublist((yyvsp[(2) - (3)].datalist));;} break; case 119: - -/* Line 1806 of yacc.c */ #line 809 "ncgen.y" - {(yyval.constant)=(yyvsp[(1) - (1)].constant);} + {(yyval.constant)=(yyvsp[(1) - (1)].constant);;} break; case 120: - -/* Line 1806 of yacc.c */ #line 810 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_OPAQUE);} + {(yyval.constant)=makeconstdata(NC_OPAQUE);;} break; case 121: - -/* Line 1806 of yacc.c */ #line 811 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_FILLVALUE);} + {(yyval.constant)=makeconstdata(NC_FILLVALUE);;} break; case 122: - -/* Line 1806 of yacc.c */ #line 812 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_NIL);} + {(yyval.constant)=makeconstdata(NC_NIL);;} break; case 123: - -/* Line 1806 of yacc.c */ #line 813 "ncgen.y" - {(yyval.constant)=(yyvsp[(1) - (1)].constant);} + {(yyval.constant)=(yyvsp[(1) - (1)].constant);;} break; case 125: - -/* Line 1806 of yacc.c */ #line 818 "ncgen.y" - {(yyval.constant) = makeenumconstref((yyvsp[(1) - (1)].sym));} + {(yyval.constant) = makeenumconstref((yyvsp[(1) - (1)].sym));;} break; case 126: - -/* Line 1806 of yacc.c */ #line 822 "ncgen.y" - {(yyval.constant)=evaluate((yyvsp[(1) - (4)].sym),(yyvsp[(3) - (4)].datalist));} + {(yyval.constant)=evaluate((yyvsp[(1) - (4)].sym),(yyvsp[(3) - (4)].datalist));;} break; case 127: - -/* Line 1806 of yacc.c */ #line 827 "ncgen.y" - {(yyval.datalist) = builddatalist(0); datalistextend((yyval.datalist),&((yyvsp[(1) - (1)].constant)));} + {(yyval.datalist) = builddatalist(0); datalistextend((yyval.datalist),&((yyvsp[(1) - (1)].constant)));;} break; case 128: - -/* Line 1806 of yacc.c */ #line 829 "ncgen.y" - {datalistextend((yyvsp[(1) - (3)].datalist),&((yyvsp[(3) - (3)].constant))); (yyval.datalist)=(yyvsp[(1) - (3)].datalist);} + {datalistextend((yyvsp[(1) - (3)].datalist),&((yyvsp[(3) - (3)].constant))); (yyval.datalist)=(yyvsp[(1) - (3)].datalist);;} break; case 129: - -/* Line 1806 of yacc.c */ #line 833 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_CHAR);} + {(yyval.constant)=makeconstdata(NC_CHAR);;} break; case 130: - -/* Line 1806 of yacc.c */ #line 834 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_BYTE);} + {(yyval.constant)=makeconstdata(NC_BYTE);;} break; case 131: - -/* Line 1806 of yacc.c */ #line 835 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_SHORT);} + {(yyval.constant)=makeconstdata(NC_SHORT);;} break; case 132: - -/* Line 1806 of yacc.c */ #line 836 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_INT);} + {(yyval.constant)=makeconstdata(NC_INT);;} break; case 133: - -/* Line 1806 of yacc.c */ #line 837 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_INT64);} + {(yyval.constant)=makeconstdata(NC_INT64);;} break; case 134: - -/* Line 1806 of yacc.c */ #line 838 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_UBYTE);} + {(yyval.constant)=makeconstdata(NC_UBYTE);;} break; case 135: - -/* Line 1806 of yacc.c */ #line 839 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_USHORT);} + {(yyval.constant)=makeconstdata(NC_USHORT);;} break; case 136: - -/* Line 1806 of yacc.c */ #line 840 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_UINT);} + {(yyval.constant)=makeconstdata(NC_UINT);;} break; case 137: - -/* Line 1806 of yacc.c */ #line 841 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_UINT64);} + {(yyval.constant)=makeconstdata(NC_UINT64);;} break; case 138: - -/* Line 1806 of yacc.c */ #line 842 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_FLOAT);} + {(yyval.constant)=makeconstdata(NC_FLOAT);;} break; case 139: - -/* Line 1806 of yacc.c */ #line 843 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_DOUBLE);} + {(yyval.constant)=makeconstdata(NC_DOUBLE);;} break; case 140: - -/* Line 1806 of yacc.c */ #line 844 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_STRING);} + {(yyval.constant)=makeconstdata(NC_STRING);;} break; case 141: - -/* Line 1806 of yacc.c */ #line 848 "ncgen.y" - {(yyval.datalist) = builddatalist(0); datalistextend((yyval.datalist),&((yyvsp[(1) - (1)].constant)));} + {(yyval.datalist) = builddatalist(0); datalistextend((yyval.datalist),&((yyvsp[(1) - (1)].constant)));;} break; case 142: - -/* Line 1806 of yacc.c */ #line 849 "ncgen.y" - {(yyval.datalist)=(yyvsp[(1) - (3)].datalist); datalistextend((yyvsp[(1) - (3)].datalist),&((yyvsp[(3) - (3)].constant)));} + {(yyval.datalist)=(yyvsp[(1) - (3)].datalist); datalistextend((yyvsp[(1) - (3)].datalist),&((yyvsp[(3) - (3)].constant)));;} break; case 143: - -/* Line 1806 of yacc.c */ #line 854 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_INT);} + {(yyval.constant)=makeconstdata(NC_INT);;} break; case 144: - -/* Line 1806 of yacc.c */ #line 856 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_UINT);} + {(yyval.constant)=makeconstdata(NC_UINT);;} break; case 145: - -/* Line 1806 of yacc.c */ #line 858 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_INT64);} + {(yyval.constant)=makeconstdata(NC_INT64);;} break; case 146: - -/* Line 1806 of yacc.c */ #line 860 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_UINT64);} + {(yyval.constant)=makeconstdata(NC_UINT64);;} break; case 147: - -/* Line 1806 of yacc.c */ #line 864 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_STRING);} + {(yyval.constant)=makeconstdata(NC_STRING);;} break; case 148: - -/* Line 1806 of yacc.c */ #line 868 "ncgen.y" - {(yyval.constant)=(yyvsp[(1) - (1)].constant);} + {(yyval.constant)=(yyvsp[(1) - (1)].constant);;} break; case 149: - -/* Line 1806 of yacc.c */ #line 869 "ncgen.y" - {(yyval.constant)=(yyvsp[(1) - (1)].constant);} + {(yyval.constant)=(yyvsp[(1) - (1)].constant);;} break; case 150: - -/* Line 1806 of yacc.c */ #line 875 "ncgen.y" - {(yyval.sym)=(yyvsp[(1) - (1)].sym);} + {(yyval.sym)=(yyvsp[(1) - (1)].sym);;} break; - -/* Line 1806 of yacc.c */ -#line 2975 "ncgeny.c" +/* Line 1267 of yacc.c. */ +#line 2736 "ncgen.tab.c" default: break; } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); @@ -2993,6 +2743,7 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); *++yyvsp = yyval; + /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -3012,10 +2763,6 @@ fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[(1) - (3)].sym)->name); | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { @@ -3023,36 +2770,37 @@ yyerrlab: #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } } -# undef YYSYNTAX_ERROR #endif } @@ -3060,7 +2808,7 @@ yyerrlab: if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an + /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) @@ -3077,7 +2825,7 @@ yyerrlab: } } - /* Else will try to reuse lookahead token after shifting the error + /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; @@ -3111,7 +2859,7 @@ yyerrlab1: for (;;) { yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) + if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) @@ -3134,6 +2882,9 @@ yyerrlab1: YY_STACK_PRINT (yyss, yyssp); } + if (yyn == YYFINAL) + YYACCEPT; + *++yyvsp = yylval; @@ -3158,7 +2909,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#if !defined(yyoverflow) || YYERROR_VERBOSE +#ifndef yyoverflow /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -3169,14 +2920,9 @@ yyexhaustedlab: #endif yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - } + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -3200,8 +2946,6 @@ yyreturn: } - -/* Line 2067 of yacc.c */ #line 878 "ncgen.y" diff --git a/ncgen/ncgeny.h b/ncgen/ncgeny.h index c3d83a86c..9d2e192aa 100644 --- a/ncgen/ncgeny.h +++ b/ncgen/ncgeny.h @@ -1,21 +1,24 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - + the Free Software Foundation; either version 2, or (at your option) + any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 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 . */ + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -26,11 +29,10 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ - /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -87,33 +89,77 @@ DATASETID = 305 }; #endif +/* Tokens. */ +#define NC_UNLIMITED_K 258 +#define CHAR_K 259 +#define BYTE_K 260 +#define SHORT_K 261 +#define INT_K 262 +#define FLOAT_K 263 +#define DOUBLE_K 264 +#define UBYTE_K 265 +#define USHORT_K 266 +#define UINT_K 267 +#define INT64_K 268 +#define UINT64_K 269 +#define IDENT 270 +#define TERMSTRING 271 +#define CHAR_CONST 272 +#define BYTE_CONST 273 +#define SHORT_CONST 274 +#define INT_CONST 275 +#define INT64_CONST 276 +#define UBYTE_CONST 277 +#define USHORT_CONST 278 +#define UINT_CONST 279 +#define UINT64_CONST 280 +#define FLOAT_CONST 281 +#define DOUBLE_CONST 282 +#define DIMENSIONS 283 +#define VARIABLES 284 +#define NETCDF 285 +#define DATA 286 +#define TYPES 287 +#define COMPOUND 288 +#define ENUM 289 +#define OPAQUE 290 +#define OPAQUESTRING 291 +#define GROUP 292 +#define PATH 293 +#define FILLMARKER 294 +#define NIL 295 +#define _FILLVALUE 296 +#define _FORMAT 297 +#define _STORAGE 298 +#define _CHUNKSIZES 299 +#define _DEFLATELEVEL 300 +#define _SHUFFLE 301 +#define _ENDIANNESS 302 +#define _NOFILL 303 +#define _FLETCHER32 304 +#define DATASETID 305 + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -{ - -/* Line 2068 of yacc.c */ #line 131 "ncgen.y" - +{ Symbol* sym; unsigned long size; /* allow for zero size to indicate e.g. UNLIMITED*/ long mark; /* track indices into the sequence*/ int nctype; /* for tracking attribute list type*/ Datalist* datalist; NCConstant constant; - - - -/* Line 2068 of yacc.c */ -#line 111 "ncgeny.h" -} YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 +} +/* Line 1529 of yacc.c. */ +#line 158 "ncgen.tab.h" + YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE ncglval; - From fce30a0d32867c37b9ffb0c55010c591493906a1 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Thu, 26 Nov 2015 17:47:30 -0600 Subject: [PATCH 39/39] Updated ncgenl.c --- ncgen/ncgen.l | 4 +--- ncgen/ncgenl.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/ncgen/ncgen.l b/ncgen/ncgen.l index da82caa29..689c1ec32 100644 --- a/ncgen/ncgen.l +++ b/ncgen/ncgen.l @@ -817,7 +817,6 @@ collecttag(char* text, char** stagp) char* stag0; #define MAXTAGLEN 3 char stag[MAXTAGLEN+1]; - char stagtmp[MAXTAGLEN+1]; int slen = strlen(text); int staglen; int tag = NC_NAT; @@ -836,8 +835,7 @@ collecttag(char* text, char** stagp) stag[MAXTAGLEN] = '\0'; if(stag[0] == 'U' || stag[0] == 'u') { hasU = 1; - strncpy(stagtmp,stag+1,MAXTAGLEN+1); - strncpy(stag,stagtmp,MAXTAGLEN+1); + memmove(stag,stag+1,MAXTAGLEN); staglen--; } else if(stag[staglen-1] == 'U' || stag[staglen-1] == 'u') { hasU = 1; diff --git a/ncgen/ncgenl.c b/ncgen/ncgenl.c index d8a64cd4f..3b8187a72 100644 --- a/ncgen/ncgenl.c +++ b/ncgen/ncgenl.c @@ -3312,7 +3312,6 @@ collecttag(char* text, char** stagp) char* stag0; #define MAXTAGLEN 3 char stag[MAXTAGLEN+1]; - char stagtmp[MAXTAGLEN+1]; int slen = strlen(text); int staglen; int tag = NC_NAT; @@ -3331,8 +3330,7 @@ collecttag(char* text, char** stagp) stag[MAXTAGLEN] = '\0'; if(stag[0] == 'U' || stag[0] == 'u') { hasU = 1; - strncpy(stagtmp,stag+1,MAXTAGLEN+1); - strncpy(stag,stagtmp,MAXTAGLEN+1); + memmove(stag,stag+1,MAXTAGLEN); staglen--; } else if(stag[staglen-1] == 'U' || stag[staglen-1] == 'u') { hasU = 1;