Patent ID: 7043720

Claim:
A computer implemented method for transforming a simple statement into a compound statement, comprising: identifying, using a lexical analyzer, one or more tokens in a set of source code; creating a syntax tree from the one or more tokens; identifying, from the syntax tree, one or more potential statements for a particular simple statement by: (a) identifying a particular standalone statement, in the particular simple statement, that is the last standalone statement, and setting the last standalone statement as a current standalone statement, and (b) processing the particular simple statement backwards from the current standalone statement by iteratively applying a conditional statement that precedes the current standalone statement in the set of source code to identify a new current standalone statement until all potential statements in the particular simple statement are identified, wherein each potential statement, of the one or more potential statements, is to be rendered on a separate line; creating a tree of blocks for the one or more potential statements, wherein the tree of blocks identifies block levels associated with each of the one or more potential statements; creating an intermediate textual representation from the tree of blocks, wherein an indentation level is associated with each of the one or more potential statements and each of the indentation levels is derived from the block level; and inserting begin and end block indicators into the intermediate textual representation to create a compound statement.