comp.lang.ada
 help / color / mirror / Atom feed
From: olivermkellogg@gmail.com
Subject: Ada grammar rules for names too permissive?
Date: Sat, 29 Dec 2018 10:20:39 -0800 (PST)
Date: 2018-12-29T10:20:39-08:00	[thread overview]
Message-ID: <30ba8954-a19e-4c95-b350-798b0276db41@googlegroups.com> (raw)

Hi,

RM section 3.2.2 defines

  subtype_mark ::= (subtype_)name

where (subtype_) is subtype_ rendered in italics, i.e. essentially

  subtype_mark ::= name

This looks overly permissive to me, considering 4.1

  name ::=
     direct_name | explicit_dereference
   | indexed_component | slice
   | selected_component | attribute_reference
   | type_conversion | function_call
   | character_literal | qualified_expression
   | generalized_reference | generalized_indexing
   | target_name

The AARM elaborates in paragraph 4a:

*Ramification*: Note that name includes attribute_reference; thus, S'Base can be used as a subtype_mark.

My question is, why is subtype_mark not defined as follows:

  compound_name ::= identifier { . identifier }

  subtype_mark ::= compound_name [ ' Base ]


Similarly, RM section 10.1.1 defines

  parent_unit_name ::= name

Here my question also applies, why not

  parent_unit_name ::= compound_name


- Oliver
(currently fighting ambiguities in the ANTLR grammar caused by laxity of rules)

             reply	other threads:[~2018-12-29 18:20 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-29 18:20 olivermkellogg [this message]
2018-12-31 21:45 ` Ada grammar rules for names too permissive? Randy Brukardt
2019-01-01  8:44   ` Dmitry A. Kazakov
2019-01-01 19:49     ` Stephen Leake
2019-01-01 20:42       ` Dmitry A. Kazakov
2019-01-02 19:21         ` Stephen Leake
2019-01-02 20:47           ` Dmitry A. Kazakov
2019-01-03 21:45             ` Stephen Leake
2019-01-03 22:34               ` Jere
2019-01-05 18:46                 ` Stephen Leake
2019-01-07 11:11                   ` J-P. Rosen
2019-01-08 18:58                     ` Stephen Leake
2019-01-04  8:53               ` Dmitry A. Kazakov
2019-01-03 22:39     ` olivermkellogg
2019-01-04  8:58       ` Dmitry A. Kazakov
2019-01-05  8:45         ` Randy Brukardt
2019-01-05 18:50       ` Stephen Leake
2019-01-01 19:46   ` olivermkellogg
2019-01-03 22:36     ` Randy Brukardt
2019-01-01 19:46 ` Stephen Leake
2019-01-01 21:03   ` olivermkellogg
2019-01-02 19:42     ` Stephen Leake
replies disabled

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