The only thing I can guess is that your "EOF;" isn't the first thing on its line. In your code above there are no indents, but I hope that's just a code-paste thing and it's indented appropriately. However, make EOF; the very beginning thing on its line.
Couple of notes to make - EOF means End Of File. You can use any word you wish there, so EOF (whilst conventional in tutorials) isn't a necessary thing to use. Also you don't need those quotes there either, unless they're there for a reason.