Giter VIP home page Giter VIP logo

antlr4-intellij-adaptor's Introduction

ANTLRv4 support in IntelliJ IDEs Build Status Maven Central

A library to support the use of ANTLRv4 grammars for custom languages in IntelliJ-based IDEs plug-in development.

This library has adaptors that convert ANTLR-generated parse trees into IntelliJ PSI trees. Mostly this library is about adapting ANTLR parsers and trees, but there is considerable support to examine PSI trees derived from ANTLR parse trees. For example, if you're building a structure view for your plug-in and you want to get the list of function names you can use XPath-like specs such as "/script/function/ID":

Collection<? extends PsiElement> allfuncs =
    XPath.findAll(SampleLanguage.INSTANCE, tree,
                  "/script/function/ID");

Using the library in your project

The library is published on Maven Central which means you can download the JAR and add it to your classpath manually, or pull the dependency automatically if you are using a Gradle build:

repositories {
    mavenCentral()
}

dependencies {
    compile "org.antlr:antlr4-intellij-adaptor:0.1"
}

In Maven builds, use:

<dependency>
  <groupId>org.antlr</groupId>
  <artifactId>antlr4-intellij-adaptor</artifactId>
  <version>0.1</version>
</dependency>

You can now head over to the Getting started section of the wiki.

Examples

Here is a list of known plugins that use the adaptor:

Other usages can be found on GitHub

Migration from the pre-Maven version

Before 0.1, it was recommended to add this Git repo as a submodule of your own project, or to copy the source files directly.

It is now recommended to use the Maven dependency. The main breaking change is that the base package has been renamed from org.antlr.jetbrains.adaptor to org.antlr.intellij.adaptor

antlr4-intellij-adaptor's People

Contributors

bjansen avatar bjansen-caps avatar parrt avatar vemilyus avatar yegorpetrov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.