comple fail

Schneider schneidt at mail.nih.gov
Thu Jul 14 02:16:37 CEST 2016


Pascal:

I got the translator and compiler working but could not translate and
compile a simple pascal program of my own.

verysimple.p - my pascal program
verysimple.adb - my pascal program translated to Ada

When I try to gnatmake:

% gnatmake verysimple.adb 
gcc -c verysimple.adb
verysimple.adb:32:01: no candidate interpretations match the actuals:
verysimple.adb:32:01: missing argument for parameter "Item" in call to "put" declared at a-tienio.ads:50, instance at line 24
verysimple.adb:32:01: missing argument for parameter "Item" in call to "put" declared at a-tienio.ads:34, instance at line 24
verysimple.adb:32:01: missing argument for parameter "Item" in call to "put" declared at a-tiflio.ads:79, instance at a-lfteio.ads:18
verysimple.adb:32:01: missing argument for parameter "Item" in call to "put" declared at a-tiflio.ads:61, instance at a-lfteio.ads:18
verysimple.adb:32:01: missing argument for parameter "Item" in call to "put" declared at a-tiflio.ads:79, instance at a-flteio.ads:20
verysimple.adb:32:01: missing argument for parameter "Item" in call to "put" declared at a-tiflio.ads:61, instance at a-flteio.ads:20
verysimple.adb:32:01: missing argument for parameter "Item" in call to "put" declared at a-tiinio.ads:76, instance at a-inteio.ads:18
verysimple.adb:32:01: missing argument for parameter "Item" in call to "put" declared at a-tiinio.ads:60, instance at a-inteio.ads:18
verysimple.adb:32:01: missing argument for parameter "Item" in call to "put" declared at a-textio.ads:241
verysimple.adb:32:01: missing argument for parameter "Item" in call to "put" declared at a-textio.ads:207
verysimple.adb:32:05: expected type "Standard.Boolean"
verysimple.adb:32:05: found private type "Ada.Text_Io.File_Type"
verysimple.adb:32:05:   ==> in call to "Put" at a-tienio.ads:40, instance at line 24
verysimple.adb:32:05:   ==> in call to "Put" at a-tiflio.ads:68, instance at a-lfteio.ads:18
verysimple.adb:32:05:   ==> in call to "Put" at a-tiflio.ads:68, instance at a-flteio.ads:20
verysimple.adb:32:05:   ==> in call to "Put" at a-tiinio.ads:66, instance at a-inteio.ads:18
verysimple.adb:32:05:   ==> in call to "Put" at a-textio.ads:242
verysimple.adb:32:05:   ==> in call to "Put" at a-textio.ads:208
gnatmake: "verysimple.adb" compilation error

Any idea what I'm dong wrong?

Thanks,

Tom

  Thomas D. Schneider, Ph.D.
  Senior Investigator
  National Institutes of Health
  National Cancer Institute
  Center for Cancer Research
  Gene Regulation and Chromosome Biology Laboratory
  Molecular Information Theory Group
  Frederick, Maryland  21702-1201
  schneidt at mail.nih.gov
  https://schneider.ncifcrf.gov (current link)
  https://alum.mit.edu/www/toms (permanent link)
-------------- next part --------------
program verysimple (output);
begin
writeln(output,'very simple hello world');
end.
-------------- next part --------------
-- Translated on 13-Jul-2016 by (New) P2Ada v. 28-Oct-2009
-- The following with/use clauses are put graciously by P2Ada.
-- Some of them may be useless, your Ada compiler will tell it you.
--   (GNAT: with '-gnatwa')
with Ada.Text_IO;                       use Ada.Text_IO;
with Ada.Integer_Text_IO;               use Ada.Integer_Text_IO;
with Ada.Float_Text_IO;                 use Ada.Float_Text_IO;
with Ada.Long_Float_Text_IO;            use Ada.Long_Float_Text_IO;
with Ada.Direct_IO;
with Ada.Command_Line;                  use Ada.Command_Line; -- ParamStr,...
with Ada.Characters.Handling;           use Ada.Characters.Handling; -- UpCase
with Interfaces;                        use Interfaces; -- For Shift_Left/Right
-- This is for Pi :
with Ada.Numerics;                      use Ada.Numerics;
-- This is for Sqrt, Sin, Cos, etc. :
with Ada.Numerics.Elementary_Functions; use Ada.Numerics.Elementary_Functions;
with Ada.Numerics.Long_Elementary_Functions;
 use Ada.Numerics.Long_Elementary_Functions;
-- This is for Dispose. P2Ada writes automatically:
--   "Dispose is new Ada.Unchecked_Deallocation(<type>, <pointer type>)".
with Ada.Unchecked_Deallocation;

procedure  verysimple is
  package Boolean_Text_IO is new Enumeration_IO(Boolean);
  use Boolean_Text_IO; -- [P2Ada]: This is for 'Write([Boolean])'
  package Byte_Direct_IO is new Ada.Direct_IO(Unsigned_8);
 -- [P2Ada]: This is for 'file' without type
  Program_halted: exception; -- [P2Ada]: This is for the Halt pseudo-procedure
 output: Ada.Text_IO.File_Type;

begin
Put(output);
Put( -- [P2Ada]: !Help! Maybe (file,...) here
"very simple hello world"); New_Line; -- [P2Ada]: !Help! Maybe (file)

end verysimple;
-- Translated on 13-Jul-2016 by (New) P2Ada v. 28-Oct-2009




More information about the Gpc mailing list