POV-Ray : Newsgroups : povray.programming : How does parser.cpp/parstxtr.cpp work? : Re: How does parser.cpp/parstxtr.cpp work? Server Time
28 Jul 2024 06:17:40 EDT (-0400)
  Re: How does parser.cpp/parstxtr.cpp work?  
From: Christopher James Huff
Date: 21 Oct 2002 13:47:50
Message: <chrishuff-E24E4F.13430621102002@netplex.aussie.org>
In article <3db438cb@news.povray.org>, jan### [at] lzernet wrote:

> Can someone please explain to me, or point me to a direction/documentation,
> how the parser works?

You don't start with the small questions, do you... ;-)


> Its quite hard for an C novice to understand the inner working of the parser
> with all these marcros and definitions...

Mainly, look at existing code for features that do something similar to 
what you want, and imitate what you see.


> Or simply help me with my current prob?

That would be a lot easier.


> Returning the float works ok, so far, but as this started as a copy of a 
> brick-pattern, I can't apply a colormap. I assume the appropriate code lies
> in the parser. Can someone tell me, where which token has how to be added?

Hmm...POV uses the position of the pattern ID in PATTERN_IDS (in 
pattern.h) to tell block patterns from other patterns, so make sure you 
put it with the "ordinary" patterns. The blend map stuff is handled 
automatically. If you had it working right as a block pattern, you 
probably added some code to the blend map parsing code that you need to 
remove now...block patterns are actually more complex then float 
patterns.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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