Blob Blame History Raw
diff -up netcdf-4.1.1/libncdap3/oc/daplex.c.dap netcdf-4.1.1/libncdap3/oc/daplex.c
--- netcdf-4.1.1/libncdap3/oc/daplex.c.dap	2013-03-22 11:43:28.933640833 -0600
+++ netcdf-4.1.1/libncdap3/oc/daplex.c	2013-03-22 11:43:38.946596288 -0600
@@ -2,6 +2,7 @@
    See the COPYRIGHT file for more information. */
 
 #include "dapparselex.h"
+#include "daptab.h"
 
 #define URLCVT
 
diff -up netcdf-4.1.1/libncdap3/oc/dapparse.c.dap netcdf-4.1.1/libncdap3/oc/dapparse.c
--- netcdf-4.1.1/libncdap3/oc/dapparse.c.dap	2010-04-01 17:33:24.000000000 -0600
+++ netcdf-4.1.1/libncdap3/oc/dapparse.c	2013-03-22 11:43:14.710704133 -0600
@@ -2,6 +2,7 @@
    See the COPYRIGHT file for more information. */
 
 #include "dapparselex.h"
+#include "daptab.h"
 
 extern int dapparse(DAPparsestate*);
 
@@ -19,7 +20,7 @@ static int check_int32(char* val, long*
 
 
 Object
-datasetbody(DAPparsestate* state, Object name, Object decls)
+dap_datasetbody(DAPparsestate* state, Object name, Object decls)
 {
     OCnode* node = newocnode((char*)name,OC_Dataset,state);
     node->subnodes = (OClist*)decls;
@@ -32,7 +33,7 @@ datasetbody(DAPparsestate* state, Object
 }
 
 Object
-attributebody(DAPparsestate* state, Object attrlist)
+dap_attributebody(DAPparsestate* state, Object attrlist)
 {
     OCnode* node = newocnode(NULL,OC_Attributeset,state);
     OCASSERT((state->root == NULL));
@@ -45,7 +46,7 @@ attributebody(DAPparsestate* state, Obje
 }
 
 Object
-errorbody(DAPparsestate* state, Object code, Object msg)
+dap_errorbody(DAPparsestate* state, Object code, Object msg)
 {
     state->svcerror = 1;
     state->code = strdup((char*)code);
@@ -54,13 +55,13 @@ errorbody(DAPparsestate* state, Object c
 }
 
 Object
-unrecognizedresponse(DAPparsestate* state)
+dap_unrecognizedresponse(DAPparsestate* state)
 {
-    return errorbody(state,"0",state->lexstate->input);
+    return dap_errorbody(state,"0",state->lexstate->input);
 }
 
 Object
-declarations(DAPparsestate* state, Object decls, Object decl)
+dap_declarations(DAPparsestate* state, Object decls, Object decl)
 {
     OClist* alist = (OClist*)decls;
     if(alist == NULL)
@@ -71,7 +72,7 @@ declarations(DAPparsestate* state, Objec
 }
 
 Object
-arraydecls(DAPparsestate* state, Object arraydecls, Object arraydecl)
+dap_arraydecls(DAPparsestate* state, Object arraydecls, Object arraydecl)
 {
     OClist* alist = (OClist*)arraydecls;
     if(alist == NULL)
@@ -82,7 +83,7 @@ arraydecls(DAPparsestate* state, Object
 }
 
 Object
-arraydecl(DAPparsestate* state, Object name, Object size)
+dap_arraydecl(DAPparsestate* state, Object name, Object size)
 {
     long value;
     OCnode* dim;
@@ -97,7 +98,7 @@ arraydecl(DAPparsestate* state, Object n
 }
 
 Object
-attrlist(DAPparsestate* state, Object attrlist, Object attrtuple)
+dap_attrlist(DAPparsestate* state, Object attrlist, Object attrtuple)
 {
     OClist* alist = (OClist*)attrlist;
     if(alist == NULL)
@@ -117,7 +118,7 @@ attrlist(DAPparsestate* state, Object at
 }
 
 Object
-attrvalue(DAPparsestate* state, Object valuelist, Object value, Object etype)
+dap_attrvalue(DAPparsestate* state, Object valuelist, Object value, Object etype)
 {
     OClist* alist = (OClist*)valuelist;
     if(alist == NULL) alist = oclistnew();
@@ -128,7 +129,7 @@ attrvalue(DAPparsestate* state, Object v
 }
 
 Object
-attribute(DAPparsestate* state, Object name, Object values, Object etype)
+dap_attribute(DAPparsestate* state, Object name, Object values, Object etype)
 {
     OCnode* att;
     att = newocnode((char*)name,OC_Attribute,state);
@@ -138,7 +139,7 @@ attribute(DAPparsestate* state, Object n
 }
 
 Object
-attrset(DAPparsestate* state, Object name, Object attributes)
+dap_attrset(DAPparsestate* state, Object name, Object attributes)
 {
     OCnode* attset;
     attset = newocnode((char*)name,OC_Attributeset,state);
@@ -199,7 +200,7 @@ dimnameanon(char* basename, unsigned int
 }
 
 Object
-makebase(DAPparsestate* state, Object name, Object etype, Object dimensions)
+dap_makebase(DAPparsestate* state, Object name, Object etype, Object dimensions)
 {
     OCnode* node;
     node = newocnode((char*)name,OC_Primitive,state);
@@ -209,7 +210,7 @@ makebase(DAPparsestate* state, Object na
 }
 
 Object
-makestructure(DAPparsestate* state, Object name, Object dimensions, Object fields)
+dap_makestructure(DAPparsestate* state, Object name, Object dimensions, Object fields)
 {
     OCnode* node;
     char* dupname;    
@@ -225,7 +226,7 @@ makestructure(DAPparsestate* state, Obje
 }
 
 Object
-makesequence(DAPparsestate* state, Object name, Object members)
+dap_makesequence(DAPparsestate* state, Object name, Object members)
 {
     OCnode* node;
     char* dupname;    
@@ -240,7 +241,7 @@ makesequence(DAPparsestate* state, Objec
 }
 
 Object
-makegrid(DAPparsestate* state, Object name, Object arraydecl, Object mapdecls)
+dap_makegrid(DAPparsestate* state, Object name, Object arraydecl, Object mapdecls)
 {
     OCnode* node;
     /* Check for duplicate map names */
diff -up netcdf-4.1.1/libncdap3/oc/dapparselex.h.dap netcdf-4.1.1/libncdap3/oc/dapparselex.h
--- netcdf-4.1.1/libncdap3/oc/dapparselex.h.dap	2010-04-01 17:33:24.000000000 -0600
+++ netcdf-4.1.1/libncdap3/oc/dapparselex.h	2013-03-22 11:40:43.271384078 -0600
@@ -6,12 +6,6 @@
 
 #include "ocinternal.h"
 #include "ocdebug.h"
-#ifdef USE_DAP
-/* To avoid "make distclean" wiping out dap.tab.h */
-#include "daptab.h"
-#else
-#include "dap.tab.h"
-#endif
 
 #ifdef WIN32
 #define strcasecmp stricmp
@@ -73,26 +67,32 @@ typedef struct DAPparsestate {
 extern int yylex (YYSTYPE*, DAPparsestate*);
 extern int yyerror(DAPparsestate*,char*);
 
+extern void dassetup(DAPparsestate* state);
 extern void dap_parse_error(DAPparsestate*,const char *fmt, ...);
-
-extern Object datasetbody(DAPparsestate*,Object decls, Object name);
-extern Object declarations(DAPparsestate*,Object decls, Object decl);
-extern Object arraydecls(DAPparsestate*,Object arraydecls, Object arraydecl);
-extern Object arraydecl(DAPparsestate*,Object name, Object size);
-
-extern void attributesetup(DAPparsestate*);
-extern Object attributebody(DAPparsestate*,Object attrlist);
-extern Object attrlist(DAPparsestate*,Object attrlist, Object attrtuple);
-extern Object attribute(DAPparsestate*,Object name, Object value, Object etype);
-extern Object attrset(DAPparsestate*,Object name, Object attributes);
-extern Object attrvalue(DAPparsestate*,Object valuelist, Object value, Object etype);
-
-extern Object makebase(DAPparsestate*,Object name, Object etype, Object dimensions);
-extern Object makestructure(DAPparsestate*,Object name, Object dimensions, Object fields);
-extern Object makesequence(DAPparsestate*,Object name, Object members);
-extern Object makegrid(DAPparsestate*,Object name, Object arraydecl, Object mapdecls);
-
-extern Object errorbody(DAPparsestate*, Object code, Object msg);
-extern Object unrecognizedresponse(DAPparsestate*);
+extern Object dap_datasetbody(DAPparsestate*,Object decls, Object name);
+extern Object dap_declarations(DAPparsestate*,Object decls, Object decl);
+extern Object dap_arraydecls(DAPparsestate*,Object arraydecls, Object arraydecl);
+extern Object dap_arraydecl(DAPparsestate*,Object name, Object size);
+
+extern void dap_attributesetup(DAPparsestate*);
+extern Object dap_attributebody(DAPparsestate*,Object attrlist);
+extern Object dap_attrlist(DAPparsestate*,Object attrlist, Object attrtuple);
+extern Object dap_attribute(DAPparsestate*,Object name, Object value, Object etype);
+extern Object dap_attrset(DAPparsestate*,Object name, Object attributes);
+extern Object dap_attrvalue(DAPparsestate*,Object valuelist, Object value, Object etype);
+
+extern Object dap_makebase(DAPparsestate*,Object name, Object etype, Object dimensions);
+extern Object dap_makestructure(DAPparsestate*,Object name, Object dimensions, Object fields);
+extern Object dap_makesequence(DAPparsestate*,Object name, Object members);
+extern Object dap_makegrid(DAPparsestate*,Object name, Object arraydecl, Object mapdecls);
+
+extern Object dap_errorbody(DAPparsestate*, Object code, Object msg);
+extern Object dap_unrecognizedresponse(DAPparsestate*);
+
+/* Lexer entry points */
+extern int daplex(YYSTYPE*, DAPparsestate*);
+extern void daplexinit(char* input, Lexstate** lexstatep);
+extern void daplexcleanup(Lexstate** lexstatep);
+extern void dapsetwordchars(Lexstate* lexstate, int kind);
 
 #endif /*DAPPARSELEX_H*/
diff -up netcdf-4.1.1/libncdap3/oc/dap.y.dap netcdf-4.1.1/libncdap3/oc/dap.y
--- netcdf-4.1.1/libncdap3/oc/dap.y.dap	2010-04-01 17:33:23.000000000 -0600
+++ netcdf-4.1.1/libncdap3/oc/dap.y	2013-03-22 11:34:25.689059778 -0600
@@ -1,12 +1,10 @@
 /* Copyright 2009, UCAR/Unidata and OPeNDAP, Inc.
    See the COPYRIGHT file for more information. */
 
-%{
-#include "dapparselex.h"
-%}
 %pure-parser
 %lex-param {DAPparsestate* parsestate}
 %parse-param {DAPparsestate* parsestate}
+%{#include "dapparselex.h"%}
 
 %token SCAN_ALIAS 
 %token SCAN_ARRAY
@@ -51,30 +49,30 @@ start:
 	| SCAN_ATTR dassetup attributebody
 	| SCAN_ERROR errorbody
         | error
-            {$$=unrecognizedresponse(parsestate);}
+            {$$=dap_unrecognizedresponse(parsestate);}
 	;
 
 datasetbody:
 	  '{' declarations '}' datasetname ';'
-		{$$=datasetbody(parsestate,$4,$2);}
+		{$$=dap_datasetbody(parsestate,$4,$2);}
 	;
 
 declarations:
-	  /* empty */ {$$=declarations(parsestate,null,null);}
-        | declarations declaration {$$=declarations(parsestate,$1,$2);}
+	  /* empty */ {$$=dap_declarations(parsestate,null,null);}
+        | declarations declaration {$$=dap_declarations(parsestate,$1,$2);}
 	;
 
 /* 01/21/08: James says: no dimensions for grids or sequences */
 /* 05/08/09: James says: no duplicate map names */
 declaration:
 	  base_type var_name array_decls ';'
-		{$$=makebase(parsestate,$2,$1,$3);}
+		{$$=dap_makebase(parsestate,$2,$1,$3);}
 	| SCAN_STRUCTURE '{' declarations '}' var_name array_decls ';'
-	    {if(($$ = makestructure(parsestate,$5,$6,$3))==null) {YYABORT;}}
+	    {if(($$ = dap_makestructure(parsestate,$5,$6,$3))==null) {YYABORT;}}
 	| SCAN_SEQUENCE '{' declarations '}' var_name ';'
-	    {if(($$ = makesequence(parsestate,$5,$3))==null) {YYABORT;}}
+	    {if(($$ = dap_makesequence(parsestate,$5,$3))==null) {YYABORT;}}
 	| SCAN_GRID '{' SCAN_ARRAY ':' declaration SCAN_MAPS ':' declarations '}' var_name ';'
-	    {if(($$ = makegrid(parsestate,$10,$5,$8))==null) {YYABORT;}}
+	    {if(($$ = dap_makegrid(parsestate,$10,$5,$8))==null) {YYABORT;}}
         | error 
             {yyerror(parsestate,"Unrecognized type"); YYABORT;}
 	;
@@ -93,13 +91,13 @@ base_type:
 	;
 
 array_decls:
-	  /* empty */ {$$=arraydecls(parsestate,null,null);}
-	| array_decls array_decl {$$=arraydecls(parsestate,$1,$2);}
+	  /* empty */ {$$=dap_arraydecls(parsestate,null,null);}
+	| array_decls array_decl {$$=dap_arraydecls(parsestate,$1,$2);}
 	;
 
 array_decl:
-	   '[' SCAN_WORD ']' {$$=arraydecl(parsestate,null,$2);}
-	 | '[' name '=' SCAN_WORD ']' {$$=arraydecl(parsestate,$2,$4);}
+	   '[' SCAN_WORD ']' {$$=dap_arraydecl(parsestate,null,$2);}
+	 | '[' name '=' SCAN_WORD ']' {$$=dap_arraydecl(parsestate,$2,$4);}
 	 | error
 	    {yyerror(parsestate,"Illegal dimension declaration"); YYABORT;}
 	;
@@ -115,81 +113,81 @@ var_name: name {$$=$1;};
 dassetup: {dassetup(parsestate);}
 
 attributebody:
-	  '{' attr_list '}' {$$=attributebody(parsestate,$2);}
+	  '{' attr_list '}' {$$=dap_attributebody(parsestate,$2);}
 	| error
             {yyerror(parsestate,"Illegal DAS body"); YYABORT;}
 	;
 
 attr_list:
-	  /* empty */ {$$=attrlist(parsestate,null,null);}
-	| attr_list attribute {$$=attrlist(parsestate,$1,$2);}
+	  /* empty */ {$$=dap_attrlist(parsestate,null,null);}
+	| attr_list attribute {$$=dap_attrlist(parsestate,$1,$2);}
 	;
 
 attribute:
 	  alias ';' {$$=null;} /* ignored */ 
         | SCAN_BYTE name bytes ';'
-	    {$$=attribute(parsestate,$2,$3,(Object)SCAN_BYTE);}
+	    {$$=dap_attribute(parsestate,$2,$3,(Object)SCAN_BYTE);}
 	| SCAN_INT16 name int16 ';'
-	    {$$=attribute(parsestate,$2,$3,(Object)SCAN_INT16);}
+	    {$$=dap_attribute(parsestate,$2,$3,(Object)SCAN_INT16);}
 	| SCAN_UINT16 name uint16 ';'
-	    {$$=attribute(parsestate,$2,$3,(Object)SCAN_UINT16);}
+	    {$$=dap_attribute(parsestate,$2,$3,(Object)SCAN_UINT16);}
 	| SCAN_INT32 name int32 ';'
-	    {$$=attribute(parsestate,$2,$3,(Object)SCAN_INT32);}
+	    {$$=dap_attribute(parsestate,$2,$3,(Object)SCAN_INT32);}
 	| SCAN_UINT32 name uint32 ';'
-	    {$$=attribute(parsestate,$2,$3,(Object)SCAN_UINT32);}
+	    {$$=dap_attribute(parsestate,$2,$3,(Object)SCAN_UINT32);}
 	| SCAN_FLOAT32 name float32 ';'
-	    {$$=attribute(parsestate,$2,$3,(Object)SCAN_FLOAT32);}
+	    {$$=dap_attribute(parsestate,$2,$3,(Object)SCAN_FLOAT32);}
 	| SCAN_FLOAT64 name float64 ';'
-	    {$$=attribute(parsestate,$2,$3,(Object)SCAN_FLOAT64);}
+	    {$$=dap_attribute(parsestate,$2,$3,(Object)SCAN_FLOAT64);}
 	| SCAN_STRING name strs ';'
-	    {$$=attribute(parsestate,$2,$3,(Object)SCAN_STRING);}
+	    {$$=dap_attribute(parsestate,$2,$3,(Object)SCAN_STRING);}
 	| SCAN_URL name urls ';'
-	    {$$=attribute(parsestate,$2,$3,(Object)SCAN_URL);}
-	| name '{' attr_list '}' {$$=attrset(parsestate,$1,$3);}
+	    {$$=dap_attribute(parsestate,$2,$3,(Object)SCAN_URL);}
+	| name '{' attr_list '}' {$$=dap_attrset(parsestate,$1,$3);}
 	| error 
             {yyerror(parsestate,"Illegal attribute"); YYABORT;}
 	;
 
 bytes:
-	  SCAN_WORD {$$=attrvalue(parsestate,null,$1,(Object)SCAN_BYTE);}
+	  SCAN_WORD {$$=dap_attrvalue(parsestate,null,$1,(Object)SCAN_BYTE);}
 	| bytes ',' SCAN_WORD
-		{$$=attrvalue(parsestate,$1,$3,(Object)SCAN_BYTE);}
+		{$$=dap_attrvalue(parsestate,$1,$3,(Object)SCAN_BYTE);}
 	;
 int16:
-	  SCAN_WORD {$$=attrvalue(parsestate,null,$1,(Object)SCAN_INT16);}
+	  SCAN_WORD {$$=dap_attrvalue(parsestate,null,$1,(Object)SCAN_INT16);}
 	| int16 ',' SCAN_WORD
-		{$$=attrvalue(parsestate,$1,$3,(Object)SCAN_INT16);}
+		{$$=dap_attrvalue(parsestate,$1,$3,(Object)SCAN_INT16);}
 	;
 uint16:
-	  SCAN_WORD {$$=attrvalue(parsestate,null,$1,(Object)SCAN_UINT16);}
+	  SCAN_WORD {$$=dap_attrvalue(parsestate,null,$1,(Object)SCAN_UINT16);}
 	| uint16 ',' SCAN_WORD
-		{$$=attrvalue(parsestate,$1,$3,(Object)SCAN_UINT16);}
+		{$$=dap_attrvalue(parsestate,$1,$3,(Object)SCAN_UINT16);}
 	;
 int32:
-	  SCAN_WORD {$$=attrvalue(parsestate,null,$1,(Object)SCAN_INT32);}
+	  SCAN_WORD {$$=dap_attrvalue(parsestate,null,$1,(Object)SCAN_INT32);}
 	| int32 ',' SCAN_WORD
-		{$$=attrvalue(parsestate,$1,$3,(Object)SCAN_INT32);}
+		{$$=dap_attrvalue(parsestate,$1,$3,(Object)SCAN_INT32);}
 	;
 uint32:
-	  SCAN_WORD {$$=attrvalue(parsestate,null,$1,(Object)SCAN_UINT32);}
-	| uint32 ',' SCAN_WORD  {$$=attrvalue(parsestate,$1,$3,(Object)SCAN_UINT32);}
+	  SCAN_WORD {$$=dap_attrvalue(parsestate,null,$1,(Object)SCAN_UINT32);}
+	| uint32 ',' SCAN_WORD  {$$=dap_attrvalue(parsestate,$1,$3,(Object)SCAN_UINT32);}
 	;
 float32:
-	  SCAN_WORD {$$=attrvalue(parsestate,null,$1,(Object)SCAN_FLOAT32);}
-	| float32 ',' SCAN_WORD  {$$=attrvalue(parsestate,$1,$3,(Object)SCAN_FLOAT32);}
+	  SCAN_WORD {$$=dap_attrvalue(parsestate,null,$1,(Object)SCAN_FLOAT32);}
+	| float32 ',' SCAN_WORD  {$$=dap_attrvalue(parsestate,$1,$3,(Object)SCAN_FLOAT32);}
 	;
 float64:
-	  SCAN_WORD {$$=attrvalue(parsestate,null,$1,(Object)SCAN_FLOAT64);}
-	| float64 ',' SCAN_WORD  {$$=attrvalue(parsestate,$1,$3,(Object)SCAN_FLOAT64);}
+	  SCAN_WORD {$$=dap_attrvalue(parsestate,null,$1,(Object)SCAN_FLOAT64);}
+	| float64 ',' SCAN_WORD  {$$=dap_attrvalue(parsestate,$1,$3,(Object)SCAN_FLOAT64);}
 	;
 strs:
-	  str_or_id {$$=attrvalue(parsestate,null,$1,(Object)SCAN_STRING);}
-	| strs ',' str_or_id {$$=attrvalue(parsestate,$1,$3,(Object)SCAN_STRING);}
+	  str_or_id {$$=dap_attrvalue(parsestate,null,$1,(Object)SCAN_STRING);}
+	| strs ',' str_or_id {$$=dap_attrvalue(parsestate,$1,$3,(Object)SCAN_STRING);}
 	;
 
 urls:
-	  url {$$=attrvalue(parsestate,null,$1,(Object)SCAN_URL);}
-	| urls ',' url {$$=attrvalue(parsestate,$1,$3,(Object)SCAN_URL);}
+	  url {$$=dap_attrvalue(parsestate,null,$1,(Object)SCAN_URL);}
+	| urls ',' url {$$=dap_attrvalue(parsestate,$1,$3,(Object)SCAN_URL);}
 	;
 
 url:
@@ -239,7 +237,7 @@ name:
 
 errorbody:
 	'{' SCAN_CODE '=' SCAN_WORD ';' SCAN_MESSAGE '=' SCAN_WORD ';' '}' ';'
-		{$$=errorbody(parsestate,$4,$8);}
+		{$$=dap_errorbody(parsestate,$4,$8);}
 	;