Unlock instant, AI-driven research and patent intelligence for your innovation.

C language code dependency relationship extraction method based on static analysis

A technology of dependency relationship and static analysis, applied in the field of computer technology and software engineering, can solve the problems of complex, unsupported package concept, insufficient dependency analysis work, etc., to achieve the effect of great utilization value and broad application prospects

Active Publication Date: 2021-08-31
NANJING UNIV
View PDF9 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, because it is designed with complex macros and does not support the concept of packages, it brings certain challenges to dependency analysis, and the related dependency analysis work for C language code is even more insufficient.

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
  • C language code dependency relationship extraction method based on static analysis
  • C language code dependency relationship extraction method based on static analysis
  • C language code dependency relationship extraction method based on static analysis

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0045] In order to explain in detail the technical content, structural features, achieved goals and effects of the technical solution, the following will be described in detail in conjunction with specific embodiments and accompanying drawings.

[0046] The flow chart of the static analysis-based C language code dependency extraction method provided according to the embodiment of the method is as follows: figure 1 , the process has the following steps:

[0047] Step (1): import a C language source code file, carry out static analysis to the source code in this file, obtain the information of each macro instruction and the information of each variable, function, type, the concrete C language description of embodiment is:

[0048]

[0049]

[0050] Where main.c is the input source code file, h1.h and h2.h are the header files included in the input file, and lib.c is the library file included in the compilation instruction corresponding to the input file.

[0051] It shoul...

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 discloses a C language code dependency relationship extraction method based on static analysis, which comprises the following steps of: performing static analysis on a C language source code to obtain information of each macro instruction and information of each variable, function and type; for each macro instruction, extracting a dependency relationship generated by the macro instruction based on the macro instruction information; for each variable, extracting a dependency relationship generated by the variable based on each piece of variable information; for each function, extracting a dependency relationship generated by the function based on each piece of function information; for each type, extracting a dependency relationship generated by the type based on the type information; extracting a dependency relationship of a file level based on the dependency relationship of the symbol level; carrying out persistence on the extracted dependency relationship. According to the method, a more comprehensive, more accurate and multi-level dependency relationship is extracted from a C language source code.

Description

technical field [0001] The invention relates to the fields of computer technology and software engineering, in particular to a static analysis-based method for extracting dependencies of C language codes. Background technique [0002] With the development of modern software technology, the scale of software projects tends to be large, the coupling relationship between files and modules tends to be complicated, and the threshold of traditional experience-based software architecture design methods is getting higher and higher. Therefore, it is more and more important to automatically perform static analysis on the code and extract the multi-level dependencies of software projects. At the same time, the dependencies of software projects are also the underlying supporting data necessary to implement functions such as architecture analysis and software refactoring. [0003] At the same time, the existing static analysis work usually focuses on specific requirements and focuses o...

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/41G06F8/36
CPCG06F8/433G06F8/437G06F8/36Y02D10/00
Inventor 张天彭彦鑫
Owner NANJING UNIV