Wednesday 2 February 2011

ANTLR's plugin in Eclipse

How to get Antlr working in Eclipse

From the ANTLR website, you must get eclipse's plugin:
- Go to WIKI (on top of the page)
ANTLR - WIKI
- Then click Integration with Development Environments (on the right side)
Integration with Development Environments



- Go to the Eclipse's section.
There are two choices under Eclipse: antlrDT and antlr IDE
- choose antlr IDE
- And click on the link to source forge
Source Forge



- In Eclipse go to help, install new software
- Choose Helios - http://download.eclipse.org/releases/helios from the list of Software Sites
- Uncheck Group Items by category
- In the search box type Dynamic Languages



- Check Dynamic Languages Toolkit - Core Frameworks.
- Then type GEF.
- Check Graphical Editing Framework.
- Type Zest.
- And check Graphical Editing Framework Zest Visualization Toolkit.

- Click next, the three chosen options should appear in the window
- Click next and complete the installation.

Go back to the source forge website Source Forge
- Click the Download/Install tab
- And copy the address at "via Update Manager" (http://antlrv3ide.sourceforge.net/updates)

In Eclipse, go to "help" then "install new software" and add a new location in the list of software sites:
e.g. Antlr IDE at http://antlrv3ide.sourceforge.net/updates
- Check ANTLR IDEv2.1.1.
- Click next twice, accept the licence and click finish That should start the installation of the plugin.
- Restart eclipse.

In the Window menu, go down to preferences.
- Click ANtlr in the menu on the left side.
- Then Builder.
- Click add and browse to the directory where we put the ANTLR jar.
- Next, select "Code Generator" and choose "Project relative folder" and input a name such as "antlr-generated" that will keep the grammars in a separated directory.
- Check "append java package to output folder".



For more complete detailed information, you should check Scott Stanchfield's page on Vimeo. ANTLR 3.x Tutorial

0 comments: