[Git][debian-gis-team/mapserver][upstream] New upstream version 7.2.2
Bas Couwenberg
gitlab at salsa.debian.org
Tue Feb 19 18:30:28 GMT 2019
Bas Couwenberg pushed to branch upstream at Debian GIS Project / mapserver
Commits:
bdbe4db7 by Bas Couwenberg at 2019-02-19T16:56:29Z
New upstream version 7.2.2
- - - - -
19 changed files:
- CMakeLists.txt
- HISTORY.TXT
- README.rst
- mapfile.c
- maplexer.c
- maplexer.l
- mapmetadata.c
- mapmssql2008.c
- mapmvt.c
- mapogcfiltercommon.c
- mapparser.c
- mapparser.h
- mapparser.y
- mappostgis.c
- mapscript/csharp/CMakeLists.txt
- mapscript/java/CMakeLists.txt
- mapscript/perl/CMakeLists.txt
- mapscript/ruby/CMakeLists.txt
- mapwms.c
Changes:
=====================================
CMakeLists.txt
=====================================
@@ -17,7 +17,7 @@ include(CheckCSourceCompiles)
set (MapServer_VERSION_MAJOR 7)
set (MapServer_VERSION_MINOR 2)
-set (MapServer_VERSION_REVISION 1)
+set (MapServer_VERSION_REVISION 2)
set (MapServer_VERSION_SUFFIX "")
set(TARGET_VERSION_MAJOR ${MapServer_VERSION_MAJOR})
=====================================
HISTORY.TXT
=====================================
@@ -12,6 +12,11 @@ For a complete change history, please see the Git log comments. For more
details about recent point releases, please see the online changelog at:
http://mapserver.org/development/changelog/
+7.2.2 release (2019-2-19)
+--------------------------
+
+- No major changes, see detailed changelog for bug fixes
+
7.2.1 release (2018-10-1)
--------------------------
=====================================
README.rst
=====================================
@@ -69,7 +69,7 @@ License
::
- Copyright (c) 2008-2018 Open Source Geospatial Foundation.
+ Copyright (c) 2008-2019 Open Source Geospatial Foundation.
Copyright (c) 1996-2008 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a copy
=====================================
mapfile.c
=====================================
@@ -525,13 +525,13 @@ static void writeKeyword(FILE *stream, int indent, const char *name, int value,
va_end(argp);
}
-static void writeDimension(FILE *stream, int indent, const char *name, int x, int y, char *bind_x, char *bind_y)
+static void writeDimension(FILE *stream, int indent, const char *name, double x, double y, char *bind_x, char *bind_y)
{
writeIndent(stream, ++indent);
if(bind_x) msIO_fprintf(stream, "%s [%s] ", name, bind_x);
- else msIO_fprintf(stream, "%s %d ", name, x);
+ else msIO_fprintf(stream, "%s %.15g ", name, x);
if(bind_y) msIO_fprintf(stream, "[%s]\n", bind_y);
- else msIO_fprintf(stream, "%d\n", y);
+ else msIO_fprintf(stream, "%.15g\n", y);
}
static void writeDoubleRange(FILE *stream, int indent, const char *name, double x, double y)
=====================================
maplexer.c
=====================================
@@ -2754,7 +2754,7 @@ YY_RULE_SETUP
case 21:
YY_RULE_SETUP
#line 188 "maplexer.l"
-{ MS_LEXER_RETURN_TOKEN(IN); }
+{ MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_IN); /* was IN */ }
YY_BREAK
case 22:
YY_RULE_SETUP
=====================================
maplexer.l
=====================================
@@ -185,7 +185,7 @@ char path[MS_MAXPATHLEN];
<EXPRESSION_STRING>=\* { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_IEQ); }
<EXPRESSION_STRING>~\* { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_IRE); }
-<EXPRESSION_STRING>in { MS_LEXER_RETURN_TOKEN(IN); }
+<EXPRESSION_STRING>in { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_IN); /* was IN */ }
<EXPRESSION_STRING>area { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_AREA); }
<EXPRESSION_STRING>length { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_LENGTH); }
=====================================
mapmetadata.c
=====================================
@@ -89,6 +89,7 @@ xmlNodePtr _msMetadataGetOnline(xmlNsPtr namespace, layerObj *layer, char *servi
char *url = NULL;
char buffer[32];
char *epsg_str;
+ char *link_protocol;
xmlNodePtr psNode = NULL;
xmlNodePtr psORNode = NULL;
@@ -108,6 +109,7 @@ xmlNodePtr _msMetadataGetOnline(xmlNsPtr namespace, layerObj *layer, char *servi
url = msStringConcatenate(url, msEncodeHTMLEntities("&crs="));
msOWSGetEPSGProj(&(layer->projection), &(layer->metadata), "MFCSGO", MS_TRUE, &epsg_str);
url = msStringConcatenate(url, msEncodeHTMLEntities(epsg_str));
+ link_protocol = "WWW:DOWNLOAD-1.0-http-get-map";
status = msLayerGetExtent(layer, &rect);
@@ -127,12 +129,14 @@ xmlNodePtr _msMetadataGetOnline(xmlNsPtr namespace, layerObj *layer, char *servi
}
}
else if (strcasecmp(service, "F") == 0) {
+ link_protocol = "WWW:DOWNLOAD-1.0-http--download";
url = msStringConcatenate(url, msEncodeHTMLEntities("service=WFS&version=1.1.0&request=GetFeature&typename="));
url = msStringConcatenate(url, msEncodeHTMLEntities(layer->name));
url = msStringConcatenate(url, msEncodeHTMLEntities("&outputformat="));
url = msStringConcatenate(url, msEncodeHTMLEntities(format));
}
else if (strcasecmp(service, "C") == 0) {
+ link_protocol = "WWW:DOWNLOAD-1.0-http--download";
url = msStringConcatenate(url, msEncodeHTMLEntities("service=WCS&version=2.0.1&request=GetCoverage&coverageid="));
url = msStringConcatenate(url, msEncodeHTMLEntities(layer->name));
url = msStringConcatenate(url, msEncodeHTMLEntities("&format="));
@@ -141,7 +145,7 @@ xmlNodePtr _msMetadataGetOnline(xmlNsPtr namespace, layerObj *layer, char *servi
xmlAddChild(psORNode, _msMetadataGetURL(namespace, "linkage", url));
- xmlAddChild(psORNode, _msMetadataGetCharacterString(namespace, "protocol", "WWW:DOWNLOAD-1.0-http--download"));
+ xmlAddChild(psORNode, _msMetadataGetCharacterString(namespace, "protocol", link_protocol));
xmlAddChild(psORNode, _msMetadataGetCharacterString(namespace, "name", layer->name));
xmlAddChild(psORNode, _msMetadataGetCharacterString(namespace, "description", desc));
@@ -450,12 +454,12 @@ xmlNodePtr _msMetadataGetContact(xmlNsPtr namespace, char *contact_element, mapO
if (value)
xmlAddChild(psCIAddressNode, _msMetadataGetCharacterString(namespace, "electronicMailAddress", value));
- psORNode = xmlNewChild(psCINode2, namespace, BAD_CAST "onlineResource", NULL);
- psORNode2 = xmlNewChild(psORNode, namespace, BAD_CAST "CI_OnlineResource", NULL);
-
value = (char *)msOWSLookupMetadata(&(map->web.metadata), "MCFO", "onlineresource");
- if (value)
+ if (value) {
+ psORNode = xmlNewChild(psCINode2, namespace, BAD_CAST "onlineResource", NULL);
+ psORNode2 = xmlNewChild(psORNode, namespace, BAD_CAST "CI_OnlineResource", NULL);
xmlAddChild(psORNode2, _msMetadataGetURL(namespace, "linkage", value));
+ }
xmlAddChild(psCNode, _msMetadataGetCodeList(namespace, "role", "CI_RoleCode", "pointOfContact"));
@@ -604,9 +608,7 @@ xmlNodePtr _msMetadataGetDistributionInfo(xmlNsPtr namespace, mapObj *map, layer
/* WMS */
xmlAddChild(psDTONode, _msMetadataGetOnline(namespace, layer, "M", "image/png", "PNG Format", url));
-
xmlAddChild(psDTONode, _msMetadataGetOnline(namespace, layer, "M", "image/jpeg", "JPEG Format", url));
- xmlAddChild(psDTONode, _msMetadataGetOnline(namespace, layer, "M", "image/gif", "GIF Format", url));
/* WCS */
if (layer->type == MS_LAYER_RASTER) {
@@ -892,10 +894,10 @@ void msMetadataSetGetMetadataURL(layerObj *lp, const char *url)
pszMetadataURL = msStringConcatenate(pszMetadataURL, lp->name);
msInsertHashTable(&(lp->metadata), "ows_metadataurl_href", pszMetadataURL);
- msInsertHashTable(&(lp->metadata), "ows_metadataurl_type", "ISOTC211/19115");
+ msInsertHashTable(&(lp->metadata), "ows_metadataurl_type", "TC211");
msInsertHashTable(&(lp->metadata), "ows_metadataurl_format", "text/xml");
msInsertHashTable(&(lp->metadata), "ows_metadatalink_href", pszMetadataURL);
- msInsertHashTable(&(lp->metadata), "ows_metadatalink_type", "ISOTC211/19115");
+ msInsertHashTable(&(lp->metadata), "ows_metadatalink_type", "TC211");
msInsertHashTable(&(lp->metadata), "ows_metadatalink_format", "text/xml");
msFree(pszMetadataURL);
}
=====================================
mapmssql2008.c
=====================================
@@ -2,8 +2,9 @@
* $Id$
*
* Project: MapServer
- * Purpose: MS SQL 2008 (Katmai) Layer Connector
+ * Purpose: MS SQL Server Layer Connector
* Author: Richard Hillman - based on PostGIS and SpatialDB connectors
+ * Tamas Szekeres - maintenance
*
******************************************************************************
* Copyright (c) 2007 IS Consulting (www.mapdotnet.com)
@@ -50,7 +51,7 @@
#include <string.h>
#include <ctype.h> /* tolower() */
-/* SqlGeometry serialization format
+/* SqlGeometry/SqlGeography serialization format
Simple Point (SerializationProps & IsSinglePoint)
[SRID][0x01][SerializationProps][Point][z][m]
@@ -59,9 +60,17 @@ Simple Line Segment (SerializationProps & IsSingleLineSegment)
[SRID][0x01][SerializationProps][Point1][Point2][z1][z2][m1][m2]
Complex Geometries
- [SRID][0x01][SerializationProps][NumPoints][Point1]..[PointN][z1]..[zN][m1]..[mN]
+ [SRID][VersionAttribute][SerializationProps][NumPoints][Point1]..[PointN][z1]..[zN][m1]..[mN]
[NumFigures][Figure]..[Figure][NumShapes][Shape]..[Shape]
+Complex Geometries (FigureAttribute == Curve)
+ [SRID][VersionAttribute][SerializationProps][NumPoints][Point1]..[PointN][z1]..[zN][m1]..[mN]
+ [NumFigures][Figure]..[Figure][NumShapes][Shape]..[Shape][NumSegments][SegmentType]..[SegmentType]
+
+VersionAttribute (1 byte)
+ 0x01 = Katmai (MSSQL2008+)
+ 0x02 = Denali (MSSQL2012+)
+
SRID
Spatial Reference Id (4 bytes)
@@ -71,7 +80,7 @@ SerializationProps (bitmask) 1 byte
0x04 = IsValid
0x08 = IsSinglePoint
0x10 = IsSingleLineSegment
- 0x20 = IsWholeGlobe
+ 0x20 = IsLargerThanAHemisphere
Point (2-4)x8 bytes, size depends on SerializationProps & HasZValues & HasMValues
[x][y] - SqlGeometry
@@ -80,11 +89,17 @@ Point (2-4)x8 bytes, size depends on SerializationProps & HasZValues & HasMValue
Figure
[FigureAttribute][PointOffset]
-FigureAttribute (1 byte)
+FigureAttribute - Katmai (1 byte)
0x00 = Interior Ring
0x01 = Stroke
0x02 = Exterior Ring
+FigureAttribute - Denali (1 byte)
+ 0x00 = None
+ 0x01 = Line
+ 0x02 = Arc
+ 0x03 = Curve
+
Shape
[ParentFigureOffset][FigureOffset][ShapeType]
@@ -97,6 +112,17 @@ ShapeType (1 byte)
0x05 = MultiLineString
0x06 = MultiPolygon
0x07 = GeometryCollection
+ -- Denali
+ 0x08 = CircularString
+ 0x09 = CompoundCurve
+ 0x0A = CurvePolygon
+ 0x0B = FullGlobe
+
+SegmentType (1 byte)
+ 0x00 = Line
+ 0x01 = Arc
+ 0x02 = FirstLine
+ 0x03 = FirstArc
*/
@@ -125,7 +151,7 @@ ShapeType (1 byte)
#define SP_ISVALID 4
#define SP_ISSINGLEPOINT 8
#define SP_ISSINGLELINESEGMENT 0x10
-#define SP_ISWHOLEGLOBE 0x20
+#define SP_ISLARGERTHANAHEMISPHERE 0x20
#define ST_UNKNOWN 0
#define ST_POINT 1
@@ -135,6 +161,15 @@ ShapeType (1 byte)
#define ST_MULTILINESTRING 5
#define ST_MULTIPOLYGON 6
#define ST_GEOMETRYCOLLECTION 7
+#define ST_CIRCULARSTRING 8
+#define ST_COMPOUNDCURVE 9
+#define ST_CURVEPOLYGON 10
+#define ST_FULLGLOBE 11
+
+#define SMT_LINE 0
+#define SMT_ARC 1
+#define SMT_FIRSTLINE 2
+#define SMT_FIRSTARC 3
#define ReadInt32(nPos) (*((unsigned int*)(gpi->pszData + (nPos))))
@@ -145,6 +180,7 @@ ShapeType (1 byte)
#define ParentOffset(iShape) (ReadInt32(gpi->nShapePos + (iShape) * 9 ))
#define FigureOffset(iShape) (ReadInt32(gpi->nShapePos + (iShape) * 9 + 4))
#define ShapeType(iShape) (ReadByte(gpi->nShapePos + (iShape) * 9 + 8))
+#define SegmentType(iSegment) (ReadByte(gpi->nSegmentPos + (iSegment)))
#define NextFigureOffset(iShape) (iShape + 1 < gpi->nNumShapes? FigureOffset((iShape) +1) : gpi->nNumFigures)
@@ -157,11 +193,17 @@ ShapeType (1 byte)
#define ReadZ(iPoint) (ReadDouble(gpi->nPointPos + 16 * gpi->nNumPoints + 8 * (iPoint)))
#define ReadM(iPoint) (ReadDouble(gpi->nPointPos + 24 * gpi->nNumPoints + 8 * (iPoint)))
+#define FP_EPSILON 1e-12
+#define SEGMENT_ANGLE 5.0
+#define SEGMENT_MINPOINTS 10
+
/* Native geometry parser struct */
typedef struct msGeometryParserInfo_t {
unsigned char* pszData;
int nLen;
- /* serialization propeties */
+ /* version */
+ char chVersion;
+ /* serialization properties */
char chProps;
/* point array */
int nPointSize;
@@ -175,6 +217,9 @@ typedef struct msGeometryParserInfo_t {
int nShapePos;
int nNumShapes;
int nSRSId;
+ /* segment array */
+ int nSegmentPos;
+ int nNumSegments;
/* geometry or geography */
int nColType;
/* bounds */
@@ -243,13 +288,129 @@ void ReadPoint(msGeometryParserInfo* gpi, pointObj* p, int iPoint)
}
#ifdef USE_POINT_Z_M
- if ( gpi->chProps & SP_HASZVALUES )
+ if ((gpi->chProps & SP_HASZVALUES) && (gpi->chProps & SP_HASMVALUES))
+ {
p->z = ReadZ(iPoint);
- if ( gpi->chProps & SP_HASMVALUES )
- p->z = ReadM(iPoint);
+ p->m = ReadM(iPoint);
+ }
+ else if (gpi->chProps & SP_HASZVALUES)
+ {
+ p->z = ReadZ(iPoint);
+ p->m = 0.0;
+ }
+ else if (gpi->chProps & SP_HASMVALUES)
+ {
+ p->z = 0.0;
+ p->m = ReadZ(iPoint);
+ }
+ else
+ {
+ p->z = 0.0;
+ p->m = 0.0;
+ }
#endif
}
+int StrokeArcToLine(msGeometryParserInfo* gpi, lineObj* line, int index)
+{
+ if (index > 1) {
+ double x, y, x1, y1, x2, y2, x3, y3, dxa, dya, sxa, sya, dxb, dyb;
+ double d, sxb, syb, ox, oy, a1, a3, sa, da, a, radius;
+ int numpoints;
+#ifdef USE_POINT_Z_M
+ double z;
+ z = line->point[index].z; /* must be equal for arc segments */
+#endif
+ /* first point */
+ x1 = line->point[index - 2].x;
+ y1 = line->point[index - 2].y;
+ /* second point */
+ x2 = line->point[index - 1].x;
+ y2 = line->point[index - 1].y;
+ /* third point */
+ x3 = line->point[index].x;
+ y3 = line->point[index].y;
+
+ sxa = (x1 + x2);
+ sya = (y1 + y2);
+ dxa = x2 - x1;
+ dya = y2 - y1;
+
+ sxb = (x2 + x3);
+ syb = (y2 + y3);
+ dxb = x3 - x2;
+ dyb = y3 - y2;
+
+ d = (dxa * dyb - dya * dxb) * 2;
+
+ if (fabs(d) < FP_EPSILON) {
+ /* points are colinear, nothing to do here */
+ return index;
+ }
+
+ /* calculating the center of circle */
+ ox = ((sya - syb) * dya * dyb + sxa * dyb * dxa - sxb * dya * dxb) / d;
+ oy = ((sxb - sxa) * dxa * dxb + syb * dyb * dxa - sya * dya * dxb) / d;
+
+ radius = sqrt((x1 - ox) * (x1 - ox) + (y1 - oy) * (y1 - oy));
+
+ /* calculating the angle to be used */
+ a1 = atan2(y1 - oy, x1 - ox);
+ a3 = atan2(y3 - oy, x3 - ox);
+
+ if (d > 0) {
+ /* draw counterclockwise */
+ if (a3 > a1) /* Wrapping past 180? */
+ sa = a3 - a1;
+ else
+ sa = a3 - a1 + 2.0 * M_PI ;
+ }
+ else {
+ if (a3 > a1) /* Wrapping past 180? */
+ sa = a3 - a1 + 2.0 * M_PI;
+ else
+ sa = a3 - a1;
+ }
+
+ numpoints = (int)floor(fabs(sa) * 180 / SEGMENT_ANGLE / M_PI);
+ if (numpoints < SEGMENT_MINPOINTS)
+ numpoints = SEGMENT_MINPOINTS;
+
+ da = sa / numpoints;
+
+ /* extend the point array */
+ line->numpoints += numpoints - 2;
+ line->point = msSmallRealloc(line->point, sizeof(pointObj) * line->numpoints);
+ --index;
+
+ a = a1 + da;
+ while (numpoints > 1) {
+ line->point[index].x = x = ox + radius * cos(a);
+ line->point[index].y = y = oy + radius * sin(a);
+#ifdef USE_POINT_Z_M
+ line->point[index].z = z;
+#endif
+
+ /* calculate bounds */
+ if (gpi->minx > x) gpi->minx = x;
+ else if (gpi->maxx < x) gpi->maxx = x;
+ if (gpi->miny > y) gpi->miny = y;
+ else if (gpi->maxy < y) gpi->maxy = y;
+
+ a += da;
+ ++index;
+ --numpoints;
+ }
+ /* set last point */
+ line->point[index].x = x3;
+ line->point[index].y = y3;
+#ifdef USE_POINT_Z_M
+ line->point[index].z = z;
+#endif
+ }
+ return index;
+}
+
int ParseSqlGeometry(msMSSQL2008LayerInfo* layerinfo, shapeObj *shape)
{
msGeometryParserInfo* gpi = &layerinfo->gpi;
@@ -264,19 +425,22 @@ int ParseSqlGeometry(msMSSQL2008LayerInfo* layerinfo, shapeObj *shape)
/* store the SRS id for further use */
gpi->nSRSId = ReadInt32(0);
- if ( ReadByte(4) != 1 ) {
+ gpi->chVersion = ReadByte(4);
+
+ if (gpi->chVersion > 2) {
msDebug("ParseSqlGeometry CORRUPT_DATA\n");
return CORRUPT_DATA;
}
gpi->chProps = ReadByte(5);
+ gpi->nPointSize = 16;
+
if ( gpi->chProps & SP_HASMVALUES )
- gpi->nPointSize = 32;
- else if ( gpi->chProps & SP_HASZVALUES )
- gpi->nPointSize = 24;
- else
- gpi->nPointSize = 16;
+ gpi->nPointSize += 8;
+
+ if ( gpi->chProps & SP_HASZVALUES )
+ gpi->nPointSize += 8;
if ( gpi->chProps & SP_ISSINGLEPOINT ) {
// single point geometry
@@ -312,7 +476,7 @@ int ParseSqlGeometry(msMSSQL2008LayerInfo* layerinfo, shapeObj *shape)
ReadPoint(gpi, &shape->line[0].point[0], 0);
ReadPoint(gpi, &shape->line[0].point[1], 1);
} else {
- int iShape, iFigure;
+ int iShape, iFigure, iSegment;
// complex geometries
gpi->nNumPoints = ReadInt32(6);
@@ -368,10 +532,13 @@ int ParseSqlGeometry(msMSSQL2008LayerInfo* layerinfo, shapeObj *shape)
if (shapeType == ST_POINT || shapeType == ST_MULTIPOINT) {
shape->type = MS_SHAPE_POINT;
break;
- } else if (shapeType == ST_LINESTRING || shapeType == ST_MULTILINESTRING) {
+ } else if (shapeType == ST_LINESTRING || shapeType == ST_MULTILINESTRING ||
+ shapeType == ST_CIRCULARSTRING || shapeType == ST_COMPOUNDCURVE) {
shape->type = MS_SHAPE_LINE;
break;
- } else if (shapeType == ST_POLYGON || shapeType == ST_MULTIPOLYGON) {
+ } else if (shapeType == ST_POLYGON || shapeType == ST_MULTIPOLYGON ||
+ shapeType == ST_CURVEPOLYGON)
+ {
shape->type = MS_SHAPE_POLYGON;
break;
}
@@ -379,6 +546,8 @@ int ParseSqlGeometry(msMSSQL2008LayerInfo* layerinfo, shapeObj *shape)
shape->line = (lineObj *) msSmallMalloc(sizeof(lineObj) * gpi->nNumFigures);
shape->numlines = gpi->nNumFigures;
+ gpi->nNumSegments = 0;
+
// read figures
for (iFigure = 0; iFigure < gpi->nNumFigures; iFigure++) {
int iPoint, iNextPoint, i;
@@ -386,15 +555,61 @@ int ParseSqlGeometry(msMSSQL2008LayerInfo* layerinfo, shapeObj *shape)
iNextPoint = NextPointOffset(iFigure);
shape->line[iFigure].point = (pointObj *) msSmallMalloc(sizeof(pointObj)*(iNextPoint - iPoint));
-
+ shape->line[iFigure].numpoints = iNextPoint - iPoint;
i = 0;
- while (iPoint < iNextPoint) {
- ReadPoint(gpi, &shape->line[iFigure].point[i], iPoint);
- ++iPoint;
- ++i;
- }
- shape->line[iFigure].numpoints = i;
+ if (gpi->chVersion == 0x02 && FigureAttribute(iFigure) >= 0x02) {
+ int nPointPrepared = 0;
+ lineObj* line = &shape->line[iFigure];
+ if (FigureAttribute(iFigure) == 0x03) {
+ if (gpi->nNumSegments == 0) {
+ /* position of the segment types */
+ gpi->nSegmentPos = gpi->nShapePos + 9 * gpi->nNumShapes + 4;
+ gpi->nNumSegments = ReadInt32(gpi->nSegmentPos - 4);
+ if (gpi->nLen < gpi->nSegmentPos + gpi->nNumSegments) {
+ msDebug("ParseSqlGeometry NOT_ENOUGH_DATA\n");
+ return NOT_ENOUGH_DATA;
+ }
+ iSegment = 0;
+ }
+
+ while (iPoint < iNextPoint && iSegment < gpi->nNumSegments) {
+ ReadPoint(gpi, &line->point[i], iPoint);
+ ++iPoint;
+ ++nPointPrepared;
+
+ if (nPointPrepared == 2 && (SegmentType(iSegment) == SMT_FIRSTLINE || SegmentType(iSegment) == SMT_LINE)) {
+ ++iSegment;
+ nPointPrepared = 1;
+ }
+ else if (nPointPrepared == 3 && (SegmentType(iSegment) == SMT_FIRSTARC || SegmentType(iSegment) == SMT_ARC)) {
+ i = StrokeArcToLine(gpi, line, i);
+ ++iSegment;
+ nPointPrepared = 1;
+ }
+ ++i;
+ }
+ }
+ else {
+ while (iPoint < iNextPoint) {
+ ReadPoint(gpi, &line->point[i], iPoint);
+ ++iPoint;
+ ++nPointPrepared;
+ if (nPointPrepared == 3) {
+ i = StrokeArcToLine(gpi, line, i);
+ nPointPrepared = 1;
+ }
+ ++i;
+ }
+ }
+ }
+ else {
+ while (iPoint < iNextPoint) {
+ ReadPoint(gpi, &shape->line[iFigure].point[i], iPoint);
+ ++iPoint;
+ ++i;
+ }
+ }
}
}
@@ -544,7 +759,8 @@ static void setConnError(msODBCconn *conn)
/* Connect to db */
static msODBCconn * mssql2008Connect(const char * connString)
{
- SQLCHAR fullConnString[1024];
+ SQLCHAR outConnString[1024];
+ SQLSMALLINT outConnStringLen;
SQLRETURN rc;
msODBCconn * conn = msSmallMalloc(sizeof(msODBCconn));
@@ -556,13 +772,17 @@ static msODBCconn * mssql2008Connect(const char * connString)
SQLAllocHandle(SQL_HANDLE_DBC, conn->henv, &conn->hdbc);
- snprintf((char*)fullConnString, sizeof(fullConnString), "DRIVER=SQL Server;%s", connString);
-
+ if (strcasestr(connString, "DRIVER=") == 0)
{
- SQLCHAR outConnString[1024];
- SQLSMALLINT outConnStringLen;
+ SQLCHAR fullConnString[1024];
+
+ snprintf((char*)fullConnString, sizeof(fullConnString), "DRIVER={SQL Server};%s", connString);
- rc = SQLDriverConnect(conn->hdbc, NULL, fullConnString, SQL_NTS, outConnString, 1024, &outConnStringLen, SQL_DRIVER_NOPROMPT);
+ rc = SQLDriverConnect(conn->hdbc, NULL, fullConnString, SQL_NTS, outConnString, 1024, &outConnStringLen, SQL_DRIVER_NOPROMPT);
+ }
+ else
+ {
+ rc = SQLDriverConnect(conn->hdbc, NULL, connString, SQL_NTS, outConnString, 1024, &outConnStringLen, SQL_DRIVER_NOPROMPT);
}
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
@@ -1088,10 +1308,9 @@ static int prepare_database(layerObj *layer, rectObj rect, char **query_string)
/* adding items to the select list */
for (t = 0; t < layer->numitems; t++) {
#ifdef USE_ICONV
- /* no conversion applied at the database */
- query = msStringConcatenate(query, "[");
+ query = msStringConcatenate(query, "convert(nvarchar(max), [");
query = msStringConcatenate(query, layer->items[t]);
- query = msStringConcatenate(query, "],");
+ query = msStringConcatenate(query, "]),");
#else
query = msStringConcatenate(query, "convert(varchar(max), [");
query = msStringConcatenate(query, layer->items[t]);
=====================================
mapmvt.c
=====================================
@@ -57,6 +57,21 @@ typedef struct {
#define COMMAND(id, count) (((id) & 0x7) | ((count) << 3))
#define PARAMETER(n) (((n) << 1) ^ ((n) >> 31))
+static double getTriangleHeight(lineObj *ring)
+{
+ int i;
+ double s=0, b=0;
+
+ if(ring->numpoints != 4) return -1; /* not a triangle */
+
+ for(i=0; i<ring->numpoints-1; i++) {
+ s += (ring->point[i].x*ring->point[i+1].y - ring->point[i+1].x*ring->point[i].y);
+ b = MS_MAX(b, msDistancePointToPoint(&ring->point[i], &ring->point[i+1]));
+ }
+
+ return (MS_ABS(s/b));
+}
+
static enum MS_RING_DIRECTION mvtGetRingDirection(lineObj *ring) {
int i, sum=0;
@@ -132,6 +147,11 @@ static int mvtTransformShape(shapeObj *shape, rectObj *extent, int layer_type, i
shape->line[i].numpoints = outj;
if(layer_type == MS_LAYER_POLYGON) {
+ if(shape->line[i].numpoints == 4 && getTriangleHeight(&shape->line[i]) < 1) {
+ shape->line[i].numpoints = 0; /* so it's not considered anymore */
+ continue; /* next ring */
+ }
+
ring_direction = mvtGetRingDirection(&shape->line[i]);
if(ring_direction == MS_DIRECTION_INVALID_RING)
shape->line[i].numpoints = 0; /* so it's not considered anymore */
@@ -355,6 +375,10 @@ int msMVTWriteTile( mapObj *map, int sendheaders ) {
VectorTile__Tile mvt_tile = VECTOR_TILE__TILE__INIT;
mvt_tile.layers = msSmallCalloc(map->numlayers, sizeof(VectorTile__Tile__Layer*));
+ /* make sure we have a scale and cellsize computed */
+ map->cellsize = MS_CELLSIZE(map->extent.minx, map->extent.maxx, map->width);
+ msCalculateScale(map->extent, map->units, map->width, map->height, map->resolution, &map->scaledenom);
+
/* expand the map->extent so it goes from pixel center (MapServer) to pixel edge (OWS) */
map->extent.minx -= map->cellsize * 0.5;
map->extent.maxx += map->cellsize * 0.5;
=====================================
mapogcfiltercommon.c
=====================================
@@ -41,7 +41,7 @@ char *FLTGetIsLikeComparisonCommonExpression(FilterEncodingNode *psFilterNode)
{
const size_t bufferSize = 1024;
char szBuffer[1024];
- char szTmp[256];
+ char szTmp[512];
char *pszValue = NULL;
const char *pszWild = NULL;
@@ -52,9 +52,9 @@ char *FLTGetIsLikeComparisonCommonExpression(FilterEncodingNode *psFilterNode)
int nLength=0, i=0, iTmp=0;
- /* From http://www.fon.hum.uva.nl/praat/manual/Regular_expressions_1__Special_characters.html */
+ /* From http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html#tag_09_04 */
/* also add double quote because we are within a string */
- const char* pszRegexSpecialCharsAndDoubleQuote = "\\^${}[]().*+?|<>-&\"";
+ const char* pszRegexSpecialCharsAndDoubleQuote = "\\^${[().*+?|\"";
if (!psFilterNode || !psFilterNode->pOther || !psFilterNode->psLeftNode || !psFilterNode->psRightNode || !psFilterNode->psRightNode->pszValue)
return NULL;
@@ -92,11 +92,12 @@ char *FLTGetIsLikeComparisonCommonExpression(FilterEncodingNode *psFilterNode)
pszValue = psFilterNode->psRightNode->pszValue;
nLength = strlen(pszValue);
- if( 1 + 2 * nLength + 1 + 1 >= sizeof(szTmp) )
+ /* The 4 factor is in case of \. See below */
+ if( 1 + 4 * nLength + 1 + 1 >= sizeof(szTmp) )
return NULL;
iTmp =0;
- if (nLength > 0 && pszValue[0] != pszWild[0] && pszValue[0] != pszSingle[0] && pszValue[0] != pszEscape[0]) {
+ if (nLength > 0) {
szTmp[iTmp]= '^';
iTmp++;
}
@@ -106,21 +107,33 @@ char *FLTGetIsLikeComparisonCommonExpression(FilterEncodingNode *psFilterNode)
iTmp++;
szTmp[iTmp] = '\0';
/* The Filter escape character is supposed to only escape the single, wildcard and escape character */
- /* As we replace single and wild by regular expression special characters, we indeed */
- /* need to escape them */
- } else if (pszValue[i] == pszEscape[0] && (pszValue[i+1] == pszSingle[0] || pszValue[i+1] == pszWild[0])) {
- szTmp[iTmp] = '\\';
- iTmp++;
- szTmp[iTmp] = '\0';
- /* If the Filter escape character is escaped, only regular-expression-escape-it */
- /* if it is indeed a regular expression special character. Otherwise ignore it */
- } else if (pszValue[i] == pszEscape[0] && pszValue[i+1] == pszEscape[0]) {
- if( strchr(pszRegexSpecialCharsAndDoubleQuote, pszValue[i]) )
+ } else if (pszValue[i] == pszEscape[0] && (
+ pszValue[i+1] == pszSingle[0] ||
+ pszValue[i+1] == pszWild[0] ||
+ pszValue[i+1] == pszEscape[0])) {
+ if( pszValue[i+1] == '\\' )
+ {
+ /* Tricky case: \ must be escaped ncce in the regular expression context
+ so that the regexp matches it as an ordinary character.
+ But as \ is also the escape character for MapServer string, we
+ must escape it again. */
+ szTmp[iTmp++] = '\\';
+ szTmp[iTmp++] = '\\';
+ szTmp[iTmp++] = '\\';
+ szTmp[iTmp++] = '\\';
+ }
+ else
{
- szTmp[iTmp] = '\\';
- iTmp++;
- szTmp[iTmp] = '\0';
+ /* If the escaped character is itself a regular expression special character */
+ /* we need to regular-expression-escape-it ! */
+ if( strchr(pszRegexSpecialCharsAndDoubleQuote, pszValue[i+1]) )
+ {
+ szTmp[iTmp++] = '\\';
+ }
+ szTmp[iTmp++] = pszValue[i+1];
}
+ i++;
+ szTmp[iTmp] = '\0';
} else if (pszValue[i] == pszWild[0]) {
szTmp[iTmp++] = '.';
szTmp[iTmp++] = '*';
@@ -129,10 +142,19 @@ char *FLTGetIsLikeComparisonCommonExpression(FilterEncodingNode *psFilterNode)
/* Escape regular expressions special characters and double quote */
else if (strchr(pszRegexSpecialCharsAndDoubleQuote, pszValue[i]))
{
- szTmp[iTmp] = '\\';
- iTmp++;
- szTmp[iTmp] = pszValue[i];
- iTmp++;
+ if( pszValue[i] == '\\' )
+ {
+ /* See above explantation */
+ szTmp[iTmp++] = '\\';
+ szTmp[iTmp++] = '\\';
+ szTmp[iTmp++] = '\\';
+ szTmp[iTmp++] = '\\';
+ }
+ else
+ {
+ szTmp[iTmp++] = '\\';
+ szTmp[iTmp++] = pszValue[i];
+ }
szTmp[iTmp] = '\0';
}
else {
@@ -143,7 +165,10 @@ char *FLTGetIsLikeComparisonCommonExpression(FilterEncodingNode *psFilterNode)
}
szTmp[iTmp] = '"';
szTmp[++iTmp] = '\0';
-
+#if 0
+ msDebug("like: %s\n", pszValue);
+ msDebug("regexp (with \\ escaping for MapServer use): %s\n", szTmp);
+#endif
strlcat(szBuffer, szTmp, bufferSize);
strlcat(szBuffer, ")", bufferSize);
return msStrdup(szBuffer);
=====================================
mapparser.c
=====================================
@@ -1,21 +1,24 @@
-/* A Bison parser, made by GNU Bison 2.5. */
+/* A Bison parser, made by GNU Bison 2.3. */
-/* Bison implementation for Yacc-like parsers in C
-
- Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
+/* Skeleton implementation for Bison's Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -26,7 +29,7 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
-
+
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
@@ -44,7 +47,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.5"
+#define YYBISON_VERSION "2.3"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -52,61 +55,11 @@
/* Pure parsers. */
#define YYPURE 1
-/* Push parsers. */
-#define YYPUSH 0
-
-/* Pull parsers. */
-#define YYPULL 1
-
/* Using locations. */
#define YYLSP_NEEDED 0
-/* Copy the first part of user declarations. */
-
-/* Line 268 of yacc.c */
-#line 5 "mapparser.y"
-
-/* C declarations */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <time.h>
-
-#include "mapserver.h" /* for TRUE/FALSE and REGEX includes */
-#include "maptime.h" /* for time comparison routines */
-#include "mapprimitive.h" /* for shapeObj */
-
-#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 *);
-
-
-/* Line 268 of yacc.c */
-#line 90 "mapparser.c"
-
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-
-/* Enabling verbose error messages. */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-/* Enabling the token table. */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
-#endif
-
-
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
@@ -210,35 +163,69 @@ int yyerror(parseObj *, const char *);
+/* Copy the first part of user declarations. */
+#line 5 "mapparser.y"
+
+/* C declarations */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <time.h>
+
+#include "mapserver.h" /* for TRUE/FALSE and REGEX includes */
+#include "maptime.h" /* for time comparison routines */
+#include "mapprimitive.h" /* for shapeObj */
+
+#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
+#endif
+
+/* Enabling verbose error messages. */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+/* Enabling the token table. */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE 0
+#endif
+
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-{
-
-/* Line 293 of yacc.c */
#line 30 "mapparser.y"
-
+{
double dblval;
int intval;
char *strval;
struct tm tmval;
shapeObj *shpval;
-
-
-
-/* Line 293 of yacc.c */
-#line 230 "mapparser.c"
-} YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
+}
+/* Line 193 of yacc.c. */
+#line 216 "/Users/sdlime/mapserver/sdlime/mapserver/mapparser.c"
+ YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
#endif
+
/* Copy the second part of user declarations. */
-/* Line 343 of yacc.c */
-#line 242 "mapparser.c"
+/* Line 216 of yacc.c. */
+#line 229 "/Users/sdlime/mapserver/sdlime/mapserver/mapparser.c"
#ifdef short
# undef short
@@ -313,14 +300,14 @@ typedef short int yytype_int16;
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static int
-YYID (int yyi)
+YYID (int i)
#else
static int
-YYID (yyi)
- int yyi;
+YYID (i)
+ int i;
#endif
{
- return yyi;
+ return i;
}
#endif
@@ -341,11 +328,11 @@ YYID (yyi)
# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
-# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
+# ifndef _STDLIB_H
+# define _STDLIB_H 1
# endif
# endif
# endif
@@ -368,24 +355,24 @@ YYID (yyi)
# ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif
-# if (defined __cplusplus && ! defined EXIT_SUCCESS \
+# if (defined __cplusplus && ! defined _STDLIB_H \
&& ! ((defined YYMALLOC || defined malloc) \
&& (defined YYFREE || defined free)))
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
+# ifndef _STDLIB_H
+# define _STDLIB_H 1
# endif
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
-# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# define YYFREE free
-# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
+# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
@@ -401,9 +388,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- yytype_int16 yyss_alloc;
- YYSTYPE yyvs_alloc;
-};
+ yytype_int16 yyss;
+ YYSTYPE yyvs;
+ };
/* The size of the maximum gap between one aligned stack and the next. */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
@@ -414,27 +401,6 @@ union yyalloc
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
-# define YYCOPY_NEEDED 1
-
-/* Relocate STACK from its old location to the new one. The
- local variables YYSIZE and YYSTACKSIZE give the old and new number of
- elements in the stack, and YYPTR gives the new location of the
- stack. Advance YYPTR to a properly aligned location for the next
- stack. */
-# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
- do \
- { \
- YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
- Stack = &yyptr->Stack_alloc; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
- } \
- while (YYID (0))
-
-#endif
-
-#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
/* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */
# ifndef YYCOPY
@@ -452,7 +418,24 @@ union yyalloc
while (YYID (0))
# endif
# endif
-#endif /* !YYCOPY_NEEDED */
+
+/* Relocate STACK from its old location to the new one. The
+ local variables YYSIZE and YYSTACKSIZE give the old and new number of
+ elements in the stack, and YYPTR gives the new location of the
+ stack. Advance YYPTR to a properly aligned location for the next
+ stack. */
+# define YYSTACK_RELOCATE(Stack) \
+ do \
+ { \
+ YYSIZE_T yynewbytes; \
+ YYCOPY (&yyptr->Stack, Stack, yysize); \
+ Stack = &yyptr->Stack; \
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / sizeof (*yyptr); \
+ } \
+ while (YYID (0))
+
+#endif
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 78
@@ -655,8 +638,8 @@ static const yytype_uint8 yyr2[] =
6, 4, 4, 4, 4, 4, 1, 3
};
-/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
- Performed when YYTABLE doesn't specify something else to do. Zero
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+ STATE-NUM when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
@@ -741,7 +724,8 @@ static const yytype_int8 yypgoto[] =
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
- number is the opposite. If YYTABLE_NINF, syntax error. */
+ number is the opposite. If zero, do what YYDEFACT says.
+ If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -1
static const yytype_uint16 yytable[] =
{
@@ -799,12 +783,6 @@ static const yytype_uint16 yytable[] =
123
};
-#define yypact_value_is_default(yystate) \
- ((yystate) == (-50))
-
-#define yytable_value_is_error(yytable_value) \
- YYID (0)
-
static const yytype_int16 yycheck[] =
{
0, 6, 9, 4, 8, 9, 55, 56, 47, 47,
@@ -908,18 +886,9 @@ static const yytype_uint8 yystos[] =
/* Like YYERROR except do call yyerror. This remains here temporarily
to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. However,
- YYFAIL appears to be in use. Nevertheless, it is formally deprecated
- in Bison 2.4.2's NEWS entry, where a plan to phase it out is
- discussed. */
+ Once GCC version 2 has supplanted version 1, this can go. */
#define YYFAIL goto yyerrlab
-#if defined YYFAIL
- /* This is here to suppress warnings from the GCC cpp's
- -Wunused-macros. Normally we don't worry about that warning, but
- some users do, and we want to make it easy for users to remove
- YYFAIL uses, which will produce warnings from Bison 2.5. */
-#endif
#define YYRECOVERING() (!!yyerrstatus)
@@ -929,6 +898,7 @@ do \
{ \
yychar = (Token); \
yylval = (Value); \
+ yytoken = YYTRANSLATE (yychar); \
YYPOPSTACK (1); \
goto yybackup; \
} \
@@ -970,10 +940,19 @@ while (YYID (0))
#endif
-/* This macro is provided for backward compatibility. */
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+ This macro was not mandated originally: define only if we know
+ we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+# define YY_LOCATION_PRINT(File, Loc) \
+ fprintf (File, "%d.%d-%d.%d", \
+ (Loc).first_line, (Loc).first_column, \
+ (Loc).last_line, (Loc).last_column)
+# else
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
#endif
@@ -1080,20 +1059,17 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, p)
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
+yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
#else
static void
-yy_stack_print (yybottom, yytop)
- yytype_int16 *yybottom;
- yytype_int16 *yytop;
+yy_stack_print (bottom, top)
+ yytype_int16 *bottom;
+ yytype_int16 *top;
#endif
{
YYFPRINTF (stderr, "Stack now");
- for (; yybottom <= yytop; yybottom++)
- {
- int yybot = *yybottom;
- YYFPRINTF (stderr, " %d", yybot);
- }
+ for (; bottom <= top; ++bottom)
+ YYFPRINTF (stderr, " %d", *bottom);
YYFPRINTF (stderr, "\n");
}
@@ -1128,11 +1104,11 @@ yy_reduce_print (yyvsp, yyrule, p)
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
- YYFPRINTF (stderr, " $%d = ", yyi + 1);
+ fprintf (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)])
, p);
- YYFPRINTF (stderr, "\n");
+ fprintf (stderr, "\n");
}
}
@@ -1169,6 +1145,7 @@ int yydebug;
# define YYMAXDEPTH 10000
#endif
+
#if YYERROR_VERBOSE
@@ -1271,142 +1248,115 @@ yytnamerr (char *yyres, const char *yystr)
}
# endif
-/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
- about the unexpected token YYTOKEN for the state stack whose top is
- YYSSP.
-
- Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
- not large enough to hold the message. In that case, also set
- *YYMSG_ALLOC to the required number of bytes. Return 2 if the
- required number of bytes is too large to store. */
-static int
-yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
- yytype_int16 *yyssp, int yytoken)
+/* Copy into YYRESULT an error message about the unexpected token
+ YYCHAR while in state YYSTATE. Return the number of bytes copied,
+ including the terminating null byte. If YYRESULT is null, do not
+ copy anything; just return the number of bytes that would be
+ copied. As a special case, return 0 if an ordinary "syntax error"
+ message will do. Return YYSIZE_MAXIMUM if overflow occurs during
+ size calculation. */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
{
- YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
- YYSIZE_T yysize = yysize0;
- YYSIZE_T yysize1;
- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
- /* Internationalized format string. */
- const char *yyformat = 0;
- /* Arguments of yyformat. */
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- /* Number of reported tokens (one for the "unexpected", one per
- "expected"). */
- int yycount = 0;
-
- /* There are many possibilities here to consider:
- - Assume YYFAIL is not used. It's too flawed to consider. See
- <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
- for details. YYERROR is fine as it does not invoke this
- function.
- - If this state is a consistent state with a default action, then
- the only way this function was invoked is if the default action
- is an error action. In that case, don't check for expected
- tokens because there are none.
- - The only way there can be no lookahead present (in yychar) is if
- this state is a consistent state with a default action. Thus,
- detecting the absence of a lookahead is sufficient to determine
- that there is no unexpected or expected token to report. In that
- case, just report a simple "syntax error".
- - Don't assume there isn't a lookahead just because this state is a
- consistent state with a default action. There might have been a
- previous inconsistent state, consistent state with a non-default
- action, or user semantic action that manipulated yychar.
- - Of course, the expected token list depends on states to have
- correct lookahead information, and it depends on the parser not
- to perform extra reductions after fetching a lookahead from the
- scanner and before detecting a syntax error. Thus, state merging
- (from LALR or IELR) and default reductions corrupt the expected
- token list. However, the list is correct for canonical LR with
- one exception: it will still contain any token that will not be
- accepted due to an error action in a later state.
- */
- if (yytoken != YYEMPTY)
- {
- int yyn = yypact[*yyssp];
- yyarg[yycount++] = yytname[yytoken];
- if (!yypact_value_is_default (yyn))
- {
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. In other words, skip the first -YYN actions for
- this state because they are default actions. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn + 1;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yyx;
-
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
- && !yytable_value_is_error (yytable[yyx + yyn]))
- {
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
- {
- yycount = 1;
- yysize = yysize0;
- break;
- }
- yyarg[yycount++] = yytname[yyx];
- yysize1 = yysize + yytnamerr (0, yytname[yyx]);
- if (! (yysize <= yysize1
- && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
- }
- }
- }
+ int yyn = yypact[yystate];
- switch (yycount)
- {
-# define YYCASE_(N, S) \
- case N: \
- yyformat = S; \
- break
- YYCASE_(0, YY_("syntax error"));
- YYCASE_(1, YY_("syntax error, unexpected %s"));
- YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
- YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
- YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
- YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
-# undef YYCASE_
- }
+ if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+ return 0;
+ else
+ {
+ int yytype = YYTRANSLATE (yychar);
+ YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+ YYSIZE_T yysize = yysize0;
+ YYSIZE_T yysize1;
+ int yysize_overflow = 0;
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+ int yyx;
+
+# if 0
+ /* This is so xgettext sees the translatable formats that are
+ constructed on the fly. */
+ YY_("syntax error, unexpected %s");
+ YY_("syntax error, unexpected %s, expecting %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+# endif
+ char *yyfmt;
+ char const *yyf;
+ static char const yyunexpected[] = "syntax error, unexpected %s";
+ static char const yyexpecting[] = ", expecting %s";
+ static char const yyor[] = " or %s";
+ char yyformat[sizeof yyunexpected
+ + sizeof yyexpecting - 1
+ + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+ * (sizeof yyor - 1))];
+ char const *yyprefix = yyexpecting;
+
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yycount = 1;
+
+ yyarg[0] = yytname[yytype];
+ yyfmt = yystpcpy (yyformat, yyunexpected);
+
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ {
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+ {
+ yycount = 1;
+ yysize = yysize0;
+ yyformat[sizeof yyunexpected - 1] = '\0';
+ break;
+ }
+ yyarg[yycount++] = yytname[yyx];
+ yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+ yysize_overflow |= (yysize1 < yysize);
+ yysize = yysize1;
+ yyfmt = yystpcpy (yyfmt, yyprefix);
+ yyprefix = yyor;
+ }
- yysize1 = yysize + yystrlen (yyformat);
- if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
+ yyf = YY_(yyformat);
+ yysize1 = yysize + yystrlen (yyf);
+ yysize_overflow |= (yysize1 < yysize);
+ yysize = yysize1;
- if (*yymsg_alloc < yysize)
- {
- *yymsg_alloc = 2 * yysize;
- if (! (yysize <= *yymsg_alloc
- && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
- *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
- return 1;
- }
+ if (yysize_overflow)
+ return YYSIZE_MAXIMUM;
- /* Avoid sprintf, as that infringes on the user's name space.
- Don't have undefined behavior even if the translation
- produced a string with the wrong number of "%s"s. */
- {
- char *yyp = *yymsg;
- int yyi = 0;
- while ((*yyp = *yyformat) != '\0')
- if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyformat += 2;
- }
- else
- {
- yyp++;
- yyformat++;
- }
- }
- return 0;
+ if (yyresult)
+ {
+ /* Avoid sprintf, as that infringes on the user's name space.
+ Don't have undefined behavior even if the translation
+ produced a string with the wrong number of "%s"s. */
+ char *yyp = yyresult;
+ int yyi = 0;
+ while ((*yyp = *yyf) != '\0')
+ {
+ if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+ {
+ yyp += yytnamerr (yyp, yyarg[yyi++]);
+ yyf += 2;
+ }
+ else
+ {
+ yyp++;
+ yyf++;
+ }
+ }
+ }
+ return yysize;
+ }
}
#endif /* YYERROR_VERBOSE */
+
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
@@ -1440,9 +1390,10 @@ yydestruct (yymsg, yytype, yyvaluep, p)
break;
}
}
-
+
/* Prevent warnings from -Wmissing-prototypes. */
+
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
@@ -1458,6 +1409,10 @@ int yyparse ();
#endif /* ! YYPARSE_PARAM */
+
+
+
+
/*----------.
| yyparse. |
`----------*/
@@ -1484,46 +1439,22 @@ yyparse (p)
#endif
#endif
{
-/* The lookahead symbol. */
+ /* The look-ahead symbol. */
int yychar;
-/* The semantic value of the lookahead symbol. */
+/* The semantic value of the look-ahead symbol. */
YYSTYPE yylval;
- /* Number of syntax errors so far. */
- int yynerrs;
-
- int yystate;
- /* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
-
- /* The stacks and their tools:
- `yyss': related to states.
- `yyvs': related to semantic values.
-
- Refer to the stacks thru separate pointers, to allow yyoverflow
- to reallocate them elsewhere. */
-
- /* The state stack. */
- yytype_int16 yyssa[YYINITDEPTH];
- yytype_int16 *yyss;
- yytype_int16 *yyssp;
-
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs;
- YYSTYPE *yyvsp;
-
- YYSIZE_T yystacksize;
+/* Number of syntax errors so far. */
+int yynerrs;
+ int yystate;
int yyn;
int yyresult;
- /* Lookahead token as an internal (translated) token number. */
- int yytoken;
- /* The variables used to return semantic value and location from the
- action routines. */
- YYSTYPE yyval;
-
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus;
+ /* Look-ahead token as an internal (translated) token number. */
+ int yytoken = 0;
#if YYERROR_VERBOSE
/* Buffer for error messages, and its allocated size. */
char yymsgbuf[128];
@@ -1531,28 +1462,51 @@ YYSTYPE yylval;
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif
+ /* Three stacks and their tools:
+ `yyss': related to states,
+ `yyvs': related to semantic values,
+ `yyls': related to locations.
+
+ Refer to the stacks thru separate pointers, to allow yyoverflow
+ to reallocate them elsewhere. */
+
+ /* The state stack. */
+ yytype_int16 yyssa[YYINITDEPTH];
+ yytype_int16 *yyss = yyssa;
+ yytype_int16 *yyssp;
+
+ /* The semantic value stack. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs = yyvsa;
+ YYSTYPE *yyvsp;
+
+
+
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
+ YYSIZE_T yystacksize = YYINITDEPTH;
+
+ /* The variables used to return semantic value and location from the
+ action routines. */
+ YYSTYPE yyval;
+
+
/* The number of symbols on the RHS of the reduced rule.
Keep to zero when no symbol should be popped. */
int yylen = 0;
- yytoken = 0;
- yyss = yyssa;
- yyvs = yyvsa;
- yystacksize = YYINITDEPTH;
-
YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0;
yyerrstatus = 0;
yynerrs = 0;
- yychar = YYEMPTY; /* Cause a token to be read. */
+ yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers.
Waste one element of value and location stack
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
+
yyssp = yyss;
yyvsp = yyvs;
@@ -1582,6 +1536,7 @@ YYSTYPE yylval;
YYSTYPE *yyvs1 = yyvs;
yytype_int16 *yyss1 = yyss;
+
/* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might
@@ -1589,6 +1544,7 @@ YYSTYPE yylval;
yyoverflow (YY_("memory exhausted"),
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
+
&yystacksize);
yyss = yyss1;
@@ -1611,8 +1567,9 @@ YYSTYPE yylval;
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
goto yyexhaustedlab;
- YYSTACK_RELOCATE (yyss_alloc, yyss);
- YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+ YYSTACK_RELOCATE (yyss);
+ YYSTACK_RELOCATE (yyvs);
+
# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
@@ -1623,6 +1580,7 @@ YYSTYPE yylval;
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
+
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize));
@@ -1632,9 +1590,6 @@ YYSTYPE yylval;
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
- if (yystate == YYFINAL)
- YYACCEPT;
-
goto yybackup;
/*-----------.
@@ -1643,16 +1598,16 @@ YYSTYPE yylval;
yybackup:
/* Do appropriate processing given the current state. Read a
- lookahead token if we need one and don't already have one. */
+ look-ahead token if we need one and don't already have one. */
- /* First try to decide what to do without reference to lookahead token. */
+ /* First try to decide what to do without reference to look-ahead token. */
yyn = yypact[yystate];
- if (yypact_value_is_default (yyn))
+ if (yyn == YYPACT_NINF)
goto yydefault;
- /* Not known => get a lookahead token if don't already have one. */
+ /* Not known => get a look-ahead token if don't already have one. */
- /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
@@ -1678,22 +1633,26 @@ yybackup:
yyn = yytable[yyn];
if (yyn <= 0)
{
- if (yytable_value_is_error (yyn))
- goto yyerrlab;
+ if (yyn == 0 || yyn == YYTABLE_NINF)
+ goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus)
yyerrstatus--;
- /* Shift the lookahead token. */
+ /* Shift the look-ahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
- /* Discard the shifted token. */
- yychar = YYEMPTY;
+ /* Discard the shifted token unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
yystate = yyn;
*++yyvsp = yylval;
@@ -1733,8 +1692,6 @@ yyreduce:
switch (yyn)
{
case 3:
-
-/* Line 1806 of yacc.c */
#line 69 "mapparser.y"
{
switch(p->type) {
@@ -1752,8 +1709,6 @@ yyreduce:
break;
case 4:
-
-/* Line 1806 of yacc.c */
#line 82 "mapparser.y"
{
switch(p->type) {
@@ -1772,8 +1727,6 @@ yyreduce:
break;
case 5:
-
-/* Line 1806 of yacc.c */
#line 96 "mapparser.y"
{
switch(p->type) {
@@ -1791,8 +1744,6 @@ yyreduce:
break;
case 6:
-
-/* Line 1806 of yacc.c */
#line 109 "mapparser.y"
{
switch(p->type) {
@@ -1805,15 +1756,11 @@ yyreduce:
break;
case 8:
-
-/* Line 1806 of yacc.c */
#line 120 "mapparser.y"
{ (yyval.intval) = (yyvsp[(2) - (3)].intval); }
break;
case 9:
-
-/* Line 1806 of yacc.c */
#line 121 "mapparser.y"
{
(yyval.intval) = MS_FALSE;
@@ -1822,8 +1769,6 @@ yyreduce:
break;
case 10:
-
-/* Line 1806 of yacc.c */
#line 125 "mapparser.y"
{
if((yyvsp[(1) - (3)].intval) == MS_TRUE)
@@ -1836,8 +1781,6 @@ yyreduce:
break;
case 11:
-
-/* Line 1806 of yacc.c */
#line 133 "mapparser.y"
{
if((yyvsp[(1) - (3)].intval) == MS_TRUE) {
@@ -1851,8 +1794,6 @@ yyreduce:
break;
case 12:
-
-/* Line 1806 of yacc.c */
#line 142 "mapparser.y"
{
if((yyvsp[(1) - (3)].intval) == MS_TRUE)
@@ -1865,8 +1806,6 @@ yyreduce:
break;
case 13:
-
-/* Line 1806 of yacc.c */
#line 150 "mapparser.y"
{
if((yyvsp[(1) - (3)].intval) == MS_TRUE) {
@@ -1880,8 +1819,6 @@ yyreduce:
break;
case 14:
-
-/* Line 1806 of yacc.c */
#line 159 "mapparser.y"
{
if((yyvsp[(1) - (3)].dblval) != 0)
@@ -1894,8 +1831,6 @@ yyreduce:
break;
case 15:
-
-/* Line 1806 of yacc.c */
#line 167 "mapparser.y"
{
if((yyvsp[(1) - (3)].dblval) != 0) {
@@ -1909,8 +1844,6 @@ yyreduce:
break;
case 16:
-
-/* Line 1806 of yacc.c */
#line 176 "mapparser.y"
{
if((yyvsp[(1) - (3)].dblval) != 0)
@@ -1923,8 +1856,6 @@ yyreduce:
break;
case 17:
-
-/* Line 1806 of yacc.c */
#line 184 "mapparser.y"
{
if((yyvsp[(1) - (3)].dblval) != 0) {
@@ -1938,22 +1869,16 @@ yyreduce:
break;
case 18:
-
-/* Line 1806 of yacc.c */
#line 193 "mapparser.y"
{ (yyval.intval) = !(yyvsp[(2) - (2)].intval); }
break;
case 19:
-
-/* Line 1806 of yacc.c */
#line 194 "mapparser.y"
{ (yyval.intval) = !(yyvsp[(2) - (2)].dblval); }
break;
case 20:
-
-/* Line 1806 of yacc.c */
#line 195 "mapparser.y"
{
ms_regex_t re;
@@ -1978,8 +1903,6 @@ yyreduce:
break;
case 21:
-
-/* Line 1806 of yacc.c */
#line 215 "mapparser.y"
{
ms_regex_t re;
@@ -2004,8 +1927,6 @@ yyreduce:
break;
case 22:
-
-/* Line 1806 of yacc.c */
#line 235 "mapparser.y"
{
if((yyvsp[(1) - (3)].dblval) == (yyvsp[(3) - (3)].dblval))
@@ -2016,8 +1937,6 @@ yyreduce:
break;
case 23:
-
-/* Line 1806 of yacc.c */
#line 241 "mapparser.y"
{
if((yyvsp[(1) - (3)].dblval) != (yyvsp[(3) - (3)].dblval))
@@ -2028,8 +1947,6 @@ yyreduce:
break;
case 24:
-
-/* Line 1806 of yacc.c */
#line 247 "mapparser.y"
{
if((yyvsp[(1) - (3)].dblval) > (yyvsp[(3) - (3)].dblval))
@@ -2040,8 +1957,6 @@ yyreduce:
break;
case 25:
-
-/* Line 1806 of yacc.c */
#line 253 "mapparser.y"
{
if((yyvsp[(1) - (3)].dblval) < (yyvsp[(3) - (3)].dblval))
@@ -2052,8 +1967,6 @@ yyreduce:
break;
case 26:
-
-/* Line 1806 of yacc.c */
#line 259 "mapparser.y"
{
if((yyvsp[(1) - (3)].dblval) >= (yyvsp[(3) - (3)].dblval))
@@ -2064,8 +1977,6 @@ yyreduce:
break;
case 27:
-
-/* Line 1806 of yacc.c */
#line 265 "mapparser.y"
{
if((yyvsp[(1) - (3)].dblval) <= (yyvsp[(3) - (3)].dblval))
@@ -2076,8 +1987,6 @@ yyreduce:
break;
case 28:
-
-/* Line 1806 of yacc.c */
#line 271 "mapparser.y"
{
if(strcmp((yyvsp[(1) - (3)].strval), (yyvsp[(3) - (3)].strval)) == 0)
@@ -2090,8 +1999,6 @@ yyreduce:
break;
case 29:
-
-/* Line 1806 of yacc.c */
#line 279 "mapparser.y"
{
if(strcmp((yyvsp[(1) - (3)].strval), (yyvsp[(3) - (3)].strval)) != 0)
@@ -2104,8 +2011,6 @@ yyreduce:
break;
case 30:
-
-/* Line 1806 of yacc.c */
#line 287 "mapparser.y"
{
if(strcmp((yyvsp[(1) - (3)].strval), (yyvsp[(3) - (3)].strval)) > 0)
@@ -2118,8 +2023,6 @@ yyreduce:
break;
case 31:
-
-/* Line 1806 of yacc.c */
#line 295 "mapparser.y"
{
if(strcmp((yyvsp[(1) - (3)].strval), (yyvsp[(3) - (3)].strval)) < 0)
@@ -2132,8 +2035,6 @@ yyreduce:
break;
case 32:
-
-/* Line 1806 of yacc.c */
#line 303 "mapparser.y"
{
if(strcmp((yyvsp[(1) - (3)].strval), (yyvsp[(3) - (3)].strval)) >= 0)
@@ -2146,8 +2047,6 @@ yyreduce:
break;
case 33:
-
-/* Line 1806 of yacc.c */
#line 311 "mapparser.y"
{
if(strcmp((yyvsp[(1) - (3)].strval), (yyvsp[(3) - (3)].strval)) <= 0)
@@ -2160,8 +2059,6 @@ yyreduce:
break;
case 34:
-
-/* Line 1806 of yacc.c */
#line 319 "mapparser.y"
{
if(msTimeCompare(&((yyvsp[(1) - (3)].tmval)), &((yyvsp[(3) - (3)].tmval))) == 0)
@@ -2172,8 +2069,6 @@ yyreduce:
break;
case 35:
-
-/* Line 1806 of yacc.c */
#line 325 "mapparser.y"
{
if(msTimeCompare(&((yyvsp[(1) - (3)].tmval)), &((yyvsp[(3) - (3)].tmval))) != 0)
@@ -2184,8 +2079,6 @@ yyreduce:
break;
case 36:
-
-/* Line 1806 of yacc.c */
#line 331 "mapparser.y"
{
if(msTimeCompare(&((yyvsp[(1) - (3)].tmval)), &((yyvsp[(3) - (3)].tmval))) > 0)
@@ -2196,8 +2089,6 @@ yyreduce:
break;
case 37:
-
-/* Line 1806 of yacc.c */
#line 337 "mapparser.y"
{
if(msTimeCompare(&((yyvsp[(1) - (3)].tmval)), &((yyvsp[(3) - (3)].tmval))) < 0)
@@ -2208,8 +2099,6 @@ yyreduce:
break;
case 38:
-
-/* Line 1806 of yacc.c */
#line 343 "mapparser.y"
{
if(msTimeCompare(&((yyvsp[(1) - (3)].tmval)), &((yyvsp[(3) - (3)].tmval))) >= 0)
@@ -2220,8 +2109,6 @@ yyreduce:
break;
case 39:
-
-/* Line 1806 of yacc.c */
#line 349 "mapparser.y"
{
if(msTimeCompare(&((yyvsp[(1) - (3)].tmval)), &((yyvsp[(3) - (3)].tmval))) <= 0)
@@ -2232,8 +2119,6 @@ yyreduce:
break;
case 40:
-
-/* Line 1806 of yacc.c */
#line 355 "mapparser.y"
{
char *delim, *bufferp;
@@ -2259,8 +2144,6 @@ yyreduce:
break;
case 41:
-
-/* Line 1806 of yacc.c */
#line 376 "mapparser.y"
{
char *delim,*bufferp;
@@ -2285,8 +2168,6 @@ yyreduce:
break;
case 42:
-
-/* Line 1806 of yacc.c */
#line 396 "mapparser.y"
{
if((yyvsp[(1) - (3)].dblval) == (yyvsp[(3) - (3)].dblval))
@@ -2297,8 +2178,6 @@ yyreduce:
break;
case 43:
-
-/* Line 1806 of yacc.c */
#line 402 "mapparser.y"
{
if(strcasecmp((yyvsp[(1) - (3)].strval), (yyvsp[(3) - (3)].strval)) == 0)
@@ -2311,8 +2190,6 @@ yyreduce:
break;
case 44:
-
-/* Line 1806 of yacc.c */
#line 410 "mapparser.y"
{
if(msTimeCompare(&((yyvsp[(1) - (3)].tmval)), &((yyvsp[(3) - (3)].tmval))) == 0)
@@ -2323,8 +2200,6 @@ yyreduce:
break;
case 45:
-
-/* Line 1806 of yacc.c */
#line 416 "mapparser.y"
{
int rval;
@@ -2340,8 +2215,6 @@ yyreduce:
break;
case 46:
-
-/* Line 1806 of yacc.c */
#line 427 "mapparser.y"
{
int rval;
@@ -2357,8 +2230,6 @@ yyreduce:
break;
case 47:
-
-/* Line 1806 of yacc.c */
#line 438 "mapparser.y"
{
int rval;
@@ -2374,8 +2245,6 @@ yyreduce:
break;
case 48:
-
-/* Line 1806 of yacc.c */
#line 449 "mapparser.y"
{
int rval;
@@ -2391,8 +2260,6 @@ yyreduce:
break;
case 49:
-
-/* Line 1806 of yacc.c */
#line 460 "mapparser.y"
{
int rval;
@@ -2408,8 +2275,6 @@ yyreduce:
break;
case 50:
-
-/* Line 1806 of yacc.c */
#line 471 "mapparser.y"
{
int rval;
@@ -2425,8 +2290,6 @@ yyreduce:
break;
case 51:
-
-/* Line 1806 of yacc.c */
#line 482 "mapparser.y"
{
int rval;
@@ -2442,8 +2305,6 @@ yyreduce:
break;
case 52:
-
-/* Line 1806 of yacc.c */
#line 493 "mapparser.y"
{
int rval;
@@ -2459,8 +2320,6 @@ yyreduce:
break;
case 53:
-
-/* Line 1806 of yacc.c */
#line 504 "mapparser.y"
{
int rval;
@@ -2476,8 +2335,6 @@ yyreduce:
break;
case 54:
-
-/* Line 1806 of yacc.c */
#line 515 "mapparser.y"
{
int rval;
@@ -2493,8 +2350,6 @@ yyreduce:
break;
case 55:
-
-/* Line 1806 of yacc.c */
#line 526 "mapparser.y"
{
int rval;
@@ -2510,8 +2365,6 @@ yyreduce:
break;
case 56:
-
-/* Line 1806 of yacc.c */
#line 537 "mapparser.y"
{
int rval;
@@ -2527,8 +2380,6 @@ yyreduce:
break;
case 57:
-
-/* Line 1806 of yacc.c */
#line 548 "mapparser.y"
{
int rval;
@@ -2544,8 +2395,6 @@ yyreduce:
break;
case 58:
-
-/* Line 1806 of yacc.c */
#line 559 "mapparser.y"
{
int rval;
@@ -2561,8 +2410,6 @@ yyreduce:
break;
case 59:
-
-/* Line 1806 of yacc.c */
#line 570 "mapparser.y"
{
int rval;
@@ -2578,8 +2425,6 @@ yyreduce:
break;
case 60:
-
-/* Line 1806 of yacc.c */
#line 581 "mapparser.y"
{
int rval;
@@ -2595,8 +2440,6 @@ yyreduce:
break;
case 61:
-
-/* Line 1806 of yacc.c */
#line 592 "mapparser.y"
{
double d;
@@ -2611,8 +2454,6 @@ yyreduce:
break;
case 62:
-
-/* Line 1806 of yacc.c */
#line 602 "mapparser.y"
{
double d;
@@ -2627,43 +2468,31 @@ yyreduce:
break;
case 64:
-
-/* Line 1806 of yacc.c */
#line 615 "mapparser.y"
{ (yyval.dblval) = (yyvsp[(2) - (3)].dblval); }
break;
case 65:
-
-/* Line 1806 of yacc.c */
#line 616 "mapparser.y"
{ (yyval.dblval) = (yyvsp[(1) - (3)].dblval) + (yyvsp[(3) - (3)].dblval); }
break;
case 66:
-
-/* Line 1806 of yacc.c */
#line 617 "mapparser.y"
{ (yyval.dblval) = (yyvsp[(1) - (3)].dblval) - (yyvsp[(3) - (3)].dblval); }
break;
case 67:
-
-/* Line 1806 of yacc.c */
#line 618 "mapparser.y"
{ (yyval.dblval) = (yyvsp[(1) - (3)].dblval) * (yyvsp[(3) - (3)].dblval); }
break;
case 68:
-
-/* Line 1806 of yacc.c */
#line 619 "mapparser.y"
{ (yyval.dblval) = (int)(yyvsp[(1) - (3)].dblval) % (int)(yyvsp[(3) - (3)].dblval); }
break;
case 69:
-
-/* Line 1806 of yacc.c */
#line 620 "mapparser.y"
{
if((yyvsp[(3) - (3)].dblval) == 0.0) {
@@ -2675,29 +2504,21 @@ yyreduce:
break;
case 70:
-
-/* Line 1806 of yacc.c */
#line 627 "mapparser.y"
{ (yyval.dblval) = (yyvsp[(2) - (2)].dblval); }
break;
case 71:
-
-/* Line 1806 of yacc.c */
#line 628 "mapparser.y"
{ (yyval.dblval) = pow((yyvsp[(1) - (3)].dblval), (yyvsp[(3) - (3)].dblval)); }
break;
case 72:
-
-/* Line 1806 of yacc.c */
#line 629 "mapparser.y"
{ (yyval.dblval) = strlen((yyvsp[(3) - (4)].strval)); }
break;
case 73:
-
-/* Line 1806 of yacc.c */
#line 630 "mapparser.y"
{
if((yyvsp[(3) - (4)].shpval)->type != MS_SHAPE_POLYGON) {
@@ -2710,22 +2531,16 @@ yyreduce:
break;
case 74:
-
-/* Line 1806 of yacc.c */
#line 638 "mapparser.y"
{ (yyval.dblval) = (MS_NINT((yyvsp[(3) - (6)].dblval)/(yyvsp[(5) - (6)].dblval)))*(yyvsp[(5) - (6)].dblval); }
break;
case 76:
-
-/* Line 1806 of yacc.c */
#line 642 "mapparser.y"
{ (yyval.shpval) = (yyvsp[(2) - (3)].shpval); }
break;
case 77:
-
-/* Line 1806 of yacc.c */
#line 643 "mapparser.y"
{
shapeObj *s;
@@ -2740,8 +2555,6 @@ yyreduce:
break;
case 78:
-
-/* Line 1806 of yacc.c */
#line 653 "mapparser.y"
{
shapeObj *s;
@@ -2756,8 +2569,6 @@ yyreduce:
break;
case 79:
-
-/* Line 1806 of yacc.c */
#line 663 "mapparser.y"
{
shapeObj *s;
@@ -2772,8 +2583,6 @@ yyreduce:
break;
case 80:
-
-/* Line 1806 of yacc.c */
#line 673 "mapparser.y"
{
shapeObj *s;
@@ -2788,8 +2597,6 @@ yyreduce:
break;
case 81:
-
-/* Line 1806 of yacc.c */
#line 683 "mapparser.y"
{
shapeObj *s;
@@ -2804,8 +2611,6 @@ yyreduce:
break;
case 82:
-
-/* Line 1806 of yacc.c */
#line 693 "mapparser.y"
{
shapeObj *s;
@@ -2820,8 +2625,6 @@ yyreduce:
break;
case 83:
-
-/* Line 1806 of yacc.c */
#line 703 "mapparser.y"
{
shapeObj *s;
@@ -2836,8 +2639,6 @@ yyreduce:
break;
case 84:
-
-/* Line 1806 of yacc.c */
#line 713 "mapparser.y"
{
shapeObj *s;
@@ -2852,8 +2653,6 @@ yyreduce:
break;
case 85:
-
-/* Line 1806 of yacc.c */
#line 723 "mapparser.y"
{
shapeObj *s;
@@ -2869,8 +2668,6 @@ yyreduce:
break;
case 86:
-
-/* Line 1806 of yacc.c */
#line 734 "mapparser.y"
{
#ifdef USE_V8_MAPSCRIPT
@@ -2891,15 +2688,11 @@ yyreduce:
break;
case 88:
-
-/* Line 1806 of yacc.c */
#line 753 "mapparser.y"
{ (yyval.strval) = (yyvsp[(2) - (3)].strval); }
break;
case 89:
-
-/* Line 1806 of yacc.c */
#line 754 "mapparser.y"
{
(yyval.strval) = (char *)malloc(strlen((yyvsp[(1) - (3)].strval)) + strlen((yyvsp[(3) - (3)].strval)) + 1);
@@ -2908,8 +2701,6 @@ yyreduce:
break;
case 90:
-
-/* Line 1806 of yacc.c */
#line 758 "mapparser.y"
{
(yyval.strval) = (char *) malloc(strlen((yyvsp[(5) - (6)].strval)) + 64); /* Plenty big? Should use snprintf below... */
@@ -2918,8 +2709,6 @@ yyreduce:
break;
case 91:
-
-/* Line 1806 of yacc.c */
#line 762 "mapparser.y"
{
(yyvsp[(3) - (4)].strval) = msCommifyString((yyvsp[(3) - (4)].strval));
@@ -2928,8 +2717,6 @@ yyreduce:
break;
case 92:
-
-/* Line 1806 of yacc.c */
#line 766 "mapparser.y"
{
msStringToUpper((yyvsp[(3) - (4)].strval));
@@ -2938,8 +2725,6 @@ yyreduce:
break;
case 93:
-
-/* Line 1806 of yacc.c */
#line 770 "mapparser.y"
{
msStringToLower((yyvsp[(3) - (4)].strval));
@@ -2948,8 +2733,6 @@ yyreduce:
break;
case 94:
-
-/* Line 1806 of yacc.c */
#line 774 "mapparser.y"
{
msStringInitCap((yyvsp[(3) - (4)].strval));
@@ -2958,8 +2741,6 @@ yyreduce:
break;
case 95:
-
-/* Line 1806 of yacc.c */
#line 778 "mapparser.y"
{
msStringFirstCap((yyvsp[(3) - (4)].strval));
@@ -2968,29 +2749,15 @@ yyreduce:
break;
case 97:
-
-/* Line 1806 of yacc.c */
#line 785 "mapparser.y"
{ (yyval.tmval) = (yyvsp[(2) - (3)].tmval); }
break;
-
-/* Line 1806 of yacc.c */
-#line 2981 "mapparser.c"
+/* Line 1267 of yacc.c. */
+#line 2759 "/Users/sdlime/mapserver/sdlime/mapserver/mapparser.c"
default: break;
}
- /* User semantic actions sometimes alter yychar, and that requires
- that yytoken be updated with the new translation. We take the
- approach of translating immediately before every use of yytoken.
- One alternative is translating here after every semantic action,
- but that translation would be missed if the semantic action invokes
- YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
- if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
- incorrect destructor might then be invoked immediately. In the
- case of YYERROR or YYBACKUP, subsequent parser actions might lead
- to an incorrect destructor call or verbose syntax error message
- before the lookahead is translated. */
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
YYPOPSTACK (yylen);
@@ -2999,6 +2766,7 @@ yyreduce:
*++yyvsp = yyval;
+
/* Now `shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
@@ -3018,10 +2786,6 @@ yyreduce:
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
- /* Make sure we have latest lookahead translation. See comments at
- user semantic actions for why this is necessary. */
- yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
-
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
@@ -3029,36 +2793,37 @@ yyerrlab:
#if ! YYERROR_VERBOSE
yyerror (p, YY_("syntax error"));
#else
-# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
- yyssp, yytoken)
{
- char const *yymsgp = YY_("syntax error");
- int yysyntax_error_status;
- yysyntax_error_status = YYSYNTAX_ERROR;
- if (yysyntax_error_status == 0)
- yymsgp = yymsg;
- else if (yysyntax_error_status == 1)
- {
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
- yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
- if (!yymsg)
- {
- yymsg = yymsgbuf;
- yymsg_alloc = sizeof yymsgbuf;
- yysyntax_error_status = 2;
- }
- else
- {
- yysyntax_error_status = YYSYNTAX_ERROR;
- yymsgp = yymsg;
- }
- }
- yyerror (p, yymsgp);
- if (yysyntax_error_status == 2)
- goto yyexhaustedlab;
+ YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+ if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+ {
+ YYSIZE_T yyalloc = 2 * yysize;
+ if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+ yyalloc = YYSTACK_ALLOC_MAXIMUM;
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+ yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+ if (yymsg)
+ yymsg_alloc = yyalloc;
+ else
+ {
+ yymsg = yymsgbuf;
+ yymsg_alloc = sizeof yymsgbuf;
+ }
+ }
+
+ if (0 < yysize && yysize <= yymsg_alloc)
+ {
+ (void) yysyntax_error (yymsg, yystate, yychar);
+ yyerror (p, yymsg);
+ }
+ else
+ {
+ yyerror (p, YY_("syntax error"));
+ if (yysize != 0)
+ goto yyexhaustedlab;
+ }
}
-# undef YYSYNTAX_ERROR
#endif
}
@@ -3066,7 +2831,7 @@ yyerrlab:
if (yyerrstatus == 3)
{
- /* If just tried and failed to reuse lookahead token after an
+ /* If just tried and failed to reuse look-ahead token after an
error, discard it. */
if (yychar <= YYEOF)
@@ -3083,7 +2848,7 @@ yyerrlab:
}
}
- /* Else will try to reuse lookahead token after shifting the error
+ /* Else will try to reuse look-ahead token after shifting the error
token. */
goto yyerrlab1;
@@ -3117,7 +2882,7 @@ yyerrlab1:
for (;;)
{
yyn = yypact[yystate];
- if (!yypact_value_is_default (yyn))
+ if (yyn != YYPACT_NINF)
{
yyn += YYTERROR;
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
@@ -3140,6 +2905,9 @@ yyerrlab1:
YY_STACK_PRINT (yyss, yyssp);
}
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
*++yyvsp = yylval;
@@ -3164,7 +2932,7 @@ yyabortlab:
yyresult = 1;
goto yyreturn;
-#if !defined(yyoverflow) || YYERROR_VERBOSE
+#ifndef yyoverflow
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
@@ -3175,14 +2943,9 @@ yyexhaustedlab:
#endif
yyreturn:
- if (yychar != YYEMPTY)
- {
- /* Make sure we have latest lookahead translation. See comments at
- user semantic actions for why this is necessary. */
- yytoken = YYTRANSLATE (yychar);
- yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval, p);
- }
+ if (yychar != YYEOF && yychar != YYEMPTY)
+ yydestruct ("Cleanup: discarding lookahead",
+ yytoken, &yylval, p);
/* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen);
@@ -3206,8 +2969,6 @@ yyreturn:
}
-
-/* Line 2067 of yacc.c */
#line 788 "mapparser.y"
@@ -3258,6 +3019,8 @@ int yylex(YYSTYPE *lvalp, parseObj *p)
case MS_TOKEN_COMPARISON_RE: token = RE; break;
case MS_TOKEN_COMPARISON_IRE: token = IRE; break;
+ case MS_TOKEN_COMPARISON_IN: token = IN; break;
+
case MS_TOKEN_COMPARISON_INTERSECTS: token = INTERSECTS; break;
case MS_TOKEN_COMPARISON_DISJOINT: token = DISJOINT; break;
case MS_TOKEN_COMPARISON_TOUCHES: token = TOUCHES; break;
=====================================
mapparser.h
=====================================
@@ -1,21 +1,24 @@
-/* A Bison parser, made by GNU Bison 2.5. */
+/* A Bison parser, made by GNU Bison 2.3. */
-/* Bison interface for Yacc-like parsers in C
-
- Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
+/* Skeleton interface for Bison's Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -26,11 +29,10 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
-
+
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
-
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
@@ -136,27 +138,21 @@
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-{
-
-/* Line 2068 of yacc.c */
#line 30 "mapparser.y"
-
+{
double dblval;
int intval;
char *strval;
struct tm tmval;
shapeObj *shpval;
-
-
-
-/* Line 2068 of yacc.c */
-#line 154 "mapparser.h"
-} YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
+}
+/* Line 1529 of yacc.c. */
+#line 151 "/Users/sdlime/mapserver/sdlime/mapserver/mapparser.h"
+ YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
#endif
-
=====================================
mapparser.y
=====================================
@@ -834,6 +834,8 @@ int yylex(YYSTYPE *lvalp, parseObj *p)
case MS_TOKEN_COMPARISON_RE: token = RE; break;
case MS_TOKEN_COMPARISON_IRE: token = IRE; break;
+ case MS_TOKEN_COMPARISON_IN: token = IN; break;
+
case MS_TOKEN_COMPARISON_INTERSECTS: token = INTERSECTS; break;
case MS_TOKEN_COMPARISON_DISJOINT: token = DISJOINT; break;
case MS_TOKEN_COMPARISON_TOUCHES: token = TOUCHES; break;
=====================================
mappostgis.c
=====================================
@@ -4032,7 +4032,7 @@ int msPostGISLayerTranslateFilter(layerObj *layer, expressionObj *filter, char *
if(layer->debug >= 2) msDebug("msPostGISLayerTranslateFilter. There are tokens to process... \n");
node = filter->tokens;
- while (node != NULL) {
+ while (node != NULL) {
/*
** Do any token caching/tracking here, easier to have it in one place.
@@ -4040,8 +4040,9 @@ int msPostGISLayerTranslateFilter(layerObj *layer, expressionObj *filter, char *
if(node->token == MS_TOKEN_BINDING_TIME) {
bindingToken = node->token;
} else if(node->token == MS_TOKEN_COMPARISON_EQ || node->token == MS_TOKEN_COMPARISON_NE ||
- node->token == MS_TOKEN_COMPARISON_GT || node->token == MS_TOKEN_COMPARISON_GE ||
- node->token == MS_TOKEN_COMPARISON_LT || node->token == MS_TOKEN_COMPARISON_LE) {
+ node->token == MS_TOKEN_COMPARISON_GT || node->token == MS_TOKEN_COMPARISON_GE ||
+ node->token == MS_TOKEN_COMPARISON_LT || node->token == MS_TOKEN_COMPARISON_LE ||
+ node->token == MS_TOKEN_COMPARISON_IN) {
comparisonToken = node->token;
}
@@ -4066,13 +4067,38 @@ int msPostGISLayerTranslateFilter(layerObj *layer, expressionObj *filter, char *
msFree(snippet);
break;
case MS_TOKEN_LITERAL_STRING:
- strtmpl = "'%s'";
- stresc = msPostGISEscapeSQLParam(layer, node->tokenval.strval);
- snippet = (char *) msSmallMalloc(strlen(strtmpl) + strlen(stresc));
- sprintf(snippet, strtmpl, stresc);
- native_string = msStringConcatenate(native_string, snippet);
- msFree(snippet);
- msFree(stresc);
+
+ if(comparisonToken == MS_TOKEN_COMPARISON_IN) { /* issue 5490 */
+ char **strings=NULL;
+ int i, nstrings=0;
+
+ strings = msStringSplit(node->tokenval.strval, ',', &nstrings);
+ if(nstrings > 0) {
+ native_string = msStringConcatenate(native_string, "(");
+ for(i=0; i<nstrings; i++) {
+ if(i != 0) native_string = msStringConcatenate(native_string, ",");
+ strtmpl = "'%s'";
+ stresc = msPostGISEscapeSQLParam(layer, strings[i]);
+ snippet = (char *) msSmallMalloc(strlen(strtmpl) + strlen(stresc));
+ sprintf(snippet, strtmpl, stresc);
+ native_string = msStringConcatenate(native_string, snippet);
+ msFree(snippet);
+ msFree(stresc);
+ }
+ native_string = msStringConcatenate(native_string, ")");
+ }
+
+ msFreeCharArray(strings, nstrings);
+ } else {
+ strtmpl = "'%s'";
+ stresc = msPostGISEscapeSQLParam(layer, node->tokenval.strval);
+ snippet = (char *) msSmallMalloc(strlen(strtmpl) + strlen(stresc));
+ sprintf(snippet, strtmpl, stresc);
+ native_string = msStringConcatenate(native_string, snippet);
+ msFree(snippet);
+ msFree(stresc);
+ }
+
break;
case MS_TOKEN_LITERAL_TIME: {
snippet = (char *) msSmallMalloc(512);
=====================================
mapscript/csharp/CMakeLists.txt
=====================================
@@ -62,6 +62,4 @@ ADD_CUSTOM_COMMAND(TARGET mapscript
COMMENT "Compiling c# source files"
)
-#get_target_property(LOC_MAPSCRIPT_LIB ${SWIG_MODULE_csharpmapscript_REAL_NAME} LOCATION)
-#install(FILES ${LOC_MAPSCRIPT_LIB} DESTINATION lib)
=====================================
mapscript/java/CMakeLists.txt
=====================================
@@ -1,23 +1,28 @@
-FIND_PACKAGE(SWIG REQUIRED)
-INCLUDE(${SWIG_USE_FILE})
+find_package(SWIG REQUIRED)
+include(${SWIG_USE_FILE})
-FIND_PACKAGE(JNI)
-FIND_PACKAGE(Java)
+find_package(JNI)
+find_package(Java)
if(NOT JNI_INCLUDE_DIRS OR NOT Java_JAVAC_EXECUTABLE OR NOT Java_JAR_EXECUTABLE)
message(SEND_ERROR "Could not find required Java componenents. Try setting the JAVA_HOME environment variable (required on e.g. Ubuntu)")
endif(NOT JNI_INCLUDE_DIRS OR NOT Java_JAVAC_EXECUTABLE OR NOT Java_JAR_EXECUTABLE)
-INCLUDE_DIRECTORIES(${JNI_INCLUDE_DIRS})
+include_directories(${JNI_INCLUDE_DIRS})
include_directories(${PROJECT_SOURCE_DIR}/mapscript/swiginc)
include_directories(${PROJECT_SOURCE_DIR}/mapscript/)
include_directories(${PROJECT_SOURCE_DIR}/mapscript/java)
-SET (CMAKE_SWIG_OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/edu/umn/gis/mapscript")
-SET(CMAKE_SWIG_FLAGS -package edu.umn.gis.mapscript)
-SWIG_ADD_MODULE(javamapscript java ../mapscript.i)
+set (CMAKE_SWIG_OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/edu/umn/gis/mapscript")
+set(CMAKE_SWIG_FLAGS -package edu.umn.gis.mapscript)
-SWIG_LINK_LIBRARIES(javamapscript ${MAPSERVER_LIBMAPSERVER})
+if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 3.7)
+ swig_add_library(javamapscript TYPE MODULE LANGUAGE java SOURCES ../mapscript.i)
+else ()
+ swig_add_module(javamapscript java ../mapscript.i)
+endif ()
-ADD_CUSTOM_COMMAND(TARGET javamapscript
+swig_link_libraries(javamapscript ${MAPSERVER_LIBMAPSERVER})
+
+add_custom_command(TARGET javamapscript
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
POST_BUILD
COMMAND ${Java_JAVAC_EXECUTABLE} edu/umn/gis/mapscript/*.java
@@ -25,6 +30,5 @@ ADD_CUSTOM_COMMAND(TARGET javamapscript
COMMENT "Compiling java source files, creating mapscript.jar"
)
-get_target_property(LOC_MAPSCRIPT_LIB ${SWIG_MODULE_javamapscript_REAL_NAME} LOCATION)
-install(FILES ${LOC_MAPSCRIPT_LIB} DESTINATION ${CMAKE_INSTALL_LIBDIR})
-
+set(mapscript_files $<TARGET_FILE:${SWIG_MODULE_javamapscript_REAL_NAME}>)
+install(FILES ${mapscript_files} DESTINATION ${CMAKE_INSTALL_LIBDIR})
=====================================
mapscript/perl/CMakeLists.txt
=====================================
@@ -1,15 +1,20 @@
-FIND_PACKAGE(SWIG REQUIRED)
-INCLUDE(${SWIG_USE_FILE})
-FIND_PACKAGE(Perl REQUIRED)
-FIND_PACKAGE(PerlLibs REQUIRED)
+find_package(SWIG REQUIRED)
+include(${SWIG_USE_FILE})
+find_package(Perl REQUIRED)
+find_package(PerlLibs REQUIRED)
set(CUSTOM_PERL_SITE_ARCH_DIR ${PERL_SITEARCH} CACHE DIR "Custom installation directory for perl binary extension")
-INCLUDE_DIRECTORIES(${PERL_INCLUDE_PATH})
+include_directories(${PERL_INCLUDE_PATH})
include_directories(${PROJECT_SOURCE_DIR}/mapscript/swiginc)
include_directories(${PROJECT_SOURCE_DIR}/mapscript/)
add_definitions(${PERL_EXTRA_C_FLAGS})
-SET(CMAKE_SWIG_FLAGS -shadow -w314)
+set(CMAKE_SWIG_FLAGS -shadow -w314)
include_directories(${PROJECT_SOURCE_DIR}/mapscript/perl)
-SWIG_ADD_MODULE(perlmapscript perl5 ../mapscript.i)
+
+if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 3.7)
+ swig_add_library(perlmapscript TYPE MODULE LANGUAGE perl5 SOURCES ../mapscript.i)
+else ()
+ swig_add_module(perlmapscript perl5 ../mapscript.i)
+endif ()
SWIG_LINK_LIBRARIES(perlmapscript ${PERL_LIBRARIES} ${MAPSERVER_LIBMAPSERVER})
set_target_properties(perlmapscript PROPERTIES OUTPUT_NAME mapscript)
@@ -18,8 +23,5 @@ if(APPLE)
set_target_properties(perlmapscript PROPERTIES SUFFIX ".bundle")
endif(APPLE)
-get_target_property(LOC_MAPSCRIPT_LIB ${SWIG_MODULE_perlmapscript_REAL_NAME} LOCATION)
-set(mapscript_files ${LOC_MAPSCRIPT_LIB} ${CMAKE_CURRENT_BINARY_DIR}/mapscript.pm)
-install(FILES ${LOC_MAPSCRIPT_LIB} DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/mapscript)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mapscript.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR})
-
+install(FILES $<TARGET_FILE:${SWIG_MODULE_perlmapscript_REAL_NAME}> DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/mapscript)
+install(FILES $<TARGET_FILE_DIR:${SWIG_MODULE_perlmapscript_REAL_NAME}>/mapscript.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR})
=====================================
mapscript/ruby/CMakeLists.txt
=====================================
@@ -1,20 +1,26 @@
-FIND_PACKAGE(SWIG REQUIRED)
-INCLUDE(${SWIG_USE_FILE})
-FIND_PACKAGE(Ruby REQUIRED)
-INCLUDE_DIRECTORIES(${RUBY_INCLUDE_DIRS})
+find_package(SWIG REQUIRED)
+include(${SWIG_USE_FILE})
+find_package(Ruby REQUIRED)
+include_directories(${RUBY_INCLUDE_DIRS})
include_directories(${PROJECT_SOURCE_DIR}/mapscript/swiginc)
include_directories(${PROJECT_SOURCE_DIR}/mapscript/)
include_directories(${PROJECT_SOURCE_DIR}/mapscript/ruby)
-SWIG_ADD_MODULE(rubymapscript ruby ../mapscript.i)
-SWIG_LINK_LIBRARIES(rubymapscript ${RUBY_LIBRARY} ${MAPSERVER_LIBMAPSERVER})
+if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 3.7)
+ swig_add_library(rubymapscript TYPE MODULE LANGUAGE ruby SOURCES ../mapscript.i)
+else ()
+ swig_add_module(rubymapscript ruby ../mapscript.i)
+endif ()
+
+swig_link_libraries(rubymapscript ${RUBY_LIBRARY} ${MAPSERVER_LIBMAPSERVER})
set_target_properties(${SWIG_MODULE_rubymapscript_REAL_NAME} PROPERTIES PREFIX "")
set_target_properties(${SWIG_MODULE_rubymapscript_REAL_NAME} PROPERTIES OUTPUT_NAME mapscript)
+
if(APPLE)
- set_target_properties(${SWIG_MODULE_rubymapscript_REAL_NAME} PROPERTIES SUFFIX ".bundle")
+ set_target_properties(${SWIG_MODULE_rubymapscript_REAL_NAME} PROPERTIES SUFFIX ".bundle")
endif(APPLE)
-get_target_property(LOC_MAPSCRIPT_LIB ${SWIG_MODULE_rubymapscript_REAL_NAME} LOCATION)
+set(mapscript_files $<TARGET_FILE:${SWIG_MODULE_rubymapscript_REAL_NAME}>)
execute_process(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG['sitearchdir']" OUTPUT_VARIABLE RUBY_SITEARCHDIR OUTPUT_STRIP_TRAILING_WHITESPACE)
-install(FILES ${LOC_MAPSCRIPT_LIB} DESTINATION ${RUBY_SITEARCHDIR})
+install(FILES ${mapscript_files} DESTINATION ${RUBY_SITEARCHDIR})
=====================================
mapwms.c
=====================================
@@ -323,7 +323,11 @@ int msWMSApplyFilter(mapObj *map, int version, const char *filter,
char **paszFilters = NULL;
FilterEncodingNode *psNode = NULL;
- if (!map || !filter || strlen(filter)==0)
+ // Empty filter should be ignored
+ if (!filter || strlen(filter) == 0)
+ return MS_SUCCESS;
+
+ if (!map)
return MS_FAILURE;
/* Count number of requested layers
@@ -360,7 +364,7 @@ int msWMSApplyFilter(mapObj *map, int version, const char *filter,
}
if (numlayers != numfilters) {
- msSetError(MS_WFSERR, "Wrong number of filter elements, one filter must be specified for each requested layer.",
+ msSetError(MS_WMSERR, "Wrong number of filter elements, one filter must be specified for each requested layer.",
"msWMSApplyFilter" );
return msWMSException(map, version, "InvalidParameterValue", wms_exception_format);
}
@@ -454,7 +458,7 @@ int msWMSApplyFilter(mapObj *map, int version, const char *filter,
errorObj* ms_error = msGetErrorObj();
if(ms_error->code != MS_NOTFOUND) {
- msSetError(MS_WFSERR, "FLTApplyFilterToLayer() failed", "msWFSGetFeature()");
+ msSetError(MS_WMSERR, "FLTApplyFilterToLayer() failed", "msWMSApplyFilter()");
FLTFreeFilterEncodingNode( psNode );
return msWMSException(map, version, "InvalidParameterValue", wms_exception_format);
}
View it on GitLab: https://salsa.debian.org/debian-gis-team/mapserver/commit/bdbe4db72422589f5dfc84290d118d177960be8d
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/mapserver/commit/bdbe4db72422589f5dfc84290d118d177960be8d
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20190219/eca7e6fd/attachment-0001.html>
More information about the Pkg-grass-devel
mailing list