- ANTLR 4.x
- Advanced Syntax Highlighting (even for target language)
- Automatic Code Generation (on save)
- Manual Code Generation (through External Tools menu)
- Code Formatter (Ctrl+Shift+F)
- Syntax Diagrams as HTML
- Live Parse Tree evaluation
- Advanced Rule Navigation between files (F3 or Ctrl+Click over a rule)
- Quick fixes
This is brand new version of the old ANTLR IDE. The new IDE supports ANTLR 4.x and it was created to run on Eclipse 4.x
The old ANTLR IDE isn't supported anymore. When I wrote it, I was young and didn't know what was doing ;)
Don't get me wrong, the old version did a very good work from user point of view, it just I'm not proud of the code base because is kind of complex and had a poor quality.
The main reason of complexity of the old IDE was in Dynamic Language ToolKit (DLTK) dependency. The DLTK project didn't evolve so much over the last few years and doing something in DLTK is very very complex and require a lot of work.
Now, the new IDE was built on XText. XText is great for building DSL with Eclipse IDE support, so if you are not familiar with XText go and see it.
- Eclipse 4.4 (Luna)
- XText 2.7.3
- Open Eclipse Luna (4.4)
- Go to:
Help > Eclipse Marketplace...
- Search for
antlr
- Choose
ANTLR 4 IDE
and clickInstall
You can download the plugin and the save it in the dropins
directory of your Eclipse installation.
The new IDE is very simple to use all the files with a *.g4
extension will be opened by the ANTLR 4 Editor. So, just open a *.g4
file and play with it
Code is automatically generated on save if the grammar is valid. You can turn off this feature by going to: Window > Preferences > ANTLR 4 > Tool
and uncheck the "Tool is activated" option. From there you can configure a couple more of options.
You can find the generated code in the target/generated-sources/antlr4
(same directory as antlr4-maven-plugin)
You can fire a code generation action by selecting a *.g4
file from the Package Explorer, right click: Run As > ANTLR 4
.
A default ANTLR 4 launch configuration will be created. You can modify the generated launch configuration by going to: Run > External Tools > External Tools Configurations...
from there you will see the launch configuration and how to set or override code generation options
To open the Syntax Diagram view go to: Window > Show View > Other
search and select: Syntax Diagram
- Fork and clone the repository from github
- Download and install Maven 3.x
- Open a shell console and type:
cd antlr4ide
- Build the project with:
mvn clean package
- It takes a while to download and configure Eclipse dependencies, so be patient
- Wait for a:
BUILD SUCCESS
message
- Make sure you built the project first.
- Open Eclipse Luna (4.4)
- Install Xtext 2.7.3
- Copy and paste this url: http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/ in the Work with text field
- Hit Enter
- Choose XText 2.7.3. NOTE: DON'T confuse with Xtend, you must choose Xtext
- Restart Eclipse after installing Xtext
- Import the project into Eclipse
- Go to:
File > Import...
thenGeneral > Existing Projects into Workspace
- Choose project root
antlr4ide
- Enabled:
Search for nested projects
- Finish
You don't need any extra Eclipse plugin (like m2e or similar). Project metadata is on git so all you need to do is: mvn clean package
and then import the projects into Eclipse.
- Fork the project on Github.
- Wandering what to work on? See task/bug list and pick up something you would like to work on.
- Create an issue or fix one from issues list.
- If you know the answer to a question posted to our mailing list - don't hesitate to write a reply.
- Share your ideas or ask questions on mailing list - don't hesitate to write a reply - that helps us improve javadocs/FAQ.
- If you miss a particular feature - browse or ask on the mailing list - don't hesitate to write a reply, show us a sample code and describe the problem.
- Write a blog post about how you use or extend ANTLR 4 IDE.
- Please suggest changes to javadoc/exception messages when you find something unclear.
- If you have problems with documentation, find it non intuitive or hard to follow - let us know about it, we'll try to make it better according to your suggestions. Any constructive critique is greatly appreciated. Don't forget that this is an open source project developed and documented in spare time.
[Edgar Espina] (https://twitter.com/edgarespina)