From: Fernando Arroyo <arroyopinto@gmail.com>
Subject: Re: Pascal to ADA Converter
Date: Wed, 29 Jul 2015 07:59:30 -0700 (PDT)
Date: 2015-07-29T07:59:30-07:00 [thread overview]
Message-ID: <c1915a1d-ff3e-4d91-be2a-5e743cd153f7@googlegroups.com> (raw)
In-Reply-To: <87bnev8ix7.fsf@adaheads.sparre-andersen.dk>
On Wednesday, July 29, 2015 at 10:30:45 AM UTC+2, Jacob Sparre Andersen wrote:
> Fernando Arroyo wrote:
> > On Monday, July 20, 2015 at 2:47:13 PM UTC+2, gautier...@hotmail.com wrote:
>
> >> Especially, you can grab the P2Ada sources there:
> >>
> >> http://sourceforge.net/projects/p2ada/files/p2ada/Sources/
>
> > I have downloaded p2ada for Win32 and it works properly in Windows 7
> > and XP. The problem is that I would like to run this program in linux
>
> Why don't you download the sources and compile the program? The output
> from the program will not really be relevant anyway, if you don't have
> an Ada compiler on the system.
>
> Greetings,
>
> Jacob
> --
> The so-called "desktop metaphor" of today's workstation
> is instead an "airplane-seat" metaphor.
I did't want to compile the sources since I have problems building it, I had to make some changes and I was afraid of modify the program behaviour.
Therefore, I have decided to use the previous version in the repository at http://sourceforge.net/projects/p2ada/files/p2ada/Sources/ (newp2ada-24-aug-2008.zip), and according the instructions (newp2ada.txt), I unzipped the zip (unzip -aaLL) and in the newp2ada folder I have done "gnatmake p2ada" and it is built and runs properly.
However, I would like to use the 2010 version (p2ada-aug-2010-src.tgz) but according the instructions (newp2ada/README), I unzipped the zip (unzip -aaLL) and in the newp2ada folder I have done "gnatmake p2ada" and gives problems:
gnatmake p2ada
gcc -c p2ada.adb
p2ada.adb:27:06: file "pascal_io.ads" not found
gnatmake: "p2ada.adb" compilation error
Therefore I decided follow the instructions of "How to make P2Ada translator work?"
First of all the instructions says about a file newp2ada.zip which I don't have. I assume that file is equvalent to the one that I downloaded p2ada-aug-2010-src.tgz (So here the first weird thing). I have decided to uncompress the tgz, compress again to .zip and decompress with "unzip -aaLL".
Then, I create the folder acu and modify the file p2ada_options.ads. According the instrucctions, we have replace one string DOS by Unix, but the instrucctions are not clear, I assume that is the second one (here the second weird thing):
type Line_endings is (Unix,DOS,Mac); -- LF,CR/LF,CR
new_line_endings: Line_endings:= DOS; -- <-----This one
Then next step is make and if I do it(here the third weird thing):
$ make
make: *** No rule to make target `aflex', needed by `pascal_dfa.adb'. Stop.
Since the readme says that "aflex and ayacc must have been made (see below) and copy or link them here" I follow the instructions "How to change P2Ada for yet another Pascal dialect ?":
1. building AYACC :
- go to directory ayacc
- run "gnatmake ayacc"
it looks ok:
$ gnatmake ayacc
gcc -c ayacc.adb
gcc -c ayacc_file_names.adb
gcc -c command_line_interface.adb
gcc -c error_report_file.adb
gcc -c options.adb
gcc -c output_file.adb
gcc -c parse_table.adb
gcc -c parser.adb
gcc -c rule_table.adb
gcc -c source_file.adb
gcc -c string_pkg.adb
gcc -c symbol_table.adb
gcc -c tokens_file.adb
gcc -c str_pack.adb
gcc -c string_scanner.adb
gcc -c string_lists.ads
gcc -c actions_file.adb
gcc -c parse_template_file.adb
gcc -c goto_file.adb
gcc -c lalr_symbol_info.adb
gcc -c lr0_machine.adb
gcc -c shift_reduce_file.adb
gcc -c symbol_info.adb
gcc -c verbose_file.adb
gcc -c lexical_analyzer.adb
gcc -c lists.adb
gcc -c stack_pkg.adb
gcc -c ragged.adb
gcc -c stack_pack.adb
gcc -c set_pack.adb
gnatbind -x ayacc.ali
gnatlink ayacc.ali
- move the executable in a reachable directory (see: path)
2. building AFLEX :
- go to directory aflex
- run "gnatmake aflex"
- move the executable in a reachable directory (see: path)
it looks ok:
$ gnatmake aflex
gcc -c aflex.adb
gcc -c dfa.adb
gcc -c gen.adb
gcc -c main_body.adb
gcc -c misc.adb
gcc -c misc_defs.adb
gcc -c template_manager.adb
gcc -c ccl.adb
gcc -c ecs.adb
gcc -c int_io.ads
gcc -c nfa.adb
gcc -c skeleton_manager.adb
gcc -c tblcmp.adb
gcc -c tstring.ads
gcc -c parse_tokens.ads
gcc -c scanner.adb
gcc -c command_line_interface.adb
gcc -c external_file_manager.adb
gcc -c parser.adb
gcc -c file_string.ads
gcc -c vstrings.adb
gcc -c ascan_dfa.adb
gcc -c ascan_io.adb
gcc -c sym.adb
gcc -c aflex_scanner.adb
gcc -c parse_goto.ads
gcc -c parse_shift_reduce.ads
gnatbind -x aflex.ali
gnatlink aflex.ali
Then I follow the instructions:
-go to directory lypascal
- type "ayacc pascal.y"
$ ayacc pascal.y
Ayacc (File => "pascal.y",
C_Lex => Off,
Debug => Off,
Summary => On,
Verbose => Off,
Error_Recovery => Off,
Extension => ".a");
637 Productions
420 Nonterminals
105 Terminals
866 States
76 Shift/Reduce conflicts
92 Reduce/Reduce conflicts
- type "aflex -i -E pascal.l" (No output)
- change the file extensions (.a) of new Ada files if needed (e.g. for GNAT) and move them to upper directory
ls:
pascal.a pascal_io.a pascal.l01 pascal.l06 pascal_shift_reduce.ads pascal.y00 pascal.y03 pascal.y07
pascal_dfa.a pascal.l pascal.l02 pascal.l97 pascal_tokens.ads pascal.y01 pascal.y05 pascal.y97
pascal_goto.ads pascal.l00 pascal.l03 pascal.l99 pascal.y pascal.y02 pascal.y06 pascal.y99
(I assume that I have to change pascal.a, pascal_io.a and pascal_dfa.a to .ads and move to the upper directory., here the forth weird thing)
- build P2Ada ("gnatmake p2ada").and then:
$ gnatmake p2ada
gcc -c p2ada.adb
pascal_io.ads:91:01: end of file expected, file can have only one compilation unit
gnatmake: "p2ada.adb" compilation error
I don't understand what happends, it looks that the steps of the README does not correspond to this version.
Any idea?
The status of my files are the following:
https://www.dropbox.com/s/9h25jpumt1pzayp/p2ada-aug-2010-src.zip?dl=0
Thanks
next prev parent reply other threads:[~2015-07-29 14:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-20 11:51 Pascal to ADA Converter arroyopinto
2015-07-20 12:27 ` G.B.
2015-07-20 12:28 ` G.B.
2015-07-20 12:37 ` Mark Carroll
2015-07-20 12:47 ` gautier_niouzes
2015-07-29 8:16 ` Fernando Arroyo
2015-07-29 8:30 ` Jacob Sparre Andersen
2015-07-29 14:59 ` Fernando Arroyo [this message]
2015-07-29 16:03 ` Niklas Holsti
2015-07-29 20:00 ` gautier_niouzes
2015-07-31 10:40 ` Fernando Arroyo
-- strict thread matches above, loose matches on Subject: below --
1997-11-14 0:00 Pascal to Ada Converter R. Karl Werner
1992-01-08 16:55 Pascal to Ada converter email!swdsrv.edvz.univie.ac.at!news.tu-graz.ac.at!fstgds03!ggt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox