GPC module restrictions etc

Thu, 06 Feb 1997 13:34:47 +0100



------------71D9648479760
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by santra.hut.fi id OAA18262

Hello!

I'm looking at GPC to decide wether or not to use it to port a quit
large application from
VMS to Unix. The original source is written in Vax-pascal, not by me,
some ten years
ago. It consists of lots of compiler dependent features such as
Vax-pascal 'environment'
and 'inherit'-statemets that should relatively easy translate to module
exports and imports
of GPC, but also of. constructs that are, perhaps not that easy to
translate.

Currently wehave installed the 2.0 version of GPC on our Sun Solaris 5.5
machine.

The size of the system, about 175 modules, som 70 klines of code,
implies that
the translation have to rely on safe module-import/export functionality.
According to the
documentation the GPI-mechanism is not as stable as it should be.
but what is the actual problem?
what are the limitations?
the problem of unsized strings and GPI import? (I get a warning that
there are incompatible pointers
when calling an imported function with a varying string.)
is there som work beeing done to fix it?

Other questions that I also came up with are:
Calling  functions in C, is easy, just put a C; as a declaration af the
body. How about
calling functions in ADA (i.e. Gnat)? The other way around, other
languages calling
functions written in Pascal?

The code uses lots of  varying length strings written partly as schemas,
and partly as some
sort of conformant arrays in parameter lists. A piece fo code may look
like this:

Var    text_str  : varying (. len .) of char ;

procedure testproc ( str :  varying (.len .) of char );
var i : integer ;
begin
  for i :=3D 1 to len do
    something(i,str);
end ;

This should translate to

Var text_str : string;

procedure testproc ( str :  string );
var i : integer ;
begin
  for i :=3D 1 to length(str) do
    something(i,str);
end ;

But how about the vax statement for issuing variable amount of
arguments?
Vax-pascal:

procedure test_pro ( var arg1 : integer; [list] therest : integer) ;
var cnt : integer ;
begin
  arg1:=3D 0 ;
  for cnt :=3D 1 to argument_list_length (therest) do
    arg1 :=3D arg1 + argument(therest, cnt):
end;

Is there a construct for this in GPC? (in that case I=B4m sorry but I
haven=B4t found it in the manual)

I don=B4t think I'm on the subscriberlist so please post your reply
directly to me aswell.
(I've tried to subscribe , but I'havent hear anything...)

Thank you guys, Gnu Pascal's  great, but I still miss some important
consepts from the
extended pascal definition. (Schemas and module integrity...)
Hope that all the stuff will be there some day, right now I feel it is
not so safe
that it will suit our need for this project, but perhaps in the future..

Bye!
--
/Jakob :)

mailto:Jakob.Heinemann@lmemw.ericsson.se
Ericsson Saab Avionics
Link=F6ping, Sweden

------------71D9648479760
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit



Hello!
 
I'm looking at GPC to decide wether or not to use it to port a quit large application from
VMS to Unix. The original source is written in Vax-pascal, not by me,  some ten years
ago. It consists of lots of compiler dependent features such as Vax-pascal 'environment'
and 'inherit'-statemets that should relatively easy translate to module exports and imports
of GPC, but also of. constructs that are, perhaps not that easy to translate.
 
Currently wehave installed the 2.0 version of GPC on our Sun Solaris 5.5 machine.
 
The size of the system, about 175 modules, som 70 klines of code, implies that
the translation have to rely on safe module-import/export functionality. According to the
documentation the GPI-mechanism is not as stable as it should be.  
but what is the actual problem?
what are the limitations?
the problem of unsized strings and GPI import? (I get a warning that there are incompatible pointers
when calling an imported function with a varying string.)
is there som work beeing done to fix it?
 
Other questions that I also came up with are: 
Calling  functions in C, is easy, just put a C; as a declaration af the body. How about
calling functions in ADA (i.e. Gnat)? The other way around, other languages calling
functions written in Pascal?
 
The code uses lots of  varying length strings written partly as schemas, and partly as some
sort of conformant arrays in parameter lists. A piece fo code may look like this:
 
Var    text_str  : varying (. len .) of char ;
 
procedure testproc ( str :  varying (.len .) of char );
var i : integer ;
begin 
  for i := 1 to len do 
    something(i,str);
end ;
 
This should translate to 
 
Var text_str : string;
 
procedure testproc ( str :  string );
var i : integer ;
begin 
  for i := 1 to length(str) do 
    something(i,str);
end ;
 
But how about the vax statement for issuing variable amount of arguments?
Vax-pascal:
 
procedure test_pro ( var arg1 : integer; [list] therest : integer) ;
var cnt : integer ;
begin
  arg1:= 0 ;
  for cnt := 1 to argument_list_length (therest) do
    arg1 := arg1 + argument(therest, cnt):
end;
 
Is there a construct for this in GPC? (in that case I´m sorry but I haven´t found it in the manual)
 
I don´t think I'm on the subscriberlist so please post your reply directly to me aswell.
(I've tried to subscribe , but I'havent hear anything...)
 
Thank you guys, Gnu Pascal's  great, but I still miss some important consepts from the
extended pascal definition. (Schemas and module integrity...)
Hope that all the stuff will be there some day, right now I feel it is not so safe
that it will suit our need for this project, but perhaps in the future..
 
Bye!
-- 
/Jakob :)

mailto:Jakob.Heinemann@lmemw.ericsson.se
Ericsson Saab Avionics 
Linköping, Sweden
------------71D9648479760--
Jakob Heinemann (Jakob.Heinemann@lmemw.ericsson.se)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es