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

From: William Ivory <[email-masked]>
Date: Thu, 27 Oct 2016 10:48:46 +0000

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.

Thanks,

William

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 27 Oct 2016 13:09:10 +0200 (CEST)

William Ivory <[email-masked]> 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

---

From: William Ivory <[email-masked]>
Date: Thu, 27 Oct 2016 13:09:50 +0000

Thanks for confirming,

William

-----Original Message-----
From: Martin Bjorklund [mailto:[email-masked]] 
Sent: 27 October 2016 12:09
To: William Ivory <[email-masked]>
Cc: [email-masked]
Subject: Re: [netmod] Does YANG allow forward references to groupings?

William Ivory <[email-masked]> wrote:
> (https://urldefense.proofpoint.com/v2/url?u=https-3A__tools.ietf.org_h
> tml_rfc6020-23section-2D7.11&d=DQICAg&c=IL_XqQWOjubgfqINi2jTzg&r=GByLe
> g9jZvOv_AlgBo9uvdDrxizlOR7l_SnTXowyJU8&m=WaccLYiQTR3H0OaccbcvkoVdly-9B
> GDfTNinmMS_xB0&s=HWT6JMdt0mDXM1-aPiwzhZOp2qLAsYo2w4h9G2lnIP8&e= )
> 
> in YANG.' (https://urldefense.proofpoint.com/v2/url?u=https-3A__tools.ietf.org_html_rfc6020-23section-2D6.2&d=DQICAg&c=IL_XqQWOjubgfqINi2jTzg&r=GByLeg9jZvOv_AlgBo9uvdDrxizlOR7l_SnTXowyJU8&m=WaccLYiQTR3H0OaccbcvkoVdly-9BGDfTNinmMS_xB0&s=AMlXnMqEUOMZ6Lb0HQ-Y97cHo7BR0n7xK7cewn51wq4&e= ).
> 

/martin