home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / ada / 2437 < prev    next >
Encoding:
Text File  |  1992-08-25  |  3.1 KB  |  100 lines

  1. Newsgroups: comp.lang.ada
  2. Path: sparky!uunet!noc.near.net!inmet!spock!stt
  3. From: stt@spock.camb.inmet.com (Tucker Taft)
  4. Subject: Re: Another Question about protected records
  5. Message-ID: <1992Aug25.175331.26911@inmet.camb.inmet.com>
  6. Sender: news@inmet.camb.inmet.com
  7. Nntp-Posting-Host: spock
  8. Organization: Intermetrics Inc, Cambridge MA
  9. References: <1992Aug19.222949.12391@seas.gwu.edu>
  10. Date: Tue, 25 Aug 1992 17:53:31 GMT
  11. Lines: 87
  12.  
  13. In article <1992Aug19.222949.12391@seas.gwu.edu> 
  14. lodhi@seas.gwu.edu (Fakhar Lodhi) writes:
  15.  
  16. >Yesterday I asked two questions about protected records. While I am 
  17. >still waiting for the answers, I have another question about their syntax.
  18. >I would greatly appreciate if some body, especially some one in the Ada9x 
  19. >design team, could provide me the answers. Thanks.
  20. >
  21. >Now the question is:
  22. >
  23. >Section 9.5 of the Ada 9X Mapping Vol. II (Mapping Specification),
  24. >version 4.0, 24 Dec. 91, gives the syntax of a protected record specification
  25. >as follows:
  26. >
  27. >(para 5)
  28. >
  29. >   protected_record_specification ::=
  30. >     protected [type] identifier [discriminat_part] is
  31. >       {protected_operation_declaration}
  32. >     private
  33. >       {protected_operation_declaration}
  34. >     record
  35. >       component_list
  36. >     end [protected_record_simple_name]
  37. >
  38. >The same syntax is used in example given in section 9.6
  39. >
  40. >But, an example in section 3.3.2.1 of Ada 9X Mapping Vol. I (Mapping Rationale)
  41. >ver. 4.1, 4 March 92 uses a different syntax. The code is as follows:
  42. >
  43. >    < some stuff deleted >
  44. >    protected record type mailbox is
  45. >      
  46. >       < stuff deleted >
  47. >    private record
  48. >       
  49. >       < stuff deleted>
  50. >
  51. >    end record;
  52. >
  53. >which is clearly different from the syntax given above.
  54. >(end record is not a valid syntax.)
  55. >
  56. >Now the question is, which one of the two is correct?
  57.  
  58. Presumably you are referring to the following example 
  59. (slightly different from what you typed in):
  60.  
  61.     protected type MAILBOX is
  62.         . . .
  63.     private record
  64.         . . .
  65.     end record;
  66.  
  67. This example has the typographical error
  68. you mention ("end record" instead of end [identifier])
  69. but is otherwise consistent with the BNF given above, because
  70.   {protected_operation_declaration}
  71. matches the empty sequence, allowing "private" and "record"
  72. to appear right next to each other.
  73.  
  74. In any case, we are currently considering dropping the reserved
  75. word "record" completely from the syntax (and name) for protected types,
  76. so that the new syntax would be :
  77.  
  78.    protected [type] identifier[discriminant_part] is
  79.      {protected_operation_declaration}
  80.    private
  81.      {protected_item}
  82.    end [identifier];
  83.  
  84. where protected_item is either a protected_operation_declaration
  85. or a component_declaration.
  86.  
  87. >Once again, I would greatly appreciate your help. Thanks.
  88.  
  89. Thank you for pointing out the typographical error in the example.
  90. Feel free to send other editorial or technical comments directly to 
  91. "ada9x-mrt@inmet.com" with the format indicated in the front of 
  92. the relevant mapping document (!topic, !reference, etc.)
  93.  
  94. >Fakhar Lodhi
  95.  
  96. S. Tucker Taft  stt@inmet.com
  97. Ada 9X Mapping/Revision Team
  98. Intermetrics, Inc.
  99. Cambridge, MA  02138
  100.