Matching templates against a tree - any ideas?

Ian Clarke I.Clarke at strs.co.uk
Wed Sep 22 10:44:31 EDT 1999


> you have a template and you want to match them against EVERY subtree 
> of a given tree, efficiently. 

Correct, but there will be multiple trees and multiple templates (I
mention this just in case some preprocessing or building of lookup
tables might be useful).

> Question: what happens if there is more than one overlapping match?

One of the possibilities is selected and returned as a match - it
doesn't matter [at this stage] which one [although that may change in
the future].
 
[...snip interesting parser idea...]

I would rather implement a solution from scratch instead of attempting
to reformulate the problem into that of parsing something.  Do you think
that you could provide an explanation of what one of the parsers you
describe would do - but in terms of the problem I described, rather than
in terms of parsing.

Cheers,

Ian.

-- 
"Don't throw your PC out the window, throw Windows out of
 your PC, and install Linux"
Ian Clarke                    http://www.gnu.demon.co.uk/




More information about the Python-list mailing list