add flush instruction to parser, grammar, and api