Bug 6887: [Yang 1.1] Allow enumerations and bits to be subtyped 53/51453/8
authorIgor Foltin <ifoltin@cisco.com>
Mon, 6 Feb 2017 07:40:48 +0000 (08:40 +0100)
committerRobert Varga <nite@hq.sk>
Thu, 23 Feb 2017 09:47:10 +0000 (09:47 +0000)
commit3f4f405fe9d0d7008e1e5092038170fc3958e963
tree77bddf12949ea1ee8a695897857d00233f49265a
parent92747c44b1141ea6bef5f0f96fd3fe90fa85aa59
Bug 6887: [Yang 1.1] Allow enumerations and bits to be subtyped

Starting with YANG 1.1, enumeration and bits types
can be restricted

An enumeration type can be restricted with one or more
"enum" statements, which enumerate a subset of the values
for the base type.

A bits type can be restricted with one or more "bit"
statements, which enumerate a subset of the values for
the base type.

Change-Id: If46991b858a2a9153a60de85645f6ec301fcb33f
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
24 files changed:
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/type/BitsTypeBuilder.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/type/EnumerationTypeBuilder.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/type/RestrictedBitsType.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/type/RestrictedEnumerationType.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/type/RestrictedTypes.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/type/BitsTypeEffectiveStatementImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/type/EnumTypeEffectiveStatementImpl.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/parser/stmt/rfc7950/Bug6887Test.java [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/rfc7950/bug6887/bar-invalid-2.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/rfc7950/bug6887/bar-invalid-3.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/rfc7950/bug6887/bar-invalid-4.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/rfc7950/bug6887/bar-invalid.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/rfc7950/bug6887/bar.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/rfc7950/bug6887/bar10-invalid-2.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/rfc7950/bug6887/bar10-invalid.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/rfc7950/bug6887/bar10-valid.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/rfc7950/bug6887/foo-invalid-2.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/rfc7950/bug6887/foo-invalid-3.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/rfc7950/bug6887/foo-invalid-4.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/rfc7950/bug6887/foo-invalid.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/rfc7950/bug6887/foo.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/rfc7950/bug6887/foo10-invalid-2.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/rfc7950/bug6887/foo10-invalid.yang [new file with mode: 0644]
yang/yang-parser-impl/src/test/resources/rfc7950/bug6887/foo10-valid.yang [new file with mode: 0644]