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

Annotation processing method, device and equipment and computer readable storage medium

A processing method and annotation technology, applied in the computer field, can solve problems such as error-prone, time-consuming and labor-consuming, and achieve the effect of protecting safety and improving maintainability

Pending Publication Date: 2019-09-06
ZTE CORP
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] In view of this, the purpose of the present invention is to provide a comment processing method, device and equipment, and a computer-readable storage medium to solve the problem of time-consuming, labor-intensive and error-prone problems in the prior art that manually process code comments

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
  • Annotation processing method, device and equipment and computer readable storage medium
  • Annotation processing method, device and equipment and computer readable storage medium
  • Annotation processing method, device and equipment and computer readable storage medium

Examples

Experimental program
Comparison scheme
Effect test

no. 1 example

[0026] like figure 1 As shown, the first embodiment of the present invention provides an annotation processing method, which includes the steps of:

[0027] S11. Perform lexical analysis on the code of the source file to obtain a mark symbol.

[0028] In this embodiment, the code of the source file is scanned, and the character string sequences of the source code are spelled out one by one through lexical analysis, and converted into tokens.

[0029] In this embodiment, the code of the source file may use various programming languages, including but not limited to C, C++, Java, Python, and the like.

[0030] S12. Perform grammatical analysis according to the markup symbol to determine whether the markup symbol is a note.

[0031] In this embodiment, the grammatical structure of the program is determined according to the notation, and then it is determined whether the notation is a comment.

[0032] S13. If the mark symbol is a comment, process the comment.

[0033] In this...

no. 2 example

[0057] like figure 2As shown, the second embodiment of the present invention provides an annotation processing device, which includes a lexical analysis module 21, a syntax analysis module 22, and an annotation processing module 23;

[0058] The lexical analysis module 21 is configured to perform lexical analysis on the code of the source file to obtain mark symbols.

[0059] In this embodiment, the lexical analysis module 21 scans the code of the source file, spells out words one by one from the string sequence of the source code through lexical analysis, and converts them into tokens.

[0060] In this embodiment, the code of the source file may use various programming languages, including but not limited to C, C++, Java, Python, and the like.

[0061] The grammatical analysis module 22 is configured to perform grammatical analysis according to the marked symbols to determine whether the marked symbols are comments.

[0062] In this embodiment, the syntax analysis module 2...

no. 3 example

[0090] like Figure 7 As shown, the third embodiment of the present invention provides an annotation processing device, which includes: a memory 31, a processor 32, and an annotation processing program stored in the memory 31 and operable on the processor 32, When the annotation processing program is executed by the processor 32, it is used to implement the following steps of the annotation processing method:

[0091] Perform lexical analysis on the code of the source file to obtain markup symbols;

[0092] Carrying out grammatical analysis according to the mark symbol to determine whether the mark symbol is a comment;

[0093] If the mark symbol is a comment, then process the comment.

[0094] When the annotation processing program is executed by the processor 32, it is also used to implement the steps of the annotation processing method described below:

[0095] Performing desensitization processing on the annotations to obtain desensitized annotations;

[0096] Writing ...

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 an annotation processing method, device and equipment and a computer readable storage medium, and the method comprises the steps: carrying out the lexical analysis of a code ofa source file, and obtaining a mark symbol; performing grammatical analysis according to the mark symbols, and determining whether the mark symbols are annotations or not; and if the mark symbol is an annotation, processing the annotation. In the mthod, lexical and grammatical analysis are performed on codes of a source file, annotations are determined and processed, the problems that in the prior art, a manual mode is adopted for processing code annotations, time and labor are consumed, and errors are likely to happen are solved. The security of the code is protected, and the maintainabilityof the code is improved.

Description

technical field [0001] The present invention relates to the field of computer technology, in particular to an annotation processing method, device and equipment, and a computer-readable storage medium. Background technique [0002] Code comments are non-executable text strings in program codes, which can be used to describe complex calculations or explain programming methods. They are a communication bridge between program designers and program readers, and are also one of the important links in program code maintainability. [0003] In a multinational software project, product development teams may be distributed in various countries, and different countries use different working languages, which brings about a problem of software maintenance: code comments may be written by developers in a certain country using their native language, and written by developers in other countries. people cannot understand without a translator. [0004] In addition, in some scenarios, the co...

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): G06F17/24G06F17/27
CPCG06F40/169G06F40/253
Inventor 牛家浩
Owner ZTE CORP