comp.lang.ada
 help / color / mirror / Atom feed
* ADA error message ...
@ 1994-11-20 19:20 908mangla
  0 siblings, 0 replies; 4+ messages in thread
From: 908mangla @ 1994-11-20 19:20 UTC (permalink / raw)



The following is a .LIS file from an ADA compilation. Can someone explain the
error occuring at line 42.

Thanks, Usman

-----------------------------------------------------------------------------

CALCULATOR                      Source Listing                  20-NOV-1994 15:15:42    DEC Ada V3.0A-7                     Page   1
01                                                              20-NOV-1994 15:15:08    DISK$CS:[CS485.908MANGLA]CALC.ADA;43

      1 with TEXT_IO; use TEXT_IO;
      2 
      3 procedure CALCULATOR is
      4 	KEY:	CHARACTER:='?';
      5 	NUM:	FLOAT;
      6 	
      7 
      8 task CALCULATE is
      9 	entry ADD (X: in FLOAT);
     10 	entry MUL (X: in FLOAT);
     11 	entry CLEAR;
     12 end CALCULATE;
     13 
     14 task body CALCULATE is
     15 	TOTAL:FLOAT:=0.0;
     16 
     17 begin
     18    loop
     19 	select
     20 		accept ADD (X: in FLOAT) do
     21 			TOTAL := TOTAL + X;
     22 		end ADD;
     23 	or
     24 		accept MUL (X: in FLOAT) do
     25 			TOTAL := TOTAL * X;
     26 		end MUL;
     27 	or
     28 		accept CLEAR do
     29 			TOTAL := 0.0;
     30 		end CLEAR;
     31 	or
     32 		terminate;
     33 	end select;
     34    end loop;
     35 end CALCULATE;
     36 
     37 procedure CALC is
     38 begin
     39 	while KEY /= '@' loop
     40 		case KEY is 
     41 		when '+' | '*' =>
     42 			get(NUM);
...................................1
%ADAC-E-INCONRSL, (1) Inconsistency detected during overload resolution [LRM 8.7]
%ADAC-I-SUPPMEAN, (1) For procedure call get the meanings considered are
            Call of procedure specification GET (ITEM : STRING) declared in TEXT_IO at line 121 (discarded because type 
                STRING of formal ITEM is not a possible type of the corresponding actual)
            Call of procedure specification GET (ITEM : CHARACTER) declared in TEXT_IO at line 114 (discarded because 
                type CHARACTER of formal ITEM is not a possible type of the corresponding actual)
            Call of procedure specification GET (FILE_TYPE; STRING) declared in TEXT_IO at line 120 (discarded because 
                of too few actual parameters: number of actuals is 1, number of formals is 2)
            Call of procedure specification GET (FILE_TYPE; CHARACTER) declared in TEXT_IO at line 113 (discarded 
                because of too few actual parameters: number of actuals is 1, number of formals is 2)
        For NUM the meaning is variable NUM at line 5 of floating-point type FLOAT in predefined STANDARD

     43 			put_line(" ");
     44 		when others => null;
\f
CALCULATOR                      Source Listing                  20-NOV-1994 15:15:42    DEC Ada V3.0A-7                     Page   2
01                                                              20-NOV-1994 15:15:08    DISK$CS:[CS485.908MANGLA]CALC.ADA;43

     45 		end case;
     46 	case KEY is
................1
%ADAC-E-NOT_EXHAUSTIVE, (1) Missing values in the range of enumeration type CHARACTER in predefined STANDARD [LRM 
        3.7.3(3), 4.3(5), 5.4(4)]
            ',' .. '<'
            NUL .. ')'
            '>' .. DEL

     47 		when '+' => CALCULATE.ADD(NUM);
     48 		when '*' => CALCULATE.MUL(NUM);
     49 		when '=' => put(NUM);
.......................................1
%ADAC-E-INCONRSL, (1) Inconsistency detected during overload resolution [LRM 8.7]
%ADAC-I-SUPPMEAN, (1) For procedure call put the meanings considered are
            Call of procedure specification PUT (ITEM : STRING) declared in TEXT_IO at line 123 (discarded because type 
                STRING of formal ITEM is not a possible type of the corresponding actual)
            Call of procedure specification PUT (ITEM : CHARACTER) declared in TEXT_IO at line 116 (discarded because 
                type CHARACTER of formal ITEM is not a possible type of the corresponding actual)
            Call of procedure specification PUT (FILE_TYPE; STRING) declared in TEXT_IO at line 122 (discarded because 
                of too few actual parameters: number of actuals is 1, number of formals is 2)
            Call of procedure specification PUT (FILE_TYPE; CHARACTER) declared in TEXT_IO at line 115 (discarded 
                because of too few actual parameters: number of actuals is 1, number of formals is 2)
        For NUM the meaning is variable NUM at line 5 of floating-point type FLOAT in predefined STANDARD

     50 			    put_line(" ");
     51 	end case;
     52 	put(":");
     53 	get(KEY);
     54 	end loop;
     55 end CALC;
     56 
     57 begin
     58 	put_line(" Enter string :");
     59 	CALC;
     60 end CALCULATOR;
     61 


PORTABILITY SUMMARY

	There are no uses of potentially nonportable constructs
\f
CALCULATOR                      Source Listing                  20-NOV-1994 15:15:42    DEC Ada V3.0A-7                     Page   3
01                                                              20-NOV-1994 15:15:08    DISK$CS:[CS485.908MANGLA]CALC.ADA;43

COMMAND QUALIFIERS

  ADA/LIS CALC.ADA


QUALIFIERS USED
        /NOANALYSIS_DATA/CHECK/COPY_SOURCE/DEBUG=ALL/ERROR_LIMIT=30/LIST/NOMACHINE_CODE
        /NODESIGN
        /NODIAGNOSTICS/LIBRARY=ADA$LIB
        /LOAD=REPLACE/NOTE_SOURCE/OPTIMIZE=(TIME,INLINE=NORMAL,SHARE=NORMAL)/SHOW=PORTABILITY/NOSMART_RECOMPILATION/NOSYNTAX_ONLY
        /WARNINGS=(NOCOMPILATION_NOTES,STATUS=LIST,SUPPLEMENTAL=ALL,WARNINGS=ALL,WEAK_WARNINGS=ALL)


\f
CALCULATOR                      Source Listing                  20-NOV-1994 15:15:42    DEC Ada V3.0A-7                     Page   4
01                                                              20-NOV-1994 15:15:08    DISK$CS:[CS485.908MANGLA]CALC.ADA;43

COMPILER INTERNAL TIMING

        Phase                          CPU    Elapsed    Page      I/O
                                     seconds  seconds   faults    count
  Initialization                        0.03     0.17       55       12
  Parser                                0.02     0.05       29        2
  Static Semantics                      0.08     0.19      163       32
  Generic Expansion                     0.00     0.00        0        0
  Ada Back End                          0.00     0.00        0        0
  Code Generation-Ada                   0.00     0.00        0        0
    DST Generation                      0.00     0.00        0        0
  Smart Recompilation                   0.00     0.00        0        0
  IL expansion                          0.00     0.00        0        0
  Optimization                          0.00     0.00        0        0
    Dominator tree construction         0.00     0.00        0        0
    Loop dominator insertion            0.00     0.00        0        0
    Lifetime analysis                   0.00     0.00        0        0
    IDEF computation                    0.00     0.00        0        0
    DATAFLOW computation                0.00     0.00        0        0
    Dependence analysis                 0.00     0.00        0        0
      Dependence graph building         0.00     0.00        0        0
      Dependence cycle processing       0.00     0.00        0        0
      DA heuristic weighting            0.00     0.00        0        0
      DA loop strategy selection        0.00     0.00        0        0
      DA loop contents placement        0.00     0.00        0        0
      DA final loop generation          0.00     0.00        0        0
    Strength reduction                  0.00     0.00        0        0
    Loop unroll/Loop optimization       0.00     0.00        0        0
    Test replacement                    0.00     0.00        0        0
    Profitability determination         0.00     0.00        0        0
    Profitability reordering            0.00     0.00        0        0
    Use propagation                     0.00     0.00        0        0
    Split lifetime analysis             0.00     0.00        0        0
    Base Binding                        0.00     0.00        0        0
      Base binding - Dataflow           0.00     0.00        0        0
      Base-binding - Profitability      0.00     0.00        0        0
      Base-binding - Transformation     0.00     0.00        0        0
  Code Generation                       0.00     0.00        0        0
    Context analysis                    0.00     0.00        0        0
    Register History                    0.00     0.00        0        0
    Temporary allocation                0.00     0.00        0        0
    Code emission                       0.00     0.00        0        0
  Final                                 0.00     0.00        0        0
    Peepholing                          0.00     0.00        0        0
    Final flow analysis                 0.00     0.00        0        0
    Object scheduling                   0.00     0.00        0        0
    Branch/jump resolution              0.00     0.00        0        0
  Object module generation              0.00     0.00        0        0
  List Generation                       0.00     0.11        3        8
  Compilation Library                   0.02     0.06       18        6
  Writing Units to Library              0.00     0.00        0        0
  Analysis Data Collection              0.00     0.00        0        0
  Compiler totals                       0.16     0.67      328       68



\f
CALCULATOR                      Source Listing                  20-NOV-1994 15:15:42    DEC Ada V3.0A-7                     Page   5
01                                                              20-NOV-1994 15:15:08    DISK$CS:[CS485.908MANGLA]CALC.ADA;43

COMPILATION STATISTICS

  CPU time:          0.16 seconds
  Elapsed time:      0.67 seconds
  Pagefaults:         328
  I/O Count:           68
  Source lines:        61

  22875 lines per CPU minute.
  Compilation complete



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

* Re: ADA error message ...
@ 1994-11-21 21:40 Bennett, Chip (KTR) ~U
  0 siblings, 0 replies; 4+ messages in thread
From: Bennett, Chip (KTR) ~U @ 1994-11-21 21:40 UTC (permalink / raw)


908mangla@WMICH.EDU (Usman) writes:

> The following is a .LIS file from an ADA compilation. Can someone explain
the
> error occuring at line 42.
>
> ... (source deleted)
>

You use of Text_IO.Get with a floating point type requires the instantiation
of a generic:

     package My_Float_IO is new Text_IO.Float_IO (Float);
     use My_Float_IO;

Numeric types can be anything (temperature, class_avg, etc).  Float is just
the one provided.  In other words, if you had declared a floating type like
the following:

     type Temperature is digits 6;
     ...
     package Temp_IO is new Text_IO.Float_IO (Temperature);
     use Temp_IO;

You could then use "Get" with type "Temperature".

(Be sure and give me credit on your homework assignment :-) )

*****************************************************************
* Chip Bennett, GDE Systems Inc | BennettC@j64.stratcom.af.mil  *
* USSTRATCOM/J64213             | Voice (402)294-7360           *
* 901 SAC Blvd, Suite 2B24      | FAX   (402)294-7912           *
* Offutt AFB, NE 68113-6600     | Proud member of Team Ada      *
* Opinions expressed here are my own _so_,  TTFWTW              *
*****************************************************************

Thanks, Usman
Date:    Sun, 20 Nov 1994 15:20:16 EDT
From:    908mangla@WMICH.EDU
Subject: ADA error message ...

The following is a .LIS file from an ADA compilation. Can someone explain
the
error occuring at line 42.

Thanks, Usman



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

* ADA error message ...
@ 1994-12-05 18:42 Bering
  1994-12-06  8:55 ` Ross Mather
  0 siblings, 1 reply; 4+ messages in thread
From: Bering @ 1994-12-05 18:42 UTC (permalink / raw)




@ >908mangla@wmich.edu}


@ >The following is a .LIS file from an ADA compilation. Can someone expla
@ >error occuring at line 42.

@ >Thanks, Usman

@ >-----------------------------------------------------------------------

@ >CALCULATOR                      Source Listing                  20-NOV-
@ >15:15:42    DEC Ada V3.0A-7                     Page   1
@ >01                                                              20-NOV-
@ >15:15:08    DISK$CS:[CS485.908MANGLA]CALC.ADA;43

@ >      1 with TEXT_IO; use TEXT_IO;
@ >      2 
@ >      3 procedure CALCULATOR is
@ >      4 	KEY:	CHARACTER:='?';
@ >      5 	NUM:	FLOAT;
@ >      6 	
@ >      7 
@ >      8 task CALCULATE is
@ >      9 	entry ADD (X: in FLOAT);
@ >     10 	entry MUL (X: in FLOAT);
@ >     11 	entry CLEAR;
@ >     12 end CALCULATE;
@ >     13 
@ >     14 task body CALCULATE is
@ >     15 	TOTAL:FLOAT:=0.0;
@ >     16 
@ >     17 begin
@ >     18    loop
@ >     19 	select
@ >     20 		accept ADD (X: in FLOAT) do
@ >     21 			TOTAL := TOTAL + X;
@ >     22 		end ADD;
@ >     23 	or
@ >     24 		accept MUL (X: in FLOAT) do
@ >     25 			TOTAL := TOTAL * X;
@ >     26 		end MUL;
@ >     27 	or
@ >     28 		accept CLEAR do
@ >     29 			TOTAL := 0.0;
@ >     30 		end CLEAR;
@ >     31 	or
@ >     32 		terminate;
@ >     33 	end select;
@ >     34    end loop;
@ >     35 end CALCULATE;
@ >     36 
@ >     37 procedure CALC is
@ >     38 begin
@ >     39 	while KEY /= '@' loop
@ >     40 		case KEY is 
@ >     41 		when '+' | '*' =>
@ >     42 			get(NUM);
@ >...................................1
@ >%ADAC-E-INCONRSL, (1) Inconsistency detected during overload resolution
@ >8.7]


I take it you are running under VMS on a VAX and that you wish to get user 
inport from the key board.  

You need to declare a file varable for input from the key board.
 

with TEXT_IO;
--
procedure TEST is
--
package INTEGER_IO is new TEXT_IO.INTEGER_IO(INTEGER);
--
TERMINAL : TEXT_IO.FILE_TYPE;
VALUE    : INTEGER;
--
begin -- TEST
  TEXT_IO.OPEN(TERMINAL,TEXT_IO.IN_FILE,"USER_INPUT:");
  TEXT_IO.GET(TERMINAL,VALUE);
  TEXT_IO.PUT("The value you entered was ");
  INTEGER_IO.PUT(VALUE);
  TEXT_IO.NEW_LINE;
end TEST;
 
Hope this helps Joe...



---
 * WR  [NR] * UNREGISTERED EVALUATION COPY



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

* Re: ADA error message ...
  1994-12-05 18:42 ADA error message Bering
@ 1994-12-06  8:55 ` Ross Mather
  0 siblings, 0 replies; 4+ messages in thread
From: Ross Mather @ 1994-12-06  8:55 UTC (permalink / raw)


In article <912.UUL1.3#25274@ace.com> bering@ace.com (Bering) writes:
>
>@ >      1 with TEXT_IO; use TEXT_IO;
>@ >      2 
>@ >      3 procedure CALCULATOR is
>@ >      4 	KEY:	CHARACTER:='?';
>@ >      5 	NUM:	FLOAT;
>@ >      6 	

>@ >     36 
>@ >     37 procedure CALC is
>@ >     38 begin
>@ >     39 	while KEY /= '@' loop
>@ >     40 		case KEY is 
>@ >     41 		when '+' | '*' =>
>@ >     42 			get(NUM);
>@ >...................................1
>@ >%ADAC-E-INCONRSL, (1) Inconsistency detected during overload resolution
>@ >8.7]
>
>
>I take it you are running under VMS on a VAX and that you wish to get user 
>inport from the key board.  
>
>You need to declare a file varable for input from the key board.
> 
>
>with TEXT_IO;
>--
>procedure TEST is
>--
>package INTEGER_IO is new TEXT_IO.INTEGER_IO(INTEGER);
>--
>TERMINAL : TEXT_IO.FILE_TYPE;
>VALUE    : INTEGER;
>--
>begin -- TEST
>  TEXT_IO.OPEN(TERMINAL,TEXT_IO.IN_FILE,"USER_INPUT:");
>  TEXT_IO.GET(TERMINAL,VALUE);
>  TEXT_IO.PUT("The value you entered was ");
>  INTEGER_IO.PUT(VALUE);
>  TEXT_IO.NEW_LINE;
>end TEST;
> 
I would have replied to this via e-mail, but the original posters address
appeared to be mangled.

IF this is running under VAX/VMS then the above will apply at least partially.
The most obvious error that was made was by not including the line:

package FLOAT_IO is new TEXT_IO.FLOAT_IO ( FLOAT ) ;

THe error was generated because the compiler searched the context and located
the with and use clauses for TEXT_IO. Therefore the get call would be for a
character or a string and with the variable being a float the compiler just gets
very confused.

For more info on Get functions and Float IO look in section 14.3 of the Ada83
LRM.

cheers
Ross


-- 
Ross M. Mather                         mather@mscn.nl, rmt@dasc.nl
I speak for me, and me alone. Canter & Siegel please take note.
Rugby isn't a way of life, it's more important than that. 



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

end of thread, other threads:[~1994-12-06  8:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1994-12-05 18:42 ADA error message Bering
1994-12-06  8:55 ` Ross Mather
  -- strict thread matches above, loose matches on Subject: below --
1994-11-21 21:40 Bennett, Chip (KTR) ~U
1994-11-20 19:20 908mangla

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