[Dwarf-discuss] Encoding variant records: request for clarification.
Ron Brender
ron.brender
Fri Aug 18 11:16:32 GMT 2006
Greetings Paul,
I think the answer to this question is covered by the example type REC2
presented in D.2.2. See Figure 53 on p197 in particular. The key point,
I think, is that there is only one entity named N and the other uses of
N are references to it.
If this does not address your question, please clarify.
Cheers,
Ron Brender
Paul Hilfinger wrote:
> I'm finding the description of variants a little difficult to
> interpret and apply, and I wonder if someone could supply me with an
> example. Let's consider specifically the Ada record type R,
> defined
>
> type R (N : Integer) is record
> Data : String (1 .. N);
> case N is
> when 0 =>
> Name : String (1 .. N);
> when 1..20 =>
> Id, Port : Integer;
> when others =>
> null;
> end case;
> end record;
>
> N here is basically a member of R. As you can see, it is referred to
> in Data. According to the standard, however, there is ALSO a child of
> the variant part for N. What is the relationship between the two (the
> child of R representing N and the child of the variant child of R
> representing N)? How exactly is type R to be encoded?
>
> Thanks in advance.
>
> Paul Hilfinger
> AdaCore, Inc. & UC Berkeley
More information about the Dwarf-discuss
mailing list