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, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1be1b347b5b5ad43 X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: Ayacc/Aflex "entropy" (P2Ada) Date: 1999/10/31 Message-ID: <7vhib3$8o1$1@nnrp1.deja.com>#1/1 X-Deja-AN: 542687973 References: <3813716C.52655126@Maths.UniNe.CH> <7v2400$e02$1@nnrp1.deja.com> <7v30jd$3i6$1@nnrp1.deja.com> <7v3u0f$nn6$1@nnrp1.deja.com> <3816331A.99C596D2@mitre.org> <7v5ns8$2h1$1@nnrp1.deja.com> <3819CBDA.E801A064@mitre.org> X-Http-Proxy: 1.0 x40.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Sun Oct 31 14:05:24 1999 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-10-31T00:00:00+00:00 List-Id: In article <3819CBDA.E801A064@mitre.org>, "Robert I. Eachus" wrote: > package body Foobar is > ... > procedure Foo(X: in out Bar); > I: Integer :=3; > begin ... > > Is syntactically correct in Ada, but cannot be correct > semantically. However there is no semantic rule that says > it is illegal either. Remember to check that the set of declarations (where I is in the above) does not include a pragma Import for Foo, which renders this example semantically legal (have a look in the GNAT code for the rather complex details in handling this case correctly :-) > Putting in a special case rule to recognize that the semicolon > should be an "is" helps a lot, but you also want to look > further to deliver the right error message. If Robert Eachus is saying that it is easy to add rules to a typical table driver parser to handle this case, all I can say is (a) I never saw it done and (b) I think it would be tricky, and (c) the only thing that would convince me is an actual working example. The trouble in this kind of error detection and recovery is very much that the devil is in the engineering details. For example, people have suggested for years the idea of using indentation to help error recovery, but I have not seen this systematically implemented till GNAT, and it is really quite tricky (have a look at par-endh.adb in the GNAT sources for example!) Robert Dewar Sent via Deja.com http://www.deja.com/ Before you buy.