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

Last change on this file since 862 was 638, checked in by djay, 10 years ago

Fix for SAGA-GIS generated ZCFG and add '=' to the acceptable values in a ZCFG.

File size: 3.0 KB
Line 
1/*
2 * Author : Gérald FENOY
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.
23 */
24%option noyywrap
25%option yylineno
26
27
28%{
29
30#include <string.h>
31#include "service_conf.tab.h"
32
33char *lmsg=NULL;
34
35%}
36
37S               [ \t\r\n]+
38
39CharRef         "&#"[0-9]+";"|"&#x"[0-9a-fA-F]+";"
40
41egalevolue              {S}?"="{S}?
42
43Name            ([_:]|[\x41-\x5A]|[\x61-\x7A]|[\xC0-\xD6]|[\xD8-\xF6]|[\xF8-\xFF])(([\x41-\x5A]|[\x61-\x7A]|[\xC0-\xD6]|[\xD8-\xF6]|[\xF8-\xFF])|[0-9.\-_:])*
44
45chardata        [^<]*
46
47attname [a-zA-Z0-9._\-]+
48attvalue1      [\x80-\xbf\xc2-\xdf\xe0-\xef\xf0-\xf4="#°²θé\^\*\+\,\;;?!~`ú@a-zA-Z0-9%_\-:\:.:" "\"\'/\\\(\)\t\|\$\&>\[\]]+
49
50attvalue                \"[^"]*\"|\'[^']*\'\(\)
51
52whitespace                      [\t]{0,}|[ ]{0,}
53whitesp                      [\t]|[ ]
54newline                 [\r\n]|[\n]
55newlines                 [\r\n]{1,}|[\n]{1,}
56
57
58%x DANSBALISE HORSBALISE PAIRSTART
59
60
61
62
63%%
64
65"\n" { }
66
67{newline}+{whitesp}*                    { return NEWLINE; }
68
69<INITIAL,HORSBALISE>"["{attname}"]"             {  srlval.chaine=yytext;return ANID; }
70
71<INITIAL,HORSBALISE>{attname}             {  srlval.chaine=yytext; return SPAIR; }
72
73<PAIRSTART,HORSBALISE>{attvalue1}             { srlval.chaine=yytext;/*BEGIN(INITIAL);*/ return EPAIR;}
74
75<PAIRSTART,INITIAL,HORSBALISE>{whitesp}*"="{whitesp}*             {  BEGIN(PAIRSTART);}
76
77<PAIRSTART,INITIAL,HORSBALISE>{newline}+{whitesp}*             { BEGIN(INITIAL);  return NEWLINE;}
78
79<DANSBALISE,INITIAL,HORSBALISE>{S}   {  }
80
81<INITIAL,HORSBALISE>{newline}*"<"                   { BEGIN(DANSBALISE); return INFCAR;}
82
83
84<DANSBALISE>">"                 { BEGIN(HORSBALISE);return SUPCAR;}
85
86
87<DANSBALISE>"/"         {return SLASH;}
88
89
90<DANSBALISE>{egalevolue}                        {return Eq;}
91
92
93<DANSBALISE>{Name}{newline}*                    {memmove(srlval.chaine,yytext,(strlen(yytext)+1)*sizeof(char));return ID;}
94
95
96<DANSBALISE>{attvalue}          {return ATTVALUE;}
97
98
99<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;}
100
101%%
102
Note: See TracBrowser for help on using the repository browser.

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