comp.lang.ada
 help / color / mirror / Atom feed
* Pascal to Ada converter
@ 1992-01-08 16:55 email!swdsrv.edvz.univie.ac.at!news.tu-graz.ac.at!fstgds03!ggt
  0 siblings, 0 replies; 13+ messages in thread
From: email!swdsrv.edvz.univie.ac.at!news.tu-graz.ac.at!fstgds03!ggt @ 1992-01-08 16:55 UTC (permalink / raw)


Hello,

    Is there a pascal to ada converter available, either commercial
or public domain ? Preferable it should run under VAX/VMS, but other
operating systems are also ok.

Any hints are highly appreciated.

Thanks in advance

Gerhard G. Thallinger                            ggt@fstgds03.tu-graz.ac.at

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

* Pascal to Ada Converter
@ 1997-11-14  0:00 R. Karl Werner
  0 siblings, 0 replies; 13+ messages in thread
From: R. Karl Werner @ 1997-11-14  0:00 UTC (permalink / raw)




I am looking for a tool that would translate Turbo Pascal or Pascal to Ada
resonably well on a PC platform.


Any help or assistance would be greatly appreciated.

Karl

----
rkwerner@cybercomm.net






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

* Pascal to ADA Converter
@ 2015-07-20 11:51 arroyopinto
  2015-07-20 12:27 ` G.B.
  2015-07-20 12:47 ` gautier_niouzes
  0 siblings, 2 replies; 13+ messages in thread
From: arroyopinto @ 2015-07-20 11:51 UTC (permalink / raw)


Hello, 

I have a source code written in pascal which works properly in a specific embedded system. 

I want to use the same source code in another enhanced embedded system with a new processor. 

This new processor has very poor pascal compiler and my pascal code does not run on it. I was recommend to use an ADA compiler which is good for my processor. 

However, I do not want to modify my pascal code since is too large and I would like to use a Pascal to ADA converter (ADA 2012 if possible and runnable in Linux). 

I have found one in this web-site: 
http://www.adapower.com/index.php?Command=Class&ClassID=Utilities&Title=Ada+Utilities 
However, the link is broken. 

Does anyone have it? If not, does anyone can recommend me another p2ada converter? (wish: popular, generates ADA 2012 version and runnable in Linux)

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

* Re: Pascal to ADA Converter
  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:47 ` gautier_niouzes
  1 sibling, 1 reply; 13+ messages in thread
From: G.B. @ 2015-07-20 12:27 UTC (permalink / raw)


On 20.07.15 13:51, arroyopinto@gmail.com wrote:

> I have found one in this web-site:
> http://www.adapower.com/index.php?Command=Class&ClassID=Utilities&Title=Ada+Utilities
> However, the link is broken.
>
> Does anyone have it? If not, does anyone can recommend me another p2ada converter? (wish: popular, generates ADA 2012 version and runnable in Linux)

Trying this,

https://www.google.de/search?client=safari&rls=en&q=Pascal/Delphi+to+Ada+Converter+(Gautier+de+Montmollin)&ie=UTF-8&oe=UTF-8

has produced a link to sourceforge.net for p2ada.



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

* Re: Pascal to ADA Converter
  2015-07-20 12:27 ` G.B.
@ 2015-07-20 12:28   ` G.B.
  2015-07-20 12:37     ` Mark Carroll
  0 siblings, 1 reply; 13+ messages in thread
From: G.B. @ 2015-07-20 12:28 UTC (permalink / raw)


On 20.07.15 14:27, G.B. wrote:
> On 20.07.15 13:51, arroyopinto@gmail.com wrote:
>
>> I have found one in this web-site:
>> http://www.adapower.com/index.php?Command=Class&ClassID=Utilities&Title=Ada+Utilities
>>
>> However, the link is broken.
>>
>> Does anyone have it? If not, does anyone can recommend me another
>> p2ada converter? (wish: popular, generates ADA 2012 version and
>> runnable in Linux)
>
> Trying this,
>
> https://www.google.de/search?client=safari&rls=en&q=Pascal/Delphi+to+Ada+Converter+(Gautier+de+Montmollin)&ie=UTF-8&oe=UTF-8
>
>
> has produced a link to sourceforge.net for p2ada.

and sourceforge.net appears to be recovering from something,
so it might take a moment until any link is back again.


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

* Re: Pascal to ADA Converter
  2015-07-20 12:28   ` G.B.
@ 2015-07-20 12:37     ` Mark Carroll
  0 siblings, 0 replies; 13+ messages in thread
From: Mark Carroll @ 2015-07-20 12:37 UTC (permalink / raw)


"G.B." <bauhaus@futureapps.invalid> writes:

> and sourceforge.net appears to be recovering from something,
> so it might take a moment until any link is back again.

Yes, their storage array broke and they had to restore from backup.

-- Mark


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

* Re: Pascal to ADA Converter
  2015-07-20 11:51 Pascal to ADA Converter arroyopinto
  2015-07-20 12:27 ` G.B.
@ 2015-07-20 12:47 ` gautier_niouzes
  2015-07-29  8:16   ` Fernando Arroyo
  1 sibling, 1 reply; 13+ messages in thread
From: gautier_niouzes @ 2015-07-20 12:47 UTC (permalink / raw)


The access by the SF project page is still working

http://sourceforge.net/projects/p2ada/

Especially, you can grab the P2Ada sources there:

http://sourceforge.net/projects/p2ada/files/p2ada/Sources/

There are also precompiled binaries.
Cheers
_________________________ 
Gautier's Ada programming 
http://gautiersblog.blogspot.com/search/label/Ada 
NB: follow the above link for a valid e-mail address 


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

* Re: Pascal to ADA Converter
  2015-07-20 12:47 ` gautier_niouzes
@ 2015-07-29  8:16   ` Fernando Arroyo
  2015-07-29  8:30     ` Jacob Sparre Andersen
  0 siblings, 1 reply; 13+ messages in thread
From: Fernando Arroyo @ 2015-07-29  8:16 UTC (permalink / raw)


On Monday, July 20, 2015 at 2:47:13 PM UTC+2, gautier...@hotmail.com wrote:
> The access by the SF project page is still working
> 
> http://sourceforge.net/projects/p2ada/
> 
> Especially, you can grab the P2Ada sources there:
> 
> http://sourceforge.net/projects/p2ada/files/p2ada/Sources/
> 
> There are also precompiled binaries.
> Cheers
> _________________________ 
> Gautier's Ada programming 
> http://gautiersblog.blogspot.com/search/label/Ada 
> NB: follow the above link for a valid e-mail address

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 (or at least in a DOS simulator in linux called DOSEMU). When I try to run this program in DOSEMU, it says that "This program cannot be run in DOS mode". In the repository that you sent me there is not precompiled binaries for intel and linux. 

Any idea? It would be preferably don't have to recompile the sources.

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

* Re: Pascal to ADA Converter
  2015-07-29  8:16   ` Fernando Arroyo
@ 2015-07-29  8:30     ` Jacob Sparre Andersen
  2015-07-29 14:59       ` Fernando Arroyo
  0 siblings, 1 reply; 13+ messages in thread
From: Jacob Sparre Andersen @ 2015-07-29  8:30 UTC (permalink / raw)


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.


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

* Re: Pascal to ADA Converter
  2015-07-29  8:30     ` Jacob Sparre Andersen
@ 2015-07-29 14:59       ` Fernando Arroyo
  2015-07-29 16:03         ` Niklas Holsti
  2015-07-29 20:00         ` gautier_niouzes
  0 siblings, 2 replies; 13+ messages in thread
From: Fernando Arroyo @ 2015-07-29 14:59 UTC (permalink / raw)


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

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

* Re: Pascal to ADA Converter
  2015-07-29 14:59       ` Fernando Arroyo
@ 2015-07-29 16:03         ` Niklas Holsti
  2015-07-29 20:00         ` gautier_niouzes
  1 sibling, 0 replies; 13+ messages in thread
From: Niklas Holsti @ 2015-07-29 16:03 UTC (permalink / raw)


On 15-07-29 17:59 , Fernando Arroyo wrote:

> 	- 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?

Well, there seems to be something that GNAT does not like in the file 
pascal_io.ads, at line 91.

That error message usually means that the source-code file needs to be 
divided into separate files, one for each compilation unit (package 
declaration, package body, ...) in the original file. Some other Ada 
compilers accept source-code files that contain several compilation 
units, but GNAT does not.

> The status of my files are the following:
> https://www.dropbox.com/s/9h25jpumt1pzayp/p2ada-aug-2010-src.zip?dl=0

I did not find any file named pascal_io.ads there. Do you have a file by 
that name?

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .


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

* Re: Pascal to ADA Converter
  2015-07-29 14:59       ` Fernando Arroyo
  2015-07-29 16:03         ` Niklas Holsti
@ 2015-07-29 20:00         ` gautier_niouzes
  2015-07-31 10:40           ` Fernando Arroyo
  1 sibling, 1 reply; 13+ messages in thread
From: gautier_niouzes @ 2015-07-29 20:00 UTC (permalink / raw)


Hello,
My recommendation: use the 2008 .zip version (no further improvement in the translator itself), or do a checkout of the current version:

  svn checkout svn://svn.code.sf.net/p/p2ada/code/ p2ada

, then look at the /newp2ada/current/ directory.

NB: if your Pascal sources are a bit of the Borland / Turbo / Delphi dialect, (especially with conditional defines and switches that change the language behaviour after them) then the bp2p preprocessor might help as well. Then "gnatmake bp2p" will build that as well. Run bp2p for instructions.
_________________________
Gautier's Ada programming
http://gautiersblog.blogspot.com/search/label/Ada
NB: follow the above link for a valid e-mail address

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

* Re: Pascal to ADA Converter
  2015-07-29 20:00         ` gautier_niouzes
@ 2015-07-31 10:40           ` Fernando Arroyo
  0 siblings, 0 replies; 13+ messages in thread
From: Fernando Arroyo @ 2015-07-31 10:40 UTC (permalink / raw)


Ok in this case I will use the 2008 one.

I have another problem when I convert a file from .pas to .ada. The p2ada generates with/use clauses that I would like to remove. Is there any file that I can modify for add/remove them?

Thanks

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

end of thread, other threads:[~2015-07-31 10:40 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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