comp.lang.ada
 help / color / mirror / Atom feed
* Placement of pragmas in the grammar (language laywers required)
@ 2015-12-10  7:46 Lucretia
  2015-12-10 14:39 ` Lucretia
  2015-12-10 17:12 ` Bob Duff
  0 siblings, 2 replies; 6+ messages in thread
From: Lucretia @ 2015-12-10  7:46 UTC (permalink / 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.



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

end of thread, other threads:[~2015-12-10 23:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-10  7:46 Placement of pragmas in the grammar (language laywers required) Lucretia
2015-12-10 14:39 ` 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

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