comp.lang.ada
 help / color / mirror / Atom feed
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
Date: 19 Jul 93 16:56:04 GMT	[thread overview]
Message-ID: <CAF8DG.AqH@irvine.com> (raw)

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

             reply	other threads:[~1993-07-19 16:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-07-19 16:56 Adam Beneschan [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-07-30 12:00 Forcing default representations Bob Gilbert
1993-07-30  1:15 pipex!warwick!zaphod.crihan.fr!univ-lyon1.fr!scsing.switch.ch!epflnews!di
1993-07-26 18:30 Robert I. Eachus
1993-07-26 15:12 agate!howland.reston.ans.net!europa.eng.gtefsd.com!news.ans.net!newsgate.watson.ibm.com!yktnews.watson.ibm.com!ncohen
1993-07-24 21:16 Erik Magnuson
1993-07-24 17:13 pipex!sunic!news.funet.fi!funic!news.eunet.fi!prime!mits!rkaivola
1993-07-23 19:15 Gary Morris @ignite
1993-07-22 18:34 Bob Crispen
1993-07-20 12:57 Bob Crispen
1993-07-16 22:26 dog.ee.lbl.gov!overload.lbl.gov!agate!howland.reston.ans.net!noc.near.net
1993-07-13 19:22 crispen
replies disabled

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