pacc logo

Feeding finale

That was almost too easy. It took just a few minutes to implement $ as new syntax to indicate feeding points (the new node type in the AST is called cafe), then update the cooker, eat a few test cases, and wash up by removing the -r option.

A particularly pleasing moment was when the calculator test worked first time; a nice indication that this is at last the right approach. That example now looks like this:

Sum :: int ← _ a:Additive → a
Additive ← m:Multitive $ Plus $ a:Additive { m + a } / m:Multitive → m
Multitive ← p:Primary $ Times $ m:Multitive { p * m } / p:Primary → p
Primary ← Left $ a:Additive $ Right → a / d:Decimal → d
Decimal ← [0-9]+ _ { atoi(ref_ptr(ref())) }

Left :: void ← "(" _
Right ← ")" _
Plus ← "+" _
Times ← "*" _
_ ← [ \t\n] *

If you want to play with it yourself, please clone the git repo:

git clone git://paccrat.org/pacc

A new release is now a step more imminent than it was. Watch this space!

Last updated: 2015-05-24 19:45:30 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