• Stars
    star
    178
  • Rank 214,989 (Top 5 %)
  • Language
    Kotlin
  • License
    Apache License 2.0
  • Created over 6 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Support for Kotlin as a target for ANTLR

ANTLR Kotlin

Build Status Release License Apache-2.0

This project contains everything is needed to support Kotlin as a target for ANTLR. It means:

  • the Kotlin target: this is a plugin for the ANTLR code generator that produces lexers, parsers, and listeners
  • the Kotlin runtime library: this is a multi-platform library needed to run the lexers and parsers

Because we produce multi-platform code and a multi-platform runtime, the code written using the Kotlin target for ANTLR can run on the JVM (including Android), in the browser, and natively on Mac, Windows, Linux, and iOS.

Status

The project should be considered experimental. Several parsers have been implemented and work so far using this target but not all the features are complete and well tested.

Using ANTLR-Kotlin with Gradle

ANTLR-Kotlin is accessible on Maven & Gradle through Jitpack. In jitpack basically you can use every commit or tag as a version number. You can find recent versions on the Jitpack page for ANTLR-Kotlin.

In older versions of this Plugin (antlr-kotlin-plugin <0.0.5), the configuration was applied by the plugin. Starting from version 0.0.5, you have to apply the configuration manually:

For an example how to use ANTLR-Kotlin see the JVM Example Project. There is also an Kotlin Multiplatform Project Example.

The Kotlin target

The Kotlin target is a plugin for the ANTLR generator. It should be added to the classpath used to run the ANTLR Tool. You will simply need to specify the language to be Kotlin.

The Kotlin runtime library

This project contains the runtime for the Kotlin target of ANTLR. This runtime is built as a multi-platform project running on the JVM, JS, and Kotlin/Native platforms.

You will need to use ANTLR 4 and the Kotlin target to generate ANTLR Lexers and Parsers in Kotlin.

More Repositories

1

SmartReader

SmartReader is a library to extract the main content of a web page, based on a port of the Readability library by Mozilla
C#
138
star
2

kolasu

Kotlin Language Support – AST Library
Kotlin
111
star
3

calc-monaco-editor

A browser based editor for a simple DSL to perform calculations
TypeScript
53
star
4

rpg-to-java-transpiler

An RPG to Java transpiler
Kotlin
35
star
5

article-llvm-rpg

C++
31
star
6

StarLasu

A collection of libraries to work with languages from Java, Kotlin, Python, Javascript, and Typescript
CSS
24
star
7

article-antlr4-c3

The code for the article, Code Completion with antlr4-c3
ANTLR
21
star
8

tylasu

TypeScript
20
star
9

MPSServer

Python
19
star
10

pylasu

Python
14
star
11

webeditkit

A framework to build projectional editors running in the browser
TypeScript
13
star
12

FormatsDSL

A DSL to describe formats and generate loaders
10
star
13

article-antlr4-c3-vscode

Code for the article, Integrating Code Completion in Visual Studio Code With the Language Server Protocol
TypeScript
10
star
14

transformers

Language2Language Transformers: machine learning to build transpilers.
Python
7
star
15

article-lsp-go-to-definition

TypeScript
7
star
16

textx-tutorial

Python
5
star
17

wasi-tutorial

TypeScript
4
star
18

calc-webeditkit-example

JavaScript
4
star
19

sharplasu

CSharp Language Support – AST Library
C#
4
star
20

financialdsl

Kotlin
3
star
21

kolasu-tutorial

Kotlin
2
star
22

article-python-excel

Code for the article "Working with Excel in Python"
Python
2
star
23

mpsserver-client

TypeScript
2
star
24

mpswizard-gradle-plugin

Kotlin
2
star
25

kotlin-mps

2
star
26

sas-parser-samples

Java
2
star
27

spoofax-tutorial

Java
1
star
28

article-peggy

CSS
1
star
29

article-cross-language-navigation

Kotlin
1
star
30

tylasu-hello-world

Hello World with Tylasu
TypeScript
1
star
31

jar_mps

This is the companion repository of the tutorial that shows how to add JARs to a Jetbrains MPS Project
Java
1
star
32

mpsserverdemo

JavaScript
1
star
33

kolasu-languageserver-library

Kotlin
1
star