[ONOS-4352]Defect fix for unsupported types.

Change-Id: I5c1425518422492de8e108c54ea82f0c85812157
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerUtil.java b/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerUtil.java
index de11f05..7f4e86b 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerUtil.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerUtil.java
@@ -34,12 +34,16 @@
 import static org.onosproject.yangutils.utils.UtilConstants.SLASH;
 import static org.onosproject.yangutils.utils.UtilConstants.COLON;
 import static org.onosproject.yangutils.utils.UtilConstants.CARET;
+import static org.onosproject.yangutils.utils.UtilConstants.CURRENTLY_UNSUPPORTED;
 import static org.onosproject.yangutils.utils.UtilConstants.QUOTES;
 import static org.onosproject.yangutils.utils.UtilConstants.HYPHEN;
 import static org.onosproject.yangutils.utils.UtilConstants.EMPTY_STRING;
 import static org.onosproject.yangutils.utils.UtilConstants.TRUE;
 import static org.onosproject.yangutils.utils.UtilConstants.FALSE;
 import static org.onosproject.yangutils.utils.UtilConstants.YANG_FILE_ERROR;
+import static org.onosproject.yangutils.utils.UtilConstants.IDENTITYREF;
+import static org.onosproject.yangutils.utils.UtilConstants.LEAFREF;
+import static org.onosproject.yangutils.utils.UtilConstants.INSTANCE_IDENTIFIER;
 
 /**
  * Represents an utility for listener.
@@ -263,6 +267,7 @@
         String[] tmpData = tmpIdentifierString.split(Pattern.quote(COLON));
         if (tmpData.length == 1) {
             YangNodeIdentifier nodeIdentifier = new YangNodeIdentifier();
+            checkForUnsupportedTypes(tmpData[0], yangConstruct, ctx);
             nodeIdentifier.setName(getValidIdentifier(tmpData[0], yangConstruct, ctx));
             return nodeIdentifier;
         } else if (tmpData.length == 2) {
@@ -281,6 +286,30 @@
     }
 
     /**
+     * Checks whether the type is an unsupported type.
+     *
+     * @param typeName name of the type
+     * @param yangConstruct yang construct to check if it is type
+     * @param ctx yang construct's context to get the line number and character position
+     */
+    private static void checkForUnsupportedTypes(String typeName,
+            YangConstructType yangConstruct, ParserRuleContext ctx) {
+
+        if (yangConstruct == YangConstructType.TYPE_DATA) {
+            if (typeName.equalsIgnoreCase(LEAFREF)) {
+                handleUnsupportedYangConstruct(YangConstructType.LEAFREF_DATA,
+                        ctx, CURRENTLY_UNSUPPORTED);
+            } else if (typeName.equalsIgnoreCase(IDENTITYREF)) {
+                handleUnsupportedYangConstruct(YangConstructType.IDENTITYREF_DATA,
+                        ctx, CURRENTLY_UNSUPPORTED);
+            } else if (typeName.equalsIgnoreCase(INSTANCE_IDENTIFIER)) {
+                handleUnsupportedYangConstruct(YangConstructType.INSTANCE_IDENTIFIER_DATA,
+                        ctx, CURRENTLY_UNSUPPORTED);
+            }
+        }
+    }
+
+    /**
      * Checks and return valid absolute schema node id.
      *
      * @param argumentString string from yang file
diff --git a/src/main/java/org/onosproject/yangutils/utils/UtilConstants.java b/src/main/java/org/onosproject/yangutils/utils/UtilConstants.java
index 24744fa..39e5148 100644
--- a/src/main/java/org/onosproject/yangutils/utils/UtilConstants.java
+++ b/src/main/java/org/onosproject/yangutils/utils/UtilConstants.java
@@ -272,6 +272,21 @@
     public static final String INPUT = "input";
 
     /**
+     * Static attribute for leafref string.
+     */
+    public static final String LEAFREF = "leafref";
+
+    /**
+     * Static attribute for identityref string.
+     */
+    public static final String IDENTITYREF = "identityref";
+
+    /**
+     * Static attribute for instance identifier string.
+     */
+    public static final String INSTANCE_IDENTIFIER = "instance-identifier";
+
+    /**
      * Static attribute for output variable of rpc.
      */
     public static final String RPC_INPUT_VAR_NAME = "inputVar";
diff --git a/src/main/java/org/onosproject/yangutils/utils/YangConstructType.java b/src/main/java/org/onosproject/yangutils/utils/YangConstructType.java
index 91bc61a..03c4983 100644
--- a/src/main/java/org/onosproject/yangutils/utils/YangConstructType.java
+++ b/src/main/java/org/onosproject/yangutils/utils/YangConstructType.java
@@ -350,6 +350,21 @@
     REFINE_DATA,
 
     /**
+     * Identifies the YANG leafref element parsed data.
+     */
+    LEAFREF_DATA,
+
+    /**
+     * Identifies the YANG identityref element parsed data.
+     */
+    IDENTITYREF_DATA,
+
+    /**
+     * Identifies the YANG instance identifier element parsed data.
+     */
+    INSTANCE_IDENTIFIER_DATA,
+
+    /**
      * Identifies the YANG deviation element parsed data.
      */
     DEVIATION_DATA,
@@ -500,6 +515,12 @@
                 return "unique";
             case REFINE_DATA:
                 return "refine";
+            case LEAFREF_DATA:
+                return "leafref";
+            case IDENTITYREF_DATA:
+                return "identityref";
+            case INSTANCE_IDENTIFIER_DATA:
+                return "instance-identifier";
             case DEVIATION_DATA:
                 return "deviation";
             case ANYXML_DATA: