comp.lang.ada
 help / color / mirror / Atom feed
* ASIS question
@ 2000-03-27  0:00 Andy Askey
  2000-03-28  0:00 ` Samuel T. Harris
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Askey @ 2000-03-27  0:00 UTC (permalink / raw)


Is anyone in here an ASIS wiz?  You know, the kind who just
can't get enough opportunities to show off that wizardry??

I've been playing with ASIS 2.0 for a couple days and have figured out
how to loop over elements and unwind subtypes/derived type back into
their base types.  I've also figured out how to loop through all the
components of a record structure.   Now, I'd like to combine the two
and determine the base types of the components in a record structure
-- but this is where it appears to take a wizard to bridge the gap.

Anyone have any helpful hints... or simple source code examples they
would care to share?  I've read the examples from SIGADA, but these do
not show anything other than the most elementary uses.   I will
appreciate any help that anyone offers.

Thanx much.

--
Andy Askey
ajaskey@mindspring.com




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ASIS question
  2000-03-27  0:00 Andy Askey
@ 2000-03-28  0:00 ` Samuel T. Harris
  0 siblings, 0 replies; 6+ messages in thread
From: Samuel T. Harris @ 2000-03-28  0:00 UTC (permalink / raw)


Andy Askey wrote:
> 
> Is anyone in here an ASIS wiz?  You know, the kind who just
> can't get enough opportunities to show off that wizardry??
> 
> I've been playing with ASIS 2.0 for a couple days and have figured out
> how to loop over elements and unwind subtypes/derived type back into
> their base types.  I've also figured out how to loop through all the
> components of a record structure.   Now, I'd like to combine the two
> and determine the base types of the components in a record structure
> -- but this is where it appears to take a wizard to bridge the gap.
> 
> Anyone have any helpful hints... or simple source code examples they
> would care to share?  I've read the examples from SIGADA, but these do
> not show anything other than the most elementary uses.   I will
> appreciate any help that anyone offers.
> 

My experience is limited to ASIS for Ada 83 but I hope this
helps anyway. Once you have an element of kind a_component_declaration
this can be used just like an_object_declaration. I assume you
already have each a_component_declaration from the record
since you say your are looping through all the components
of a record.

Also sssuming you already have a routine which takes
an_object_declaration
and produces the base type, you can reuse this same routine on each
a_component_declaration you produce from decomposing the record.

No wizardry involved :)

-- 
Samuel T. Harris, Principal Engineer
Raytheon, Aerospace Engineering Services
"If you can make it, We can fake it!"




^ permalink raw reply	[flat|nested] 6+ messages in thread

* ASIS question
@ 2005-09-15 16:02 James Alan Farrell
  2005-09-16  8:22 ` Jean-Pierre Rosen
  0 siblings, 1 reply; 6+ messages in thread
From: James Alan Farrell @ 2005-09-15 16:02 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 436 bytes --]

Given a declaration, is there an easy way to get a list of pragmas 
relating to that declaration?

ie:

procedure Foo;
pragma Export(C, Foo, "foo");

where Foo is declared in a long list of declarations.  I have the decl 
list and the declaration of Foo.  Is there any way I can get the pragma 
directly from Foo, rather than searching the long list of declarations 
and seeing if any pragma relates to Foo?

Thanks
James Alan Farrell


[-- Attachment #2: jfarrell.vcf --]
[-- Type: text/x-vcard, Size: 88 bytes --]

begin:vcard
fn:James Alan Farrell
n:Farrell;James
org:GrammaTech
version:2.1
end:vcard


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ASIS question
  2005-09-15 16:02 ASIS question James Alan Farrell
@ 2005-09-16  8:22 ` Jean-Pierre Rosen
  2005-09-16 16:12   ` James Alan Farrell
  0 siblings, 1 reply; 6+ messages in thread
From: Jean-Pierre Rosen @ 2005-09-16  8:22 UTC (permalink / raw)


James Alan Farrell a �crit :
> Given a declaration, is there an easy way to get a list of pragmas 
> relating to that declaration?
> 
> ie:
> 
> procedure Foo;
> pragma Export(C, Foo, "foo");
> 
> where Foo is declared in a long list of declarations.  I have the decl 
> list and the declaration of Foo.  Is there any way I can get the pragma 
> directly from Foo, rather than searching the long list of declarations 
> and seeing if any pragma relates to Foo?
> 
Asis.Elements.Corresponding_Pragmas

-- 
---------------------------------------------------------
            J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ASIS question
  2005-09-16  8:22 ` Jean-Pierre Rosen
@ 2005-09-16 16:12   ` James Alan Farrell
  2005-09-19 16:15     ` Jean-Pierre Rosen
  0 siblings, 1 reply; 6+ messages in thread
From: James Alan Farrell @ 2005-09-16 16:12 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 841 bytes --]

Jean-Pierre Rosen wrote:
> James Alan Farrell a �crit :
> 
>> Given a declaration, is there an easy way to get a list of pragmas 
>> relating to that declaration?
>>
>> ie:
>>
>> procedure Foo;
>> pragma Export(C, Foo, "foo");
>>
>> where Foo is declared in a long list of declarations.  I have the decl 
>> list and the declaration of Foo.  Is there any way I can get the 
>> pragma directly from Foo, rather than searching the long list of 
>> declarations and seeing if any pragma relates to Foo?
>>
> Asis.Elements.Corresponding_Pragmas
> 
Ah, I should have been more clear - apologies.  In ASIS for gnat 3.15p, 
Asis.Elements.Corresponding_Pragmas raises an exception "unimplemented."

Given that situation, is there a reasonably elegant way to do this?
Will this function be implemented in the future?

Thank you for your reply,
JAF

[-- Attachment #2: jfarrell.vcf --]
[-- Type: text/x-vcard, Size: 88 bytes --]

begin:vcard
fn:James Alan Farrell
n:Farrell;James
org:GrammaTech
version:2.1
end:vcard


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ASIS question
  2005-09-16 16:12   ` James Alan Farrell
@ 2005-09-19 16:15     ` Jean-Pierre Rosen
  0 siblings, 0 replies; 6+ messages in thread
From: Jean-Pierre Rosen @ 2005-09-19 16:15 UTC (permalink / raw)


James Alan Farrell a �crit :
> Ah, I should have been more clear - apologies.  In ASIS for gnat 3.15p, 
> Asis.Elements.Corresponding_Pragmas raises an exception "unimplemented."
In my (GAP 2005) implementation, there is this comment:

--  At the moment, this is a partial implementattion. For A_Statement
--  argument we always return Nil_Element_List, and for A_Declaration
--  Element we return a list of representation pragmas only.

Maybe better that in 3.15p, but still not complete.

> Given that situation, is there a reasonably elegant way to do this?
> Will this function be implemented in the future?
> 
Elegant, certainly not, otherwise corresponding_pragmas would be 
redundant. What I did in the past in this situation is write a 
compatible function (with exactly the same spec), implement it with 
whatever hack was needed. When it eventually gets implemented, you just 
replace your version with the "clean" one.
-- 
---------------------------------------------------------
            J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-09-19 16:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-15 16:02 ASIS question James Alan Farrell
2005-09-16  8:22 ` Jean-Pierre Rosen
2005-09-16 16:12   ` James Alan Farrell
2005-09-19 16:15     ` Jean-Pierre Rosen
  -- strict thread matches above, loose matches on Subject: below --
2000-03-27  0:00 Andy Askey
2000-03-28  0:00 ` Samuel T. Harris

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