Join Slack
Powered by
Anyone here got experience with a Kotlin parser, s...
# server
a
Albert
06/19/2018, 1:55 PM
Anyone here got experience with a Kotlin parser, similar what JavaParser does for Java?
g
Gary Tierney
06/19/2018, 2:08 PM
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
Albert
06/19/2018, 2:15 PM
Thanks
@Gary Tierney
I will take a look at that
a
André L. Santos
04/26/2024, 1:41 PM
this thread is from 6 years ago… any news here? a JavaParser’s counter part could be really useful
g
Gary Tierney
04/29/2024, 3:42 AM
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
7
Views
Open in Slack
Previous
Next