comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: Ayacc/Aflex "entropy" (P2Ada)
Date: 1999/10/31
Date: 1999-10-31T00:00:00+00:00	[thread overview]
Message-ID: <7vhib3$8o1$1@nnrp1.deja.com> (raw)
In-Reply-To: 3819CBDA.E801A064@mitre.org

In article <3819CBDA.E801A064@mitre.org>,
  "Robert I. Eachus" <eachus@mitre.org> 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.




  reply	other threads:[~1999-10-31  0:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-24  0:00 Ayacc/Aflex "entropy" (P2Ada) Gautier
1999-10-25  0:00 ` Ray Blaak
1999-10-25  0:00   ` Gautier
1999-10-25  0:00 ` Ted Dennison
1999-10-25  0:00 ` Ted Dennison
1999-10-26  0:00   ` Robert Dewar
1999-10-26  0:00     ` David Starner
1999-10-26  0:00       ` Robert Dewar
1999-10-30  0:00         ` Brian Rogoff
1999-10-31  0:00           ` Robert Dewar
1999-10-26  0:00     ` bourguet
1999-10-26  0:00       ` Robert I. Eachus
1999-10-27  0:00         ` Robert Dewar
1999-10-27  0:00           ` Ted Dennison
1999-10-27  0:00           ` bourguet
1999-10-29  0:00           ` Robert I. Eachus
1999-10-31  0:00             ` Robert Dewar [this message]
1999-11-01  0:00               ` Robert I. Eachus
1999-10-26  0:00       ` Ted Dennison
1999-10-26  0:00         ` William B. Clodius
1999-10-26  0:00     ` Gautier
1999-10-27  0:00       ` Tarjei Jensen
1999-10-27  0:00         ` David Botton
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox