Ignore:
Timestamp:
Mar 12, 2015, 3:14:52 AM (9 years ago)
Author:
djay
Message:

Introduce the Process Profiles Registry with its documentation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/service_conf.y

    r539 r607  
    1 %{
    2 //======================================================
    3 /**
     1/*
    42 * Thx to Jean-Marie CODOL and Naitan GROLLEMUND
    53 * copyright 2009 GeoLabs SARL
     
    75 *
    86 */
    9 //======================================================
     7%{
    108
    119#include <string>
     
    2220static bool wait_defaults=false;
    2321static bool wait_supporteds=false;
    24 static bool wait_outputs=false;
     22static bool wait_outputs=-1;
    2523static bool wait_data=false;
    2624static service* my_service=NULL;
     
    3432// namespace
    3533using namespace std;
    36 //======================================================
    3734
    3835// srerror
    3936void srerror(const char *s);
    40 //======================================================
    4137
    4238// usage ()
    4339void usage(void) ;
    44 //======================================================
    4540
    4641// srdebug
    4742extern int srdebug;
    48 //======================================================
    4943
    5044extern char srtext[];
     
    5246// srlineno
    5347extern int srlineno;
    54 //======================================================
    5548
    5649// srin
    5750extern FILE* srin;
    58 //======================================================
    5951
    6052// srlex
    6153extern int srlex(void);
    6254extern int srlex_destroy(void);
    63 
    64 //vector<char*> lattribute;
    6555
    6656%}
     
    7666/* STARTXMLDECL et ENDXMLDECL qui sont <?xml et ?>*/
    7767%token STARTXMLDECL ENDXMLDECL
    78 //======================================================
     68
    7969/* version="xxx" et encoding="xxx" */
    8070%token VERSIONDECL ENCODINGDECL SDDECL
    81 //======================================================
     71
    8272/* < et > */
    8373%token INFCAR SUPCAR
    84 //======================================================
     74
    8575/* / = a1  texte "texte" */
    8676%token SLASH Eq CHARDATA ATTVALUE PAIR SPAIR EPAIR ANID
     
    8878%type <chaine> EPAIR
    8979%type <chaine> SPAIR
    90 //======================================================
     80
    9181/* <!-- xxx -> <? xxx yyy ?> */
    9282%token PI PIERROR /** COMMENT **/
    93 //======================================================
     83
    9484/* <!-- xxx -> <? xxx yyy ?> */
    9585%token ERREURGENERALE CDATA WHITESPACE NEWLINE
     
    9787%type <s> ETag
    9888%type <s> ANID
    99 //======================================================
    100 // %start
    101 //======================================================
     89
     90// % start
    10291
    10392%%
    104 // document <//===
    105 //======================================================
     93// document
    10694// regle 1
    10795// on est a la racine du fichier xml
    108 //======================================================
    10996document
    11097 : miscetoile element miscetoile {}
     
    118105 ;
    119106// element
    120 //======================================================
    121107// regle 39
    122108// OUVRANTE CONTENU FERMANTE obligatoirement
     
    124110// on ne peut pas avoir Epsilon
    125111// un fichier xml ne peut pas etre vide ou seulement avec un prolog
    126 //======================================================
    127112element
    128113 : STag contentetoile ETag     
     
    136121 ;
    137122
    138 //======================================================
    139123// STag
    140 //======================================================
    141124// regle 40
    142125// BALISE OUVRANTE
    143126// on est obligé de faire appel a infcar et supcar
    144127// pour acceder aux start conditions DANSBALISE et INITIAL
    145 //======================================================
    146128STag
    147129: INFCAR ID Attributeetoile SUPCAR
     
    150132  fprintf(stderr,"(%s %d) %s\n",__FILE__,__LINE__,$2);
    151133  fflush(stderr);
     134  dumpMap(current_content);
    152135#endif
    153136  if(my_service->content==NULL){
     
    163146  }
    164147  if(strncasecmp($2,"DataInputs",10)==0){
    165     if(wait_mainmetadata==true){
     148    if(wait_mainmetadata==true && current_content!=NULL){
    166149      addMapToMap(&my_service->metadata,current_content);
    167150      freeMap(&current_content);
     
    238221        current_element->next=NULL;
    239222      }
    240       wait_outputs=true;
     223      wait_outputs=1;
    241224      current_data=2;
    242225      previous_data=2;
     
    323306 ;
    324307
    325 //======================================================
    326308// Attributeetoile
    327 //======================================================
    328309// regle 41
    329310// une liste qui peut etre vide d'attributs
    330311// utiliser la récursivité a gauche
    331 //======================================================
    332312Attributeetoile
    333313 : Attributeetoile attribute  {}
     
    335315 ;
    336316
    337 //======================================================
    338317// attribute
    339 //======================================================
    340318// regle 41
    341319// un attribut est compose d'un identifiant
     
    343321// et d'une définition de chaine de caractere
    344322// ( "xxx" ou 'xxx' )
    345 //======================================================
    346323attribute
    347324 : ID Eq ATTVALUE               
     
    353330 ;
    354331
    355 //======================================================
    356332// EmptyElemTag
    357 //======================================================
    358333// regle 44
    359334// ICI ON DEFINIT NEUTRE
     
    361336// parce qu'il n'y a pas de comparaisons a faire
    362337// avec un identifiant d'une balise jumelle
    363 //======================================================
    364338EmptyElemTag
    365339 : INFCAR ID Attributeetoile SLASH SUPCAR       {
     
    386360 ;
    387361
    388 //======================================================
    389362// ETag
    390 //======================================================
    391 // regle 42
    392363// BALISE FERMANTE
    393364// les separateurs après ID sont filtrés
    394 //======================================================
    395365ETag
    396366 : INFCAR SLASH ID SUPCAR
     
    401371  if(strcmp($3,"DataInputs")==0){
    402372    current_data=1;
     373    if(current_content!=NULL){
     374      if(current_element->content==NULL){
     375        addMapToMap(&current_element->content,current_content);
     376      }
     377      freeMap(&current_content);
     378      free(current_content);
     379      current_content=NULL;
     380    }
     381    if(current_element!=NULL){
     382      if(my_service->content!=NULL && current_element->name!=NULL){
     383        if(my_service->inputs==NULL){
     384          my_service->inputs=dupElements(current_element);
     385          my_service->inputs->next=NULL;
     386          tmp_count++;
     387        }
     388        else{
     389          addToElements(&my_service->inputs,current_element);
     390        }
     391        freeElements(&current_element);
     392        free(current_element);
     393        current_element=NULL;
     394      }
     395    }
    403396  }
    404397  if(strcmp($3,"DataOutputs")==0){
     
    489482 ;
    490483
    491 //======================================================
    492484// texteinterbalise
    493 //======================================================
    494485// regle 14
    495486// DU TEXTE quelconque
     
    499490// maintenant on croise les ID dans les dbalises
    500491// et des CHARDATA hors des balises
    501 //======================================================
    502492texteinterbalise
    503493 : CHARDATA             {}
    504494 ;
    505 //======================================================
    506495
    507496pair: PAIR { if(debug) fprintf(stderr,"PAIR FOUND !!\n");if(curr_key!=NULL){free(curr_key);curr_key=NULL;} }
     
    637626    else
    638627      if(current_data==2){
    639         wait_outputs=true;
     628        wait_outputs=1;
    640629        if(wait_inputs){
    641630          if(current_element!=NULL && current_element->name!=NULL){
     
    746735          }
    747736        wait_inputs=false;
    748         wait_outputs=true;
     737        wait_outputs=1;
    749738        //wait_outputs=true;
    750739      }
     
    755744%%
    756745
    757 // srerror
    758 //======================================================
    759 /* fonction qui affiche l erreur si il y en a une */
    760 //======================================================
     746/**
     747 * Print on stderr the message and the line number of the error which occured.
     748 *
     749 * @param s the error message
     750 */
    761751void srerror(const char *s)
    762752{
     
    766756
    767757/**
    768  * getServiceFromFile :
    769  * set service given as second parameter with informations extracted from the
    770  * definition file.
     758 * Parse a ZCFG file and fill the service structure.
     759 *
     760 * @param conf the conf maps containing the main.cfg settings
     761 * @param file the fullpath to the ZCFG file
     762 * @param service the service structure to fill
     763 * @return 0 on success, -1 on failure
    771764 */
    772765int getServiceFromFile(maps* conf,const char* file,service** service){
     
    792785  wait_defaults=false;
    793786  wait_supporteds=false;
    794   wait_outputs=false;
     787  wait_outputs=-1;
    795788  wait_data=false;
    796789  data=-1;
     
    810803#ifdef DEBUG_SERVICE_CONF
    811804  fprintf(stderr,"RESULT: %d %d\n",resultatYYParse,wait_outputs);
    812 #endif
    813   if(wait_outputs && current_element!=NULL && current_element->name!=NULL){
    814     if(my_service->outputs==NULL){     
     805  dumpElements(current_element);
     806#endif
     807  if(wait_outputs>0 && current_element!=NULL && current_element->name!=NULL){
     808    if(my_service->outputs==NULL){ 
    815809#ifdef DEBUG_SERVICE_CONF
    816810      fprintf(stderr,"(DATAOUTPUTS - %d) DUP current_element\n",__LINE__);
     
    840834    current_element=NULL;
    841835  }
     836  int contentOnly=-1;
    842837  if(current_content!=NULL){
     838    if(my_service->content==NULL){
     839      addMapToMap(&my_service->content,current_content);
     840      contentOnly=1;
     841    }
    843842    freeMap(&current_content);
    844843    free(current_content);
     
    849848  dumpService(my_service);
    850849#endif
    851   if(wait_outputs<0 || my_service==NULL || my_service->name==NULL || my_service->content==NULL || my_service->outputs==NULL){
    852     fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
     850  if(contentOnly<0 && ((wait_outputs<0 && current_data==2 && my_service->outputs==NULL) || my_service==NULL || my_service->name==NULL || my_service->content==NULL)){
    853851    setMapInMaps(conf,"lenv","message",srlval.chaine);
    854852#ifndef WIN32
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png