Menu Close

ea3 Release

The ea3 release has taken longer than I had expected; somewhere along the line, I took on the problem of finding a replacement for the approximate approach used in ea2 for handling recursion. After implementing three different exact approaches, I found one that appears to be optimal, and that is the one used in ea3. There are still improvements to be made—left recursion is not yet supported, for example—but these are minor. There are also improvements in labeling for construction of case statements that implement state machines for selecting recognition functions and for dealing with recursion. The ea3 LGLL implementation can be considered stable.

The centerpiece of the ea3 release is an upgrade of the grammar generator that has a working dependency analyzer for attribute-based rewrites. GrammarGen now properly deals with both SORCERER-style tree construction (via ^ and ! suffixing of grammar elements) and attribute-based rewrites. Grammar generation removes much of the effort of designing intermediate representations for AST transformations. Instead of laboriously crafting an intermediate form and then debugging it, grammar generation allows the developer to identify possibly useful transformations, generate the grammar to match the transformed input, and then verify that the transformation is useful through inspection of the output grammar. Instead of focusing on developing an “ideal” design concept that may or may not prove out and tediously testing the result, the developer does quick turnaround transformation testing. This effectively compresses the development time for each pass of a language processor from days/weeks to hours.

Once a multipass translator has been developed, maintenance becomes an issue. Propagating changes across grammars by hand and debugging is tedious, but not particularly time consuming. I have done a fair amount of this type of maintenance. With a more fully capable grammar generator, another possibility is to use diff3 to merge the changes between two generated grammars (before modification of the input grammar and after) and a third that is an annotated version of the before output. This version should enable that.

I had planned for the ea3 release to include improved error handling support, but that will have to wait for a later release—the effort (and somewhat more) that would have gone into that was spent on the improved recursion handling. 

Leave a Reply

Your email address will not be published. Required fields are marked *