complete parser (almost)