comp.lang.ada
 help / color / mirror / Atom feed
* explanation about an error message
@ 2004-07-07  9:57 Evangelista Sami
  2004-07-07 12:58 ` Georg Bauhaus
  0 siblings, 1 reply; 4+ messages in thread
From: Evangelista Sami @ 2004-07-07  9:57 UTC (permalink / raw)


hello

could someone explain to me this error message i get :

generator.adb:4:06: unit in with clause is private child unit
generator.adb:4:06: current unit must also have parent "Decls"

and what i could i do to fix that?



the code is the following :

file generator.adb :
-------------------------------

with Generator.Decls; use Generator.Decls;
with Generator.Decls.Vars; use Generator.Decls.Vars;  
package body Generator is
   ...
end generator;
-------------------------------

line 4 is "with Generator.Decls.Vars; use Generator.Decls.Vars;".
generator.decls and generator.decls.vars are two private packages.


thanks



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

* Re: explanation about an error message
  2004-07-07  9:57 explanation about an error message Evangelista Sami
@ 2004-07-07 12:58 ` Georg Bauhaus
  2004-07-07 19:51   ` Evangelista Sami
  0 siblings, 1 reply; 4+ messages in thread
From: Georg Bauhaus @ 2004-07-07 12:58 UTC (permalink / raw)


Evangelista Sami <evangeli@cnam.fr> wrote:
: 
: generator.adb:4:06: unit in with clause is private child unit
: generator.adb:4:06: current unit must also have parent "Decls"
 
: file generator.adb :
: -------------------------------
: 
: with Generator.Decls; use Generator.Decls;
: with Generator.Decls.Vars; use Generator.Decls.Vars;  
: package body Generator is
:   ...
: end generator;
: -------------------------------
: 
: line 4 is "with Generator.Decls.Vars; use Generator.Decls.Vars;".
: generator.decls and generator.decls.vars are two private packages.

I've found it useful to think of children as of nested packages:

package Generator is

   procedure run;

private  -- part of Generator

   foo: Wide_Character;

   package Vars is

      var_foo: Wide_Character;


   private  -- part of Vars

      package Decls is
         decl_foo: Wide_Character;
      end Decls;

   end Vars;

end Generator;

package body Generator is

   ---------
   -- run --
   ---------

   procedure run is
      oops: Wide_Character;
   begin
      oops := Vars.var_foo;
      oops := Vars.Decls.decl_foo;
   end run;

end Generator;


    11.       oops := Vars.Decls.decl_foo;
                          |
        >>> "Decls" is not a visible entity of "Vars"





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

* Re: explanation about an error message
  2004-07-07 12:58 ` Georg Bauhaus
@ 2004-07-07 19:51   ` Evangelista Sami
  2004-07-07 20:32     ` Randy Brukardt
  0 siblings, 1 reply; 4+ messages in thread
From: Evangelista Sami @ 2004-07-07 19:51 UTC (permalink / raw)


Georg Bauhaus <sb463ba@l1-hrz.uni-duisburg.de> wrote in message news:<ccgs2c$bjm$1@a1-hrz.uni-duisburg.de>...
> Evangelista Sami <evangeli@cnam.fr> wrote:
> : 
> : generator.adb:4:06: unit in with clause is private child unit
> : generator.adb:4:06: current unit must also have parent "Decls"
>  
> : file generator.adb :
> : -------------------------------
> : 
> : with Generator.Decls; use Generator.Decls;
> : with Generator.Decls.Vars; use Generator.Decls.Vars;  
> : package body Generator is
> :   ...
> : end generator;
> : -------------------------------
> : 
> : line 4 is "with Generator.Decls.Vars; use Generator.Decls.Vars;".
> : generator.decls and generator.decls.vars are two private packages.
> 
> I've found it useful to think of children as of nested packages:
> 
> package Generator is
> 
>    procedure run;
> 
> private  -- part of Generator
> 
>    foo: Wide_Character;
> 
>    package Vars is
> 
>       var_foo: Wide_Character;
> 
> 
>    private  -- part of Vars
> 
>       package Decls is
>          decl_foo: Wide_Character;
>       end Decls;
> 
>    end Vars;
> 
> end Generator;
> 
> package body Generator is
> 
>    ---------
>    -- run --
>    ---------
> 
>    procedure run is
>       oops: Wide_Character;
>    begin
>       oops := Vars.var_foo;
>       oops := Vars.Decls.decl_foo;
>    end run;
> 
> end Generator;
> 
> 
>     11.       oops := Vars.Decls.decl_foo;
>                           |
>         >>> "Decls" is not a visible entity of "Vars"


so what i'm tryng to do is impossible?



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

* Re: explanation about an error message
  2004-07-07 19:51   ` Evangelista Sami
@ 2004-07-07 20:32     ` Randy Brukardt
  0 siblings, 0 replies; 4+ messages in thread
From: Randy Brukardt @ 2004-07-07 20:32 UTC (permalink / raw)


"Evangelista Sami" <evangeli@cnam.fr> wrote in message
news:5f59677c.0407071151.697198f6@posting.google.com...
...
> >     11.       oops := Vars.Decls.decl_foo;
> >                           |
> >         >>> "Decls" is not a visible entity of "Vars"
>
>
> so what i'm tryng to do is impossible?

Possibly. I wonder why Decls.Vars is a private package in the first place.
The usual intent is to keep the package from being used outside of the
Generators hierarchy, but that is already accomplished by Decls.Vars being
private. So, if Decls.Vars was a non-private package, you wouldn't have the
problem. It still couldn't be withed by clients of Generators, as Decls
would still be private.

                Randy.








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

end of thread, other threads:[~2004-07-07 20:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-07  9:57 explanation about an error message Evangelista Sami
2004-07-07 12:58 ` Georg Bauhaus
2004-07-07 19:51   ` Evangelista Sami
2004-07-07 20:32     ` Randy Brukardt

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