Generalization of parsec's expression parser.