sky 1c01e1de78 fork & optimize: 从github上获取官方源码,并进行了一些优化(不过不保证完全没问题) hace 3 años
..
src 1c01e1de78 fork & optimize: 从github上获取官方源码,并进行了一些优化(不过不保证完全没问题) hace 3 años
README.md 52ff41ca90 Adapt all instances of the term frontend to the new term (language) module. hace 4 años
pom.xml 9422dec832 Move to new structure hace 4 años

README.md

JPlag Kotlin language module

The JPlag Kotlin module allows the use of JPlag with submissions in Kotlin.
It is based on the Kotlin ANTLR4 grammar, licensed under the Apache 2.0.

Kotlin specification compatibility

The underlying grammar definition does not specify which version of Kotlin it is built on, but the presence of the inline keyword and the lack of support for trailing commas in argument lists indicate that it complies with Kotlin 1.3, released in late 2018.

The grammar in this repo contains a fix and some modifications to allow for easier token generation, see the comment in the KotlinParser.

If there are any major updates or fixes to the grammar1, they should surely be applied to this module as well.

Token Extraction

The choice of tokens is intended to be similar to the Java or C# modules. It includes a range of nesting structures (class, method, control flow expressions) as well as variable declaration, object creation, assignment, and control flow altering keywords.

More syntactic elements of Kotlin may turn out to be helpful to include in the future.

Usage

To use the Kotlin module, add the -l kotlin flag in the CLI, or use a JPlagOption object set to LanguageOption.KOTLIN in the Java API as described in the usage information in the readme of the main project and in the wiki.


Footnotes

1 The grammar files are taken from grammar-v4, with the most recent modification in commit 9644ff9 from February 2021.