Patent Document ID: 6061513
Application ID: 08914314

Base Claim:
1. A method for constructing language specific reverse engineering systems for automatically extracting compressed ASTs with attributes, called Flexforms in the preferred embodiment, from arbitrary source code in a plurality of structured languages; wherein said method minimizes the need for human input and automates many difficult and key steps in the process, wherein each said language has a well defined grammar and lexical analyzer to which some general purpose parser generator can be applied to create a parser for source code written in said language; wherein the terminal nodes in said compressed ASTs contain statements, declarations and/or expressions in said source code and wherein the non-terminal nodes in said compressed ASTs correspond to higher level constructs in said code, said method comprising the steps of: a) receiving a grammar and lexical analyzer for said language and an associated language independent parser generator; b) one of receiving and constructing a set of programming commands sufficient for constructing said compressed AST representations of said source code in said language of step a; c) identifying constructs in said language of step a, including the allowable types of said compressed ASTs and the allowable sections and kinds of procedural refinements in each said type of compressed AST, that are to be represented as non-terminal nodes in said compressed AST; d) for each said construct of step c, identifying those right hand side tokens in specific productions in said grammar of step b that collectively comprise one of said construct and the name of said node representing said construct; e) for each said specific production in step d that corresponds to one said construct of step c, assigning commands from step b, which operate on nodes corresponding to said right side input tokens in said production and generate a node in said compressed AST that corresponds to that said construct; f) for each said specific production in said grammar of step a that does not correspond to any said construct of step c, assigning a default command which automatically decides whether to concatenate the contents of given nodes or to construct a subtree containing said nodes; and g) applying said general-purpose parser generator to the results of said steps e and step f.

---

Claim 8:
8. A method in accordance with claim 1, wherein said given grammar is a fraud grammar and wherein said method of claim 1 creates a reverse engineer for converting text in each terminal node of a compressed AST into a Flexform or statement-level AST.