add some code contracts in Parser Class