pacc logo

Darn

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}
foo

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 })
foo

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

Donate

Support the development of pacc with a donation! We accept donations in BitCoin or via PayPal who handle almost any other form of payment.

News

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

feed