[mapserver-dev] RFC 59 Logical Expression Overhaul (preliminary draft)

Frank Warmerdam warmerdam at pobox.com
Sat Aug 7 09:47:05 EDT 2010


On Fri, Aug 6, 2010 at 1:41 PM, Lime, Steve D (DNR)
<Steve.Lime at state.mn.us> wrote:
> Hi all: I figure it's time to formally surface some work I've been doing relative to improving the function and extending the
> use of the MapServer Bison/Yacc parser. For now I drafted the RFC on the wiki and will move to the dev. portion of the
> website if necessary. I think this adds some pretty interesting functionality. Anyway, it's at:
>
>  http://trac.osgeo.org/mapserver/wiki/RFC59-Draft

Steve,

This looks like a promising step.  Coincidentally, this is at the
same time that I wrote an SQL parser using yacc/bison for OGR.

A few thoughts.

1) Why not parse the expression once into an expression tree
data structure and then just evaluate that each time instead of
also having to run the parser each time?   I'm not sure what the
speed advantage of this would be over doing the evaluation of
the expression as part of parsing, but it *seems* like a more
conventional approach.

2) You mention the use of globals to pass in stuff to the parser.
I was able to use the parse-param and lex-param directives to
Bison to have a 'context' data structure in to the parser and on
to the lexer.  You can skim the .y file I came up with at:

http://trac.osgeo.org/gdal/browser/sandbox/warmerdam/gdal-rfc28/gdal/ogr/swq_parser.y

This was also a fully reentrant parsers so different threads could
be parsing at the same time without serialization.  I'd be happy to
help if you would like to investigate.

I certainly agree that the old substitute and re-parse
approach was a performance issue, so I'm pleased to
see the direction you are moving.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent


More information about the mapserver-dev mailing list