SourceForge Logo

JavaCC Eclipse Plug-in for Eclipse 3.2 - 3.3 - 3.4

Last update 23 may 2009

JavaCC plug-in is designed to help development of JavaCC applications.
License : GPL / Cecill
You can download the last version from sourceforge : sourceforge site
Or use this site as an update site in Eclipse : http://eclipse-javacc.sourceforge.net/
The plugin needs Java 1.6 to run, sources contain Java 5.0 templates and Eclipse 3.2.2 or 3.3.3 or 3.4.2

To install just unzip in C:/eclipse. The sources are with the plugin.
The sources are bundled with the plugin and at sourceforge.
See readme_developer.txt  if you want to hack the sources.

Tom Copeland wrote a very nice book on JavaCC :  http://generatingparserswithjavacc.com/
A really good book, clear, well written, and full of ready to use examples.
If you need to parse a complex file format and choose JavaCC to generate the parser, this is definitly the best book.

This plug-in provides :

History
23/05/09 - New in 1.5.14 Added call hierarchy view
25/04/09 - New in 1.5.14 (Marc Mazas) Updated JavaCC / JJTree / JTB options, New preferences , Enhanced formatting 
13/07/08 New in 1.5.12 : Updated with JavaCC 4.1, Added Folding, Hover, Completion proposals, and project Cleaning.
08/07/07 New in 1.5.10 : Correct JJTREE_OUTPUT_DIRECTORY, NullPointerException
10/06/07 New in 1.5.9 : Correct javacc.jar to handle output directory for JJDoc
11/03/07 New in 1.5.7 : Correct suppress warnings and preserve unicode escape when formatting
26/11/06 New in 1.5.6 : Restore compatibility with Eclipse 3.1 and handle case where no src/bin dir are defined.
05/11/06 New in 1.5.5 : Java 1.5 and Eclipse 3.2.1, correct bug in console hyperlinks, basic content assistant
01/10/06 New in 1.5.4 : Suppress warnings in generated files, global preferences for colors
24/05/06 New in 1.5.3 : Correct plugin key conflict F3
27/03/06 New in 1.5.2 : Removed "exclude from build" and adopted Eclipse way, ie Build Path. New in 1.5.2 : bug correction
24/02/06 New in 1.5.1 : French version, sauf que je n'ai pas encore traduit l'aide en français.
13/11/05 New in 1.4.0 : Update site, automatic format, java 1.4 .class files compatibility
31/10/05 New in 1.3.0 : JTB, Ctrl+clic, Wizard

Quick Start

1) Create a new Java project and a package "foo"

2) Select package "foo" and create a new JavaCC file. Just accept all default settings.

new project

Beware templates files are for Java 1.5 (you must change in generated file to JDK_VERSION = 1.4 if you use java 1.4)

3) You have now a new JavaCC file, compiled with JavaCC and all generated java files in you project.

files generated

Note that :
- the generated files are decorated with a "G" and a "<from.jj>" to indicate the .jj file they come from,
- there may be warnings from the Java Compiler (Eclipse doesn't like JavaCC generated code),
- JavaCC console opens automatically.

4) Run the example
Select "TestJavaCC" and menu "Run"/ "Run as..." / "Java application"
Choose "eg1" for the main type.
You can now test your JavaCC application :



You can do the same with the template for JJTree :



and also with the template for JTB:



Feel free to signal any bug or suggest enhancement at the Eclipse JavaCC sourceforge site.