Subject: [netmod] choice-stmt syntax

From: Andy Bierman <[email-masked]>
Date: Sun, 11 Dec 2011 11:49:30 -0800

Hi,

I am curious about the differences between the 'short-case-stmt' and 'case-stmt' variants.

    short-case-stmt     = container-stmt /
                          leaf-stmt /
                          leaf-list-stmt /
                          list-stmt /
                          anyxml-stmt

This is essentially a data-def-stmt without choice-stmt or uses-stmt,
A case-stmt uses *data-def-stmt.

I understand why uses-stmt cannot be in a short-case-stmt --
it can expand to more than 1 data node which could be interpreted as multiple
short-case-stmts.

I don't understand why choice-stmt cannot be used:

    choice a {
      choice case-one { ... }   // illegal
      leaf case-two { ... }
    }

    choice b {
      case one {
        choice case-one { ... }  // legal
      }
      leaf case-two { ... }
    }

This seems like a YANG CLR to me. (Among many)
I know both nested choices could be pulled up into the top choice, but for user UI reasons,
I could see how nested choices could end up in the data model instead.

Andy