[parser] some changes to make it able to write.