← works
2019 · Program Analysis · C · AST

c2Spoon

Maps the XML representation of a C program onto the Java AST used by Spoon.

The problem

Spoon’s rich analysis and transformation API is powerful, but it only understands Java.

The approach

c2Spoon maps a C program’s XML representation onto the Spoon model, so the same querying and rewriting tooling can be reused on C code.

In practice

It extends a mature Java analysis toolchain to a second language through a shared AST.

Highlights

  • Maps C (XML) onto the Spoon AST
  • Reuse Spoon analyses and transforms on C
  • A practical cross-language AST bridge