Anyone here got experience with a Kotlin parser, s...
# server
a
Anyone here got experience with a Kotlin parser, similar what JavaParser does for Java?
g
The best option for parsing and analysing Kotlin, I think, is using the actual parser: https://github.com/JetBrains/kotlin/blob/master/compiler/psi/src/org/jetbrains/kotlin/parsing/KotlinParser.java. ANTLR4 comes with a Kotlin grammar too, though there isn't anything to close to what JavaParser provides for Java.
a
Thanks @Gary Tierney I will take a look at that
a
this thread is from 6 years ago… any news here? a JavaParser’s counter part could be really useful
g
best to ask in a more language oriented channel as I don't keep up with the latest in kotlin parsing, but kotlin does now ship an antlr grammar as part of its spec https://github.com/Kotlin/kotlin-spec/blob/release/grammar/src/main/antlr/KotlinParser.g4