My JavaCC book, Generating Parsers With JavaCC is now in stock and available! Here's where to order it. It covers lots of stuff that I'm sure will be useful to those working with JavaCC grammars, including sections on:
- Installing and running JavaCC from the command line, with Ant, and with Maven
- Building tokenizers with regular expressions, lexical states, and using MORE/SKIP/SPECIAL_TOKEN tokens
- Creating parsers, using multiple token/syntactic/semantic lookahead, and resolving ambiguities and choice conflicts, plus a chapter on JJDoc.
- Working with Abstract Syntax Trees (ASTs), using conditional node descriptors, and building Visitors with JJTree. Even a section on JTB!
- Handling Unicode characters in a JavaCC grammar
- Trapping and recovering from errors within a tokenizer, parser, and tree builder
- Testing tokenizers and parsers with JUnit, and testing ASTs with XPath
- Installing and using the excellent JavaCC Eclipse plugin
- A flurry of small examples showing JavaCC in various contexts: parsing Apache logs, a simple Logo parser, and several others.
This book was a lot of fun to write and with any luck it'll make JavaCC a much more accessible parser generator. Enjoy!