POV-Ray : Newsgroups : povray.general : Any way to avoid repeated parsing? : Re: Any way to avoid repeated parsing? Server Time
11 Aug 2024 11:15:05 EDT (-0400)
  Re: Any way to avoid repeated parsing?  
From: PoD
Date: 21 Sep 1999 17:53:00
Message: <37E7FF5D.BBBFA77A@merlin.net.au>
I'm beginning to think that #static as a type of #declare would be more
feasible, after all it is only usefull for things which take a long time
to parse such as complex unions and meshes.

When parsing a #static declaration, check if the name is already in the
symbol table.  If it is then skip to the end of the declaration.

How do you know what's the end of the declaration?
Firstly all declarations should end with a semi colon.  Then each
[#declare|#local|#static] would match up with a semi colon.

#static ST = union{
  #declare A=0;#while(A<360)
    sphere{x*10,1 rotate y*A}
    #declare A=A+12;#end
  }; <- this semicolon marks the end of the #static declaration.

#undef works on #statics the same as #declares
e.g. #if(clock = 0.5) #undef ST #end

Any how, just an idea.
Cheers, PoD.


Post a reply to this message

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