Patent ID: 8806452

Claim:
A method for transforming a first computer program having a plurality of program statements to a second computer program, said method comprising: parsing, by one or more processors, each program statement in the first computer program, wherein said parsing comprises: (i) identifying, in the first computer program, a first program statement that includes a first error and has thrown a parsing exception with respect to the first error prior to said parsing, and (ii) replacing the first program statement by a predefined program statement that is an executable equivalent program statement to the first program statement and can be parsed without throwing any parsing exception; translating, by the one or more processors, the parsed first computer program to the second computer program, wherein said translating comprises: (i) identifying a second program statement in the parsed first computer program that includes a second error and has thrown a translation exception with respect to the second error prior to said translating, (ii) rolling back said translating to a predefined check point prior to the second program statement in the parsed first computer program such that the predefined check point is associated with a statement in the parsed first computer program that was successfully translated during said translating, and (iii) generating an executable equivalent translation for the second statement that does not throw a translation exception; and after said translating, generating, by the one or more processors, a mapping of one or more statements in the second computer program to one or more statements in the first computer program.