Is there an official library/api to manipularte A...
# compiler
Is there an official library/api to manipularte ASTs of Kotlin source, in a similar fashion as JavaParser does? (
Kotlin supports compiler plugins that gives you access to FIR, which is similar to the AST. You can generate more FIR with
, but I’m not sure about manipulating existing FIR. However, you can manipulate IR, which is the representation built from FIR.
What exactly are you trying to achieve?
thanks. one of the goals is to perform analysis of kotlin code using a reasonably high-level abstraction (like JavaParser)
For analysis only, I think you’re better off with PSI. You may check how detekt does it.
🙏 1
Check this video for more info:

apparently FIR is something close to what I was looking for