pacc logo


Writing documentation again, and spotting holes as I do so. I've a feeling I've been here before, but the interaction between alternation and expressions is wrong.

For example, currently this is a valid pacc grammar:

S ← "a" ("b" → {5}) "c" → {7}

This is permitted because parentheses contain a Rule0, which is where alternation is defined. However, the conclusion last time was that this is the right way to describe the syntax, and I've reached the same conclusion again. The current syntax exactly matches Ford (I'm not sure how, or even if, he handles the case of a rule with too many values). And I definitely like this grammar (which just became test/pacc/alt2.pacc):

FortySomething ← "forty-" ("four" → { 44 } / "five" → { 45 })

To prevent nonsensical grammars like the first one above, we will introduce a separate semantic pass over the AST. Similar to the check for left recursion, this pass will ensure that every path through a rule produces exactly one value (or no values, for void rules).

Last updated: 2015-05-24 19:45:24 UTC


Porting and packaging

One thing pacc needs is more users. And, perhaps, one way to get more users is to reduce the friction in getting started with pacc. An obvious lubricant is packaging. Read More...

Release relief

Looking at _pacc_coords(), I noticed that it seemed to have the same realloc() bug that I'd just fixed in _pacc_result(). However, the "list of arrays" trick really wasn't going to work here. Read More...

See more news articles