* cocor_ada: Sets, FileIO?
@ 2016-07-29 14:40 hreba
2016-08-02 18:51 ` p.p11
0 siblings, 1 reply; 7+ messages in thread
From: hreba @ 2016-07-29 14:40 UTC (permalink / raw)
Hi,
I am familiarizing with Coco/R. I installed it (and Florist) and I am
able to generate a scanner and a parser. They contain the lines
-----------------------------------------------------------------
with Sets;
with FileIO;
-----------------------------------------------------------------
Does anybody know were I find these packages?
The scanner package has the line
-----------------------------------------------------------------
Source : aliased FileIO.File; -- source/list files. To be opened by
the main pgm
-----------------------------------------------------------------
I guess FileIO exports a constructor and I have to do something like
-----------------------------------------------------------------
My_Scanner.Source:= FileIO.New_File ("my_input_file.xyz");
-----------------------------------------------------------------
Correct?
--
Frank Hrebabetzky +49 / 6355 / 989 5070
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: cocor_ada: Sets, FileIO?
2016-07-29 14:40 cocor_ada: Sets, FileIO? hreba
@ 2016-08-02 18:51 ` p.p11
2016-08-03 8:28 ` hreba
0 siblings, 1 reply; 7+ messages in thread
From: p.p11 @ 2016-08-02 18:51 UTC (permalink / raw)
Hello,
Where do you get the code?
Pascal.
Le vendredi 29 juillet 2016 16:40:19 UTC+2, hreba a écrit :
> Hi,
>
> I am familiarizing with Coco/R. I installed it (and Florist) and I am
> able to generate a scanner and a parser. They contain the lines
> -----------------------------------------------------------------
> with Sets;
> with FileIO;
> -----------------------------------------------------------------
> Does anybody know were I find these packages?
>
> The scanner package has the line
> -----------------------------------------------------------------
> Source : aliased FileIO.File; -- source/list files. To be opened by
> the main pgm
> -----------------------------------------------------------------
> I guess FileIO exports a constructor and I have to do something like
> -----------------------------------------------------------------
> My_Scanner.Source:= FileIO.New_File ("my_input_file.xyz");
> -----------------------------------------------------------------
> Correct?
>
> --
> Frank Hrebabetzky +49 / 6355 / 989 5070
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: cocor_ada: Sets, FileIO?
2016-08-02 18:51 ` p.p11
@ 2016-08-03 8:28 ` hreba
2016-08-03 17:41 ` p.p11
0 siblings, 1 reply; 7+ messages in thread
From: hreba @ 2016-08-03 8:28 UTC (permalink / raw)
Searching the web I found an entry www.ada-ru.org
which is a link to
http://www.ada-ru.org/files/cocor_ada-1.53.1.tar.gz
This is the package I installed.
On 08/02/2016 08:51 PM, p.p11@orange.fr wrote:
> Hello,
>
> Where do you get the code?
>
> Pascal.
>
> Le vendredi 29 juillet 2016 16:40:19 UTC+2, hreba a écrit :
>> Hi,
>>
>> I am familiarizing with Coco/R. I installed it (and Florist) and I am
>> able to generate a scanner and a parser. They contain the lines
>> -----------------------------------------------------------------
>> with Sets;
>> with FileIO;
>> -----------------------------------------------------------------
>> Does anybody know were I find these packages?
>>
>> The scanner package has the line
>> -----------------------------------------------------------------
>> Source : aliased FileIO.File; -- source/list files. To be opened by
>> the main pgm
>> -----------------------------------------------------------------
>> I guess FileIO exports a constructor and I have to do something like
>> -----------------------------------------------------------------
>> My_Scanner.Source:= FileIO.New_File ("my_input_file.xyz");
>> -----------------------------------------------------------------
>> Correct?
>>
>> --
>> Frank Hrebabetzky +49 / 6355 / 989 5070
>
--
Frank Hrebabetzky +49 / 6355 / 989 5070
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: cocor_ada: Sets, FileIO?
2016-08-03 8:28 ` hreba
@ 2016-08-03 17:41 ` p.p11
2016-08-04 12:08 ` hreba
2016-08-10 13:06 ` hreba
0 siblings, 2 replies; 7+ messages in thread
From: p.p11 @ 2016-08-03 17:41 UTC (permalink / raw)
Hello Frank,
Sets and FileIO packages depend on a Posix Ada Library like Florist.
For MacOS I propose prebuilt libraries XAdaLib on:
https://sourceforge.net/projects/gnuada/files/GNAT_GPL%20Mac%20OS%20X/2015-mavericks/
Then you may go further with a very simple GNAT acr.gpr project file:
with "florist";
project ACR is
for Main use ("cr.adb");
package Builder is
for Executable ("cr.adb") use "acr";
end Builder;
end ACR;
Then:
$ gprbuild -P acr.gpr -aP /usr/local/xnadalib-2016/share/gpr
gcc -c fileio.adb
fileio.adb:529:16: warning: index for "ext" may assume lower bound of 1
fileio.adb:529:16: warning: suggested replacement: "ext'First"
fileio.adb:529:42: warning: index for "ext" may assume lower bound of 1
fileio.adb:529:42: warning: suggested replacement: "ext'First"
gcc -c sets.adb
gprbind cr.bexch
gnatbind cr.ali
gcc -c b__cr.adb
gcc cr.o -o acr
$ ./acr
Coco/R (Linux) - Compiler-Compiler V-1.53.1
Released by O.Havva 11 January 2005
Input Grammar_Name not present
COCOR ? gives short help screen
What language do you plan to process with Coco/R?
HTH, Pascal.
Le mercredi 3 août 2016 10:28:36 UTC+2, hreba a écrit :
> Searching the web I found an entry www.ada-ru.org
> which is a link to
> http://www.ada-ru.org/files/cocor_ada-1.53.1.tar.gz
>
> This is the package I installed.
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: cocor_ada: Sets, FileIO?
2016-08-03 17:41 ` p.p11
@ 2016-08-04 12:08 ` hreba
2016-08-10 13:06 ` hreba
1 sibling, 0 replies; 7+ messages in thread
From: hreba @ 2016-08-04 12:08 UTC (permalink / raw)
Hi Pascal,
acr was already installed and working, but the generated scanner and
parser needed the packages Sets and FileIO which I searched in Florist,
but not in Coco/R. With your help I found them, included them in my
project and it works. The first simple test is
with FileIO;
with File_ReaderS; -- generated with acr
with File_ReaderP; -- generated with acr
procedure Test_Coco is
begin
FileIO.Open (File_ReaderS.Source, "sos-file.atg", false);
File_ReaderP.Parse;
end Test_Coco;
The "language" just describes a structured parameter file. I am working
on a ray tracer for lens systems. With Coco/R I want to generate a file
reader which constructs or initializes my lens data structure from a
parameter file.
Thanks for your help,
--
Frank Hrebabetzky +49 / 6355 / 989 5070
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: cocor_ada: Sets, FileIO?
2016-08-03 17:41 ` p.p11
2016-08-04 12:08 ` hreba
@ 2016-08-10 13:06 ` hreba
2016-08-10 16:58 ` Simon Wright
1 sibling, 1 reply; 7+ messages in thread
From: hreba @ 2016-08-10 13:06 UTC (permalink / raw)
Hi Pascal,
working on a little bit I see that my built doesn't work as well as
expected. So I am rebuilding coco/r following your hints. I am stuck at
the last step:
> gcc cr.o -o acr
I get a large number of "undefined reference errors", starting with
/usr/lib/x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
cr.o: In function `_ada_cr':
cr.adb:(.text+0xae): undefined reference to `fileio__write_string'
cr.adb:(.text+0xd9): undefined reference to `fileio__write_string'
cr.adb:(.text+0xe3): undefined reference to `fileio__write_ln'
cr.adb:(.text+0x10e): undefined reference to `fileio__write_string'
...
I see that the missing functions are in the object files in the current
directory (fileio.o, crt.o, ...) but I don't know how to include them in
gcc. Any hint?
--
Frank Hrebabetzky +49 / 6355 / 989 5070
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: cocor_ada: Sets, FileIO?
2016-08-10 13:06 ` hreba
@ 2016-08-10 16:58 ` Simon Wright
0 siblings, 0 replies; 7+ messages in thread
From: Simon Wright @ 2016-08-10 16:58 UTC (permalink / raw)
hreba <f_hreba@yahoo.com.br> writes:
> I am stuck
> at the last step:
>
>> gcc cr.o -o acr
>
> I get a large number of "undefined reference errors", starting with
>
> /usr/lib/x86_64-linux-gnu/crt1.o: In function `_start':
> (.text+0x20): undefined reference to `main'
> cr.o: In function `_ada_cr':
The problem is that gprbuild (which Pascal was using) can be very
misleading about the command lines it actually issues.
So when Pascal said
$ gprbuild -P acr.gpr -aP /usr/local/xnadalib-2016/share/gpr
gcc -c fileio.adb
fileio.adb:529:16: warning: index for "ext" may assume lower bound of 1
fileio.adb:529:16: warning: suggested replacement: "ext'First"
fileio.adb:529:42: warning: index for "ext" may assume lower bound of 1
fileio.adb:529:42: warning: suggested replacement: "ext'First"
gcc -c sets.adb
gprbind cr.bexch
gnatbind cr.ali
gcc -c b__cr.adb
gcc cr.o -o acr
all those lines are just a hint of what was actually going on; you need
to call gprbuild to manage the process.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-08-10 16:58 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-29 14:40 cocor_ada: Sets, FileIO? hreba
2016-08-02 18:51 ` p.p11
2016-08-03 8:28 ` hreba
2016-08-03 17:41 ` p.p11
2016-08-04 12:08 ` hreba
2016-08-10 13:06 ` hreba
2016-08-10 16:58 ` Simon Wright
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox