From: tmoran@acm.org
Subject: Re: Rep Spec Report with ASIS
Date: Sat, 02 Feb 2002 17:35:25 GMT
Date: 2002-02-02T17:35:25+00:00 [thread overview]
Message-ID: <xrV68.6402$P87.3738368124@newssvr14.news.prodigy.com> (raw)
In-Reply-To: PMS68.69384$Ln2.15233029@typhoon.ne.mediaone.net
>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)
& ";");
next prev parent reply other threads:[~2002-02-02 17:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-02 14:33 Rep Spec Report with ASIS John Cupak
2002-02-02 17:35 ` tmoran [this message]
2002-02-02 21:29 ` Larry Kilgallen
2002-02-02 22:51 ` Robert Dewar
2002-02-03 0:34 ` Jeffrey Creem
2002-02-03 10:29 ` Steven Hovater
2002-02-03 13:40 ` Jeffrey Creem
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox