comp.lang.ada
 help / color / mirror / Atom feed
* pb with child units
@ 2001-02-23 14:06 Veronique GAILDRAT
  2001-02-23 14:43 ` Ted Dennison
  0 siblings, 1 reply; 2+ messages in thread
From: Veronique GAILDRAT @ 2001-02-23 14:06 UTC (permalink / raw)


Hello,

I try to call a subprogram from a brother unit :

specification of the parent unit :
---------------------------------
generic
  type Item is private;
  with function image (t : Item) return String;
  with function equals (i1, i2 : Item) return boolean;

package liste_dyn_gen_p is
	type Liste is limited private; 
	LISTE_VIDE, LISTE_PLEINE, ERREUR_INDEX : exception;

	-- d�clarations des op�rations export�es par le TDA
	function toString (le : Liste) return String;
........
	private
		type Cellule;
		type Liste is access Cellule;
		type Cellule is record
			value : Item;
			nextV : Liste;
		end record;
end liste_dyn_gen_p;

specification of the called unit :
---------------------------------
generic
package liste_dyn_gen_p.liste_simple_p is
	procedure insererEnTete (le : in out Liste; i : Item);
....
end liste_dyn_gen_p.liste_simple_p;

call :
------
specification :
---------------
generic
	with function "<"(i1, i2 : Item) return Boolean;
package liste_dyn_gen_p.liste_dyn_triee_p is
	procedure inserer (le : in out Liste; e : Item);
end liste_dyn_gen_p.liste_dyn_triee_p;

body :
------
with liste_dyn_gen_p.liste_simple_p;

package body liste_dyn_gen_p.liste_dyn_triee_p is
	procedure inserer (le : in out Liste; e : Item) is
		pt : Liste := le;
		pTmp : Liste;
	begin
		if estVide(le) or else  e < premier(le) then 
----> error ---->	liste_dyn_gen_p.liste_simple_p.insererEnTete(le, e);
		else
......
		end if;
	end inserer;
end liste_dyn_gen_p.liste_dyn_triee_p;

The compiling error is the next one : 
	invalid prefix in selected component "liste_simple_p"

but liste_simple_p is a child unit of liste_dyn_gen_p !
They are both generic, but a can use them in a child unit ??

An idea ??

Thanks

-- 
------------------------
Veronique Gaildrat
IRIT-UPS
email : gaildrat@irit.fr
------------------------



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

end of thread, other threads:[~2001-02-23 14:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-23 14:06 pb with child units Veronique GAILDRAT
2001-02-23 14:43 ` Ted Dennison

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