Skiba <abx### [at] babilon org> wrote:
> As I remember text output of function parser - there were some kind of float
> variables/registers/stack entries. I though that every such float has
> dictionary feature (similiar to dictionary used gif coding) where every float
> has preprocessed string (without whitespaces) with syntax used to build this
> expression. So when new expression is calculated then it is verified with
> dictionary and use reference to ready float. But my imagination was probably
> far from implementation so forget it.
Sadly, it isn't that simple. The internal representation is a tree so finding
a subexpression would require to compare every possible subtree of the
function with every other possible subtree. This task gets very complex
quickly. That is why there is usually an intermediate representation more
suitable for this "kind of pattern matching" in advanced compilers.
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trf de
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|