We consider the problem of linear regular tree pattern matching and describ
e a new solution based on a bottom up technique. Current bottom up techniqu
es preprocess the patterns and construct a finite state tree pattern matchi
ng automaton for the purpose. Though matching time is linear in the size of
the subject tree, the size of the automaton can be exponential in the sum
of the sizes of all patterns. We show here that the problem can be cast as
a parsing problem for a context free language, and a solution that uses an
extension of the LR parsing technique can be devised. Though the size of th
e resulting pushdown automaton can be exponential in the pattern size in th
e worst case, there are problem instances for which exponential gains in su
ccinctness of representation are obtained. The technique has been successfu
lly applied to the problem of generation of an instruction selector in a co
mpiler back end. (C) 2000 Elsevier Science B.V. All rights reserved.