From: Lucretia <laguest9000@googlemail.com>
Subject: Placement of pragmas in the grammar (language laywers required)
Date: Wed, 9 Dec 2015 23:46:44 -0800 (PST)
Date: 2015-12-09T23:46:44-08:00 [thread overview]
Message-ID: <f3829f17-b212-447f-b130-f9d1f89c93f0@googlegroups.com> (raw)
Hi,
I'm looking at the 2012 grammar in the AARM/LRM and I just don't get why you designers don't include pragma's in their correct places instead of saying:
5 Pragmas are only allowed at the following places in a program:
6 After a semicolon delimiter, but not within a formal_part or discriminant_part.
7/3 {AI05-0100-1} {AI05-0163-1} At any place where the syntax rules allow a construct defined by a syntactic category whose name ends with "declaration", "item", "statement", "clause", or "alternative", or one of the syntactic categories variant or exception_handler; but not in place of such a construct if the construct is required, or is part of a list that is required to have at least one such construct. Also at any place where a compilation_unit would be allowed.
7.1/3 {AI05-0163-1} In place of a statement in a sequence_of_statements.
7.2/3 {AI05-0100-1} At any place where a compilation_unit is allowed.
etc.
So, for basic_declaration, do I add pragma as follows:
basic_declaration ::=
type_declaration | subtype_declaration
| object_declaration | number_declaration
| subprogram_declaration | abstract_subprogram_declaration
| null_procedure_declaration | expression_function_declaration
| package_declaration | renaming_declaration
| exception_declaration | generic_declaration
| generic_instantiation
| pragma
and then inside each of the above *_declaration's, e.g. type_declaration:
type_declaration ::= full_type_declaration
| incomplete_type_declaration
| private_type_declaration
| private_extension_declaration
| pragma
and again inside the above *_declaration's? And then, e.g component_item:
component_item ::= component_declaration | aspect_clause | pragma
and agian inside the component_declaration rule?
Seems overkill.
I must be missing something here.
Thanks,
Luke.
next reply other threads:[~2015-12-10 7:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-10 7:46 Lucretia [this message]
2015-12-10 14:39 ` Placement of pragmas in the grammar (language laywers required) Lucretia
2015-12-10 17:12 ` Bob Duff
2015-12-10 17:59 ` Lucretia
2015-12-10 18:19 ` Bob Duff
2015-12-10 23:47 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox