|
|
In article <38cc2ddc$1@news.povray.org>, "Johannes Hubert"
<jht### [at] mailacom> wrote:
> No, what I mean is this: Don't interfere with the POV-parser at all,
> just at the very first function call, where the POV-parser is initially
> called:
> Here, insert a call to your own parser code which pre-translates the
> code it reads from the input file *before* passing it to the standard
> POV-parser.
> For this, you can leave the POV-parser totally alone.
> This is also why I mean that blending C and C++ isn't too hard: Between
> your code and the rest of the POV code there would be only one single
> function call to a global function in your module, which is passed the
> current script as a parameter, and which returns the same script, but
> with all CSDL blocks replaced by their POV equivalents.
Ah, I see what you mean now. My module would be called whenever a source
file is opened. It would probably be possible to cache the translated
files in case one is included multiple times(per parse, that is. I don't
think caching from render to render would be easy.), so it doesn't have
to be translated for every time it is included.
> Probably the best step is to do a separate tool like you are planning
> now, and see how it gets accepted. If people like it, integrating it
> into a POV patch (the mega-patch?) would be a great idea, I think.
Yes, that sounds like what I have been thinking of.
> This is an interesting project. I would be happy to offer any help I can
> give (both in the language design and/or programming).
I will post a "concept sketch" of the language design in a few minutes.
It is incomplete, but should give an idea of what I am thinking.
I have never written a parser before, so that might be a little
difficult(well, a simple keyword-value thing, but that doesn't really
count). But I guess I have to learn sometime... :-)
I do have a couple ideas about parsing the language, I think it would be
easiest to parse the scene into a data structure and then have the data
structure output the POV code for each scene element.
--
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/
Post a reply to this message
|
|