Is is possible to have a child package as a separate compilation unit in Ada -


i have main package normal spec , body file. trying create child packages of parent, want them in separate compilation file(s). can done if package body, or if subprogram/proc/func. however, can't let me make child spec file.

the reason doing because want have information in child available other children of same parent. know can including spec portion in parent, making parent file pretty big.

is possible, or have no choice make root unit? or leave spec wise in parent?

i tried:

in parent: package child1 separate; (also tried parent.child1 gave compiles errors

in child:

separate(parent)  package parent.child1 .... end parent.child1; 

ideas? not possible?

update: compiling green hills multi compiler. ada95 language version, non-oo project.

yes, totally fine. can have parent , child packages in separate files:

parent.ads

package parent -- ... end parent; 

parent-child.ads

package parent.child -- ... end parent.child; 

parent-other.ads:

limited parent.child; --need ada 2005 package parent.other -- ... end parent.other; 

the parent.child package , parent.other package have access definitions in parent (with limitations).

notice how parent.other "withs" parent.child has access definitions in parent.child.

i have example of how can done. also, here example wikibooks.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -