Turning to Semantic Lookahead

In my last post I reported that I had finally fixed the way syntactic lookahead works in JavaCC. This leads to the natural question: what about semantic lookahead? Well, what is historically called semantic lookahead in JavaCC is actually misnamed. It’s really just a bit of java code that is used to determine whether to enter an expansion or not. Something like: …

Turning to Semantic Lookahead Read More »

Bugfix! Nested syntactic lookahead now works correctly!

Fixed a Longstanding Bug Known Issue in JavaCC: Nested syntactic lookahead now works! There is a quite serious bug (let’s just call it by what it is, shall we?) of very long standing in JavaCC. Basically, syntactic lookaheads do not nest. This bug is documented in Theodore Norvell’s JavaCC FAQ, which by the way, is the best …

Bugfix! Nested syntactic lookahead now works correctly! Read More »

Reducing Visual Clutter: Introducing a New Streamlined Syntax for JavaCC 21

The overarching design goal of the JavaCC 21 project (dating back from when it was still called FreeCC) is to transform the legacy JavaCC tool into something more useful and useable. Having a clean syntax does not, in itself, further the first goal, but it is surely a key part of the latter. While it is possible for …

Reducing Visual Clutter: Introducing a New Streamlined Syntax for JavaCC 21 Read More »

Straightforward LOOKAHEAD Enhancements

A couple of weeks ago, I implemented a solution to a longstanding Dmitry Dmitriyevich problem with LOOKAHEAD specifications in JavaCC. Dmitry Dmitriyevich (alternatively Ivan Ivanovich or Vladimir Vladimirovich) is my own personal terminology for situations where you are required to write highly repetitive code. (Patriotic Irishmen are welcome to call this the Patrick Fitzpatrick or Gerald …

Straightforward LOOKAHEAD Enhancements Read More »

Revisiting LOOKAHEAD in JavaCC, Attacking the Dmitry Dmitriyevich Problem

As a result of some private correspondence with one of the PMD developers (PMD makes extensive use of JavaCC) I started thinking about some issues that I had in the back of my mind to look into at a later point. Having recently ripped out the code in JavaCC 21 that supported putting LOOKAHEAD specifications …

Revisiting LOOKAHEAD in JavaCC, Attacking the Dmitry Dmitriyevich Problem Read More »