POV-Ray : Newsgroups : povray.pov4.discussion.general : Overly, token hungry, parser. Server Time
9 May 2024 09:37:25 EDT (-0400)
  Overly, token hungry, parser. (Message 1 to 1 of 1)  
From: William F Pokorny
Subject: Overly, token hungry, parser.
Date: 12 Nov 2023 22:06:35
Message: <655192bb$1@news.povray.org>
Because I've been playing a lot with overly, token hungry, parser issues 
of late, I inserted a couple of texture ID declares smack in the middle 
of the triangle definition in a scene posted to this newsgroup just 
prior. BOOM, CRASH, BANG!!! There too semicolons are absolutely 
necessary for the parser to not get confused, but the parser issues nary 
a word on the actual problem.

Once it is overeating tokens and confused, we can get all sorts of odd 
error / warning messages depending on what SDL follows those 
definitions. Anything from not a peep to whatever. It depends on what 
tokens end up getting eaten and what remains once the parser rights itself.

The overeating condition has too the bad side effect of, occasionally, 
eating warnings and errors the parser code actually did try to issue.

The problem is there all the way back to v3.7 at least - and it looks to 
be a lot more of a general problem than I thought. Guess I've mostly 
missed this 'elephant in the room' issue.

My habit is to pre-declare almost everything as IDs (sometimes as 
macros) in a stand alone / non-mingled way. Thereafter I reference IDs 
while building larger things, which often are assigned to IDs too.

Suppose people who inline most everything as raw SDL code will mostly be 
OK too - will avoid the overeating.

On typos / mistakes, though, we are all exposed confusing results or 
feedback from the parser when it gets overly token hungry. :-(

Having just implemented better vector related checking for lack of 
semicolons, I think a general solution is unlikely in any v3.8 offering 
- but I'll let the thought bounce around a while.

We should be sure we don't carry this issue to v4.0 in any case!

Bill P.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.