A metaprogramming library for analyzing and transforming Java source code via a well-designed AST.
Spoon is a metaprogramming library for analyzing and transforming Java source code. It parses Java files to build a complete abstract syntax tree (AST), enabling developers to inspect, modify, and transpile code programmatically. It solves the problem of automating complex code refactoring, analysis, and migration tasks.
Java developers and researchers working on static analysis, code transformation tools, refactoring engines, or academic program analysis projects.
Developers choose Spoon for its well-designed, sound AST model, powerful and intuitive API, and strong support for modern Java versions. Its focus on semantic equivalence and fast error detection makes it reliable for automated code manipulation.
Spoon is a metaprogramming library to analyze and transform Java source code. :spoon: is made with :heart:, :beers: and :sparkles:. It parses source files to build a well-designed AST with powerful analysis and transformation API.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Builds a sound and complete abstract syntax tree per design philosophy R2, ensuring accurate representation of Java source code for reliable analysis.
Supports Java versions up to 25 for source code analysis, allowing use with latest language features while handling older code, as stated in the key features.
Provides intuitive operators for code rewriting with validation checks, enabling safe modifications and fast error detection, per the feature list on semantic preservation.
Backed by INRIA and OW2 with academic citations and professional support options, ensuring reliability and community trust, as highlighted in the README.
Requires specific JDK versions to run (e.g., JDK 17 for Spoon 11.x), which can complicate setup for teams stuck on older Java environments, as noted in the getting started section.
Parsing and building a complete AST for large codebases can be slow and memory-intensive, making it less suitable for real-time or performance-critical applications.
Does not include out-of-the-box refactoring tools; developers must build custom transformations from scratch, increasing initial development effort.