
kotlinx.ast:parser-antlr-optimized contains the shared code required to parse grammars using the optimized fork of antlr. kotlinx.ast:parser-antlr-kotlin contains the shared code required to parse grammars using antlr-kotlin. kotlinx.ast:parser-antlr-java contains the shared code required to parse grammars using the official antlr4 JVM implementation. kotlinx.ast:common-test contains the dependencies to test frameworks, used by kotlinx.ast unit tests. kotlinx.ast:common contains the code that can later be reused by other grammar parsers. There are some parts missing, for example the importList is not converted into an easy-to-use data class OverviewĬurrently, there are some libraries that are part of kotlinx.ast: Files named "*.summary.txt" contains the AST summary. Files named "*.raw.txt" contains the parsed raw kotlin AST as defined by the official Kotlin Grammar. Files named "*.kt.txt" contains the kotlin source to parse. There are more examples in directory testdata. kastree is currently not under active development. Kastree is using the kotlin compiler for parsing,
Multiplatform support (Kotlin Native and Kotlin JavaScript) for antlr-kotlin is planned.īecause antlr-java and antlr-optimized are JVM-only, support for other platforms is not possible. Kotlinx.ast is a multiplatform project, but currently, JVM is the only supported target.Īntlr-java, antlr-optimized and antlr-kotlin are supported on the JVM. The Project is in an early stage, but it is already possible to parse Kotlin code.īug reports, feature requests and pull requests are very welcome. Used to represent and easily access the AST. Kotlinx.ast does not use the Kotlin Compiler for parsing,Ī collection of language independent data classes
The library is designed that other languages can be easily added. Kotlinx.ast is a generic AST (Abstract Syntax Tree) parsing library, Kotlin is currently the only supported language.