ANTLR and Eclipse (or any decent IDE)

I have been using ANTLR with Eclipse for some time using the ANTLRv3IDE plugin. Although not perfect and a bit dated, he does his job quite well.

Now I want to switch to ANTLRv4 for another DSL that I create. However, Eclipse support seems very subtle. I decided to try ANTLRWorks, which is a NetBeans plugin, but I could not install it (it seems to be blocked for certain dated versions (201302132200, while I have something newer, still 7.3, as docs say) dependencies).

So the question is: Has anyone configured any Java IDE (preferably Eclipse, but I could convince to switch if the support is good for something else) to integrate with ANTLR? With integration, I mean: generate code while saving / shortening keys and coloring syntax (at least). Of course, it's nice to have code to complete the code and other functions, but I could live without them for now.

I know Xtext well, and I had great success using it for some projects, but, unfortunately, it does not meet the needs here (there is no IDE support, I need my own DSL model, not based on ECore, etc.).

I know that ANTLRWorks can be run as a stand-alone application without a Java IDE, but I think this is the last solution, since it is very difficult to work this way (switching between applications, files is not synchronized, without VCS support, etc.). I tried the opposite: install the Java parts in ANTLRworks (which itself is a NetBeans distribution), but it did not end well (it seems that the main project support, etc. was removed from ANTLRworks).

+8
eclipse antlr antlr4 antlrworks
source share
4 answers

The Antlr4 plugin for Eclipse is here:

https://github.com/jknack/antlr4ide

+6
source share
  • ANTLRWorks 2 uses many non-public interfaces from NetBeans, which means that it will always be bound to a specific version. Offline loading will always work because it links the dependencies themselves.

  • The standalone build of ANTLRWorks 2.1 is available . This build includes support for ANTLR 4.1.

  • The new version of the ANTLRWorks 2.1 plugin will be available after NetBeans 7.4.

  • Moving forward, the ANTLRWorks post-2.1 code is open source under the LGPL license .

+3
source share

I think you downloaded Netbeans 7.3.1. Try downloading 7.3 from https://netbeans.org/downloads/7.3/ and install the ANTLRworks plugin there. (Link to ANTLRworks Update Center: http://tunnelvisionlabs.com/downloads/nbupdates/nb73/aw2/updates.xml ).

Please note that ANTLRworks v2 contains ANTLR v4.0, which is not the current version of ANTLR (4.1). Also download ANTLR v4.0 from the ANTLR download folder (antlr-4.0-complete.jar file) and use it as a library for compilation.

Now you can use almost everything you need.

+1
source share

ANTLRv3IDE was opensourced . It must compile for Juno. For stringtemplate (ST4) see the Hastee plugin . It supports some ST4 constructors.

0
source share

All Articles