Merge "Add IfNewHostNotify to DeviceManager"
[controller.git] / opendaylight / sal / yang-prototype / code-generator / yang-model-parser-impl / src / main / java / org / opendaylight / controller / yang / parser / impl / YangParserListenerImpl.java
index 8b739098a067f3fbd0144963b0cce0600e091045..1c01cd4a82b56cdbc016ed0e3f0c23eec5b833d8 100644 (file)
@@ -342,7 +342,6 @@ public final class YangParserListenerImpl extends YangParserBaseListener {
                 if ("union".equals(typeName)) {
                     List<String> typePath = new ArrayList<String>(actualPath);
                     typePath.add(typeName);
-
                     SchemaPath p = createActualSchemaPath(typePath, namespace,
                             revision, yangModelPrefix);
                     UnionTypeBuilder unionBuilder = moduleBuilder.addUnionType(
@@ -356,16 +355,16 @@ public final class YangParserListenerImpl extends YangParserBaseListener {
                             getIdentityrefBase(typeBody), actualPath, path,
                             line);
                 } else {
-                    List<String> typePath = new ArrayList<String>(actualPath);
-                    typePath.add(typeName);
-
-                    type = parseTypeBody(typeName, typeBody, typePath,
-                            namespace, revision, yangModelPrefix);
+                    type = parseTypeBody(typeName, typeBody, actualPath,
+                            namespace, revision, yangModelPrefix,
+                            moduleBuilder.getActualNode());
                     moduleBuilder.setType(type, actualPath);
                 }
             }
         } else {
-            type = parseUnknownTypeBody(typeQName, typeBody);
+            type = parseUnknownTypeBody(typeQName, typeBody, actualPath,
+                    namespace, revision, yangModelPrefix,
+                    moduleBuilder.getActualNode(), moduleBuilder);
             // mark parent node of this type statement as dirty
             moduleBuilder.addDirtyNode(actualPath);
             moduleBuilder.setType(type, actualPath);
@@ -411,15 +410,15 @@ public final class YangParserListenerImpl extends YangParserBaseListener {
         GroupingBuilder builder = moduleBuilder.addGrouping(groupQName,
                 actualPath, ctx.getStart().getLine());
         moduleBuilder.enterNode(builder);
-        updatePath("grouping");
         updatePath(groupName);
+        builder.setPath(createActualSchemaPath(actualPath, namespace, revision,
+                yangModelPrefix));
         parseSchemaNodeArgs(ctx, builder);
     }
 
     @Override
     public void exitGrouping_stmt(YangParser.Grouping_stmtContext ctx) {
         String actContainer = actualPath.pop();
-        actContainer += "-" + actualPath.pop();
         logger.debug("exiting " + actContainer);
         moduleBuilder.exitNode();
     }
@@ -496,8 +495,11 @@ public final class YangParserListenerImpl extends YangParserBaseListener {
         final String groupingPathStr = stringFromNode(ctx);
         UsesNodeBuilder builder = moduleBuilder.addUsesNode(groupingPathStr,
                 actualPath, ctx.getStart().getLine());
+
         moduleBuilder.enterNode(builder);
         updatePath(groupingPathStr);
+        builder.setPath(createActualSchemaPath(actualPath, namespace, revision,
+                yangModelPrefix));
     }
 
     @Override