Strumenta / antlr-kotlin

Support for Kotlin as a target for ANTLR 4
Apache License 2.0
221 stars 47 forks source link

Fix code generation by partially backporting ANTLR5 changes #167

Closed lppedd closed 6 months ago

lppedd commented 6 months ago

The main difference here is the use of @JvmField to avoid JVM-specific conflicts (while also avoiding JS name clashes), and the addition of ruleIndex to the reserved words.

ruleIndex has to be reserved as the generated code will already have such a property:

public open class MiniCalcFileContext : ParserRuleContext {
    override val ruleIndex: Int = Rules.MiniCalcFile
    ...

This should be merged before #166.
Closes: #162

ftomassetti commented 6 months ago

I will do a new release.

I think that some time in the near future we should move to 1.0, as this code seems performing well, pass all tests, and be used in production by several companies, so the current version number is deceitful