Pattern matching mechanisms based on regular expressions feature in a number of recent languages for processing XML. The flexibility of these mechanisms demands novel approaches to the familiar problems of pattern-match compilation—how to minimize the number of tests performed during pattern matching while keeping the size of the output code small. We describe work in progress on a compilation method based on matching automata, a form of tree automata specialized for pattern compilation [9], in which we use the schema of the value flowing into a pattern matching expression to generate more efficient target code.
Michael Y. Levin, Benjamin C. Pierce