Hi Andrew and Lars: I inspected Doug's code and found: Utils { /** Make sure file exists and is readable. */ public static InputStream makeInputStream(File file) throws IOException (@ if (!file.exists()) { Stream.err.println("Error: Input file " + file + " does not exist."); } else if (!file.canRead()) { Stream.err.println("Error: Input file " + file + " exists but is not readable."); } else if (!file.isFile()) { Stream.err.println("Error: Input file " + file + " is not a plain file."); } else try { FileInputStream in = new FileInputStream(file); return in; } catch (FileNotFoundException exc) { // This shouldn't happen... throw new RuntimeException(exc.toString()); } throw new IOException(); @) } Checking the cd: MethodDef = MethodSignature MethodBody. MethodSignature = List(MethodKeyword) JavaType MethodName "(" [ Commalist(MethodParm) ] ")" Throws. Throws = [ *s "throws" Commalist(ClassName) ]. MethodBody : VerbatimMethodBody | AdaptiveMethodBody | NoMethodBody. This means that adaptive methods can throw exceptions. You can write something like: void f() throws IOException to A (Visitor); Does this help? -- Karl From lth@ccs.neu.edu Wed Jun 3 09:01:54 1998 To: amiller@xis.xerox.com (Andrew Miller) cc: lieber@ccs.neu.edu, com3362@ccs.neu.edu, dem@ccs.neu.edu Subject: Re: Re[4]: Demjava From: Lars Thomas Hansen > Is there a way to delcare a traversal as "throws "? > Without this capability I don't think Java will let me throw the > exception. This capability was designed (but never implemented) for an earlier version of Demeter/Java (see http://www.ccs.neu.edu/home/lth/aao/index.html). You're right -- without it, you won't be able to use exceptions in a sensible manner. --lars From amiller@xis.xerox.com Wed Jun 3 08:48:03 1998 Is there a way to delcare a traversal as "throws "? Without this capability I don't think Java will let me throw the exception. Andrew ______________________________ Reply Separator _________________________________ Subject: Re: Re[2]: Demjava Author: Karl Lieberherr at intergate Date: 6/3/98 5:21 AM Andrew Miller writes: Ok. Now another question. Have you added some kind of early-out construct to traversals? Let's say I was searching for something and I've found it. I now want to end the traversal. No we don't have a structure-shy construct to get out from a deep traversal. It is something we have been thinking about. Your implementation will give some clues on how to approach this. -- Karl