In this paper, we present Lupa - a framework for large-scale analysis of the programming language usage. Lupa is a command line tool that uses the power of the IntelliJ Platform under the hood, which gives it access to powerful static analysis tools used in modern IDEs. The tool supports custom analyzers that process the rich concrete syntax tree of the code and can calculate its various features: the presence of entities, their dependencies, definition-usage chains, etc. Currently, Lupa supports analyzing Python and Kotlin, but can be extended to other languages supported by IntelliJ-based IDEs. We explain the internals of the tool, show how it can be extended and customized, and describe an example analysis that we carried out with its help: analyzing the syntax of ranges in Kotlin.
翻译:在本文中,我们介绍卢巴语(Lupa),这是一个大规模分析编程语言使用的框架。卢巴语是一个使用Intellij平台在引擎盖下的力量的指令行工具,它使得它能够获得现代IDES中所使用的强大的静态分析工具。该工具支持处理该代码中丰富的混凝土语法树并能计算其各种特征的定制分析师:实体的存在、其依赖性、定义-使用链等。目前,卢巴语支持分析皮顿语和科特林语,但可以推广到基于IntelliJ的IDES支持的其他语言。我们解释了该工具的内部,展示了如何扩展和定制该工具,并描述了我们在其帮助下进行的一个示例分析:分析科特林地区范围的语法。