Code clone detection method and application based on abstract syntax tree and token
An abstract syntax tree and token technology, applied in code compilation, program code conversion, unstructured text data retrieval, etc., to achieve the effects of narrowing the candidate range, improving accuracy, and improving judgment efficiency
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0032] like figure 1 As shown, a method for code clone detection based on an abstract syntax tree and a token in an embodiment of the present invention is introduced, and the method includes the following steps.
[0033] In step S101, all codes are parsed into tokens and abstract syntax trees.
[0034] Split all code into function-based code blocks, number each code block, calculate the corresponding hash value; parse the token and abstract syntax tree of each code block; and calculate the token corresponding to the code block and token frequency, and calculate the height and width of the abstract syntax tree corresponding to the code block.
[0035] In step S102, code blocks that are not code clones are filtered out by tokens, and candidate blocks that have the same type of code clones as the query block are filtered out by an abstract syntax tree.
[0036] According to the degree of similarity of code clones, code clones are generally divided into 4 types, namely identical...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com