source: trunk/zoo-project/zoo-kernel/service_conf.l @ 569

Last change on this file since 569 was 550, checked in by djay, 10 years ago

Add otb2zcfg and OTB applications support without observer by now. Fix issue with maxOccurs and multiple downloaded value for the same input.

File size: 4.2 KB
RevLine 
[1]1%option noyywrap
2%option yylineno
3
4
5%{
6//======================================================
7/**
8
[13]9 authors : Jean-Marie CODOL, Naitan GROLLEMUND
[1]10
11**/
12//======================================================
13
14
15#include <string.h>
16#include "service_conf.tab.h"
17
18#ifdef DEBUG_SERVICE_CONF
19int affichetrace = 1;
20#else
21int affichetrace = 0;
22#endif
23
[465]24char *lmsg;
[1]25int attentionImpossibleDeTrouverXMLDeclapres = 0 ;
26
27int attentionImpossibleDeTrouverPIapres = 0 ;
28
29%}
30
31
32S               [ \t\r\n]+
33
34CharRef         "&#"[0-9]+";"|"&#x"[0-9a-fA-F]+";"
35
36egalevolue              {S}?"="{S}?
37
38Name            ([_:]|[\x41-\x5A]|[\x61-\x7A]|[\xC0-\xD6]|[\xD8-\xF6]|[\xF8-\xFF])(([\x41-\x5A]|[\x61-\x7A]|[\xC0-\xD6]|[\xD8-\xF6]|[\xF8-\xFF])|[0-9.\-_:])*
39
[13]40chardata        [^<]*
[1]41
[550]42attname [a-zA-Z0-9._\-]+
43attvalue1       [°²θé#\^\*\+,;@a-zA-Z0-9%_\-::.:" "\"\'/\\\(\)\t\|\$\&>\[\]]+
[1]44
45attvalue                \"[^"]*\"|\'[^']*\'\(\)
46
[214]47whitespace                      [\t]{0,}|[ ]{0,}
48whitesp                      [\t]|[ ]
[1]49newline                 [\r\n]|[\n]
50newlines                 [\r\n]{1,}|[\n]{1,}
51
52
53%x DANSBALISE HORSBALISE PAIRSTART
54
55
56
57
58%%
59
60"\n" {  if (affichetrace==1) fprintf (stderr,"\n\nNEWLINE\n") ;return NEWLINE;}
61
62{newline}+{whitesp}*                    {  if (affichetrace==1) fprintf (stderr,"\n\nNEWLINE 1\n") ; return NEWLINE;}
63
[9]64<INITIAL,HORSBALISE>"["{attname}"]"             {  srlval.chaine=yytext;return ANID; }
[1]65
[9]66<INITIAL,HORSBALISE>{attname}             {  srlval.chaine=yytext; return SPAIR; }
[1]67
[9]68<PAIRSTART,HORSBALISE>{attvalue1}             { srlval.chaine=yytext;/*BEGIN(INITIAL);*/ return EPAIR;}
[1]69
70<PAIRSTART,INITIAL,HORSBALISE>{whitesp}*"="{whitesp}*             {  BEGIN(PAIRSTART);}
71
[9]72<PAIRSTART,INITIAL,HORSBALISE,DANSBALISE>{newline}+{whitesp}*             { BEGIN(INITIAL);  return NEWLINE;}
[1]73
[9]74<INITIAL>"<?"[Xx][Mm][Ll]  {   if (attentionImpossibleDeTrouverXMLDeclapres == 1 || attentionImpossibleDeTrouverPIapres == 1) {/* il y a eut un commentaire ou une balise applicative avant la declaration xml */ fprintf(stderr,"\nerror : a la ligne %d : il y a eut un commentaire ou un PI avant la declaration xml\n",srlineno); exit (10) ; } ; return STARTXMLDECL;}
[1]75
[9]76<INITIAL>"version"{egalevolue}\"1.0\"|"version"{egalevolue}\'1.0\'  { return VERSIONDECL;  }
[1]77<INITIAL>"version"{egalevolue}\"[^"]*\"|"version"{egalevolue}\'[^']*\'  {/* erreur de version encoding */ fprintf(stderr,"\nerror : a la ligne %d : la version xml n est pas reconnue : %s\n",srlineno,yytext); exit (9) ; }
78
79
[9]80<INITIAL>"encoding"{egalevolue}\"[Ii][Ss][Oo]"-8859-1"\"|"encoding"{egalevolue}\'[Ii][Ss][Oo]"-8859-1"\'  { return ENCODINGDECL;}
[1]81<INITIAL>"encoding"{egalevolue}\"[^"]*\"|"encoding"{egalevolue}\'[^']*\'  {/* erreur de version encoding */     fprintf(stderr,"\nerror : a la ligne %d : la version d encodage n est pas reconnue : %s\n",srlineno,yytext); exit (8) ; }
82
83
[9]84<INITIAL>"standalone"{egalevolue}\"yes\"|"standalone"{egalevolue}\'yes\'|"standalone"{egalevolue}\"no\"|"standalone"{egalevolue}\'no\'  { return SDDECL;}
[1]85
86<INITIAL>"standalone"{egalevolue}\"[^"]*\"|"standalone"{egalevolue}\'[^']*\'|"standalone"{egalevolue}\"[^"]*\"|"standalone"{egalevolue}\'[^']*\'  { /* erreur de version encoding */    fprintf(stderr,"\nerror : a la ligne %d : la version standalone n est pas reconnue : %s\n",srlineno,yytext); exit (7) ; }
87
88
[9]89<INITIAL>"?>"  { BEGIN(HORSBALISE); return ENDXMLDECL;}
[1]90
91
[9]92<DANSBALISE,INITIAL,HORSBALISE>{S}   {  }
[1]93
94
[9]95<HORSBALISE>"<?"[Xx][Mm][Ll]{S}({S}|{chardata})*"?>"|"<?"[Xx][Mm][Ll]"?>"       { return PIERROR;}
96<INITIAL,HORSBALISE>"<?"([^xX]|([xX][^mM])|([xX][mM][^lL]))({S}|([^?]|("?"[^>])))*"?>"          { attentionImpossibleDeTrouverPIapres=1 ; return PI;}
[1]97
98
[9]99<INITIAL,HORSBALISE>{newline}*"<"                   { BEGIN(DANSBALISE); return INFCAR;}
[1]100
101
[9]102<DANSBALISE>">"                 { BEGIN(HORSBALISE);return SUPCAR;}
[1]103
104
[9]105<DANSBALISE>"/"         {return SLASH;}
[1]106
107
[9]108<DANSBALISE>{egalevolue}                        {return Eq;}
[1]109
110
[57]111<DANSBALISE>{Name}{newline}*                    {memmove(srlval.chaine,yytext,(strlen(yytext)+1)*sizeof(char));return ID;}
[1]112
113
[9]114<DANSBALISE>{attvalue}          {return ATTVALUE;}
[1]115
116
117<INITIAL,HORSBALISE>"<!--"([^-]|"-"[^-])*"-->"          {attentionImpossibleDeTrouverXMLDeclapres=1; }
118
119
[476]120<INITIAL,DANSBALISE,HORSBALISE>.|\n     {lmsg=(char*)malloc(1024*sizeof(char));sprintf(lmsg,"error: line %d: character not allowed '%s'",srlineno,yytext);fprintf(stderr,"%s \n",lmsg);srlval.chaine=lmsg;fprintf(stderr,"%s \n",lmsg);return -1;}
[1]121
122%%
123
Note: See TracBrowser for help on using the repository browser.

Search

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