Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

A control flow graph construction method for object-oriented programming

A control flow graph, object-oriented technology, applied in software design and other directions, can solve problems such as difficult migration, and achieve the effect of simple implementation and wide application

Active Publication Date: 2019-03-01
SOUTHEAST UNIV
View PDF2 Cites 5 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The existing research results mainly focus on the control flow analysis of structured syntax features and simple exception handling structures, and these research results are difficult to transfer to the construction of control flow graphs of object-oriented programs with complex exception handling structures.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A control flow graph construction method for object-oriented programming
  • A control flow graph construction method for object-oriented programming
  • A control flow graph construction method for object-oriented programming

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0074] For the convenience of description, suppose there is the following simplified source code example:

[0075] Table 1 example code

[0076]

[0077]

[0078] According to the calculation steps mentioned above, implement in turn:

[0079] Step 1: Analyze the corresponding abstract syntax tree according to the above code:

[0080] The source code in Table 1 contains three classes and an interface. ConStrategyA and ConStrategyB implement the Strategy interface, and the calPrice method in the Context class calls the discount method of the Strategy interface.

[0081] Step two build a class inheritance diagram based on the abstract syntax tree, such as image 3 Shown:

[0082] The abstract syntax tree of the source program contains three type declaration nodes, corresponding to image 3 The node name in. Parse the method declaration information contained in the type declaration to get image 3 The method information contained in the middle node. Further analyze the interface type infor...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a control flow graph construction method for object-oriented programming, which comprises the following steps: 1) constructing an abstract syntax tree according to a source code; 2) constructing a class inheritance relation graph base on an abstract syntax tree; 3) constructing a coarse-grained control flow sub-graph according to a sentence position relation as a method, andthen construct a fine-grained control flow sub-graph by utilizing node disassembly and a virtual finally node method; 4) analyzing that control flow of the exception throwing point and the nested exception handle structure by using the exception floating method; 5) parsing that method invocation information to construct a statement-based control flow diagram; 6) merging the set of statements thatdo not cause the program execution order to change to form a basic module, constructing a control flow graph based on the basic module. The construction method of the invention not only supports theanalysis of the influence of the polymorphic features on the control flow, but also supports the control flow analysis of the multi-layer nested exception handling structure.

Description

Technical field [0001] The invention relates to an object-oriented program control flow graph construction method, which belongs to the technical field of program static analysis. Background technique [0002] A control flow graph is an abstract representation of a process or program, which represents all the paths traversed during the execution of a program. For a certain process or program P, the four-tuple G=(N,E,Entry,Exit) is usually used to represent the control flow graph of P. Among them, N is a set of nodes, where the node contains two kinds of basic modules and simple statements. The former refers to a set of statements that do not change the execution order of the program, and the latter refers to each simple statement as a control flow node; E is A collection of edges, each edge is an ordered pair of nodes <ni,nj> , It represents the possible control transfer from ni to nj (that is, nj may be executed immediately after the statement ni is executed); Entry and E...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F8/20
CPCG06F8/20
Inventor 李必信朱玲媛
Owner SOUTHEAST UNIV
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products