JavaCC Eclipse Plug-in for Eclipse 3.4 - 3.5
with JavaCC 5.0 and JTB 1.4.0
Last update : november 21th, 2009 - version 1.5.17
The JavaCC plug-in is designed to help development of JavaCC applications within the Eclipse IDE.
License : GPL / Cecill
How to update / download
You can use this site as an update site in Eclipse :
add http://eclipse-javacc.sourceforge.net/ to your software update sites and follow the instructions.
Or you can download from the
JavaCC Eclipse Plug-in site on Sourceforge
the (zipped) update site file,
and use it a a local update site, or unzip it directly over the Eclipse home directory.
Or you can get the source from the CVS repository and recompile the plug-in :
see the JavaCC Eclipse Plug-in CVS information
for accessing the CVS repository.
You can also look at the following
tutorial on Team development with Eclipse and CVS.
Note for Galileo users: we encountered different problems during our tests updating our Eclipse environments,
which we did not understand in most cases and which seem related to Eclipse and not to the JavaCC Eclipse plug-in:
so we recommend you to backup your Eclipse environment (eclipse home and .eclipse under user_home) before updating it.
The plug-in needs Java 1.5 or 1.6 and Eclipse 3.4.2 or 3.5 to run.
See readme_developer.txt if you want a quick introduction
on how to modify the sources.
This plug-in provides
- preference pages for JavaCC, JJTree, JJDoc & JTB options setting
- an editor for JavaCC, JJTree and JTB sources, with
- formatting, syntax coloring, automatic indentation, matching punctuation highlighting
- navigation to elements declaration / uses (open declaration and back / forth)
- some keyboard shortcuts : Comment lines Ctrl+/, Open declaration Ctrl+clic, Format Ctrl+Shift+F
- an outline view for JavaCC, JJTree and JTB sources
- a call hierarchy view for JavaCC, JJTree and JTB sources
- JavaCC, JJTree & JJDoc sources compilation
(see https://javacc.dev.java.net/)
- JTB source compilation
(see http://compilers.cs.ucla.edu/jtb/)
- JavaCC, JJTree and JTB sources compilation problems reporting
- a console for compilation outputs with hyperlinks to Errors and Warnings
- decoration of generated files
- support for Eclipse 3.4 & 3.5, Java 1.5 & 1.6, JavaCC5.0, JTB 1.4.0 (JTB 1.3.2 is still provided)
- JavaCC launching in the same directory as the grammar files (to facilitate package handling)
- some help through the Eclipse menu Help / Help Contents
History
13/11/09 - 1.5.17 : Fixed formatting / syntax coloring / outline / autoindent / call hierarchy / context menus / messages issues ;
updated with JTB 1.4.0 and new options (Marc Mazas)
04/10/09 - 1.5.16 : Added support for Eclipse variables in Builder and Options ; fixed JTB jar store bug in preferences and
added use of default jar when no jar is set
07/09/09 - 1.5.15 : Updated with JavaCC 5.0 and for new options, fixed running in Galileo, compiled with Java 1.5 to support Mac OS X ;
Change the released zip to be a zipped update site file
23/05/09 - 1.5.14 : Added Call hierarchy view
25/04/09 - 1.5.13 : Updated JavaCC / JJTree / JTB options, New preferences, Enhanced formatting & coloring (Marc Mazas)
13/07/08 - 1.5.12 : Updated with JavaCC 4.1, added Folding, Hover, Completion proposals, and project Cleaning
08/07/07 - 1.5.10 : Fixed JJTREE_OUTPUT_DIRECTORY, NullPointerException
10/06/07 - 1.5.9 : Fixed javacc.jar to handle output directory for JJDoc
11/03/07 - 1.5.7 : Fixed suppress warnings and preserve unicode escape when formatting
26/11/06 - 1.5.6 : Restored compatibility with Eclipse 3.1 and handle case where no src/bin dir are defined
05/11/06 - 1.5.5 : Added Java 1.5 and Eclipse 3.2.1 support, fixed bug in console hyperlinks, added basic content assistant
01/10/06 - 1.5.4 : Suppressed warnings in generated files, global preferences for colors
24/05/06 - 1.5.3 : Fixed plug-in key conflict F3
27/03/06 - 1.5.2 : Removed "exclude from build" and adopted Eclipse way, ie Build Path
24/02/06 - 1.5.1 : Added French version, sauf que je n'ai pas encore traduit l'aide en français
13/11/05 - 1.4.0 : Added update site, automatic format, java 1.4 .class files compatibility
31/10/05 - 1.3.0 : Added JTB, Ctrl+click to open declaration, 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.

3) You have now a new JavaCC file, compiled with JavaCC, with all the generated java files in you project.
Note that :
- the generated files are decorated with a "G" and a "<somefromfile.jj>"
to indicate where the .jj files come from,
- there may be compiler warnings, in the java generated files (due to your compiler error & warnings settings
and due to the way JavaCC generates the java code)
- the 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 :

Support
Feel free to report any bug or suggest enhancement at the
JavaCC Eclipse Plug-in Sourceforge site.
JavaCC Book
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.