Skip to content

shadrina/kotlin-grammar-antlr4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kotlin ANTLR4 grammar

The project is no longer supported. Please refer to the Kotlin Language Specification to get the most relevant Kotlin grammar version.

Project description

ANTLR4 grammar for Kotlin written only in ANTLR's special syntax. Developed to facilitate the implementation of the language in other projects.

The primary files are in the grammars folder:

  • KotlinParser.g4 - parser rules
  • KotlinLexer.g4 - lexer rules
  • UnicodeClasses.g4 - lexer grammar containing made Unicode classes from the source

Lexer and parser grammars are divided for the use of lexer modes.

Issues and limitations

All issues are described in TODO.txt.

Testing

After generating lexer and parser with ANTLR4 tool you can test the grammar running testing\Test.java. Test data can be taken from the JetBrains's repo.
Some other usages of generated files are in the examples folder.

Links

License

Licensed under the Apache 2.0

Contacts

Anastasiya Shadrina [email protected]

About

Kotlin grammar written for ANTLR v4

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages