comp.lang.ada
 help / color / mirror / Atom feed
* c to ada
@ 1995-04-07  0:00 JH Lee
  0 siblings, 0 replies; 14+ messages in thread
From: JH Lee @ 1995-04-07  0:00 UTC (permalink / raw)


do you known a list of ftp sites where i can find a translator c 
to ada. thank you.




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

* Re: C to Ada
  1996-11-04  0:00   ` C to Ada Ali Mirhosseini
@ 1996-11-04  0:00     ` Robert Dewar
  1996-11-04  0:00     ` Matthew Daniel
  1 sibling, 0 replies; 14+ messages in thread
From: Robert Dewar @ 1996-11-04  0:00 UTC (permalink / raw)



"I am looking for a C to Ada translator, could you let me know of any
pulic domain software for Unix and Dos,
"


Probably the only such software is implemented using zillions of neurons
and walking around in computers called Bob, or Fred, or Nancy. And likely
they are not in the public domain anyway.

Seriously, automatic translatoin of this kind is a recipe for creating
junk, and is almost never justifiable. If there is a reason for 
translating code, then there is a reason for re-engineering it. Perhaps
you can give some insight as to what problem you are trying to solve,
rather than ask about details on inappropriate solutions.





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

* Re: C to Ada
  1996-11-04  0:00   ` C to Ada Ali Mirhosseini
  1996-11-04  0:00     ` Robert Dewar
@ 1996-11-04  0:00     ` Matthew Daniel
  1 sibling, 0 replies; 14+ messages in thread
From: Matthew Daniel @ 1996-11-04  0:00 UTC (permalink / raw)
  To: Ali Mirhosseini


Ali Mirhosseini wrote:
> 
> Dear Fellows:
> 
> I am looking for a C to Ada translator, could you let me know of any
> pulic domain software for Unix and Dos,
> 
> Cheers
> 
> Ali Reza Mirhosseini
> 
> ------------------------------------------------------------------------
> Laboratory for Imaging Science and Engineering     Phone: +61 2 9351 4824
> Department of Electrical Engineering               Fax:   +61 2 9351 3847
> University of Sydney, Sydney, NSW 2006             Email: armir@ee.usyd.edu.au
> 
> WWW: http://cassius.ee.usyd.edu.au/~armir
> -----------------------------------------------------------------------

look at 

http://www.adahome.com/

there is a tools and components link follow this to get a copy of c2ada, only for unix or the
like

Matt




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

* C to Ada
  1996-11-04  0:00 ` Don Harrison
@ 1996-11-04  0:00   ` Ali Mirhosseini
  1996-11-04  0:00     ` Robert Dewar
  1996-11-04  0:00     ` Matthew Daniel
  0 siblings, 2 replies; 14+ messages in thread
From: Ali Mirhosseini @ 1996-11-04  0:00 UTC (permalink / raw)



Dear Fellows:

I am looking for a C to Ada translator, could you let me know of any
pulic domain software for Unix and Dos,

Cheers



Ali Reza Mirhosseini

------------------------------------------------------------------------
Laboratory for Imaging Science and Engineering	   Phone: +61 2 9351 4824
Department of Electrical Engineering		   Fax:   +61 2 9351 3847
University of Sydney, Sydney, NSW 2006		   Email: armir@ee.usyd.edu.au

WWW: http://cassius.ee.usyd.edu.au/~armir
-----------------------------------------------------------------------




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

* C to Ada
@ 1997-02-23  0:00 Cliff Lim
  1997-02-27  0:00 ` David Wheeler
  0 siblings, 1 reply; 14+ messages in thread
From: Cliff Lim @ 1997-02-23  0:00 UTC (permalink / raw)



Is there a trasnlator program from C to Ada?. If so, where can
I download it and how may I find such a program.





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

* Re: C to Ada
  1997-02-23  0:00 Cliff Lim
@ 1997-02-27  0:00 ` David Wheeler
  0 siblings, 0 replies; 14+ messages in thread
From: David Wheeler @ 1997-02-27  0:00 UTC (permalink / raw)



Cliff Lim (clifflim@rigel.oac.uci.edu) wrote:
: Is there a trasnlator program from C to Ada?. If so, where can
: I download it and how may I find such a program.

There are several programs that translate C interfaces so that
Ada programs can call C programs, and at least one of them tries to
translate all of C into Ada.

My "Lovelace" tutorial discusses interfacing issues; the section
you might want to specifically look at is at:

  http://www.adahome.com/Tutorials/Lovelace/s16s3.htm


--- David A. Wheeler
    dwheeler@ida.org





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

* C to Ada
@ 2003-01-20 19:28 chris.danx
  0 siblings, 0 replies; 14+ messages in thread
From: chris.danx @ 2003-01-20 19:28 UTC (permalink / raw)


-- Apologise if this appears twice, these news servers are a pita!!!


Hi,

How do you map something like this to Ada (for a binding)?  It's 
probable that I'll only be working with GNAT on the Linux front (it's 
all there is), so a GNAT specific option although not ideal, is acceptable.


/* Open the shared object FILE and map it in; return a handle that can 
be passed to `dlsym' to get symbol values from it.  */

extern void *dlopen (__const char *__file, int __mode) __THROW;

I know rougly how to map the __file, and __mode params but am not sure 
how to deal with the void * or in this case the throw.  This is taken 
from dlfcn.h which is the header for dynamic library support in Linux. 
If anyone already has a (GMGPL) binding to this library and they'd like 
to share, please let me know, it'll save me making one.  In any event 
how do you translate this C code so it can be called from Ada?

After I get a wee thin binding working, I'm going to make it a little 
thicker and toss it into the open.


Cheers,
Chris
-- 
for personal replies change spamoff to chris




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

* C to Ada
@ 2006-11-23 22:12 Brian May
  2006-11-24  2:28 ` rodkay
  0 siblings, 1 reply; 14+ messages in thread
From: Brian May @ 2006-11-23 22:12 UTC (permalink / raw)


Hello,

Are there any up-to-date utilities for converting a C *.h file into a
Ada wrapper package?

I don't care if it requires cleaning up by hand afterwords.

Or is it considered better to write the entire wrapper by hand?

(considering a number of C libraries that I would like to be able to
access from Ada here but with no native Ada bindings yet).

Thanks.
-- 
Brian May <bam@snoopy.apana.org.au>



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

* Re: C to Ada
  2006-11-23 22:12 C to Ada Brian May
@ 2006-11-24  2:28 ` rodkay
  2006-11-25 22:18   ` Brian May
  0 siblings, 1 reply; 14+ messages in thread
From: rodkay @ 2006-11-24  2:28 UTC (permalink / raw)



Brian May wrote:
> Are there any up-to-date utilities for converting a C *.h file into a
> Ada wrapper package?

   You might try the prototype SWIG 'ada' and 'gnat' modules.

   These attempt to generate Ada bindings to both C and C++ libraries.
The 'ada' module is for any Ada compiler, and produces bindings based
on a 'proxy' approach. The 'gnat' compiler targets the GNAT family of
compilers, and produces Ada types and objects which are the binary
equivalent of their corresponding C/C++ types.


> I don't care if it requires cleaning up by hand afterwords.

   The generated bindings are pretty rough, and generally need to be
'pretty print' formatted, by gnatpp or another tool. There are also
many style 'warts', which should eventually be cleared up.


>
> Or is it considered better to write the entire wrapper by hand?

   Bindings done by hand tend to be better than the auto-generated
ones. SWIG produces very thin bindings. A decent compromise is to use
SWIG to build a thin binding, and then write a thick binding by hand,
on top of the thin.


>
> (considering a number of C libraries that I would like to be able to
> access from Ada here but with no native Ada bindings yet).

   There is an example of a few SWIG 'gnat' bindings to the GNU
Scientific Library (GSL) at

                             svn co svn://58.163.88.116/anvil/gsl



   SWIG with the 'ada' & 'gnat' modules is available via

           svn co
https://svn.sourceforge.net/svnroot/gnuada/trunk/projects/swig-1.3.29


   The repository code is a little out of date, but recent changes
should be committed within the next few days.



regards.




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

* Re: C to Ada
  2006-11-24  2:28 ` rodkay
@ 2006-11-25 22:18   ` Brian May
  2006-11-25 23:52     ` rodkay
  0 siblings, 1 reply; 14+ messages in thread
From: Brian May @ 2006-11-25 22:18 UTC (permalink / raw)


>>>>> "rodkay" == rodkay  <rodkay@dodo.com.au> writes:

    rodkay>    These attempt to generate Ada bindings to both C and
    rodkay> C++ libraries.  The 'ada' module is for any Ada compiler,
    rodkay> and produces bindings based on a 'proxy' approach. The
    rodkay> 'gnat' compiler targets the GNAT family of compilers, and
    rodkay> produces Ada types and objects which are the binary
    rodkay> equivalent of their corresponding C/C++ types.

I am still not clear on the difference - what is the 'proxy' approach?

Can I assume that the GNAT target uses GNAT specific features and
won't work without GNAT??
-- 
Brian May <bam@snoopy.apana.org.au>



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

* Re: C to Ada
  2006-11-25 22:18   ` Brian May
@ 2006-11-25 23:52     ` rodkay
  2006-11-26 15:45       ` Robert A Duff
  0 siblings, 1 reply; 14+ messages in thread
From: rodkay @ 2006-11-25 23:52 UTC (permalink / raw)



Brian May wrote:
> >>>>> "rodkay" == rodkay  <rodkay@dodo.com.au> writes:
>
>     rodkay>    These attempt to generate Ada bindings to both C and
>     rodkay> C++ libraries.  The 'ada' module is for any Ada compiler,
>     rodkay> and produces bindings based on a 'proxy' approach. The
>     rodkay> 'gnat' compiler targets the GNAT family of compilers, and
>     rodkay> produces Ada types and objects which are the binary
>     rodkay> equivalent of their corresponding C/C++ types.
>
> I am still not clear on the difference - what is the 'proxy' approach?

   With the 'proxy' approach, the Ada type holds only a pointer to the
wrapped C++ object. When an object of the the Ada type is constructed,
a corresponding C++ object is created, and its pointer stored in the
Ada type object. All operations on the Ada object are then relayed to
its internal C++ object.

   The 'gnat' binary approach produces an Ada record layout which is
equivalent to the C++ class layout. Operations act directly on the Ada
object.



> Can I assume that the GNAT target uses GNAT specific features and
> won't work without GNAT??

   Yes, the 'gnat' SWIG module produces bindings which require a GNAT
compiler.

    Perhaps a similar approach (binary-compatible) for other compilers
might be attempted, after the existing modules have matured a little
more.




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

* Re: C to Ada
  2006-11-25 23:52     ` rodkay
@ 2006-11-26 15:45       ` Robert A Duff
  2006-11-26 18:12         ` Jeffrey Creem
  2006-11-26 19:00         ` Martin Krischik
  0 siblings, 2 replies; 14+ messages in thread
From: Robert A Duff @ 2006-11-26 15:45 UTC (permalink / raw)


rodkay@dodo.com.au writes:

>    Yes, the 'gnat' SWIG module produces bindings which require a GNAT
> compiler.
>
>     Perhaps a similar approach (binary-compatible) for other compilers
> might be attempted, after the existing modules have matured a little
> more.

What's the status of the Ada SWIG support, and where can I find it?
I tried google, but it wasn't clear to me from what I found
whether such support is available yet.

Thanks.

- Bob



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

* Re: C to Ada
  2006-11-26 15:45       ` Robert A Duff
@ 2006-11-26 18:12         ` Jeffrey Creem
  2006-11-26 19:00         ` Martin Krischik
  1 sibling, 0 replies; 14+ messages in thread
From: Jeffrey Creem @ 2006-11-26 18:12 UTC (permalink / raw)


Robert A Duff wrote:
> rodkay@dodo.com.au writes:
> 
> 
>>   Yes, the 'gnat' SWIG module produces bindings which require a GNAT
>>compiler.
>>
>>    Perhaps a similar approach (binary-compatible) for other compilers
>>might be attempted, after the existing modules have matured a little
>>more.
> 
> 
> What's the status of the Ada SWIG support, and where can I find it?
> I tried google, but it wasn't clear to me from what I found
> whether such support is available yet.
> 
> Thanks.
> 
> - Bob

It is currently being worked outside of the SWIG tree. The GNUAda 
project at sourceforge setup an area in the SVN tree so that if the 
current people working on it abandon it, we don't loose the progress.

The hope is that it will soon be mature enough that it can  be accepted 
into the SWIG tree.

http://gnuada.svn.sourceforge.net/viewvc/gnuada/trunk/projects/swig-1.3.29/



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

* Re: C to Ada
  2006-11-26 15:45       ` Robert A Duff
  2006-11-26 18:12         ` Jeffrey Creem
@ 2006-11-26 19:00         ` Martin Krischik
  1 sibling, 0 replies; 14+ messages in thread
From: Martin Krischik @ 2006-11-26 19:00 UTC (permalink / raw)


Robert A Duff wrote:

> rodkay@dodo.com.au writes:
> 
>>    Yes, the 'gnat' SWIG module produces bindings which require a GNAT
>> compiler.
>>
>>     Perhaps a similar approach (binary-compatible) for other compilers
>> might be attempted, after the existing modules have matured a little
>> more.
> 
> What's the status of the Ada SWIG support, and where can I find it?
> I tried google, but it wasn't clear to me from what I found
> whether such support is available yet.

http://gnuada.sf.net 

Check the Subversion archive - it's work in progress.

Martin
-- 
mailto://krischik@users.sourceforge.net
Ada programming at: http://ada.krischik.com



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

end of thread, other threads:[~2006-11-26 19:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-23 22:12 C to Ada Brian May
2006-11-24  2:28 ` rodkay
2006-11-25 22:18   ` Brian May
2006-11-25 23:52     ` rodkay
2006-11-26 15:45       ` Robert A Duff
2006-11-26 18:12         ` Jeffrey Creem
2006-11-26 19:00         ` Martin Krischik
  -- strict thread matches above, loose matches on Subject: below --
2003-01-20 19:28 chris.danx
1997-02-23  0:00 Cliff Lim
1997-02-27  0:00 ` David Wheeler
1996-10-30  0:00 Eiffel and Java + Ada dispatching Jon S Anthony
1996-11-04  0:00 ` Don Harrison
1996-11-04  0:00   ` C to Ada Ali Mirhosseini
1996-11-04  0:00     ` Robert Dewar
1996-11-04  0:00     ` Matthew Daniel
1995-04-07  0:00 c to ada JH Lee

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