Patent Document ID: 7913239
Application ID: 11075091
Patent Flag: 1

Claim One:
1. A method in a data processing system for pattern matching and expression transformation of intermediate language expression trees, the method comprising: defining a pattern using a generic pattern definition in a computer program, wherein the pattern comprise an assignment operator indicating a reference to a part of the pattern; responsive to detecting a match statement in the computer program, matching the pattern with an input expression, wherein the match statement includes a generic pattern definition, an input expression, and a compilation unit object, wherein the generic pattern definition is defined using a plurality of objects, wherein the generic pattern definition includes a unifiable variable and wherein the matching step comprises: determining if the unifiable variable is bound; if the unifiable variable is bound, comparing value of the unifiable variable to a value of the input expression; if the unifiable variable is not bound, binding the unifiable variable to a value of the input expression; and responsive to determining that a bound unifiable variable fails to match the input expression, backtracking to unbind the bound unifiable variable; determining an age of the unifiable variable, wherein the age indicates an order of binding; comparing the age to a predefined age barrier, wherein the age barrier indicates a point to which an algorithm backtracks; if the age is greater than the age barrier, unbinding the unifiable variable by resetting the value of the unifiable variable; and responsive to detecting a transform statement in the computer program, matching the pattern with an input expression, and generating an output expression further comprising: determining if the transform statement includes a derivation pattern, wherein the derivation pattern includes a derivation operator, a match pattern, and a generate pattern; if the transform statement does not include a derivation pattern, generating a copy of the input expression as an output expression; if the transform statement includes a derivation pattern, matching the input expression with the match pattern along with any grammatical objects; responsive to matching the input expression with the match pattern, generating an output expression for all grammatical objects using the generate pattern; if the transform statement includes a derivation pattern, generating an output expression from the matched pattern with a plurality of objects, wherein the plurality of objects are bound to the input expression during the matching step; determining if the transform statement indicates that flag and label information are managed by the pattern; if the transform statement indicates that flag and label information are managed by the pattern, passing the flag and label information to the generated pattern; providing an assignment operator that is used to create a reference by the pattern to a subset of the pattern, wherein a first portion of the pattern is a first particular pattern and a second portion of the pattern is a second particular pattern, and wherein the first portion and the second portion are included in the subset portion; using the assignment operator to define the pattern to unify with the first portion if the input expression is a first particular command; and using the assignment operator to define the pattern to unify with the second portion if the input expression is a second particular command.