Kotlin / kotlin-spec

Kotlin Language Specification:
https://kotlinlang.org/spec
Apache License 2.0
387 stars 80 forks source link

How does this grammar file generate the PSI layer of Kotlin source code? #120

Open Terrency opened 1 year ago

Terrency commented 1 year ago

Does this grammar file have no relationship with the PSI layer of Kotlin source code anymore?

ice-phoenix commented 1 year ago

Hi mate! It was never the intention to have any kind of relationship between the ANTLR grammar and the Kotlin PSI. What are your reasons for wanting this?

Terrency commented 1 year ago

Hi Ice, It's great to receive your response. As I have been going through the Kotlin source code, I noticed that it only includes Flex, but there is no BNF syntax section. So when I came across the ANTLR grammar portion here, I was curious about how Kotlin generates the PSI layer code. I wondered if ANTLR's grammar could be used to automatically generate the PSI.