[Mapserver-users] msyyparse() - parse error

Möri Cédric Cedric.Moeri@bd.so.ch
Thu, 25 Mar 2004 18:09:35 +0100


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_000_01C4128B.F2CCF910
Content-Type: text/plain;
	charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi Steve, hi list

the code works fine and was very useful! Many thanks for the quick =
response!
That's what I love about mailing list and open source!

The error shows now like this:

msyyparse(): Expression parser error. Error is 'parse error' in =
expression
((("BS" =3D "GA") OR ("BS" =3D "GV") OR ("BS" =3D "GH") OR ("BS" =3D =
"GS")) AND ("F"
=3D "T") AND (0 > 100) AND (0 <=3D 250).

Quiet easy to see that there is one opening parenthesis too much. Sadly =
this
error belongs not to my project.

My error reads now like this:
msyyparse(): Expression parser error. Error is 'parse error' in =
expression
40 =3D foo.

This is quite useful to find the ofending layer, but I'm not =
understanding
what's wrong with it. I just see it doesn't match. My guess is, that =
the
parser dies because he got an alphanumeric and I think he's expecting a
numeric value. If this is correct I would suggest not to throw an error =
but
a simple "not matching". I use this syntax often to generate an item in =
a
legend, that I don't want to have in the map itsself.=20

I changed from the 'EXPRESSION ([COLOR] =3D 4)' to 'EXPRESSION "4"' =
with a
CLASSITEM "COLOR" and now the error doesn't pop up.

That about this parser error thing. Sadly engouh the project still =
doesn't
work.=20
The error doesn't show up but I no map at all. The error log file =
simply
shows time an ip, but no error message at all (apache log shows =
nothing). As
I mentioned in the older mails, this behaviour is rather at random.
Sometimes it works perfect and then just nothing happens.=20

I tried to convert my data from postgis to shapefiles but it didn't =
matter.

As far as we know is this error influenced by LABELCACHE ON/OFF,
POSTLABELCACHE ON/OFF, which layers are STATUS ON/OFF, order of the =
layers
in the mapfile etc.=20

Sometimes I find a set with lets say for layer off that works fine. If =
I
turn one of this layer on, it won't work. The next time I find another =
set
with just this layers on, workin without problems. Additionally most of =
this
layers are involved in other projects on the same box an they work just
fine.=20

I know, this error description is rahter confused and so I am. So any =
hint
will be helpful. I attach my mapfile to this mail, hoping some finds =
the
point, that I'm so obviously missing!

Thanks a lot to all!
best regards
C=E9dric


> -----Original Message-----
> From: Steve Lime [mailto:steve.lime@dnr.state.mn.us]
> Sent: Wednesday, March 24, 2004 7:41 PM
> To: Cedric.Moeri@bd.so.ch; mapserver-users@lists.gis.umn.edu
> Subject: RE: [Mapserver-users] msyyparse() - parse error
>=20
>=20
> I can check on the error message detail. The parser works on tokens
> and may not have access to the entire expression text.
>=20
> A quick peek tells me that we'd need to exit the msyyerror function =
at
> the bottom of maplexer.l, and then recompile.
>=20
> Try editing that function and changing:
>=20
> int msyyerror(char *s) {
>   msSetError(MS_PARSEERR, s, "msyyparse()");
>   return(0);
> }
>=20
> to
>=20
> int msyyerror(char *s) {
>   msSetError(MS_PARSEERR, "Error is '%s' in expression %s.",=20
> "msyyparse()", s, msyystring);
>   return(0);
> }
>=20
> I've not tested but this should work. Let me know if that=20
> helps debug. If so I'll make that change in CVS...
>=20
> Steve
>=20
> >>> M=F6ri C=E9dric <Cedric.Moeri@bd.so.ch> 3/24/2004 9:38:19 AM >>>
> Hi list!
>=20
> i'm still stuck on this problem. So my question for the moment is the
> following:
>=20
> Is it possible to have an error message with a little more=20
> information?
> For the moment it only tells me "msyyparse(): Expression=20
> parser error. parse
> error".=20
>=20
> It would be great to have a filename and a line/record number=20
> or at least a
> some twenty characters of the ofending data or expression. It=20
> would be much
> more easier to investigate the error.
>=20
> Is this already possible (through some debug-level or other=20
> switches I don't
> know about) or would it be a big challenge to add such a feature?
>=20
> best regards
> C=E9dric
>=20
> > -----Original Message-----
> > From: Steve Lime [mailto:steve.lime@dnr.state.mn.us]=20
> > Sent: Monday, March 22, 2004 5:38 PM
> > To: Cedric.Moeri@bd.so.ch; mapserver-users@lists.gis.umn.edu=20
> > Subject: Re: [Mapserver-users] msyyparse() - parse error
> >=20
> >=20
> > Hi there: Msyyparse() is the function that evaluates=20
> > MapServer expressions. There
> > are 3 possibilities:=20
> >=20
> > 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.
> >=20
> > Although 1) and 3) are possible they seem unlikely. My guess=20
> > is that there is an
> > issue with certain data values and the expressions. One=20
> > example would be
> > data values containing embeded quotes. Let's say you had a=20
> place name
> > called O'Reilly and where using an expression like:
> >=20
> > ('[placename]' =3D 'foo') which would become in the case of =
O'Reilly,
> >=20
> > ('O'Reilly' =3D 'foo') and this would cause a parse error.=20
> >=20
> > Could also happen with numeric fields that didn't contain=20
> > numbers or are empty.
> > We'd really need to see your mapfile to make the call.
> >=20
> > Steve
> >=20
> > >>> M=F6ri C=E9dric <Cedric.Moeri@bd.so.ch> 3/22/2004 4:27:42 AM =
>>>
> > Hello list!
> >=20
> > 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=20
> > running under
> > Linux RH7.2.
> >=20
> > Now i'm reciving sometimes this strange error "msyyparse():=20
> Expression
> > parser error. parse error".
> > (In the old version, everyting worked perfect!)
> >=20
> > I'm not able to reproduce this error regularly. Sometimes it=20
> > triggers when
> > i'm switching some layers on/off, sometimes it triggers when=20
> > i'm just paning
> > (same layer-set/same scale). Sometimes it triggers only one=20
> > time, othertimes
> > up to 60 times with still the same mapfile.=20
> >=20
> > I read from the archives that there might be some issue about=20
> > the querrying
> > in postgis but there is not much more.
> >=20
> > So I guess I'm stuck. Has anybody a hint for me in which=20
> > direction to go on
> > with my quest? May anybody explain what the msyyparse does,=20
> > and when it is
> > called?
> >=20
> > Any hint would be appreciated!
> > If needed I would be glad to provide further information.
> >=20
> > best regards
> > mit freundlichen Gr=FCssen
> >=20
> > C=E9dric M=F6ri
> >=20
> > ********************************************
> > Kanton Solothurn
> > Amt f=FCr Geoinformation
> > Abt. SO!GIS Koordinationsstelle=20
> > R=F6tihof
> > 4509 Solothurn
> > T:   ++41 (0)32 627 2475
> > Fax: ++41 (0)32 627 2214=20
> > http://www.sogis.so.ch=20
> > ********************************************
> >=20
> >=20
> >=20
> > _______________________________________________
> > Mapserver-users mailing list
> > Mapserver-users@lists.gis.umn.edu=20
> > http://lists.gis.umn.edu/mailman/listinfo/mapserver-users=20
> >=20
>=20
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users@lists.gis.umn.edu=20
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>=20


------_=_NextPart_000_01C4128B.F2CCF910
Content-Type: application/octet-stream;
	name="strada.map"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="strada.map"

NAME STRADA=0A=
STATUS ON=0A=
#SIZE 666 594  # if the size entry is deleted, it can be set via the =
URL=0A=
SYMBOLSET =
"/opt/wwwroot/sogis/develop/cmoe/MapServer/etc/symbols/symbols.neu"=0A=
EXTENT 590000 190000 650000 265000=0A=
UNITS METERS=0A=
SIZE 200 200=0A=
SHAPEPATH "/opt/wwwroot/sogis/daten/"=0A=
IMAGECOLOR 255 255 255=0A=
FONTSET =
"/opt/wwwroot/sogis/develop/cmoe/MapServer/etc/fonts/fonts.list"=0A=
RESOLUTION 82=0A=
IMAGETYPE GIF=0A=
INTERLACE OFF=0A=
DATAPATTERN ".*"=0A=
TEMPLATEPATTERN ".*"=0A=
#=0A=
# Start of web interface definition=0A=
#=0A=
WEB=0A=
  HEADER =
"/opt/wwwroot/sogis/develop/cmoe/MapServer/fr_map/header.html"=0A=
  TEMPLATE =
"/opt/wwwroot/sogis/develop/cmoe/MapServer/fr_map/template.html"=0A=
  FOOTER =
"/opt/wwwroot/sogis/develop/cmoe/MapServer/fr_map/footer.html"=0A=
  MINSCALE 100=0A=
  MAXSCALE 1550000=0A=
  IMAGEPATH "/opt/wwwroot/sogis/gifs/"=0A=
  IMAGEURL "/sogis/gifs/"=0A=
  LOG "/opt/wwwroot/sogis/MapServer/etc/log/MapServer.log"=0A=
#	EMPTY =
"/opt/wwwroot/sogis/develop/cmoe/MapServer/fr_map/empty.html"=0A=
#	ERROR =
"Mapserver-users@lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users