Proceedings of the 2024 3rd International Conference on Engineering Management and Information Science (EMIS 2024)

Enhancing Code Completion with Round Splitting and Unique Traversal of Abstract Syntax Tree

Authors
Jiahao Li1, 2, Linbo Zhu2, *, Bowen Lv1, Jun Ding2
1AHU-IAI AI Joint Laboratory, Anhui University, Hefei, China
2Institute of Artificial Intelligence, Hefei Comprehensive National Science Center, Hefei, China
*Corresponding author. Email: lbzhu@iai.ustc.edu.cn
Corresponding Author
Linbo Zhu
Available Online 14 July 2024.
DOI
10.2991/978-94-6463-447-1_32How to use a DOI?
Keywords
code completion; abstract syntax tree; round-splitting algorithm; unique traversal algorithm
Abstract

Code completion is one of the crucial features of Integrated Development Environments, enhancing user coding efficiency by providing code suggestions. Research indicates that code completion methods based on Abstract Syntax Tree (AST) representations can extract rich syntax and structure information embedded in the code. However, the current processing of the AST often results in a significant loss of information. To address this, we have designed round-splitting and unique traversal algorithms to optimize the AST processing. The round-splitting algorithm achieves tree splitting with minimal disruption, preserving the structural information of the tree to the greatest extent. The unique traversal algorithm ensures a one-to-one mapping relationship between the tree and the sequence after traversal, thereby reducing information loss. We conducted experiments on benchmark datasets, demonstrating our algorithms’ effectiveness in the code completion task.

Copyright
© 2024 The Author(s)
Open Access
Open Access This chapter is licensed under the terms of the Creative Commons Attribution-NonCommercial 4.0 International License (http://creativecommons.org/licenses/by-nc/4.0/), which permits any noncommercial use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

Download article (PDF)

Volume Title
Proceedings of the 2024 3rd International Conference on Engineering Management and Information Science (EMIS 2024)
Series
Advances in Computer Science Research
Publication Date
14 July 2024
ISBN
978-94-6463-447-1
ISSN
2352-538X
DOI
10.2991/978-94-6463-447-1_32How to use a DOI?
Copyright
© 2024 The Author(s)
Open Access
Open Access This chapter is licensed under the terms of the Creative Commons Attribution-NonCommercial 4.0 International License (http://creativecommons.org/licenses/by-nc/4.0/), which permits any noncommercial use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

Cite this article

TY  - CONF
AU  - Jiahao Li
AU  - Linbo Zhu
AU  - Bowen Lv
AU  - Jun Ding
PY  - 2024
DA  - 2024/07/14
TI  - Enhancing Code Completion with Round Splitting and Unique Traversal of Abstract Syntax Tree
BT  - Proceedings of the 2024 3rd International Conference on Engineering Management and Information Science (EMIS 2024)
PB  - Atlantis Press
SP  - 291
EP  - 298
SN  - 2352-538X
UR  - https://doi.org/10.2991/978-94-6463-447-1_32
DO  - 10.2991/978-94-6463-447-1_32
ID  - Li2024
ER  -