convert grammar to LL(1); remove @now and use functional style in the parser