title: Checked exceptions in visitors
body: <p>I am learning ANTLR4 and I have no previous experience with parser generators. </p>
  
  <p>When I define my own visitor implementation, I have to override methods of the BaseVisitor (I am looking for instance at the EvalVisitor class at <a href="http://pragprog.com/book/tpantlr2/the-definitive-antlr-4-reference">page 40 of the book</a>). In case my method implementation possibly throws an exception, what should I do? I cannot use a checked exception since the original method has an empty throws clause. Am I expected to use unchecked exceptions? (this seems a bad Java design). For instance, assume that in the EvalVisitor class I want method visitId (page 41) to throw a user-defined exception, say UndefinedId, rather than returning 0. How should I write my code?</p>