Abstract:In domestic and foreign research, using the computer to understand the program automatically is the focus. This paper, object-oriented program for the research, proposes object-oriented programming classes of information extraction rules. This method can extract the type of information from the program, then, represents these information by class diagrams, thus lays the bais for the computer to understand the program automatically. In this paper, we specify the rules for generating UML class diagrams, which include classes, attributes, operations, objects, relationships, inheritance, associations interfaces and so on. Finally, we introduce an application of the algorithm instance.