home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.ada
- Path: sparky!uunet!noc.near.net!inmet!spock!stt
- From: stt@spock.camb.inmet.com (Tucker Taft)
- Subject: Re: Another Question about protected records
- Message-ID: <1992Aug25.175331.26911@inmet.camb.inmet.com>
- Sender: news@inmet.camb.inmet.com
- Nntp-Posting-Host: spock
- Organization: Intermetrics Inc, Cambridge MA
- References: <1992Aug19.222949.12391@seas.gwu.edu>
- Date: Tue, 25 Aug 1992 17:53:31 GMT
- Lines: 87
-
- In article <1992Aug19.222949.12391@seas.gwu.edu>
- lodhi@seas.gwu.edu (Fakhar Lodhi) writes:
-
- >Yesterday I asked two questions about protected records. While I am
- >still waiting for the answers, I have another question about their syntax.
- >I would greatly appreciate if some body, especially some one in the Ada9x
- >design team, could provide me the answers. Thanks.
- >
- >Now the question is:
- >
- >Section 9.5 of the Ada 9X Mapping Vol. II (Mapping Specification),
- >version 4.0, 24 Dec. 91, gives the syntax of a protected record specification
- >as follows:
- >
- >(para 5)
- >
- > protected_record_specification ::=
- > protected [type] identifier [discriminat_part] is
- > {protected_operation_declaration}
- > private
- > {protected_operation_declaration}
- > record
- > component_list
- > end [protected_record_simple_name]
- >
- >The same syntax is used in example given in section 9.6
- >
- >But, an example in section 3.3.2.1 of Ada 9X Mapping Vol. I (Mapping Rationale)
- >ver. 4.1, 4 March 92 uses a different syntax. The code is as follows:
- >
- > < some stuff deleted >
- > protected record type mailbox is
- >
- > < stuff deleted >
- > private record
- >
- > < stuff deleted>
- >
- > end record;
- >
- >which is clearly different from the syntax given above.
- >(end record is not a valid syntax.)
- >
- >Now the question is, which one of the two is correct?
-
- Presumably you are referring to the following example
- (slightly different from what you typed in):
-
- protected type MAILBOX is
- . . .
- private record
- . . .
- end record;
-
- This example has the typographical error
- you mention ("end record" instead of end [identifier])
- but is otherwise consistent with the BNF given above, because
- {protected_operation_declaration}
- matches the empty sequence, allowing "private" and "record"
- to appear right next to each other.
-
- In any case, we are currently considering dropping the reserved
- word "record" completely from the syntax (and name) for protected types,
- so that the new syntax would be :
-
- protected [type] identifier[discriminant_part] is
- {protected_operation_declaration}
- private
- {protected_item}
- end [identifier];
-
- where protected_item is either a protected_operation_declaration
- or a component_declaration.
-
- >Once again, I would greatly appreciate your help. Thanks.
-
- Thank you for pointing out the typographical error in the example.
- Feel free to send other editorial or technical comments directly to
- "ada9x-mrt@inmet.com" with the format indicated in the front of
- the relevant mapping document (!topic, !reference, etc.)
-
- >Fakhar Lodhi
-
- S. Tucker Taft stt@inmet.com
- Ada 9X Mapping/Revision Team
- Intermetrics, Inc.
- Cambridge, MA 02138
-