POV-Ray : Newsgroups : povray.general : Parsed SDL Server Time
26 Dec 2024 13:16:39 EST (-0500)
  Parsed SDL (Message 1 to 4 of 4)  
From: POVMAN
Subject: Parsed SDL
Date: 1 Feb 2006 11:42:18
Message: <43e0e4ea$1@news.povray.org>
Hi,

Does anyone know of a way to see the  parsed SDL for a scene ( if it 
actually gets created at all ).  I know that the base SDL I've typed in gets 
parsed, and was wondering if POV-Ray engine internally generates an 
intermediate SDL file in memory.  If it does, I'd like to output it.

For instance, if I have a macro that generates 100 spheres, is there ever a 
version of the SDL that contains 100 sphere definitions?

-- 
#####-----#####-----#####
POV Tips and Hints at ...
http://povman.blogspot.com/


Post a reply to this message

From: Chambers
Subject: Re: Parsed SDL
Date: 1 Feb 2006 13:02:54
Message: <43e0f7ce$1@news.povray.org>
POVMAN wrote:
> For instance, if I have a macro that generates 100 spheres, is there ever a 
> version of the SDL that contains 100 sphere definitions?

No.  You're probably used to other programming languages (C++, for 
instance) that have a separate preprocessor and compiler.  In POV-Ray, 
SDL files get "compiled" at the same time as being "preprocessed".  So, 
macro substitution occurs as the file is being evaluated.

It would be simple (but tedious) to insert #debug statements into your 
code to let you know what's going on.  For instance, in your macro that 
generates 100 spheres, you could do:

#debug "Macro generating 100 spheres...\n"

-or-

#local c_x = str(sphere_center.x, 0, 0);
#local c_y = str(sphere_center.y, 0, 0);
#local c_z = str(sphere_center.z, 0, 0);
#debug concat("Macro generated sphere at ", c_x, ", ", c_y, ", ", c_z, "\n"


...Chambers


Post a reply to this message

From: POVMAN
Subject: Re: Parsed SDL
Date: 2 Feb 2006 05:16:26
Message: <43e1dbfa@news.povray.org>
Thanks Chambers, good answer, not what I wanted to hear, but thanks anyway.

-- 
#####-----#####-----#####
POV Tips and Hints at ...
http://povman.blogspot.com/


Post a reply to this message

From: Warp
Subject: Re: Parsed SDL
Date: 2 Feb 2006 09:48:49
Message: <43e21bd1@news.povray.org>
POVMAN <s### [at] acom> wrote:
> Does anyone know of a way to see the  parsed SDL for a scene ( if it 
> actually gets created at all ).  I know that the base SDL I've typed in gets 
> parsed, and was wondering if POV-Ray engine internally generates an 
> intermediate SDL file in memory.  If it does, I'd like to output it.

  The current SDL parser is a very direct interpreter: It immediately acts
upon the commands it parses, without converting nor saving them anywhere.

  (The only exception are the user-defined functions, which use their own
separate parser and interpreter which works quite differently. There might
have been some obscure trick to get the byte-compiled functions printed,
but I don't remember at all how it might have been done... :P )

-- 
                                                          - Warp


Post a reply to this message

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