modify parser following K&R