%{ /* ** READ ME FIRST! ** ** When this file is altered, it is necessary to do "make lexer". Due to ** problems detailed in #2310 the lexer is no longer automatically rebuilt ** when maplexer.l is altered. */ /* C declarations */ #include #include #include #include #include #include "mapserver.h" #include "maperror.h" #include "mapfile.h" #include "maptime.h" #include "mapsymbol.h" #include "mapparser.h" #include "mapprimitive.h" /* msyylineno is required for flex 2.5.4 and older, but is already defined by * flex 2.5.31 (bug 975). * Unfortunately there is no clean way to differenciate the two versions, * so we use the symbol YY_CURRENT_BUFFER_LVALUE to base our test since it * was not present in 2.5.4 and is present in 2.5.31. Hopefully that won't * put us in trouble with other versions. If that happens then we can * switch to using autoconf to detect the version. */ #ifndef YY_CURRENT_BUFFER_LVALUE int msyylineno = 1; #endif int msyysource=MS_STRING_TOKENS; double msyynumber; int msyystate=MS_TOKENIZE_DEFAULT; char *msyystring=NULL; char *msyybasepath=NULL; char *msyystring_buffer_ptr; int msyystring_buffer_size = 256; int msyystring_size; char msyystring_begin; char *msyystring_buffer = NULL; int msyystring_icase = MS_FALSE; int msyystring_return_state; int msyystring_begin_state; int msyystring_size_tmp; int msyyreturncomments = 0; #define MS_LEXER_STRING_REALLOC(string, string_size, max_size, string_ptr) \ if (string_size >= max_size) { \ msyystring_size_tmp = max_size; \ max_size = ((max_size*2) > string_size) ? max_size*2 : string_size+1; \ string = (char *) msSmallRealloc(string, sizeof(char *) * max_size); \ string_ptr = string; \ string_ptr += msyystring_size_tmp; \ } #define MS_LEXER_RETURN_TOKEN(token) \ MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), \ msyystring_buffer_size, msyystring_buffer_ptr); \ strcpy(msyystring_buffer, msyytext); \ return(token); #define MAX_INCLUDE_DEPTH 5 YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; int include_lineno[MAX_INCLUDE_DEPTH]; int include_stack_ptr = 0; char path[MS_MAXPATHLEN]; %} %s URL_VARIABLE %s URL_STRING %s EXPRESSION_STRING %s INCLUDE %s MSSTRING %% if (msyystring_buffer == NULL) msyystring_buffer = (char*) msSmallMalloc(sizeof(char) * msyystring_buffer_size); msyystring_buffer[0] = '\0'; msyystring_buffer_size = 0; switch(msyystate) { case(MS_TOKENIZE_DEFAULT): break; case(MS_TOKENIZE_FILE): BEGIN(INITIAL); msyystring_begin_state = INITIAL; msyysource=MS_FILE_TOKENS; msyystate=MS_TOKENIZE_DEFAULT; msyystring=NULL; msyyreturncomments=0; include_stack_ptr=0; return(0); break; case(MS_TOKENIZE_STRING): BEGIN(INITIAL); msyystring_begin_state = INITIAL; msyy_delete_buffer(YY_CURRENT_BUFFER); msyy_scan_string(msyystring); msyysource=MS_STRING_TOKENS; msyystate=MS_TOKENIZE_DEFAULT; msyyin=NULL; msyyreturncomments=0; include_stack_ptr=0; return(0); break; case(MS_TOKENIZE_URL_VARIABLE): BEGIN(URL_VARIABLE); msyystring_begin_state = URL_VARIABLE; msyy_delete_buffer(YY_CURRENT_BUFFER); msyy_scan_string(msyystring); msyysource=MS_URL_TOKENS; msyystate=MS_TOKENIZE_DEFAULT; msyyreturncomments=0; (void) yyunput; /* just to avoid warning about it being unrefed */ break; case(MS_TOKENIZE_URL_STRING): BEGIN(URL_STRING); msyystring_begin_state = URL_STRING; msyy_delete_buffer(YY_CURRENT_BUFFER); msyy_scan_string(msyystring); msyysource=MS_URL_TOKENS; msyystate=MS_TOKENIZE_DEFAULT; msyyin=NULL; msyyreturncomments=0; return(0); break; case(MS_TOKENIZE_EXPRESSION): BEGIN(EXPRESSION_STRING); msyystring_begin_state = EXPRESSION_STRING; msyy_delete_buffer(YY_CURRENT_BUFFER); msyy_scan_string(msyystring); msyystate=MS_TOKENIZE_DEFAULT; msyyreturncomments=0; break; case(99): BEGIN(INITIAL); /* may not need this one */ msyystring_begin_state = INITIAL; msyy_delete_buffer(YY_CURRENT_BUFFER); msyystate=MS_TOKENIZE_DEFAULT; msyystring=NULL; msyyreturncomments=0; return(0); break; default: break; } [ \t\r]+ ; #.* { if (msyyreturncomments) return(MS_COMMENT); } _|\. ; or|\|\| { MS_LEXER_RETURN_TOKEN(MS_TOKEN_LOGICAL_OR); } and|&& { MS_LEXER_RETURN_TOKEN(MS_TOKEN_LOGICAL_AND); } not|! { MS_LEXER_RETURN_TOKEN(MS_TOKEN_LOGICAL_NOT); } eq|=|== { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_EQ); } ne|!= { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_NE); } gt|> { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_GT); } lt|< { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_LT); } ge|>= { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_GE); } le|<= { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_LE); } ~ { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_RE); } =\* { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_IEQ); } ~\* { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_IRE); } in { MS_LEXER_RETURN_TOKEN(IN); } area { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_AREA); } length { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_LENGTH); } tostring { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_TOSTRING); } commify { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_COMMIFY); } round { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_ROUND); } buffer { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_BUFFER); } difference { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_DIFFERENCE); } intersects { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_INTERSECTS); } disjoint { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_DISJOINT); } touches { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_TOUCHES); } overlaps { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_OVERLAPS); } crosses { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_CROSSES); } within { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_WITHIN); } contains { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_CONTAINS); } beyond { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_BEYOND); } dwithin { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_DWITHIN); } fromtext { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_FROMTEXT); } colorrange { MS_LEXER_RETURN_TOKEN(COLORRANGE); } datarange { MS_LEXER_RETURN_TOKEN(DATARANGE); } rangeitem { MS_LEXER_RETURN_TOKEN(RANGEITEM); } align { MS_LEXER_RETURN_TOKEN(ALIGN); } anchorpoint { MS_LEXER_RETURN_TOKEN(ANCHORPOINT); } angle { MS_LEXER_RETURN_TOKEN(ANGLE); } antialias { MS_LEXER_RETURN_TOKEN(ANTIALIAS); } backgroundcolor { MS_LEXER_RETURN_TOKEN(BACKGROUNDCOLOR); } bandsitem { MS_LEXER_RETURN_TOKEN(BANDSITEM); } bindvals { MS_LEXER_RETURN_TOKEN(BINDVALS); } browseformat { MS_LEXER_RETURN_TOKEN(BROWSEFORMAT); } buffer { MS_LEXER_RETURN_TOKEN(BUFFER); } character { MS_LEXER_RETURN_TOKEN(CHARACTER); } class { MS_LEXER_RETURN_TOKEN(CLASS); } classitem { MS_LEXER_RETURN_TOKEN(CLASSITEM); } classgroup { MS_LEXER_RETURN_TOKEN(CLASSGROUP); } cluster { MS_LEXER_RETURN_TOKEN(CLUSTER); } color { MS_LEXER_RETURN_TOKEN(COLOR); } config { MS_LEXER_RETURN_TOKEN(CONFIG); } connection { MS_LEXER_RETURN_TOKEN(CONNECTION); } connectiontype { MS_LEXER_RETURN_TOKEN(CONNECTIONTYPE); } data { MS_LEXER_RETURN_TOKEN(DATA); } datapattern { MS_LEXER_RETURN_TOKEN(DATAPATTERN); } debug { MS_LEXER_RETURN_TOKEN(DEBUG); } driver { MS_LEXER_RETURN_TOKEN(DRIVER); } dump { MS_LEXER_RETURN_TOKEN(DUMP); } empty { MS_LEXER_RETURN_TOKEN(EMPTY); } encoding { MS_LEXER_RETURN_TOKEN(ENCODING); } end { MS_LEXER_RETURN_TOKEN(END); } error { MS_LEXER_RETURN_TOKEN(ERROR); } expression { MS_LEXER_RETURN_TOKEN(EXPRESSION); } extent { MS_LEXER_RETURN_TOKEN(EXTENT); } extension { MS_LEXER_RETURN_TOKEN(EXTENSION); } feature { MS_LEXER_RETURN_TOKEN(FEATURE); } filled { MS_LEXER_RETURN_TOKEN(FILLED); } filter { MS_LEXER_RETURN_TOKEN(FILTER); } filteritem { MS_LEXER_RETURN_TOKEN(FILTERITEM); } footer { MS_LEXER_RETURN_TOKEN(FOOTER); } font { MS_LEXER_RETURN_TOKEN(FONT); } fontset { MS_LEXER_RETURN_TOKEN(FONTSET); } force { MS_LEXER_RETURN_TOKEN(FORCE); } formatoption { MS_LEXER_RETURN_TOKEN(FORMATOPTION); } from { MS_LEXER_RETURN_TOKEN(FROM); } gap { MS_LEXER_RETURN_TOKEN(GAP); } geomtransform { MS_LEXER_RETURN_TOKEN(GEOMTRANSFORM); } grid { MS_LEXER_RETURN_TOKEN(GRID); } gridstep { MS_LEXER_RETURN_TOKEN(GRIDSTEP); } graticule { MS_LEXER_RETURN_TOKEN(GRATICULE); } group { MS_LEXER_RETURN_TOKEN(GROUP); } header { MS_LEXER_RETURN_TOKEN(HEADER); } image { MS_LEXER_RETURN_TOKEN(IMAGE); } imagecolor { MS_LEXER_RETURN_TOKEN(IMAGECOLOR); } imagetype { MS_LEXER_RETURN_TOKEN(IMAGETYPE); } imagequality { MS_LEXER_RETURN_TOKEN(IMAGEQUALITY); } imagemode { MS_LEXER_RETURN_TOKEN(IMAGEMODE); } imagepath { MS_LEXER_RETURN_TOKEN(IMAGEPATH); } temppath { MS_LEXER_RETURN_TOKEN(TEMPPATH); } imageurl { MS_LEXER_RETURN_TOKEN(IMAGEURL); } include { BEGIN(INCLUDE); } index { MS_LEXER_RETURN_TOKEN(INDEX); } initialgap { MS_LEXER_RETURN_TOKEN(INITIALGAP); } interlace { MS_LEXER_RETURN_TOKEN(INTERLACE); } intervals { MS_LEXER_RETURN_TOKEN(INTERVALS); } join { MS_LEXER_RETURN_TOKEN(JOIN); } keyimage { MS_LEXER_RETURN_TOKEN(KEYIMAGE); } keysize { MS_LEXER_RETURN_TOKEN(KEYSIZE); } keyspacing { MS_LEXER_RETURN_TOKEN(KEYSPACING); } label { MS_LEXER_RETURN_TOKEN(LABEL); } labelcache { MS_LEXER_RETURN_TOKEN(LABELCACHE); } labelformat { MS_LEXER_RETURN_TOKEN(LABELFORMAT); } labelitem { MS_LEXER_RETURN_TOKEN(LABELITEM); } labelmaxscale { MS_LEXER_RETURN_TOKEN(LABELMAXSCALE); } labelmaxscaledenom { MS_LEXER_RETURN_TOKEN(LABELMAXSCALEDENOM); } labelminscale { MS_LEXER_RETURN_TOKEN(LABELMINSCALE); } labelminscaledenom { MS_LEXER_RETURN_TOKEN(LABELMINSCALEDENOM); } labelrequires { MS_LEXER_RETURN_TOKEN(LABELREQUIRES); } latlon { MS_LEXER_RETURN_TOKEN(LATLON); } layer { MS_LEXER_RETURN_TOKEN(LAYER); } leader { MS_LEXER_RETURN_TOKEN(LEADER); } legend { MS_LEXER_RETURN_TOKEN(LEGEND); } legendformat { MS_LEXER_RETURN_TOKEN(LEGENDFORMAT); } linecap { MS_LEXER_RETURN_TOKEN(LINECAP); } linejoin { MS_LEXER_RETURN_TOKEN(LINEJOIN); } linejoinmaxsize { MS_LEXER_RETURN_TOKEN(LINEJOINMAXSIZE); } log { MS_LEXER_RETURN_TOKEN(LOG); } map { MS_LEXER_RETURN_TOKEN(MAP); } marker { MS_LEXER_RETURN_TOKEN(MARKER); } markersize { MS_LEXER_RETURN_TOKEN(MARKERSIZE); } mask { MS_LEXER_RETURN_TOKEN(MASK); } maxarcs { MS_LEXER_RETURN_TOKEN(MAXARCS); } maxboxsize { MS_LEXER_RETURN_TOKEN(MAXBOXSIZE); } maxdistance { MS_LEXER_RETURN_TOKEN(MAXDISTANCE); } maxfeatures { MS_LEXER_RETURN_TOKEN(MAXFEATURES); } maxinterval { MS_LEXER_RETURN_TOKEN(MAXINTERVAL); } maxscale { MS_LEXER_RETURN_TOKEN(MAXSCALE); } maxscaledenom { MS_LEXER_RETURN_TOKEN(MAXSCALEDENOM); } maxgeowidth { MS_LEXER_RETURN_TOKEN(MAXGEOWIDTH); } maxlength { MS_LEXER_RETURN_TOKEN(MAXLENGTH); } maxsize { MS_LEXER_RETURN_TOKEN(MAXSIZE); } maxsubdivide { MS_LEXER_RETURN_TOKEN(MAXSUBDIVIDE); } maxtemplate { MS_LEXER_RETURN_TOKEN(MAXTEMPLATE); } maxwidth { MS_LEXER_RETURN_TOKEN(MAXWIDTH); } metadata { MS_LEXER_RETURN_TOKEN(METADATA); } mimetype { MS_LEXER_RETURN_TOKEN(MIMETYPE); } minarcs { MS_LEXER_RETURN_TOKEN(MINARCS); } minboxsize { MS_LEXER_RETURN_TOKEN(MINBOXSIZE); } mindistance { MS_LEXER_RETURN_TOKEN(MINDISTANCE); } repeatdistance { MS_LEXER_RETURN_TOKEN(REPEATDISTANCE); } maxoverlapangle { MS_LEXER_RETURN_TOKEN(MAXOVERLAPANGLE); } minfeaturesize { MS_LEXER_RETURN_TOKEN(MINFEATURESIZE); } mininterval { MS_LEXER_RETURN_TOKEN(MININTERVAL); } minscale { MS_LEXER_RETURN_TOKEN(MINSCALE); } minscaledenom { MS_LEXER_RETURN_TOKEN(MINSCALEDENOM); } mingeowidth { MS_LEXER_RETURN_TOKEN(MINGEOWIDTH); } minlength { MS_LEXER_RETURN_TOKEN(MINLENGTH); } minsize { MS_LEXER_RETURN_TOKEN(MINSIZE); } minsubdivide { MS_LEXER_RETURN_TOKEN(MINSUBDIVIDE); } mintemplate { MS_LEXER_RETURN_TOKEN(MINTEMPLATE); } minwidth { MS_LEXER_RETURN_TOKEN(MINWIDTH); } name { MS_LEXER_RETURN_TOKEN(NAME); } offset { MS_LEXER_RETURN_TOKEN(OFFSET); } offsite { MS_LEXER_RETURN_TOKEN(OFFSITE); } opacity { MS_LEXER_RETURN_TOKEN(OPACITY); } outlinecolor { MS_LEXER_RETURN_TOKEN(OUTLINECOLOR); } outlinewidth { MS_LEXER_RETURN_TOKEN(OUTLINEWIDTH); } outputformat { MS_LEXER_RETURN_TOKEN(OUTPUTFORMAT); } overlaybackgroundcolor { MS_LEXER_RETURN_TOKEN(OVERLAYBACKGROUNDCOLOR); } overlaycolor { MS_LEXER_RETURN_TOKEN(OVERLAYCOLOR); } overlaymaxsize { MS_LEXER_RETURN_TOKEN(OVERLAYMAXSIZE); } overlayminsize { MS_LEXER_RETURN_TOKEN(OVERLAYMINSIZE); } overlayoutlinecolor { MS_LEXER_RETURN_TOKEN(OVERLAYOUTLINECOLOR); } overlaysize { MS_LEXER_RETURN_TOKEN(OVERLAYSIZE); } overlaysymbol { MS_LEXER_RETURN_TOKEN(OVERLAYSYMBOL); } partials { MS_LEXER_RETURN_TOKEN(PARTIALS); } pattern { MS_LEXER_RETURN_TOKEN(PATTERN); } points { MS_LEXER_RETURN_TOKEN(POINTS); } items { MS_LEXER_RETURN_TOKEN(ITEMS); } position { MS_LEXER_RETURN_TOKEN(POSITION); } postlabelcache { MS_LEXER_RETURN_TOKEN(POSTLABELCACHE); } priority { MS_LEXER_RETURN_TOKEN(PRIORITY); } processing { MS_LEXER_RETURN_TOKEN(PROCESSING); } projection { MS_LEXER_RETURN_TOKEN(PROJECTION); } queryformat { MS_LEXER_RETURN_TOKEN(QUERYFORMAT); } querymap { MS_LEXER_RETURN_TOKEN(QUERYMAP); } reference { MS_LEXER_RETURN_TOKEN(REFERENCE); } region { MS_LEXER_RETURN_TOKEN(REGION); } relativeto { MS_LEXER_RETURN_TOKEN(RELATIVETO); } requires { MS_LEXER_RETURN_TOKEN(REQUIRES); } resolution { MS_LEXER_RETURN_TOKEN(RESOLUTION); } defresolution { MS_LEXER_RETURN_TOKEN(DEFRESOLUTION); } scale { MS_LEXER_RETURN_TOKEN(SCALE); } scaledenom { MS_LEXER_RETURN_TOKEN(SCALEDENOM); } scalebar { MS_LEXER_RETURN_TOKEN(SCALEBAR); } shadowcolor { MS_LEXER_RETURN_TOKEN(SHADOWCOLOR); } shadowsize { MS_LEXER_RETURN_TOKEN(SHADOWSIZE); } shapepath { MS_LEXER_RETURN_TOKEN(SHAPEPATH); } size { MS_LEXER_RETURN_TOKEN(SIZE); } sizeunits { MS_LEXER_RETURN_TOKEN(SIZEUNITS); } status { MS_LEXER_RETURN_TOKEN(STATUS); } style { MS_LEXER_RETURN_TOKEN(STYLE); } styleitem { MS_LEXER_RETURN_TOKEN(STYLEITEM); } symbol { MS_LEXER_RETURN_TOKEN(SYMBOL); } symbolscale { MS_LEXER_RETURN_TOKEN(SYMBOLSCALE); } symbolscaledenom { MS_LEXER_RETURN_TOKEN(SYMBOLSCALEDENOM); } symbolset { MS_LEXER_RETURN_TOKEN(SYMBOLSET); } table { MS_LEXER_RETURN_TOKEN(TABLE); } template { MS_LEXER_RETURN_TOKEN(TEMPLATE); } templatepattern { MS_LEXER_RETURN_TOKEN(TEMPLATEPATTERN); } text { MS_LEXER_RETURN_TOKEN(TEXT); } tileindex { MS_LEXER_RETURN_TOKEN(TILEINDEX); } tileitem { MS_LEXER_RETURN_TOKEN(TILEITEM); } title { MS_LEXER_RETURN_TOKEN(TITLE); } to { MS_LEXER_RETURN_TOKEN(TO); } tolerance { MS_LEXER_RETURN_TOKEN(TOLERANCE); } toleranceunits { MS_LEXER_RETURN_TOKEN(TOLERANCEUNITS); } transparency { MS_LEXER_RETURN_TOKEN(TRANSPARENCY); } transparent { MS_LEXER_RETURN_TOKEN(TRANSPARENT); } transform { MS_LEXER_RETURN_TOKEN(TRANSFORM); } type { MS_LEXER_RETURN_TOKEN(TYPE); } units { MS_LEXER_RETURN_TOKEN(UNITS); } validation { MS_LEXER_RETURN_TOKEN(VALIDATION); } web { MS_LEXER_RETURN_TOKEN(WEB); } width { MS_LEXER_RETURN_TOKEN(WIDTH); } wkt { MS_LEXER_RETURN_TOKEN(WKT); } wrap { MS_LEXER_RETURN_TOKEN(WRAP); } annotation { MS_LEXER_RETURN_TOKEN(MS_LAYER_ANNOTATION); } auto { MS_LEXER_RETURN_TOKEN(MS_AUTO); } auto2 { MS_LEXER_RETURN_TOKEN(MS_AUTO2); } bevel { MS_LEXER_RETURN_TOKEN(MS_CJC_BEVEL); } bitmap { MS_LEXER_RETURN_TOKEN(MS_BITMAP); } butt { MS_LEXER_RETURN_TOKEN(MS_CJC_BUTT); } cc { MS_LEXER_RETURN_TOKEN(MS_CC); } center { MS_LEXER_RETURN_TOKEN(MS_ALIGN_CENTER); } chart { MS_LEXER_RETURN_TOKEN(MS_LAYER_CHART); } circle { MS_LEXER_RETURN_TOKEN(MS_LAYER_CIRCLE); } cl { MS_LEXER_RETURN_TOKEN(MS_CL); } cr { MS_LEXER_RETURN_TOKEN(MS_CR); } csv { MS_LEXER_RETURN_TOKEN(MS_DB_CSV); } postgresql { MS_LEXER_RETURN_TOKEN(MS_DB_POSTGRES); } mysql { MS_LEXER_RETURN_TOKEN(MS_DB_MYSQL); } default { MS_LEXER_RETURN_TOKEN(MS_DEFAULT); } dd { MS_LEXER_RETURN_TOKEN(MS_DD); } ellipse { MS_LEXER_RETURN_TOKEN(MS_SYMBOL_ELLIPSE); } embed { MS_LEXER_RETURN_TOKEN(MS_EMBED); } false { MS_LEXER_RETURN_TOKEN(MS_FALSE); } feet { MS_LEXER_RETURN_TOKEN(MS_FEET); } follow { MS_LEXER_RETURN_TOKEN(MS_FOLLOW); } giant { MS_LEXER_RETURN_TOKEN(MS_GIANT); } hatch { MS_LEXER_RETURN_TOKEN(MS_SYMBOL_HATCH); } hilite { MS_LEXER_RETURN_TOKEN(MS_HILITE); } inches { MS_LEXER_RETURN_TOKEN(MS_INCHES); } kilometers { MS_LEXER_RETURN_TOKEN(MS_KILOMETERS); } large { MS_LEXER_RETURN_TOKEN(MS_LARGE); } lc { MS_LEXER_RETURN_TOKEN(MS_LC); } left { MS_LEXER_RETURN_TOKEN(MS_ALIGN_LEFT); } line { MS_LEXER_RETURN_TOKEN(MS_LAYER_LINE); } ll { MS_LEXER_RETURN_TOKEN(MS_LL); } lr { MS_LEXER_RETURN_TOKEN(MS_LR); } medium { MS_LEXER_RETURN_TOKEN(MS_MEDIUM); } meters { MS_LEXER_RETURN_TOKEN(MS_METERS); } nauticalmiles { MS_LEXER_RETURN_TOKEN(MS_NAUTICALMILES); } miles { MS_LEXER_RETURN_TOKEN(MS_MILES); } miter { MS_LEXER_RETURN_TOKEN(MS_CJC_MITER); } multiple { MS_LEXER_RETURN_TOKEN(MS_MULTIPLE); } none { MS_LEXER_RETURN_TOKEN(MS_CJC_NONE); } normal { MS_LEXER_RETURN_TOKEN(MS_NORMAL); } off { MS_LEXER_RETURN_TOKEN(MS_OFF); } ogr { MS_LEXER_RETURN_TOKEN(MS_OGR); } on { MS_LEXER_RETURN_TOKEN(MS_ON); } one-to-one { MS_LEXER_RETURN_TOKEN(MS_JOIN_ONE_TO_ONE); } one-to-many { MS_LEXER_RETURN_TOKEN(MS_JOIN_ONE_TO_MANY); } oraclespatial { MS_LEXER_RETURN_TOKEN(MS_ORACLESPATIAL); } percentages { MS_LEXER_RETURN_TOKEN(MS_PERCENTAGES); } pixmap { MS_LEXER_RETURN_TOKEN(MS_SYMBOL_PIXMAP); } pixels { MS_LEXER_RETURN_TOKEN(MS_PIXELS); } point { MS_LEXER_RETURN_TOKEN(MS_LAYER_POINT); } polygon { MS_LEXER_RETURN_TOKEN(MS_LAYER_POLYGON); } postgis { MS_LEXER_RETURN_TOKEN(MS_POSTGIS); } plugin { MS_LEXER_RETURN_TOKEN(MS_PLUGIN); } query { MS_LEXER_RETURN_TOKEN(MS_LAYER_QUERY); } raster { MS_LEXER_RETURN_TOKEN(MS_LAYER_RASTER); } right { MS_LEXER_RETURN_TOKEN(MS_ALIGN_RIGHT); } round { MS_LEXER_RETURN_TOKEN(MS_CJC_ROUND); } sde { MS_LEXER_RETURN_TOKEN(MS_SDE); } selected { MS_LEXER_RETURN_TOKEN(MS_SELECTED); } simple { MS_LEXER_RETURN_TOKEN(MS_SYMBOL_SIMPLE); } single { MS_LEXER_RETURN_TOKEN(MS_SINGLE); } small { MS_LEXER_RETURN_TOKEN(MS_SMALL); } square { MS_LEXER_RETURN_TOKEN(MS_CJC_SQUARE); } svg { MS_LEXER_RETURN_TOKEN(MS_SYMBOL_SVG); } polaroffset { MS_LEXER_RETURN_TOKEN(POLAROFFSET); } tiny { MS_LEXER_RETURN_TOKEN(MS_TINY); } triangle { MS_LEXER_RETURN_TOKEN(MS_CJC_TRIANGLE); } true { MS_LEXER_RETURN_TOKEN(MS_TRUE); } truetype { MS_LEXER_RETURN_TOKEN(MS_TRUETYPE); } uc { MS_LEXER_RETURN_TOKEN(MS_UC); } ul { MS_LEXER_RETURN_TOKEN(MS_UL); } ur { MS_LEXER_RETURN_TOKEN(MS_UR); } union { MS_LEXER_RETURN_TOKEN(MS_UNION); } uvraster { MS_LEXER_RETURN_TOKEN(MS_UVRASTER); } vector { MS_LEXER_RETURN_TOKEN(MS_SYMBOL_VECTOR); } wfs { MS_LEXER_RETURN_TOKEN(MS_WFS); } wms { MS_LEXER_RETURN_TOKEN(MS_WMS); } alpha { MS_LEXER_RETURN_TOKEN(MS_GD_ALPHA); } \[[a-z/\.][a-z0-9/\.\-\=_ ]*\] { msyytext++; msyytext[strlen(msyytext)-1] = '\0'; MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), msyystring_buffer_size, msyystring_buffer_ptr); strcpy(msyystring_buffer,msyytext); return(MS_STRING); } \[[0-9]*\] { msyytext++; msyytext[strlen(msyytext)-1] = '\0'; MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), msyystring_buffer_size, msyystring_buffer_ptr); strcpy(msyystring_buffer,msyytext); msyynumber = atof(msyytext); return(MS_NUMBER); } \[[^\]]*\] { msyytext++; msyytext[strlen(msyytext)-1] = '\0'; MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), msyystring_buffer_size, msyystring_buffer_ptr); strcpy(msyystring_buffer,msyytext); return(MS_BINDING); } \[shape\] { /* attribute binding - shape (fixed value) */ return(MS_TOKEN_BINDING_SHAPE); } \[[^\]]*\] { /* attribute binding - numeric (no quotes) */ msyytext++; msyytext[strlen(msyytext)-1] = '\0'; MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), msyystring_buffer_size, msyystring_buffer_ptr); strcpy(msyystring_buffer, msyytext); return(MS_TOKEN_BINDING_DOUBLE); } \"\[[^\"]*\]\"|\'\[[^\']*\]\' { /* attribute binding - string (single or double quotes) */ msyytext+=2; msyytext[strlen(msyytext)-2] = '\0'; MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), msyystring_buffer_size, msyystring_buffer_ptr); strcpy(msyystring_buffer, msyytext); return(MS_TOKEN_BINDING_STRING); } \`\[[^\`]*\]\` { /* attribute binding - time */ msyytext+=2; msyytext[strlen(msyytext)-2] = '\0'; MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), msyystring_buffer_size, msyystring_buffer_ptr); strcpy(msyystring_buffer, msyytext); return(MS_TOKEN_BINDING_TIME); } -?[0-9]+|-?[0-9]+\.[0-9]*|-?\.[0-9]*|-?[0-9]+[eE][+-]?[0-9]+|-?[0-9]+\.[0-9]*[eE][+-]?[0-9]+|-?\.[0-9]*[eE][+-]?[0-9]+ { MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), msyystring_buffer_size, msyystring_buffer_ptr); strcpy(msyystring_buffer,msyytext); msyynumber = atof(msyytext); return(MS_NUMBER); } -?[0-9]+|-?[0-9]+\.[0-9]*|-?\.[0-9]*|-?[0-9]+[eE][+-]?[0-9]+|-?[0-9]+\.[0-9]*[eE][+-]?[0-9]+|-?\.[0-9]*[eE][+-]?[0-9]+ { MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), msyystring_buffer_size, msyystring_buffer_ptr); strcpy(msyystring_buffer,msyytext); msyynumber = atof(msyytext); return(MS_TOKEN_LITERAL_NUMBER); } \`[^\`]*\` { msyytext++; msyytext[strlen(msyytext)-1] = '\0'; MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), msyystring_buffer_size, msyystring_buffer_ptr); strcpy(msyystring_buffer, msyytext); return(MS_TOKEN_LITERAL_TIME); } \/[^\/]*\/i { msyytext++; msyytext[strlen(msyytext)-2] = '\0'; MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), msyystring_buffer_size, msyystring_buffer_ptr); strcpy(msyystring_buffer, msyytext); return(MS_IREGEX); } \/[^\/]*\/ { msyytext++; msyytext[strlen(msyytext)-1] = '\0'; MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), msyystring_buffer_size, msyystring_buffer_ptr); strcpy(msyystring_buffer, msyytext); return(MS_REGEX); } \(.*\) { msyytext++; msyytext[strlen(msyytext)-1] = '\0'; MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), msyystring_buffer_size, msyystring_buffer_ptr); strcpy(msyystring_buffer, msyytext); return(MS_EXPRESSION); } \'|\" { msyystring_return_state = MS_STRING; msyystring_begin = msyytext[0]; msyystring_size = 0; msyystring_buffer_ptr = msyystring_buffer; BEGIN(MSSTRING); } \'|\"|\"i|\'i { MS_LEXER_STRING_REALLOC(msyystring_buffer, msyystring_size, msyystring_buffer_size, msyystring_buffer_ptr); if (msyystring_begin == msyytext[0]) { BEGIN(msyystring_begin_state); *msyystring_buffer_ptr = '\0'; if (msyystring_return_state == MS_STRING) { if (msyystring_icase && strlen(msyytext)==2) { msyystring_icase = MS_FALSE; // reset return MS_ISTRING; } else return MS_STRING; } return msyystring_return_state; } else { ++msyystring_size; *msyystring_buffer_ptr++ = *msyytext; if (strlen(msyytext)==2) { MS_LEXER_STRING_REALLOC(msyystring_buffer, msyystring_size, msyystring_buffer_size, msyystring_buffer_ptr); ++msyystring_size; *msyystring_buffer_ptr++ = msyytext[1]; } } } \\\'|\\\"|\\\\|\\ { MS_LEXER_STRING_REALLOC(msyystring_buffer, msyystring_size, msyystring_buffer_size, msyystring_buffer_ptr); ++msyystring_size; if (strlen(msyytext) == 2) *msyystring_buffer_ptr++ = msyytext[1]; else *msyystring_buffer_ptr++ = msyytext[0]; } [^\\\'\\\"]+ { char *yptr = msyytext; while ( *yptr ) { MS_LEXER_STRING_REALLOC(msyystring_buffer, msyystring_size, msyystring_buffer_size, msyystring_buffer_ptr); ++msyystring_size; *msyystring_buffer_ptr++ = *yptr++; } } \"[^\"]*\"|\'[^\']*\' { msyytext++; msyytext[strlen(msyytext)-1] = '\0'; if(include_stack_ptr >= MAX_INCLUDE_DEPTH) { msSetError(MS_IOERR, "Includes nested to deeply.", "msyylex()"); return(-1); } include_stack[include_stack_ptr] = YY_CURRENT_BUFFER; /* save state */ include_lineno[include_stack_ptr] = msyylineno; include_stack_ptr++; msyyin = fopen(msBuildPath(path, msyybasepath, msyytext), "r"); if(!msyyin) { msSetError(MS_IOERR, "Error opening included file \"%s\".", "msyylex()", msyytext); return(-1); } msyy_switch_to_buffer( msyy_create_buffer(msyyin, YY_BUF_SIZE) ); msyylineno = 1; BEGIN(INITIAL); } \'|\" { msyystring_return_state = MS_TOKEN_LITERAL_STRING; msyystring_begin = msyytext[0]; msyystring_size = 0; msyystring_buffer_ptr = msyystring_buffer; BEGIN(MSSTRING); } [a-z/\.][a-z0-9/\._\-\=]* { MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), msyystring_buffer_size, msyystring_buffer_ptr); strcpy(msyystring_buffer, msyytext); return(MS_STRING); } \n { msyylineno++; } <> { if( --include_stack_ptr < 0 ) return(EOF); /* end of main file */ else { fclose(YY_CURRENT_BUFFER->yy_input_file); msyy_delete_buffer( YY_CURRENT_BUFFER ); msyy_switch_to_buffer(include_stack[include_stack_ptr]); msyylineno = include_lineno[include_stack_ptr]; } } [\r|\n|\0] { return(0); } . { MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), msyystring_buffer_size, msyystring_buffer_ptr); strcpy(msyystring_buffer, msyytext); return(0); } . { return(msyytext[0]); } %% /* ** Any extra C functions */ int msyywrap() /* override */ { return(1); } int msyyerror(char *s) { msSetError(MS_PARSEERR, s, "msyyparse()"); return(0); }