JavaCC : Java Glossary

go to home page J words local find full screen, hide local find menu Google search web for more information on this topic jump to foot of page translate this page with Babelfish 2007-07-17 by Roedy Green ©1996-2008 Canadian Mind Products
index page for letter ⇒ punctuation 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z (all)
JavaCC
Formerly known as Jack. JavaCC is a parser, like YACC, except that is it written in Java and generates Java code. It started out handled by Sun, then by Metamata, then bought out by Webgain, who went belly up. It is now an open source project. It is still the most popular parser written in Java. JavaCC is similar to PCCTS. JavaCC is a LL(k) (top down) parser, whereas YACC is a LALR(1) (bottom up) parser, so the grammars look quite different. The documentation is quite readable, unlike most of its competition. The parser has some parsing speedup tricks like lookahead and custom code for the tricky bits.

Check this list of tutorials. I blew my mind when a little parser I wrote worked first time. It is much simpler than it first looks. The easiest way to learn is to study the *.jj example grammar descriptions and to google for example source code for javacc code for grammars similar to what you want to tackle.

download JavaCC 4.0 free. Last revised: 2007-04-20 The download zip includes documentation, Jjtree and a number of simple *.jj example grammar descriptions. Just unzip everything with embedded folder names into a Program Files directory. It does not have an explicit installer. You will want to tweak javacc-4.0\bin\javacc.bat, (the script that compiles your grammar descriptor into Java source code) and put a copy somewhere on the path.

You write little methods that describe the various phrases of your grammar. They are a mixture of Java code and JavaCC grammatical BNF. JavaCC then merges them and converts the whole thing into pure Java source code, with methods that will recognise the various phrases. When you compile that, you can parse text. In addition there are commands to describe the tokens of your language tokens — the basic units/words.

Learning More

book cover recommend book⇒Generating Parsers with JavaCC
 paperback
ISBN13:978-0-9762214-3-2clickcounter
ISBN10:0-9762214-3-8clickcounter
publisher:Centennial Books
published:2007
by:Tom Copeland
You can also order direct from the author. Also covers JJTree, JTB and JJDoc. It explains how to write Unicode parsers to handle a much richer character set than in traditional in languages. It covers integration with Eclipse, but not IntelliJ. The documentation for JavaCC is scattered over the web. This book helps you find it all.
UK flag abe books.co.uk abe books.ca Canadian flag
UK flag amazon.co.uk. amazon.ca. Canadian flag
German flag abe books.de chapters.indigo.ca . Canadian flag
German flag amazon.de. abe books.com American flag
French flag abe books.fr amazon.com. American flag
French flag amazon.fr. barnes and noble.com American flag
Italian flag abe books.it powells.com American flag
Spanish flag iberlibro.com abe books anz Australian flag

CMP homejump to top
CMP logo
feedback Please email your feedback for publication, errors, omissions, broken/redirected link reports
and suggestions to improve this page to Roedy Green : feedback email
made with CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[65.110.21.43]
Your face IP:[38.103.63.61] The information on this page is for non-military use only.
You are visitor number 12,814. Military use includes use by defence contractors.
You can get a fresh copy of this page from: or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror)
http://mindprod.com/jgloss/javacc.html J:\mindprod\jgloss\javacc.html