location of filter engine in src

Steve Lime steve.lime at DNR.STATE.MN.US
Mon Jan 30 14:17:28 EST 2006


So you want to add a modulus operator correct? (I thought it existed but I was wrong) To do that is pretty straight forward you have to edit one file and recompile:

  - mapparser.y -> this is the Bison/YACC parser grammar, the '%' operator needs to be added to the section that defines operator precedence, and down in the math_exp syntax session

I don't have my reference manual handy but looking through a perl manual I see the '%' operator at the same level as '*' and '/' so in the precedence section. So you can change the line:

%left '*' '/'

to

%left '*' '/' '%'

and change:

| math_exp '*' math_exp { $$ = $1 * $3; }

to

| math_exp '*' math_exp { $$ = $1 * $3; }
| math_exp '%' math_exp { $$ = $1 % $3; }

or something close to this. Lemme know if it works and I'll patch 4.8 and 4.9.

Steve

>>> Charlton Purvis <cplist at EARTHLINK.NET> 01/27/06 12:04 PM >>>
Hi, folks:

I'd like to modify the filter to execute modulus in addition to everything
it already does (http://mapserver.gis.umn.edu/docs/howto/msexpressions).
I'm looking through the code right now, but if somebody knows off the top of
their head where to point me, that would be great.

Thanks,

Charlton



More information about the mapserver-users mailing list