revusky

Syntax Converter Available

There is now a syntax converter to convert legacy JavaCC (and some things in JavaCC 21) to the approved CongoCC syntax. You can execute it as: java -jar javacc-full.jar convert filename That will spit it out to stdout. More likely you want something more like: java -jar javacc-full.jar convert filename > outputfilename The converter converts …

Syntax Converter Available Read More »

NFA stands for “Nondeterministic finite automaton”. (Does that make you nervous?)

The main goal of the JavaCC 21 project, soon to be renamed as CongoCC, is to develop a very capable, practical, usable parser generator tool. However, there is another overarching goal — perhaps not so much a goal, as a philosophy. That can be summed up in a single word: Demystification You see, somehow or …

NFA stands for “Nondeterministic finite automaton”. (Does that make you nervous?) Read More »

Nested Lookahead Redux

(The TLDR: Nested lookahead was always broken in legacy JavaCC. This is finally fully addressed (as of 11/26/2022) in JavaCC 21. However, since this fix has a lot of potential to break existing code, for now, the fix is only in effect if you put LEGACY_GLITCHY_LOOKAHEAD=false at the top of your grammar(s). Meanwhile, you should …

Nested Lookahead Redux Read More »

I shall tell you my plans but then I shall have to kill you, Mr. Bond Van Bruggen

There is a scene that repeats itself in various James Bond films, usually towards the end. The archvillain has captured Bond. However, instead of just killing him, he has to do it in some very creative, slow manner, using some sort of Rube Goldberg contraption. Meanwhile, he tells Bond gleefully what his plans are for …

I shall tell you my plans but then I shall have to kill you, Mr. Bond Van Bruggen Read More »

Announcement: JavaCC 21 includes parsers for the latest Java and Python versions!

As the title says: as of this writing, the included grammars for Java and Python both support the latest versions of the language, JDK 17 and Python 3.10 respectively. Contextual Keywords It turns out that, from a language support perspective, the only new stable feature in JDK 17 is the concept of sealed classes. This …

Announcement: JavaCC 21 includes parsers for the latest Java and Python versions! Read More »

Context-Sensitive Tokenization, Next Installment, Activating and De-activating Tokens

Sometimes, when you complete a major code cleanup, features that were previously pie in the sky become low-hanging fruit to pluck. The new feature that I describe here, the ability to activate and deactivate tokens is such a case. It resulted from my rewriting of the lexical code generation that I describe here. In an …

Context-Sensitive Tokenization, Next Installment, Activating and De-activating Tokens Read More »