The tool converts Kotlin grammar in ANTLR format to text file or XML file for the Kotlin website.
Source grammar files are located in the Kotlin specification repository.
Generated grammar is used on the Kotlin website: https://kotlinlang.org/docs/reference/grammar.html
--xml
/--text
— target file format,-o
/--output
— path to output file (grammar.xml
orgrammar.txt
),-g
/--grammarFilesPath
— path to folder with grammar files (KotlinLexer.g4
,KotlinParser.g4
andUnicodeClasses.g4
).
The tool can be run using gradle (./gradlew run
) or IDE (run main
method with arguments).