An Improved Method of Static Analysis Tool Based on Code Replacement and Regular Expression
A static analysis tool and expression technology, applied in the field of computer programming, can solve the problems of ignoring wrong typing, high false negative rate, compiler detection, etc., to reduce false negative rate, improve accuracy, and reduce costs. Effect
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Examples
Embodiment Construction
[0018] Examples are given below to describe the present invention in detail.
[0019] Step (1), preprocessing
[0020] The main function of the preprocessing module is to preprocess the source code in the project file or project folder specified by the user, and generate intermediate code for syntax analysis.
[0021] The processing of the source code by the preprocessing module mainly includes four parts: traversing directories at all levels to obtain a list of files containing source code to be detected, combining header files and source code files, replacing auto-increment and auto-decrement operations, and performing macro definition preprocessing. The first of these steps is optional and only enabled if the input is a folder. An alternative to the third step is as follows:
[0022] i++=>((i=i+1)-1)
[0023] ++i=>(i=i+1)
[0024] i--=>((i=i-1)+1)
[0025] --i=>(i=i-1)
[0026] Take i++ replaced by ((i=i+1)-1) as an example, assuming i=3, i++ means to use i first, an...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More