Subject: [YANG] legal uses-stmt?

From: Andy Bierman <[email-masked]>
Date: Wed, 26 Dec 2007 19:48:10 -0800

Hi,

Is this legal?

   grouping A {
     leaf x { type string; }
   }

   container foo {
     uses A {
       leaf x { description "blah"; }
       leaf x { default "blah-blah"; }
     }
   }

Or is each leaf from 'grouping A' allowed to be specified 0 or 1 time
within the 'uses A' statement?  The ABNF allows the above,
and sec 7.11.2 doesn't say (although there is a CLR about the
clauses being in the same order as in the grouping).

Andy

_______________________________________________
YANG mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/yang

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 27 Dec 2007 08:38:36 +0100 (CET)

Andy Bierman <[email-masked]> wrote:
> within the 'uses A' statement? 

Yes, that was the idea.

> The ABNF allows the above,

The ABNF cannot make these kind of restrictions, since the identifier
is dynamic.

> clauses being in the same order as in the grouping).

I'll update 7.11.2

/martin

---

From: Andy Bierman <[email-masked]>
Date: Thu, 27 Dec 2007 09:12:31 -0800

>> within the 'uses A' statement? 

good -- then it works the same as the rules for container or list

>> clauses being in the same order as in the grouping).

What about removing the CLR about the clauses in the 'uses' must
match the exact order of clauses in the grouping?   One of the
things that makes YANG user-friendly (and a pain to implement ;-)
is that forward references are allowed, and most sub-statements
can appear in any order.  Statement order is only forced when
it really matters, like imports before the body statements.

Andy