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,3d3f20d31be1c33a X-Google-Attributes: gid103376,public X-Google-Thread: f43e6,2c6139ce13be9980 X-Google-Attributes: gidf43e6,public X-Google-Thread: fac41,2c6139ce13be9980 X-Google-Attributes: gidfac41,public From: stt@houdini.camb.inmet.com (Tucker Taft) Subject: Re: Interface/Implementation (was Re: Design by Contract) Date: 1997/09/10 Message-ID: #1/1 X-Deja-AN: 271319996 Sender: news@inmet.camb.inmet.com (USENET news) References: Followup-To: comp.software-eng,comp.lang.ada,comp.lang.eiffel X-Nntp-Posting-Host: houdini.camb.inmet.com Organization: Intermetrics, Inc. Newsgroups: comp.software-eng,comp.lang.ada,comp.lang.eiffel Date: 1997-09-10T00:00:00+00:00 List-Id: Robert Dewar (dewar@merv.cs.nyu.edu) wrote: : ... It is in fact NOT possible in any reasonable : way to create a one-pass compiler for Ada 95, and certainly no one has : done so. In the "for what it's worth" department... The AdaMagic front end is a "nearly" one-pass Ada 95 front end. It "quick-parses" ahead only as necessary to find things like labels and the name of a generic unit, and it does static analysis for all declarations between bodies before emitting elaboration code for the declarations (because rep-clauses can follow the declarations, but not follow an intervening body). But other than that, it can generate IL (intermediate language) as it goes. What this means is that you could feed the source code for a package body into the front end and start seeing stuff coming out of the other end before you finished feeding in the whole package body. Be that as it may, I agree with Robert that the "one pass" model is most important in its role in simplifying the semantics of "elaboration" (the executable code associated with declarations) and in helpng with human comprehension. Coming from Ada, it is somewhat alarming to read Java code where fields and methods can be referenced in code prior to their declarations. This seems to be one side-effect of a lack of separate method declarations in Java. Java does have an "import" clause which must come first, analagous to the Ada "with" clause, when referring to external (packages of) classes. Eiffel seems to have foregone even this bit of declaration-before-use -- there seems no need to declare the importing of one class prior to using it anywhere inside another. Though to be fair, even in Java, "import" is not needed for java.lang.*, nor if you are willing to use the fully qualified class name rather than just its simple name. -- -Tucker Taft stt@inmet.com http://www.inmet.com/~stt/ Intermetrics, Inc. Burlington, MA USA