[Mapserver-users] msyyparse() - parse error

Steve Lime steve.lime at dnr.state.mn.us
Wed Mar 24 10:40:50 PST 2004


I can check on the error message detail. The parser works on tokens
and may not have access to the entire expression text.

A quick peek tells me that we'd need to exit the msyyerror function at
the bottom of maplexer.l, and then recompile.

Try editing that function and changing:

int msyyerror(char *s) {
  msSetError(MS_PARSEERR, s, "msyyparse()");
  return(0);
}

to

int msyyerror(char *s) {
  msSetError(MS_PARSEERR, "Error is '%s' in expression %s.", "msyyparse()", s, msyystring);
  return(0);
}

I've not tested but this should work. Let me know if that helps debug. If so I'll make that change in CVS...

Steve

>>> Möri Cédric <Cedric.Moeri at bd.so.ch> 3/24/2004 9:38:19 AM >>>
Hi list!

i'm still stuck on this problem. So my question for the moment is the
following:

Is it possible to have an error message with a little more information?
For the moment it only tells me "msyyparse(): Expression parser error. parse
error". 

It would be great to have a filename and a line/record number or at least a
some twenty characters of the ofending data or expression. It would be much
more easier to investigate the error.

Is this already possible (through some debug-level or other switches I don't
know about) or would it be a big challenge to add such a feature?

best regards
Cédric

> -----Original Message-----
> From: Steve Lime [mailto:steve.lime at dnr.state.mn.us] 
> Sent: Monday, March 22, 2004 5:38 PM
> To: Cedric.Moeri at bd.so.ch; mapserver-users at lists.gis.umn.edu 
> Subject: Re: [Mapserver-users] msyyparse() - parse error
> 
> 
> Hi there: Msyyparse() is the function that evaluates 
> MapServer expressions. There
> are 3 possibilities: 
> 
> 1) There is an error in the expression you're using.
> 2) There is something funky in your data, that breaks an expression.
> 3) There is an error in the code itself.
> 
> Although 1) and 3) are possible they seem unlikely. My guess 
> is that there is an
> issue with certain data values and the expressions. One 
> example would be
> data values containing embeded quotes. Let's say you had a place name
> called O'Reilly and where using an expression like:
> 
> ('[placename]' = 'foo') which would become in the case of O'Reilly,
> 
> ('O'Reilly' = 'foo') and this would cause a parse error. 
> 
> Could also happen with numeric fields that didn't contain 
> numbers or are empty.
> We'd really need to see your mapfile to make the call.
> 
> Steve
> 
> >>> Möri Cédric <Cedric.Moeri at bd.so.ch> 3/22/2004 4:27:42 AM >>>
> Hello list!
> 
> we recently upgraded our systems from
> MapServer3.6.6/postgreSQL7.2.4/postgis0.8.0 to
> MapServer4.0.1/postgreSQL7.4.2/postgis0.8.1. The system is 
> running under
> Linux RH7.2.
> 
> Now i'm reciving sometimes this strange error "msyyparse(): Expression
> parser error. parse error".
> (In the old version, everyting worked perfect!)
> 
> I'm not able to reproduce this error regularly. Sometimes it 
> triggers when
> i'm switching some layers on/off, sometimes it triggers when 
> i'm just paning
> (same layer-set/same scale). Sometimes it triggers only one 
> time, othertimes
> up to 60 times with still the same mapfile. 
> 
> I read from the archives that there might be some issue about 
> the querrying
> in postgis but there is not much more.
> 
> So I guess I'm stuck. Has anybody a hint for me in which 
> direction to go on
> with my quest? May anybody explain what the msyyparse does, 
> and when it is
> called?
> 
> Any hint would be appreciated!
> If needed I would be glad to provide further information.
> 
> best regards
> mit freundlichen Grüssen
> 
> Cédric Möri
> 
> ********************************************
> Kanton Solothurn
> Amt für Geoinformation
> Abt. SO!GIS Koordinationsstelle 
> Rötihof
> 4509 Solothurn
> T:   ++41 (0)32 627 2475
> Fax: ++41 (0)32 627 2214 
> http://www.sogis.so.ch 
> ********************************************
> 
> 
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu 
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users 
> 

_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu 
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list