Skip to content

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

License

Notifications You must be signed in to change notification settings

ismo1652/jetbrains

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ANTLR support in 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. 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");

I have made a sample plug-in that demonstrates the use of this library: antlr/jetbrains-plugin-sample.

I can't use mvn to build and publish this library (see pom.xml but you can use a git submodule to clone this library underneath your plug-in root directory as, perhaps, adaptor directory:

$ cd myplugin
$ git submodule add git@github.com:antlr/jetbrains.git adaptor
$ ls adaptor
./                .git              LICENSE           contributors.txt  pom.xml
../               .gitignore        README.md         doc/              src/

Then tell your plug-in build to look in that directory for source code. This is what the sample plug-in does.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 96.8%
  • ANTLR 3.2%