|
|
Am 08.01.2011 22:29, schrieb Robert Baer:
> Let's see if i can say this correctly.
> Start in .POV and an object is named.
> The program "looks" to see if it is / has been defined in .POV and if not,
> scans the .INC files.
> If found in<workingname>.INC then the contents get copied (acts as if one had
> a very long file) and then run.
Not exactly. Things work as follows:
- You give POV-Ray a POV file to render.
- POV-Ray works through it line by line, doing what each line says.
- If POV-Ray encounters an #include "FILENAME", it remembers the current
line in the current file, then works through FILENAME, again line by
line, doing what each line says.
- When done with FILENAME, POV-Ray continues with the main file.
- When encountering a "#define IDENTIFIER = ...", POV-Ray generates the
following object, texture or whatever, but instead of adding it to the
scene it just remembers it, under the name IDENTIFIER.
- When encountering a "object { IDENTIFIER }", "texture { IDENTIFIER }"
or whatever, POV-Ray inserts there whatever it remembered under that
name. If it didn't encounter a fitting "#define IDENTIFIER" before, it
will simply complain.
- When encountering a "#macro IDENTIFIER(...)" statement, POV-Ray will
/not/ parse the macro; instead, it will just remember the file and
position where it encountered it, then skip to the matching #end.
- When encountering "IDENTIFIER(...)", POV-Ray will jump to the
remembered file and position, then work through whatever the macro says,
until it hits the matching #end. Provided that it had encountered
"#macro IDENTIFIER(...)" already, otherwise it will simply complain again.
Thus, whatever you use in POV-Ray, you must #define it (or "#macro" it)
/before/ using it.
> In my case, the .INC file had an un-matched #if..#end so when the program
> continued (effectively "went back" to the .POV file) it did not find a matching
> #end and so complained about finding an EOF.
Yup.
> Now, i think that the program actually does all of the work as it scans thru
> all of the pertinent files, and saves the results in some ?hidden? temp area
> until done (error or not).
> Then, if error, the appropriate line(s) and file name are used for the message
> file - and all results are then scratched / released / erased.
> If no error, one gets all if the neat picture(s), etc.
Nope. As soon as POV-Ray /recognizes/ an error, it stops parsing
immediately, and spits out the file name and line of wherever it is
currently working. The problem with missing #end statements however is
that POV-Ray does not recognize the error until it hits the EOF of the
main file.
Post a reply to this message
|
|