For those that haven't seen it, ZPL is a text-based markup language used for printing labels from special-purpose printers. A UPS shipping label would be a good example.
The markup language is quite primitive. There are modal commands to set a few state values, but the bulk of the language is one-liners that take the form <command><parameters><data>
. There is no flow-control or nesting.
I want to write a rendering engine that interprets ZPL and renders to an image. There are a couple projects that have started down this road, but those projects are not complete enough for commercial use.
My question is: What do I need to learn to write a great <something>
that will parse a ZPL document and convert that into commands I can execute? (By 'execute', I mean draw.)
Is this a parser? a lexer? tokenizer? interpreter? Is there some subset of compiler design theory that would be the most efficient path to success for this kind of project? ... and what is that called?