fkling / astexplorer

A web tool to explore the ASTs generated by various parsers.
https://astexplorer.net/
MIT License
6.13k stars 729 forks source link

Support for Kotlin language #317

Open sarod opened 6 years ago

sarod commented 6 years ago

It would be nice to support Kotlin language.

Not sure if this would help but there is an antlr grammar available here: https://github.com/antlr/grammars-v4/tree/master/kotlin.

Thanks for this wonderful project. It is very useful to discover new language syntax.

fkling commented 6 years ago

The more languages the better 😃 Eventually I want astexplorer to support server side languages (and actually run on them on server). I haven't thought to much about it yet though.

madhead commented 4 years ago

Probably the other way to parse Kotlin is to use IntelliJ's PSI / Kotlin compiler API like it is done in detekt (static Kotlin analyzer): https://github.com/arturbosch/detekt/blob/master/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/KtCompiler.kt

zhirzh commented 3 years ago

Probably the other way to parse Kotlin is to use IntelliJ's PSI / Kotlin compiler API like it is done in detekt (static Kotlin analyzer): https://github.com/arturbosch/detekt/blob/master/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/KtCompiler.kt

new url: https://github.com/detekt/detekt/blob/main/detekt-parser/src/main/kotlin/io/github/detekt/parser/KtCompiler.kt

RReverser commented 3 years ago

If that project can be compiled with Kotlin/Native, then it should be possible to compile it to Wasm and integrate just like we already integrate Rust parsing.