started work on parser implementation

Implementing the parser is harder than expected, since the grammar is somewhat
convoluted. The parser code might become fairly complicated in order to cater
for all possibilities.