Subject: [netmod] choice-within-a-case

From: Andy Bierman <[email-masked]>
Date: Thu, 09 Jul 2009 21:27:27 -0700

Hi,

I was re-reading the ABNF in yang-06 and I noticed
that a choice-stmt is not allowed within a case-stmt.
I thought I was using that and yangdump missed it,
but no, I was using a choice from a grouping:

grouping HelpMode {
  choice help-mode {
     default normal;
     leaf brief { type empty; }
     leaf normal { type empty; }
     leaf full { type empty; }
  }
}

rpc eventlog {
 input {
   choice event-action {
     case show-case {
        leaf show { type uint32; }
	leaf start { type uint32; }
        uses HelpMode;
     }
     leaf clear { type uint32; }
   }
 }
}

All my tools support this just fine.
According to the yang-06 ABNF, all tools should.

So why is there a CLR preventing choice-stmt from
being used directly, but it is OK to use it
from a grouping?

Andy

---

From: Martin Bjorklund <[email-masked]>
Date: Fri, 10 Jul 2009 22:52:17 +0200 (CEST)

Hi,

> being used directly, but it is OK to use it

The intention was not to allow it through a grouping either.  But this
cannot be expressed in the ABNF grammar, it has to go into the text.

/martin

---

From: Andy Bierman <[email-masked]>
Date: Fri, 10 Jul 2009 14:27:49 -0700

> cannot be expressed in the ABNF grammar, it has to go into the text.

I think it is a dumb CLR.

I have already found more than one use case
for allowing choice within a case.

Why is the CLR needed?

Should I just write in the YANG Usage Guidelines
"You can't do this because the NETMOD WG says so,
but they don't know why."

Usually a CLR has some reason attached to it,
that can be expressed in text, if not ABNF.

Andy