1.0.0 • Published 3 years ago

kotlin-parser-antlr v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Kotlin parser

Kotiln parser that generates a concrete syntax tree using, parser class generated by ANTLR v4 and kotlin grammar taken from kotlinx/ast.

Build grammar

Follow these steps to build grammar classes:

  1. Download antlr4 grammar for Kotlin
  2. Download ANTLR tool itself
  3. Install Java 8 JRE or JDK

With everything setup, run the following BASH script to generate classes KotilnLexer & KotlinParser.

#! /bin/bash

out_dir=./src/kotlin

# cleanup previous built files
rm -r $out_dir

# build files
java -jar <PATH TO ANTLR JAR> \
  -Dlanguage=JavaScript \
  -no-listener \
  -Xexact-output-dir \
  -o $out_dir/ \
  <PATH TO GRAMMAR>

# cleanup
rm $out_dir/*.interp
rm $out_dir/*.tokens
1.0.0

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago