Re: [netmod] Does YANG allow forward references to groupings?

Martin Bjorklund <mbj@tail-f.com> Thu, 27 October 2016 11:10 UTC

Return-Path: <mbj@tail-f.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E4F9612940E for <netmod@ietfa.amsl.com>; Thu, 27 Oct 2016 04:10:18 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.332
X-Spam-Level:
X-Spam-Status: No, score=-2.332 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RP_MATCHES_RCVD=-0.431, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4mPmZc71J6F4 for <netmod@ietfa.amsl.com>; Thu, 27 Oct 2016 04:10:17 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id 953A8129444 for <netmod@ietf.org>; Thu, 27 Oct 2016 04:10:17 -0700 (PDT)
Received: from localhost (unknown [173.38.220.42]) by mail.tail-f.com (Postfix) with ESMTPSA id C8AC21AE0335; Thu, 27 Oct 2016 13:10:15 +0200 (CEST)
Date: Thu, 27 Oct 2016 13:09:10 +0200
Message-Id: <20161027.130910.1427642386163433591.mbj@tail-f.com>
To: wivory@Brocade.com
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <d20fdada1dc243d18f4f097009f04b75@EMEAWP-EXMB11.corp.brocade.com>
References: <d20fdada1dc243d18f4f097009f04b75@EMEAWP-EXMB11.corp.brocade.com>
X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/0NubgPvWZAPGgc2nZuaK45CG7tg>
Cc: netmod@ietf.org
Subject: Re: [netmod] Does YANG allow forward references to groupings?
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 27 Oct 2016 11:10:19 -0000

William Ivory <wivory@Brocade.com> wrote:
> Hi,
> 
> I'd appreciate clarification on whether a YANG grouping defined and
> used in the same file must have the grouping definition first, before
> the 'uses' statement.
> 
> On the one hand, RFC 6020 section 7.11 states: 'Once a grouping is
> defined, it can be referenced in a "uses" statement', suggesting a C /
> C++ -style which doesn't allow forward references.
> (https://tools.ietf.org/html/rfc6020#section-7.11)
> 
> On the other hand, section 6.2 states 'Forward references are allowed
> in YANG.' (https://tools.ietf.org/html/rfc6020#section-6.2).
> 
> I am assuming that the second, more explicit, statement trumps the
> first, but would appreciate confirmation.

Correct.  YANG allows forward references to groupings.


/martin