- Edited
First, a little background. I currently have a COBOL -> Java compiler/runtime for which I use javacc/jtb for parsing and building the AST. A sub-grammar of the main COBOL grammar is one used for encoding the COBOL "picture" strings. For that I also used javacc/jtb and encoded the picture by visiting the AST in a single pass.
I discovered CongoCC (ne. Javacc21) about a month ago, and became very excited, since every time I have to touch the COBOL grammar I am reminded of how fragile and unpredictable javacc is. The problem is that I use jtb, not jjtree (not a show stopper, just some tedious work to change the multiple passes over the AST, or hack CongoCC to create the optional nodes like jtb) and I rely on some of javacc's bugs to accomplish some things in the current parser. However, I decided to recode the picture parser using CongoCC to get my feet wet, so to speak. Now, I have the result. It is not exactly apples-to-apples. My new CongoCC picture parser (picture encoder in my parlance) does not generate a tree (although it did along the way to its final form). Instead the semantics are all rolled into the grammar and performed during parsing, but because of the simplicity of the former visitor logic, I suspect it is not a very significant difference.
The CongoCC-based picture encoder is about 2x faster than the javacc/jtb one! Although in the actual compiler the picture encodings are cached, so the performance of the encoder is not so important, I was still happy with the results as an indication that I can remain excited about possibly replacing javacc/jtb entirely.
The main COBOL grammar is very large (around 12,000 lines), so there is some work to do, but I am now highly motivated. And CongoCC is now entrenched in the product as the new picture encoder!
So goodbye javacc, and thanks for all the fish.
Oh, and here is the grammar if anyone is interested https://drive.google.com/file/d/1Va5z4mAiWh1EQ9epGqB7suWivO2umor7/view?usp=sharing