comp.lang.ada
 help / color / mirror / Atom feed
* Ada grammar rules for names too permissive?
@ 2018-12-29 18:20 olivermkellogg
  2018-12-31 21:45 ` Randy Brukardt
  2019-01-01 19:46 ` Stephen Leake
  0 siblings, 2 replies; 22+ messages in thread
From: olivermkellogg @ 2018-12-29 18:20 UTC (permalink / 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)

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2019-01-08 18:58 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-29 18:20 Ada grammar rules for names too permissive? olivermkellogg
2018-12-31 21:45 ` 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

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