In A.1.10

    package_item ::=
        package_or_generate_item_declaration
        | anonymous_program
        | package_export_declaration
        | timeunits_declaration

In Syntax 19-1

    package_item ::=
        package_or_generate_item_declaration
        | anonymous_program
        | package_export_declaration
        | timeunits_declaration

In A.2.1.3 Type declarations

    package_export_declaration ::=
       
export *::*;
        |
export package_import_item { , package_import_item } ;


After 19.2.2, insert new section

19.2.3  Exporting imported names from packages

 

package_export_declaration ::=
       
export *::*;
        |
export package_import_item { , package_import_item } ;

 
 

   

Syntax 19-3—Package export syntax (excerpt from Annex A)


By default, declarations imported into a package are not visible by way of subsequent imports of that package.  Package export declarations allow a package to specify that imported declarations are to be made visible in subsequent imports.  A package export may precede a corresponding package import.
 
An export of the form
package_name::* exports all declarations that were actually imported from package_name within the context of the exporting package.  All names from package_name, whether imported directly or through wildcard imports, are made available. Symbols that are candidates for import but not actually imported are not made available.  The special wildcard export form,  export *::*; ,  exports all imported declarations from all packages from which imports occur.

 An export of the form
package_name::name makes the given declaration available. It shall be an error if the given declaration is not a candidate for import or if the declaration is not actually imported in the package.  The declaration being exported must be imported from the same package_name used in the export.  If the declaration is an unreferenced candidate for import, the export shall be considered to be a reference and shall import the declaration into the package following the same rules as for a direct import of the name.

 An import of a declaration made visible through an export is equivalent to an import of the original declaration.  Thus direct or wildcard import of a declaration by way of multiple exported paths does not cause conflicts.

 It is valid to specify multiple exports that export the same actual declaration.


Examples:

 

package p1;

   int x,y;

endpackage

 

 

package p2;

   import p1::x;

   export p1::*;    // exports p1::x as the name "x";

                    // p1::x and p2::x are the same declaration

endpackage

 

package p3;
   import p1::*;

   import p2::*;

   export p2::*;

   int q = x;

   // p1::x and q are made available from p3.  Although p1::y

   // is a candidate for import, it is not actually imported

   // since it is not referenced. Since p1::y is not imported,

   // it is not made available by the export.
endpackage

 


package p4;

   import p1::*;

   export p1::*;

   int y = x;       // y is available as a direct declaration;

                    // p1::x is made available by the export

endpackage

 

package p5;

   import p4::*;

   import p1::*;

   export p1::x;  

   export p4::x;    // p4::x refers to the same declaration

                    // as p1::x so this is legal.              

endpackage

 

package p6;

    import p1::*;

    export p1::x;

    int x;          // Error. export p1::x is considered to                     

                    // be a reference to "x" so a subsequent

                    // declaration of x is illegal.

endpackage

 

package p7;

    int y;

endpackage

 

package p8;

    export *::*;    // Exports both p7::y and p1::x.

    import p7::y;

    import p1::x;

endpackage

 

module top;

   import p2::*;

   import p4::*;

   int y = x;       // x is p1::x

endmodule

 

 

[Note to editor: Please update the numbers of Syntax 19-3, Syntax 19-4 and Syntax 19-5 to Syntax 19-4, Syntax 19-5 and Syntax 19-6.]