Font Size: a A A

Design And Implementation Of The Source Code Analysis Tool Via Makefile

Posted on:2017-04-06Degree:MasterType:Thesis
Country:ChinaCandidate:F W GuFull Text:PDF
GTID:2308330488978391Subject:Computer Science and Technology
Abstract/Summary:PDF Full Text Request
Analysis technology of source code is very important in the field of software testing, systems analysis and software development. In recent years, there are so many tools in source code analysis, and they provide great convenience for the people. However, for source code organized by makefile, due to its dependency rules are defined in the makefile, many problems appeared in the process of analysis. These problems are mainly caused by definition confusion. In this paper, based on the static analysis, the solution was presented by locating the definition, taking advantage of the dependency rules of files, so as to the positioning accuracy was improved.The main contents and innovations are concluded as follows:1. Based on the use and analysis of the current main source analyzing tools, summed up the problems that current tools temporarily cannot solve, and then to analyze them:The called symbols are defined under the different files with the same name and the return type that caused confusion etc.2. Use the makefile file dependencies to determine the search scope in the process of analyzing the source code. First extracting from the file dependency information and generating an index query structure, then we can obtain dependent file list of a certain file. To confirm the search file scope, the called symbols can be fined. Then we can get more accurate positioning for information.3. Research the compiler front-end internal implementation, exactly the process of lexical analysis and syntax analysis in compilation system to obtain the middle of the code corresponding to the source code. With traversing and analyzing the abstract syntax tree structure, we turned the middle code into the searchable index structure. These information indexes can improve the positioning accuracy of source analysis.4. The source analysis tool is realized based on the above two part works. Using the dependent indexes structure we can determine the search scope, then the symbol definition information can be determined. The system solved the problems caused by definition confusion, which improve the accuracy of the source code analysis.
Keywords/Search Tags:source code analysis, abstract syntax tree, makefile, file-based dependency
PDF Full Text Request
Related items