FilterExpr ::= PrimaryExpr | FilterExpr Predicate
Saturday 04 June 2005
Made a minor grammar fix, and reworked location steps slightly so expressions like $doc/step1/step2 or $doc[pred] work (assuming $doc is bound to a node-set obviously).
Everytime I find a problem in the grammar, which actually isn’t very often at all, I give thanks to the pragmatic programming Gods that I used Spirit rather than rolling my own parser. In this case, I’d transcribed
FilterExpr ::= PrimaryExpr | FilterExpr Predicate
after eliminating right-recursion as
FilterExpr = PrimaryExpr >> *(Predicate >> PrimaryExpr);
rather than
FilterExpr = PrimaryExpr >> *Predicate;`
Time to fix - about 30 seconds. Time to fix if I’d hand-rolled - don’t even want to think about it.
Freelance software grandad
software created
extended or repaired
Freelance software grandad
software created
extended or repaired
Freelance software grandad
software created
extended or repaired
Freelance software grandad
software created
extended or repaired
Freelance software grandad
software created
extended or repaired
Freelance software grandad
software created
extended or repaired