Arabica: Suddenly, a new parser

Over the last few months I’ve spent a bit of time, on and off, looking at the Spirit parser framework. It’s a pretty amazing piece of work which allows you to express parsers pretty much directly in EBNF. Needless to say it uses the miracle of template meta-programming in a pretty remarkable way. I’d always looked at it and thought this is exceedingly clever, but how do I actually use it, until last night. In five minutes, snatched before I put Daniel to bed, I had an aha moment.

This morning, I’ve used the Spirit framework to put together a new SAX parser, and it already calls all of the ContentHandler functions except skippedEntity. I think that’s pretty incredible, given it took me two weeks to write a partial DTD parser and that only has about 5 things to notify. I’ve got no feel for how it’ll compare with expat and the rest, too early, but there’s already the obvious benefit of having nothing extra to link.

Just discover that the expat wrapper didn’t report processing instructions. Ooops. Fixed it.

I’m off to walk the dog in the rain. My new parser, called Garden, does enough to be useful. It does basic parsing, predefined entities and character entities. Doesn’t do DTDs, external entities, namespaces or anything else not in ContentHandler. It’s enough though.


Tagged code, arabica, xml, and c++


Jez Higgins

Freelance software grandad
software created
extended or repaired


Jez Higgins

Freelance software grandad
software created
extended or repaired


Jez Higgins

Freelance software grandad
software created
extended or repaired



Jez Higgins

Freelance software grandad
software created
extended or repaired


Jez Higgins

Freelance software grandad
software created
extended or repaired


Jez Higgins

Freelance software grandad
software created
extended or repaired