[Parser] Added function which iterates over statements