From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 19 Jul 93 16:56:04 GMT From: agate!howland.reston.ans.net!math.ohio-state.edu!sdd.hp.com!network.ucsd. edu!news.cerf.net!shrike.irvine.com!adam@ucbvax.Berkeley.EDU (Adam Beneschan) Subject: Re: Forcing default representations Message-ID: List-Id: In article <9307131922.AA04017@eight-ball.boeing.com> crispen@eight-ball.boeing.com (crispen) writes: [stuff deleted] > But, I can define this record: > > for Landing_Gear_Parameters use > record > Position at 0 range Four_Bytes; > State at 4 range One_Byte; > -- 3 bytes spare > Crab_Angle at 8 range Four_Bytes; > end record; > Landing_Gear_Parameters_Size : constant := 12 * Bytes; > for Landing_Gear_Parameters'size use Landing_Gear_Parameters_Size; > [more stuff deleted] > p.p.s: I've defined: > > type One_Byte is range 0..7; > type Two_Bytes is range 0..15; > type Three_Bytes is range 0..23; > type Four_Bytes is range 0..31; > > Cute trick, eh? Is this cute trick actually legal? The LRM defines component_clause ::= COMPONENT_name at STATIC_simple_expression range STATIC_range; [13.4(2)] range ::= RANGE_attribute | simple_expression .. simple_expression [3.5(2)] I don't see how a type name fits into the component clause of a record rep clause, given these syntax definitions. Am I missing something somewhere else in the LRM? Or is there an AI that allows this trick? -- thanks, Adam