[mapserver-commits] r10775 - sandbox/sdlime/common-expressions/mapserver

svn at osgeo.org svn at osgeo.org
Wed Dec 1 23:57:11 EST 2010


Author: sdlime
Date: 2010-12-01 20:57:11 -0800 (Wed, 01 Dec 2010)
New Revision: 10775

Modified:
   sandbox/sdlime/common-expressions/mapserver/mapparser.c
   sandbox/sdlime/common-expressions/mapserver/mapparser.h
   sandbox/sdlime/common-expressions/mapserver/mapparser.y
Log:
Include mapparser.h in mapparser.y to avoid warnings with yylex() function prototype.

Modified: sandbox/sdlime/common-expressions/mapserver/mapparser.c
===================================================================
--- sandbox/sdlime/common-expressions/mapserver/mapparser.c	2010-12-01 18:39:49 UTC (rev 10774)
+++ sandbox/sdlime/common-expressions/mapserver/mapparser.c	2010-12-02 04:57:11 UTC (rev 10775)
@@ -139,13 +139,12 @@
 #include "maptime.h" /* for time comparison routines */
 #include "mapprimitive.h" /* for shapeObj */
 
-/*
-** Probably need to move yylex() and yyerror() to a separate file to avoid parse errors with YYSTYP and/or compiler warnings...
-*/
-// int yylex(YYSTYPE *, parseObj *); /* prototype functions, defined after the grammar */
-// int yyerror(parseObj *, const char *);
+#include "mapparser.h" /* for YYSTYPE in the function prototype for yylex() */
 
+int yylex(YYSTYPE *, parseObj *); /* prototype functions, defined after the grammar */
+int yyerror(parseObj *, const char *);
 
+
 /* Enabling traces.  */
 #ifndef YYDEBUG
 # define YYDEBUG 0
@@ -160,7 +159,7 @@
 #endif
 
 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 31 "mapparser.y"
+#line 30 "mapparser.y"
 typedef union YYSTYPE {
   double dblval;
   int intval;  
@@ -169,7 +168,7 @@
   shapeObj *shpval;
 } YYSTYPE;
 /* Line 185 of yacc.c.  */
-#line 173 "mapparser.c"
+#line 172 "mapparser.c"
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 # define YYSTYPE_IS_TRIVIAL 1
@@ -181,7 +180,7 @@
 
 
 /* Line 213 of yacc.c.  */
-#line 185 "mapparser.c"
+#line 184 "mapparser.c"
 
 #if ! defined (yyoverflow) || YYERROR_VERBOSE
 
@@ -388,14 +387,14 @@
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 static const unsigned short int yyrline[] =
 {
-       0,    66,    66,    67,    80,    94,   107,   118,   126,   135,
-     143,   152,   160,   169,   177,   186,   187,   188,   201,   214,
-     220,   226,   232,   238,   244,   250,   251,   259,   267,   276,
-     284,   292,   300,   306,   312,   318,   324,   330,   336,   357,
-     378,   384,   392,   399,   410,   421,   432,   443,   454,   465,
-     476,   487,   497,   509,   510,   511,   512,   513,   514,   515,
-     522,   523,   524,   525,   533,   536,   537,   538,   550,   551,
-     552,   556,   560,   566,   567
+       0,    65,    65,    66,    79,    93,   106,   117,   125,   134,
+     142,   151,   159,   168,   176,   185,   186,   187,   200,   213,
+     219,   225,   231,   237,   243,   249,   250,   258,   266,   275,
+     283,   291,   299,   305,   311,   317,   323,   329,   335,   356,
+     377,   383,   391,   398,   409,   420,   431,   442,   453,   464,
+     475,   486,   496,   508,   509,   510,   511,   512,   513,   514,
+     521,   522,   523,   524,   532,   535,   536,   537,   549,   550,
+     551,   555,   559,   565,   566
 };
 #endif
 
@@ -1255,7 +1254,7 @@
   switch (yyn)
     {
         case 3:
-#line 67 "mapparser.y"
+#line 66 "mapparser.y"
     {
       switch(p->type) {
       case(MS_PARSE_TYPE_BOOLEAN):
@@ -1272,7 +1271,7 @@
     break;
 
   case 4:
-#line 80 "mapparser.y"
+#line 79 "mapparser.y"
     {
       switch(p->type) {
       case(MS_PARSE_TYPE_BOOLEAN):
@@ -1290,7 +1289,7 @@
     break;
 
   case 5:
-#line 94 "mapparser.y"
+#line 93 "mapparser.y"
     {
       switch(p->type) {
       case(MS_PARSE_TYPE_BOOLEAN):
@@ -1307,7 +1306,7 @@
     break;
 
   case 6:
-#line 107 "mapparser.y"
+#line 106 "mapparser.y"
     {
     switch(p->type) {
     case(MS_PARSE_TYPE_SHAPE):
@@ -1319,7 +1318,7 @@
     break;
 
   case 7:
-#line 118 "mapparser.y"
+#line 117 "mapparser.y"
     {
 	                                 if((yyvsp[-2].intval) == MS_TRUE)
 		                           (yyval.intval) = MS_TRUE;
@@ -1331,7 +1330,7 @@
     break;
 
   case 8:
-#line 126 "mapparser.y"
+#line 125 "mapparser.y"
     {
 	                                 if((yyvsp[-2].intval) == MS_TRUE) {
 			                   if((yyvsp[0].intval) == MS_TRUE)
@@ -1344,7 +1343,7 @@
     break;
 
   case 9:
-#line 135 "mapparser.y"
+#line 134 "mapparser.y"
     {
 	                                 if((yyvsp[-2].intval) == MS_TRUE)
 		                           (yyval.intval) = MS_TRUE;
@@ -1356,7 +1355,7 @@
     break;
 
   case 10:
-#line 143 "mapparser.y"
+#line 142 "mapparser.y"
     {
 	                                 if((yyvsp[-2].intval) == MS_TRUE) {
 			                   if((yyvsp[0].dblval) != 0)
@@ -1369,7 +1368,7 @@
     break;
 
   case 11:
-#line 152 "mapparser.y"
+#line 151 "mapparser.y"
     {
 	                                 if((yyvsp[-2].dblval) != 0)
 		                           (yyval.intval) = MS_TRUE;
@@ -1381,7 +1380,7 @@
     break;
 
   case 12:
-#line 160 "mapparser.y"
+#line 159 "mapparser.y"
     {
 	                                 if((yyvsp[-2].dblval) != 0) {
 			                   if((yyvsp[0].intval) == MS_TRUE)
@@ -1394,7 +1393,7 @@
     break;
 
   case 13:
-#line 169 "mapparser.y"
+#line 168 "mapparser.y"
     {
 	                                 if((yyvsp[-2].dblval) != 0)
 		                           (yyval.intval) = MS_TRUE;
@@ -1406,7 +1405,7 @@
     break;
 
   case 14:
-#line 177 "mapparser.y"
+#line 176 "mapparser.y"
     {
 	                                 if((yyvsp[-2].dblval) != 0) {
 			                   if((yyvsp[0].dblval) != 0)
@@ -1419,17 +1418,17 @@
     break;
 
   case 15:
-#line 186 "mapparser.y"
+#line 185 "mapparser.y"
     { (yyval.intval) = !(yyvsp[0].intval); }
     break;
 
   case 16:
-#line 187 "mapparser.y"
+#line 186 "mapparser.y"
     { (yyval.intval) = !(yyvsp[0].dblval); }
     break;
 
   case 17:
-#line 188 "mapparser.y"
+#line 187 "mapparser.y"
     {
                                          ms_regex_t re;
 
@@ -1446,7 +1445,7 @@
     break;
 
   case 18:
-#line 201 "mapparser.y"
+#line 200 "mapparser.y"
     {
                                          ms_regex_t re;
 
@@ -1463,7 +1462,7 @@
     break;
 
   case 19:
-#line 214 "mapparser.y"
+#line 213 "mapparser.y"
     {
 	                                 if((yyvsp[-2].dblval) == (yyvsp[0].dblval))
 	 		                   (yyval.intval) = MS_TRUE;
@@ -1473,7 +1472,7 @@
     break;
 
   case 20:
-#line 220 "mapparser.y"
+#line 219 "mapparser.y"
     {
 	                                 if((yyvsp[-2].dblval) != (yyvsp[0].dblval))
 			                   (yyval.intval) = MS_TRUE;
@@ -1483,7 +1482,7 @@
     break;
 
   case 21:
-#line 226 "mapparser.y"
+#line 225 "mapparser.y"
     {	                                 
 	                                 if((yyvsp[-2].dblval) > (yyvsp[0].dblval))
 			                   (yyval.intval) = MS_TRUE;
@@ -1493,7 +1492,7 @@
     break;
 
   case 22:
-#line 232 "mapparser.y"
+#line 231 "mapparser.y"
     {
 	                                 if((yyvsp[-2].dblval) < (yyvsp[0].dblval))
 			                   (yyval.intval) = MS_TRUE;
@@ -1503,7 +1502,7 @@
     break;
 
   case 23:
-#line 238 "mapparser.y"
+#line 237 "mapparser.y"
     {	                                 
 	                                 if((yyvsp[-2].dblval) >= (yyvsp[0].dblval))
 			                   (yyval.intval) = MS_TRUE;
@@ -1513,7 +1512,7 @@
     break;
 
   case 24:
-#line 244 "mapparser.y"
+#line 243 "mapparser.y"
     {
 	                                 if((yyvsp[-2].dblval) <= (yyvsp[0].dblval))
 			                   (yyval.intval) = MS_TRUE;
@@ -1523,12 +1522,12 @@
     break;
 
   case 25:
-#line 250 "mapparser.y"
+#line 249 "mapparser.y"
     { (yyval.intval) = (yyvsp[-1].intval); }
     break;
 
   case 26:
-#line 251 "mapparser.y"
+#line 250 "mapparser.y"
     {
                                          if(strcmp((yyvsp[-2].strval), (yyvsp[0].strval)) == 0)
 					   (yyval.intval) = MS_TRUE;
@@ -1540,7 +1539,7 @@
     break;
 
   case 27:
-#line 259 "mapparser.y"
+#line 258 "mapparser.y"
     {
                                          if(strcmp((yyvsp[-2].strval), (yyvsp[0].strval)) != 0)
 					   (yyval.intval) = MS_TRUE;
@@ -1552,7 +1551,7 @@
     break;
 
   case 28:
-#line 267 "mapparser.y"
+#line 266 "mapparser.y"
     {
                                          if(strcmp((yyvsp[-2].strval), (yyvsp[0].strval)) > 0)
 					   (yyval.intval) = MS_TRUE;
@@ -1565,7 +1564,7 @@
     break;
 
   case 29:
-#line 276 "mapparser.y"
+#line 275 "mapparser.y"
     {
                                          if(strcmp((yyvsp[-2].strval), (yyvsp[0].strval)) < 0)
 					   (yyval.intval) = MS_TRUE;
@@ -1577,7 +1576,7 @@
     break;
 
   case 30:
-#line 284 "mapparser.y"
+#line 283 "mapparser.y"
     {
                                          if(strcmp((yyvsp[-2].strval), (yyvsp[0].strval)) >= 0)
 					   (yyval.intval) = MS_TRUE;
@@ -1589,7 +1588,7 @@
     break;
 
   case 31:
-#line 292 "mapparser.y"
+#line 291 "mapparser.y"
     {
                                          if(strcmp((yyvsp[-2].strval), (yyvsp[0].strval)) <= 0)
 					   (yyval.intval) = MS_TRUE;
@@ -1601,7 +1600,7 @@
     break;
 
   case 32:
-#line 300 "mapparser.y"
+#line 299 "mapparser.y"
     {
                                      if(msTimeCompare(&((yyvsp[-2].tmval)), &((yyvsp[0].tmval))) == 0)
 				       (yyval.intval) = MS_TRUE;
@@ -1611,7 +1610,7 @@
     break;
 
   case 33:
-#line 306 "mapparser.y"
+#line 305 "mapparser.y"
     {
                                      if(msTimeCompare(&((yyvsp[-2].tmval)), &((yyvsp[0].tmval))) != 0)
 				       (yyval.intval) = MS_TRUE;
@@ -1621,7 +1620,7 @@
     break;
 
   case 34:
-#line 312 "mapparser.y"
+#line 311 "mapparser.y"
     {
                                      if(msTimeCompare(&((yyvsp[-2].tmval)), &((yyvsp[0].tmval))) > 0)
 				       (yyval.intval) = MS_TRUE;
@@ -1631,7 +1630,7 @@
     break;
 
   case 35:
-#line 318 "mapparser.y"
+#line 317 "mapparser.y"
     {
                                      if(msTimeCompare(&((yyvsp[-2].tmval)), &((yyvsp[0].tmval))) < 0)
 				       (yyval.intval) = MS_TRUE;
@@ -1641,7 +1640,7 @@
     break;
 
   case 36:
-#line 324 "mapparser.y"
+#line 323 "mapparser.y"
     {
                                      if(msTimeCompare(&((yyvsp[-2].tmval)), &((yyvsp[0].tmval))) >= 0)
 				       (yyval.intval) = MS_TRUE;
@@ -1651,7 +1650,7 @@
     break;
 
   case 37:
-#line 330 "mapparser.y"
+#line 329 "mapparser.y"
     {
                                      if(msTimeCompare(&((yyvsp[-2].tmval)), &((yyvsp[0].tmval))) <= 0)
 				       (yyval.intval) = MS_TRUE;
@@ -1661,7 +1660,7 @@
     break;
 
   case 38:
-#line 336 "mapparser.y"
+#line 335 "mapparser.y"
     {
 					 char *delim,*bufferp;
 
@@ -1686,7 +1685,7 @@
     break;
 
   case 39:
-#line 357 "mapparser.y"
+#line 356 "mapparser.y"
     {
 					 char *delim,*bufferp;
 
@@ -1711,7 +1710,7 @@
     break;
 
   case 40:
-#line 378 "mapparser.y"
+#line 377 "mapparser.y"
     {
 	                                 if((yyvsp[-2].dblval) == (yyvsp[0].dblval))
 	 		                   (yyval.intval) = MS_TRUE;
@@ -1721,7 +1720,7 @@
     break;
 
   case 41:
-#line 384 "mapparser.y"
+#line 383 "mapparser.y"
     {
                                          if(strcasecmp((yyvsp[-2].strval), (yyvsp[0].strval)) == 0)
 					   (yyval.intval) = MS_TRUE;
@@ -1733,7 +1732,7 @@
     break;
 
   case 42:
-#line 392 "mapparser.y"
+#line 391 "mapparser.y"
     {
                                      if(msTimeCompare(&((yyvsp[-2].tmval)), &((yyvsp[0].tmval))) == 0)
 				       (yyval.intval) = MS_TRUE;
@@ -1743,7 +1742,7 @@
     break;
 
   case 43:
-#line 399 "mapparser.y"
+#line 398 "mapparser.y"
     {
       int rval;
       rval = msGEOSEquals((yyvsp[-2].shpval), (yyvsp[0].shpval));
@@ -1758,7 +1757,7 @@
     break;
 
   case 44:
-#line 410 "mapparser.y"
+#line 409 "mapparser.y"
     {
       int rval;
       rval = msGEOSIntersects((yyvsp[-2].shpval), (yyvsp[0].shpval));      
@@ -1773,7 +1772,7 @@
     break;
 
   case 45:
-#line 421 "mapparser.y"
+#line 420 "mapparser.y"
     {
       int rval;
       rval = msGEOSDisjoint((yyvsp[-2].shpval), (yyvsp[0].shpval));
@@ -1788,7 +1787,7 @@
     break;
 
   case 46:
-#line 432 "mapparser.y"
+#line 431 "mapparser.y"
     {
       int rval;
       rval = msGEOSTouches((yyvsp[-2].shpval), (yyvsp[0].shpval));
@@ -1803,7 +1802,7 @@
     break;
 
   case 47:
-#line 443 "mapparser.y"
+#line 442 "mapparser.y"
     {
       int rval;
       rval = msGEOSOverlaps((yyvsp[-2].shpval), (yyvsp[0].shpval));
@@ -1818,7 +1817,7 @@
     break;
 
   case 48:
-#line 454 "mapparser.y"
+#line 453 "mapparser.y"
     {
       int rval;
       rval = msGEOSCrosses((yyvsp[-2].shpval), (yyvsp[0].shpval));
@@ -1833,7 +1832,7 @@
     break;
 
   case 49:
-#line 465 "mapparser.y"
+#line 464 "mapparser.y"
     {
       int rval;
       rval = msGEOSWithin((yyvsp[-2].shpval), (yyvsp[0].shpval));
@@ -1848,7 +1847,7 @@
     break;
 
   case 50:
-#line 476 "mapparser.y"
+#line 475 "mapparser.y"
     {
       int rval;
       rval = msGEOSWithin((yyvsp[-2].shpval), (yyvsp[0].shpval));
@@ -1863,7 +1862,7 @@
     break;
 
   case 51:
-#line 487 "mapparser.y"
+#line 486 "mapparser.y"
     {
       double d;
       d = msGEOSDistance((yyvsp[-2].shpval), (yyvsp[0].shpval));
@@ -1877,7 +1876,7 @@
     break;
 
   case 52:
-#line 497 "mapparser.y"
+#line 496 "mapparser.y"
     {
       double d;
       d = msGEOSDistance((yyvsp[-2].shpval), (yyvsp[0].shpval));
@@ -1891,32 +1890,32 @@
     break;
 
   case 54:
-#line 510 "mapparser.y"
+#line 509 "mapparser.y"
     { (yyval.dblval) = (yyvsp[-1].dblval); }
     break;
 
   case 55:
-#line 511 "mapparser.y"
+#line 510 "mapparser.y"
     { (yyval.dblval) = (yyvsp[-2].dblval) + (yyvsp[0].dblval); }
     break;
 
   case 56:
-#line 512 "mapparser.y"
+#line 511 "mapparser.y"
     { (yyval.dblval) = (yyvsp[-2].dblval) - (yyvsp[0].dblval); }
     break;
 
   case 57:
-#line 513 "mapparser.y"
+#line 512 "mapparser.y"
     { (yyval.dblval) = (yyvsp[-2].dblval) * (yyvsp[0].dblval); }
     break;
 
   case 58:
-#line 514 "mapparser.y"
+#line 513 "mapparser.y"
     { (yyval.dblval) = (int)(yyvsp[-2].dblval) % (int)(yyvsp[0].dblval); }
     break;
 
   case 59:
-#line 515 "mapparser.y"
+#line 514 "mapparser.y"
     {
       if((yyvsp[0].dblval) == 0.0) {
         yyerror(p, "Division by zero.");
@@ -1927,22 +1926,22 @@
     break;
 
   case 60:
-#line 522 "mapparser.y"
+#line 521 "mapparser.y"
     { (yyval.dblval) = (yyvsp[0].dblval); }
     break;
 
   case 61:
-#line 523 "mapparser.y"
+#line 522 "mapparser.y"
     { (yyval.dblval) = pow((yyvsp[-2].dblval), (yyvsp[0].dblval)); }
     break;
 
   case 62:
-#line 524 "mapparser.y"
+#line 523 "mapparser.y"
     { (yyval.dblval) = strlen((yyvsp[-1].strval)); }
     break;
 
   case 63:
-#line 525 "mapparser.y"
+#line 524 "mapparser.y"
     {
       if((yyvsp[-1].shpval)->type != MS_SHAPE_POLYGON) {
         yyerror(p, "Area can only be computed for polygon shapes.");
@@ -1954,17 +1953,17 @@
     break;
 
   case 64:
-#line 533 "mapparser.y"
+#line 532 "mapparser.y"
     { (yyval.dblval) = (MS_NINT((yyvsp[-3].dblval)/(yyvsp[-1].dblval)))*(yyvsp[-1].dblval); }
     break;
 
   case 66:
-#line 537 "mapparser.y"
+#line 536 "mapparser.y"
     { (yyval.shpval) = (yyvsp[-1].shpval); }
     break;
 
   case 67:
-#line 538 "mapparser.y"
+#line 537 "mapparser.y"
     {
       shapeObj *s;
       s = msGEOSBuffer((yyvsp[-3].shpval), (yyvsp[-1].dblval));
@@ -1978,12 +1977,12 @@
     break;
 
   case 69:
-#line 551 "mapparser.y"
+#line 550 "mapparser.y"
     { (yyval.strval) = (yyvsp[-1].strval); }
     break;
 
   case 70:
-#line 552 "mapparser.y"
+#line 551 "mapparser.y"
     { 
       (yyval.strval) = (char *)malloc(strlen((yyvsp[-2].strval)) + strlen((yyvsp[0].strval)) + 1);
       sprintf((yyval.strval), "%s%s", (yyvsp[-2].strval), (yyvsp[0].strval)); free((yyvsp[-2].strval)); free((yyvsp[0].strval)); 
@@ -1991,7 +1990,7 @@
     break;
 
   case 71:
-#line 556 "mapparser.y"
+#line 555 "mapparser.y"
     {
       (yyval.strval) = (char *) malloc(strlen((yyvsp[-1].strval)) + 64); /* Plenty big? Should use snprintf below... */
       sprintf((yyval.strval), (yyvsp[-1].strval), (yyvsp[-3].dblval));
@@ -1999,7 +1998,7 @@
     break;
 
   case 72:
-#line 560 "mapparser.y"
+#line 559 "mapparser.y"
     {  
       (yyvsp[-1].strval) = msCommifyString((yyvsp[-1].strval)); 
       (yyval.strval) = (yyvsp[-1].strval); 
@@ -2007,7 +2006,7 @@
     break;
 
   case 74:
-#line 567 "mapparser.y"
+#line 566 "mapparser.y"
     { (yyval.tmval) = (yyvsp[-1].tmval); }
     break;
 
@@ -2015,7 +2014,7 @@
     }
 
 /* Line 1037 of yacc.c.  */
-#line 2019 "mapparser.c"
+#line 2018 "mapparser.c"
 
   yyvsp -= yylen;
   yyssp -= yylen;
@@ -2243,7 +2242,7 @@
 }
 
 
-#line 570 "mapparser.y"
+#line 569 "mapparser.y"
 
 
 /*

Modified: sandbox/sdlime/common-expressions/mapserver/mapparser.h
===================================================================
--- sandbox/sdlime/common-expressions/mapserver/mapparser.h	2010-12-01 18:39:49 UTC (rev 10774)
+++ sandbox/sdlime/common-expressions/mapserver/mapparser.h	2010-12-02 04:57:11 UTC (rev 10775)
@@ -102,7 +102,7 @@
 
 
 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 31 "mapparser.y"
+#line 30 "mapparser.y"
 typedef union YYSTYPE {
   double dblval;
   int intval;  

Modified: sandbox/sdlime/common-expressions/mapserver/mapparser.y
===================================================================
--- sandbox/sdlime/common-expressions/mapserver/mapparser.y	2010-12-01 18:39:49 UTC (rev 10774)
+++ sandbox/sdlime/common-expressions/mapserver/mapparser.y	2010-12-02 04:57:11 UTC (rev 10775)
@@ -14,11 +14,10 @@
 #include "maptime.h" /* for time comparison routines */
 #include "mapprimitive.h" /* for shapeObj */
 
-/*
-** Probably need to move yylex() and yyerror() to a separate file to avoid parse errors with YYSTYP and/or compiler warnings...
-*/
-// int yylex(YYSTYPE *, parseObj *); /* prototype functions, defined after the grammar */
-// int yyerror(parseObj *, const char *);
+#include "mapparser.h" /* for YYSTYPE in the function prototype for yylex() */
+
+int yylex(YYSTYPE *, parseObj *); /* prototype functions, defined after the grammar */
+int yyerror(parseObj *, const char *);
 %}
 
 /* Bison/Yacc declarations */



More information about the mapserver-commits mailing list