ANTLR and Eclipse (or any decent IDE)
Asked Answered
C

4

8

I have been using ANTLR with Eclipse for some time using the ANTLRv3IDE plugin. While it is not perfect, and a bit outdated, it does its job reasonably well.

Now I am looking to switch to ANTLRv4 for another DSL that I am creating. However, Eclipse support seems to be extremely thin. I decided to try out ANTLRWorks, which is a NetBeans plugin, but I could not get it to install (it seems to be locked to specific dated versions (201302132200 while I have something newer, still 7.3 as docs say) of dependencies).

So, the question: Has anyone set up any Java IDE (preferably Eclipse, but I could be persuaded to switch if support is good for something else) to integrate with ANTLR? With integrate, I mean: code generate on save/keyboard shortcut and syntax coloring (at the very least). Code completion and other features are of course nice to have, but I could live without them for now.

I am well aware of Xtext and I have had great success using it for some projects, but unfortunately it does not fit the needs here (need no IDE support, need my own DSL model not based on ECore, etc).

I know ANTLRWorks can be run as a standalone application without a Java IDE, but that I consider to be a last-resort solution as it is extremely cumbersome to work this way (switch between application, files out of sync, no VCS support etc). I tried the other way around: to install the Java parts into ANTLRworks (which itself is a NetBeans distro), but it did not end well (it seems basic project support etc was stripped out of ANTLRworks).

Culm answered 22/6, 2013 at 20:21 Comment(3)
I also search for a neat solution for ANTLR IDE (also Eclipse preferred). Any news? I hope some great guys could create a plugin with no limitation on the version of ANTLR. Right now I am in terminal.Abbie
Sorry, nothing yet. Stuck with TextWrangler and shell command here :( If I get some spare time I might give it a try porting the v3 plugin (did not look at the source, so I'm not sure how much work that would be...)Culm
I just create a ant build file to compile the grammar manually after I make modifications.Abbie
M
6

Antlr4 plugin for Eclipse is here:

https://github.com/jknack/antlr4ide

Madelynmademoiselle answered 13/1, 2014 at 19:34 Comment(0)
E
3
  • ANTLRWorks 2 uses many non-public interfaces from NetBeans, which means it will always be bound to a particular version. The standalone download will always work because it bundles the dependencies itself.

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

  • A new plugin build of ANTLRWorks 2.1 will be available once NetBeans 7.4 is released.

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

Elea answered 28/8, 2013 at 11:31 Comment(0)
D
1

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

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

Now you can use nearly all things you wanted.

Duplet answered 28/8, 2013 at 11:17 Comment(0)
H
0

ANTLRv3IDE was opensourced. It should be compile-able for Juno. For stringtemplate (ST4) look at the Hastee plugin. It supports some of ST4 constructs.

Haemophilia answered 25/6, 2013 at 7:23 Comment(1)
Thanks. Though I got ANTLRv3IDE to run well enough on Juno, it does only support ANTLR 3. I was interested in getting ANLTR 4 to run on it. ANTLR is unfortunately not the same as StringTemplate.Culm

© 2022 - 2024 — McMap. All rights reserved.