Code syntax error repairing method based on incomplete abstract syntax tree

An abstract syntax tree and syntax error technology, which is applied in the cross-application field of deep learning and software engineering, and can solve problems such as insufficient use of code structure and semantic information, simplicity, and inability to accurately locate errors.

Inactive Publication Date: 2019-10-22
NANJING UNIV
View PDF4 Cites 5 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The current methods have the following problems: (1) the probability-based error localization method is too simple to accurately locate the error; (2) only treats the code as text, and does not make full use of the structure and semantic information of the code; (3) requires a large number of Heuristic rule-limited approach to repair

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
  • Code syntax error repairing method based on incomplete abstract syntax tree
  • Code syntax error repairing method based on incomplete abstract syntax tree
  • Code syntax error repairing method based on incomplete abstract syntax tree

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0107] In order to deepen the understanding of the present invention, the present invention will be further described below in conjunction with the accompanying drawings and embodiments, which are only used to explain the present invention and do not limit the protection scope of the present invention.

[0108] figure 1 It is a flowchart of a code syntax error repairing method based on an incomplete abstract syntax tree. First, the system generates an incomplete AST tree of the error code, encodes the code information according to the text and the AST tree, uses the neural network to predict the location of the grammatical error in the code and the content of the repair, restores and verifies the new code, and repeats iterative repairs until all are repaired Grammatical errors.

[0109] figure 2 A specific flowchart for generating an input sequence of code-based incomplete abstract syntax trees is described. We choose the PYCParser tool to compile the wrong C code....

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 code syntax error repairing method based on an incomplete abstract syntax tree. For code compilation errors, the method realizes positioning and error correction of the codecompilation errors. According to the method, incomplete AST information is utilized to construct an input sequence containing code structure information, and information between adjacent nodes is updated by using graph model propagation. The invention also provides a new error correction method. By predicting five kinds of information including an error starting position, an error ending position,whether copying is carried out or not, a copying position and a generated word, the method can modify and replace error codes with any length. Meanwhile, the method performs error correction based onan iterative mode, and can realize the repair of a plurality of errors in the code.

Description

technical field [0001] The invention relates to a method of using deep learning to construct a neural network based on code text and structure information, and a method for correcting code grammatical errors, which belongs to the cross-application field of deep learning and software engineering. Background technique [0002] Syntax errors refer to errors that are considered by the grammar detector to be inconsistent with the grammar rules of the programming language. Syntax errors are common errors encountered in program development, and some simple syntax errors are often covered up by misleading information generated by the compiler. These error messages make it difficult to locate grammatical errors, and also waste a lot of valuable time of programmers (especially novices). If grammatical errors can be accurately found and repaired automatically, development efficiency will be greatly improved, development costs will be reduced, and economic and social benefits will be b...

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): G06F8/41G06N3/04
CPCG06F8/42G06N3/04
Inventor李斐吴礼蔚吴优华刘峰郑滔
OwnerNANJING UNIV