The parser... well, that shouldn't be hard, it's a straight-up grammar.