comp.lang.ada
 help / color / mirror / Atom feed
* ADA PACKAGES
@ 1996-06-11  0:00 Robert Adams
  0 siblings, 0 replies; 10+ messages in thread
From: Robert Adams @ 1996-06-11  0:00 UTC (permalink / raw)



Anything for an ADA programmer.  Looking for usefule packages 
and compilable tools.  Leave email at RAdams9348@gnn.com.  
Thanks.





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

* ada packages
@ 2004-02-17 10:20 Kuba Malczak
  2004-02-17 11:10 ` Preben Randhol
  0 siblings, 1 reply; 10+ messages in thread
From: Kuba Malczak @ 2004-02-17 10:20 UTC (permalink / raw)


Hi i have one more question.
Could you tell mi if enywhere is something
like package browser.i want to browse functions
with comments about themn, now i must open some package file 
and look for function that i wantm, is any simpliest way ?
sory for lame question



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

* Re: ada packages
  2004-02-17 10:20 ada packages Kuba Malczak
@ 2004-02-17 11:10 ` Preben Randhol
  2004-02-17 11:55   ` Kuba Malczak
  0 siblings, 1 reply; 10+ messages in thread
From: Preben Randhol @ 2004-02-17 11:10 UTC (permalink / raw)


On 2004-02-17, Kuba Malczak <wipe@op.pl> wrote:
> Hi i have one more question.
> Could you tell mi if enywhere is something
> like package browser.i want to browse functions
> with comments about themn, now i must open some package file 
> and look for function that i wantm, is any simpliest way ?
> sory for lame question

Some choices: 

   Adabrowse
   http://home.tiscalinet.ch/t_wolf/tw/ada95/

   gnathtml (in GNAT) 
   http://libre.act-europe.fr/GNAT/

   AdaDoc
   http://adadoc.sourceforge.net/

   GPS (IDE)
   http://libre.act-europe.fr/gps/

-- 
"Saving keystrokes is the job of the text editor, not the programming
 language."



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

* Re: ada packages
  2004-02-17 11:10 ` Preben Randhol
@ 2004-02-17 11:55   ` Kuba Malczak
  0 siblings, 0 replies; 10+ messages in thread
From: Kuba Malczak @ 2004-02-17 11:55 UTC (permalink / raw)


On Tue, 17 Feb 2004 11:10:04 +0000, Preben Randhol wrote:

> On 2004-02-17, Kuba Malczak <wipe@op.pl> wrote:
>> Hi i have one more question.
>> Could you tell mi if enywhere is something
>> like package browser.i want to browse functions
>> with comments about themn, now i must open some package file 
>> and look for function that i wantm, is any simpliest way ?
>> sory for lame question
> 
> Some choices: 
> 
>    Adabrowse
>    http://home.tiscalinet.ch/t_wolf/tw/ada95/
> 
>    gnathtml (in GNAT) 
>    http://libre.act-europe.fr/GNAT/
> 
>    AdaDoc
>    http://adadoc.sourceforge.net/
> 
>    GPS (IDE)
>    http://libre.act-europe.fr/gps/
thank you 




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

* Ada Packages
@ 2011-09-17  5:45 George
  2011-09-17  6:15 ` Jeffrey Carter
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: George @ 2011-09-17  5:45 UTC (permalink / raw)


Hi All,

I tried to build a basic package. My two files look like this:

File 1: basic_num_io.ads

package Basic_Num_IO is
  procedure Num_IO;
end Basic_Num_IO;

File 2: basic_num_io.adb

with text_io; use text_io;

package body Basic_Num_IO is
  procedure Num_IO is
    package Integer_InOut is new Integer_IO(integer);
    package Float_InOut is new Integer_IO(float);
    begin
      null;
    end Num_IO;
end Basic_Num_IO;

If I call gnat compile basic_num_io.ads I get the error message:

basic_num_io.ads:8:01: end of file expected, file can have only one 
compilation unit

What am I doing wrong? Where can I find it in the documentation?

Kind regards

George



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

* Re: Ada Packages
  2011-09-17  5:45 Ada Packages George
@ 2011-09-17  6:15 ` Jeffrey Carter
  2011-09-17  6:16 ` J-P. Rosen
  2011-09-17  7:18 ` Georg Maubach
  2 siblings, 0 replies; 10+ messages in thread
From: Jeffrey Carter @ 2011-09-17  6:15 UTC (permalink / raw)


On 09/16/2011 10:45 PM, George wrote:
>
> If I call gnat compile basic_num_io.ads I get the error message:
>
> basic_num_io.ads:8:01: end of file expected, file can have only one
> compilation unit

basic_num_io.ads clearly has at least 8 lines in it, not the 3 you presented. 
Since I don't know what's in this file, I can't really help you. Make sure this 
file only contains the package specification.

In general, you don't need to compile the package specification; that's done 
automatically when you compile the body.

gnatmake basic_num_io.adb

should do that for you, once you get the contents of the files correct.

> What am I doing wrong? Where can I find it in the documentation?

The documentation depends on which version of GNAT you're using. Documentation 
for GNAT GPL 2011 is at

http://www.adacore.com/category/developers-center/reference-library/documentation/

-- 
Jeff Carter
"I'm a kike, a yid, a heebie, a hook nose! I'm Kosher,
Mum! I'm a Red Sea pedestrian, and proud of it!"
Monty Python's Life of Brian
77



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

* Re: Ada Packages
  2011-09-17  5:45 Ada Packages George
  2011-09-17  6:15 ` Jeffrey Carter
@ 2011-09-17  6:16 ` J-P. Rosen
  2011-09-17  7:18 ` Georg Maubach
  2 siblings, 0 replies; 10+ messages in thread
From: J-P. Rosen @ 2011-09-17  6:16 UTC (permalink / raw)


Le 17/09/2011 07:45, George a écrit :
> I tried to build a basic package. My two files look like this:
> 
> File 1: basic_num_io.ads
> 
> package Basic_Num_IO is
>   procedure Num_IO;
> end Basic_Num_IO;
> 
[...]
> basic_num_io.ads:8:01: end of file expected, file can have only one 
> compilation unit
> 
Hmmm... It complains at line 8, but what you show has only 3 lines.
There must be something else that you didn't notice at the end of the
file, and the compiler considers that something as a second compilation
unit in the same file.

-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Adalog a déménagé / Adalog has moved:
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00



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

* Re: Ada Packages
  2011-09-17  5:45 Ada Packages George
  2011-09-17  6:15 ` Jeffrey Carter
  2011-09-17  6:16 ` J-P. Rosen
@ 2011-09-17  7:18 ` Georg Maubach
  2011-09-17  7:42   ` Simon Wright
  2011-09-17  7:46   ` Georg Maubach
  2 siblings, 2 replies; 10+ messages in thread
From: Georg Maubach @ 2011-09-17  7:18 UTC (permalink / raw)


Hi Jeffrey,
Hi Jean-Pierre,

you're right: I left my comments out.

I started all over, deleted both files and build a new file with just the 
three lines in it:

package Basic_Num_IO is
  procedure Num_IO;
end Basic_Num_IO;

The compiler error is now 

gcc-4.3 -c basic_num_io.ads
cannot generate code for file basic_num_io.ads (package spec)
to check package spec for errors, use -gnatc
gnatmake: "basic_num_io.ads" compilation error

I tried gcc-4.3 -c -gnatc basic_num_io.ads. No error occured.

How can I fix that?

Kind regards

George

Am Sat, 17 Sep 2011 05:45:27 +0000 schrieb George:

> Hi All,
> 
> I tried to build a basic package. My two files look like this:
> 
> File 1: basic_num_io.ads
> 
> package Basic_Num_IO is
>   procedure Num_IO;
> end Basic_Num_IO;
> 
> File 2: basic_num_io.adb
> 
> with text_io; use text_io;
> 
> package body Basic_Num_IO is
>   procedure Num_IO is
>     package Integer_InOut is new Integer_IO(integer); package
>     Float_InOut is new Integer_IO(float); begin
>       null;
>     end Num_IO;
> end Basic_Num_IO;
> 
> If I call gnat compile basic_num_io.ads I get the error message:
> 
> basic_num_io.ads:8:01: end of file expected, file can have only one
> compilation unit
> 
> What am I doing wrong? Where can I find it in the documentation?
> 
> Kind regards
> 
> George




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

* Re: Ada Packages
  2011-09-17  7:18 ` Georg Maubach
@ 2011-09-17  7:42   ` Simon Wright
  2011-09-17  7:46   ` Georg Maubach
  1 sibling, 0 replies; 10+ messages in thread
From: Simon Wright @ 2011-09-17  7:42 UTC (permalink / raw)


Georg Maubach <ada_resources@gmx.de> writes:

> gcc-4.3 -c basic_num_io.ads
> cannot generate code for file basic_num_io.ads (package spec)

As someone above pointed out, GNAT won't generate object code from a
spec (unless the spec doesn't need, ie must not have) a body. Try
compiling the .adb file.

-gnatc is "Check syntax and semantics only (no code generation)". I
 found this out using the command "gnatmake -h".

You're better off using gnatmake as the compiler driver, it understands
all about dependencies and the Ada bind/link process, and will produce
executables if it can.



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

* Re: Ada Packages
  2011-09-17  7:18 ` Georg Maubach
  2011-09-17  7:42   ` Simon Wright
@ 2011-09-17  7:46   ` Georg Maubach
  1 sibling, 0 replies; 10+ messages in thread
From: Georg Maubach @ 2011-09-17  7:46 UTC (permalink / raw)


Hi Jeffrey,
Hi Jean-Pierre,

I tried again and checked my code. The reason for the error is a wrong 
call to a function. It should read

package Float_InOut is new Float_IO(Float);

instead of

package Float_InOut is new Integer_IO(Float);

Many thanks for your willingness to help.

Kind regards

George


Am Sat, 17 Sep 2011 07:18:20 +0000 schrieb Georg Maubach:

> Hi Jeffrey,
> Hi Jean-Pierre,
> 
> you're right: I left my comments out.
> 
> I started all over, deleted both files and build a new file with just
> the three lines in it:
> 
> package Basic_Num_IO is
>   procedure Num_IO;
> end Basic_Num_IO;
> 
> The compiler error is now
> 
> gcc-4.3 -c basic_num_io.ads
> cannot generate code for file basic_num_io.ads (package spec) to check
> package spec for errors, use -gnatc gnatmake: "basic_num_io.ads"
> compilation error
> 
> I tried gcc-4.3 -c -gnatc basic_num_io.ads. No error occured.
> 
> How can I fix that?
> 
> Kind regards
> 
> George
> 
> Am Sat, 17 Sep 2011 05:45:27 +0000 schrieb George:
> 
>> Hi All,
>> 
>> I tried to build a basic package. My two files look like this:
>> 
>> File 1: basic_num_io.ads
>> 
>> package Basic_Num_IO is
>>   procedure Num_IO;
>> end Basic_Num_IO;
>> 
>> File 2: basic_num_io.adb
>> 
>> with text_io; use text_io;
>> 
>> package body Basic_Num_IO is
>>   procedure Num_IO is
>>     package Integer_InOut is new Integer_IO(integer); package
>>     Float_InOut is new Integer_IO(float); begin
>>       null;
>>     end Num_IO;
>> end Basic_Num_IO;
>> 
>> If I call gnat compile basic_num_io.ads I get the error message:
>> 
>> basic_num_io.ads:8:01: end of file expected, file can have only one
>> compilation unit
>> 
>> What am I doing wrong? Where can I find it in the documentation?
>> 
>> Kind regards
>> 
>> George




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

end of thread, other threads:[~2011-09-17  7:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-17  5:45 Ada Packages George
2011-09-17  6:15 ` Jeffrey Carter
2011-09-17  6:16 ` J-P. Rosen
2011-09-17  7:18 ` Georg Maubach
2011-09-17  7:42   ` Simon Wright
2011-09-17  7:46   ` Georg Maubach
  -- strict thread matches above, loose matches on Subject: below --
2004-02-17 10:20 ada packages Kuba Malczak
2004-02-17 11:10 ` Preben Randhol
2004-02-17 11:55   ` Kuba Malczak
1996-06-11  0:00 ADA PACKAGES Robert Adams

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