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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Interesting article on ARG work Date: Mon, 9 Apr 2018 15:24:39 -0500 Organization: JSA Research & Innovation Message-ID: References: <1b44444f-c1b3-414e-84fb-8798961487c3@googlegroups.com> <62ee0aac-49da-4925-b9aa-a16695b3fc45@googlegroups.com> <9879872e-c18a-4667-afe5-41ce0f54559f@googlegroups.com> <80db2d05-744f-4201-ba1b-4436f8040491@googlegroups.com> <59f9ab6d-d6ba-45ff-a6f0-c5699983d9e8@googlegroups.com> <1a390e22-f49f-4028-8e58-ca4d0f51e4b6@googlegroups.com> Injection-Date: Mon, 9 Apr 2018 20:24:40 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="26554"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:51423 Date: 2018-04-09T15:24:39-05:00 List-Id: Dmitry A. Kazakov" wrote in message news:pag4fd$pn4$1@gioia.aioe.org... > On 2018-04-09 18:12, Niklas Holsti wrote: > >> For example, the text >> >> if Foo then >> Bar; >> @ else >> @ Baz; >> end if; >> >> would be parsed in four ways, according to the four combinations of >> choices (enabled/disabled) for the two @ signs: > > [...] > > It is a trivial recursive-descent parser. "else" cannot follow "@", > because there is no statement starting with "else". Full stop. Of course, that would very much emasulate the feature (probably 25% of the @-code in Janus/Ada is to remove various "elsif" and "else" cases). [Remember, we designed this code to work on very small memory hosts, so anything not critical to the operation of the compiler is removed. One reason that I don't use that any more in production code.] Another common use that you wouldn't allow is to remove the exception handler from some code. (For Janus/Ada, the existence of an exception handler has a cost, so if it is not needed for production code, it is best completely eliminated.) I think you could come up with a rule that would be less harmful to the feature than requiring full statements, especially for composite statements like if and case and blocks. Randy.