anqiansong / antlr4-jetbrains-adapter

A library to support the use of ANTLR grammars in jetbrains IDE plugins for building custom languages.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ANTLR Parser Adapter for JetBrains IDEs

A library to support the use of ANTLR grammars for custom languages in jetbrains IDEs plug-in development.

This library has adaptors that convert ANTLR-generated parse trees into jetbrains PSI trees.

Usage

Instruction below is suitable for plugin that are using gradle build system.

Add repository to the build script - https://dl.bintray.com/antlr/maven/:

repositories {
    jcenter()
    mavenLocal()
    maven {
        url "https://dl.bintray.com/antlr/maven/"
    }
}

Add library as a dependency - org.antlr:antlr4-jetbrains-adapter:1.2.0:

dependencies {
    compile 'org.antlr:antlr4-runtime:4.5.1'
    compile ('org.antlr:antlr4-jetbrains-adapter:1.2.0') {
        exclude group: 'com.jetbrains'
    }
}

Plug-in that demonstrates the use of this library: protostuff/protobuf-jetbrains-plugin.

Build HOW-TO

Build:

./gradlew clean build

Deploy to bintray:

./gradlew bintrayUpload

Install to local maven repository:

./gradlew publishMainPublicationToMavenLocal

CI

Builds run automatically: https://jenkins.ksprojects.org/job/kshchepanovskyi/

Artifacts are uploaded to bintray:

https://bintray.com/antlr/maven/antlr4-jetbrains-adapter/

Version number computation logic:

if [[ "$BRANCH_NAME" =~ ^(release/).*$ ]]; then
  VERSION=$(cat release.txt).${BUILD_ID}
elif [[ "$BRANCH_NAME" =~ ^(master).*$ ]]; then
  VERSION=$(cat release.txt).alpha.${BUILD_ID}                                                              
else
  VERSION=$(cat release.txt).snapshot.$(git rev-parse HEAD)
fi

About

A library to support the use of ANTLR grammars in jetbrains IDE plugins for building custom languages.

License:BSD 2-Clause "Simplified" License


Languages

Language:Java 94.8%Language:ANTLR 5.2%