From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fd173879a595bde X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!f14g2000cwb.googlegroups.com!not-for-mail From: "Britt Snodgrass" Newsgroups: comp.lang.ada Subject: Re: Default rep specs for record types - documented?? Date: 4 Nov 2005 07:27:53 -0800 Organization: http://groups.google.com Message-ID: <1131118073.282094.236790@f14g2000cwb.googlegroups.com> References: NNTP-Posting-Host: 205.175.225.5 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1131118080 27417 127.0.0.1 (4 Nov 2005 15:28:00 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 4 Nov 2005 15:28:00 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: f14g2000cwb.googlegroups.com; posting-host=205.175.225.5; posting-account=iQEqXQ0AAACqS3Ok4UXIuHodYg1uri3K Xref: g2news1.google.com comp.lang.ada:6193 Date: 2005-11-04T07:27:53-08:00 List-Id: Stephen Leake wrote: > Stephen Leake writes: > > > One solution is to have the compiler write the representation clause > for me; in this case, if we make reasonable assumptions about > 'record_type', there is only one reasonable rep clause. So I'd like to > define: Starting with version 4.2 I believe, the Apex Ada editor has a "Build Rep Clauses" feature that will insert all applicable compiler generated confirming representation clauses following a type declaration. I've tried it with Apex NT 4.2.0c and it works nicely. Here is an example: type Record_Type is record Field_0 : Integer_16; Field_1 : Integer_16; Field_2 : Integer_16; end record; for Record_Type use record Field_0 at 0 range 0 .. 15; Field_1 at 2 range 0 .. 15; Field_2 at 4 range 0 .. 15; end record; for Record_Type'Alignment use 4; for Record_Type'Size use 48; pragma Convention (Ada_Pass_By_Copy, Record_Type); Everything after the record type declaration was generated by the compiler and inserted by the editor, -- Britt