comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Is it really Ok to assert that the Ada syntax is a context-free grammar ?
Date: Wed, 20 Feb 2008 15:51:13 -0500
Date: 2008-02-20T15:51:13-05:00	[thread overview]
Message-ID: <wcczltv8i7y.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 9012d70c-8d61-4e2e-9eda-c12d48f1d9e1@s19g2000prg.googlegroups.com

Hibou57 <yannick_duchene@yahoo.fr> writes:

> On 20 f�v, 11:34, Ludovic Brenta <ludo...@ludovic-brenta.org> wrote:
>> Jeffrey is correct; it is not a "type cast", it is a "type conversion"
>> and there is no such thing as "Ada.Unchecked_Cast". Yes, this is nit-
>> picking; why would we choose Ada if we didn't care about details and
>> wording?
>
> Ok, forgive me for the english mistake : I use either type cast or
> type conversion to mean the same thing. I will take care in the futur.

I think there's nothing wrong with using informal terms when talking
about Ada, so long as the meaning is clear from context.  For example,
I sometimes use "pointer" to mean "access type" or "access value", and I
don't see anything wrong with that.  (And some Ada folks lecture me
about it.  ;-))

The problem with "type cast" is that in the Ada context, it could mean
two different things -- a type_conversion (which is well-defined
according to the high-level semantics) or an "unchecked conversion"
(i.e. an instance of Ada.Unchecked_Conversion, which is defined
in terms of bit-level representation).  The difference is important!

> But I'm still not sure about the assertion that it is context free
> (while, Ok, the AEM does not tell it is LR(1))

The grammar given in the Ada RM under "Syntax" is a context free
grammar.  It is, however, ambiguous, and therefore not LR(1).

You noted the biggest ambiguity -- X(Y) could mean various things.
There are a few others (e.g. .all can be implicit in some cases, and
subprogram calls with no parameters don't get empty parens).  The full
power of semantic analysis is required to disambiguate these things, in
the general case.

- Bob



  parent reply	other threads:[~2008-02-20 20:51 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-20  0:47 Is it really Ok to assert that the Ada syntax is a context-free grammar ? Hibou57
2008-02-20  2:06 ` Jeffrey R. Carter
2008-02-20 10:05   ` Martin Krischik
2008-02-20 10:34     ` Ludovic Brenta
2008-02-20 11:13       ` Dmitry A. Kazakov
2008-02-22  8:57         ` Stephen Leake
2008-02-22 10:44           ` Dmitry A. Kazakov
2008-02-20 14:22       ` Hibou57
2008-02-20 15:19         ` Niklas Holsti
2008-02-20 18:34           ` Hibou57 (Yannick Duchêne)
2008-02-20 19:10             ` Hibou57 (Yannick Duchêne)
2008-02-21  0:39               ` Randy Brukardt
2008-02-21  0:56                 ` Hibou57 (Yannick Duchêne)
2008-02-21 22:19                   ` Randy Brukardt
2008-02-21 23:54                     ` Hibou57 (Yannick Duchêne)
2008-02-22 19:51                       ` Randy Brukardt
2008-02-23 18:13                         ` Hibou57 (Yannick Duchêne)
2008-02-21 22:19                   ` Randy Brukardt
2008-02-20 20:22             ` Niklas Holsti
2008-02-20 21:38             ` Manuel Collado
2008-02-21  0:30               ` Hibou57 (Yannick Duchêne)
2008-02-20 20:51         ` Robert A Duff [this message]
2008-02-21 19:24       ` Martin Krischik
2008-02-22 20:17         ` Simon Wright
2008-02-25 21:47           ` Samuel Tardieu
2008-02-23 19:02         ` Maciej Sobczak
2008-02-20 18:27     ` Jeffrey R. Carter
2008-02-21 19:20       ` Martin Krischik
2008-02-21 21:31         ` Jeffrey R. Carter
2008-02-20  5:53 ` Niklas Holsti
2008-02-20 16:43 ` Adam Beneschan
replies disabled

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