Jez Higgins

Freelance software generalist
software created
extended or repaired


Older posts are available in the archive or through tags.

Feed

Follow me on Twitter
My code on GitHub

Contact
About

Saturday 04 June 2005 Arabica: XPath: variables returning node-sets

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 eliminiating 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 :)


Tagged code, arabica, xml, and c++


Jez Higgins

Freelance software generalist
software created
extended or repaired

Older posts are available in the archive or through tags.

Feed

Follow me on Twitter
My code on GitHub

Contact
About