From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d4b13594b8779b99 X-Google-Attributes: gid103376,public From: "Samuel T. Harris" Subject: Re: Improving Ada Exceptions Date: 1997/11/10 Message-ID: <34674022.5B0C22E1@hso.link.com>#1/1 X-Deja-AN: 288349036 References: <63ll1g$7f8$2@trumpet.uni-mannheim.de> <640d4n$l431@castor.cca.rockwell.com> Organization: Hughes Training Inc. - Houston Operations Newsgroups: comp.lang.ada Date: 1997-11-10T00:00:00+00:00 List-Id: Wayne Magor wrote: > > My biggest gripe with Ada exceptions is that there is no indication in the > spec as to what exceptions a subprogram can raise (or propagate). > > You cannot know for sure that *your* code is correct until you examine the > bodies of all the subprograms you call for "raise" statements. You then > must examine all the subprograms that they call, and so forth. > > Perhaps a tool is needed that does this type of analysis. Then, at least > comments can be added to every subprogram spec indicating what exceptions > it could raise. Knowing this, you should be able to create a tool that > tells you if any of your code is propagating exceptions that you didn't > expect to be propagating. Then, if you don't want it to be propagated > you can handle it in your subprogram. > > Recovering from unexpected exceptions is important in critical applications, > but it's difficult to achieve. If you compiler provides an ASIS (Ada Semantic Interface Specification) then you should be able to produce such a tool. I've used Ada 83 ASIS extensively, but have not dabbled with Ada 95 ASIS yet. But that is the route I'd take. Alternatively, you could get an Ada yacc grammar and do the lex/yacc or aflex/ayacc kind of thing. I believe that is more work, but ASIS does have a significant learning curve. -- Samuel T. Harris, Senior Engineer Hughes Training, Inc. - Houston Operations 2224 Bay Area Blvd. Houston, TX 77058-2099 "If you can make it, We can fake it!"