Antlr plugin integrates the famous ANTLR Lexer/Parser-Generator into the Eclipse
Software Development Environment (Websphere Studio Application Developer is
the IBM-product based on the eclipse platform).
Sorry, the ANTLR plugin is no longer supported. I decided to drop the antlr-plugin
from my page; it's very old and I want to focus on Slime UML (http://www.mvmsoft.de/content/plugins/slime/slime.htm);
on sourceforge is another antlr-plugin http://sourceforge.net/projects/antlreclipse which
incorporates all features of my plugin and is more up-to-date.
Please use this one.
ANTLR is a very cool Parser generator. Well, a grammar file might get a bit
confusing, if you mix comments, grammar rules, action java code. And it must
be integrated well into the build process. I wanted to integrate ANTLR into
Eclipse to enable easy fixing of syntax errors, browse the grammar files and
integrate parser generation into the Eclipse build process.
- Syntax highlighting
- Outline view of grammar rules
- Builder to automatically translate grammar files to Java-files in Eclipse
- browsing of grammars (goto rule defining token)
- Error markers for grammar files
- Grammar overview which parses the grammar file and shows a compressed view
of the grammar, containing only terminals and non-terminals; all actions,
comments, type information is removed
Well, it's not really self-explanatory. There are some things to know to get
started at all.
Activating the Grammar Builder
- Grammar files must have the postfix .g
- open them and you see the syntax highlighting and outline of your grammar
- that's it
- Builder support is not perfectly working yet; you need to do some things
to your project to get it working.
Known Limitations and Bugs
- open the navigation view (package view won't work !)
- select your project root node
- open the context menu in the Navigation view on the project
root node; an entry "(Un)install ANTLR Grammar Builder" should
appear; otherwise check plugin version and location.
- click ok, the builder is now registered for this project and gets
active, if a grammar file is inserted or changed.
- Now open the Preferences window and select Java->Builder
(only for Eclipse 2.0): type *.g to exclude grammar files from
to the bin folder.
- That's it. Go !
- It doesn't work with any current ANTLR release. For the error markers
I need some patches for ANTLR. The 2.7.2a2 already contains most of the patches,
still hoping for a final release containing all patches.
- This is an alpha-version. It's free for you to try, but don't use it for
- I have only tested it on Windows 2000. If you have any experience with
other platforms, please tell me.
- Incremental build doesn't work well with grammar files, since they are
copied to the bin folder. This can only be fixed by the Eclipse 2.0 version,
there you have more control over the java builder copy process.
- From a grammar generated files are not removed anymore, if file content
changes (e.g. Parser class name, removal of grammar file etc.)
- Grammar inheritance is not supported by error markers and Parser
- The builder always generates java-code into the same directory as the grammar;
thus make sure, the grammar-directory matches the Parser-package.
In this picture, you see a grammar with error marker, the generated source
files for the grammar file, rudimentary syntax highlighting and the outline
view in action.
This is the grammar overview, which is still pretty rudimentary, but great
to get an overview over the grammar without getting distracted by embedded