Bug 6869: [Yang 1.1] Allow if-feature in bit, enum, refine & identity
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / YangInferencePipeline.java
index cf844977fa6267defd94e1a824511d72dfe6fc49..4b746b2376912a498637b5410180929f6d488fb1 100644 (file)
@@ -63,10 +63,13 @@ import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementR
 import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.ActionStatementImpl;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.AnydataStatementImpl;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.AugmentStatementRfc7950Support;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.BitStatementRfc7950Support;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.CaseStatementRfc7950Support;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.ChoiceStatementRfc7950Support;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.ContainerStatementRfc7950Support;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.EnumStatementRfc7950Support;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.GroupingStatementRfc7950Support;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.IdentityStatementRfc7950Support;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.ImportStatementRfc7950Support;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.IncludeStatementRfc7950Support;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.InputStatementRfc7950Support;
@@ -74,6 +77,7 @@ import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.ListStatementRfc7950S
 import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.ModuleStatementRfc7950Support;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.NotificationStatementRfc7950Support;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.OutputStatementRfc7950Support;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.RefineStatementRfc7950Support;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.SubmoduleStatementRfc7950Support;
 
 public final class YangInferencePipeline {
@@ -147,16 +151,19 @@ public final class YangInferencePipeline {
             .addSupport(global(ExtensionNamespace.class))
             .addSupport(new TypedefStatementImpl.Definition())
             .addSupport(treeScoped(TypeNamespace.class))
-            .addSupport(new IdentityStatementImpl.Definition())
+            .addVersionSpecificSupport(VERSION_1, new IdentityStatementImpl.Definition())
+            .addVersionSpecificSupport(VERSION_1_1, new IdentityStatementRfc7950Support())
             .addSupport(global(IdentityNamespace.class))
             .addSupport(new DefaultStatementImpl.Definition())
             .addSupport(new StatusStatementImpl.Definition())
             .addSupport(new TypeStatementImpl.Definition())
             .addSupport(new UnitsStatementImpl.Definition())
             .addSupport(new RequireInstanceStatementImpl.Definition())
-            .addSupport(new BitStatementImpl.Definition())
+            .addVersionSpecificSupport(VERSION_1, new BitStatementImpl.Definition())
+            .addVersionSpecificSupport(VERSION_1_1, new BitStatementRfc7950Support())
             .addSupport(new PathStatementImpl.Definition())
-            .addSupport(new EnumStatementImpl.Definition())
+            .addVersionSpecificSupport(VERSION_1, new EnumStatementImpl.Definition())
+            .addVersionSpecificSupport(VERSION_1_1, new EnumStatementRfc7950Support())
             .addSupport(new LengthStatementImpl.Definition())
             .addSupport(new PatternStatementImpl.Definition())
             .addSupport(new RangeStatementImpl.Definition())
@@ -210,7 +217,8 @@ public final class YangInferencePipeline {
             .addVersionSpecificSupport(VERSION_1, new AugmentStatementImpl.Definition())
             .addVersionSpecificSupport(VERSION_1_1, new AugmentStatementRfc7950Support())
             .addSupport(treeScoped(AugmentToChoiceNamespace.class))
-            .addSupport(new RefineStatementImpl.Definition())
+            .addVersionSpecificSupport(VERSION_1, new RefineStatementImpl.Definition())
+            .addVersionSpecificSupport(VERSION_1_1, new RefineStatementRfc7950Support())
             .addSupport(new FeatureStatementImpl.Definition())
             .addSupport(new PositionStatementImpl.Definition())
             .addSupport(new ValueStatementImpl.Definition())