一句话:提出基于 Python 的 jAST 工具,生成并操作 Java 抽象语法树,支持源码级分析与变换。
在软件工程中,许多任务需要在抽象语法树(AST)层面分析和修改 Java 源码。现有 Java 专用工具多工作于字节码层,或与 Java 生态紧密耦合,灵活性和可访问性受限。本文提出 jAST:一个基于 Python 的工具,可为 Java 程序生成并操作 AST。它利用 Python 的简洁性与丰富生态,支持精确的源码级分析、与 Python 工作流无缝集成,并可用于调试特征提取和基于学习的失败分析等高级任务。jAST 以开源工具形式发布,为研究者、教育者和实践者提供可扩展的 Java AST 处理框架。
Analyzing and modifying source code at the Abstract Syntax Tree (AST) level is fundamental to numerous software engineering tasks, including program analysis, instrumentation, and transformation. While Java-specific tools exist, they often operate at the bytecode level or are tightly coupled to the Java ecosystem, limiting their flexibility and accessibility. In this paper, we present jAST, a Python-based tool that generates and manipulates ASTs for Java programs. By leveraging Python's simplicity and extensive ecosystem, jAST enables precise source-level analysis, seamless integration with Python workflows, and support for advanced tasks such as feature extraction for debugging and learning-based failure analysis. jAST is an open-source tool offering researchers, educators, and practitioners an extensible framework for working with Java ASTs.