arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2204.01028cs.SE
收藏

MSCCD:基于ANTLR解析器生成的语法可插入克隆检测

MSCCD: Grammar Pluggable Clone Detection Based on ANTLR Parser Generation

Wenqing Zhu, Norihiro Yoshida, Toshihiro Kamiya, Eunjong Choi, Hiroaki Takada

摘要:

由于各种原因,程序设计语言继续繁殖和发展。有必要拥有一个多语言的克隆检测工具,可以很容易地扩展支持的程序设计语言和检测各种代码克隆是必要的。然而,多语言代码克隆检测的研究还没有得到足够的重视。在这项研究中,我们提出了MSCCD(多语言语法代码克隆检测器),语法插入代码克隆检测工具,使用解析器生成器生成一个代码块提取器的目标语言。然后,提取器从解析树中提取语义代码块。MSCCD可以检测不同粒度的3型克隆。我们评估MSCCD的语言扩展性MSCCD应用到20种现代语言。16种语言得到了完美的支持,其余4种语言也提供了相同的检测功能,但牺牲了执行时间。我们使用BigCloneEval评估了MSCCD的召回率,并进行了手动实验来评估精度。MSCCD实现了与最先进工具相当的检测性能。

英文摘要:

For various reasons, programming languages continue to multiply and evolve. It has become necessary to have a multilingual clone detection tool that can easily expand supported programming languages and detect various code clones is needed. However, research on multilingual code clone detection has not received sufficient attention. In this study, we propose MSCCD (Multilingual Syntactic Code Clone Detector), a grammar pluggable code clone detection tool that uses a parser generator to generate a code block extractor for the target language. The extractor then extracts the semantic code blocks from a parse tree. MSCCD can detect Type-3 clones at various granularities. We evaluated MSCCD's language extensibility by applying MSCCD to 20 modern languages. Sixteen languages were perfectly supported, and the remaining four were provided with the same detection capabilities at the expense of execution time. We evaluated MSCCD's recall by using BigCloneEval and conducted a manual experiment to evaluate precision. MSCCD achieved equivalent detection performance equivalent to state-of-the-art tools.

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

↑