POV-Ray : Newsgroups : povray.general : New SDL: support for lexical scanner generators : Re: New SDL: support for lexical scanner generators Server Time
31 Jul 2024 12:19:02 EDT (-0400)
  Re: New SDL: support for lexical scanner generators  
From: Nicolas Alvarez
Date: 5 Oct 2007 14:58:35
Message: <4706895b$1@news.povray.org>

> Darren New <dne### [at] sanrrcom> wrote:
> 
>> What the current POV calls "parsing" isn't what things like ANTLR do.
>> "Parsing" (in the non-POV sense) means building a data structure
>> isomorphic to the input source code. "Parsing" in the POV sense includes
>> things like executing the while loops, while in the ANTLR sense it does
>> not. So with a parser generator, you'd have three phases: parsing
>> (fast), evaluating (putting together all the objects in the scene), then
>> rendering (calculating pixel colors).
> 
> My point above was mainly concerned with how *OTHER* tools can *VALIDATE*
> any given SDL code, not with how POV-ray will parse a SDL.
> In my example I need a lexer for PovClipse telling me what's wrong with a
> given SDL. I do not need to care about how POV-ray will internally
> implement the step between the SDL token recognition and building the
> internal data structure.
> All I need to know is:
> * is the SDL valid
> * if not, where are the errors (missing braces, semicolons, misspellings...)
> 
> In order to archive this the best thing to have is a complete,
> programmatically usable sytactical grammar description which you can easily
> feed into tools like ANTLR.
> And in my opinion the one providing such a grammar description should be the
> one implementing it, thus POV-ray.
> 
> - Wolf
> 
> 

That's impossible to do with the current SDL syntax. Abusing macros and 
loops you could make the syntax change from valid to invalid depending 
on what frame number you're rendering. And the only way to test that is 
interpreting the whole scene code with the current parameters, which 
could very well take hours on some scenes with built-in physics 
simulations :)


Post a reply to this message

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