POV-Ray : Newsgroups : povray.programming : Why there are no mesh creation functions? : Re: Why parse.c so big Server Time
28 Jul 2024 14:24:13 EDT (-0400)
  Re: Why parse.c so big  
From: Jérôme Grimbert
Date: 8 Dec 2000 09:26:55
Message: <3A30EFBA.AE33139@atos-group.com>
Warp wrote:

> <extrawhine>
> 
>   Why parse.c is so long?
>   11970 lines of code in one C-file is just a bit too much. Trying to find
> something there is like trying to find a needle in a haystack.

You can find it if you know what you're looking for...


>   I thought that the POV-Ray source code was well-done and very modular,
> but it seems that I was mistaken.

It is modular, at least for the objects. But the parser lakes this
modularity. It may have help modularity if the syntax of each object
had been specified with the object functions, but that would 
have required a meta-parser from the very beginning...
That's not impossible, but remember that povray starts with
only a few objects (box, sphere, untruncated cone, cylinder, light,
camera, plane and maybe some CSG). And that was a long time ago.

On the side note, a description of each object syntax for a meta-parser
would probably have help to write an accurate documentation.
(Quick Quizz : does the lathe AND the sor both support the sturm keyword ?)


>   Now I really understand the need for a complete rewrite. Studying the code
> makes the reason very clear.

At least the parser (parse.c and parstxtr.c are far too big & complex),
and there is too much things kept for compatibility with older versions too !

> 
> </extrawhine>
>


Post a reply to this message

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