arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2103.12778cs.SEcs.LG
收藏

PSIMiner:一个从代码中挖掘富抽象树的工具

PSIMiner: A Tool for Mining Rich Abstract Syntax Trees from Code

JetBrains Research(JetBrains研究院);Higher School of Economics(高等经济学院);JetBrains N.V.;Saint Petersburg State University(圣彼得堡国立大学)

Egor Spirin, Egor Bogomolov, Vladimir Kovalenko, Timofey Bryksin

摘要:

机器学习算法在源代码中的应用在过去几年中已经增长。由于这些算法对输入数据非常敏感,因此研究人员对输入表示进行实验也就不足为奇了。现在,表示代码的一个流行的起点是抽象语法树(AST)。抽象语法树已经在各种软件工程领域,特别是在IDE中使用了很长时间。现代IDE的API允许操作和遍历AST,解析代码元素之间的引用等。这些算法可以用新数据丰富AST,因此在基于ML的代码分析中可能很有用。在这项工作中,我们提出了PSIMiner-一个工具,用于处理来自IntelliJ平台的PSI树。PSI树包含代码语法树以及与它们一起工作的函数,因此可以使用现代IDE的静态分析算法来丰富代码表示。为了展示这个想法,我们使用我们的工具来推断Java AST中的标识符类型,并扩展了code2seq模型的方法名称预测问题。

英文摘要:

The application of machine learning algorithms to source code has grown in the past years. Since these algorithms are quite sensitive to input data, it is not surprising that researchers experiment with input representations. Nowadays, a popular starting point to represent code is abstract syntax trees (ASTs). Abstract syntax trees have been used for a long time in various software engineering domains, and in particular in IDEs. The API of modern IDEs allows to manipulate and traverse ASTs, resolve references between code elements, etc. Such algorithms can enrich ASTs with new data and therefore may be useful in ML-based code analysis. In this work, we present PSIMiner - a tool for processing PSI trees from the IntelliJ Platform. PSI trees contain code syntax trees as well as functions to work with them, and therefore can be used to enrich code representation using static analysis algorithms of modern IDEs. To showcase this idea, we use our tool to infer types of identifiers in Java ASTs and extend the code2seq model for the method name prediction problem.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑