added eof method to parser