From 16dee702b74aac9c4df1f2c9cd7846259a25fec9 Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Thu, 15 Sep 2011 16:57:16 +0000 Subject: [PATCH] fix NCF-120 --- cf | 2 +- configure.ac | 5 +- libcdmr/ast_runtime.h | 2 +- libdap2/cache.c | 2 + libdap2/cdf3.c | 103 ++- libdap2/constraints3.c | 23 +- libdap2/constraints3.h | 2 +- libdap2/daputil.c | 15 +- libdap2/dceconstraints.c | 1 + libdap2/dceparse.c | 1 + libdap2/env | 7 +- libdap2/nccommon.h | 12 +- libdap2/ncdap3.c | 10 +- libdap2/ncdap3.h | 7 +- libdap2/ncdap3a.c | 41 +- libdap2/ncdap4.c | 8 +- libdispatch/Makefile.am | 5 +- libdispatch/defcheck.c | 2 +- libdispatch/{dncbytes.c => ncbytes.c} | 0 libdispatch/{dnchashmap.c => nchashmap.c} | 0 libdispatch/{dnclist.c => nclist.c} | 0 nc_test4/tst_files5.c | 2 +- nc_test4/tst_files6.c | 2 +- ncdap_test/test_varm3.c | 5 +- ncdap_test/tst_ncdap_shared.sh | 2 +- ncdap_test/tst_remote.sh | 10 +- ncgen/ncgen.y | 113 ++- ncgen/ncgentab.c | 794 +++++++++++--------- oc/daptab.c | 841 ++++++++++------------ oc/daptab.h | 7 +- oc/ocuri.h | 3 +- 31 files changed, 1190 insertions(+), 837 deletions(-) rename libdispatch/{dncbytes.c => ncbytes.c} (100%) rename libdispatch/{dnchashmap.c => nchashmap.c} (100%) rename libdispatch/{dnclist.c => nclist.c} (100%) diff --git a/cf b/cf index 81b188ff3..2082af784 100644 --- a/cf +++ b/cf @@ -15,7 +15,7 @@ DAP=1 #cmds="all" #cmds="all check" #cmds="all dist" -cmds="all distcheck" +#cmds="all distcheck" PREFIX="/tmp/install/${HOST}" stddir="/share/ed/local/${HOST}" diff --git a/configure.ac b/configure.ac index 583e58401..7d0c5503f 100644 --- a/configure.ac +++ b/configure.ac @@ -60,7 +60,7 @@ AM_CONDITIONAL([BUILD_DOCS], [test "x$enable_doxygen" != xno]) AC_ARG_ENABLE([internal-docs], [AS_HELP_STRING([--enable-internal-docs], [Include documentation of library internals. This is of interest only to those developing the netCDF library.])]) -test $enable_internal_docs = yes || enable_internal_docs=no +test "x$enable_internal_docs" = xyes || enable_internal_docs=no AC_SUBST([BUILD_INTERNAL_DOCS], [$enable_internal_docs]) AC_MSG_CHECKING([if fsync support is enabled]) @@ -566,6 +566,9 @@ AC_FUNC_VPRINTF # Check for that conforms to C99 requirements AC_HEADER_STDBOOL +AC_CHECK_FUNCS([mktime]) +AC_CHECK_FUNCS([strptime]) + # Check for these functions... AC_CHECK_FUNCS([strlcat strerror snprintf strchr strrchr mktemp strcat strcpy strdup \ strcasecmp strtod strtoll strtoull getrlimit gettimeofday fsync MPI_Comm_f2c]) diff --git a/libcdmr/ast_runtime.h b/libcdmr/ast_runtime.h index 74ca4724c..b7bdc8845 100644 --- a/libcdmr/ast_runtime.h +++ b/libcdmr/ast_runtime.h @@ -19,7 +19,7 @@ typedef long long int64_t; #define true 1 #define false 0 #define TRUE 1 -#define FALSE 1 +#define FALSE 0 #endif typedef unsigned int bool_t; diff --git a/libdap2/cache.c b/libdap2/cache.c index b1b2c6e3b..2acbc01d6 100644 --- a/libdap2/cache.c +++ b/libdap2/cache.c @@ -137,6 +137,7 @@ nclog(NCLOGNOTE,"prefetch."); } #ifdef DEBUG +{ /* Log the set of prefetch variables */ NCbytes* buf = ncbytesnew(); ncbytescat(buf,"prefetch.vars: "); @@ -148,6 +149,7 @@ ncbytescat(buf,makesimplepathstring3(var)); ncbytescat(buf,"\n"); nclog(NCLOGNOTE,"%s",ncbytescontents(buf)); ncbytesfree(buf); +} #endif /* Make cache node be the prefetch node */ diff --git a/libdap2/cdf3.c b/libdap2/cdf3.c index 7335025fc..176ecec0e 100644 --- a/libdap2/cdf3.c +++ b/libdap2/cdf3.c @@ -26,11 +26,16 @@ static NCerror testregrid3(CDFnode* node, CDFnode* template, NClist*); static CDFnode* makenewstruct3(CDFnode* node, CDFnode* template); static NCerror regridinsert(CDFnode* newgrid, CDFnode* node); static NCerror regridremove(CDFnode* newgrid, CDFnode* node); -static NCerror imprint3r(CDFnode*, CDFnode*, int depth); -static NCerror imprintdims3(CDFnode*, CDFnode*); static void projection3r(CDFnode*); static void unprojected3(NClist* nodes); static void projectall3(NClist* nodes); +#ifdef DDSNEW +static NCerror mapnodes3r(CDFnode*, CDFnode*, int depth); +static NCerror mapdims3(CDFnode*, CDFnode*); +#else +static NCerror imprint3r(CDFnode*, CDFnode*, int depth); +static NCerror imprintdims3(CDFnode*, CDFnode*); +#endif /* Accumulate useful node sets */ NCerror @@ -395,6 +400,9 @@ fprintf(stderr,"regrid: template=%s\n",dumptree(template)); This includes containers and subnodes. If there are no projections then mark all nodes */ +#ifdef DDSNEW + projectall3(template->tree->nodes); +#else if(nclistlength(projections) == 0) { projectall3(template->tree->nodes); } else for(i=0;idiscrim == CES_VAR); projection3r(proj->var->cdfleaf); } +#endif if(simplenodematch34(ddsroot,template)) { ncstat = regrid3r(ddsroot,template,newstructs); @@ -655,6 +664,95 @@ findddsnode0(CDFnode* node) } #endif +#ifdef DDSNEW +/** + +Make the constrained dds nodes (root) +point to the corresponding unconstrained +dds nodes (fullroot) + */ + +NCerror +mapnodes3(CDFnode* root, CDFnode* fullroot) +{ + NCerror ncstat = NC_NOERR; + ASSERT(root != NULL && fullroot != NULL); + if(!simplenodematch34(root,fullroot)) + {THROWCHK(ncstat=NC_EINVAL); goto done;} + /* clear out old associations*/ + unmap3(root); + ncstat = mapnodes3r(root,fullroot,0); +done: + return ncstat; +} + +static NCerror +mapnodes3r(CDFnode* connode, CDFnode* fullnode, int depth) +{ + unsigned int i,j; + NCerror ncstat = NC_NOERR; + + ASSERT((simplenodematch34(connode,fullnode))); + + /* Map node */ + connode->basenode = fullnode; + connode->visible = 1; +#ifdef DEBUG +fprintf(stderr,"mapnode: %s\n",makecdfpathstring3(connode,".")); +#endif + + /* Do dimension imprinting */ + ASSERT((nclistlength(connode->array.dimensions) == nclistlength(fullnode->array.dimensions))); + if(nclistlength(connode->array.dimensions) > 0) { + ncstat = mapdims3(connode,fullnode); + if(ncstat) goto done; + } + + /* Try to match connode subnodes against fullnode subnodes */ + ASSERT(nclistlength(connode->subnodes) <= nclistlength(fullnode->subnodes)); + + for(i=0;isubnodes);i++) { + CDFnode* consubnode = (CDFnode*)nclistget(connode->subnodes,i); + /* Search full subnodes for a matching subnode from con */ + for(j=0;jsubnodes);j++) { + CDFnode* fullsubnode = (CDFnode*)nclistget(fullnode->subnodes,j); + if(simplenodematch34(fullsubnode,consubnode)) { + ncstat = mapnodes3r(consubnode,fullsubnode,depth+1); + if(ncstat) goto done; + } + } + } +done: + return THROW(ncstat); +} + +void +unmap3(CDFnode* root) +{ + unsigned int i; + CDFtree* tree = root->tree; + for(i=0;inodes);i++) { + CDFnode* node = (CDFnode*)nclistget(tree->nodes,i); + node->basenode = NULL; + node->visible = 0; + } +} + +static NCerror +mapdims3(CDFnode* connode, CDFnode* fullnode) +{ + unsigned int i; + for(i=0;iarray.dimensions);i++) { + CDFnode* cdim = (CDFnode*)nclistget(connode->array.dimensions,i); + CDFnode* fdim = (CDFnode*)nclistget(fullnode->array.dimensions,i); + cdim->basenode = fdim; + cdim->visible = 1; + } + return NC_NOERR; +} + +#else /*!DDSNEW*/ + /* Move data from nodes in src tree to nodes in dst tree where the nodes match. Src tree is typically a structural subset @@ -741,6 +839,7 @@ unimprint3(CDFnode* root) } } } +#endif /*!DDSNEW*/ void setvisible(CDFnode* root, int visible) diff --git a/libdap2/constraints3.c b/libdap2/constraints3.c index 3c295da30..5d3a94c4d 100755 --- a/libdap2/constraints3.c +++ b/libdap2/constraints3.c @@ -59,22 +59,22 @@ fprintf(stderr,"constraint: %s",dumpconstraint(dceconstraint)); return ncstat; } -/* Map constrain paths to a CDFnode path; the difficulty +/* Map constraint paths to CDFnode paths in specied tree; the difficulty is that suffix paths are legal. */ NCerror -mapconstraints3(NCDAPCOMMON* dapcomm) +mapconstraints3(DCEconstraint* constraint, + CDFnode* root) { int i; NCerror ncstat = NC_NOERR; - CDFnode* root = dapcomm->cdf.ddsroot; NClist* nodes = root->tree->nodes; NClist* dceprojections; NClist* dceselections; - dceprojections = dapcomm->oc.dapconstraint->projections; - dceselections = dapcomm->oc.dapconstraint->selections; + dceprojections = constraint->projections; + dceselections = constraint->selections; /* Convert the projection paths to leaves in the dds tree */ for(i=0;ioc.dapconstraint); + ncstat = qualifyconstraints3(constraint); if(ncstat != NC_NOERR) goto done; #ifdef DEBUG @@ -290,7 +290,7 @@ matchsuffix3(NClist* matchpath, NClist* segments, int index0) DCEsegment* seg = (DCEsegment*)nclistget(segments,i); CDFnode* node = (CDFnode*)nclistget(matchpath,index0+i); int match; - int rank = nclistlength(seg->slices); + int rank = seg->rank; /* Do the names match */ if(strcmp(seg->name,node->name) != 0) return 0; /* no match */ /* Do the ranks match (watch out for sequences) */ @@ -322,12 +322,13 @@ matchpartialname3(NClist* nodes, NClist* segments, CDFnode** nodep) lastseg = (DCEsegment*)nclistget(segments,nsegs-1); for(i=0;iname,lastseg->name) != 0) + continue; if(node->nctype != NC_Sequence && node->nctype != NC_Structure && node->nctype != NC_Grid && node->nctype != NC_Primitive ) continue; - if(strcmp(node->name,lastseg->name) != 0) continue; nclistpush(namematches,(ncelem)node); } if(nclistlength(namematches)==0) { @@ -486,11 +487,12 @@ fprintf(stderr,"restriction.before=|%s|\n", (like a complete grid) */ nodeset = unifyprojectionnodes3(varlist); for(i=0;incfullname); #endif - DCEprojection* newp = (DCEprojection*)dcecreate(CES_PROJECT); + newp = (DCEprojection*)dcecreate(CES_PROJECT); newp->discrim = CES_VAR; newp->var = (DCEvar*)dcecreate(CES_VAR); @@ -888,7 +890,6 @@ buildvaraprojection3(Getvara* getvar, int ncrank; NCerror ncstat = NC_NOERR; CDFnode* var = getvar->target; - NClist* vardims = var->array.dimensions; DCEprojection* projection = NULL; NClist* path = nclistnew(); NClist* segments = NULL; @@ -930,7 +931,7 @@ buildvaraprojection3(Getvara* getvar, segment->rank = localrank; for(j=0;jslices[j]; - CDFnode* dim = (CDFnode*)nclistget(vardims,dimindex+j); + CDFnode* dim = (CDFnode*)nclistget(dimset,dimindex+j); /* make each slice represent the corresponding start/count/stride */ slice->first = startp[dimindex+j]; diff --git a/libdap2/constraints3.h b/libdap2/constraints3.h index 69bd0c01f..17ab9d813 100644 --- a/libdap2/constraints3.h +++ b/libdap2/constraints3.h @@ -7,7 +7,7 @@ #define CONSTRAINTS3_H 1 extern NCerror parsedapconstraints(NCDAPCOMMON*, char*, DCEconstraint*); -extern NCerror mapconstraints3(NCDAPCOMMON*); +extern NCerror mapconstraints3(DCEconstraint*,CDFnode*); extern char* simplepathstring(NClist* segments, char* separator); extern void makesegmentstring3(NClist* segments, NCbytes* buf, char* separator); diff --git a/libdap2/daputil.c b/libdap2/daputil.c index 59e233891..d3f9ce8e1 100644 --- a/libdap2/daputil.c +++ b/libdap2/daputil.c @@ -962,15 +962,18 @@ dap_oc_fetch(NCDAPCOMMON* nccomm, OCconnection conn, const char* ce, { OCerror ocstat; char* ext; - if(dxd == OCDDS) ext = "dds"; - else if(dxd == OCDAS) ext = "das"; - else ext = "dods"; + if(dxd == OCDDS) ext = ".dds"; + else if(dxd == OCDAS) ext = ".das"; + else ext = ".dods"; if(ce != NULL && strlen(ce) == 0) ce = NULL; if(FLAGSET(nccomm->controls,NCF_SHOWFETCH)) { + /* Build uri string minus the constraint */ + char* baseuri = ocuribuild(nccomm->oc.uri,NULL,ext,0); if(ce == NULL) - nclog(NCLOGNOTE,"fetch: %s.%s",nccomm->oc.uri->uri,ext); - else - nclog(NCLOGNOTE,"fetch: %s.%s?%s",nccomm->oc.uri->uri,ext,ce); + nclog(NCLOGNOTE,"fetch: %s",baseuri); + else + nclog(NCLOGNOTE,"fetch: %s?%s",baseuri,ce); + nullfree(baseuri); #ifdef HAVE_GETTIMEOFDAY gettimeofday(&time0,NULL); #endif diff --git a/libdap2/dceconstraints.c b/libdap2/dceconstraints.c index 8588d3ed7..dbcdab536 100644 --- a/libdap2/dceconstraints.c +++ b/libdap2/dceconstraints.c @@ -130,6 +130,7 @@ dceslicemerge(DCEslice* dst, DCEslice* src) int err = NC_NOERR; DCEslice tmp; + tmp.node.sort = CES_SLICE; tmp.stride = (dst->stride * src->stride); tmp.first = (dst->first+((src->first)*(dst->stride))); tmp.length = (((src->length - 1) / src->stride) * tmp.stride) + 1; diff --git a/libdap2/dceparse.c b/libdap2/dceparse.c index ffa32450a..9e7c941ef 100644 --- a/libdap2/dceparse.c +++ b/libdap2/dceparse.c @@ -96,6 +96,7 @@ segment(DCEparsestate* state, Object name, Object slices0) NClist* slices = (NClist*)slices0; segment->name = strdup((char*)name); if(slices != NULL && nclistlength(slices) > 0) { + segment->rank = nclistlength(slices); segment->slicesdefined = 1; /* but not declsizes */ for(i=0;iunlimited */ BOOL usesequence; /* If this sequence is usable */ BOOL elided; /* 1 => node does not partipate in naming*/ +#ifdef DDSNEW + struct CDFnode* basenode; /* map from constrained tree to unconstrained */ +#endif BOOL visible; /* 1 => node is present in constrained tree; independent of elided flag */ BOOL zerodim; /* 1 => node has a zero dimension */ diff --git a/libdap2/ncdap3.c b/libdap2/ncdap3.c index e615a0c53..fd8122259 100755 --- a/libdap2/ncdap3.c +++ b/libdap2/ncdap3.c @@ -173,17 +173,17 @@ fprintf(stderr,"parsed constraint: %s\n", ncstat = fetchtemplatemetadata3(&drno->dap); if(ncstat != NC_NOERR) goto done; - /* Process the constraints to map the CDF tree */ - ncstat = mapconstraints3(&drno->dap); - if(ncstat != NC_NOERR) goto done; - /* fetch and build the constrained DDS */ ncstat = fetchconstrainedmetadata3(&drno->dap); if(ncstat != NC_NOERR) goto done; - /* The following actions are WRT to the + /* The following actions are (mostly) WRT to the constrained tree */ + /* Process the constraints to map to the constrained CDF tree */ + ncstat = mapconstraints3(drno->dap.oc.dapconstraint,drno->dap.cdf.ddsroot); + if(ncstat != NC_NOERR) goto done; + /* Accumulate useful nodes sets */ ncstat = computecdfnodesets3(&drno->dap); if(ncstat) {THROWCHK(ncstat); goto done;} diff --git a/libdap2/ncdap3.h b/libdap2/ncdap3.h index f4c2f1220..7dcd14a38 100755 --- a/libdap2/ncdap3.h +++ b/libdap2/ncdap3.h @@ -142,10 +142,15 @@ extern NCerror nc3d_open(const char* path, int mode, int* ncidp); extern int nc3d_close(int ncid); extern int nc3dinitialize(void); extern NCerror regrid3(CDFnode* ddsroot, CDFnode* template, NClist*); +extern void setvisible(CDFnode* root, int visible); +#ifdef DDSNEW +extern NCerror mapnodes3(CDFnode* dstroot, CDFnode* srcroot); +extern void unmap3(CDFnode* root); +#else extern NCerror imprint3(CDFnode* dstroot, CDFnode* srcroot); extern void unimprint3(CDFnode* root); extern NCerror imprintself3(CDFnode* root); -extern void setvisible(CDFnode* root, int visible); +#endif /* From: ncdap3a.c*/ extern NCerror fetchtemplatemetadata3(NCDAPCOMMON* nccomm); diff --git a/libdap2/ncdap3a.c b/libdap2/ncdap3a.c index f12df951e..92c9ae875 100644 --- a/libdap2/ncdap3a.c +++ b/libdap2/ncdap3a.c @@ -648,11 +648,19 @@ fetchtemplatemetadata3(NCDAPCOMMON* nccomm) if(nccomm->cdf.ddsroot != NULL) freecdfroot34(&drno->dap->cdf.ddsroot); #endif - nccomm->cdf.ddsroot = ddsroot; - /* Combine */ +#ifdef DDSNEW + nccomm->cdf.fullddsroot = ddsroot; +#else + nccomm->cdf.ddsroot = ddsroot; +#endif + +#ifdef DDSNEW +#else + /* Combine DDS and DAS */ ncstat = dapmerge3(nccomm,ddsroot,nccomm->oc.ocdasroot); if(ncstat != NC_NOERR) {THROWCHK(ncstat); goto done;} +#endif done: nullfree(ce); @@ -674,11 +682,15 @@ fetchconstrainedmetadata3(NCDAPCOMMON* nccomm) else ce = buildconstraintstring3(nccomm->oc.dapconstraint); +#ifdef DDSNEW +#else if(ce == NULL || strlen(ce) == 0) { /* no need to get the dds again; just imprint on self */ ncstat = imprintself3(nccomm->cdf.ddsroot); if(ncstat) goto fail; - } else { + } else +#endif + { ocstat = dap_oc_fetch(nccomm,nccomm->oc.conn,ce,OCDDS,&ocroot); if(ocstat != OC_NOERR) {THROWCHK(ocstat); goto fail;} @@ -686,9 +698,17 @@ fetchconstrainedmetadata3(NCDAPCOMMON* nccomm) ncstat = buildcdftree34(nccomm,ocroot,OCDDS,&ddsroot); if(ncstat) goto fail; +#ifdef DDSNEW + nccomm->cdf.ddsroot = ddsroot; +#endif + if(!FLAGSET(nccomm->controls,NCF_UNCONSTRAINABLE)) { - /* fix DAP server problem by adding back any missing grid nodes */ + /* fix DAP server problem by adding back any missing grid structure nodes */ +#ifdef DDSNEW + ncstat = regrid3(ddsroot,nccomm->cdf.fullddsroot,nccomm->oc.dapconstraint->projections); +#else ncstat = regrid3(ddsroot,nccomm->cdf.ddsroot,nccomm->oc.dapconstraint->projections); +#endif if(ncstat) goto fail; } @@ -696,12 +716,23 @@ fetchconstrainedmetadata3(NCDAPCOMMON* nccomm) fprintf(stderr,"constrained:\n%s",dumptree(ddsroot)); #endif +#ifdef DDSNEW + /* Combine DDS and DAS */ + if(nccomm->oc.ocdasroot != NULL) { + ncstat = dapmerge3(nccomm,ddsroot,nccomm->oc.ocdasroot); + if(ncstat != NC_NOERR) {THROWCHK(ncstat); goto fail;} + } + + /* map the constrained DDS to the unconstrained DDS */ + ncstat = mapnodes3(ddsroot,nccomm->cdf.fullddsroot); + if(ncstat) goto fail; +#else /* Imprint the constrained DDS data over the unconstrained DDS */ ncstat = imprint3(nccomm->cdf.ddsroot,ddsroot); if(ncstat) goto fail; - /* Throw away the constrained DDS */ freecdfroot34(ddsroot); +#endif } fail: diff --git a/libdap2/ncdap4.c b/libdap2/ncdap4.c index 137fb8edf..0f41fc045 100644 --- a/libdap2/ncdap4.c +++ b/libdap2/ncdap4.c @@ -199,16 +199,16 @@ ocdebug = 1; ncstat = fetchtemplatemetadata3(&drno->dap); if(ncstat != NC_NOERR) goto done; - /* Process the constraints to map the CDF tree */ - ncstat = mapconstraints3(&drno->dap); - if(ncstat != NC_NOERR) goto done; - /* fetch and build the constrained DDS */ ncstat = fetchconstrainedmetadata3(&drno->dap); if(ncstat != NC_NOERR) goto done; /* The following actions are WRT to the constrained tree */ + /* Process the constraints to map the CDF tree */ + ncstat = mapconstraints3(drno->dap.oc.dapconstraint,drno->dap.cdf.ddsroot); + if(ncstat != NC_NOERR) goto done; + /* Accumulate useful nodes sets */ ncstat = computecdfnodesets4(&drno->dap); if(ncstat) {THROWCHK(ncstat); goto done;} diff --git a/libdispatch/Makefile.am b/libdispatch/Makefile.am index ae60e3d96..fcac8529b 100755 --- a/libdispatch/Makefile.am +++ b/libdispatch/Makefile.am @@ -17,8 +17,9 @@ libdispatch_la_CPPFLAGS = ${AM_CPPFLAGS} # The source files. libdispatch_la_SOURCES = dparallel.c dcopy.c dfile.c ddim.c datt.c \ dattinq.c dattput.c dattget.c derror.c dvar.c dvarget.c dvarput.c \ -dvarinq.c ddispatch.c nc_uri.c dnclist.c dncbytes.c dnchashmap.c \ -dnclog.c dstring.c dutf8proc.c utf8proc_data.h +dvarinq.c ddispatch.c \ +dnclog.c dstring.c dutf8proc.c utf8proc_data.h \ +nc_uri.c nclist.c ncbytes.c nchashmap.c # Add functions only found in netCDF-4. if USE_NETCDF4 diff --git a/libdispatch/defcheck.c b/libdispatch/defcheck.c index 6c73b916d..072291254 100644 --- a/libdispatch/defcheck.c +++ b/libdispatch/defcheck.c @@ -4,7 +4,7 @@ #include #include -#define URL "http://test.opendap.org:8080/dods/dts/test.02" +#define URL "http://motherlod.ucar.edu:8081/dods/dts/test.02" #define VAR "i32" #define ERRCODE 2 diff --git a/libdispatch/dncbytes.c b/libdispatch/ncbytes.c similarity index 100% rename from libdispatch/dncbytes.c rename to libdispatch/ncbytes.c diff --git a/libdispatch/dnchashmap.c b/libdispatch/nchashmap.c similarity index 100% rename from libdispatch/dnchashmap.c rename to libdispatch/nchashmap.c diff --git a/libdispatch/dnclist.c b/libdispatch/nclist.c similarity index 100% rename from libdispatch/dnclist.c rename to libdispatch/nclist.c diff --git a/nc_test4/tst_files5.c b/nc_test4/tst_files5.c index a51733ae6..52efaba4d 100644 --- a/nc_test4/tst_files5.c +++ b/nc_test4/tst_files5.c @@ -9,7 +9,7 @@ #include "netcdf.h" #define FILE_NAME "tst_files.nc" -#define URL "http://test.opendap.org:8080/dods/dts/test.01" +#define URL "http://motherlode.ucar.edu:8081/dods/dts/test.01" int main(int argc, char **argv) diff --git a/nc_test4/tst_files6.c b/nc_test4/tst_files6.c index 273a926f2..30185ef54 100644 --- a/nc_test4/tst_files6.c +++ b/nc_test4/tst_files6.c @@ -8,7 +8,7 @@ #include #include "netcdf.h" -#define URL "http://test.opendap.org:8080/dods/dts/test.01" +#define URL "http://motherlode.ucar.edu:8081/dods/dts/test.01" #define FILE_NAME "tst_files6.nc" int diff --git a/ncdap_test/test_varm3.c b/ncdap_test/test_varm3.c index 2939cb45b..43ab1d91a 100644 --- a/ncdap_test/test_varm3.c +++ b/ncdap_test/test_varm3.c @@ -125,8 +125,9 @@ main() printf("\n"); #endif - check(err = nc_get_varm_float (ncid, varid, start, count, stride, imap, - (float*) dat),__FILE__,__LINE__); +// check(err = nc_get_varm_float (ncid, varid, start, count, stride, imap,(float*) dat),__FILE__,__LINE__); + check(err = nc_get_vara_float (ncid, varid, start, count, (float*) dat),__FILE__,__LINE__); + #ifdef STANDALONE printf("varm: %s =",VAR); for(i=0;i<12;i++) printf(" %f",dat[i]); diff --git a/ncdap_test/tst_ncdap_shared.sh b/ncdap_test/tst_ncdap_shared.sh index bd97b751c..6f1325620 100755 --- a/ncdap_test/tst_ncdap_shared.sh +++ b/ncdap_test/tst_ncdap_shared.sh @@ -48,7 +48,7 @@ FILETESTS="${SYNTHETICDATA} ${ACTUALDATA1} ${ACTUALDATA2}" # Remote test info ################################################## -# REMOTEURL1="http://test.opendap.org:8080/dods/dts" +# REMOTEURL1="http://motherlode.ucar.edu:8081/dods/dts" # REMOTEURL2="http://test.opendap.org/dap/netcdf/examples" # # diff --git a/ncdap_test/tst_remote.sh b/ncdap_test/tst_remote.sh index 1ebef9a85..400919aab 100755 --- a/ncdap_test/tst_remote.sh +++ b/ncdap_test/tst_remote.sh @@ -55,14 +55,14 @@ fi WHICHTESTS="C2" # For special testing -REMOTEURLX="http://test.opendap.org:8080/dods/dts" +REMOTEURLX="http://motherlode.ucar.edu:8081/dods/dts" REMOTETESTSX="test.03" -REMOTEURLXC="http://test.opendap.org:8080/dods/dts" +REMOTEURLXC="http://motherlode.ucar.edu:8081/dods/dts" REMOTETESTSXC="test.03;1;s0,s1" # These shorter tests are always run -REMOTEURLS1="http://test.opendap.org:8080/dods/dts" +REMOTEURLS1="http://motherlode.ucar.edu:8081/dods/dts" REMOTETESTSS1="\ test.01 test.02 test.04 test.05 test.06a test.07a test.07 \ test.21 test.22 test.23 \ @@ -92,7 +92,7 @@ TOOBIG="parserBug0001 test.satimage Sat_Images test.06 test.32" ESCAPEDFAIL="test.dfr1 test.dfr2 test.dfr3 test.GridFile test.PointFile test.SwathFile test.sds6 test.sds7" # Following tests are to check constraint handling -REMOTEURLC1="http://test.opendap.org:8080/dods/dts" +REMOTEURLC1="http://motherlode.ucar.edu:8081/dods/dts" REMOTETESTSC1="\ test.01;1;f64 \ test.02;1;b[1:2:10] \ @@ -117,7 +117,7 @@ argo_all.cdp;1;&location.LATITUDE<1&location.LATITUDE>-1\ " # Constrained long tests -REMOTEURLLC1="http://test.opendap.org:8080/dods/dts" +REMOTEURLLC1="http://motherlode.ucar.edu:8081/dods/dts" REMOTETESTSLC1="\ test.03;2;s1" diff --git a/ncgen/ncgen.y b/ncgen/ncgen.y index 63229db92..fdc61bc54 100644 --- a/ncgen/ncgen.y +++ b/ncgen/ncgen.y @@ -14,6 +14,11 @@ static char SccsId[] = "$Id: ncgen.y,v 1.42 2010/05/18 21:32:46 dmh Exp $"; */ #include "includes.h" #include "offsets.h" +#include +#include + +#define TIMEFORMAT "%Y-%m-%d" +extern char *strptime(const char *s, const char *format, struct tm *tm); /* parser controls */ #define YY_NO_INPUT 1 @@ -92,6 +97,7 @@ List* tmp; /* Forward */ static Constant makeconstdata(nc_type); +static Constant evaluate(Symbol* fcn, Datalist* arglist); static Constant makeenumconst(Symbol*); static void addtogroup(Symbol*); static Symbol* getunlimiteddim(void); @@ -189,7 +195,8 @@ Constant constant; %type enumidlist fieldlist fields varlist dimspec dimlist field fielddimspec fielddimlist %type dataitem constdata constint conststring constbool -%type datalist intlist datalist1 datalist0 +%type simpleconstant function +%type datalist intlist datalist1 datalist0 arglist %start ncdesc /* start symbol for grammar */ @@ -789,6 +796,25 @@ dataitem: ; constdata: + simpleconstant {$$=$1;} + | OPAQUESTRING {$$=makeconstdata(NC_OPAQUE);} + | FILLMARKER {$$=makeconstdata(NC_FILLVALUE);} + | path {$$=makeenumconst($1);} + | function + ; + +function: + IDENT '(' arglist ')' {$$=evaluate($1,$3);} + ; + +arglist: + simpleconstant + {$$ = builddatalist(0); datalistextend($$,&($1));} + | arglist ',' simpleconstant + {datalistextend($1,&($3)); $$=$1;} + ; + +simpleconstant: CHAR_CONST {$$=makeconstdata(NC_CHAR);} /* never used apparently*/ | BYTE_CONST {$$=makeconstdata(NC_BYTE);} | SHORT_CONST {$$=makeconstdata(NC_SHORT);} @@ -801,9 +827,6 @@ constdata: | FLOAT_CONST {$$=makeconstdata(NC_FLOAT);} | DOUBLE_CONST {$$=makeconstdata(NC_DOUBLE);} | TERMSTRING {$$=makeconstdata(NC_STRING);} - | OPAQUESTRING {$$=makeconstdata(NC_OPAQUE);} - | path {$$=makeenumconst($1);} - | FILLMARKER {$$=makeconstdata(NC_FILLVALUE);} ; intlist: @@ -1381,3 +1404,85 @@ vercheck(int ncid) } if(tmsg != NULL) markcdf4(tmsg); } + +/* +Since the arguments are all simple constant, +we can evaluate the function immediately +and return its value. +*/ + +static Constant +evaluate(Symbol* fcn, Datalist* arglist) +{ + Constant result; + + /* prepare the result */ + result.lineno = fcn->lineno; + result.filled = 0; + +#if defined(HAVE_STRPTIME) && defined(HAVE_MKTIME) + if(strcasecmp(fcn->name,"time") == 0) { + result.nctype = NC_INT; + result.value.int32v = 0; + /* int time(string,string) */ + if(arglist->length != 2 + || arglist->data[0].nctype != NC_STRING + || arglist->data[1].nctype != NC_STRING) { + derror("Expected function signature: time(string,string)"); + goto done; + } else { + char* timekind = arglist->data[0].value.stringv.stringv; + char* timevalue = arglist->data[1].value.stringv.stringv; + if(strcasecmp(timekind,"timetest")==0) { + struct tm time; + memset(&time,0,sizeof(time)); + if(strptime(timevalue,TIMEFORMAT,&time) == NULL) { + derror("Malformed time string: %s",timevalue); + goto done; + } else { + result.value.int32v = (int)mktime(&time); + } + } else { + derror("Time conversion '%s' not supported",timekind); + goto done; + } + } + } else if(strcasecmp(fcn->name,"math") == 0) { + /* int match(string,string) */ + if(arglist->length != 2 + || arglist->data[0].nctype != NC_STRING + || arglist->data[1].nctype != NC_STRING) { + derror("Expected function signature: math(string,string)"); + goto done; + } else { + char* fcn = arglist->data[0].value.stringv.stringv; + char* arg = arglist->data[1].value.stringv.stringv; + double matharg = 0.0; + result.nctype = NC_INT64; + result.value.int64v = 0; + if(sscanf(arg,"%le",&matharg) != 1) { + derror("Malformed math function value: %s",arg); + goto done; + } + if(strcasecmp(fcn,"sin")==0) { + result.value.int64v = sin(matharg); + } else if(strcasecmp(fcn,"cos")==0) { + result.value.int64v = cos(matharg); + } else if(strcasecmp(fcn,"tan")==0) { + result.value.int64v = tan(matharg); + } else { + derror("Math function '%s' not supported",fcn); + goto done; + } + } + } else +#endif + { /* Unknown function */ + derror("Unknown function name: %s",fcn->name); + goto done; + } + +done: + return result; +} + diff --git a/ncgen/ncgentab.c b/ncgen/ncgentab.c index 62c13e92e..f326d5ced 100644 --- a/ncgen/ncgentab.c +++ b/ncgen/ncgentab.c @@ -82,6 +82,11 @@ static char SccsId[] = "$Id: ncgen.y,v 1.42 2010/05/18 21:32:46 dmh Exp $"; */ #include "includes.h" #include "offsets.h" +#include +#include + +#define TIMEFORMAT "%Y-%m-%d" +extern char *strptime(const char *s, const char *format, struct tm *tm); /* parser controls */ #define YY_NO_INPUT 1 @@ -160,6 +165,7 @@ List* tmp; /* Forward */ static Constant makeconstdata(nc_type); +static Constant evaluate(Symbol* fcn, Datalist* arglist); static Constant makeenumconst(Symbol*); static void addtogroup(Symbol*); static Symbol* getunlimiteddim(void); @@ -190,7 +196,7 @@ extern int lex_init(void); /* Line 189 of yacc.c */ -#line 194 "ncgen.tab.c" +#line 200 "ncgen.tab.c" /* Enabling traces. */ #ifndef YYDEBUG @@ -274,7 +280,7 @@ typedef union YYSTYPE { /* Line 214 of yacc.c */ -#line 126 "ncgen.y" +#line 132 "ncgen.y" Symbol* sym; unsigned long size; /* allow for zero size to indicate e.g. UNLIMITED*/ @@ -286,7 +292,7 @@ Constant constant; /* Line 214 of yacc.c */ -#line 290 "ncgen.tab.c" +#line 296 "ncgen.tab.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -298,7 +304,7 @@ Constant constant; /* Line 264 of yacc.c */ -#line 302 "ncgen.tab.c" +#line 308 "ncgen.tab.c" #ifdef short # undef short @@ -513,16 +519,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 4 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 343 +#define YYLAST 362 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 59 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 61 +#define YYNNTS 64 /* YYNRULES -- Number of rules. */ -#define YYNRULES 141 +#define YYNRULES 146 /* YYNRULES -- Number of states. */ -#define YYNSTATES 238 +#define YYNSTATES 247 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -584,9 +590,9 @@ static const yytype_uint16 yyprhs[] = 254, 259, 266, 272, 278, 285, 291, 297, 303, 309, 315, 321, 327, 332, 334, 336, 337, 339, 342, 345, 349, 353, 355, 357, 358, 360, 364, 366, 370, 372, - 374, 376, 378, 380, 382, 384, 386, 388, 390, 392, - 394, 396, 398, 400, 402, 406, 408, 410, 412, 414, - 416, 418 + 374, 376, 378, 380, 385, 387, 391, 393, 395, 397, + 399, 401, 403, 405, 407, 409, 411, 413, 415, 417, + 421, 423, 425, 427, 429, 431, 433 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -620,40 +626,42 @@ static const yytype_int8 yyrhs[] = 106, 52, 105, -1, 58, 15, 54, 111, -1, 103, 104, 58, 15, 54, 111, -1, 104, 58, 15, 54, 111, -1, 104, 58, 40, 54, 111, -1, 103, 104, - 58, 40, 54, 111, -1, 104, 58, 42, 54, 118, - -1, 104, 58, 43, 54, 116, -1, 104, 58, 48, - 54, 119, -1, 104, 58, 44, 54, 117, -1, 104, - 58, 45, 54, 119, -1, 104, 58, 46, 54, 118, - -1, 104, 58, 47, 54, 119, -1, 58, 41, 54, - 118, -1, 15, -1, 38, -1, -1, 31, -1, 31, + 58, 40, 54, 111, -1, 104, 58, 42, 54, 121, + -1, 104, 58, 43, 54, 119, -1, 104, 58, 48, + 54, 122, -1, 104, 58, 44, 54, 120, -1, 104, + 58, 45, 54, 122, -1, 104, 58, 46, 54, 121, + -1, 104, 58, 47, 54, 122, -1, 58, 41, 54, + 121, -1, 15, -1, 38, -1, -1, 31, -1, 31, 109, -1, 110, 52, -1, 109, 110, 52, -1, 102, 54, 111, -1, 112, -1, 113, -1, -1, 114, -1, 111, 53, 114, -1, 115, -1, 50, 111, 51, -1, - 17, -1, 18, -1, 19, -1, 20, -1, 21, -1, - 22, -1, 23, -1, 24, -1, 25, -1, 26, -1, - 27, -1, 16, -1, 36, -1, 107, -1, 39, -1, - 117, -1, 116, 53, 117, -1, 20, -1, 24, -1, - 21, -1, 25, -1, 16, -1, 118, -1, 117, -1 + 118, -1, 36, -1, 39, -1, 107, -1, 116, -1, + 15, 55, 117, 56, -1, 118, -1, 117, 53, 118, + -1, 17, -1, 18, -1, 19, -1, 20, -1, 21, + -1, 22, -1, 23, -1, 24, -1, 25, -1, 26, + -1, 27, -1, 16, -1, 120, -1, 119, 53, 120, + -1, 20, -1, 24, -1, 21, -1, 25, -1, 16, + -1, 121, -1, 120, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 201, 201, 207, 214, 221, 221, 224, 233, 223, - 238, 239, 240, 244, 244, 246, 256, 256, 259, 260, - 261, 262, 265, 265, 268, 298, 300, 317, 326, 338, - 352, 385, 386, 389, 403, 404, 405, 406, 407, 408, - 409, 410, 411, 412, 413, 416, 417, 418, 421, 422, - 425, 425, 427, 428, 432, 436, 444, 454, 466, 478, - 479, 480, 483, 484, 487, 487, 489, 511, 515, 519, - 546, 547, 550, 551, 555, 569, 573, 578, 607, 608, - 612, 613, 618, 628, 648, 659, 670, 689, 696, 696, - 699, 701, 710, 721, 723, 725, 727, 729, 731, 733, - 735, 737, 739, 744, 750, 759, 760, 761, 764, 765, - 768, 772, 773, 777, 781, 782, 787, 788, 792, 793, - 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, - 804, 805, 806, 810, 811, 815, 817, 819, 821, 826, - 830, 831 + 0, 208, 208, 214, 221, 228, 228, 231, 240, 230, + 245, 246, 247, 251, 251, 253, 263, 263, 266, 267, + 268, 269, 272, 272, 275, 305, 307, 324, 333, 345, + 359, 392, 393, 396, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 423, 424, 425, 428, 429, + 432, 432, 434, 435, 439, 443, 451, 461, 473, 485, + 486, 487, 490, 491, 494, 494, 496, 518, 522, 526, + 553, 554, 557, 558, 562, 576, 580, 585, 614, 615, + 619, 620, 625, 635, 655, 666, 677, 696, 703, 703, + 706, 708, 717, 728, 730, 732, 734, 736, 738, 740, + 742, 744, 746, 751, 757, 766, 767, 768, 771, 772, + 775, 779, 780, 784, 788, 789, 794, 795, 799, 800, + 801, 802, 803, 807, 811, 813, 818, 819, 820, 821, + 822, 823, 824, 825, 826, 827, 828, 829, 833, 834, + 838, 840, 842, 844, 849, 853, 854 }; #endif @@ -683,7 +691,8 @@ static const char *const yytname[] = "fielddimlist", "fielddim", "varref", "typeref", "type_var_ref", "attrdecllist", "attrdecl", "path", "datasection", "datadecls", "datadecl", "datalist", "datalist0", "datalist1", "dataitem", - "constdata", "intlist", "constint", "conststring", "constbool", 0 + "constdata", "function", "arglist", "simpleconstant", "intlist", + "constint", "conststring", "constbool", 0 }; #endif @@ -716,9 +725,9 @@ static const yytype_uint8 yyr1[] = 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 107, 107, 108, 108, 108, 109, 109, 110, 111, 111, 112, 113, 113, 114, 114, 115, 115, - 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, - 115, 115, 115, 116, 116, 117, 117, 117, 117, 118, - 119, 119 + 115, 115, 115, 116, 117, 117, 118, 118, 118, 118, + 118, 118, 118, 118, 118, 118, 118, 118, 119, 119, + 120, 120, 120, 120, 121, 122, 122 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -736,9 +745,9 @@ static const yytype_uint8 yyr2[] = 4, 6, 5, 5, 6, 5, 5, 5, 5, 5, 5, 5, 4, 1, 1, 0, 1, 2, 2, 3, 3, 1, 1, 0, 1, 3, 1, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, - 1, 1 + 1, 1, 1, 4, 1, 3, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 1, 1, 1, 1, 1, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -752,79 +761,81 @@ static const yytype_uint8 yydefact[] = 0, 0, 0, 11, 45, 88, 113, 0, 0, 3, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 13, 16, 22, 22, 22, 22, - 87, 0, 0, 46, 59, 89, 129, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 130, 132, - 113, 131, 90, 111, 112, 114, 116, 139, 102, 0, - 0, 0, 113, 113, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 14, 23, 18, 21, 20, 19, - 0, 0, 17, 103, 47, 0, 50, 52, 0, 51, - 60, 105, 0, 0, 7, 113, 113, 92, 93, 95, - 135, 137, 136, 138, 96, 133, 98, 141, 140, 99, - 100, 101, 97, 0, 0, 0, 0, 0, 48, 0, - 0, 61, 0, 64, 0, 65, 106, 4, 117, 115, - 88, 91, 94, 0, 0, 0, 0, 85, 0, 0, - 0, 49, 58, 53, 57, 55, 54, 56, 0, 62, - 70, 66, 67, 0, 84, 107, 0, 5, 134, 30, - 0, 31, 78, 33, 75, 28, 0, 0, 25, 29, - 63, 0, 69, 0, 113, 0, 108, 8, 32, 0, - 77, 0, 0, 24, 0, 0, 72, 74, 70, 68, - 110, 109, 0, 83, 82, 0, 80, 76, 27, 26, - 0, 71, 88, 0, 79, 73, 9, 81 + 87, 0, 0, 46, 59, 89, 103, 137, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 119, + 120, 113, 121, 90, 111, 112, 114, 116, 122, 118, + 144, 102, 0, 0, 0, 113, 113, 0, 0, 0, + 0, 0, 0, 0, 15, 0, 0, 14, 23, 18, + 21, 20, 19, 0, 0, 17, 103, 47, 0, 50, + 52, 0, 51, 60, 105, 0, 0, 0, 7, 113, + 113, 92, 93, 95, 140, 142, 141, 143, 96, 138, + 98, 146, 145, 99, 100, 101, 97, 0, 0, 0, + 0, 0, 48, 0, 0, 61, 0, 64, 0, 65, + 106, 4, 0, 124, 117, 115, 88, 91, 94, 0, + 0, 0, 0, 85, 0, 0, 0, 49, 58, 53, + 57, 55, 54, 56, 0, 62, 70, 66, 67, 0, + 84, 107, 0, 0, 123, 5, 139, 30, 0, 31, + 78, 33, 75, 28, 0, 0, 25, 29, 63, 0, + 69, 0, 113, 0, 108, 125, 8, 32, 0, 77, + 0, 0, 24, 0, 0, 72, 74, 70, 68, 110, + 109, 0, 83, 82, 0, 80, 76, 27, 26, 0, + 71, 88, 0, 79, 73, 9, 81 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 2, 6, 21, 30, 40, 160, 222, 34, 53, - 102, 54, 55, 106, 56, 197, 198, 57, 58, 59, - 164, 165, 22, 64, 114, 115, 116, 117, 118, 121, - 151, 152, 153, 181, 182, 202, 215, 216, 193, 194, - 210, 225, 226, 183, 23, 24, 25, 26, 27, 157, - 185, 186, 82, 83, 84, 85, 86, 134, 137, 138, - 139 + -1, 2, 6, 21, 30, 40, 166, 231, 34, 53, + 105, 54, 55, 109, 56, 205, 206, 57, 58, 59, + 170, 171, 22, 64, 117, 118, 119, 120, 121, 124, + 155, 156, 157, 187, 188, 210, 224, 225, 201, 202, + 219, 234, 235, 189, 23, 24, 25, 26, 27, 161, + 191, 192, 83, 84, 85, 86, 87, 88, 162, 89, + 138, 141, 142, 143 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -101 +#define YYPACT_NINF -117 static const yytype_int16 yypact[] = { - -17, -20, 23, -19, -101, 141, -101, -101, -101, -101, - -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, - -6, -101, -101, 268, -1, 22, 11, -101, 32, 33, - -23, 9, 129, 70, 62, 141, 221, 79, 81, -101, - -101, -4, 43, 44, 45, 46, 47, 48, 50, 52, - 53, 94, 55, 70, -101, -101, 59, 59, 59, 59, - 78, 197, 61, 176, 85, -101, -101, -101, -101, -101, - -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, - 221, -101, 64, -101, -101, -101, -101, -101, -101, 65, - 66, 68, 221, 221, 79, 0, 0, 31, 79, 31, - 31, -101, 69, 98, -101, -101, -101, -101, -101, -101, - 94, 72, -101, 76, 176, 71, 73, -101, 77, -101, - 141, 102, 13, 221, -101, 221, 221, 64, 64, -101, - -101, -101, -101, -101, 82, -101, -101, -101, -101, -101, - -101, -101, -101, 268, 80, 88, 83, 89, -101, 125, - 14, 141, 91, -101, 280, -101, 268, -101, -101, -101, - 141, 64, 64, 0, 211, 105, 143, -101, 94, 144, - 94, -101, -101, -101, -101, -101, -101, -101, 108, -101, - -25, 109, -101, 107, -101, 268, 112, -101, -101, -101, - 113, -101, 111, 115, -101, -101, 138, 20, -101, -101, - -101, 4, -101, 178, 221, 142, -101, 158, -101, -2, - -101, 143, 304, -101, 144, -13, -101, -101, 145, -101, - 64, -101, 147, -101, -101, -3, -101, -101, -101, -101, - 4, -101, 141, -2, -101, -101, -101, -101 + -9, -23, 73, 51, -117, 145, -117, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + 7, -117, -117, 275, 44, 71, 52, -117, -25, 54, + -21, 47, -2, 74, 78, 145, 228, 94, 96, -117, + -117, -4, 59, 60, 61, 62, 63, 65, 66, 67, + 68, 108, 69, 74, -117, -117, 75, 75, 75, 75, + 97, 203, 76, 184, 101, -117, 80, -117, -117, -117, + -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, + -117, 228, -117, 84, -117, -117, -117, -117, -117, -117, + -117, -117, 83, 85, 86, 228, 228, 94, 43, 43, + 34, 94, 34, 34, -117, 92, 123, -117, -117, -117, + -117, -117, -117, 108, 87, -117, 91, 184, 95, 93, + -117, 107, -117, 145, 131, 335, -20, 228, -117, 228, + 228, 84, 84, -117, -117, -117, -117, -117, 110, -117, + -117, -117, -117, -117, -117, -117, -117, 275, 109, 114, + 111, 116, -117, 151, 29, 145, 118, -117, 287, -117, + 275, -117, -33, -117, -117, -117, 145, 84, 84, 43, + 219, 119, 157, -117, 108, 158, 108, -117, -117, -117, + -117, -117, -117, -117, 122, -117, -30, 124, -117, 125, + -117, 275, 128, 335, -117, -117, -117, -117, 129, -117, + 121, 132, -117, -117, 130, 39, -117, -117, -117, -3, + -117, 167, 228, 134, -117, -117, 163, -117, -5, -117, + 157, 311, -117, 158, 4, -117, -117, 146, -117, 84, + -117, 153, -117, -117, 19, -117, -117, -117, -117, -3, + -117, 145, -5, -117, -117, -117, -117 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -101, -101, -101, 67, 26, -101, -101, -101, -101, -101, - -100, 175, -101, 3, -101, -101, 15, -101, -101, -101, - -101, 86, -21, -101, -101, 116, -101, 84, -101, -101, - -101, 100, -101, -101, 28, -101, -101, 2, -101, 42, - -101, -101, 21, -101, -27, -22, -35, -26, -34, -101, - -101, 114, -77, -101, -101, 132, 49, -101, -91, -29, - -55 + -117, -117, -117, 36, 24, -117, -117, -117, -117, -117, + -105, 168, -117, 41, -117, -117, 12, -117, -117, -117, + -117, 50, -19, -117, -117, 120, -117, 103, -117, -117, + -117, 81, -117, -117, 27, -117, -117, 0, -117, 20, + -117, -117, 17, -117, -29, -22, -35, -26, -34, -117, + -117, 70, -78, -117, -117, 133, 42, -117, -117, -116, + -117, -93, -27, -37 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -834,80 +845,84 @@ static const yytype_int16 yypgoto[] = #define YYTABLE_NINF -104 static const yytype_int16 yytable[] = { - 65, 31, 81, 122, 135, 136, 61, 62, 88, 28, - 145, 90, 60, 1, 38, 127, 128, 174, 223, 18, - 130, 131, 224, 4, 132, 133, 61, 62, 39, 3, - 201, 5, 60, -103, 175, 29, 91, 119, 176, 31, - 230, 177, 19, 231, 141, 142, 81, 87, 161, 162, - 233, 130, 131, 234, 33, 132, 133, 32, 81, 81, - 107, 108, 109, 35, 158, 129, 123, 41, 195, 140, - 199, 213, 188, 214, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 36, 37, 119, 81, - 63, 81, 81, 154, 155, 87, 89, 92, 93, 94, - 95, 96, 97, 51, 98, 52, 99, 100, 19, 101, - 103, 105, 110, 112, 120, 124, 166, 123, 144, 143, - 125, 167, 126, 148, 154, 155, 149, 220, 20, 146, - -58, 150, 31, 156, 184, 163, 168, 166, 169, 170, - 172, 171, 167, 179, 42, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 191, 192, 196, - 200, 204, 203, 184, 206, 208, 209, 217, 211, 43, - 81, 44, 45, 46, 47, 48, 49, 50, 81, 19, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 113, 212, 218, 221, 38, 217, 236, 232, 20, - 201, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 207, 19, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 187, 104, 229, - 147, 219, 235, 173, 20, 19, 18, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 19, - 190, 178, 111, 227, 237, 159, 0, 78, 0, 19, - 79, 228, 189, 0, 0, 0, 0, 0, 0, 0, - 0, 80, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 180, 0, 0, 0, 205, - 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 19, 18, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 0, 0, 0, 0, 0, 0, 0, 0, - 78, 0, 19, 79 + 65, 31, 82, 126, 61, 139, 140, 62, 149, 163, + 91, 93, 18, 42, 60, 232, 38, 131, 132, 233, + 193, 1, 28, 194, 61, 209, 3, 62, -103, 36, + 39, 164, 180, 127, 60, 19, 94, 122, 43, 31, + 44, 45, 46, 47, 48, 49, 50, 82, 29, 181, + 90, 167, 168, 182, 134, 135, 183, 239, 136, 137, + 240, 82, 82, 134, 135, 145, 146, 136, 137, 203, + 133, 207, 242, 4, 144, 243, 196, 215, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 222, 122, 223, 82, 158, 82, 82, 159, 110, 111, + 112, 5, 32, 33, 35, 41, 63, 51, 37, 52, + 90, 92, 19, 95, 96, 97, 98, 99, 172, 100, + 101, 102, 103, 104, 106, 173, 158, 108, 115, 159, + 123, 113, 20, 128, 229, 125, 31, 127, 190, 129, + 130, 172, 147, 148, 150, -58, 153, 152, 173, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 154, 160, 169, 175, 174, 178, 176, 177, 190, + 185, 199, 200, 204, 208, 226, 218, 211, 82, 212, + 214, 217, 227, 19, 221, 220, 230, 82, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 116, + 38, 209, 195, 20, 241, 226, 245, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 216, + 198, 107, 19, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 238, 184, 151, 228, 244, + 236, 19, 20, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 179, 19, 114, 246, + 165, 213, 0, 237, 79, 0, 19, 80, 0, 0, + 197, 0, 0, 0, 0, 0, 0, 0, 81, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 186, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 19, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 0, + 0, 0, 0, 0, 0, 0, 0, 79, 0, 19, + 80, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78 }; static const yytype_int16 yycheck[] = { - 35, 23, 36, 80, 95, 96, 33, 33, 37, 15, - 110, 15, 33, 30, 37, 92, 93, 3, 20, 15, - 20, 21, 24, 0, 24, 25, 53, 53, 51, 49, - 55, 50, 53, 58, 20, 41, 40, 63, 24, 61, - 53, 27, 38, 56, 99, 100, 80, 16, 125, 126, - 53, 20, 21, 56, 32, 24, 25, 58, 92, 93, - 57, 58, 59, 52, 51, 94, 53, 58, 168, 98, - 170, 51, 163, 53, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 54, 54, 114, 123, - 28, 125, 126, 120, 120, 16, 15, 54, 54, 54, - 54, 54, 54, 33, 54, 35, 54, 54, 38, 15, - 55, 52, 34, 52, 29, 50, 143, 53, 20, 50, - 54, 143, 54, 52, 151, 151, 53, 204, 58, 57, - 54, 54, 154, 31, 156, 53, 56, 164, 50, 56, - 15, 52, 164, 52, 15, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 52, 15, 15, - 52, 54, 53, 185, 52, 52, 55, 201, 53, 40, - 204, 42, 43, 44, 45, 46, 47, 48, 212, 38, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 54, 15, 52, 37, 230, 232, 51, 58, - 55, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 187, 38, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 160, 53, 214, - 114, 203, 230, 149, 58, 38, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 38, - 164, 151, 55, 211, 233, 123, -1, 36, -1, 38, - 39, 212, 51, -1, -1, -1, -1, -1, -1, -1, - -1, 50, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, -1, -1, -1, 185, - -1, -1, -1, -1, -1, -1, 38, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 38, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, -1, -1, -1, -1, -1, -1, -1, -1, - 36, -1, 38, 39 + 35, 23, 36, 81, 33, 98, 99, 33, 113, 125, + 37, 15, 15, 15, 33, 20, 37, 95, 96, 24, + 53, 30, 15, 56, 53, 55, 49, 53, 58, 54, + 51, 51, 3, 53, 53, 38, 40, 63, 40, 61, + 42, 43, 44, 45, 46, 47, 48, 81, 41, 20, + 16, 129, 130, 24, 20, 21, 27, 53, 24, 25, + 56, 95, 96, 20, 21, 102, 103, 24, 25, 174, + 97, 176, 53, 0, 101, 56, 169, 193, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 51, 117, 53, 127, 123, 129, 130, 123, 57, 58, + 59, 50, 58, 32, 52, 58, 28, 33, 54, 35, + 16, 15, 38, 54, 54, 54, 54, 54, 147, 54, + 54, 54, 54, 15, 55, 147, 155, 52, 52, 155, + 29, 34, 58, 50, 212, 55, 158, 53, 160, 54, + 54, 170, 50, 20, 57, 54, 53, 52, 170, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 54, 31, 53, 50, 56, 15, 56, 52, 191, + 52, 52, 15, 15, 52, 209, 55, 53, 212, 54, + 52, 52, 15, 38, 54, 53, 52, 221, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 37, 55, 166, 58, 51, 239, 241, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 195, + 170, 53, 38, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 223, 155, 117, 211, 239, + 220, 38, 58, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 153, 38, 55, 242, + 127, 191, -1, 221, 36, -1, 38, 39, -1, -1, + 51, -1, -1, -1, -1, -1, -1, -1, 50, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 38, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 38, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, -1, + -1, -1, -1, -1, -1, -1, -1, 36, -1, 38, + 39, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -920,24 +935,25 @@ static const yytype_uint8 yystos[] = 63, 104, 58, 32, 67, 52, 54, 54, 37, 51, 64, 58, 15, 40, 42, 43, 44, 45, 46, 47, 48, 33, 35, 68, 70, 71, 73, 76, 77, 78, - 81, 103, 106, 28, 82, 105, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 36, 39, - 50, 107, 111, 112, 113, 114, 115, 16, 118, 15, - 15, 40, 54, 54, 54, 54, 54, 54, 54, 54, - 54, 15, 69, 55, 70, 52, 72, 72, 72, 72, - 34, 55, 52, 15, 83, 84, 85, 86, 87, 106, - 29, 88, 111, 53, 50, 54, 54, 111, 111, 118, - 20, 21, 24, 25, 116, 117, 117, 117, 118, 119, - 118, 119, 119, 50, 20, 69, 57, 84, 52, 53, - 54, 89, 90, 91, 103, 106, 31, 108, 51, 114, - 65, 111, 111, 53, 79, 80, 103, 104, 56, 50, - 56, 52, 15, 86, 3, 20, 24, 27, 90, 52, - 15, 92, 93, 102, 104, 109, 110, 62, 117, 51, - 80, 52, 15, 97, 98, 69, 15, 74, 75, 69, - 52, 55, 94, 53, 54, 110, 52, 63, 52, 55, - 99, 53, 54, 51, 53, 95, 96, 107, 15, 93, - 111, 52, 66, 20, 24, 100, 101, 98, 115, 75, - 53, 56, 51, 53, 56, 96, 105, 101 + 81, 103, 106, 28, 82, 105, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 36, + 39, 50, 107, 111, 112, 113, 114, 115, 116, 118, + 16, 121, 15, 15, 40, 54, 54, 54, 54, 54, + 54, 54, 54, 54, 15, 69, 55, 70, 52, 72, + 72, 72, 72, 34, 55, 52, 15, 83, 84, 85, + 86, 87, 106, 29, 88, 55, 111, 53, 50, 54, + 54, 111, 111, 121, 20, 21, 24, 25, 119, 120, + 120, 120, 121, 122, 121, 122, 122, 50, 20, 69, + 57, 84, 52, 53, 54, 89, 90, 91, 103, 106, + 31, 108, 117, 118, 51, 114, 65, 111, 111, 53, + 79, 80, 103, 104, 56, 50, 56, 52, 15, 86, + 3, 20, 24, 27, 90, 52, 15, 92, 93, 102, + 104, 109, 110, 53, 56, 62, 120, 51, 80, 52, + 15, 97, 98, 69, 15, 74, 75, 69, 52, 55, + 94, 53, 54, 110, 52, 118, 63, 52, 55, 99, + 53, 54, 51, 53, 95, 96, 107, 15, 93, 111, + 52, 66, 20, 24, 100, 101, 98, 115, 75, 53, + 56, 51, 53, 56, 96, 105, 101 }; #define yyerrok (yyerrstatus = 0) @@ -1760,14 +1776,14 @@ yyreduce: case 2: /* Line 1464 of yacc.c */ -#line 204 "ncgen.y" +#line 211 "ncgen.y" {if (derror_count > 0) exit(6);;} break; case 7: /* Line 1464 of yacc.c */ -#line 224 "ncgen.y" +#line 231 "ncgen.y" { Symbol* id = (yyvsp[(2) - (3)].sym); markcdf4("Group specification"); @@ -1780,28 +1796,28 @@ yyreduce: case 8: /* Line 1464 of yacc.c */ -#line 233 "ncgen.y" +#line 240 "ncgen.y" {listpop(groupstack);;} break; case 11: /* Line 1464 of yacc.c */ -#line 239 "ncgen.y" +#line 246 "ncgen.y" {;} break; case 12: /* Line 1464 of yacc.c */ -#line 241 "ncgen.y" +#line 248 "ncgen.y" {markcdf4("Type specification");;} break; case 15: /* Line 1464 of yacc.c */ -#line 247 "ncgen.y" +#line 254 "ncgen.y" { /* Use when defining a type */ (yyvsp[(1) - (1)].sym)->objectclass = NC_TYPE; if(dupobjectcheck(NC_TYPE,(yyvsp[(1) - (1)].sym))) @@ -1814,21 +1830,21 @@ yyreduce: case 16: /* Line 1464 of yacc.c */ -#line 256 "ncgen.y" +#line 263 "ncgen.y" {;} break; case 17: /* Line 1464 of yacc.c */ -#line 256 "ncgen.y" +#line 263 "ncgen.y" {;} break; case 24: /* Line 1464 of yacc.c */ -#line 270 "ncgen.y" +#line 277 "ncgen.y" { int i; addtogroup((yyvsp[(3) - (6)].sym)); /* sets prefix*/ @@ -1860,14 +1876,14 @@ yyreduce: case 25: /* Line 1464 of yacc.c */ -#line 299 "ncgen.y" +#line 306 "ncgen.y" {(yyval.mark)=listlength(stack); listpush(stack,(elem_t)(yyvsp[(1) - (1)].sym));;} break; case 26: /* Line 1464 of yacc.c */ -#line 301 "ncgen.y" +#line 308 "ncgen.y" { int i; (yyval.mark)=(yyvsp[(1) - (3)].mark); @@ -1887,7 +1903,7 @@ yyreduce: case 27: /* Line 1464 of yacc.c */ -#line 318 "ncgen.y" +#line 325 "ncgen.y" { (yyvsp[(1) - (3)].sym)->objectclass=NC_TYPE; (yyvsp[(1) - (3)].sym)->subclass=NC_ECONST; @@ -1899,7 +1915,7 @@ yyreduce: case 28: /* Line 1464 of yacc.c */ -#line 327 "ncgen.y" +#line 334 "ncgen.y" { vercheck(NC_OPAQUE); addtogroup((yyvsp[(5) - (5)].sym)); /*sets prefix*/ @@ -1914,7 +1930,7 @@ yyreduce: case 29: /* Line 1464 of yacc.c */ -#line 339 "ncgen.y" +#line 346 "ncgen.y" { Symbol* basetype = (yyvsp[(1) - (5)].sym); vercheck(NC_VLEN); @@ -1931,7 +1947,7 @@ yyreduce: case 30: /* Line 1464 of yacc.c */ -#line 353 "ncgen.y" +#line 360 "ncgen.y" { int i,j; vercheck(NC_COMPOUND); @@ -1966,21 +1982,21 @@ yyreduce: case 31: /* Line 1464 of yacc.c */ -#line 385 "ncgen.y" +#line 392 "ncgen.y" {(yyval.mark)=(yyvsp[(1) - (2)].mark);;} break; case 32: /* Line 1464 of yacc.c */ -#line 386 "ncgen.y" +#line 393 "ncgen.y" {(yyval.mark)=(yyvsp[(1) - (3)].mark);;} break; case 33: /* Line 1464 of yacc.c */ -#line 390 "ncgen.y" +#line 397 "ncgen.y" { int i; (yyval.mark)=(yyvsp[(2) - (2)].mark); @@ -1997,112 +2013,112 @@ yyreduce: case 34: /* Line 1464 of yacc.c */ -#line 403 "ncgen.y" +#line 410 "ncgen.y" { (yyval.sym) = primsymbols[NC_CHAR]; ;} break; case 35: /* Line 1464 of yacc.c */ -#line 404 "ncgen.y" +#line 411 "ncgen.y" { (yyval.sym) = primsymbols[NC_BYTE]; ;} break; case 36: /* Line 1464 of yacc.c */ -#line 405 "ncgen.y" +#line 412 "ncgen.y" { (yyval.sym) = primsymbols[NC_SHORT]; ;} break; case 37: /* Line 1464 of yacc.c */ -#line 406 "ncgen.y" +#line 413 "ncgen.y" { (yyval.sym) = primsymbols[NC_INT]; ;} break; case 38: /* Line 1464 of yacc.c */ -#line 407 "ncgen.y" +#line 414 "ncgen.y" { (yyval.sym) = primsymbols[NC_FLOAT]; ;} break; case 39: /* Line 1464 of yacc.c */ -#line 408 "ncgen.y" +#line 415 "ncgen.y" { (yyval.sym) = primsymbols[NC_DOUBLE]; ;} break; case 40: /* Line 1464 of yacc.c */ -#line 409 "ncgen.y" +#line 416 "ncgen.y" { vercheck(NC_UBYTE); (yyval.sym) = primsymbols[NC_UBYTE]; ;} break; case 41: /* Line 1464 of yacc.c */ -#line 410 "ncgen.y" +#line 417 "ncgen.y" { vercheck(NC_USHORT); (yyval.sym) = primsymbols[NC_USHORT]; ;} break; case 42: /* Line 1464 of yacc.c */ -#line 411 "ncgen.y" +#line 418 "ncgen.y" { vercheck(NC_UINT); (yyval.sym) = primsymbols[NC_UINT]; ;} break; case 43: /* Line 1464 of yacc.c */ -#line 412 "ncgen.y" +#line 419 "ncgen.y" { vercheck(NC_INT64); (yyval.sym) = primsymbols[NC_INT64]; ;} break; case 44: /* Line 1464 of yacc.c */ -#line 413 "ncgen.y" +#line 420 "ncgen.y" { vercheck(NC_UINT64); (yyval.sym) = primsymbols[NC_UINT64]; ;} break; case 46: /* Line 1464 of yacc.c */ -#line 417 "ncgen.y" +#line 424 "ncgen.y" {;} break; case 47: /* Line 1464 of yacc.c */ -#line 418 "ncgen.y" +#line 425 "ncgen.y" {;} break; case 50: /* Line 1464 of yacc.c */ -#line 425 "ncgen.y" +#line 432 "ncgen.y" {;} break; case 51: /* Line 1464 of yacc.c */ -#line 425 "ncgen.y" +#line 432 "ncgen.y" {;} break; case 54: /* Line 1464 of yacc.c */ -#line 433 "ncgen.y" +#line 440 "ncgen.y" { (yyvsp[(1) - (3)].sym)->dim.declsize = (size_t)uint32_val; ;} @@ -2111,7 +2127,7 @@ yyreduce: case 55: /* Line 1464 of yacc.c */ -#line 437 "ncgen.y" +#line 444 "ncgen.y" { if(int32_val <= 0) { derror("dimension size must be positive"); @@ -2124,7 +2140,7 @@ yyreduce: case 56: /* Line 1464 of yacc.c */ -#line 445 "ncgen.y" +#line 452 "ncgen.y" { /* for rare case where 2^31 < dimsize < 2^32 */ if (double_val <= 0) yyerror("dimension length must be positive"); @@ -2139,7 +2155,7 @@ yyreduce: case 57: /* Line 1464 of yacc.c */ -#line 455 "ncgen.y" +#line 462 "ncgen.y" { if(usingclassic) { /* check for multiple UNLIMITED decls*/ @@ -2154,7 +2170,7 @@ yyreduce: case 58: /* Line 1464 of yacc.c */ -#line 467 "ncgen.y" +#line 474 "ncgen.y" { (yyvsp[(1) - (1)].sym)->objectclass=NC_DIM; if(dupobjectcheck(NC_DIM,(yyvsp[(1) - (1)].sym))) @@ -2169,35 +2185,35 @@ yyreduce: case 60: /* Line 1464 of yacc.c */ -#line 479 "ncgen.y" +#line 486 "ncgen.y" {;} break; case 61: /* Line 1464 of yacc.c */ -#line 480 "ncgen.y" +#line 487 "ncgen.y" {;} break; case 64: /* Line 1464 of yacc.c */ -#line 487 "ncgen.y" +#line 494 "ncgen.y" {;} break; case 65: /* Line 1464 of yacc.c */ -#line 487 "ncgen.y" +#line 494 "ncgen.y" {;} break; case 66: /* Line 1464 of yacc.c */ -#line 490 "ncgen.y" +#line 497 "ncgen.y" { int i; stackbase=(yyvsp[(2) - (2)].mark); @@ -2222,7 +2238,7 @@ yyreduce: case 67: /* Line 1464 of yacc.c */ -#line 512 "ncgen.y" +#line 519 "ncgen.y" {(yyval.mark)=listlength(stack); listpush(stack,(elem_t)(yyvsp[(1) - (1)].sym)); ;} @@ -2231,14 +2247,14 @@ yyreduce: case 68: /* Line 1464 of yacc.c */ -#line 516 "ncgen.y" +#line 523 "ncgen.y" {(yyval.mark)=(yyvsp[(1) - (3)].mark); listpush(stack,(elem_t)(yyvsp[(3) - (3)].sym));;} break; case 69: /* Line 1464 of yacc.c */ -#line 520 "ncgen.y" +#line 527 "ncgen.y" { int i; Dimset dimset; @@ -2268,35 +2284,35 @@ yyreduce: case 70: /* Line 1464 of yacc.c */ -#line 546 "ncgen.y" +#line 553 "ncgen.y" {(yyval.mark)=listlength(stack);;} break; case 71: /* Line 1464 of yacc.c */ -#line 547 "ncgen.y" +#line 554 "ncgen.y" {(yyval.mark)=(yyvsp[(2) - (3)].mark);;} break; case 72: /* Line 1464 of yacc.c */ -#line 550 "ncgen.y" +#line 557 "ncgen.y" {(yyval.mark)=listlength(stack); listpush(stack,(elem_t)(yyvsp[(1) - (1)].sym));;} break; case 73: /* Line 1464 of yacc.c */ -#line 552 "ncgen.y" +#line 559 "ncgen.y" {(yyval.mark)=(yyvsp[(1) - (3)].mark); listpush(stack,(elem_t)(yyvsp[(3) - (3)].sym));;} break; case 74: /* Line 1464 of yacc.c */ -#line 556 "ncgen.y" +#line 563 "ncgen.y" {Symbol* dimsym = (yyvsp[(1) - (1)].sym); dimsym->objectclass = NC_DIM; /* Find the actual dimension*/ @@ -2312,7 +2328,7 @@ yyreduce: case 75: /* Line 1464 of yacc.c */ -#line 570 "ncgen.y" +#line 577 "ncgen.y" {(yyval.mark)=listlength(stack); listpush(stack,(elem_t)(yyvsp[(1) - (1)].sym)); ;} @@ -2321,14 +2337,14 @@ yyreduce: case 76: /* Line 1464 of yacc.c */ -#line 574 "ncgen.y" +#line 581 "ncgen.y" {(yyval.mark)=(yyvsp[(1) - (3)].mark); listpush(stack,(elem_t)(yyvsp[(3) - (3)].sym));;} break; case 77: /* Line 1464 of yacc.c */ -#line 579 "ncgen.y" +#line 586 "ncgen.y" { int i; Dimset dimset; @@ -2360,35 +2376,35 @@ yyreduce: case 78: /* Line 1464 of yacc.c */ -#line 607 "ncgen.y" +#line 614 "ncgen.y" {(yyval.mark)=listlength(stack);;} break; case 79: /* Line 1464 of yacc.c */ -#line 608 "ncgen.y" +#line 615 "ncgen.y" {(yyval.mark)=(yyvsp[(2) - (3)].mark);;} break; case 80: /* Line 1464 of yacc.c */ -#line 612 "ncgen.y" +#line 619 "ncgen.y" {(yyval.mark)=listlength(stack); listpush(stack,(elem_t)(yyvsp[(1) - (1)].sym));;} break; case 81: /* Line 1464 of yacc.c */ -#line 614 "ncgen.y" +#line 621 "ncgen.y" {(yyval.mark)=(yyvsp[(1) - (3)].mark); listpush(stack,(elem_t)(yyvsp[(3) - (3)].sym));;} break; case 82: /* Line 1464 of yacc.c */ -#line 619 "ncgen.y" +#line 626 "ncgen.y" { /* Anonymous integer dimension. Can only occur in type definitions*/ char anon[32]; @@ -2403,7 +2419,7 @@ yyreduce: case 83: /* Line 1464 of yacc.c */ -#line 629 "ncgen.y" +#line 636 "ncgen.y" { /* Anonymous integer dimension. Can only occur in type definitions*/ char anon[32]; @@ -2422,7 +2438,7 @@ yyreduce: case 84: /* Line 1464 of yacc.c */ -#line 649 "ncgen.y" +#line 656 "ncgen.y" {Symbol* vsym = (yyvsp[(1) - (1)].sym); if(vsym->objectclass != NC_VAR) { derror("Undefined or forward referenced variable: %s",vsym->name); @@ -2435,7 +2451,7 @@ yyreduce: case 85: /* Line 1464 of yacc.c */ -#line 660 "ncgen.y" +#line 667 "ncgen.y" {Symbol* tsym = (yyvsp[(1) - (1)].sym); if(tsym->objectclass != NC_TYPE) { derror("Undefined or forward referenced type: %s",tsym->name); @@ -2448,7 +2464,7 @@ yyreduce: case 86: /* Line 1464 of yacc.c */ -#line 671 "ncgen.y" +#line 678 "ncgen.y" {Symbol* tvsym = (yyvsp[(1) - (1)].sym); Symbol* sym; /* disambiguate*/ tvsym->objectclass = NC_VAR; @@ -2472,35 +2488,35 @@ yyreduce: case 87: /* Line 1464 of yacc.c */ -#line 689 "ncgen.y" +#line 696 "ncgen.y" {(yyval.sym)=(yyvsp[(1) - (1)].sym);;} break; case 88: /* Line 1464 of yacc.c */ -#line 696 "ncgen.y" +#line 703 "ncgen.y" {;} break; case 89: /* Line 1464 of yacc.c */ -#line 696 "ncgen.y" +#line 703 "ncgen.y" {;} break; case 90: /* Line 1464 of yacc.c */ -#line 700 "ncgen.y" +#line 707 "ncgen.y" { (yyval.sym)=makeattribute((yyvsp[(2) - (4)].sym),NULL,NULL,(yyvsp[(4) - (4)].datalist),ATTRGLOBAL);;} break; case 91: /* Line 1464 of yacc.c */ -#line 702 "ncgen.y" +#line 709 "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) { (yyval.sym)=makeattribute(asym,vsym,tsym,(yyvsp[(6) - (6)].datalist),ATTRVAR); @@ -2514,7 +2530,7 @@ yyreduce: case 92: /* Line 1464 of yacc.c */ -#line 711 "ncgen.y" +#line 718 "ncgen.y" {Symbol* sym = (yyvsp[(1) - (5)].sym); Symbol* asym = (yyvsp[(3) - (5)].sym); if(sym->objectclass == NC_VAR) { (yyval.sym)=makeattribute(asym,sym,NULL,(yyvsp[(5) - (5)].datalist),ATTRVAR); @@ -2530,77 +2546,77 @@ yyreduce: case 93: /* Line 1464 of yacc.c */ -#line 722 "ncgen.y" +#line 729 "ncgen.y" {(yyval.sym) = makespecial(_FILLVALUE_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)(yyvsp[(5) - (5)].datalist),0);;} break; case 94: /* Line 1464 of yacc.c */ -#line 724 "ncgen.y" +#line 731 "ncgen.y" {(yyval.sym) = makespecial(_FILLVALUE_FLAG,(yyvsp[(2) - (6)].sym),(yyvsp[(1) - (6)].sym),(void*)(yyvsp[(6) - (6)].datalist),0);;} break; case 95: /* Line 1464 of yacc.c */ -#line 726 "ncgen.y" +#line 733 "ncgen.y" {(yyval.sym) = makespecial(_STORAGE_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);;} break; case 96: /* Line 1464 of yacc.c */ -#line 728 "ncgen.y" +#line 735 "ncgen.y" {(yyval.sym) = makespecial(_CHUNKSIZES_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)(yyvsp[(5) - (5)].datalist),0);;} break; case 97: /* Line 1464 of yacc.c */ -#line 730 "ncgen.y" +#line 737 "ncgen.y" {(yyval.sym) = makespecial(_FLETCHER32_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);;} break; case 98: /* Line 1464 of yacc.c */ -#line 732 "ncgen.y" +#line 739 "ncgen.y" {(yyval.sym) = makespecial(_DEFLATE_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);;} break; case 99: /* Line 1464 of yacc.c */ -#line 734 "ncgen.y" +#line 741 "ncgen.y" {(yyval.sym) = makespecial(_SHUFFLE_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);;} break; case 100: /* Line 1464 of yacc.c */ -#line 736 "ncgen.y" +#line 743 "ncgen.y" {(yyval.sym) = makespecial(_ENDIAN_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);;} break; case 101: /* Line 1464 of yacc.c */ -#line 738 "ncgen.y" +#line 745 "ncgen.y" {(yyval.sym) = makespecial(_NOFILL_FLAG,(yyvsp[(1) - (5)].sym),NULL,(void*)&(yyvsp[(5) - (5)].constant),1);;} break; case 102: /* Line 1464 of yacc.c */ -#line 740 "ncgen.y" +#line 747 "ncgen.y" {(yyval.sym) = makespecial(_FORMAT_FLAG,NULL,NULL,(void*)&(yyvsp[(4) - (4)].constant),1);;} break; case 103: /* Line 1464 of yacc.c */ -#line 745 "ncgen.y" +#line 752 "ncgen.y" { (yyval.sym)=(yyvsp[(1) - (1)].sym); (yyvsp[(1) - (1)].sym)->is_ref=1; @@ -2611,7 +2627,7 @@ yyreduce: case 104: /* Line 1464 of yacc.c */ -#line 751 "ncgen.y" +#line 758 "ncgen.y" { (yyval.sym)=(yyvsp[(1) - (1)].sym); (yyvsp[(1) - (1)].sym)->is_ref=1; @@ -2623,245 +2639,273 @@ yyreduce: case 106: /* Line 1464 of yacc.c */ -#line 760 "ncgen.y" +#line 767 "ncgen.y" {;} break; case 107: /* Line 1464 of yacc.c */ -#line 761 "ncgen.y" +#line 768 "ncgen.y" {;} break; case 110: /* Line 1464 of yacc.c */ -#line 769 "ncgen.y" +#line 776 "ncgen.y" {(yyvsp[(1) - (3)].sym)->data = (yyvsp[(3) - (3)].datalist);;} break; case 111: /* Line 1464 of yacc.c */ -#line 772 "ncgen.y" +#line 779 "ncgen.y" {(yyval.datalist) = (yyvsp[(1) - (1)].datalist);;} break; case 112: /* Line 1464 of yacc.c */ -#line 773 "ncgen.y" +#line 780 "ncgen.y" {(yyval.datalist) = (yyvsp[(1) - (1)].datalist);;} break; case 113: /* Line 1464 of yacc.c */ -#line 777 "ncgen.y" +#line 784 "ncgen.y" {(yyval.datalist) = builddatalist(0);;} break; case 114: /* Line 1464 of yacc.c */ -#line 781 "ncgen.y" +#line 788 "ncgen.y" {(yyval.datalist) = builddatalist(0); datalistextend((yyval.datalist),&((yyvsp[(1) - (1)].constant)));;} break; case 115: /* Line 1464 of yacc.c */ -#line 783 "ncgen.y" +#line 790 "ncgen.y" {datalistextend((yyvsp[(1) - (3)].datalist),&((yyvsp[(3) - (3)].constant))); (yyval.datalist)=(yyvsp[(1) - (3)].datalist);;} break; case 116: /* Line 1464 of yacc.c */ -#line 787 "ncgen.y" +#line 794 "ncgen.y" {(yyval.constant)=(yyvsp[(1) - (1)].constant);;} break; case 117: /* Line 1464 of yacc.c */ -#line 788 "ncgen.y" +#line 795 "ncgen.y" {(yyval.constant)=builddatasublist((yyvsp[(2) - (3)].datalist));;} break; case 118: /* Line 1464 of yacc.c */ -#line 792 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_CHAR);;} +#line 799 "ncgen.y" + {(yyval.constant)=(yyvsp[(1) - (1)].constant);;} break; case 119: /* Line 1464 of yacc.c */ -#line 793 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_BYTE);;} +#line 800 "ncgen.y" + {(yyval.constant)=makeconstdata(NC_OPAQUE);;} break; case 120: /* Line 1464 of yacc.c */ -#line 794 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_SHORT);;} +#line 801 "ncgen.y" + {(yyval.constant)=makeconstdata(NC_FILLVALUE);;} break; case 121: /* Line 1464 of yacc.c */ -#line 795 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_INT);;} - break; - - case 122: - -/* Line 1464 of yacc.c */ -#line 796 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_INT64);;} +#line 802 "ncgen.y" + {(yyval.constant)=makeenumconst((yyvsp[(1) - (1)].sym));;} break; case 123: /* Line 1464 of yacc.c */ -#line 797 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_UBYTE);;} +#line 807 "ncgen.y" + {(yyval.constant)=evaluate((yyvsp[(1) - (4)].sym),(yyvsp[(3) - (4)].datalist));;} break; case 124: /* Line 1464 of yacc.c */ -#line 798 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_USHORT);;} +#line 812 "ncgen.y" + {(yyval.datalist) = builddatalist(0); datalistextend((yyval.datalist),&((yyvsp[(1) - (1)].constant)));;} break; case 125: /* Line 1464 of yacc.c */ -#line 799 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_UINT);;} +#line 814 "ncgen.y" + {datalistextend((yyvsp[(1) - (3)].datalist),&((yyvsp[(3) - (3)].constant))); (yyval.datalist)=(yyvsp[(1) - (3)].datalist);;} break; case 126: /* Line 1464 of yacc.c */ -#line 800 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_UINT64);;} +#line 818 "ncgen.y" + {(yyval.constant)=makeconstdata(NC_CHAR);;} break; case 127: /* Line 1464 of yacc.c */ -#line 801 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_FLOAT);;} +#line 819 "ncgen.y" + {(yyval.constant)=makeconstdata(NC_BYTE);;} break; case 128: /* Line 1464 of yacc.c */ -#line 802 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_DOUBLE);;} +#line 820 "ncgen.y" + {(yyval.constant)=makeconstdata(NC_SHORT);;} break; case 129: /* Line 1464 of yacc.c */ -#line 803 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_STRING);;} +#line 821 "ncgen.y" + {(yyval.constant)=makeconstdata(NC_INT);;} break; case 130: /* Line 1464 of yacc.c */ -#line 804 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_OPAQUE);;} +#line 822 "ncgen.y" + {(yyval.constant)=makeconstdata(NC_INT64);;} break; case 131: /* Line 1464 of yacc.c */ -#line 805 "ncgen.y" - {(yyval.constant)=makeenumconst((yyvsp[(1) - (1)].sym));;} +#line 823 "ncgen.y" + {(yyval.constant)=makeconstdata(NC_UBYTE);;} break; case 132: /* Line 1464 of yacc.c */ -#line 806 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_FILLVALUE);;} +#line 824 "ncgen.y" + {(yyval.constant)=makeconstdata(NC_USHORT);;} break; case 133: /* Line 1464 of yacc.c */ -#line 810 "ncgen.y" - {(yyval.datalist) = builddatalist(0); datalistextend((yyval.datalist),&((yyvsp[(1) - (1)].constant)));;} +#line 825 "ncgen.y" + {(yyval.constant)=makeconstdata(NC_UINT);;} break; case 134: /* Line 1464 of yacc.c */ -#line 811 "ncgen.y" - {(yyval.datalist)=(yyvsp[(1) - (3)].datalist); datalistextend((yyvsp[(1) - (3)].datalist),&((yyvsp[(3) - (3)].constant)));;} +#line 826 "ncgen.y" + {(yyval.constant)=makeconstdata(NC_UINT64);;} break; case 135: /* Line 1464 of yacc.c */ -#line 816 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_INT);;} +#line 827 "ncgen.y" + {(yyval.constant)=makeconstdata(NC_FLOAT);;} break; case 136: /* Line 1464 of yacc.c */ -#line 818 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_UINT);;} +#line 828 "ncgen.y" + {(yyval.constant)=makeconstdata(NC_DOUBLE);;} break; case 137: /* Line 1464 of yacc.c */ -#line 820 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_INT64);;} +#line 829 "ncgen.y" + {(yyval.constant)=makeconstdata(NC_STRING);;} break; case 138: /* Line 1464 of yacc.c */ -#line 822 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_UINT64);;} +#line 833 "ncgen.y" + {(yyval.datalist) = builddatalist(0); datalistextend((yyval.datalist),&((yyvsp[(1) - (1)].constant)));;} break; case 139: /* Line 1464 of yacc.c */ -#line 826 "ncgen.y" - {(yyval.constant)=makeconstdata(NC_STRING);;} +#line 834 "ncgen.y" + {(yyval.datalist)=(yyvsp[(1) - (3)].datalist); datalistextend((yyvsp[(1) - (3)].datalist),&((yyvsp[(3) - (3)].constant)));;} break; case 140: /* Line 1464 of yacc.c */ -#line 830 "ncgen.y" - {(yyval.constant)=(yyvsp[(1) - (1)].constant);;} +#line 839 "ncgen.y" + {(yyval.constant)=makeconstdata(NC_INT);;} break; case 141: /* Line 1464 of yacc.c */ -#line 831 "ncgen.y" +#line 841 "ncgen.y" + {(yyval.constant)=makeconstdata(NC_UINT);;} + break; + + case 142: + +/* Line 1464 of yacc.c */ +#line 843 "ncgen.y" + {(yyval.constant)=makeconstdata(NC_INT64);;} + break; + + case 143: + +/* Line 1464 of yacc.c */ +#line 845 "ncgen.y" + {(yyval.constant)=makeconstdata(NC_UINT64);;} + break; + + case 144: + +/* Line 1464 of yacc.c */ +#line 849 "ncgen.y" + {(yyval.constant)=makeconstdata(NC_STRING);;} + break; + + case 145: + +/* Line 1464 of yacc.c */ +#line 853 "ncgen.y" + {(yyval.constant)=(yyvsp[(1) - (1)].constant);;} + break; + + case 146: + +/* Line 1464 of yacc.c */ +#line 854 "ncgen.y" {(yyval.constant)=(yyvsp[(1) - (1)].constant);;} break; /* Line 1464 of yacc.c */ -#line 2865 "ncgen.tab.c" +#line 2909 "ncgen.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -3073,7 +3117,7 @@ yyreturn: /* Line 1684 of yacc.c */ -#line 835 "ncgen.y" +#line 858 "ncgen.y" #ifndef NO_STDARG @@ -3624,3 +3668,85 @@ vercheck(int ncid) if(tmsg != NULL) markcdf4(tmsg); } +/* +Since the arguments are all simple constant, +we can evaluate the function immediately +and return its value. +*/ + +static Constant +evaluate(Symbol* fcn, Datalist* arglist) +{ + Constant result; + + /* prepare the result */ + result.lineno = fcn->lineno; + result.filled = 0; + +#if defined(HAVE_STRPTIME) && defined(HAVE_MKTIME) + if(strcasecmp(fcn->name,"time") == 0) { + result.nctype = NC_INT; + result.value.int32v = 0; + /* int time(string,string) */ + if(arglist->length != 2 + || arglist->data[0].nctype != NC_STRING + || arglist->data[1].nctype != NC_STRING) { + derror("Expected function signature: time(string,string)"); + goto done; + } else { + char* timekind = arglist->data[0].value.stringv.stringv; + char* timevalue = arglist->data[1].value.stringv.stringv; + if(strcasecmp(timekind,"timetest")==0) { + struct tm time; + memset(&time,0,sizeof(time)); + if(strptime(timevalue,TIMEFORMAT,&time) == NULL) { + derror("Malformed time string: %s",timevalue); + goto done; + } else { + result.value.int32v = (int)mktime(&time); + } + } else { + derror("Time conversion '%s' not supported",timekind); + goto done; + } + } + } else if(strcasecmp(fcn->name,"math") == 0) { + /* int match(string,string) */ + if(arglist->length != 2 + || arglist->data[0].nctype != NC_STRING + || arglist->data[1].nctype != NC_STRING) { + derror("Expected function signature: math(string,string)"); + goto done; + } else { + char* fcn = arglist->data[0].value.stringv.stringv; + char* arg = arglist->data[1].value.stringv.stringv; + double matharg = 0.0; + result.nctype = NC_INT64; + result.value.int64v = 0; + if(sscanf(arg,"%le",&matharg) != 1) { + derror("Malformed math function value: %s",arg); + goto done; + } + if(strcasecmp(fcn,"sin")==0) { + result.value.int64v = sin(matharg); + } else if(strcasecmp(fcn,"cos")==0) { + result.value.int64v = cos(matharg); + } else if(strcasecmp(fcn,"tan")==0) { + result.value.int64v = tan(matharg); + } else { + derror("Math function '%s' not supported",fcn); + goto done; + } + } + } else +#endif + { /* Unknown function */ + derror("Unknown function name: %s",fcn->name); + goto done; + } + +done: + return result; +} + + diff --git a/oc/daptab.c b/oc/daptab.c index 67e0590fa..8e461607b 100644 --- a/oc/daptab.c +++ b/oc/daptab.c @@ -1,8 +1,9 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 2.4.3. */ -/* Bison implementation for Yacc-like parsers in C +/* Skeleton implementation for Bison's Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2009, 2010 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 @@ -44,7 +45,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.5" +#define YYBISON_VERSION "2.4.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -73,7 +74,7 @@ /* Copy the first part of user declarations. */ -/* Line 268 of yacc.c */ +/* Line 189 of yacc.c */ #line 11 "dap.y" #include "config.h" @@ -81,8 +82,8 @@ int dapdebug = 0; -/* Line 268 of yacc.c */ -#line 86 "dap.tab.c" +/* Line 189 of yacc.c */ +#line 87 "dap.tab.c" /* Enabling traces. */ #ifndef YYDEBUG @@ -150,8 +151,8 @@ typedef int YYSTYPE; /* Copy the second part of user declarations. */ -/* Line 343 of yacc.c */ -#line 155 "dap.tab.c" +/* Line 264 of yacc.c */ +#line 156 "dap.tab.c" #ifdef short # undef short @@ -254,11 +255,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 @@ -281,24 +282,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 @@ -327,7 +328,23 @@ union yyalloc ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) -# define YYCOPY_NEEDED 1 +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of @@ -347,26 +364,6 @@ union yyalloc #endif -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - /* YYFINAL -- State number of the termination state. */ #define YYFINAL 9 /* YYLAST -- Last index in YYTABLE. */ @@ -559,8 +556,8 @@ static const yytype_uint8 yyr2[] = 1, 1, 1, 1, 1, 1, 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[] = { @@ -635,7 +632,8 @@ static const yytype_int8 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 -1 static const yytype_uint8 yytable[] = { @@ -678,12 +676,6 @@ static const yytype_uint8 yytable[] = 33, 34 }; -#define yypact_value_is_default(yystate) \ - ((yystate) == (-70)) - -#define yytable_value_is_error(yytable_value) \ - YYID (0) - static const yytype_int16 yycheck[] = { 37, 19, 71, 72, 1, 1, 1, 30, 0, 30, @@ -785,6 +777,7 @@ do \ { \ yychar = (Token); \ yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ @@ -826,10 +819,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 @@ -1025,6 +1027,7 @@ int yydebug; # define YYMAXDEPTH 10000 #endif + #if YYERROR_VERBOSE @@ -1127,142 +1130,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. | @@ -1297,7 +1273,6 @@ yydestruct (yymsg, yytype, yyvaluep, parsestate) } } - /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus @@ -1314,9 +1289,12 @@ int yyparse (); #endif /* ! YYPARSE_PARAM */ -/*----------. -| yyparse. | -`----------*/ + + + +/*-------------------------. +| yyparse or yypush_parse. | +`-------------------------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -1503,7 +1481,7 @@ yybackup: /* First try to decide what to do without reference to lookahead 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. */ @@ -1534,8 +1512,8 @@ 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; } @@ -1590,728 +1568,717 @@ yyreduce: { case 6: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 57 "dap.y" - {dap_unrecognizedresponse(parsestate); YYABORT;} + {dap_unrecognizedresponse(parsestate); YYABORT;;} break; case 7: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 62 "dap.y" - {dap_tagparse(parsestate,SCAN_DATASET);} + {dap_tagparse(parsestate,SCAN_DATASET);;} break; case 8: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 66 "dap.y" - {dap_tagparse(parsestate,SCAN_ATTR);} + {dap_tagparse(parsestate,SCAN_ATTR);;} break; case 9: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 70 "dap.y" - {dap_tagparse(parsestate,SCAN_ERROR);} + {dap_tagparse(parsestate,SCAN_ERROR);;} break; case 10: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 75 "dap.y" - {dap_datasetbody(parsestate,(yyvsp[(4) - (5)]),(yyvsp[(2) - (5)]));} + {dap_datasetbody(parsestate,(yyvsp[(4) - (5)]),(yyvsp[(2) - (5)]));;} break; case 11: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 80 "dap.y" - {(yyval)=dap_declarations(parsestate,null,null);} + {(yyval)=dap_declarations(parsestate,null,null);;} break; case 12: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 81 "dap.y" - {(yyval)=dap_declarations(parsestate,(yyvsp[(1) - (2)]),(yyvsp[(2) - (2)]));} + {(yyval)=dap_declarations(parsestate,(yyvsp[(1) - (2)]),(yyvsp[(2) - (2)]));;} break; case 13: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 88 "dap.y" - {(yyval)=dap_makebase(parsestate,(yyvsp[(2) - (4)]),(yyvsp[(1) - (4)]),(yyvsp[(3) - (4)]));} + {(yyval)=dap_makebase(parsestate,(yyvsp[(2) - (4)]),(yyvsp[(1) - (4)]),(yyvsp[(3) - (4)]));;} break; case 14: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 90 "dap.y" - {if(((yyval)=dap_makestructure(parsestate,(yyvsp[(5) - (7)]),(yyvsp[(6) - (7)]),(yyvsp[(3) - (7)])))==null) {YYABORT;}} + {if(((yyval)=dap_makestructure(parsestate,(yyvsp[(5) - (7)]),(yyvsp[(6) - (7)]),(yyvsp[(3) - (7)])))==null) {YYABORT;};} break; case 15: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 92 "dap.y" - {if(((yyval)=dap_makesequence(parsestate,(yyvsp[(5) - (6)]),(yyvsp[(3) - (6)])))==null) {YYABORT;}} + {if(((yyval)=dap_makesequence(parsestate,(yyvsp[(5) - (6)]),(yyvsp[(3) - (6)])))==null) {YYABORT;};} break; case 16: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 95 "dap.y" - {if(((yyval)=dap_makegrid(parsestate,(yyvsp[(10) - (11)]),(yyvsp[(5) - (11)]),(yyvsp[(8) - (11)])))==null) {YYABORT;}} + {if(((yyval)=dap_makegrid(parsestate,(yyvsp[(10) - (11)]),(yyvsp[(5) - (11)]),(yyvsp[(8) - (11)])))==null) {YYABORT;};} break; case 17: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 97 "dap.y" - {daperror(parsestate,"Unrecognized type"); YYABORT;} + {daperror(parsestate,"Unrecognized type"); YYABORT;;} break; case 18: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 102 "dap.y" - {(yyval)=(Object)SCAN_BYTE;} + {(yyval)=(Object)SCAN_BYTE;;} break; case 19: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 103 "dap.y" - {(yyval)=(Object)SCAN_INT16;} + {(yyval)=(Object)SCAN_INT16;;} break; case 20: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 104 "dap.y" - {(yyval)=(Object)SCAN_UINT16;} + {(yyval)=(Object)SCAN_UINT16;;} break; case 21: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 105 "dap.y" - {(yyval)=(Object)SCAN_INT32;} + {(yyval)=(Object)SCAN_INT32;;} break; case 22: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 106 "dap.y" - {(yyval)=(Object)SCAN_UINT32;} + {(yyval)=(Object)SCAN_UINT32;;} break; case 23: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 107 "dap.y" - {(yyval)=(Object)SCAN_FLOAT32;} + {(yyval)=(Object)SCAN_FLOAT32;;} break; case 24: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 108 "dap.y" - {(yyval)=(Object)SCAN_FLOAT64;} + {(yyval)=(Object)SCAN_FLOAT64;;} break; case 25: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 109 "dap.y" - {(yyval)=(Object)SCAN_URL;} + {(yyval)=(Object)SCAN_URL;;} break; case 26: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 110 "dap.y" - {(yyval)=(Object)SCAN_STRING;} + {(yyval)=(Object)SCAN_STRING;;} break; case 27: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 114 "dap.y" - {(yyval)=dap_arraydecls(parsestate,null,null);} + {(yyval)=dap_arraydecls(parsestate,null,null);;} break; case 28: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 115 "dap.y" - {(yyval)=dap_arraydecls(parsestate,(yyvsp[(1) - (2)]),(yyvsp[(2) - (2)]));} + {(yyval)=dap_arraydecls(parsestate,(yyvsp[(1) - (2)]),(yyvsp[(2) - (2)]));;} break; case 29: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 119 "dap.y" - {(yyval)=dap_arraydecl(parsestate,null,(yyvsp[(2) - (3)]));} + {(yyval)=dap_arraydecl(parsestate,null,(yyvsp[(2) - (3)]));;} break; case 30: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 120 "dap.y" - {(yyval)=dap_arraydecl(parsestate,null,(yyvsp[(3) - (4)]));} + {(yyval)=dap_arraydecl(parsestate,null,(yyvsp[(3) - (4)]));;} break; case 31: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 121 "dap.y" - {(yyval)=dap_arraydecl(parsestate,(yyvsp[(2) - (5)]),(yyvsp[(4) - (5)]));} + {(yyval)=dap_arraydecl(parsestate,(yyvsp[(2) - (5)]),(yyvsp[(4) - (5)]));;} break; case 32: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 123 "dap.y" - {daperror(parsestate,"Illegal dimension declaration"); YYABORT;} + {daperror(parsestate,"Illegal dimension declaration"); YYABORT;;} break; case 33: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 127 "dap.y" - {(yyval)=(yyvsp[(1) - (1)]);} + {(yyval)=(yyvsp[(1) - (1)]);;} break; case 34: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 129 "dap.y" - {daperror(parsestate,"Illegal dataset declaration"); YYABORT;} + {daperror(parsestate,"Illegal dataset declaration"); YYABORT;;} break; case 35: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 132 "dap.y" - {(yyval)=(yyvsp[(1) - (1)]);} + {(yyval)=(yyvsp[(1) - (1)]);;} break; case 36: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 135 "dap.y" - {dap_attributebody(parsestate,(yyvsp[(2) - (3)]));} + {dap_attributebody(parsestate,(yyvsp[(2) - (3)]));;} break; case 37: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 137 "dap.y" - {daperror(parsestate,"Illegal DAS body"); YYABORT;} + {daperror(parsestate,"Illegal DAS body"); YYABORT;;} break; case 38: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 141 "dap.y" - {(yyval)=dap_attrlist(parsestate,null,null);} + {(yyval)=dap_attrlist(parsestate,null,null);;} break; case 39: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 142 "dap.y" - {(yyval)=dap_attrlist(parsestate,(yyvsp[(1) - (2)]),(yyvsp[(2) - (2)]));} + {(yyval)=dap_attrlist(parsestate,(yyvsp[(1) - (2)]),(yyvsp[(2) - (2)]));;} break; case 40: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 146 "dap.y" - {(yyval)=null;} + {(yyval)=null;;} break; case 41: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 148 "dap.y" - {(yyval)=dap_attribute(parsestate,(yyvsp[(2) - (4)]),(yyvsp[(3) - (4)]),(Object)SCAN_BYTE);} + {(yyval)=dap_attribute(parsestate,(yyvsp[(2) - (4)]),(yyvsp[(3) - (4)]),(Object)SCAN_BYTE);;} break; case 42: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 150 "dap.y" - {(yyval)=dap_attribute(parsestate,(yyvsp[(2) - (4)]),(yyvsp[(3) - (4)]),(Object)SCAN_INT16);} + {(yyval)=dap_attribute(parsestate,(yyvsp[(2) - (4)]),(yyvsp[(3) - (4)]),(Object)SCAN_INT16);;} break; case 43: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 152 "dap.y" - {(yyval)=dap_attribute(parsestate,(yyvsp[(2) - (4)]),(yyvsp[(3) - (4)]),(Object)SCAN_UINT16);} + {(yyval)=dap_attribute(parsestate,(yyvsp[(2) - (4)]),(yyvsp[(3) - (4)]),(Object)SCAN_UINT16);;} break; case 44: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 154 "dap.y" - {(yyval)=dap_attribute(parsestate,(yyvsp[(2) - (4)]),(yyvsp[(3) - (4)]),(Object)SCAN_INT32);} + {(yyval)=dap_attribute(parsestate,(yyvsp[(2) - (4)]),(yyvsp[(3) - (4)]),(Object)SCAN_INT32);;} break; case 45: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 156 "dap.y" - {(yyval)=dap_attribute(parsestate,(yyvsp[(2) - (4)]),(yyvsp[(3) - (4)]),(Object)SCAN_UINT32);} + {(yyval)=dap_attribute(parsestate,(yyvsp[(2) - (4)]),(yyvsp[(3) - (4)]),(Object)SCAN_UINT32);;} break; case 46: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 158 "dap.y" - {(yyval)=dap_attribute(parsestate,(yyvsp[(2) - (4)]),(yyvsp[(3) - (4)]),(Object)SCAN_FLOAT32);} + {(yyval)=dap_attribute(parsestate,(yyvsp[(2) - (4)]),(yyvsp[(3) - (4)]),(Object)SCAN_FLOAT32);;} break; case 47: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 160 "dap.y" - {(yyval)=dap_attribute(parsestate,(yyvsp[(2) - (4)]),(yyvsp[(3) - (4)]),(Object)SCAN_FLOAT64);} + {(yyval)=dap_attribute(parsestate,(yyvsp[(2) - (4)]),(yyvsp[(3) - (4)]),(Object)SCAN_FLOAT64);;} break; case 48: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 162 "dap.y" - {(yyval)=dap_attribute(parsestate,(yyvsp[(2) - (4)]),(yyvsp[(3) - (4)]),(Object)SCAN_STRING);} + {(yyval)=dap_attribute(parsestate,(yyvsp[(2) - (4)]),(yyvsp[(3) - (4)]),(Object)SCAN_STRING);;} break; case 49: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 164 "dap.y" - {(yyval)=dap_attribute(parsestate,(yyvsp[(2) - (4)]),(yyvsp[(3) - (4)]),(Object)SCAN_URL);} + {(yyval)=dap_attribute(parsestate,(yyvsp[(2) - (4)]),(yyvsp[(3) - (4)]),(Object)SCAN_URL);;} break; case 50: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 165 "dap.y" - {(yyval)=dap_attrset(parsestate,(yyvsp[(1) - (4)]),(yyvsp[(3) - (4)]));} + {(yyval)=dap_attrset(parsestate,(yyvsp[(1) - (4)]),(yyvsp[(3) - (4)]));;} break; case 51: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 167 "dap.y" - {daperror(parsestate,"Illegal attribute"); YYABORT;} + {daperror(parsestate,"Illegal attribute"); YYABORT;;} break; case 52: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 171 "dap.y" - {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[(1) - (1)]),(Object)SCAN_BYTE);} + {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[(1) - (1)]),(Object)SCAN_BYTE);;} break; case 53: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 173 "dap.y" - {(yyval)=dap_attrvalue(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),(Object)SCAN_BYTE);} + {(yyval)=dap_attrvalue(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),(Object)SCAN_BYTE);;} break; case 54: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 176 "dap.y" - {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[(1) - (1)]),(Object)SCAN_INT16);} + {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[(1) - (1)]),(Object)SCAN_INT16);;} break; case 55: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 178 "dap.y" - {(yyval)=dap_attrvalue(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),(Object)SCAN_INT16);} + {(yyval)=dap_attrvalue(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),(Object)SCAN_INT16);;} break; case 56: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 181 "dap.y" - {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[(1) - (1)]),(Object)SCAN_UINT16);} + {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[(1) - (1)]),(Object)SCAN_UINT16);;} break; case 57: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 183 "dap.y" - {(yyval)=dap_attrvalue(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),(Object)SCAN_UINT16);} + {(yyval)=dap_attrvalue(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),(Object)SCAN_UINT16);;} break; case 58: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 186 "dap.y" - {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[(1) - (1)]),(Object)SCAN_INT32);} + {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[(1) - (1)]),(Object)SCAN_INT32);;} break; case 59: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 188 "dap.y" - {(yyval)=dap_attrvalue(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),(Object)SCAN_INT32);} + {(yyval)=dap_attrvalue(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),(Object)SCAN_INT32);;} break; case 60: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 191 "dap.y" - {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[(1) - (1)]),(Object)SCAN_UINT32);} + {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[(1) - (1)]),(Object)SCAN_UINT32);;} break; case 61: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 192 "dap.y" - {(yyval)=dap_attrvalue(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),(Object)SCAN_UINT32);} + {(yyval)=dap_attrvalue(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),(Object)SCAN_UINT32);;} break; case 62: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 195 "dap.y" - {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[(1) - (1)]),(Object)SCAN_FLOAT32);} + {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[(1) - (1)]),(Object)SCAN_FLOAT32);;} break; case 63: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 196 "dap.y" - {(yyval)=dap_attrvalue(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),(Object)SCAN_FLOAT32);} + {(yyval)=dap_attrvalue(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),(Object)SCAN_FLOAT32);;} break; case 64: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 199 "dap.y" - {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[(1) - (1)]),(Object)SCAN_FLOAT64);} + {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[(1) - (1)]),(Object)SCAN_FLOAT64);;} break; case 65: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 200 "dap.y" - {(yyval)=dap_attrvalue(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),(Object)SCAN_FLOAT64);} + {(yyval)=dap_attrvalue(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),(Object)SCAN_FLOAT64);;} break; case 66: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 203 "dap.y" - {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[(1) - (1)]),(Object)SCAN_STRING);} + {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[(1) - (1)]),(Object)SCAN_STRING);;} break; case 67: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 204 "dap.y" - {(yyval)=dap_attrvalue(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),(Object)SCAN_STRING);} + {(yyval)=dap_attrvalue(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),(Object)SCAN_STRING);;} break; case 68: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 208 "dap.y" - {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[(1) - (1)]),(Object)SCAN_URL);} + {(yyval)=dap_attrvalue(parsestate,null,(yyvsp[(1) - (1)]),(Object)SCAN_URL);;} break; case 69: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 209 "dap.y" - {(yyval)=dap_attrvalue(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),(Object)SCAN_URL);} + {(yyval)=dap_attrvalue(parsestate,(yyvsp[(1) - (3)]),(yyvsp[(3) - (3)]),(Object)SCAN_URL);;} break; case 70: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 213 "dap.y" - {(yyval)=(yyvsp[(1) - (1)]);} + {(yyval)=(yyvsp[(1) - (1)]);;} break; case 71: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 217 "dap.y" - {(yyval)=(yyvsp[(1) - (1)]);} + {(yyval)=(yyvsp[(1) - (1)]);;} break; case 72: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 218 "dap.y" - {(yyval)=(yyvsp[(1) - (1)]);} + {(yyval)=(yyvsp[(1) - (1)]);;} break; case 73: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 229 "dap.y" - {(yyval)=(yyvsp[(2) - (3)]); (yyval)=(yyvsp[(3) - (3)]); (yyval)=null;} + {(yyval)=(yyvsp[(2) - (3)]); (yyval)=(yyvsp[(3) - (3)]); (yyval)=null;;} break; case 74: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 234 "dap.y" - {dap_errorbody(parsestate,(yyvsp[(2) - (7)]),(yyvsp[(3) - (7)]),(yyvsp[(4) - (7)]),(yyvsp[(5) - (7)]));} + {dap_errorbody(parsestate,(yyvsp[(2) - (7)]),(yyvsp[(3) - (7)]),(yyvsp[(4) - (7)]),(yyvsp[(5) - (7)]));;} break; case 75: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 237 "dap.y" - {(yyval)=null;} + {(yyval)=null;;} break; case 76: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 237 "dap.y" - {(yyval)=(yyvsp[(3) - (4)]);} + {(yyval)=(yyvsp[(3) - (4)]);;} break; case 77: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 238 "dap.y" - {(yyval)=null;} + {(yyval)=null;;} break; case 78: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 238 "dap.y" - {(yyval)=(yyvsp[(3) - (4)]);} + {(yyval)=(yyvsp[(3) - (4)]);;} break; case 79: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 239 "dap.y" - {(yyval)=null;} + {(yyval)=null;;} break; case 80: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 239 "dap.y" - {(yyval)=(yyvsp[(3) - (4)]);} + {(yyval)=(yyvsp[(3) - (4)]);;} break; case 81: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 240 "dap.y" - {(yyval)=null;} + {(yyval)=null;;} break; case 82: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 240 "dap.y" - {(yyval)=(yyvsp[(3) - (4)]);} + {(yyval)=(yyvsp[(3) - (4)]);;} break; case 83: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 246 "dap.y" - {(yyval)=((yyvsp[(1) - (1)]));} + {(yyval)=((yyvsp[(1) - (1)]));;} break; case 84: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 247 "dap.y" - {(yyval)=strdup("alias");} + {(yyval)=strdup("alias");;} break; case 85: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 248 "dap.y" - {(yyval)=strdup("array");} + {(yyval)=strdup("array");;} break; case 86: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 249 "dap.y" - {(yyval)=strdup("attributes");} + {(yyval)=strdup("attributes");;} break; case 87: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 250 "dap.y" - {(yyval)=strdup("byte");} + {(yyval)=strdup("byte");;} break; case 88: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 251 "dap.y" - {(yyval)=strdup("dataset");} + {(yyval)=strdup("dataset");;} break; case 89: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 252 "dap.y" - {(yyval)=strdup("data");} + {(yyval)=strdup("data");;} break; case 90: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 253 "dap.y" - {(yyval)=strdup("error");} + {(yyval)=strdup("error");;} break; case 91: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 254 "dap.y" - {(yyval)=strdup("float32");} + {(yyval)=strdup("float32");;} break; case 92: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 255 "dap.y" - {(yyval)=strdup("float64");} + {(yyval)=strdup("float64");;} break; case 93: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 256 "dap.y" - {(yyval)=strdup("grid");} + {(yyval)=strdup("grid");;} break; case 94: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 257 "dap.y" - {(yyval)=strdup("int16");} + {(yyval)=strdup("int16");;} break; case 95: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 258 "dap.y" - {(yyval)=strdup("int32");} + {(yyval)=strdup("int32");;} break; case 96: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 259 "dap.y" - {(yyval)=strdup("maps");} + {(yyval)=strdup("maps");;} break; case 97: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 260 "dap.y" - {(yyval)=strdup("sequence");} + {(yyval)=strdup("sequence");;} break; case 98: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 261 "dap.y" - {(yyval)=strdup("string");} + {(yyval)=strdup("string");;} break; case 99: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 262 "dap.y" - {(yyval)=strdup("structure");} + {(yyval)=strdup("structure");;} break; case 100: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 263 "dap.y" - {(yyval)=strdup("uint16");} + {(yyval)=strdup("uint16");;} break; case 101: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 264 "dap.y" - {(yyval)=strdup("uint32");} + {(yyval)=strdup("uint32");;} break; case 102: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 265 "dap.y" - {(yyval)=strdup("url");} + {(yyval)=strdup("url");;} break; case 103: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 266 "dap.y" - {(yyval)=strdup("code");} + {(yyval)=strdup("code");;} break; case 104: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 267 "dap.y" - {(yyval)=strdup("message");} + {(yyval)=strdup("message");;} break; case 105: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 268 "dap.y" - {(yyval)=strdup("program");} + {(yyval)=strdup("program");;} break; case 106: -/* Line 1806 of yacc.c */ +/* Line 1464 of yacc.c */ #line 269 "dap.y" - {(yyval)=strdup("program_type");} + {(yyval)=strdup("program_type");;} break; -/* Line 1806 of yacc.c */ -#line 2302 "dap.tab.c" +/* Line 1464 of yacc.c */ +#line 2280 "dap.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); @@ -2339,10 +2306,6 @@ yyreduce: | 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) { @@ -2350,36 +2313,37 @@ yyerrlab: #if ! YYERROR_VERBOSE yyerror (parsestate, 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 (parsestate, 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 (parsestate, yymsg); + } + else + { + yyerror (parsestate, YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } } -# undef YYSYNTAX_ERROR #endif } @@ -2438,7 +2402,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) @@ -2497,13 +2461,8 @@ yyexhaustedlab: 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, parsestate); - } + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, parsestate); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -2528,7 +2487,7 @@ yyreturn: -/* Line 2067 of yacc.c */ +/* Line 1684 of yacc.c */ #line 272 "dap.y" diff --git a/oc/daptab.h b/oc/daptab.h index e085df562..f5341cfc5 100644 --- a/oc/daptab.h +++ b/oc/daptab.h @@ -1,8 +1,9 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 2.4.3. */ -/* Bison interface for Yacc-like parsers in C +/* Skeleton interface for Bison's Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2009, 2010 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 diff --git a/oc/ocuri.h b/oc/ocuri.h index 892419dbf..05ca8c18c 100644 --- a/oc/ocuri.h +++ b/oc/ocuri.h @@ -27,14 +27,13 @@ extern void ocurifree(OCURI* ocuri); /* Replace the constraints */ extern void ocurisetconstraints(OCURI*,const char* constraints); -/* Construct a complete OC URI; caller frees returned string */ - /* Define flags to control what is included */ #define OCURICONSTRAINTS 1 #define OCURIUSERPWD 2 #define OCURIPARAMS 4 #define OCURIENCODE 8 /* If output should be encoded */ +/* Construct a complete OC URI; caller frees returned string */ extern char* ocuribuild(OCURI*,const char* prefix, const char* suffix, int flags);