Supercharge Your Innovation With Domain-Expert AI Agents!

Source code analysis method and system

An analysis method and source code technology, applied in software testing/debugging, etc., can solve problems such as inability to process Perl source code

Active Publication Date: 2012-04-25
CHINA INFORMATION TECH SECURITY EVALUATION CENT +1
View PDF5 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0014] Compared with the prior art, before using the syntax analyzer to parse the Perl language, the morphemes in the Perl source code are identified through preprocessing, and the user-defined morphemes are marked for labeling, so as to clarify that the above-mentioned user-defined morphemes are included in the code type, thereby converting the context-sensitive grammar in the Perl language into a context-free grammar, thereby enabling the grammatical analyzer in the prior art to be able to handle it, and overcoming the problem that the grammatical analyzer in the prior art cannot process the Perl source code

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
  • Source code analysis method and system
  • Source code analysis method and system
  • Source code analysis method and system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0017] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that, in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined arbitrarily with each other.

[0018] figure 1 A schematic flowchart of an embodiment of a source code parsing method provided by the present invention. figure 1 Embodiments of the methods shown include:

[0019] Step 11, before adopting syntax analyzer to analyze Perl source code, obtain the function information and variable information in the Perl source code, wherein said function information comprises system function and user-defined function, and said variable information comprises system variable And user-defined package variables and lexical variables;

[0020] Step 12, setting a corre...

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 source code analysis method and system. The method comprises the following steps: before analyzing a Perl source code by using a syntactic parser, acquiring function information and variable information in the Perl source code, wherein the function information comprises a system function and a user-defined function, and the variable information comprises system variables, and user-defined packet variables and lexical variables; respectively setting a corresponding prefix identifier for the user-defined function, and the user-defined packet variables and lexical variables; and in the Perl source code analysis process, if a morpheme determined according to the function information and symbol information is one of the user-defined function, and the user-defined packet variables and lexical variables, adding the corresponding prefix identifier before the morpheme to obtain a processed code, and using the processed code as a code to be analyzed by the syntactic analyzer.

Description

technical field [0001] The invention relates to the field of computer applications, in particular to a source code analysis method and system. Background technique [0002] With the increasing scale of software engineering, there are more and more source code files, and the calling relationship between source code files is also becoming more and more complicated. Relying solely on the compiler is not enough to find all the problems in the code. More and more developers use source code static analyzer tools as an effective supplement to the compiler to find and solve possible problems in the program, such as semantic errors, security defect etc. The general method is to input the source code into the source code static analysis front-end. First, the front-end processes the source code and converts the source code into a simplified intermediate code, and then sends it to the defect analysis module. defect. [0003] The basic process of traditional source code analysis front...

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
IPC IPC(8): G06F11/36
Inventor 吴世忠李守鹏郭涛时志伟王眉林张东升
Owner CHINA INFORMATION TECH SECURITY EVALUATION CENT
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More