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

svn at osgeo.org svn at osgeo.org
Tue Jul 13 00:51:49 EDT 2010


Author: sdlime
Date: 2010-07-13 04:51:48 +0000 (Tue, 13 Jul 2010)
New Revision: 10343

Modified:
   sandbox/sdlime/common-expressions/mapserver/mapparser.c
   sandbox/sdlime/common-expressions/mapserver/mapparser.y
Log:
Added several other of the spatial operators (only BEYOND and DWITHIN remain).

Modified: sandbox/sdlime/common-expressions/mapserver/mapparser.c
===================================================================
--- sandbox/sdlime/common-expressions/mapserver/mapparser.c	2010-07-13 04:45:38 UTC (rev 10342)
+++ sandbox/sdlime/common-expressions/mapserver/mapparser.c	2010-07-13 04:51:48 UTC (rev 10343)
@@ -286,16 +286,16 @@
 /* YYFINAL -- State number of the termination state. */
 #define YYFINAL  29
 /* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   260
+#define YYLAST   298
 
 /* YYNTOKENS -- Number of terminals. */
 #define YYNTOKENS  43
 /* YYNNTS -- Number of nonterminals. */
 #define YYNNTS  8
 /* YYNRULES -- Number of rules. */
-#define YYNRULES  62
+#define YYNRULES  67
 /* YYNRULES -- Number of states. */
-#define YYNSTATES  129
+#define YYNSTATES  139
 
 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 #define YYUNDEFTOK  2
@@ -347,9 +347,9 @@
       26,    30,    34,    38,    42,    45,    48,    52,    56,    60,
       64,    68,    72,    76,    80,    84,    88,    92,    96,   100,
      104,   108,   112,   116,   120,   124,   128,   132,   136,   140,
-     144,   148,   152,   156,   160,   162,   166,   170,   174,   178,
-     182,   186,   189,   193,   198,   203,   205,   209,   214,   216,
-     220,   224,   226
+     144,   148,   152,   156,   160,   164,   168,   172,   176,   180,
+     182,   186,   190,   194,   198,   202,   206,   209,   213,   218,
+     223,   225,   229,   234,   236,   240,   244,   246
 };
 
 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
@@ -371,6 +371,8 @@
       49,    -1,    47,    14,    49,    -1,    47,    13,    47,    -1,
       49,    13,    49,    -1,    50,    13,    50,    -1,    48,    20,
       48,    -1,    48,    30,    48,    -1,    48,    29,    48,    -1,
+      48,    28,    48,    -1,    48,    27,    48,    -1,    48,    26,
+      48,    -1,    48,    25,    48,    -1,    48,    24,    48,    -1,
        3,    -1,    41,    47,    42,    -1,    47,    34,    47,    -1,
       47,    35,    47,    -1,    47,    36,    47,    -1,    47,    38,
       47,    -1,    47,    37,    47,    -1,    35,    47,    -1,    47,
@@ -387,9 +389,9 @@
      116,   124,   133,   141,   150,   151,   152,   165,   171,   177,
      183,   189,   195,   201,   202,   210,   218,   227,   235,   243,
      251,   257,   263,   269,   275,   281,   287,   308,   329,   335,
-     343,   350,   361,   372,   385,   386,   387,   388,   389,   390,
-     391,   398,   399,   400,   401,   411,   412,   413,   425,   426,
-     427,   430,   431
+     343,   350,   361,   372,   383,   394,   405,   416,   427,   440,
+     441,   442,   443,   444,   445,   446,   453,   454,   455,   456,
+     466,   467,   468,   480,   481,   482,   485,   486
 };
 #endif
 
@@ -428,9 +430,9 @@
       46,    46,    46,    46,    46,    46,    46,    46,    46,    46,
       46,    46,    46,    46,    46,    46,    46,    46,    46,    46,
       46,    46,    46,    46,    46,    46,    46,    46,    46,    46,
-      46,    46,    46,    46,    47,    47,    47,    47,    47,    47,
-      47,    47,    47,    47,    47,    48,    48,    48,    49,    49,
-      49,    50,    50
+      46,    46,    46,    46,    46,    46,    46,    46,    46,    47,
+      47,    47,    47,    47,    47,    47,    47,    47,    47,    47,
+      48,    48,    48,    49,    49,    49,    50,    50
 };
 
 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
@@ -440,9 +442,9 @@
        3,     3,     3,     3,     2,     2,     3,     3,     3,     3,
        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
-       3,     3,     3,     3,     1,     3,     3,     3,     3,     3,
-       3,     2,     3,     4,     4,     1,     3,     4,     1,     3,
-       3,     1,     3
+       3,     3,     3,     3,     3,     3,     3,     3,     3,     1,
+       3,     3,     3,     3,     3,     3,     2,     3,     4,     4,
+       1,     3,     4,     1,     3,     3,     1,     3
 };
 
 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@@ -450,51 +452,53 @@
    means the default is an error.  */
 static const unsigned char yydefact[] =
 {
-       2,    44,    58,    61,    55,     0,     0,     0,     0,     0,
+       2,    49,    63,    66,    60,     0,     0,     0,     0,     0,
        0,     0,     3,     4,     0,     0,     0,    14,    15,     0,
-       0,     0,     0,    51,     0,     0,     0,     0,     0,     1,
+       0,     0,     0,    56,     0,     0,     0,     0,     0,     1,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,    23,    45,    56,    59,    62,     6,
-       8,     7,     9,    10,    12,    11,    13,    38,    37,    21,
-      22,    19,    20,    18,    17,    46,    47,    48,    50,    49,
-      52,    41,    43,    42,    39,    36,    28,    29,    26,    27,
-      25,    24,     5,    16,    60,     0,    40,    34,    35,    32,
-      33,    31,    30,     0,    53,     0,    54,    57,     0
+       0,     0,     0,     0,     0,     0,     0,     0,     0,    23,
+      50,    61,    64,    67,     6,     8,     7,     9,    10,    12,
+      11,    13,    38,    37,    21,    22,    19,    20,    18,    17,
+      51,    52,    53,    55,    54,    57,    41,    48,    47,    46,
+      45,    44,    43,    42,    39,    36,    28,    29,    26,    27,
+      25,    24,     5,    16,    65,     0,    40,    34,    35,    32,
+      33,    31,    30,     0,    58,     0,    59,    62,     0
 };
 
 /* YYDEFGOTO[NTERM-NUM]. */
 static const yysigned_char yydefgoto[] =
 {
-      -1,    11,   113,    12,    13,    14,    15,    16
+      -1,    11,   123,    12,    13,    14,    15,    16
 };
 
 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    STATE-NUM.  */
-#define YYPACT_NINF -31
+#define YYPACT_NINF -39
 static const short int yypact[] =
 {
-       2,   -31,   -31,   -31,   -31,     2,     1,     4,    17,    41,
-       2,    31,     9,   125,    -7,   219,   228,   -31,   191,     6,
-      -5,     6,    41,     8,     7,   114,    54,   161,    84,   -31,
-       2,     2,     2,     2,    41,     6,    41,    41,    41,    41,
-      41,    41,    41,    41,    41,    41,    41,    41,    -5,    -5,
-      -5,     6,     6,     6,     6,     6,     6,     6,     6,    42,
-       6,    -3,    -3,    -3,    -3,    -3,    -3,    -3,     6,   -30,
-      -5,    18,   -27,    53,   -31,   -31,   -31,   -31,   -31,    48,
-     153,   -31,   191,    48,   153,   -31,   191,   220,    36,   220,
-     220,   220,   220,   220,   220,   -11,   -11,     8,     8,     8,
-       8,   -31,   -31,   -31,    36,    36,    36,    36,    36,    36,
-      36,    36,   -31,   -31,   -31,    -3,   -31,   -31,   -31,   -31,
-     -31,   -31,   -31,   -18,   -31,    33,   -31,   -31,    35
+     131,   -39,   -39,   -39,   -39,   131,   -38,   -31,   -23,    47,
+     131,    24,    -2,   172,    73,   251,   271,   -39,   219,     8,
+      -3,     8,    47,   -15,     6,   139,   221,   210,    94,   -39,
+     131,   131,   131,   131,    47,     8,    47,    47,    47,    47,
+      47,    47,    47,    47,    47,    47,    47,    47,    -3,    -3,
+      -3,    -3,    -3,    -3,    -3,    -3,     8,     8,     8,     8,
+       8,     8,     8,     8,    18,     8,    -4,    -4,    -4,    -4,
+      -4,    -4,    -4,     8,   -29,    -3,   -14,   -28,   239,   -39,
+     -39,   -39,   -39,   -39,    23,   182,   -39,   219,    23,   182,
+     -39,   219,   258,    -5,   258,   258,   258,   258,   258,   258,
+     -17,   -17,   -15,   -15,   -15,   -15,   -39,   -39,   -39,   -39,
+     -39,   -39,   -39,   -39,    -5,    -5,    -5,    -5,    -5,    -5,
+      -5,    -5,   -39,   -39,   -39,    -4,   -39,   -39,   -39,   -39,
+     -39,   -39,   -39,   -27,   -39,    -7,   -39,   -39,    -6
 };
 
 /* YYPGOTO[NTERM-NUM].  */
-static const short int yypgoto[] =
+static const yysigned_char yypgoto[] =
 {
-     -31,   -31,   -31,   187,    76,    -9,    11,   -10
+     -39,   -39,   -39,    22,    86,    -9,    12,   -10
 };
 
 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
@@ -504,64 +508,70 @@
 #define YYTABLE_NINF -1
 static const unsigned char yytable[] =
 {
-      28,    26,     4,     3,    60,     1,     2,    60,     3,     4,
-       2,    71,   124,    48,     5,   127,    60,    30,    31,    30,
-      31,    27,    49,    50,    77,    44,    45,    46,     8,    47,
-      69,    29,    72,     6,     7,     8,    70,     9,   115,   101,
-     102,   103,    19,    10,     1,    20,    88,    68,    47,    74,
-     112,   116,   117,   118,   119,   120,   121,   122,    21,    31,
-     126,   125,   104,   105,   106,   107,   108,   109,   110,   111,
-      60,   114,     6,     7,    48,    76,     9,    78,     0,   123,
-       0,    18,    22,    49,    50,    23,    25,    42,    43,    44,
-      45,    46,     0,    47,     0,    75,    76,    61,    73,    62,
-      63,    64,    65,    66,    67,   128,    80,    82,    84,    86,
-      87,     0,    89,    90,    91,    92,    93,    94,    95,    96,
-      97,    98,    99,   100,    32,    33,    78,    34,    35,    36,
-      37,    38,    39,    40,    41,    32,    33,     0,    34,    35,
-      36,    37,    38,    39,    40,    41,     0,     0,    42,    43,
-      44,    45,    46,     0,    47,     0,    75,     0,     0,    42,
-      43,    44,    45,    46,    33,    47,    34,    35,    36,    37,
-      38,    39,    40,    41,    51,    52,    53,    54,    55,    56,
-      57,    58,    59,     0,     0,     0,     0,    42,    43,    44,
-      45,    46,    17,    47,     0,    60,     0,    24,     0,     0,
-       0,     0,     0,    77,    34,    35,    36,    37,    38,    39,
-      40,    41,     0,     0,     0,     0,     0,    79,    81,    83,
-      85,     0,     0,     0,     0,    42,    43,    44,    45,    46,
-       0,    47,    51,    52,    53,    54,    55,    56,    57,    58,
-      59,    61,     0,    62,    63,    64,    65,    66,    67,     0,
-       0,     0,     0,    60,    42,    43,    44,    45,    46,     0,
-      47
+      28,    26,     3,    19,     4,    65,    65,    65,    30,    31,
+      20,    76,     2,   134,   137,    82,    30,    31,    21,    44,
+      45,    46,    27,    47,    29,    47,   122,    17,   136,    65,
+       8,    74,    24,    77,    31,    81,    83,   125,    75,   106,
+     107,   108,   109,   110,   111,   112,   113,    93,    79,    73,
+       1,     0,    84,    86,    88,    90,   126,   127,   128,   129,
+     130,   131,   132,     0,     0,     0,   135,     0,   114,   115,
+     116,   117,   118,   119,   120,   121,     0,   124,     6,     7,
+       0,     0,     9,     0,     0,   133,     0,     0,    22,     0,
+       0,    18,     0,    48,     0,    23,    25,    49,    50,    51,
+      52,    53,    54,    55,     0,     0,     0,    66,    78,    67,
+      68,    69,    70,    71,    72,   138,    85,    87,    89,    91,
+      92,     0,    94,    95,    96,    97,    98,    99,   100,   101,
+     102,   103,   104,   105,     1,     2,    83,     3,     4,     0,
+       0,     0,     0,     5,     0,     0,     0,     0,     0,    32,
+      33,     0,    34,    35,    36,    37,    38,    39,    40,    41,
+       0,     0,     6,     7,     8,     0,     9,     0,     0,     0,
+       0,     0,    10,    42,    43,    44,    45,    46,     0,    47,
+       0,    80,    32,    33,     0,    34,    35,    36,    37,    38,
+      39,    40,    41,    33,     0,    34,    35,    36,    37,    38,
+      39,    40,    41,     0,     0,     0,    42,    43,    44,    45,
+      46,     0,    47,     0,     0,     0,    42,    43,    44,    45,
+      46,     0,    47,    56,    57,    58,    59,    60,    61,    62,
+      63,    64,    34,    35,    36,    37,    38,    39,    40,    41,
+       0,    48,     0,     0,    65,    49,    50,    51,    52,    53,
+      54,    55,    82,    42,    43,    44,    45,    46,     0,    47,
+       0,     0,     0,    81,    56,    57,    58,    59,    60,    61,
+      62,    63,    64,    42,    43,    44,    45,    46,     0,    47,
+       0,    80,     0,     0,    66,    65,    67,    68,    69,    70,
+      71,    72,    42,    43,    44,    45,    46,     0,    47
 };
 
 static const yysigned_char yycheck[] =
 {
-      10,    10,     7,     6,    34,     3,     4,    34,     6,     7,
-       4,    20,    42,    20,    12,    42,    34,    10,    11,    10,
-      11,    10,    29,    30,    42,    36,    37,    38,    33,    40,
-      19,     0,    21,    31,    32,    33,    41,    35,    41,    48,
-      49,    50,    41,    41,     3,    41,    35,    41,    40,    42,
-       8,    61,    62,    63,    64,    65,    66,    67,    41,    11,
-      42,    70,    51,    52,    53,    54,    55,    56,    57,    58,
-      34,    60,    31,    32,    20,    42,    35,    42,    -1,    68,
-      -1,     5,    41,    29,    30,     9,    10,    34,    35,    36,
-      37,    38,    -1,    40,    -1,    42,    42,    13,    22,    15,
-      16,    17,    18,    19,    20,   115,    30,    31,    32,    33,
+      10,    10,     6,    41,     7,    34,    34,    34,    10,    11,
+      41,    20,     4,    42,    42,    42,    10,    11,    41,    36,
+      37,    38,    10,    40,     0,    40,     8,     5,    42,    34,
+      33,    19,    10,    21,    11,    42,    42,    41,    41,    48,
+      49,    50,    51,    52,    53,    54,    55,    35,    42,    41,
+       3,    -1,    30,    31,    32,    33,    66,    67,    68,    69,
+      70,    71,    72,    -1,    -1,    -1,    75,    -1,    56,    57,
+      58,    59,    60,    61,    62,    63,    -1,    65,    31,    32,
+      -1,    -1,    35,    -1,    -1,    73,    -1,    -1,    41,    -1,
+      -1,     5,    -1,    20,    -1,     9,    10,    24,    25,    26,
+      27,    28,    29,    30,    -1,    -1,    -1,    13,    22,    15,
+      16,    17,    18,    19,    20,   125,    30,    31,    32,    33,
       34,    -1,    36,    37,    38,    39,    40,    41,    42,    43,
-      44,    45,    46,    47,    10,    11,    42,    13,    14,    15,
-      16,    17,    18,    19,    20,    10,    11,    -1,    13,    14,
-      15,    16,    17,    18,    19,    20,    -1,    -1,    34,    35,
-      36,    37,    38,    -1,    40,    -1,    42,    -1,    -1,    34,
-      35,    36,    37,    38,    11,    40,    13,    14,    15,    16,
-      17,    18,    19,    20,    13,    14,    15,    16,    17,    18,
-      19,    20,    21,    -1,    -1,    -1,    -1,    34,    35,    36,
-      37,    38,     5,    40,    -1,    34,    -1,    10,    -1,    -1,
+      44,    45,    46,    47,     3,     4,    42,     6,     7,    -1,
+      -1,    -1,    -1,    12,    -1,    -1,    -1,    -1,    -1,    10,
+      11,    -1,    13,    14,    15,    16,    17,    18,    19,    20,
+      -1,    -1,    31,    32,    33,    -1,    35,    -1,    -1,    -1,
+      -1,    -1,    41,    34,    35,    36,    37,    38,    -1,    40,
+      -1,    42,    10,    11,    -1,    13,    14,    15,    16,    17,
+      18,    19,    20,    11,    -1,    13,    14,    15,    16,    17,
+      18,    19,    20,    -1,    -1,    -1,    34,    35,    36,    37,
+      38,    -1,    40,    -1,    -1,    -1,    34,    35,    36,    37,
+      38,    -1,    40,    13,    14,    15,    16,    17,    18,    19,
+      20,    21,    13,    14,    15,    16,    17,    18,    19,    20,
+      -1,    20,    -1,    -1,    34,    24,    25,    26,    27,    28,
+      29,    30,    42,    34,    35,    36,    37,    38,    -1,    40,
       -1,    -1,    -1,    42,    13,    14,    15,    16,    17,    18,
-      19,    20,    -1,    -1,    -1,    -1,    -1,    30,    31,    32,
-      33,    -1,    -1,    -1,    -1,    34,    35,    36,    37,    38,
-      -1,    40,    13,    14,    15,    16,    17,    18,    19,    20,
-      21,    13,    -1,    15,    16,    17,    18,    19,    20,    -1,
-      -1,    -1,    -1,    34,    34,    35,    36,    37,    38,    -1,
-      40
+      19,    20,    21,    34,    35,    36,    37,    38,    -1,    40,
+      -1,    42,    -1,    -1,    13,    34,    15,    16,    17,    18,
+      19,    20,    34,    35,    36,    37,    38,    -1,    40
 };
 
 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
@@ -572,13 +582,14 @@
       41,    44,    46,    47,    48,    49,    50,    46,    47,    41,
       41,    41,    41,    47,    46,    47,    48,    49,    50,     0,
       10,    11,    10,    11,    13,    14,    15,    16,    17,    18,
-      19,    20,    34,    35,    36,    37,    38,    40,    20,    29,
-      30,    13,    14,    15,    16,    17,    18,    19,    20,    21,
-      34,    13,    15,    16,    17,    18,    19,    20,    41,    49,
-      41,    48,    49,    47,    42,    42,    42,    42,    42,    46,
-      47,    46,    47,    46,    47,    46,    47,    47,    49,    47,
-      47,    47,    47,    47,    47,    47,    47,    47,    47,    47,
-      47,    48,    48,    48,    49,    49,    49,    49,    49,    49,
+      19,    20,    34,    35,    36,    37,    38,    40,    20,    24,
+      25,    26,    27,    28,    29,    30,    13,    14,    15,    16,
+      17,    18,    19,    20,    21,    34,    13,    15,    16,    17,
+      18,    19,    20,    41,    49,    41,    48,    49,    47,    42,
+      42,    42,    42,    42,    46,    47,    46,    47,    46,    47,
+      46,    47,    47,    49,    47,    47,    47,    47,    47,    47,
+      47,    47,    47,    47,    47,    47,    48,    48,    48,    48,
+      48,    48,    48,    48,    49,    49,    49,    49,    49,    49,
       49,    49,     8,    45,    49,    41,    50,    50,    50,    50,
       50,    50,    50,    49,    42,    48,    42,    42,    50
 };
@@ -1650,7 +1661,7 @@
       if((yyvsp[-2].shpval)->scope == 1) msFreeShape((yyvsp[-2].shpval));
       if((yyvsp[0].shpval)->scope == 1) msFreeShape((yyvsp[0].shpval));
       if(rval == -1) {
-        yyerror("Intersects operator failed.");
+        yyerror("Equals (EQ or ==) operator failed.");
         return(-1);
       } else
         (yyval.intval) = rval;
@@ -1680,40 +1691,115 @@
       if((yyvsp[-2].shpval)->scope == 1) msFreeShape((yyvsp[-2].shpval));
       if((yyvsp[0].shpval)->scope == 1) msFreeShape((yyvsp[0].shpval));
       if(rval == -1) {
-        yyerror("Intersects operator failed.");
+        yyerror("Disjoint operator failed.");
         return(-1);
       } else
         (yyval.intval) = rval;
     }
     break;
 
+  case 44:
+#line 383 "mapparser.y"
+    {
+      int rval;
+      rval = msGEOSTouches((yyvsp[-2].shpval), (yyvsp[0].shpval));
+      if((yyvsp[-2].shpval)->scope == 1) msFreeShape((yyvsp[-2].shpval));
+      if((yyvsp[0].shpval)->scope == 1) msFreeShape((yyvsp[0].shpval));
+      if(rval == -1) {
+        yyerror("Touches operator failed.");
+        return(-1);
+      } else
+        (yyval.intval) = rval;
+    }
+    break;
+
   case 45:
-#line 386 "mapparser.y"
+#line 394 "mapparser.y"
+    {
+      int rval;
+      rval = msGEOSOverlaps((yyvsp[-2].shpval), (yyvsp[0].shpval));
+      if((yyvsp[-2].shpval)->scope == 1) msFreeShape((yyvsp[-2].shpval));
+      if((yyvsp[0].shpval)->scope == 1) msFreeShape((yyvsp[0].shpval));
+      if(rval == -1) {
+        yyerror("Overlaps operator failed.");
+        return(-1);
+      } else
+        (yyval.intval) = rval;
+    }
+    break;
+
+  case 46:
+#line 405 "mapparser.y"
+    {
+      int rval;
+      rval = msGEOSCrosses((yyvsp[-2].shpval), (yyvsp[0].shpval));
+      if((yyvsp[-2].shpval)->scope == 1) msFreeShape((yyvsp[-2].shpval));
+      if((yyvsp[0].shpval)->scope == 1) msFreeShape((yyvsp[0].shpval));
+      if(rval == -1) {
+        yyerror("Crosses operator failed.");
+        return(-1);
+      } else
+        (yyval.intval) = rval;
+    }
+    break;
+
+  case 47:
+#line 416 "mapparser.y"
+    {
+      int rval;
+      rval = msGEOSWithin((yyvsp[-2].shpval), (yyvsp[0].shpval));
+      if((yyvsp[-2].shpval)->scope == 1) msFreeShape((yyvsp[-2].shpval));
+      if((yyvsp[0].shpval)->scope == 1) msFreeShape((yyvsp[0].shpval));
+      if(rval == -1) {
+        yyerror("Within operator failed.");
+        return(-1);
+      } else
+        (yyval.intval) = rval;
+    }
+    break;
+
+  case 48:
+#line 427 "mapparser.y"
+    {
+      int rval;
+      rval = msGEOSContains((yyvsp[-2].shpval), (yyvsp[0].shpval));
+      if((yyvsp[-2].shpval)->scope == 1) msFreeShape((yyvsp[-2].shpval));
+      if((yyvsp[0].shpval)->scope == 1) msFreeShape((yyvsp[0].shpval));
+      if(rval == -1) {
+        yyerror("Contains operator failed.");
+        return(-1);
+      } else
+        (yyval.intval) = rval;
+    }
+    break;
+
+  case 50:
+#line 441 "mapparser.y"
     { (yyval.dblval) = (yyvsp[-1].dblval); }
     break;
 
-  case 46:
-#line 387 "mapparser.y"
+  case 51:
+#line 442 "mapparser.y"
     { (yyval.dblval) = (yyvsp[-2].dblval) + (yyvsp[0].dblval); }
     break;
 
-  case 47:
-#line 388 "mapparser.y"
+  case 52:
+#line 443 "mapparser.y"
     { (yyval.dblval) = (yyvsp[-2].dblval) - (yyvsp[0].dblval); }
     break;
 
-  case 48:
-#line 389 "mapparser.y"
+  case 53:
+#line 444 "mapparser.y"
     { (yyval.dblval) = (yyvsp[-2].dblval) * (yyvsp[0].dblval); }
     break;
 
-  case 49:
-#line 390 "mapparser.y"
+  case 54:
+#line 445 "mapparser.y"
     { (yyval.dblval) = (int)(yyvsp[-2].dblval) % (int)(yyvsp[0].dblval); }
     break;
 
-  case 50:
-#line 391 "mapparser.y"
+  case 55:
+#line 446 "mapparser.y"
     {
       if((yyvsp[0].dblval) == 0.0) {
         yyerror("Division by zero.");
@@ -1723,23 +1809,23 @@
     }
     break;
 
-  case 51:
-#line 398 "mapparser.y"
+  case 56:
+#line 453 "mapparser.y"
     { (yyval.dblval) = (yyvsp[0].dblval); }
     break;
 
-  case 52:
-#line 399 "mapparser.y"
+  case 57:
+#line 454 "mapparser.y"
     { (yyval.dblval) = pow((yyvsp[-2].dblval), (yyvsp[0].dblval)); }
     break;
 
-  case 53:
-#line 400 "mapparser.y"
+  case 58:
+#line 455 "mapparser.y"
     { (yyval.dblval) = strlen((yyvsp[-1].strval)); }
     break;
 
-  case 54:
-#line 401 "mapparser.y"
+  case 59:
+#line 456 "mapparser.y"
     {
       if((yyvsp[-1].shpval)->type != MS_SHAPE_POLYGON) {
         yyerror("Area can only be computed for polygon shapes.");
@@ -1750,13 +1836,13 @@
     }
     break;
 
-  case 56:
-#line 412 "mapparser.y"
+  case 61:
+#line 467 "mapparser.y"
     { (yyval.shpval) = (yyvsp[-1].shpval); }
     break;
 
-  case 57:
-#line 413 "mapparser.y"
+  case 62:
+#line 468 "mapparser.y"
     {
     shapeObj *s;
     s = msShapeFromWKT((yyvsp[-1].strval));
@@ -1769,18 +1855,18 @@
   }
     break;
 
-  case 59:
-#line 426 "mapparser.y"
+  case 64:
+#line 481 "mapparser.y"
     { (yyval.strval) = (yyvsp[-1].strval); free((yyvsp[-1].strval)); }
     break;
 
-  case 60:
-#line 427 "mapparser.y"
+  case 65:
+#line 482 "mapparser.y"
     { sprintf((yyval.strval), "%s%s", (yyvsp[-2].strval), (yyvsp[0].strval)); free((yyvsp[-2].strval)); free((yyvsp[0].strval)); }
     break;
 
-  case 62:
-#line 431 "mapparser.y"
+  case 67:
+#line 486 "mapparser.y"
     { (yyval.tmval) = (yyvsp[-1].tmval); }
     break;
 
@@ -1788,7 +1874,7 @@
     }
 
 /* Line 1037 of yacc.c.  */
-#line 1792 "mapparser.c"
+#line 1878 "mapparser.c"
 
   yyvsp -= yylen;
   yyssp -= yylen;
@@ -2016,7 +2102,7 @@
 }
 
 
-#line 434 "mapparser.y"
+#line 489 "mapparser.y"
 
 
 /*

Modified: sandbox/sdlime/common-expressions/mapserver/mapparser.y
===================================================================
--- sandbox/sdlime/common-expressions/mapserver/mapparser.y	2010-07-13 04:45:38 UTC (rev 10342)
+++ sandbox/sdlime/common-expressions/mapserver/mapparser.y	2010-07-13 04:51:48 UTC (rev 10343)
@@ -353,7 +353,7 @@
       if($1->scope == 1) msFreeShape($1);
       if($3->scope == 1) msFreeShape($3);
       if(rval == -1) {
-        yyerror("Intersects operator failed.");
+        yyerror("Equals (EQ or ==) operator failed.");
         return(-1);
       } else
         $$ = rval;
@@ -375,11 +375,66 @@
       if($1->scope == 1) msFreeShape($1);
       if($3->scope == 1) msFreeShape($3);
       if(rval == -1) {
-        yyerror("Intersects operator failed.");
+        yyerror("Disjoint operator failed.");
         return(-1);
       } else
         $$ = rval;
     }
+  | shape_exp TOUCHES shape_exp {
+      int rval;
+      rval = msGEOSTouches($1, $3);
+      if($1->scope == 1) msFreeShape($1);
+      if($3->scope == 1) msFreeShape($3);
+      if(rval == -1) {
+        yyerror("Touches operator failed.");
+        return(-1);
+      } else
+        $$ = rval;
+    }
+  | shape_exp OVERLAPS shape_exp {
+      int rval;
+      rval = msGEOSOverlaps($1, $3);
+      if($1->scope == 1) msFreeShape($1);
+      if($3->scope == 1) msFreeShape($3);
+      if(rval == -1) {
+        yyerror("Overlaps operator failed.");
+        return(-1);
+      } else
+        $$ = rval;
+    }
+  | shape_exp CROSSES shape_exp {
+      int rval;
+      rval = msGEOSCrosses($1, $3);
+      if($1->scope == 1) msFreeShape($1);
+      if($3->scope == 1) msFreeShape($3);
+      if(rval == -1) {
+        yyerror("Crosses operator failed.");
+        return(-1);
+      } else
+        $$ = rval;
+    }
+  | shape_exp WITHIN shape_exp {
+      int rval;
+      rval = msGEOSWithin($1, $3);
+      if($1->scope == 1) msFreeShape($1);
+      if($3->scope == 1) msFreeShape($3);
+      if(rval == -1) {
+        yyerror("Within operator failed.");
+        return(-1);
+      } else
+        $$ = rval;
+    }
+  | shape_exp CONTAINS shape_exp {
+      int rval;
+      rval = msGEOSContains($1, $3);
+      if($1->scope == 1) msFreeShape($1);
+      if($3->scope == 1) msFreeShape($3);
+      if(rval == -1) {
+        yyerror("Contains operator failed.");
+        return(-1);
+      } else
+        $$ = rval;
+    }
 ;
 
 math_exp: NUMBER



More information about the mapserver-commits mailing list