Changeset 621 for trunk/zoo-project/zoo-kernel/service_conf.y
- Timestamp:
- Apr 9, 2015, 5:23:06 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/service_conf.y
r618 r621 1 1 /* 2 * Thx to Jean-Marie CODOL and Naitan GROLLEMUND3 * copyright 2009 GeoLabs SARL4 2 * Author : Gérald FENOY 5 3 * 4 * Copyright (c) 209-2015 GeoLabs SARL 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights 9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 * copies of the Software, and to permit persons to whom the Software is 11 * furnished to do so, subject to the following conditions: 12 * 13 * The above copyright notice and this permission notice shall be included in 14 * all copies or substantial portions of the Software. 15 * 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 * THE SOFTWARE. 6 23 */ 7 24 %{ … … 64 81 %token <s> ID 65 82 %token <s> CHAINE 66 /* STARTXMLDECL et ENDXMLDECL qui sont <?xml et ?>*/ 67 %token STARTXMLDECL ENDXMLDECL 68 69 /* version="xxx" et encoding="xxx" */ 70 %token VERSIONDECL ENCODINGDECL SDDECL 71 72 /* < et > */ 83 73 84 %token INFCAR SUPCAR 74 85 … … 130 141 { 131 142 #ifdef DEBUG_SERVICE_CONF 132 fprintf(stderr," (%s %d) %s\n",__FILE__,__LINE__,$2);143 fprintf(stderr,"STag (%s %d) %s %d %d \n",__FILE__,__LINE__,$2,current_data,previous_data); 133 144 fflush(stderr); 134 145 dumpMap(current_content); … … 146 157 } 147 158 if(strncasecmp($2,"DataInputs",10)==0){ 148 if(wait_mainmetadata==true && current_content!=NULL){149 addMapToMap(&my_service->metadata,current_content);150 freeMap(¤t_content);151 free(current_content);152 current_content=NULL;153 wait_mainmetadata=false;154 }155 159 if(current_element==NULL){ 156 160 #ifdef DEBUG_SERVICE_CONF … … 255 259 || strncasecmp($2,"BoundingBoxOutput",13)==0 || strncasecmp($2,"BoundingBoxData",12)==0){ 256 260 current_data=4; 257 if(wait_metadata==true){ 258 if(current_content!=NULL){ 259 #ifdef DEBUG_SERVICE_CONF 260 fprintf(stderr,"add current_content to current_element->content\n"); 261 fprintf(stderr,"LINE %d",__LINE__); 262 #endif 263 addMapToMap(¤t_element->metadata,current_content); 264 current_element->next=NULL; 265 if($2!=NULL) 266 current_element->format=zStrdup($2); 267 268 current_element->defaults=NULL; 269 current_element->supported=NULL; 270 freeMap(¤t_content); 271 free(current_content); 272 } 273 }else{ 274 // No MainMetaData 275 addMapToMap(¤t_element->content,current_content); 276 freeMap(¤t_content); 277 free(current_content); 278 current_element->metadata=NULL; 279 current_element->next=NULL; 280 if($2!=NULL) 281 current_element->format=zStrdup($2); 282 current_element->defaults=NULL; 283 current_element->supported=NULL; 284 } 261 addMapToMap(¤t_element->content,current_content); 262 freeMap(¤t_content); 263 free(current_content); 264 current_element->next=NULL; 265 if($2!=NULL) 266 current_element->format=zStrdup($2); 267 current_element->defaults=NULL; 268 current_element->supported=NULL; 285 269 current_content=NULL; 286 wait_metadata=false;287 270 } 288 271 else … … 311 294 // utiliser la récursivité a gauche 312 295 Attributeetoile 313 296 : Attributeetoile attribute {} 314 297 | {/* Epsilon */} 315 298 ; … … 367 350 { 368 351 #ifdef DEBUG_SERVICE_CONF 369 fprintf(stderr," (%s %d)\n",__FILE__,__LINE__);352 fprintf(stderr,"ETag %s (%s %d) %d %d \n",$3,__FILE__,__LINE__,current_data,previous_data); 370 353 #endif 371 354 if(strcmp($3,"DataInputs")==0){ … … 399 382 } 400 383 if(strcmp($3,"MetaData")==0){ 384 if(current_content!=NULL){ 385 #ifdef DEBUG_SERVICE_CONF 386 fprintf(stderr,"add current_content to current_element->content\n"); 387 fprintf(stderr,"LINE %d",__LINE__); 388 #endif 389 if(wait_metadata){ 390 current_element->metadata=NULL; 391 addMapToMap(¤t_element->metadata,current_content); 392 current_element->next=NULL; 393 current_element->defaults=NULL; 394 current_element->supported=NULL; 395 }else{ 396 if(wait_mainmetadata){ 397 addMapToMap(&my_service->metadata,current_content); 398 } 399 } 400 401 freeMap(¤t_content); 402 free(current_content); 403 current_content=NULL; 404 } 401 405 current_data=previous_data; 406 wait_mainmetadata=false; 407 wait_metadata=false; 402 408 } 403 409 if(strcmp($3,"ComplexData")==0 || strcmp($3,"LiteralData")==0 404 410 || strcmp($3,"ComplexOutput")==0 || strcmp($3,"LiteralOutput")==0){ 411 if(current_element->format==NULL) 412 current_element->format=zStrdup($3); 405 413 current_content=NULL; 406 414 } … … 497 505 | EPAIR { 498 506 #ifdef DEBUG_SERVICE_CONF 499 fprintf(stderr,"(%s %d)\n",__FILE__,__LINE__); 500 fprintf(stderr,"EPAIR FOUND !! \n"); 507 fprintf(stderr,"EPAIR (%s %d)\n",__FILE__,__LINE__); 508 fprintf(stderr,"[%s=>%s]\n",curr_key,$1); 509 dumpMap(current_content); 510 fflush(stderr); 511 #endif 512 if($1!=NULL && curr_key!=NULL){ 513 if(current_content==NULL){ 514 #ifdef DEBUG_SERVICE_CONF 515 fprintf(stderr,"[ZOO: service_conf.y line %d free(%s)]\n",__LINE__,curr_key); 516 #endif 517 current_content=createMap(curr_key,$1); 518 #ifdef DEBUG_SERVICE_CONF 519 fprintf(stderr,"[ZOO: service_conf.y line %d free(%s)]\n",__LINE__,curr_key); 520 #endif 521 } 522 else{ 523 #ifdef DEBUG_SERVICE_CONF 524 dumpMap(current_content); 525 fprintf(stderr,"addToMap(current_content,%s,%s) !! \n",curr_key,$1); 526 #endif 527 addToMap(current_content,curr_key,$1); 528 #ifdef DEBUG_SERVICE_CONF 529 fprintf(stderr,"addToMap(current_content,%s,%s) end !! \n",curr_key,$1); 530 #endif 531 } 532 } 533 #ifdef DEBUG_SERVICE_CONF 501 534 fprintf(stderr,"[%s=>%s]\n",curr_key,$1); 502 535 fprintf(stderr,"[ZOO: service_conf.y line %d free(%s)]\n",__LINE__,curr_key); … … 504 537 fflush(stderr); 505 538 #endif 506 if($1!=NULL && curr_key!=NULL){507 if(current_content==NULL){508 #ifdef DEBUG_SERVICE_CONF509 fprintf(stderr,"[ZOO: service_conf.y line %d free(%s)]\n",__LINE__,curr_key);510 #endif511 current_content=createMap(curr_key,$1);512 #ifdef DEBUG_SERVICE_CONF513 fprintf(stderr,"[ZOO: service_conf.y line %d free(%s)]\n",__LINE__,curr_key);514 #endif515 }516 else{517 #ifdef DEBUG_SERVICE_CONF518 dumpMap(current_content);519 fprintf(stderr,"addToMap(current_content,%s,%s) !! \n",curr_key,$1);520 #endif521 addToMap(current_content,curr_key,$1);522 #ifdef DEBUG_SERVICE_CONF523 fprintf(stderr,"addToMap(current_content,%s,%s) end !! \n",curr_key,$1);524 #endif525 }526 }527 #ifdef DEBUG_SERVICE_CONF528 fprintf(stderr,"[%s=>%s]\n",curr_key,$1);529 fprintf(stderr,"[ZOO: service_conf.y line %d free(%s)]\n",__LINE__,curr_key);530 dumpMap(current_content);531 fflush(stderr);532 #endif533 539 if(curr_key!=NULL){ 534 540 free(curr_key); … … 543 549 : ANID { 544 550 #ifdef DEBUG_SERVICE_CONF 545 fprintf(stderr," (%s %d)\n",__FILE__,__LINE__);551 fprintf(stderr,"processid (%s %d) %s\n",__FILE__,__LINE__,$1); 546 552 #endif 547 553 if(data==-1){
Note: See TracChangeset
for help on using the changeset viewer.