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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,703b1789254e284a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-02 09:36:07 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!207.115.63.138!newscon04.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr14.news.prodigy.com.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Rep Spec Report with ASIS References: X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 64.175.240.170 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr14.news.prodigy.com 1012671325 ST000 64.175.240.170 (Sat, 02 Feb 2002 12:35:25 EST) NNTP-Posting-Date: Sat, 02 Feb 2002 12:35:25 EST Organization: Prodigy Internet http://www.prodigy.com X-UserInfo1: Q[O[SX[DGJVOBFD[LZKJOPHAWB\^PBQLGPQRJVMHQAVTUZ]CLNTCPFK[WDXDHV[K^FCGJCJLPF_D_NCC@FUG^Q\DINVAXSLIFXYJSSCCALP@PB@\OS@BITWAH\CQZKJMMD^SJA^NXA\GVLSRBD^M_NW_F[YLVTWIGAXAQBOATKBBQRXECDFDMQ\DZFUE@\JM Date: Sat, 02 Feb 2002 17:35:25 GMT Xref: archiver1.google.com comp.lang.ada:19533 Date: 2002-02-02T17:35:25+00:00 List-Id: >think it wouldn't be terribly hard to walk throught the declarations, >find record type definitions, and generate a Representation >Specification Report for each one - would it? Do you mean scan type R is record A : Boolean; B : Integer; end record; and produce something like for R use record B at 0 range 0 .. 15; A at 2 range 0 .. 7; end record; Only the compiler can do that because only the compiler knows how big its Integer, Boolean, etc are and how it optimally arranges them in a non-rep-speced record. >After a bit of digging around, we found that the compiler being ported TO >provides the ability to CREATE a rep spec for a selected record - that is, >it writes the "for use", and "at" clauses IN THE CODE. Unfortunately, this >is NOT what she wants. She wants a separate report. Can't she write a q&d program to scan and print out just the parts she wants? Another possibility, useful for the FROM compiler that doesn't produce such a nice output, would be to scan and generate a program that creates an instance X of each record type, then uses the Storage Place Attributes to print. eg. type R is record A : Boolean; B : Integer; end record; X_R : R; begin Ada.Text_IO.Put_Line("A" & " at" & Integer'image(X_R.A'Position) & " range" & Integer'image(X_R.A'First_Bit) & " .." & Integer'image(X_R.A'Last_Bit) & ";"); Ada.Text_IO.Put_Line("B" & " at" & Integer'image(X_R.B'Position) & " range" & Integer'image(X_R.B'First_Bit) & " .." & Integer'image(X_R.B'Last_Bit) & ";");