[YANG] combining sub-modules

Andy Bierman <ietf@andybierman.com> Sat, 05 January 2008 00:29 UTC

Return-path: <yang-bounces@ietf.org>
Received: from [127.0.0.1] (helo=stiedprmman1.va.neustar.com) by megatron.ietf.org with esmtp (Exim 4.43) id 1JAwvF-0000hX-CL; Fri, 04 Jan 2008 19:29:57 -0500
Received: from yang by megatron.ietf.org with local (Exim 4.43) id 1JAwvD-0000hP-Si for yang-confirm+ok@megatron.ietf.org; Fri, 04 Jan 2008 19:29:55 -0500
Received: from [10.90.34.44] (helo=chiedprmail1.ietf.org) by megatron.ietf.org with esmtp (Exim 4.43) id 1JAwvD-0000hH-Gl for yang@ietf.org; Fri, 04 Jan 2008 19:29:55 -0500
Received: from smtp119.sbc.mail.sp1.yahoo.com ([69.147.64.92]) by chiedprmail1.ietf.org with smtp (Exim 4.43) id 1JAwvD-0007Th-0n for yang@ietf.org; Fri, 04 Jan 2008 19:29:55 -0500
Received: (qmail 44046 invoked from network); 5 Jan 2008 00:29:54 -0000
Received: from unknown (HELO ?192.168.0.10?) (andybierman@att.net@68.120.80.25 with plain) by smtp119.sbc.mail.sp1.yahoo.com with SMTP; 5 Jan 2008 00:29:53 -0000
X-YMail-OSG: l9ogkoYVM1lVb_bHfbZ4EHnWz30uiBKLxi0yDCjpJoD9ZKYg
Message-ID: <477ECF81.1030702@andybierman.com>
Date: Fri, 04 Jan 2008 16:29:53 -0800
From: Andy Bierman <ietf@andybierman.com>
User-Agent: Thunderbird 2.0.0.9 (Windows/20071031)
MIME-Version: 1.0
To: yang <yang@ietf.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Scan-Signature: 8b30eb7682a596edff707698f4a80f7d
Subject: [YANG] combining sub-modules
X-BeenThere: yang@ietf.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: YANG modeling Language for NETCONF <yang.ietf.org>
List-Unsubscribe: <https://www1.ietf.org/mailman/listinfo/yang>, <mailto:yang-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www1.ietf.org/pipermail/yang>
List-Post: <mailto:yang@ietf.org>
List-Help: <mailto:yang-request@ietf.org?subject=help>
List-Subscribe: <https://www1.ietf.org/mailman/listinfo/yang>, <mailto:yang-request@ietf.org?subject=subscribe>
Errors-To: yang-bounces@ietf.org

Hi,

What are the rules for duplicate definitions in different submodules?
Assume main module 'foo' and 3 submodules.
What if sub-module A includes C, and B also include C?

    module foo
        |
        |
    +---+---+
    |       |
    A       B
    |       |
    C       C


If C has top-level definitions, or if submodules A and B simply
define the same top-level nodes, then there will be duplicates
(in the C case, may be different in the other case).

Is the 2nd 'include C' allowed?  I think so.  No rules broken, no loops.
Sec. 5.1 is not very clear on combining submodules to form
a single conceptual module.

For example, the intent is that submodules must be self-compiling,
and all definitions must be local, imported, or included in the submodule.
Submodule C cannot include A or B, and must not reference any definitions
from A or B.  None of the submodules can reference any definitions from
the main module foo.  This is not very clear.

So the compiler needs to ignore any 'duplicate object' errors
that occur from the A-C, B-C scenario, but if A and B use
the same top-level object name, it is a fatal error?
Top-level definitions can be imported from foo, regardless
of module or submodule location.



Andy


_______________________________________________
YANG mailing list
YANG@ietf.org
https://www1.ietf.org/mailman/listinfo/yang