diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/ResolvableType.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/ResolvableType.java
index 367c811..f062837 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/ResolvableType.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/ResolvableType.java
@@ -59,5 +59,10 @@
     /**
      * Identifies the compiler annotations.
      */
-    YANG_COMPILER_ANNOTATION
+    YANG_COMPILER_ANNOTATION,
+
+    /**
+     * Identifies the deviation.
+     */
+    YANG_DEVIATION
 }
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangAugment.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangAugment.java
index 4ea139d..e7e36c2 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangAugment.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangAugment.java
@@ -85,8 +85,8 @@
 public abstract class YangAugment
         extends YangNode
         implements YangLeavesHolder, YangCommonInfo, Parsable,
-                   CollisionDetector, Resolvable,
-                   YangXPathResolver, YangWhenHolder, YangIfFeatureHolder {
+        CollisionDetector, Resolvable, YangXPathResolver, YangWhenHolder,
+        YangIfFeatureHolder {
 
     private static final long serialVersionUID = 806201602L;
 
@@ -343,7 +343,17 @@
      */
     @Override
     public void addLeaf(YangLeaf leaf) {
-        getListOfLeaf().add(leaf);
+        listOfLeaf.add(leaf);
+    }
+
+    /**
+     * Removes a leaf.
+     *
+     * @param leaf the leaf to be removed
+     */
+    @Override
+    public void removeLeaf(YangLeaf leaf) {
+        listOfLeaf.remove(leaf);
     }
 
     /**
@@ -373,7 +383,17 @@
      */
     @Override
     public void addLeafList(YangLeafList leafList) {
-        getListOfLeafList().add(leafList);
+        listOfLeafList.add(leafList);
+    }
+
+    /**
+     * Removes a leaf-list.
+     *
+     * @param leafList the leaf-list to be removed
+     */
+    @Override
+    public void removeLeafList(YangLeafList leafList) {
+        listOfLeafList.remove(leafList);
     }
 
     @Override
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangCase.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangCase.java
index 8c1f491..c2e1a01 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangCase.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangCase.java
@@ -268,6 +268,16 @@
     }
 
     /**
+     * Removes a leaf.
+     *
+     * @param leaf the leaf to be removed
+     */
+    @Override
+    public void removeLeaf(YangLeaf leaf) {
+        listOfLeaf.remove(leaf);
+    }
+
+    /**
      * Returns the list of leaf-list.
      *
      * @return the list of leaf-list
@@ -298,6 +308,16 @@
     }
 
     /**
+     * Removes a leaf-list.
+     *
+     * @param leafList the leaf-list to be removed
+     */
+    @Override
+    public void removeLeafList(YangLeafList leafList) {
+        listOfLeafList.remove(leafList);
+    }
+
+    /**
      * Returns the textual reference.
      *
      * @return the reference
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangChoice.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangChoice.java
index 8e54d48..f2ce166 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangChoice.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangChoice.java
@@ -79,7 +79,8 @@
         extends YangNode
         implements YangCommonInfo, Parsable, CollisionDetector,
         YangAugmentableNode, YangWhenHolder, YangIfFeatureHolder,
-        YangAppErrorHolder, YangIsFilterContentNodes, YangConfig {
+        YangAppErrorHolder, YangIsFilterContentNodes, YangConfig,
+        YangDefault, YangMandatory {
 
     private static final long serialVersionUID = 806201604L;
 
@@ -168,6 +169,11 @@
     private YangAppErrorInfo yangAppErrorInfo;
 
     /**
+     * If mandatory leaf.
+     */
+    private boolean isMandatory;
+
+    /**
      * Create a choice node.
      */
     public YangChoice() {
@@ -341,6 +347,7 @@
      *
      * @return the default value
      */
+    @Override
     public String getDefaultValueInString() {
         return defaultValueInString;
     }
@@ -350,6 +357,7 @@
      *
      * @param defaultValueInString the default value
      */
+    @Override
     public void setDefaultValueInString(String defaultValueInString) {
         this.defaultValueInString = defaultValueInString;
     }
@@ -490,4 +498,22 @@
     public void cloneAugmentInfo() {
         yangAugmentedInfo = new ArrayList<>();
     }
+
+    /**
+     * Returns true, if the leaf is mandatory; false otherwise.
+     *
+     * @return true if leaf is mandatory; false otherwise
+     */
+    public boolean isMandatory() {
+        return isMandatory;
+    }
+
+    /**
+     * Sets the mandatory flag.
+     *
+     * @param isReq the flag value to set
+     */
+    public void setMandatory(boolean isReq) {
+        isMandatory = isReq;
+    }
 }
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangContainer.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangContainer.java
index 04d99a4..608e27d 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangContainer.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangContainer.java
@@ -269,7 +269,17 @@
      */
     @Override
     public void addLeaf(YangLeaf leaf) {
-        getListOfLeaf().add(leaf);
+        listOfLeaf.add(leaf);
+    }
+
+    /**
+     * Removes a leaf.
+     *
+     * @param leaf the leaf to be removed
+     */
+    @Override
+    public void removeLeaf(YangLeaf leaf) {
+        listOfLeaf.remove(leaf);
     }
 
     /**
@@ -299,9 +309,18 @@
      */
     @Override
     public void addLeafList(YangLeafList leafList) {
-        getListOfLeafList().add(leafList);
+        listOfLeafList.add(leafList);
     }
 
+    /**
+     * Removes a leaf-list.
+     *
+     * @param leafList the leaf-list to be removed
+     */
+    @Override
+    public void removeLeafList(YangLeafList leafList) {
+        listOfLeafList.remove(leafList);
+    }
 
     /**
      * Returns the presence string if present.
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangDefault.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangDefault.java
new file mode 100644
index 0000000..810b706
--- /dev/null
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangDefault.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.compiler.datamodel;
+
+/**
+ * Abstraction of default entity. It is used to abstract the data holders of
+ * default statement.
+ */
+public interface YangDefault {
+
+    /**
+     * Returns the default value.
+     *
+     * @return the default value
+     */
+    String getDefaultValueInString();
+
+    /**
+     * Sets the default value.
+     *
+     * @param defaultValueInString the default value
+     */
+    void setDefaultValueInString(String defaultValueInString);
+}
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangDeviateAdd.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangDeviateAdd.java
new file mode 100644
index 0000000..87603fd
--- /dev/null
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangDeviateAdd.java
@@ -0,0 +1,291 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.compiler.datamodel;
+
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.datamodel.utils.YangConstructType;
+
+import java.io.Serializable;
+import java.util.LinkedList;
+import java.util.List;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DEVIATE_ADD;
+
+/*
+ *  Reference RFC 6020.
+ *
+ *  The "deviate" statement defines how the device's implementation of
+ *  the target node deviates from its original definition.  The argument
+ *  is one of the strings "not-supported", "add", "replace", or "delete".
+ *
+ *  The argument "add" adds properties to the target node.  The
+ *  properties to add are identified by substatements to the "deviate"
+ *  statement.  If a property can only appear once, the property MUST NOT
+ *  exist in the target node.
+ *
+ *  The deviate's sub-statements
+ *
+ *        +--------------+---------+-------------+------------------+
+ *        | substatement | section | cardinality |data model mapping|
+ *        +--------------+---------+-------------+------------------+
+ *        | config       | 7.19.1  | 0..1        | YangConfig       |
+ *        | default      | 7.6.4   | 0..1        | String           |
+ *        | mandatory    | 7.6.5   | 0..1        | boolean          |
+ *        | max-elements | 7.7.4   | 0..1        | YangMaxElement   |
+ *        | min-elements | 7.7.3   | 0..1        | YangMinElement   |
+ *        | must         | 7.5.3   | 0..n        | YangMust         |
+ *        | type         | 7.4     | 0..1        | YangType         |
+ *        | unique       | 7.8.3   | 0..n        | String           |
+ *        | units        | 7.3.3   | 0..1        | String           |
+ *        +--------------+---------+-------------+------------------+
+ */
+
+/**
+ * Represents deviate add data represented in YANG.
+ */
+public class YangDeviateAdd implements YangConfig, Parsable,
+        YangMustHolder, YangUniqueHolder, YangMaxElementHolder,
+        YangMinElementHolder, YangUnits, YangMandatory, YangDefault,
+        Serializable {
+
+    private static final long serialVersionUID = 806201609L;
+
+    /**
+     * Textual units info.
+     */
+    private String units;
+
+    /**
+     * List of must statement constraints.
+     */
+    private List<YangMust> mustConstraintList;
+
+    /**
+     * List of unique leaf names.
+     */
+    private List<String> uniqueList;
+
+    /**
+     * Default value in string, needs to be converted to the target object,
+     * based on the type.
+     */
+    private String defaultValueInString;
+
+    /**
+     * Deviate's config data.
+     */
+    private boolean isConfig;
+
+    /**
+     * Mandatory constraint.
+     */
+    private boolean isMandatory;
+
+    /**
+     * Deviate's max element data.
+     */
+    private YangMaxElement maxElements;
+
+    /**
+     * Deviate's min element data.
+     */
+    private YangMinElement minElements;
+
+    /**
+     * Creates a YANG deviate add object.
+     */
+    public YangDeviateAdd() {
+        mustConstraintList = new LinkedList<>();
+        uniqueList = new LinkedList<>();
+    }
+
+    @Override
+    public boolean isConfig() {
+        return isConfig;
+    }
+
+    @Override
+    public void setConfig(boolean isConfig) {
+        this.isConfig = isConfig;
+    }
+
+    @Override
+    public YangConstructType getYangConstructType() {
+        return DEVIATE_ADD;
+    }
+
+    @Override
+    public void validateDataOnEntry() throws DataModelException {
+        // do nothing
+    }
+
+    @Override
+    public void validateDataOnExit() throws DataModelException {
+        // do nothing
+    }
+
+    @Override
+    public List<YangMust> getListOfMust() {
+        return mustConstraintList;
+    }
+
+    @Override
+    public void setListOfMust(List<YangMust> mustConstraintList) {
+        this.mustConstraintList = mustConstraintList;
+    }
+
+    @Override
+    public void addMust(YangMust must) {
+        mustConstraintList.add(must);
+    }
+
+    /**
+     * Returns the max elements.
+     *
+     * @return the max elements
+     */
+    @Override
+    public YangMaxElement getMaxElements() {
+        return maxElements;
+    }
+
+    /**
+     * Sets the max elements.
+     *
+     * @param max the max elements
+     */
+    @Override
+    public void setMaxElements(YangMaxElement max) {
+        this.maxElements = max;
+    }
+
+    /**
+     * Returns the minimum elements.
+     *
+     * @return the minimum elements
+     */
+    @Override
+    public YangMinElement getMinElements() {
+        return minElements;
+    }
+
+    /**
+     * Sets the minimum elements.
+     *
+     * @param minElements the minimum elements
+     */
+    @Override
+    public void setMinElements(YangMinElement minElements) {
+        this.minElements = minElements;
+    }
+
+    /**
+     * Returns the units.
+     *
+     * @return the units
+     */
+    @Override
+    public String getUnits() {
+        return units;
+    }
+
+    /**
+     * Sets the units.
+     *
+     * @param units the units to set
+     */
+    @Override
+    public void setUnits(String units) {
+        this.units = units;
+    }
+
+    /**
+     * Returns if the leaf is mandatory.
+     *
+     * @return if leaf is mandatory
+     */
+    @Override
+    public boolean isMandatory() {
+        return isMandatory;
+    }
+
+    /**
+     * Sets if the leaf is mandatory.
+     *
+     * @param isReq if the leaf is mandatory
+     */
+    @Override
+    public void setMandatory(boolean isReq) {
+        isMandatory = isReq;
+    }
+
+    /**
+     * Returns the default value.
+     *
+     * @return the default value
+     */
+    @Override
+    public String getDefaultValueInString() {
+        return defaultValueInString;
+    }
+
+    /**
+     * Sets the default value.
+     *
+     * @param defaultValueInString the default value
+     */
+    @Override
+    public void setDefaultValueInString(String defaultValueInString) {
+        this.defaultValueInString = defaultValueInString;
+    }
+
+    /**
+     * Returns the list of unique field names.
+     *
+     * @return the list of unique field names
+     */
+    @Override
+    public List<String> getUniqueList() {
+        return uniqueList;
+    }
+
+    /**
+     * Sets the list of unique field names.
+     *
+     * @param uniqueList the list of unique field names
+     */
+    @Override
+    public void setUniqueList(List<String> uniqueList) {
+        this.uniqueList = uniqueList;
+    }
+
+    /**
+     * Adds a unique field name.
+     *
+     * @param unique unique field name
+     * @throws DataModelException a violation of data model rules
+     */
+    @Override
+    public void addUnique(String unique) throws DataModelException {
+        if (uniqueList.contains(unique)) {
+            throw new DataModelException("A leaf identifier must not appear more than once in the\n" +
+                                                 " unique");
+        }
+        uniqueList.add(unique);
+    }
+}
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangDeviateDelete.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangDeviateDelete.java
new file mode 100644
index 0000000..d93cd93
--- /dev/null
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangDeviateDelete.java
@@ -0,0 +1,201 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.compiler.datamodel;
+
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.datamodel.utils.YangConstructType;
+
+import java.io.Serializable;
+import java.util.LinkedList;
+import java.util.List;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DEVIATE_DELETE;
+
+/*
+ *  Reference 6020.
+ *
+ *  The "deviate" statement defines how the device's implementation of
+ *  the target node deviates from its original definition.  The argument
+ *  is one of the strings "not-supported", "add", "replace", or "delete".
+ *
+ *  The argument "delete" deletes properties from the target node.  The
+ *  properties to delete are identified by substatements to the "delete"
+ *  statement.  The substatement's keyword MUST match a corresponding
+ *  keyword in the target node, and the argument's string MUST be equal
+ *  to the corresponding keyword's argument string in the target node.
+ *
+ *  The deviate's sub-statements
+ *
+ *        +--------------+---------+-------------+------------------+
+ *        | substatement | section | cardinality |data model mapping|
+ *        +--------------+---------+-------------+------------------+
+ *        | config       | 7.19.1  | 0..1        | YangConfig       |
+ *        | default      | 7.6.4   | 0..1        | String           |
+ *        | mandatory    | 7.6.5   | 0..1        | boolean          |
+ *        | max-elements | 7.7.4   | 0..1        | YangMaxElement   |
+ *        | min-elements | 7.7.3   | 0..1        | YangMinElement   |
+ *        | must         | 7.5.3   | 0..n        | YangMust         |
+ *        | type         | 7.4     | 0..1        | YangType         |
+ *        | unique       | 7.8.3   | 0..n        | String           |
+ *        | units        | 7.3.3   | 0..1        | String           |
+ *        +--------------+---------+-------------+------------------+
+ */
+
+/**
+ * Represents deviate delete data represented in YANG.
+ */
+public class YangDeviateDelete implements Parsable, YangMustHolder,
+        YangUniqueHolder, YangDefault, YangUnits, Serializable {
+
+    private static final long serialVersionUID = 806201609L;
+
+    /**
+     * Textual units info.
+     */
+    private String units;
+
+    /**
+     * List of must statement constraints.
+     */
+    private List<YangMust> mustConstraintList;
+
+    /**
+     * List of unique leaf names.
+     */
+    private List<String> uniqueList;
+
+    /**
+     * Default value in string, needs to be converted to the target object,
+     * based on the type.
+     */
+    private String defaultValueInString;
+
+    /**
+     * Creates a YANG deviate delete object.
+     */
+    public YangDeviateDelete() {
+        mustConstraintList = new LinkedList<>();
+        uniqueList = new LinkedList<>();
+    }
+
+    @Override
+    public YangConstructType getYangConstructType() {
+        return DEVIATE_DELETE;
+    }
+
+    @Override
+    public void validateDataOnEntry() throws DataModelException {
+        // do nothing
+    }
+
+    @Override
+    public void validateDataOnExit() throws DataModelException {
+        // do nothing
+    }
+
+    @Override
+    public List<YangMust> getListOfMust() {
+        return mustConstraintList;
+    }
+
+    @Override
+    public void setListOfMust(List<YangMust> mustConstraintList) {
+        this.mustConstraintList = mustConstraintList;
+    }
+
+    @Override
+    public void addMust(YangMust must) {
+        mustConstraintList.add(must);
+    }
+
+    /**
+     * Returns the units.
+     *
+     * @return the units
+     */
+    @Override
+    public String getUnits() {
+        return units;
+    }
+
+    /**
+     * Sets the units.
+     *
+     * @param units the units to set
+     */
+    @Override
+    public void setUnits(String units) {
+        this.units = units;
+    }
+
+    /**
+     * Returns the list of unique field names.
+     *
+     * @return the list of unique field names
+     */
+    @Override
+    public List<String> getUniqueList() {
+        return uniqueList;
+    }
+
+    /**
+     * Sets the list of unique field names.
+     *
+     * @param uniqueList the list of unique field names
+     */
+    @Override
+    public void setUniqueList(List<String> uniqueList) {
+        this.uniqueList = uniqueList;
+    }
+
+    /**
+     * Adds a unique field name.
+     *
+     * @param unique unique field name
+     * @throws DataModelException a violation of data model rules
+     */
+    @Override
+    public void addUnique(String unique)
+            throws DataModelException {
+        if (uniqueList.contains(unique)) {
+            throw new DataModelException("A leaf identifier must not appear more than once in the\n" +
+                                                 " unique");
+        }
+        uniqueList.add(unique);
+    }
+
+    /**
+     * Returns the default value.
+     *
+     * @return the default value
+     */
+    @Override
+    public String getDefaultValueInString() {
+        return defaultValueInString;
+    }
+
+    /**
+     * Sets the default value.
+     *
+     * @param defaultValueInString the default value
+     */
+    @Override
+    public void setDefaultValueInString(String defaultValueInString) {
+        this.defaultValueInString = defaultValueInString;
+    }
+}
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangDeviateReplace.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangDeviateReplace.java
new file mode 100644
index 0000000..b42d685
--- /dev/null
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangDeviateReplace.java
@@ -0,0 +1,244 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.compiler.datamodel;
+
+/*
+ *  Refernce 6020.
+ *
+ *  The "deviate" statement defines how the device's implementation of
+ *  the target node deviates from its original definition.  The argument
+ *  is one of the strings "not-supported", "add", "replace", or "delete".
+ *
+ *  The argument "replace" replaces properties of the target node.  The
+ *  properties to replace are identified by substatements to the
+ *  "deviate" statement.  The properties to replace MUST exist in the
+ *  target node.
+ *
+ *  The deviate's sub-statements
+ *
+ *        +--------------+---------+-------------+------------------+
+ *        | substatement | section | cardinality |data model mapping|
+ *        +--------------+---------+-------------+------------------+
+ *        | config       | 7.19.1  | 0..1        | YangConfig       |
+ *        | default      | 7.6.4   | 0..1        | String           |
+ *        | mandatory    | 7.6.5   | 0..1        | boolean          |
+ *        | max-elements | 7.7.4   | 0..1        | YangMaxElement   |
+ *        | min-elements | 7.7.3   | 0..1        | YangMinElement   |
+ *        | must         | 7.5.3   | 0..n        | YangMust         |
+ *        | type         | 7.4     | 0..1        | YangType         |
+ *        | unique       | 7.8.3   | 0..n        | String           |
+ *        | units        | 7.3.3   | 0..1        | String           |
+ *        +--------------+---------+-------------+------------------+
+ */
+
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.datamodel.utils.YangConstructType;
+
+import java.io.Serializable;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DEVIATE_REPLACE;
+
+/**
+ * Represents deviate replace data represented in YANG.
+ */
+public class YangDeviateReplace implements YangUnits, YangMinElementHolder,
+        YangMaxElementHolder, YangMandatory, YangDefault, Parsable,
+        YangConfig, Serializable {
+
+    private static final long serialVersionUID = 806201609L;
+
+    /**
+     * Textual units info.
+     */
+    private String units;
+
+    /**
+     * Deviate's config data.
+     */
+    private boolean isConfig;
+
+    /**
+     * Deviate's max element data.
+     */
+    private YangMaxElement maxElements;
+
+    /**
+     * Deviate's min element data.
+     */
+    private YangMinElement minElements;
+
+    /**
+     * Mandatory constraint.
+     */
+    private boolean isMandatory;
+
+    /**
+     * Default value in string, needs to be converted to the target object,
+     * based on the type.
+     */
+    private String defaultValueInString;
+
+    /**
+     * Data type of the leaf.
+     */
+    private YangType<?> dataType;
+
+
+    @Override
+    public boolean isConfig() {
+        return isConfig;
+    }
+
+    @Override
+    public void setConfig(boolean isConfig) {
+        this.isConfig = isConfig;
+    }
+
+    @Override
+    public YangConstructType getYangConstructType() {
+        return DEVIATE_REPLACE;
+    }
+
+    @Override
+    public void validateDataOnEntry() throws DataModelException {
+        // do nothing
+    }
+
+    @Override
+    public void validateDataOnExit() throws DataModelException {
+        // do nothing
+    }
+
+    /**
+     * Returns the max elements.
+     *
+     * @return the max elements
+     */
+    @Override
+    public YangMaxElement getMaxElements() {
+        return maxElements;
+    }
+
+    /**
+     * Sets the max elements.
+     *
+     * @param max the max elements
+     */
+    @Override
+    public void setMaxElements(YangMaxElement max) {
+        this.maxElements = max;
+    }
+
+    /**
+     * Returns the minimum elements.
+     *
+     * @return the minimum elements
+     */
+    @Override
+    public YangMinElement getMinElements() {
+        return minElements;
+    }
+
+    /**
+     * Sets the minimum elements.
+     *
+     * @param minElements the minimum elements
+     */
+    @Override
+    public void setMinElements(YangMinElement minElements) {
+        this.minElements = minElements;
+    }
+
+    /**
+     * Returns the units.
+     *
+     * @return the units
+     */
+    @Override
+    public String getUnits() {
+        return units;
+    }
+
+    /**
+     * Sets the units.
+     *
+     * @param units the units to set
+     */
+    @Override
+    public void setUnits(String units) {
+        this.units = units;
+    }
+
+    /**
+     * Returns if the leaf is mandatory.
+     *
+     * @return if leaf is mandatory
+     */
+    @Override
+    public boolean isMandatory() {
+        return isMandatory;
+    }
+
+    /**
+     * Sets if the leaf is mandatory.
+     *
+     * @param isReq if the leaf is mandatory
+     */
+    @Override
+    public void setMandatory(boolean isReq) {
+        isMandatory = isReq;
+    }
+
+    /**
+     * Returns the default value.
+     *
+     * @return the default value
+     */
+    @Override
+    public String getDefaultValueInString() {
+        return defaultValueInString;
+    }
+
+    /**
+     * Sets the default value.
+     *
+     * @param defaultValueInString the default value
+     */
+    @Override
+    public void setDefaultValueInString(String defaultValueInString) {
+        this.defaultValueInString = defaultValueInString;
+    }
+
+    /**
+     * Returns the data type.
+     *
+     * @return the data type
+     */
+    public YangType<?> getDataType() {
+        return dataType;
+    }
+
+    /**
+     * Sets the data type.
+     *
+     * @param dataType the data type to set
+     */
+    public void setDataType(YangType<?> dataType) {
+        this.dataType = dataType;
+    }
+}
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangDeviation.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangDeviation.java
new file mode 100644
index 0000000..57f9a53
--- /dev/null
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangDeviation.java
@@ -0,0 +1,346 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.compiler.datamodel;
+
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.datamodel.utils.ResolvableStatus;
+import org.onosproject.yang.compiler.datamodel.utils.YangConstructType;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import static org.onosproject.yang.compiler.datamodel.YangSchemaNodeType.YANG_NON_DATA_NODE;
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.detectCollidingChildUtil;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DEVIATION_DATA;
+
+/**
+ * Represents deviation data represented in YANG.
+ */
+public class YangDeviation extends YangNode implements Parsable, YangDesc,
+        YangReference, YangXPathResolver, Resolvable, CollisionDetector {
+
+    private static final long serialVersionUID = 806201605L;
+
+    /**
+     * List of node identifiers.
+     */
+    private List<YangAtomicPath> targetNode;
+
+    /**
+     * Description of augment.
+     */
+    private String description;
+
+    /**
+     * Reference of the YANG augment.
+     */
+    private String reference;
+
+    /**
+     * Represents deviate-not-supported statement.
+     */
+    private boolean isDeviateNotSupported;
+
+    /**
+     * Represents deviate add statement.
+     */
+    private List<YangDeviateAdd> deviateAddList;
+
+    /**
+     * Represents deviate delete statement.
+     */
+    private List<YangDeviateDelete> deviateDeleteList;
+
+    /**
+     * Represents deviate replace statement.
+     */
+    private List<YangDeviateReplace> deviateReplaceList;
+
+    /**
+     * Status of resolution.
+     */
+    private ResolvableStatus resolvableStatus;
+
+    /**
+     * Creates a specific type of node.
+     *
+     * @param type              of YANG node
+     * @param ysnContextInfoMap YSN context info map
+     */
+    public YangDeviation(YangNodeType type, Map<YangSchemaNodeIdentifier,
+            YangSchemaNodeContextInfo> ysnContextInfoMap) {
+        super(type, ysnContextInfoMap);
+        targetNode = new LinkedList<>();
+        resolvableStatus = ResolvableStatus.UNRESOLVED;
+        deviateAddList = new LinkedList<>();
+        deviateDeleteList = new LinkedList<>();
+        deviateReplaceList = new LinkedList<>();
+    }
+
+    @Override
+    public YangSchemaNodeType getYangSchemaNodeType() {
+        return YANG_NON_DATA_NODE;
+    }
+
+    @Override
+    public String getJavaPackage() {
+        // do nothing
+        return null;
+    }
+
+    @Override
+    public String getJavaClassNameOrBuiltInType() {
+        // do nothing
+        return null;
+    }
+
+    @Override
+    public String getJavaAttributeName() {
+        // do nothing
+        return null;
+    }
+
+    @Override
+    public void addToChildSchemaMap(YangSchemaNodeIdentifier schemaNodeIdentifier,
+                                    YangSchemaNodeContextInfo yangSchemaNodeContextInfo)
+            throws DataModelException {
+        // do nothing
+    }
+
+    @Override
+    public void incrementMandatoryChildCount() {
+        // do nothing
+    }
+
+    @Override
+    public void addToDefaultChildMap(YangSchemaNodeIdentifier yangSchemaNodeIdentifier,
+                                     YangSchemaNode yangSchemaNode) {
+        // do nothing
+    }
+
+    /**
+     * Returns the augmented node.
+     *
+     * @return the augmented node
+     */
+    public List<YangAtomicPath> getTargetNode() {
+        return targetNode;
+    }
+
+    /**
+     * Sets the augmented node.
+     *
+     * @param nodeIdentifiers the augmented node
+     */
+    public void setTargetNode(List<YangAtomicPath> nodeIdentifiers) {
+        targetNode = nodeIdentifiers;
+    }
+
+    /**
+     * Returns the textual reference.
+     *
+     * @return the reference
+     */
+    @Override
+    public String getReference() {
+        return reference;
+    }
+
+    /**
+     * Sets the textual reference.
+     *
+     * @param reference the reference to set
+     */
+    @Override
+    public void setReference(String reference) {
+        this.reference = reference;
+    }
+
+    /**
+     * Returns the description.
+     *
+     * @return the description
+     */
+    @Override
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * Set the description.
+     *
+     * @param description set the description
+     */
+    @Override
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    @Override
+    public YangConstructType getYangConstructType() {
+        return DEVIATION_DATA;
+    }
+
+    @Override
+    public void validateDataOnEntry() throws DataModelException {
+        // do nothing
+    }
+
+    @Override
+    public void validateDataOnExit() throws DataModelException {
+        // do nothing
+    }
+
+    @Override
+    public ResolvableStatus getResolvableStatus() {
+        return resolvableStatus;
+    }
+
+    @Override
+    public void setResolvableStatus(ResolvableStatus resolvableStatus) {
+        this.resolvableStatus = resolvableStatus;
+    }
+
+    @Override
+    public Object resolve() throws DataModelException {
+        // Resolving of target node is being done in XPathLinker.
+        return null;
+    }
+
+    /**
+     * Returns the isDeviateNotSupported flag.
+     *
+     * @return if isDeviateNotSupported flag
+     */
+    public boolean isDeviateNotSupported() {
+        return isDeviateNotSupported;
+    }
+
+    /**
+     * Sets the isDeviateNotSupported flag.
+     *
+     * @param deviateNotSupported the flag value to set
+     */
+    public void setDeviateNotSupported(boolean deviateNotSupported) {
+        isDeviateNotSupported = deviateNotSupported;
+    }
+
+    @Override
+    public void detectCollidingChild(String identifierName,
+                                     YangConstructType dataType)
+            throws DataModelException {
+        detectCollidingChildUtil(identifierName, dataType, this);
+    }
+
+    @Override
+    public void detectSelfCollision(String identifierName,
+                                    YangConstructType dataType)
+            throws DataModelException {
+        if (getName().equals(identifierName)) {
+            throw new DataModelException(
+                    "YANG file error: Duplicate input identifier detected, " +
+                            "same as input \"" +
+                            getName() + " in " +
+                            getLineNumber() + " at " +
+                            getCharPosition() +
+                            " in " + getFileName() + "\"");
+        }
+    }
+
+    /**
+     * Returns the list of deviate-add.
+     *
+     * @return the list of deviate-add
+     */
+    public List<YangDeviateAdd> getDeviateAdd() {
+        return deviateAddList;
+    }
+
+    /**
+     * Sets the list of deviate-add.
+     *
+     * @param deviateAdd the list of deviate-add to set
+     */
+    public void setDeviateAdd(List<YangDeviateAdd> deviateAdd) {
+        this.deviateAddList = deviateAdd;
+    }
+
+    /**
+     * Returns the list of deviate delete.
+     *
+     * @return the list of deviate delete
+     */
+    public List<YangDeviateDelete> getDeviateDelete() {
+        return deviateDeleteList;
+    }
+
+    /**
+     * Sets the list of deviate delete.
+     *
+     * @param deviateDelete the list of deviate delete to set
+     */
+    public void setDeviateDelete(List<YangDeviateDelete> deviateDelete) {
+        this.deviateDeleteList = deviateDelete;
+    }
+
+    /**
+     * Returns the list of deviate replace.
+     *
+     * @return the list of deviate replace
+     */
+    public List<YangDeviateReplace> getDeviateReplace() {
+        return deviateReplaceList;
+    }
+
+    /**
+     * Sets the list of deviate replace.
+     *
+     * @param deviateReplace the list of deviate-replace to set
+     */
+    public void setDeviateReplace(List<YangDeviateReplace> deviateReplace) {
+        this.deviateReplaceList = deviateReplace;
+    }
+
+    /**
+     * Adds a deviate-add.
+     *
+     * @param deviate the deviate-add to be added
+     */
+    public void addDeviateAdd(YangDeviateAdd deviate) {
+        deviateAddList.add(deviate);
+    }
+
+    /**
+     * Adds a deviate delete.
+     *
+     * @param deviate the deviate delete to be added
+     */
+    public void addDeviatedelete(YangDeviateDelete deviate) {
+        deviateDeleteList.add(deviate);
+    }
+
+    /**
+     * Adds a deviate replace.
+     *
+     * @param deviate the deviate replace to be added
+     */
+    public void addDeviateReplace(YangDeviateReplace deviate) {
+        deviateReplaceList.add(deviate);
+    }
+}
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangDeviationHolder.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangDeviationHolder.java
new file mode 100644
index 0000000..358a9b7
--- /dev/null
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangDeviationHolder.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.compiler.datamodel;
+
+/**
+ * Abstraction of deviation entity. It is used to abstract the data holders of
+ * deviation statement.
+ */
+public interface YangDeviationHolder {
+
+    /**
+     * Returns true if deviated node already cloned, false
+     * otherwise.
+     *
+     * @return the isDeviateNodeCloned flag
+     */
+    boolean isDeviatedNodeCloned();
+
+    /**
+     * Sets the deviatedNodeCloned flag.
+     *
+     * @param deviatedNodeCloned the flag to set
+     */
+    void setDeviatedNodeCloned(boolean deviatedNodeCloned);
+
+    /**
+     * Returns true if module defined only for deviation,
+     * false otherwise.
+     *
+     * @return the isDeviateNodeCloned flag
+     */
+    boolean isModuleForDeviation();
+
+    /**
+     * Sets the moduleForDeviation flag.
+     *
+     * @param moduleForDeviation the flag to set
+     */
+    void setModuleForDeviation(boolean moduleForDeviation);
+}
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangGrouping.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangGrouping.java
index da87a1d..aa2303b 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangGrouping.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangGrouping.java
@@ -204,6 +204,16 @@
     }
 
     /**
+     * Removes a leaf.
+     *
+     * @param leaf the leaf to be removed
+     */
+    @Override
+    public void removeLeaf(YangLeaf leaf) {
+        listOfLeaf.remove(leaf);
+    }
+
+    /**
      * Returns the list of leaf-list.
      *
      * @return the list of leaf-list
@@ -234,6 +244,16 @@
     }
 
     /**
+     * Removes a leaf-list.
+     *
+     * @param leafList the leaf-list to be removed
+     */
+    @Override
+    public void removeLeafList(YangLeafList leafList) {
+        listOfLeafList.remove(leafList);
+    }
+
+    /**
      * Returns the textual reference.
      *
      * @return the reference
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangIdentityRef.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangIdentityRef.java
index 6c5817f..537f606 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangIdentityRef.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangIdentityRef.java
@@ -293,7 +293,8 @@
     }
 
     @Override
-    public YangNode clone(YangUses yangUses) throws CloneNotSupportedException {
+    public YangNode clone(YangUses yangUses, boolean isDeviation)
+            throws CloneNotSupportedException {
         return (YangNode) super.clone();
     }
 }
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangInput.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangInput.java
index 10d7188..a1019a5 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangInput.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangInput.java
@@ -183,6 +183,16 @@
         listOfLeaf.add(leaf);
     }
 
+    /**
+     * Removes a leaf.
+     *
+     * @param leaf the leaf to be removed
+     */
+    @Override
+    public void removeLeaf(YangLeaf leaf) {
+        listOfLeaf.remove(leaf);
+    }
+
     @Override
     public List<YangLeafList> getListOfLeafList() {
         return unmodifiableList(listOfLeafList);
@@ -198,6 +208,16 @@
         listOfLeafList.add(leafList);
     }
 
+    /**
+     * Removes a leaf-list.
+     *
+     * @param leafList the leaf-list to be removed
+     */
+    @Override
+    public void removeLeafList(YangLeafList leafList) {
+        listOfLeafList.remove(leafList);
+    }
+
     @Override
     public void addAugmentation(YangAugment augmentInfo) {
         yangAugmentedInfo.add(augmentInfo);
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangLeaf.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangLeaf.java
index a1cf665..7d64d7f 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangLeaf.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangLeaf.java
@@ -68,7 +68,7 @@
 public abstract class YangLeaf extends DefaultLocationInfo
         implements YangCommonInfo, Parsable, Cloneable, Serializable,
         YangMustHolder, YangIfFeatureHolder, YangWhenHolder, YangSchemaNode,
-        YangConfig {
+        YangConfig, YangUnits, YangDefault, YangMandatory {
 
     private static final long serialVersionUID = 806201635L;
 
@@ -143,7 +143,8 @@
      */
     private YangLeaf referredLeaf;
 
-    private  boolean isKeyLeaf;
+    private boolean isKeyLeaf;
+
     /**
      * Creates a YANG leaf.
      */
@@ -217,6 +218,7 @@
      *
      * @return if leaf is mandatory
      */
+    @Override
     public boolean isMandatory() {
         return isMandatory;
     }
@@ -226,6 +228,7 @@
      *
      * @param isReq if the leaf is mandatory
      */
+    @Override
     public void setMandatory(boolean isReq) {
         isMandatory = isReq;
     }
@@ -275,6 +278,7 @@
      *
      * @return the units
      */
+    @Override
     public String getUnits() {
         return units;
     }
@@ -284,6 +288,7 @@
      *
      * @param units the units to set
      */
+    @Override
     public void setUnits(String units) {
         this.units = units;
     }
@@ -293,6 +298,7 @@
      *
      * @return the default value
      */
+    @Override
     public String getDefaultValueInString() {
         return defaultValueInString;
     }
@@ -302,6 +308,7 @@
      *
      * @param defaultValueInString the default value
      */
+    @Override
     public void setDefaultValueInString(String defaultValueInString) {
         this.defaultValueInString = defaultValueInString;
     }
@@ -356,6 +363,19 @@
     }
 
     /**
+     * Returns the cloned leaf.
+     *
+     * @return returns cloned leaf
+     * @throws CloneNotSupportedException if the object's class does not
+     *                                    support the interface
+     */
+    public YangLeaf cloneForDeviation()
+            throws CloneNotSupportedException {
+        YangLeaf cl = (YangLeaf) super.clone();
+        return cl;
+    }
+
+    /**
      * Returns the type of the parsed data.
      *
      * @return returns LEAF_DATA
@@ -557,6 +577,7 @@
     public void setReferredLeaf(YangLeaf leaf) {
         referredLeaf = leaf;
     }
+
     /**
      * Returns true if its a key leaf.
      *
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangLeafList.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangLeafList.java
index 2477d1a..93a0683 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangLeafList.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangLeafList.java
@@ -64,7 +64,7 @@
 public abstract class YangLeafList extends DefaultLocationInfo
         implements YangCommonInfo, Parsable, Cloneable, Serializable,
         YangMustHolder, YangWhenHolder, YangIfFeatureHolder, YangSchemaNode,
-        YangConfig {
+        YangConfig, YangUnits, YangMaxElementHolder, YangMinElementHolder {
 
     private static final long serialVersionUID = 806201637L;
 
@@ -235,6 +235,7 @@
      *
      * @return the maximum elements number
      */
+    @Override
     public YangMaxElement getMaxElements() {
         return maxElement;
     }
@@ -244,6 +245,7 @@
      *
      * @param maxElement maximum elements number
      */
+    @Override
     public void setMaxElements(YangMaxElement maxElement) {
         this.maxElement = maxElement;
     }
@@ -253,6 +255,7 @@
      *
      * @return the minimum elements number
      */
+    @Override
     public YangMinElement getMinElements() {
         return minElements;
     }
@@ -262,6 +265,7 @@
      *
      * @param minElements the minimum elements number
      */
+    @Override
     public void setMinElements(YangMinElement minElements) {
         this.minElements = minElements;
     }
@@ -311,6 +315,7 @@
      *
      * @return the units
      */
+    @Override
     public String getUnits() {
         return units;
     }
@@ -320,6 +325,7 @@
      *
      * @param units the units to set
      */
+    @Override
     public void setUnits(String units) {
         this.units = units;
     }
@@ -374,6 +380,19 @@
     }
 
     /**
+     * Returns the cloned leaf-list.
+     *
+     * @return returns cloned leaf-list
+     * @throws CloneNotSupportedException if the object's class does not
+     *                                    support the interface
+     */
+    public YangLeafList cloneForDeviation()
+            throws CloneNotSupportedException {
+        YangLeafList cll = (YangLeafList) super.clone();
+        return cll;
+    }
+
+    /**
      * Returns the type of the parsed data.
      *
      * @return returns LEAF_LIST_DATA
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangLeavesHolder.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangLeavesHolder.java
index ad39253..e7e1fac 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangLeavesHolder.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangLeavesHolder.java
@@ -47,6 +47,13 @@
     void addLeaf(YangLeaf leaf);
 
     /**
+     * Removes leaf in data holder like container / list.
+     *
+     * @param leaf the leaf to be removed
+     */
+    void removeLeaf(YangLeaf leaf);
+
+    /**
      * Returns the list of leaf-list from data holder like container / list.
      *
      * @return the list of leaf-list
@@ -68,6 +75,13 @@
     void addLeafList(YangLeafList leafList);
 
     /**
+     * Removes leaf-list in data holder like container / list.
+     *
+     * @param leafList the leaf-list to be removed
+     */
+    void removeLeafList(YangLeafList leafList);
+
+    /**
      * Adds namespace for leafs and leaf-list, this is used in case of
      * submodule.
      *
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangList.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangList.java
index 343a8f2..ab01879 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangList.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangList.java
@@ -78,7 +78,8 @@
         extends YangNode
         implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector,
         YangAugmentableNode, YangMustHolder, YangWhenHolder, YangIfFeatureHolder, YangSchemaNode,
-        YangIsFilterContentNodes, YangConfig {
+        YangIsFilterContentNodes, YangConfig, YangUniqueHolder,
+        YangMaxElementHolder, YangMinElementHolder {
 
     private static final long serialVersionUID = 806201609L;
 
@@ -330,6 +331,7 @@
      *
      * @return the list of unique field names
      */
+    @Override
     public List<String> getUniqueList() {
         return uniqueList;
     }
@@ -339,7 +341,8 @@
      *
      * @param uniqueList the list of unique field names
      */
-    private void setUniqueList(List<String> uniqueList) {
+    @Override
+    public void setUniqueList(List<String> uniqueList) {
         this.uniqueList = uniqueList;
     }
 
@@ -391,6 +394,7 @@
      * @param unique unique field name.
      * @throws DataModelException a violation of data model rules
      */
+    @Override
     public void addUnique(String unique)
             throws DataModelException {
         if (getUniqueList() == null) {
@@ -434,7 +438,17 @@
      */
     @Override
     public void addLeaf(YangLeaf leaf) {
-        getListOfLeaf().add(leaf);
+        listOfLeaf.add(leaf);
+    }
+
+    /**
+     * Removes a leaf.
+     *
+     * @param leaf the leaf to be removed
+     */
+    @Override
+    public void removeLeaf(YangLeaf leaf) {
+        listOfLeaf.remove(leaf);
     }
 
     /**
@@ -464,7 +478,17 @@
      */
     @Override
     public void addLeafList(YangLeafList leafList) {
-        getListOfLeafList().add(leafList);
+        listOfLeafList.add(leafList);
+    }
+
+    /**
+     * Removes a leaf-list.
+     *
+     * @param leafList the leaf-list to be removed
+     */
+    @Override
+    public void removeLeafList(YangLeafList leafList) {
+        listOfLeafList.remove(leafList);
     }
 
     /**
@@ -472,6 +496,7 @@
      *
      * @return the max elements
      */
+    @Override
     public YangMaxElement getMaxElements() {
         return maxElements;
     }
@@ -481,6 +506,7 @@
      *
      * @param max the max elements
      */
+    @Override
     public void setMaxElements(YangMaxElement max) {
         this.maxElements = max;
     }
@@ -490,6 +516,7 @@
      *
      * @return the minimum elements
      */
+    @Override
     public YangMinElement getMinElements() {
         return minElements;
     }
@@ -499,6 +526,7 @@
      *
      * @param minElements the minimum elements
      */
+    @Override
     public void setMinElements(YangMinElement minElements) {
         this.minElements = minElements;
     }
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangMandatory.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangMandatory.java
new file mode 100644
index 0000000..a436e61
--- /dev/null
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangMandatory.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.compiler.datamodel;
+
+/**
+ * Abstraction of mandatory entity. It is used to abstract the data holders of
+ * mandatory statement.
+ */
+public interface YangMandatory {
+
+    /**
+     * Returns true, if the leaf is mandatory; false otherwise.
+     *
+     * @return true if leaf is mandatory; false otherwise
+     */
+    boolean isMandatory();
+
+    /**
+     * Sets the mandatory flag.
+     *
+     * @param isReq the flag value to set
+     */
+    void setMandatory(boolean isReq);
+}
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangMaxElementHolder.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangMaxElementHolder.java
new file mode 100644
index 0000000..2e543db
--- /dev/null
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangMaxElementHolder.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.compiler.datamodel;
+
+/**
+ * Abstraction of max-element entity. It is used to abstract the data holders
+ * of max-element statement.
+ */
+public interface YangMaxElementHolder {
+
+    /**
+     * Returns the max elements.
+     *
+     * @return the max elements
+     */
+    YangMaxElement getMaxElements();
+
+    /**
+     * Sets the max elements.
+     *
+     * @param max the max elements
+     */
+    void setMaxElements(YangMaxElement max);
+}
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangMinElementHolder.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangMinElementHolder.java
new file mode 100644
index 0000000..d5c4375
--- /dev/null
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangMinElementHolder.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.compiler.datamodel;
+
+/**
+ * Abstraction of min-element entity. It is used to abstract the data holders
+ * of min-element statement.
+ */
+public interface YangMinElementHolder {
+
+    /**
+     * Returns the minimum elements.
+     *
+     * @return the minimum elements
+     */
+    YangMinElement getMinElements();
+
+    /**
+     * Sets the minimum elements.
+     *
+     * @param minElements the minimum elements
+     */
+    void setMinElements(YangMinElement minElements);
+}
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangModule.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangModule.java
index 360b192..09dbc98 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangModule.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangModule.java
@@ -30,6 +30,7 @@
 import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_BASE;
 import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_COMPILER_ANNOTATION;
 import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_DERIVED_DATA_TYPE;
+import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_DEVIATION;
 import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_IDENTITYREF;
 import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_IF_FEATURE;
 import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_LEAFREF;
@@ -87,7 +88,7 @@
         extends YangNode
         implements YangLeavesHolder, YangDesc, YangReference, Parsable,
         CollisionDetector, YangReferenceResolver, RpcNotificationContainer,
-        YangFeatureHolder, YangIsFilterContentNodes, YangNamespace {
+        YangFeatureHolder, YangIsFilterContentNodes, YangNamespace, YangDeviationHolder {
 
     private static final long serialVersionUID = 806201610L;
 
@@ -239,6 +240,11 @@
     private List<YangResolutionInfo> compilerAnnotationList;
 
     /**
+     * Deviation list.
+     */
+    private List<YangResolutionInfo> deviationList;
+
+    /**
      * Extension list.
      */
     private List<YangExtension> extensionList;
@@ -264,10 +270,19 @@
     private String namespace;
 
     /**
+     * Flag to check whether target node is already cloned.
+     */
+    private boolean isDeviatedNodeCloned;
+
+    /**
+     * Flag to check whether this module is only for deviation.
+     */
+    private boolean isModuleForDeviation;
+
+    /**
      * Creates a YANG node of module type.
      */
     public YangModule() {
-
         super(YangNodeType.MODULE_NODE, new HashMap<>());
         derivedTypeResolutionList = new LinkedList<>();
         augmentResolutionList = new LinkedList<>();
@@ -277,6 +292,7 @@
         baseResolutionList = new LinkedList<>();
         identityRefResolutionList = new LinkedList<>();
         compilerAnnotationList = new LinkedList<>();
+        deviationList = new LinkedList<>();
         importList = new LinkedList<>();
         includeList = new LinkedList<>();
         listOfLeaf = new LinkedList<>();
@@ -423,6 +439,16 @@
     }
 
     /**
+     * Removes a leaf.
+     *
+     * @param leaf the leaf to be removed
+     */
+    @Override
+    public void removeLeaf(YangLeaf leaf) {
+        getListOfLeaf().remove(leaf);
+    }
+
+    /**
      * Returns the list of leaf-list from module.
      *
      * @return the list of leaf-list
@@ -448,6 +474,16 @@
         listOfLeafList.add(leafList);
     }
 
+    /**
+     * Removes a leaf-list.
+     *
+     * @param leafList the leaf-list to be removed
+     */
+    @Override
+    public void removeLeafList(YangLeafList leafList) {
+        getListOfLeafList().remove(leafList);
+    }
+
     @Override
     public List<YangFeature> getFeatureList() {
         return unmodifiableList(listOfFeature);
@@ -680,8 +716,10 @@
             return unmodifiableList(baseResolutionList);
         } else if (type == YANG_IDENTITYREF) {
             return unmodifiableList(identityRefResolutionList);
-        } else {
+        } else if (type == YANG_COMPILER_ANNOTATION) {
             return unmodifiableList(compilerAnnotationList);
+        } else {
+            return unmodifiableList(deviationList);
         }
     }
 
@@ -704,6 +742,8 @@
             identityRefResolutionList.add(info);
         } else if (type == YANG_COMPILER_ANNOTATION) {
             compilerAnnotationList.add(info);
+        } else if (type == YANG_DEVIATION) {
+            deviationList.add(info);
         }
     }
 
@@ -726,6 +766,8 @@
             identityRefResolutionList = resolutionList;
         } else if (type == YANG_COMPILER_ANNOTATION) {
             compilerAnnotationList = resolutionList;
+        } else if (type == YANG_DEVIATION) {
+            deviationList = resolutionList;
         }
     }
 
@@ -817,4 +859,24 @@
     public void setModuleNamespace(String namespace) {
         this.namespace = namespace;
     }
+
+    @Override
+    public boolean isDeviatedNodeCloned() {
+        return isDeviatedNodeCloned;
+    }
+
+    @Override
+    public void setDeviatedNodeCloned(boolean deviatedNodeCloned) {
+        this.isDeviatedNodeCloned = deviatedNodeCloned;
+    }
+
+    @Override
+    public boolean isModuleForDeviation() {
+        return isModuleForDeviation;
+    }
+
+    @Override
+    public void setModuleForDeviation(boolean moduleForDeviation) {
+        isModuleForDeviation = moduleForDeviation;
+    }
 }
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangNode.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangNode.java
index d962a39..8b7f597 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangNode.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangNode.java
@@ -396,19 +396,22 @@
     /**
      * Clones the current node contents and create a new node.
      *
-     * @param yangUses YANG uses
+     * @param yangUses    YANG uses
+     * @param isDeviation flag to identify cloning is for deviation
      * @return cloned node
      * @throws CloneNotSupportedException clone is not supported by the referred
      *                                    node
      */
-    public YangNode clone(YangUses yangUses)
+    public YangNode clone(YangUses yangUses, boolean isDeviation)
             throws CloneNotSupportedException {
         YangNode clonedNode = (YangNode) super.clone();
-        clonedNode.referredSchemaNode = this;
+
         if (clonedNode instanceof YangLeavesHolder) {
             try {
-                cloneListOfLeaf((YangLeavesHolder) clonedNode, yangUses);
-                cloneListOfLeafList((YangLeavesHolder) clonedNode, yangUses);
+                cloneListOfLeaf((YangLeavesHolder) clonedNode, yangUses,
+                                isDeviation);
+                cloneListOfLeafList((YangLeavesHolder) clonedNode, yangUses,
+                                    isDeviation);
             } catch (DataModelException e) {
                 throw new CloneNotSupportedException(e.getMessage());
             }
@@ -418,9 +421,12 @@
         clonedNode.setChild(null);
         clonedNode.setNextSibling(null);
         clonedNode.setPreviousSibling(null);
-        clonedNode.yangSchemaNodeIdentifier =
-                clonedNode.yangSchemaNodeIdentifier.clone();
-        clonedNode.ysnContextInfoMap = new HashMap<>();
+        if (!isDeviation) {
+            clonedNode.yangSchemaNodeIdentifier =
+                    clonedNode.yangSchemaNodeIdentifier.clone();
+            clonedNode.ysnContextInfoMap = new HashMap<>();
+            clonedNode.referredSchemaNode = this;
+        }
         if (clonedNode instanceof YangAugmentableNode) {
             ((YangAugmentableNode) clonedNode).cloneAugmentInfo();
         }
@@ -435,10 +441,11 @@
      * @param srcRootNode source node for sub tree cloning
      * @param dstRootNode destination node where the sub tree needs to be cloned
      * @param yangUses    YANG uses
+     * @param isDeviation flag to check whether cloning is for deviation
      * @throws DataModelException data model error
      */
     public static void cloneSubTree(YangNode srcRootNode, YangNode dstRootNode,
-                                    YangUses yangUses)
+                                    YangUses yangUses, boolean isDeviation)
             throws DataModelException {
 
         YangNode nextNodeToClone = srcRootNode;
@@ -473,7 +480,7 @@
                                                          " in " + nextNodeToClone.getFileName() + "\"");
                 }
                 if (curTraversal != PARENT) {
-                    newNode = nextNodeToClone.clone(yangUses);
+                    newNode = nextNodeToClone.clone(yangUses, isDeviation);
                     detectCollisionWhileCloning(clonedTreeCurNode, newNode,
                                                 curTraversal);
                 }
@@ -508,6 +515,7 @@
                      * update the traversal's current node.
                      */
                     nextNodeToClone = nextNodeToClone.getChild();
+
                 } else if (nextNodeToClone.getNextSibling() != null) {
 
                     curTraversal = SIBILING;
@@ -525,6 +533,7 @@
                                                  " at " + nextNodeToClone.getCharPosition() +
                                                  " in " + nextNodeToClone.getFileName() + "\"");
         }
+
     }
 
     /**
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangNodeType.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangNodeType.java
index 1b178d3..994f197 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangNodeType.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangNodeType.java
@@ -112,5 +112,10 @@
     /**
      * Identityref node.
      */
-    IDENTITYREF_NODE
+    IDENTITYREF_NODE,
+
+    /**
+     * Deviation node
+     */
+    DEVIATION_NODE
 }
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangNotification.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangNotification.java
index 096b3dc..07a5958 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangNotification.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangNotification.java
@@ -216,6 +216,16 @@
         listOfLeaf.add(leaf);
     }
 
+    /**
+     * Removes a leaf.
+     *
+     * @param leaf the leaf to be removed
+     */
+    @Override
+    public void removeLeaf(YangLeaf leaf) {
+        listOfLeaf.remove(leaf);
+    }
+
     @Override
     public List<YangLeafList> getListOfLeafList() {
         return unmodifiableList(listOfLeafList);
@@ -231,6 +241,16 @@
         listOfLeafList.add(leafList);
     }
 
+    /**
+     * Removes a leaf-list.
+     *
+     * @param leafList the leaf-list to be removed
+     */
+    @Override
+    public void removeLeafList(YangLeafList leafList) {
+        listOfLeafList.remove(leafList);
+    }
+
     @Override
     public String getReference() {
         return reference;
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangOutput.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangOutput.java
index 2c206f0..6ce7aed 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangOutput.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangOutput.java
@@ -174,6 +174,16 @@
         listOfLeaf.add(leaf);
     }
 
+    /**
+     * Removes a leaf.
+     *
+     * @param leaf the leaf to be removed
+     */
+    @Override
+    public void removeLeaf(YangLeaf leaf) {
+        listOfLeaf.remove(leaf);
+    }
+
     @Override
     public void setListOfLeaf(List<YangLeaf> leafsList) {
         listOfLeaf = leafsList;
@@ -194,6 +204,16 @@
         listOfLeafList.add(leafList);
     }
 
+    /**
+     * Removes a leaf-list.
+     *
+     * @param leafList the leaf-list to be removed
+     */
+    @Override
+    public void removeLeafList(YangLeafList leafList) {
+        listOfLeafList.remove(leafList);
+    }
+
     @Override
     public void addAugmentation(YangAugment augmentInfo) {
         yangAugmentedInfo.add(augmentInfo);
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangSubModule.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangSubModule.java
index d67b15f..a83ba5d 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangSubModule.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangSubModule.java
@@ -31,6 +31,7 @@
 import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_BASE;
 import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_COMPILER_ANNOTATION;
 import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_DERIVED_DATA_TYPE;
+import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_DEVIATION;
 import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_IDENTITYREF;
 import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_IF_FEATURE;
 import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_LEAFREF;
@@ -96,7 +97,7 @@
         extends YangNode
         implements YangLeavesHolder, YangDesc, YangReference, Parsable,
         CollisionDetector, YangReferenceResolver, RpcNotificationContainer,
-        YangFeatureHolder, YangIsFilterContentNodes, YangNamespace {
+        YangFeatureHolder, YangIsFilterContentNodes, YangNamespace, YangDeviationHolder {
 
     private static final long serialVersionUID = 806201614L;
 
@@ -238,6 +239,11 @@
     private List<YangResolutionInfo> compilerAnnotationList;
 
     /**
+     * Deviation list.
+     */
+    private List<YangResolutionInfo> deviationList;
+
+    /**
      * extension list.
      */
     private List<YangExtension> extensionList;
@@ -268,6 +274,16 @@
     private String namespace;
 
     /**
+     * Flag to check whether target node is already cloned.
+     */
+    private boolean isDeviatedNodeCloned;
+
+    /**
+     * Flag to check whether this module is only for deviation.
+     */
+    private boolean isModuleForDeviation;
+
+    /**
      * Creates a sub module node.
      */
     public YangSubModule() {
@@ -280,12 +296,12 @@
         baseResolutionList = new LinkedList<>();
         identityRefResolutionList = new LinkedList<>();
         compilerAnnotationList = new LinkedList<>();
+        deviationList = new LinkedList<>();
         importList = new LinkedList<>();
         includeList = new LinkedList<>();
         listOfLeaf = new LinkedList<>();
         listOfLeafList = new LinkedList<>();
         extensionList = new LinkedList<>();
-        compilerAnnotationList = new LinkedList<>();
         listOfFeature = new LinkedList<>();
         notificationEnumMap = new HashMap<>();
         augments = new LinkedList<>();
@@ -473,6 +489,16 @@
     }
 
     /**
+     * Removes a leaf.
+     *
+     * @param leaf the leaf to be removed
+     */
+    @Override
+    public void removeLeaf(YangLeaf leaf) {
+        listOfLeaf.remove(leaf);
+    }
+
+    /**
      * Returns the list of leaf-list.
      *
      * @return the list of leaf-list
@@ -498,6 +524,16 @@
     }
 
     /**
+     * Removes a leaf-list.
+     *
+     * @param leafList the leaf-list to be removed
+     */
+    @Override
+    public void removeLeafList(YangLeafList leafList) {
+        listOfLeafList.remove(leafList);
+    }
+
+    /**
      * Returns the sub-modules organization.
      *
      * @return the organization
@@ -632,8 +668,10 @@
             return unmodifiableList(baseResolutionList);
         } else if (type == YANG_IDENTITYREF) {
             return unmodifiableList(identityRefResolutionList);
-        } else {
+        } else if (type == YANG_COMPILER_ANNOTATION) {
             return unmodifiableList(compilerAnnotationList);
+        } else {
+            return unmodifiableList(deviationList);
         }
     }
 
@@ -656,6 +694,8 @@
             identityRefResolutionList.add(resolutionInfo);
         } else if (type == YANG_COMPILER_ANNOTATION) {
             compilerAnnotationList.add(resolutionInfo);
+        } else if (type == YANG_DEVIATION) {
+            deviationList.add(resolutionInfo);
         }
     }
 
@@ -678,6 +718,8 @@
             identityRefResolutionList = resolutionList;
         } else if (type == YANG_COMPILER_ANNOTATION) {
             compilerAnnotationList = resolutionList;
+        } else if (type == YANG_DEVIATION) {
+            deviationList = resolutionList;
         }
     }
 
@@ -824,4 +866,24 @@
     public void setModuleNamespace(String namespace) {
         this.namespace = namespace;
     }
+
+    @Override
+    public boolean isDeviatedNodeCloned() {
+        return isDeviatedNodeCloned;
+    }
+
+    @Override
+    public void setDeviatedNodeCloned(boolean deviatedNodeCloned) {
+        this.isDeviatedNodeCloned = deviatedNodeCloned;
+    }
+
+    @Override
+    public boolean isModuleForDeviation() {
+        return isModuleForDeviation;
+    }
+
+    @Override
+    public void setModuleForDeviation(boolean moduleForDeviation) {
+        isModuleForDeviation = moduleForDeviation;
+    }
 }
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangTypeDef.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangTypeDef.java
index 499269d..b02e800 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangTypeDef.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangTypeDef.java
@@ -67,7 +67,7 @@
 public abstract class YangTypeDef
         extends YangNode
         implements YangCommonInfo, Parsable, YangTypeHolder, CollisionDetector,
-        YangTranslatorOperatorNode {
+        YangTranslatorOperatorNode, YangUnits, YangDefault {
 
     private static final long serialVersionUID = 806201615L;
 
@@ -141,6 +141,7 @@
      *
      * @return the default value
      */
+    @Override
     public String getDefaultValueInString() {
         return defaultValueInString;
     }
@@ -150,6 +151,7 @@
      *
      * @param defaultValueInString the default value
      */
+    @Override
     public void setDefaultValueInString(String defaultValueInString) {
         this.defaultValueInString = defaultValueInString;
     }
@@ -240,6 +242,7 @@
      *
      * @return the units
      */
+    @Override
     public String getUnits() {
         return units;
     }
@@ -249,6 +252,7 @@
      *
      * @param units the units to set
      */
+    @Override
     public void setUnits(String units) {
         this.units = units;
     }
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangUniqueHolder.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangUniqueHolder.java
new file mode 100644
index 0000000..40fc343
--- /dev/null
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangUniqueHolder.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.compiler.datamodel;
+
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+
+import java.util.List;
+
+/**
+ * Abstraction of unique entity. It is used to abstract the data holders of
+ * unique.
+ */
+public interface YangUniqueHolder {
+
+    /**
+     * Adds unique in data holder like list.
+     *
+     * @param unique the unique to be added
+     * @throws DataModelException if any violation of data model rules
+     */
+    void addUnique(String unique) throws DataModelException;
+
+    /**
+     * Sets the list of unique.
+     *
+     * @param uniqueList the list of unique to set
+     */
+    void setUniqueList(List<String> uniqueList);
+
+    /**
+     * Returns the list of unique from data holder like list.
+     *
+     * @return the list of unique
+     */
+    List<String> getUniqueList();
+}
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangUnits.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangUnits.java
new file mode 100644
index 0000000..ed56e49
--- /dev/null
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangUnits.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.compiler.datamodel;
+
+/**
+ * Abstraction of units entity. It is used to abstract the data holders of
+ * units statement.
+ */
+public interface YangUnits {
+
+    /**
+     * Returns the units.
+     *
+     * @return the units
+     */
+    String getUnits();
+
+    /**
+     * Sets the units.
+     *
+     * @param units the units to set
+     */
+    void setUnits(String units);
+}
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangUses.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangUses.java
index b622e28..496e615 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangUses.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangUses.java
@@ -424,7 +424,7 @@
         }
 
         try {
-            cloneSubTree(referredGrouping, usesParentNode, this);
+            cloneSubTree(referredGrouping, usesParentNode, this, false);
         } catch (DataModelException e) {
             throw new DataModelException(e.getMessage());
         }
@@ -551,7 +551,8 @@
     }
 
     @Override
-    public YangNode clone(YangUses node) throws CloneNotSupportedException {
+    public YangNode clone(YangUses node, boolean isDeviation) throws
+            CloneNotSupportedException {
         YangNode clnNode = (YangNode) super.clone();
         clnNode.setParent(null);
         clnNode.setChild(null);
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/DataModelUtils.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/DataModelUtils.java
index bfb5b8d..0ce482a 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/DataModelUtils.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/DataModelUtils.java
@@ -17,12 +17,18 @@
 package org.onosproject.yang.compiler.datamodel.utils;
 
 import org.onosproject.yang.compiler.datamodel.CollisionDetector;
-import org.onosproject.yang.compiler.datamodel.ResolvableType;
 import org.onosproject.yang.compiler.datamodel.YangAtomicPath;
 import org.onosproject.yang.compiler.datamodel.YangAugment;
 import org.onosproject.yang.compiler.datamodel.YangBase;
 import org.onosproject.yang.compiler.datamodel.YangCompilerAnnotation;
+import org.onosproject.yang.compiler.datamodel.YangConfig;
+import org.onosproject.yang.compiler.datamodel.YangDefault;
 import org.onosproject.yang.compiler.datamodel.YangDerivedInfo;
+import org.onosproject.yang.compiler.datamodel.YangDeviateAdd;
+import org.onosproject.yang.compiler.datamodel.YangDeviateDelete;
+import org.onosproject.yang.compiler.datamodel.YangDeviateReplace;
+import org.onosproject.yang.compiler.datamodel.YangDeviation;
+import org.onosproject.yang.compiler.datamodel.YangEntityToResolveInfo;
 import org.onosproject.yang.compiler.datamodel.YangEntityToResolveInfoImpl;
 import org.onosproject.yang.compiler.datamodel.YangEnumeration;
 import org.onosproject.yang.compiler.datamodel.YangIdentityRef;
@@ -32,13 +38,21 @@
 import org.onosproject.yang.compiler.datamodel.YangLeafList;
 import org.onosproject.yang.compiler.datamodel.YangLeafRef;
 import org.onosproject.yang.compiler.datamodel.YangLeavesHolder;
+import org.onosproject.yang.compiler.datamodel.YangMandatory;
+import org.onosproject.yang.compiler.datamodel.YangMaxElementHolder;
+import org.onosproject.yang.compiler.datamodel.YangMinElementHolder;
 import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangMust;
+import org.onosproject.yang.compiler.datamodel.YangMustHolder;
 import org.onosproject.yang.compiler.datamodel.YangNode;
 import org.onosproject.yang.compiler.datamodel.YangReferenceResolver;
 import org.onosproject.yang.compiler.datamodel.YangResolutionInfo;
 import org.onosproject.yang.compiler.datamodel.YangRpc;
+import org.onosproject.yang.compiler.datamodel.YangSchemaNode;
 import org.onosproject.yang.compiler.datamodel.YangType;
 import org.onosproject.yang.compiler.datamodel.YangUnion;
+import org.onosproject.yang.compiler.datamodel.YangUniqueHolder;
+import org.onosproject.yang.compiler.datamodel.YangUnits;
 import org.onosproject.yang.compiler.datamodel.YangUses;
 import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
 import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
@@ -60,12 +74,20 @@
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 
+import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_AUGMENT;
+import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_BASE;
+import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_COMPILER_ANNOTATION;
+import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_DERIVED_DATA_TYPE;
+import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_DEVIATION;
+import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_IDENTITYREF;
+import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_IF_FEATURE;
+import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_LEAFREF;
+import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_USES;
 import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.DERIVED;
 import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.EMPTY;
 import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.ENUMERATION;
 import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.UNION;
 
-
 /**
  * Represents utilities for data model tree.
  */
@@ -200,35 +222,36 @@
             }
         }
         YangReferenceResolver resolutionNode = (YangReferenceResolver) curNode;
-
-        if (resolutionInfo.getEntityToResolveInfo()
-                .getEntityToResolve() instanceof YangType) {
+        YangEntityToResolveInfo entityToResolveInfo = resolutionInfo.getEntityToResolveInfo();
+        if (entityToResolveInfo.getEntityToResolve()
+                instanceof YangType) {
             resolutionNode.addToResolutionList(resolutionInfo,
-                                               ResolvableType.YANG_DERIVED_DATA_TYPE);
-        } else if (resolutionInfo.getEntityToResolveInfo()
-                .getEntityToResolve() instanceof YangUses) {
+                                               YANG_DERIVED_DATA_TYPE);
+        } else if (entityToResolveInfo.getEntityToResolve()
+                instanceof YangUses) {
+            resolutionNode.addToResolutionList(resolutionInfo, YANG_USES);
+        } else if (entityToResolveInfo.getEntityToResolve()
+                instanceof YangAugment) {
+            resolutionNode.addToResolutionList(resolutionInfo, YANG_AUGMENT);
+        } else if (entityToResolveInfo.getEntityToResolve()
+                instanceof YangIfFeature) {
+            resolutionNode.addToResolutionList(resolutionInfo, YANG_IF_FEATURE);
+        } else if (entityToResolveInfo.getEntityToResolve()
+                instanceof YangLeafRef) {
+            resolutionNode.addToResolutionList(resolutionInfo, YANG_LEAFREF);
+        } else if (entityToResolveInfo.getEntityToResolve()
+                instanceof YangBase) {
+            resolutionNode.addToResolutionList(resolutionInfo, YANG_BASE);
+        } else if (entityToResolveInfo.getEntityToResolve()
+                instanceof YangIdentityRef) {
+            resolutionNode.addToResolutionList(resolutionInfo, YANG_IDENTITYREF);
+        } else if (entityToResolveInfo.getEntityToResolve()
+                instanceof YangCompilerAnnotation) {
             resolutionNode.addToResolutionList(resolutionInfo,
-                                               ResolvableType.YANG_USES);
-        } else if (resolutionInfo.getEntityToResolveInfo()
-                .getEntityToResolve() instanceof YangAugment) {
-            resolutionNode.addToResolutionList(resolutionInfo,
-                                               ResolvableType.YANG_AUGMENT);
-        } else if (resolutionInfo.getEntityToResolveInfo()
-                .getEntityToResolve() instanceof YangIfFeature) {
-            resolutionNode.addToResolutionList(resolutionInfo,
-                                               ResolvableType.YANG_IF_FEATURE);
-        } else if (resolutionInfo.getEntityToResolveInfo()
-                .getEntityToResolve() instanceof YangLeafRef) {
-            resolutionNode.addToResolutionList(resolutionInfo,
-                                               ResolvableType.YANG_LEAFREF);
-        } else if (resolutionInfo.getEntityToResolveInfo().getEntityToResolve() instanceof YangBase) {
-            resolutionNode.addToResolutionList(resolutionInfo, ResolvableType.YANG_BASE);
-        } else if (resolutionInfo.getEntityToResolveInfo().getEntityToResolve() instanceof YangIdentityRef) {
-            resolutionNode.addToResolutionList(resolutionInfo, ResolvableType.YANG_IDENTITYREF);
-        } else if (resolutionInfo.getEntityToResolveInfo()
-                .getEntityToResolve() instanceof YangCompilerAnnotation) {
-            resolutionNode.addToResolutionList(resolutionInfo,
-                                               ResolvableType.YANG_COMPILER_ANNOTATION);
+                                               YANG_COMPILER_ANNOTATION);
+        } else if (entityToResolveInfo.getEntityToResolve()
+                instanceof YangDeviation) {
+            resolutionNode.addToResolutionList(resolutionInfo, YANG_DEVIATION);
         }
     }
 
@@ -350,22 +373,30 @@
      * cloning. Under the cloned node, with cloned leaf, attributes are set
      * and added to resolution list.
      *
-     * @param clonedNode holder node
-     * @param yangUses   YANG uses
+     * @param clonedNode  holder node
+     * @param yangUses    YANG uses
+     * @param isDeviation flag to identify cloning is for deviation
      * @throws CloneNotSupportedException clone not supported error
      * @throws DataModelException         data model error
      */
-    public static void cloneListOfLeaf(
-            YangLeavesHolder clonedNode, YangUses yangUses)
+    public static void cloneListOfLeaf(YangLeavesHolder clonedNode,
+                                       YangUses yangUses,
+                                       boolean isDeviation)
             throws CloneNotSupportedException, DataModelException {
 
         List<YangLeaf> leaves = clonedNode.getListOfLeaf();
         if (nonEmpty(leaves)) {
             List<YangLeaf> clonedLeaves = new LinkedList<>();
             for (YangLeaf leaf : leaves) {
-                YangLeaf clonedLeaf = leaf.clone();
+                YangLeaf clonedLeaf;
+                if (!isDeviation) {
+                    clonedLeaf = leaf.clone();
+                    addUnresolvedType(yangUses, clonedLeaf,
+                                      (YangNode) clonedNode);
+                } else {
+                    clonedLeaf = leaf.cloneForDeviation();
+                }
                 clonedLeaf.setReferredLeaf(leaf);
-                addUnresolvedType(yangUses, clonedLeaf, (YangNode) clonedNode);
                 clonedLeaf.setContainedIn(clonedNode);
                 clonedLeaves.add(clonedLeaf);
             }
@@ -413,23 +444,29 @@
      * after cloning. Under the cloned node, with cloned leaf-list,
      * attributes are set and added to resolution list.
      *
-     * @param clonedNode cloned holder
-     * @param yangUses   YANG uses
+     * @param clonedNode  cloned holder
+     * @param yangUses    YANG uses
+     * @param isDeviation flag to identify cloning is for deviation
      * @throws CloneNotSupportedException clone not supported error
      * @throws DataModelException         data model error
      */
     public static void cloneListOfLeafList(
-            YangLeavesHolder clonedNode, YangUses yangUses)
+            YangLeavesHolder clonedNode, YangUses yangUses, boolean isDeviation)
             throws CloneNotSupportedException, DataModelException {
 
         List<YangLeafList> listOfLeafList = clonedNode.getListOfLeafList();
         if (nonEmpty(listOfLeafList)) {
             List<YangLeafList> clonedList = new LinkedList<>();
             for (YangLeafList leafList : listOfLeafList) {
-                YangLeafList clonedLeafList = leafList.clone();
+                YangLeafList clonedLeafList;
+                if (!isDeviation) {
+                    clonedLeafList = leafList.clone();
+                    addUnresolvedType(yangUses, clonedLeafList,
+                                      (YangNode) clonedNode);
+                } else {
+                    clonedLeafList = leafList.cloneForDeviation();
+                }
                 clonedLeafList.setReferredSchemaLeafList(leafList);
-                addUnresolvedType(yangUses, clonedLeafList,
-                                  (YangNode) clonedNode);
                 clonedLeafList.setContainedIn(clonedNode);
                 clonedList.add(clonedLeafList);
             }
@@ -844,4 +881,277 @@
                 return dataType.getDataType().equals(EMPTY);
         }
     }
+
+    /**
+     * Validates whether multiple deviation statement's Xpath is referring
+     * to same module.
+     *
+     * @param node YANG data model node
+     * @throws DataModelException if deviations referring to multiple module
+     */
+    public static void validateMultipleDeviationStatement(
+            YangReferenceResolver node) throws DataModelException {
+        List<YangResolutionInfo> deviationList = node
+                .getUnresolvedResolutionList(YANG_DEVIATION);
+        String prefix = null;
+        if (!deviationList.isEmpty()) {
+            YangDeviation firstDeviation = (YangDeviation) deviationList.get(0)
+                    .getEntityToResolveInfo().getEntityToResolve();
+            YangAtomicPath atomic = firstDeviation.getTargetNode().get(0);
+            prefix = atomic.getNodeIdentifier().getPrefix();
+        }
+
+        Iterator<YangResolutionInfo> deviationIterator = deviationList.iterator();
+        while (deviationIterator.hasNext()) {
+            YangDeviation deviation = (YangDeviation) deviationIterator.next()
+                    .getEntityToResolveInfo().getEntityToResolve();
+            List<YangAtomicPath> targetNode = deviation.getTargetNode();
+            YangAtomicPath atomicPath = targetNode.get(0);
+            if (!atomicPath.getNodeIdentifier().getPrefix().equals(prefix)) {
+                throw new DataModelException("YANG FILE ERROR : Deviations " +
+                                                     "of multiple module is" +
+                                                     " currently not " +
+                                                     "supported.");
+            }
+        }
+    }
+
+    /**
+     * Removes node from data model tree.
+     *
+     * @param node YANG data model node
+     */
+    public static void deleteUnsupportedNodeFromTree(YangNode node) {
+        // unlink from parent
+        YangNode parentNode = node.getParent();
+        if (parentNode.getChild().equals(node)) {
+            parentNode.setChild(node.getNextSibling());
+        }
+
+        //unlink from siblings
+        YangNode previousSibling = node.getPreviousSibling();
+        YangNode nextSibling = node.getNextSibling();
+        if (nextSibling != null && previousSibling != null) {
+            previousSibling.setNextSibling(nextSibling);
+            nextSibling.setPreviousSibling(previousSibling);
+        } else if (nextSibling != null) {
+            nextSibling.setPreviousSibling(null);
+        } else if (previousSibling != null) {
+            previousSibling.setNextSibling(null);
+        }
+        node.setParent(null);
+        node.setPreviousSibling(null);
+        node.setNextSibling(null);
+        node.setChild(null);
+    }
+
+    /**
+     * Removes leaf/leaf-list from data model tree.
+     *
+     * @param node     YANG data model node
+     * @param leafName name of leaf to be removed
+     */
+    public static void deleteUnsupportedLeafOrLeafList(YangLeavesHolder node,
+                                                       String leafName) {
+        List<YangLeaf> leaves = node.getListOfLeaf();
+        if (leaves != null && !leaves.isEmpty()) {
+            for (YangLeaf leaf : leaves) {
+                if (leaf.getName().equals(leafName)) {
+                    node.removeLeaf(leaf);
+                    return;
+                }
+            }
+        }
+
+        List<YangLeafList> leafList = node.getListOfLeafList();
+        if (leafList != null && !leafList.isEmpty()) {
+            for (YangLeafList leaf : leafList) {
+                if (leaf.getName().equals(leafName)) {
+                    node.removeLeafList(leaf);
+                    return;
+                }
+            }
+        }
+    }
+
+    /**
+     * Updates the target data model with deviate delete sub statements.
+     *
+     * @param targetNode    target node of deviation
+     * @param deviateDelete YANG deviate delete data model node
+     * @throws DataModelException if deviations referring to multiple module
+     */
+    public static void updateDeviateDeleteToTargetNode(YangSchemaNode targetNode,
+                                                       YangDeviateDelete deviateDelete)
+            throws DataModelException {
+
+        // delete must statement
+        if (targetNode instanceof YangMustHolder
+                && !deviateDelete.getListOfMust().isEmpty()) {
+            deviateDelete.setListOfMust(new LinkedList<>());
+        }
+
+        // delete unique statement
+        if (targetNode instanceof YangUniqueHolder
+                && !deviateDelete.getUniqueList().isEmpty()) {
+            deviateDelete.setUniqueList(new LinkedList<>());
+        }
+
+        // delete units statement
+        if (targetNode instanceof YangUnits) {
+            ((YangUnits) targetNode).setUnits(null);
+        }
+
+        // delete default statement
+        if (targetNode instanceof YangDefault) {
+            ((YangDefault) targetNode)
+                    .setDefaultValueInString(null);
+        }
+    }
+
+    /**
+     * Updates the target data model with deviate add sub statements.
+     *
+     * @param targetNode target node of deviation
+     * @param deviateAdd YANG deviate add data model node
+     * @throws DataModelException if deviations referring to multiple module
+     */
+    public static void updateDeviateAddToTargetNode(YangSchemaNode targetNode,
+                                                    YangDeviateAdd deviateAdd)
+            throws DataModelException {
+        // update must statement
+        if (targetNode instanceof YangMustHolder
+                && !deviateAdd.getListOfMust().isEmpty()) {
+            Iterator<YangMust> mustList = deviateAdd.getListOfMust().listIterator();
+            while (mustList.hasNext()) {
+                ((YangMustHolder) targetNode).addMust(mustList.next());
+            }
+        }
+
+        // update unique statement
+        if (targetNode instanceof YangUniqueHolder
+                && !deviateAdd.getUniqueList().isEmpty()) {
+            Iterator<String> uniqueList = deviateAdd.getUniqueList()
+                    .listIterator();
+            while (uniqueList.hasNext()) {
+                ((YangUniqueHolder) targetNode).addUnique(uniqueList.next());
+            }
+        }
+
+        // update config statement
+        if (targetNode instanceof YangConfig) {
+            ((YangConfig) targetNode).setConfig(deviateAdd.isConfig());
+        }
+
+        // update units statement
+        if (targetNode instanceof YangUnits) {
+            ((YangUnits) targetNode).setUnits(deviateAdd.getUnits());
+        }
+
+        // update default statement
+        if (targetNode instanceof YangDefault) {
+            ((YangDefault) targetNode)
+                    .setDefaultValueInString(deviateAdd.getDefaultValueInString());
+        }
+
+        // update mandatory statement
+        if (targetNode instanceof YangMandatory) {
+            ((YangMandatory) targetNode).setMandatory(deviateAdd.isMandatory());
+        }
+
+        // update minelement statement
+        if (targetNode instanceof YangMinElementHolder) {
+            ((YangMinElementHolder) targetNode)
+                    .setMinElements(deviateAdd.getMinElements());
+        }
+
+        // update max-element statement
+        if (targetNode instanceof YangMaxElementHolder) {
+            ((YangMaxElementHolder) targetNode)
+                    .setMaxElements(deviateAdd.getMaxElements());
+        }
+    }
+
+    /**
+     * Replaces the substatements of deviate replace to target node.
+     *
+     * @param targetNode     target node of deviation
+     * @param deviateReplace YANG deviate replace data model node
+     */
+    public static void updateDeviateReplaceToTargetNode(YangSchemaNode targetNode,
+                                                        YangDeviateReplace deviateReplace) {
+
+        if (targetNode instanceof YangLeaf
+                && deviateReplace.getDataType() != null) {
+            ((YangLeaf) targetNode).setDataType(deviateReplace.getDataType());
+        }
+
+        if (targetNode instanceof YangLeafList
+                && deviateReplace.getDataType() != null) {
+            ((YangLeafList) targetNode).setDataType(deviateReplace
+                                                            .getDataType());
+        }
+
+        // update config statement
+        if (targetNode instanceof YangConfig) {
+            ((YangConfig) targetNode).setConfig(deviateReplace.isConfig());
+        }
+
+        // update units statement
+        if (targetNode instanceof YangUnits) {
+            ((YangUnits) targetNode).setUnits(deviateReplace.getUnits());
+        }
+
+        // update default statement
+        if (targetNode instanceof YangDefault) {
+            ((YangDefault) targetNode)
+                    .setDefaultValueInString(deviateReplace.getDefaultValueInString());
+        }
+
+        // update mandatory statement
+        if (targetNode instanceof YangMandatory) {
+            ((YangMandatory) targetNode).setMandatory(deviateReplace.isMandatory());
+        }
+
+        // update minelement statement
+        if (targetNode instanceof YangMinElementHolder) {
+            ((YangMinElementHolder) targetNode)
+                    .setMinElements(deviateReplace.getMinElements());
+        }
+
+        // update max-element statement
+        if (targetNode instanceof YangMaxElementHolder) {
+            ((YangMaxElementHolder) targetNode)
+                    .setMaxElements(deviateReplace.getMaxElements());
+        }
+    }
+
+    /**
+     * Searches for leaf/leaf-list in given leaf holder node.
+     *
+     * @param target leaf holder
+     * @param name   leaf/leaf-list name
+     * @return leaf/leaf-list node
+     */
+    public static YangSchemaNode findLeafNode(YangLeavesHolder target,
+                                              String name) {
+        List<YangLeaf> leaves = target.getListOfLeaf();
+        if (leaves != null && !leaves.isEmpty()) {
+            for (YangLeaf leaf : leaves) {
+                if (leaf.getName().equals(name)) {
+                    return leaf;
+                }
+            }
+        }
+
+        List<YangLeafList> listOfleafList = target.getListOfLeafList();
+        if (listOfleafList != null && !listOfleafList.isEmpty()) {
+            for (YangLeafList leafList : listOfleafList) {
+                if (leafList.getName().equals(name)) {
+                    return leafList;
+                }
+            }
+        }
+        return null;
+    }
 }
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/YangConstructType.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/YangConstructType.java
index 9c9aedf..edb1128 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/YangConstructType.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/YangConstructType.java
@@ -402,7 +402,27 @@
     /**
      * Identifies the YANG argument element parsed data.
      */
-    ARGUMENT_DATA;
+    ARGUMENT_DATA,
+
+    /**
+     * Identifies the YANG deviate not supported element parsed data.
+     */
+    DEVIATE_NOT_SUPPORTED,
+
+    /**
+     * Identifies deviation add element parsed data.
+     */
+    DEVIATE_ADD,
+
+    /**
+     * Identifies deviation delete element parsed data.
+     */
+    DEVIATE_DELETE,
+
+    /**
+     * Identifies deviation replace element parsed data.
+     */
+    DEVIATE_REPLACE;
 
     /**
      * Returns the YANG construct keyword corresponding to enum values.
@@ -567,6 +587,14 @@
                 return "app-extended-name";
             case ARGUMENT_DATA:
                 return "argument";
+            case DEVIATE_NOT_SUPPORTED:
+                return "deviate-not-supported-stmt";
+            case DEVIATE_ADD:
+                return "deviate-add";
+            case DEVIATE_DELETE:
+                return "deviate-delete";
+            case DEVIATE_REPLACE:
+                return "deviate-replace";
             default:
                 return "yang";
         }
diff --git a/compiler/base/linker/src/main/java/org/onosproject/yang/compiler/linker/impl/XpathLinkingTypes.java b/compiler/base/linker/src/main/java/org/onosproject/yang/compiler/linker/impl/XpathLinkingTypes.java
index a4345cf..e560fd8 100644
--- a/compiler/base/linker/src/main/java/org/onosproject/yang/compiler/linker/impl/XpathLinkingTypes.java
+++ b/compiler/base/linker/src/main/java/org/onosproject/yang/compiler/linker/impl/XpathLinkingTypes.java
@@ -27,5 +27,8 @@
     LEAF_REF_LINKING,
 
     // Compiler annotation linking.
-    COMPILER_ANNOTATION_LINKING
+    COMPILER_ANNOTATION_LINKING,
+
+    // Deviation linking.
+    DEVIATION_LINKING
 }
diff --git a/compiler/base/linker/src/main/java/org/onosproject/yang/compiler/linker/impl/YangLinkerManager.java b/compiler/base/linker/src/main/java/org/onosproject/yang/compiler/linker/impl/YangLinkerManager.java
index 61528be..2761480 100644
--- a/compiler/base/linker/src/main/java/org/onosproject/yang/compiler/linker/impl/YangLinkerManager.java
+++ b/compiler/base/linker/src/main/java/org/onosproject/yang/compiler/linker/impl/YangLinkerManager.java
@@ -33,6 +33,7 @@
 import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_BASE;
 import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_COMPILER_ANNOTATION;
 import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_DERIVED_DATA_TYPE;
+import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_DEVIATION;
 import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_IDENTITYREF;
 import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_IF_FEATURE;
 import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_LEAFREF;
@@ -179,22 +180,17 @@
         sort(yangNodeSortedList);
         for (YangNode yangNode : yangNodeSortedList) {
             try {
-                ((YangReferenceResolver) yangNode)
-                        .resolveInterFileLinking(YANG_IF_FEATURE);
-                ((YangReferenceResolver) yangNode)
-                        .resolveInterFileLinking(YANG_USES);
-                ((YangReferenceResolver) yangNode)
-                        .resolveInterFileLinking(YANG_AUGMENT);
-                ((YangReferenceResolver) yangNode)
-                        .resolveInterFileLinking(YANG_DERIVED_DATA_TYPE);
-                ((YangReferenceResolver) yangNode)
-                        .resolveInterFileLinking(YANG_BASE);
-                ((YangReferenceResolver) yangNode)
-                        .resolveInterFileLinking(YANG_IDENTITYREF);
-                ((YangReferenceResolver) yangNode)
-                        .resolveInterFileLinking(YANG_LEAFREF);
-                ((YangReferenceResolver) yangNode)
-                        .resolveInterFileLinking(YANG_COMPILER_ANNOTATION);
+                YangReferenceResolver resolver = ((YangReferenceResolver)
+                        yangNode);
+                resolver.resolveInterFileLinking(YANG_IF_FEATURE);
+                resolver.resolveInterFileLinking(YANG_USES);
+                resolver.resolveInterFileLinking(YANG_AUGMENT);
+                resolver.resolveInterFileLinking(YANG_DERIVED_DATA_TYPE);
+                resolver.resolveInterFileLinking(YANG_BASE);
+                resolver.resolveInterFileLinking(YANG_IDENTITYREF);
+                resolver.resolveInterFileLinking(YANG_LEAFREF);
+                resolver.resolveInterFileLinking(YANG_COMPILER_ANNOTATION);
+                resolver.resolveInterFileLinking(YANG_DEVIATION);
             } catch (DataModelException e) {
                 String errorInfo = "Error in file: " + yangNode.getName() + " in " +
                         yangNode.getFileName() + " at " +
diff --git a/compiler/base/linker/src/main/java/org/onosproject/yang/compiler/linker/impl/YangResolutionInfoImpl.java b/compiler/base/linker/src/main/java/org/onosproject/yang/compiler/linker/impl/YangResolutionInfoImpl.java
index 3c1542c..2f7db3b 100644
--- a/compiler/base/linker/src/main/java/org/onosproject/yang/compiler/linker/impl/YangResolutionInfoImpl.java
+++ b/compiler/base/linker/src/main/java/org/onosproject/yang/compiler/linker/impl/YangResolutionInfoImpl.java
@@ -16,6 +16,7 @@
 
 package org.onosproject.yang.compiler.linker.impl;
 
+import org.onosproject.yang.compiler.datamodel.CollisionDetector;
 import org.onosproject.yang.compiler.datamodel.DefaultLocationInfo;
 import org.onosproject.yang.compiler.datamodel.Resolvable;
 import org.onosproject.yang.compiler.datamodel.RpcNotificationContainer;
@@ -26,6 +27,11 @@
 import org.onosproject.yang.compiler.datamodel.YangBase;
 import org.onosproject.yang.compiler.datamodel.YangCompilerAnnotation;
 import org.onosproject.yang.compiler.datamodel.YangDerivedInfo;
+import org.onosproject.yang.compiler.datamodel.YangDeviateAdd;
+import org.onosproject.yang.compiler.datamodel.YangDeviateDelete;
+import org.onosproject.yang.compiler.datamodel.YangDeviateReplace;
+import org.onosproject.yang.compiler.datamodel.YangDeviation;
+import org.onosproject.yang.compiler.datamodel.YangDeviationHolder;
 import org.onosproject.yang.compiler.datamodel.YangEntityToResolveInfoImpl;
 import org.onosproject.yang.compiler.datamodel.YangFeature;
 import org.onosproject.yang.compiler.datamodel.YangFeatureHolder;
@@ -39,12 +45,14 @@
 import org.onosproject.yang.compiler.datamodel.YangLeaf;
 import org.onosproject.yang.compiler.datamodel.YangLeafList;
 import org.onosproject.yang.compiler.datamodel.YangLeafRef;
+import org.onosproject.yang.compiler.datamodel.YangLeavesHolder;
 import org.onosproject.yang.compiler.datamodel.YangList;
 import org.onosproject.yang.compiler.datamodel.YangNode;
 import org.onosproject.yang.compiler.datamodel.YangNodeIdentifier;
 import org.onosproject.yang.compiler.datamodel.YangReferenceResolver;
 import org.onosproject.yang.compiler.datamodel.YangRelativePath;
 import org.onosproject.yang.compiler.datamodel.YangResolutionInfo;
+import org.onosproject.yang.compiler.datamodel.YangSchemaNode;
 import org.onosproject.yang.compiler.datamodel.YangType;
 import org.onosproject.yang.compiler.datamodel.YangTypeDef;
 import org.onosproject.yang.compiler.datamodel.YangUses;
@@ -65,18 +73,28 @@
 import static org.onosproject.yang.compiler.datamodel.TraversalType.PARENT;
 import static org.onosproject.yang.compiler.datamodel.TraversalType.ROOT;
 import static org.onosproject.yang.compiler.datamodel.TraversalType.SIBILING;
+import static org.onosproject.yang.compiler.datamodel.YangNode.cloneSubTree;
 import static org.onosproject.yang.compiler.datamodel.YangPathArgType.ABSOLUTE_PATH;
 import static org.onosproject.yang.compiler.datamodel.YangPathArgType.RELATIVE_PATH;
 import static org.onosproject.yang.compiler.datamodel.exceptions.ErrorMessages.getErrorMsg;
 import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.addResolutionInfo;
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.deleteUnsupportedLeafOrLeafList;
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.deleteUnsupportedNodeFromTree;
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.findLeafNode;
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.updateDeviateAddToTargetNode;
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.updateDeviateDeleteToTargetNode;
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.updateDeviateReplaceToTargetNode;
 import static org.onosproject.yang.compiler.datamodel.utils.ResolvableStatus.INTER_FILE_LINKED;
 import static org.onosproject.yang.compiler.datamodel.utils.ResolvableStatus.INTRA_FILE_RESOLVED;
 import static org.onosproject.yang.compiler.datamodel.utils.ResolvableStatus.LINKED;
 import static org.onosproject.yang.compiler.datamodel.utils.ResolvableStatus.RESOLVED;
 import static org.onosproject.yang.compiler.datamodel.utils.ResolvableStatus.UNDEFINED;
 import static org.onosproject.yang.compiler.datamodel.utils.ResolvableStatus.UNRESOLVED;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.LEAF_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.LEAF_LIST_DATA;
 import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.PATH_DATA;
 import static org.onosproject.yang.compiler.linker.impl.XpathLinkingTypes.AUGMENT_LINKING;
+import static org.onosproject.yang.compiler.linker.impl.XpathLinkingTypes.DEVIATION_LINKING;
 import static org.onosproject.yang.compiler.linker.impl.XpathLinkingTypes.LEAF_REF_LINKING;
 import static org.onosproject.yang.compiler.linker.impl.YangLinkerUtils.detectCollisionForAugmentedNode;
 import static org.onosproject.yang.compiler.linker.impl.YangLinkerUtils.fillPathPredicates;
@@ -87,6 +105,7 @@
 import static org.onosproject.yang.compiler.linker.impl.YangLinkerUtils.skipInvalidDataNodes;
 import static org.onosproject.yang.compiler.utils.UtilConstants.EMPTY_STRING;
 import static org.onosproject.yang.compiler.utils.UtilConstants.FAILED_TO_FIND_ANNOTATION;
+import static org.onosproject.yang.compiler.utils.UtilConstants.FAILED_TO_FIND_DEVIATION;
 import static org.onosproject.yang.compiler.utils.UtilConstants.FAILED_TO_FIND_LEAD_INFO_HOLDER;
 import static org.onosproject.yang.compiler.utils.UtilConstants.FAILED_TO_LINK;
 import static org.onosproject.yang.compiler.utils.UtilConstants.INVALID_ENTITY;
@@ -1094,10 +1113,227 @@
                 ex.setFileName(leafRef.getFileName());
                 throw ex;
             }
+        } else if (entityToResolve instanceof YangDeviation) {
+            YangDeviation deviation = (YangDeviation) entityToResolve;
+            List<YangAtomicPath> path = deviation.getTargetNode();
+            YangAtomicPath targetPath = path.get(path.size() - 1);
+            YangSchemaNode target = findDeviationTarget(entityToResolve, root,
+                                                        xPathLinker);
+
+            if (deviation.isDeviateNotSupported()) {
+                resolveDeviationNotSupported(target, targetPath);
+            } else {
+                List<YangDeviateAdd> deviateAddList = deviation.getDeviateAdd();
+
+                if (deviateAddList != null && !deviateAddList.isEmpty()) {
+                    resolveDeviateAdd(deviateAddList, target, targetPath);
+                }
+
+                List<YangDeviateDelete> deviateDeleteList = deviation
+                        .getDeviateDelete();
+                if (deviateDeleteList != null && !deviateDeleteList.isEmpty()) {
+                    resolveDeviateDelete(deviateDeleteList, target, targetPath);
+                }
+
+                List<YangDeviateReplace> deviateReplaceList = deviation
+                        .getDeviateReplace();
+                if (deviateReplaceList != null && !deviateReplaceList.isEmpty()) {
+                    resolveDeviateReplace(deviateReplaceList, target, targetPath);
+                }
+            }
+
+            Resolvable resolvable = (Resolvable) entityToResolve;
+            resolvable.setResolvableStatus(RESOLVED);
         }
     }
 
     /**
+     * Adds deviate add sub-statements to deviation target node.
+     *
+     * @param deviateAddList list of deviate add
+     * @param target         deviation target node
+     * @param targetPath     deviation target's last node
+     * @throws DataModelException if there is a data model error
+     */
+    private void resolveDeviateAdd(List<YangDeviateAdd> deviateAddList,
+                                   YangSchemaNode target,
+                                   YangAtomicPath targetPath)
+            throws DataModelException {
+        for (YangDeviateAdd deviate : deviateAddList) {
+            if (target.getName().equals(targetPath.getNodeIdentifier().getName())) {
+                updateDeviateAddToTargetNode(target, deviate);
+            } else {
+                YangSchemaNode leaf = findLeafNode((YangLeavesHolder) target, targetPath
+                        .getNodeIdentifier().getName());
+                updateDeviateAddToTargetNode(leaf, deviate);
+            }
+        }
+    }
+
+    /**
+     * Removes deviate delete sub-statements from deviation target node.
+     *
+     * @param deviateDeleteList list of deviate delete
+     * @param target            deviation target node
+     * @param targetPath        deviation target's last node
+     * @throws DataModelException if there is a data model error
+     */
+    private void resolveDeviateDelete(List<YangDeviateDelete>
+                                              deviateDeleteList,
+                                      YangSchemaNode target,
+                                      YangAtomicPath targetPath)
+            throws DataModelException {
+        for (YangDeviateDelete deviate : deviateDeleteList) {
+            if (target.getName().equals(targetPath.getNodeIdentifier().getName())) {
+                updateDeviateDeleteToTargetNode(target, deviate);
+            } else {
+                YangSchemaNode leaf = findLeafNode((YangLeavesHolder) target, targetPath
+                        .getNodeIdentifier().getName());
+                updateDeviateDeleteToTargetNode(leaf, deviate);
+            }
+        }
+    }
+
+    /**
+     * Replaces deviate replace sub-statements from deviation target node.
+     *
+     * @param deviateReplaceList list of deviate replace
+     * @param target             deviation target node
+     * @param targetPath         deviation target's last node
+     * @throws DataModelException if there is a data model error
+     */
+    private void resolveDeviateReplace(List<YangDeviateReplace>
+                                               deviateReplaceList,
+                                       YangSchemaNode target,
+                                       YangAtomicPath targetPath)
+            throws DataModelException {
+        for (YangDeviateReplace deviate : deviateReplaceList) {
+            if (target.getName().equals(targetPath.getNodeIdentifier().getName())) {
+                updateDeviateReplaceToTargetNode(target, deviate);
+            } else {
+                YangSchemaNode leaf = findLeafNode((YangLeavesHolder) target, targetPath
+                        .getNodeIdentifier().getName());
+                updateDeviateReplaceToTargetNode(leaf, deviate);
+            }
+        }
+    }
+
+    /**
+     * Removes deviation target node from cloned data model.
+     *
+     * @param target     deviation target node
+     * @param targetPath deviation target's last node
+     */
+    private void resolveDeviationNotSupported(YangSchemaNode target,
+                                              YangAtomicPath targetPath) {
+        if (target.getName().equals(targetPath.getNodeIdentifier().getName())) {
+            deleteUnsupportedNodeFromTree((YangNode) target);
+        } else {
+            deleteUnsupportedLeafOrLeafList((YangLeavesHolder) target,
+                                            targetPath.getNodeIdentifier().getName());
+        }
+    }
+
+    /**
+     * Returns the cloned node of deviation target node.
+     *
+     * @param entityToResolve entity to resolve
+     * @param root            root node
+     * @param xPathLinker     xpath Linker
+     * @throws DataModelException if there is a data model error
+     */
+    private YangSchemaNode findDeviationTarget(T entityToResolve,
+                                               YangReferenceResolver root,
+                                               YangXpathLinker<T> xPathLinker)
+            throws DataModelException {
+
+        YangNode targetNode;
+        YangDeviation deviation = (YangDeviation) entityToResolve;
+        List<YangAtomicPath> path = deviation.getTargetNode();
+        targetNode = xPathLinker.processXpathLinking(path, (YangNode) root,
+                                                     DEVIATION_LINKING);
+
+        if (targetNode != null) {
+            YangNode clonedNode = cloneDeviatedModuleNode(targetNode, deviation);
+            return xPathLinker.parsePath(clonedNode);
+        } else {
+            throw new LinkerException(getErrorMsg(
+                    FAILED_TO_FIND_DEVIATION, deviation.getName(),
+                    deviation.getLineNumber(), deviation.getCharPosition(),
+                    deviation.getFileName()));
+        }
+    }
+
+    /**
+     * Returns the cloned node of deviation target node.
+     *
+     * @param targetNode deviation target node
+     * @param deviation  YANG deviation node
+     * @throws DataModelException if there is a data model error
+     */
+    private YangNode cloneDeviatedModuleNode(YangNode targetNode,
+                                             YangDeviation deviation)
+            throws DataModelException {
+
+        // get Root node of target schema
+        while (targetNode.getParent() != null) {
+            targetNode = targetNode.getParent();
+        }
+        YangNode srcNode = targetNode;
+        YangNode dstNode = deviation.getParent();
+
+        if (((YangDeviationHolder) dstNode).isDeviatedNodeCloned()) {
+            // Target Node is already cloned, no need to clone again
+            return dstNode;
+        }
+
+        // clone leaf and leaf-list of root level
+        YangLeavesHolder destLeafHolder = (YangLeavesHolder) dstNode;
+        YangLeavesHolder srcLeafHolder = (YangLeavesHolder) srcNode;
+        if (srcLeafHolder.getListOfLeaf() != null) {
+            for (YangLeaf leaf : srcLeafHolder.getListOfLeaf()) {
+                YangLeaf clonedLeaf;
+                try {
+                    ((CollisionDetector) dstNode)
+                            .detectCollidingChild(leaf.getName(), LEAF_DATA);
+                    clonedLeaf = leaf.cloneForDeviation();
+                    clonedLeaf.setReferredLeaf(leaf);
+                } catch (CloneNotSupportedException | DataModelException e) {
+                    throw new DataModelException(e.getMessage());
+                }
+
+                clonedLeaf.setContainedIn(destLeafHolder);
+                destLeafHolder.addLeaf(clonedLeaf);
+            }
+        }
+        if (srcLeafHolder.getListOfLeafList() != null) {
+            for (YangLeafList leafList : srcLeafHolder.getListOfLeafList()) {
+                YangLeafList clonedLeafList;
+                try {
+                    ((CollisionDetector) destLeafHolder)
+                            .detectCollidingChild(leafList.getName(), LEAF_LIST_DATA);
+                    clonedLeafList = leafList.cloneForDeviation();
+                    clonedLeafList.setReferredSchemaLeafList(leafList);
+                } catch (CloneNotSupportedException | DataModelException e) {
+                    throw new DataModelException(e.getMessage());
+                }
+                clonedLeafList.setContainedIn(destLeafHolder);
+                destLeafHolder.addLeafList(clonedLeafList);
+            }
+        }
+
+        // clone subtree
+        cloneSubTree(srcNode, dstNode, null, true);
+
+        /*
+         * Cloning of deviated module is done, set isDeviatedNodeCloned
+         * flag as true.
+         */
+        ((YangDeviationHolder) dstNode).setDeviatedNodeCloned(true);
+        return dstNode;
+    }
+
+    /**
      * Returns the referenced prefix of entity under resolution.
      *
      * @return referenced prefix of entity under resolution
diff --git a/compiler/base/linker/src/main/java/org/onosproject/yang/compiler/linker/impl/YangXpathLinker.java b/compiler/base/linker/src/main/java/org/onosproject/yang/compiler/linker/impl/YangXpathLinker.java
index 02d1beb..1579bf1 100644
--- a/compiler/base/linker/src/main/java/org/onosproject/yang/compiler/linker/impl/YangXpathLinker.java
+++ b/compiler/base/linker/src/main/java/org/onosproject/yang/compiler/linker/impl/YangXpathLinker.java
@@ -32,6 +32,7 @@
 import org.onosproject.yang.compiler.datamodel.YangNode;
 import org.onosproject.yang.compiler.datamodel.YangNodeIdentifier;
 import org.onosproject.yang.compiler.datamodel.YangOutput;
+import org.onosproject.yang.compiler.datamodel.YangSchemaNode;
 import org.onosproject.yang.compiler.datamodel.YangSubModule;
 import org.onosproject.yang.compiler.datamodel.YangUses;
 import org.onosproject.yang.compiler.linker.exceptions.LinkerException;
@@ -293,8 +294,7 @@
      * @param root root node
      * @return linked target node
      */
-    private YangNode parsePath(YangNode root) {
-
+    public YangNode parsePath(YangNode root) {
         YangNode tempNode = root;
         Stack<YangNode> linkerStack = new Stack<>();
         Iterator<YangAtomicPath> pathIterator = absPaths.iterator();
@@ -667,7 +667,7 @@
      * @param index    current index of list
      * @return false if target node found
      */
-    private boolean validate(YangNode tempNode, int index) {
+    private boolean validate(YangSchemaNode tempNode, int index) {
 
         int size = absPaths.size();
         if (tempNode != null && index != size) {
@@ -689,7 +689,16 @@
      * @param curNodeId YANG node identifier
      * @return linked target node
      */
-    private YangNode searchTargetNode(YangNode node, YangNodeIdentifier curNodeId) {
+    private YangNode searchTargetNode(YangNode node,
+                                      YangNodeIdentifier curNodeId) {
+
+        if (linkingType == XpathLinkingTypes.DEVIATION_LINKING &&
+                node instanceof YangLeavesHolder) {
+            YangNode targetNode = searchTargetLeaf(node, curNodeId);
+            if (targetNode != null) {
+                return targetNode;
+            }
+        }
 
         if (node != null) {
             node = node.getChild();
@@ -708,12 +717,50 @@
                     !(node instanceof YangUses)) {
                 return node;
             }
+
+            if (linkingType == XpathLinkingTypes.DEVIATION_LINKING &&
+                    node instanceof YangLeavesHolder) {
+                YangNode targetNode = searchTargetLeaf(node, curNodeId);
+                if (targetNode != null) {
+                    return targetNode;
+                }
+            }
             node = node.getNextSibling();
         }
         return null;
     }
 
     /**
+     * Searches target leaf in root node.
+     *
+     * @param node      root node
+     * @param curNodeId YANG node identifier
+     * @return linked target leaf node holder
+     */
+    private YangNode searchTargetLeaf(YangNode node,
+                                      YangNodeIdentifier curNodeId) {
+        YangLeavesHolder holder = (YangLeavesHolder) node;
+        List<YangLeafList> leavesList = holder.getListOfLeafList();
+        if (leavesList != null && !leavesList.isEmpty()) {
+            for (YangLeafList leafList : leavesList) {
+                if (leafList.getName().equals(curNodeId.getName())) {
+                    return node;
+                }
+            }
+        }
+
+        List<YangLeaf> leaves = holder.getListOfLeaf();
+        if (leaves != null && !leaves.isEmpty()) {
+            for (YangLeaf leaf : leaves) {
+                if (leaf.getName().equals(curNodeId.getName())) {
+                    return node;
+                }
+            }
+        }
+        return null;
+    }
+
+    /**
      * Returns root prefix.
      *
      * @param root root node
diff --git a/compiler/base/parser/pom.xml b/compiler/base/parser/pom.xml
index 671bd15..4f2ee4f 100644
--- a/compiler/base/parser/pom.xml
+++ b/compiler/base/parser/pom.xml
@@ -55,7 +55,6 @@
             <version>4.12</version>
             <scope>test</scope>
         </dependency>
-
     </dependencies>
 
     <build>
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/TreeWalkListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/TreeWalkListener.java
index 42fe6ca..babe61e 100644
--- a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/TreeWalkListener.java
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/TreeWalkListener.java
@@ -42,6 +42,10 @@
 import org.onosproject.yang.compiler.parser.impl.listeners.Decimal64Listener;
 import org.onosproject.yang.compiler.parser.impl.listeners.DefaultListener;
 import org.onosproject.yang.compiler.parser.impl.listeners.DescriptionListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.DeviateAddListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.DeviateDeleteListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.DeviateReplaceListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.DeviationListener;
 import org.onosproject.yang.compiler.parser.impl.listeners.EnumListener;
 import org.onosproject.yang.compiler.parser.impl.listeners.EnumerationListener;
 import org.onosproject.yang.compiler.parser.impl.listeners.ErrorAppTagListener;
@@ -1473,14 +1477,12 @@
 
     @Override
     public void enterDeviationStatement(DeviationStatementContext ctx) {
-        increaseUnsupportedYangConstructDepth();
-        ListenerUtil.handleUnsupportedYangConstruct(YangConstructType.DEVIATION_DATA, ctx, UtilConstants.UNSUPPORTED_YANG_CONSTRUCT,
-                                                    getFileName());
+        DeviationListener.processDeviationEntry(this, ctx);
     }
 
     @Override
     public void exitDeviationStatement(DeviationStatementContext ctx) {
-        decreaseUnsupportedYangConstructDepth();
+        DeviationListener.processDeviationExit(this, ctx);
     }
 
     @Override
@@ -1495,32 +1497,32 @@
 
     @Override
     public void enterDeviateAddStatement(DeviateAddStatementContext ctx) {
-        // do nothing.
+        DeviateAddListener.processDeviateAddEntry(this, ctx);
     }
 
     @Override
     public void exitDeviateAddStatement(DeviateAddStatementContext ctx) {
-        // do nothing.
+        DeviateAddListener.processDeviateAddExit(this, ctx);
     }
 
     @Override
     public void enterDeviateDeleteStatement(DeviateDeleteStatementContext ctx) {
-        // do nothing.
+        DeviateDeleteListener.processDeviateDeleteEntry(this, ctx);
     }
 
     @Override
     public void exitDeviateDeleteStatement(DeviateDeleteStatementContext ctx) {
-        // do nothing.
+        DeviateDeleteListener.processDeviateDeleteExit(this, ctx);
     }
 
     @Override
     public void enterDeviateReplaceStatement(DeviateReplaceStatementContext ctx) {
-        // do nothing.
+        DeviateReplaceListener.processDeviateReplaceEntry(this, ctx);
     }
 
     @Override
     public void exitDeviateReplaceStatement(DeviateReplaceStatementContext ctx) {
-        // do nothing.
+        DeviateReplaceListener.processDeviateReplaceExit(this, ctx);
     }
 
     @Override
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ConfigListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ConfigListener.java
index 186e1c8..6c6b8da 100644
--- a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ConfigListener.java
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ConfigListener.java
@@ -16,28 +16,6 @@
 
 package org.onosproject.yang.compiler.parser.impl.listeners;
 
-import org.onosproject.yang.compiler.datamodel.YangContainer;
-import org.onosproject.yang.compiler.datamodel.YangLeaf;
-import org.onosproject.yang.compiler.datamodel.YangLeafList;
-import org.onosproject.yang.compiler.datamodel.YangList;
-import org.onosproject.yang.compiler.datamodel.utils.Parsable;
-import org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser;
-import org.onosproject.yang.compiler.parser.exceptions.ParserException;
-import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
-import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorLocation;
-import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorMessageConstruction;
-import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType;
-import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil;
-import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation;
-
-import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.CONFIG_DATA;
-import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
-import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
-import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
-import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
-import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil.getValidBooleanValue;
-import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
-
 /*
  * Reference: RFC6020 and YANG ANTLR Grammar
  *
@@ -53,6 +31,20 @@
  * config          : string;
  */
 
+import org.onosproject.yang.compiler.datamodel.YangConfig;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.CONFIG_DATA;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil.getValidBooleanValue;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
 /**
  * Represents listener based call back function corresponding to the "config"
  * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
@@ -78,30 +70,17 @@
         // Check for stack to be non empty.
         checkStackIsNotEmpty(listener, MISSING_HOLDER, CONFIG_DATA, "", ENTRY);
 
-        boolean isConfig = getValidBooleanValue(ctx.config().getText(), CONFIG_DATA, ctx);
+        boolean isConfig = getValidBooleanValue(ctx.config().getText(),
+                                                CONFIG_DATA, ctx);
 
         Parsable tmpData = listener.getParsedDataStack().peek();
-        switch (tmpData.getYangConstructType()) {
-            case LEAF_DATA:
-                YangLeaf leaf = (YangLeaf) tmpData;
-                leaf.setConfig(isConfig);
-                break;
-            case CONTAINER_DATA:
-                YangContainer container = (YangContainer) tmpData;
-                container.setConfig(isConfig);
-                break;
-            case LEAF_LIST_DATA:
-                YangLeafList leafList = (YangLeafList) tmpData;
-                leafList.setConfig(isConfig);
-                break;
-            case LIST_DATA:
-                YangList yangList = (YangList) tmpData;
-                yangList.setConfig(isConfig);
-                break;
-            case CHOICE_DATA: // TODO
-                break;
-            default:
-                throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, CONFIG_DATA, "", ENTRY));
+        if (tmpData instanceof YangConfig) {
+            YangConfig config = ((YangConfig) tmpData);
+            config.setConfig(isConfig);
+        } else {
+            throw new ParserException(
+                    constructListenerErrorMessage(INVALID_HOLDER,
+                                                  CONFIG_DATA, "", ENTRY));
         }
     }
 }
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DefaultListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DefaultListener.java
index 0000aff..043cacd 100644
--- a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DefaultListener.java
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DefaultListener.java
@@ -39,9 +39,7 @@
  * defaultStatement : DEFAULT_KEYWORD string STMTEND;
  */
 
-import org.onosproject.yang.compiler.datamodel.YangChoice;
-import org.onosproject.yang.compiler.datamodel.YangLeaf;
-import org.onosproject.yang.compiler.datamodel.YangTypeDef;
+import org.onosproject.yang.compiler.datamodel.YangDefault;
 import org.onosproject.yang.compiler.datamodel.utils.Parsable;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
 import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
@@ -77,28 +75,20 @@
                                            DefaultStatementContext ctx) {
 
         // Check for stack to be non empty.
-        checkStackIsNotEmpty(listener, MISSING_HOLDER, DEFAULT_DATA, ctx.string().getText(), ENTRY);
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, DEFAULT_DATA,
+                             ctx.string().getText(), ENTRY);
+        String value = removeQuotesAndHandleConcat(ctx.string().getText());
 
         Parsable tmpNode = listener.getParsedDataStack().peek();
-        switch (tmpNode.getYangConstructType()) {
-            case TYPEDEF_DATA: {
-                YangTypeDef typeDef = (YangTypeDef) tmpNode;
-                typeDef.setDefaultValueInString(removeQuotesAndHandleConcat(ctx.string().getText()));
-                break;
-            }
-            case LEAF_DATA: {
-                YangLeaf leaf = (YangLeaf) tmpNode;
-                leaf.setDefaultValueInString(removeQuotesAndHandleConcat(ctx.string().getText()));
-                break;
-            }
-            case CHOICE_DATA: {
-                YangChoice choice = (YangChoice) tmpNode;
-                choice.setDefaultValueInString(removeQuotesAndHandleConcat(ctx.string().getText()));
-                break;
-            }
-            default:
-                throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER,
-                                                                        DEFAULT_DATA, ctx.string().getText(), ENTRY));
+        if (tmpNode instanceof YangDefault) {
+            YangDefault defaultHolder = ((YangDefault) tmpNode);
+            defaultHolder.setDefaultValueInString(value);
+        } else {
+            throw new ParserException(
+                    constructListenerErrorMessage(INVALID_HOLDER,
+                                                  DEFAULT_DATA,
+                                                  ctx.string().getText(),
+                                                  ENTRY));
         }
     }
 }
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DeviateAddListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DeviateAddListener.java
new file mode 100644
index 0000000..1e78332
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DeviateAddListener.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.compiler.parser.impl.listeners;
+
+
+import org.onosproject.yang.compiler.datamodel.YangDeviateAdd;
+import org.onosproject.yang.compiler.datamodel.YangDeviation;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DEVIATE_ADD;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *
+ *  deviate-add-stmt    = deviate-keyword sep add-keyword optsep
+ *                        (";" /
+ *                         "{" stmtsep
+ *                             [units-stmt stmtsep]
+ *                             *(must-stmt stmtsep)
+ *                             *(unique-stmt stmtsep)
+ *                             [default-stmt stmtsep]
+ *                             [config-stmt stmtsep]
+ *                             [mandatory-stmt stmtsep]
+ *                             [min-elements-stmt stmtsep]
+ *                             [max-elements-stmt stmtsep]
+ *                         "}")
+ *
+ * ANTLR grammar rule
+ *   deviateAddStatement: DEVIATE_KEYWORD ADD_KEYWORD (STMTEND
+ *           | LEFT_CURLY_BRACE (unitsStatement | mustStatement
+ *           | uniqueStatement| defaultStatement| configStatement
+ *           | mandatoryStatement | minElementsStatement
+ *           | maxElementsStatement)*
+ *           RIGHT_CURLY_BRACE);
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "deviate
+ * add" rule defined in ANTLR grammar file for corresponding ABNF rule in RFC
+ * 6020.
+ */
+public final class DeviateAddListener {
+
+    //No instantiation
+    private DeviateAddListener() {
+    }
+
+    /**
+     * Performs validation and updates the data model tree. It is called when
+     * parser receives an input matching the grammar rule(deviate add).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processDeviateAddEntry(TreeWalkListener listener,
+                                              GeneratedYangParser.DeviateAddStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, DEVIATE_ADD, null, ENTRY);
+
+        // TODO : Validate sub-statements cardinality
+
+        Parsable curData = listener.getParsedDataStack().peek();
+        if (curData instanceof YangDeviation) {
+            YangDeviation curNode = (YangDeviation) curData;
+            YangDeviateAdd deviationAdd = new YangDeviateAdd();
+            curNode.addDeviateAdd(deviationAdd);
+            listener.getParsedDataStack().push(deviationAdd);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER,
+                                                                    DEVIATE_ADD,
+                                                                    null,
+                                                                    ENTRY));
+        }
+    }
+
+    /**
+     * Performs validation and updates the data model tree. It is called when
+     * parser exits from grammar rule (deviate add).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processDeviateAddExit(TreeWalkListener listener,
+                                             GeneratedYangParser.DeviateAddStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, DEVIATE_ADD, null,
+                             EXIT);
+
+        if (listener.getParsedDataStack().peek() instanceof YangDeviateAdd) {
+            listener.getParsedDataStack().pop();
+        } else {
+            throw new ParserException(constructListenerErrorMessage
+                                              (MISSING_CURRENT_HOLDER, DEVIATE_ADD,
+                                               null, EXIT));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DeviateDeleteListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DeviateDeleteListener.java
new file mode 100644
index 0000000..2c84791
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DeviateDeleteListener.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.compiler.parser.impl.listeners;
+
+
+import org.onosproject.yang.compiler.datamodel.YangDeviateDelete;
+import org.onosproject.yang.compiler.datamodel.YangDeviation;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DEVIATE_DELETE;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *
+ *  deviate-delete-stmt = deviate-keyword sep delete-keyword optsep
+ *                        (";" /
+ *                         "{" stmtsep
+ *                             [units-stmt stmtsep]
+ *                             *(must-stmt stmtsep)
+ *                             *(unique-stmt stmtsep)
+ *                               [default-stmt stmtsep]
+ *                           "}")
+ *
+ * ANTLR grammar rule
+ *   deviateDeleteStatement: DEVIATE_KEYWORD DELETE_KEYWORD (STMTEND
+ *           | LEFT_CURLY_BRACE (unitsStatement | mustStatement |
+ *           uniqueStatement | defaultStatement)* RIGHT_CURLY_BRACE);
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "deviate
+ * delete" rule defined in ANTLR grammar file for corresponding ABNF rule in RFC
+ * 6020.
+ */
+public final class DeviateDeleteListener {
+
+    // No instantiation
+    private DeviateDeleteListener() {
+    }
+
+    /**
+     * Performs validation and updates the data model tree. It is called when
+     * parser receives an input matching the grammar rule(deviate delete).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processDeviateDeleteEntry(TreeWalkListener listener,
+                                                 GeneratedYangParser
+                                                         .DeviateDeleteStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, DEVIATE_DELETE,
+                             null, ENTRY);
+
+        // TODO : Validate sub-statements cardinality
+
+        Parsable curData = listener.getParsedDataStack().peek();
+        if (curData instanceof YangDeviation) {
+            YangDeviation curNode = (YangDeviation) curData;
+            YangDeviateDelete deviateDelete = new YangDeviateDelete();
+            curNode.addDeviatedelete(deviateDelete);
+            listener.getParsedDataStack().push(deviateDelete);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER,
+                                                                    DEVIATE_DELETE,
+                                                                    null,
+                                                                    ENTRY));
+        }
+    }
+
+    /**
+     * Performs validation and updates the data model tree. It is called when
+     * parser exits from grammar rule (deviate delete).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processDeviateDeleteExit(TreeWalkListener listener,
+                                                GeneratedYangParser
+                                                        .DeviateDeleteStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, DEVIATE_DELETE, null,
+                             EXIT);
+
+        if (listener.getParsedDataStack().peek() instanceof YangDeviateDelete) {
+            listener.getParsedDataStack().pop();
+        } else {
+            throw new ParserException(constructListenerErrorMessage
+                                              (MISSING_CURRENT_HOLDER, DEVIATE_DELETE,
+                                               null, EXIT));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DeviateReplaceListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DeviateReplaceListener.java
new file mode 100644
index 0000000..962aa60
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DeviateReplaceListener.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.compiler.parser.impl.listeners;
+
+import org.onosproject.yang.compiler.datamodel.YangDeviateReplace;
+import org.onosproject.yang.compiler.datamodel.YangDeviation;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DEVIATE_REPLACE;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *
+ *   deviate-replace-stmt = deviate-keyword sep replace-keyword optsep
+ *                         (";" /
+ *                          "{" stmtsep
+ *                              [type-stmt stmtsep]
+ *                              [units-stmt stmtsep]
+ *                              [default-stmt stmtsep]
+ *                              [config-stmt stmtsep]
+ *                              [mandatory-stmt stmtsep]
+ *                              [min-elements-stmt stmtsep]
+ *                              [max-elements-stmt stmtsep]
+ *                          "}")
+ *
+ * ANTLR grammar rule
+ *   deviateReplaceStatement: DEVIATE_KEYWORD REPLACE_KEYWORD (STMTEND
+ *           | LEFT_CURLY_BRACE (typeStatement | unitsStatement
+ *           | defaultStatement | configStatement
+ *           | mandatoryStatement | minElementsStatement
+ *           | maxElementsStatement)* RIGHT_CURLY_BRACE);
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "deviate
+ * replace" rule defined in ANTLR grammar file for corresponding ABNF rule in
+ * RFC 6020.
+ */
+public final class DeviateReplaceListener {
+
+    //No instantiation
+    private DeviateReplaceListener() {
+    }
+
+    /**
+     * Performs validation and updates the data model tree. It is called when
+     * parser receives an input matching the grammar rule(deviate replace).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processDeviateReplaceEntry(TreeWalkListener listener,
+                                                  GeneratedYangParser
+                                                          .DeviateReplaceStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, DEVIATE_REPLACE,
+                             null, ENTRY);
+
+        // TODO : Validate sub-statements cardinality
+
+        Parsable curData = listener.getParsedDataStack().peek();
+        if (curData instanceof YangDeviation) {
+            YangDeviation curNode = (YangDeviation) curData;
+            YangDeviateReplace deviationReplace = new YangDeviateReplace();
+            curNode.addDeviateReplace(deviationReplace);
+            listener.getParsedDataStack().push(deviationReplace);
+        } else {
+            throw new ParserException(constructListenerErrorMessage
+                                              (INVALID_HOLDER,
+                                               DEVIATE_REPLACE,
+                                               null,
+                                               ENTRY));
+        }
+    }
+
+    /**
+     * Performs validation and updates the data model tree. It is called when
+     * parser exits from grammar rule (deviate replace).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processDeviateReplaceExit(TreeWalkListener listener,
+                                                 GeneratedYangParser.DeviateReplaceStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, DEVIATE_REPLACE, null,
+                             EXIT);
+
+        if (listener.getParsedDataStack().peek() instanceof YangDeviateReplace) {
+            listener.getParsedDataStack().pop();
+        } else {
+            throw new ParserException(constructListenerErrorMessage
+                                              (MISSING_CURRENT_HOLDER, DEVIATE_REPLACE,
+                                               null, EXIT));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DeviationListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DeviationListener.java
new file mode 100644
index 0000000..97f9be2
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DeviationListener.java
@@ -0,0 +1,234 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.compiler.parser.impl.listeners;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *
+ *  deviation-stmt      = deviation-keyword sep
+ *                        deviation-arg-str optsep
+ *                        "{" stmtsep
+ *                            ;; these stmts can appear in any order
+ *                            [description-stmt stmtsep]
+ *                            [reference-stmt stmtsep]
+ *                            (deviate-not-supported-stmt /
+ *                              1*(deviate-add-stmt /
+ *                                 deviate-replace-stmt /
+ *                                 deviate-delete-stmt))
+ *                        "}"
+ *
+ * ANTLR grammar rule
+ *   deviationStatement: DEVIATION_KEYWORD deviation LEFT_CURLY_BRACE (
+ *       descriptionStatement | referenceStatement | deviateNotSupportedStatement
+ *      | deviateAddStatement | deviateReplaceStatement
+ *      | deviateDeleteStatement)* RIGHT_CURLY_BRACE;
+ */
+
+import org.onosproject.yang.compiler.datamodel.YangAtomicPath;
+import org.onosproject.yang.compiler.datamodel.YangDeviation;
+import org.onosproject.yang.compiler.datamodel.YangDeviationHolder;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.linker.impl.YangResolutionInfoImpl;
+import org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
+
+import java.util.List;
+
+import static org.onosproject.yang.compiler.datamodel.YangNodeType.DEVIATION_NODE;
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.addResolutionInfo;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DEVIATE_ADD;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DEVIATE_DELETE;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DEVIATE_NOT_SUPPORTED;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DEVIATE_REPLACE;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DEVIATION_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerCollisionDetector.detectCollidingChildUtil;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil.getValidAbsoluteSchemaNodeId;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil.removeQuotesAndHandleConcat;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.validateCardinalityMutuallyExclusive;
+
+/**
+ * Represents listener based call back function corresponding to the "deviation"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class DeviationListener {
+
+    /**
+     * Creates a new deviation listener.
+     */
+    private DeviationListener() {
+    }
+
+    /**
+     * Performs validation and updates the data model tree. It is called when
+     * parser receives an input matching the grammar rule(deviation).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processDeviationEntry(TreeWalkListener listener,
+                                             GeneratedYangParser.DeviationStatementContext ctx) {
+
+        String deviationArg = removeQuotesAndHandleConcat(ctx.deviation().getText());
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, DEVIATION_DATA,
+                             deviationArg, ENTRY);
+
+        // Validates deviation argument string
+        List<YangAtomicPath> targetNode = getValidAbsoluteSchemaNodeId(deviationArg,
+                                                                       DEVIATION_DATA, ctx);
+
+        validateSubStatementsCardinality(ctx);
+
+        // Check for identifier collision
+        int line = ctx.getStart().getLine();
+        int charPositionInLine = ctx.getStart().getCharPositionInLine();
+        detectCollidingChildUtil(listener, line, charPositionInLine,
+                                 deviationArg, DEVIATION_DATA);
+
+        Parsable curData = listener.getParsedDataStack().peek();
+        if (curData instanceof YangDeviationHolder) {
+            YangDeviation deviation = new YangDeviation(DEVIATION_NODE, null);
+            deviation.setName(deviationArg);
+            deviation.setLineNumber(line);
+            deviation.setCharPosition(charPositionInLine);
+            deviation.setFileName(listener.getFileName());
+            deviation.setTargetNode(targetNode);
+            if (!ctx.deviateNotSupportedStatement().isEmpty()) {
+                deviation.setDeviateNotSupported(true);
+            }
+            YangNode curNode = (YangNode) curData;
+            try {
+                curNode.addChild(deviation);
+                ((YangDeviationHolder) curNode).setModuleForDeviation(true);
+            } catch (DataModelException e) {
+                throw new ParserException(
+                        constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                                                              DEVIATION_DATA,
+                                                              deviationArg,
+                                                              ENTRY, e.getMessage()));
+            }
+            listener.getParsedDataStack().push(deviation);
+
+            // Adds resolution info to the list
+            YangResolutionInfoImpl<YangDeviation> info =
+                    new YangResolutionInfoImpl<>(deviation, deviation.getParent(),
+                                                 line, charPositionInLine);
+            addToResolution(info, ctx);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER,
+                                                                    DEVIATION_DATA,
+                                                                    deviationArg,
+                                                                    ENTRY));
+        }
+    }
+
+    /**
+     * Performs validation and updates the data model tree. It is called when
+     * parser exits from grammar rule (deviation).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processDeviationExit(TreeWalkListener listener,
+                                            GeneratedYangParser.DeviationStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, DEVIATION_DATA, ctx
+                .deviation().getText(), EXIT);
+
+        if (listener.getParsedDataStack().peek() instanceof YangDeviation) {
+            listener.getParsedDataStack().pop();
+        } else {
+            throw new ParserException(constructListenerErrorMessage
+                                              (MISSING_CURRENT_HOLDER, DEVIATION_DATA,
+                                               ctx.deviation().getText(), EXIT));
+        }
+    }
+
+    /**
+     * Validates the cardinality of deviation sub-statements as per grammar.
+     *
+     * @param ctx context object of the grammar rule
+     */
+    private static void validateSubStatementsCardinality(GeneratedYangParser
+                                                                 .DeviationStatementContext ctx) {
+        validateCardinalityMaxOne(ctx.descriptionStatement(),
+                                  DESCRIPTION_DATA, DEVIATION_DATA,
+                                  ctx.deviation().getText());
+        validateCardinalityMaxOne(ctx.referenceStatement(), REFERENCE_DATA,
+                                  DEVIATION_DATA, ctx.deviation().getText());
+        validateCardinalityMaxOne(ctx.deviateNotSupportedStatement(),
+                                  DEVIATE_NOT_SUPPORTED,
+                                  DEVIATION_DATA, ctx.deviation().getText());
+        validateCardinalityMutuallyExclusive(ctx.deviateNotSupportedStatement(),
+                                             DEVIATE_NOT_SUPPORTED,
+                                             ctx.deviateAddStatement(),
+                                             DEVIATE_ADD,
+                                             DEVIATION_DATA,
+                                             ctx.deviation().getText(),
+                                             ctx);
+        validateCardinalityMutuallyExclusive(ctx.deviateNotSupportedStatement(),
+                                             DEVIATE_NOT_SUPPORTED,
+                                             ctx.deviateReplaceStatement(),
+                                             DEVIATE_REPLACE,
+                                             DEVIATION_DATA,
+                                             ctx.deviation().getText(),
+                                             ctx);
+        validateCardinalityMutuallyExclusive(ctx.deviateNotSupportedStatement(),
+                                             DEVIATE_NOT_SUPPORTED,
+                                             ctx.deviateDeleteStatement(),
+                                             DEVIATE_DELETE,
+                                             DEVIATION_DATA,
+                                             ctx.deviation().getText(),
+                                             ctx);
+    }
+
+    /**
+     * Add to resolution list.
+     *
+     * @param info resolution info
+     * @param ctx  context object
+     */
+    private static void addToResolution(YangResolutionInfoImpl<YangDeviation> info,
+                                        GeneratedYangParser.DeviationStatementContext ctx) {
+        try {
+            addResolutionInfo(info);
+        } catch (DataModelException e) {
+            throw new ParserException(constructExtendedListenerErrorMessage(
+                    UNHANDLED_PARSED_DATA, DEVIATION_DATA,
+                    ctx.deviation().getText(), EXIT, e.getMessage()));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/MandatoryListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/MandatoryListener.java
index b711592..5f21154 100644
--- a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/MandatoryListener.java
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/MandatoryListener.java
@@ -16,7 +16,7 @@
 
 package org.onosproject.yang.compiler.parser.impl.listeners;
 
-import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangMandatory;
 import org.onosproject.yang.compiler.datamodel.utils.Parsable;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
 import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
@@ -73,18 +73,16 @@
         // Check for stack to be non empty.
         checkStackIsNotEmpty(listener, MISSING_HOLDER, MANDATORY_DATA, "", ENTRY);
 
-        boolean isMandatory = getValidBooleanValue(ctx.mandatory().getText(), MANDATORY_DATA, ctx);
+        boolean isMandatory = getValidBooleanValue(ctx.mandatory().getText(),
+                                                   MANDATORY_DATA, ctx);
 
         Parsable tmpNode = listener.getParsedDataStack().peek();
-        switch (tmpNode.getYangConstructType()) {
-            case LEAF_DATA:
-                YangLeaf leaf = (YangLeaf) tmpNode;
-                leaf.setMandatory(isMandatory);
-                break;
-            case CHOICE_DATA: // TODO
-                break;
-            default:
-                throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, MANDATORY_DATA, "", ENTRY));
+        if (tmpNode instanceof YangMandatory) {
+            YangMandatory yangMandatory = ((YangMandatory) tmpNode);
+            yangMandatory.setMandatory(isMandatory);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(
+                    INVALID_HOLDER, MANDATORY_DATA, "", ENTRY));
         }
     }
 }
\ No newline at end of file
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/MaxElementsListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/MaxElementsListener.java
index ee7f1ef..f46b606 100644
--- a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/MaxElementsListener.java
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/MaxElementsListener.java
@@ -16,9 +16,8 @@
 
 package org.onosproject.yang.compiler.parser.impl.listeners;
 
-import org.onosproject.yang.compiler.datamodel.YangLeafList;
-import org.onosproject.yang.compiler.datamodel.YangList;
 import org.onosproject.yang.compiler.datamodel.YangMaxElement;
+import org.onosproject.yang.compiler.datamodel.YangMaxElementHolder;
 import org.onosproject.yang.compiler.datamodel.utils.Parsable;
 import org.onosproject.yang.compiler.datamodel.utils.YangConstructType;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
@@ -85,17 +84,12 @@
         maxElement.setCharPosition(ctx.getStart().getCharPositionInLine());
         maxElement.setFileName(listener.getFileName());
         Parsable tmpData = listener.getParsedDataStack().peek();
-        switch (tmpData.getYangConstructType()) {
-            case LEAF_LIST_DATA:
-                YangLeafList leafList = (YangLeafList) tmpData;
-                leafList.setMaxElements(maxElement);
-                break;
-            case LIST_DATA:
-                YangList yangList = (YangList) tmpData;
-                yangList.setMaxElements(maxElement);
-                break;
-            default:
-                throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, MAX_ELEMENT_DATA, "", ENTRY));
+        if (tmpData instanceof YangMaxElementHolder) {
+            YangMaxElementHolder holder = ((YangMaxElementHolder) tmpData);
+            holder.setMaxElements(maxElement);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(
+                    INVALID_HOLDER, MAX_ELEMENT_DATA, "", ENTRY));
         }
     }
 
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/MinElementsListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/MinElementsListener.java
index ed80c4c..ed07598 100644
--- a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/MinElementsListener.java
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/MinElementsListener.java
@@ -16,15 +16,11 @@
 
 package org.onosproject.yang.compiler.parser.impl.listeners;
 
-import org.onosproject.yang.compiler.datamodel.YangLeafList;
-import org.onosproject.yang.compiler.datamodel.YangList;
+import org.onosproject.yang.compiler.datamodel.YangMinElementHolder;
 import org.onosproject.yang.compiler.datamodel.YangMinElement;
 import org.onosproject.yang.compiler.datamodel.utils.Parsable;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
 import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
-import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorLocation;
-import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType;
-import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil;
 
 import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.MIN_ELEMENT_DATA;
 import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.MinElementsStatementContext;
@@ -74,9 +70,11 @@
                                                MinElementsStatementContext ctx) {
 
         // Check for stack to be non empty.
-        checkStackIsNotEmpty(listener, MISSING_HOLDER, MIN_ELEMENT_DATA, ctx.minValue().getText(), ENTRY);
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, MIN_ELEMENT_DATA,
+                             ctx.minValue().getText(), ENTRY);
 
-        int minElementValue = getValidNonNegativeIntegerValue(ctx.minValue().getText(), MIN_ELEMENT_DATA, ctx);
+        int minElementValue = getValidNonNegativeIntegerValue(
+                ctx.minValue().getText(), MIN_ELEMENT_DATA, ctx);
 
         YangMinElement minElement = new YangMinElement();
 
@@ -84,19 +82,15 @@
         minElement.setLineNumber(ctx.getStart().getLine());
         minElement.setCharPosition(ctx.getStart().getCharPositionInLine());
         minElement.setFileName(listener.getFileName());
+
         Parsable tmpData = listener.getParsedDataStack().peek();
-        switch (tmpData.getYangConstructType()) {
-            case LEAF_LIST_DATA:
-                YangLeafList leafList = (YangLeafList) tmpData;
-                leafList.setMinElements(minElement);
-                break;
-            case LIST_DATA:
-                YangList yangList = (YangList) tmpData;
-                yangList.setMinElements(minElement);
-                break;
-            default:
-                throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, MIN_ELEMENT_DATA,
-                                                                        ctx.minValue().getText(), ENTRY));
+        if (tmpData instanceof YangMinElementHolder) {
+            YangMinElementHolder holder = ((YangMinElementHolder) tmpData);
+            holder.setMinElements(minElement);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(
+                    INVALID_HOLDER, MIN_ELEMENT_DATA, ctx.minValue().getText(),
+                    ENTRY));
         }
     }
 }
\ No newline at end of file
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ModuleListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ModuleListener.java
index 346e35c..fa3a6f9 100644
--- a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ModuleListener.java
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ModuleListener.java
@@ -35,6 +35,7 @@
 import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_IF_FEATURE;
 import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_LEAFREF;
 import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_USES;
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.validateMultipleDeviationStatement;
 import static org.onosproject.yang.compiler.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
 import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.MODULE_DATA;
 import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ModuleStatementContext;
@@ -148,6 +149,16 @@
             linkerException.setFileName(listener.getFileName());
             throw linkerException;
         }
+
+        /*
+         * Validate whether all deviation statement xpath is referring to same
+         * module
+         */
+        try {
+            validateMultipleDeviationStatement(module);
+        } catch (DataModelException e) {
+            throw new ParserException(e.getMessage());
+        }
     }
 
     private static void throwError(ListenerErrorType type,
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/SubModuleListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/SubModuleListener.java
index 7b18d5b..f1dbf66 100644
--- a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/SubModuleListener.java
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/SubModuleListener.java
@@ -25,12 +25,8 @@
 import org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
 import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
-import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorLocation;
-import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorMessageConstruction;
-import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType;
-import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil;
-import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation;
 
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.validateMultipleDeviationStatement;
 import static org.onosproject.yang.compiler.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
 import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.MODULE_DATA;
 import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.SUB_MODULE_DATA;
@@ -154,5 +150,15 @@
             linkerException.setFileName(listener.getFileName());
             throw linkerException;
         }
+
+        /*
+         * Validate whether all deviation statement xpath is referring to same
+         * module
+         */
+        try {
+            validateMultipleDeviationStatement(subModule);
+        } catch (DataModelException e) {
+            throw new ParserException(e.getMessage());
+        }
     }
 }
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/TypeListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/TypeListener.java
index 0b16af7..7a23e7a 100644
--- a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/TypeListener.java
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/TypeListener.java
@@ -17,6 +17,7 @@
 package org.onosproject.yang.compiler.parser.impl.listeners;
 
 import org.onosproject.yang.compiler.datamodel.YangDerivedInfo;
+import org.onosproject.yang.compiler.datamodel.YangDeviateReplace;
 import org.onosproject.yang.compiler.datamodel.YangLeaf;
 import org.onosproject.yang.compiler.datamodel.YangLeafList;
 import org.onosproject.yang.compiler.datamodel.YangNode;
@@ -32,7 +33,6 @@
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
 import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
 import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType;
-import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil;
 
 import static org.onosproject.yang.compiler.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
 import static org.onosproject.yang.compiler.datamodel.utils.ResolvableStatus.UNRESOLVED;
@@ -247,8 +247,10 @@
                     addToResolutionList(resolutionInfo, ctx);
                 }
                 break;
-            //TODO: deviate replacement statement.
-
+            case DEVIATE_REPLACE:
+                YangDeviateReplace replace = (YangDeviateReplace) tmpData;
+                replace.setDataType(type);
+                break;
             default:
                 throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, TYPE_DATA,
                                                                         ctx.string().getText(), EXIT));
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/UniqueListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/UniqueListener.java
index e222422..c97d272 100644
--- a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/UniqueListener.java
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/UniqueListener.java
@@ -16,15 +16,12 @@
 
 package org.onosproject.yang.compiler.parser.impl.listeners;
 
-import org.onosproject.yang.compiler.datamodel.YangList;
+import org.onosproject.yang.compiler.datamodel.YangUniqueHolder;
 import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
 import org.onosproject.yang.compiler.datamodel.utils.Parsable;
 import org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
 import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
-import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorLocation;
-import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType;
-import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil;
 
 import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.UNIQUE_DATA;
 import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
@@ -33,6 +30,7 @@
 import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
 import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
 import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil.SPACE;
 import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil.removeQuotesAndHandleConcat;
 import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
 
@@ -70,35 +68,43 @@
                                           GeneratedYangParser.UniqueStatementContext ctx) {
 
         // Check for stack to be non empty.
-        checkStackIsNotEmpty(listener, MISSING_HOLDER, UNIQUE_DATA, ctx.unique().getText(), ENTRY);
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, UNIQUE_DATA, ctx.unique()
+                .getText(), ENTRY);
 
         Parsable tmpData = listener.getParsedDataStack().peek();
-        if (listener.getParsedDataStack().peek() instanceof YangList) {
-            YangList yangList = (YangList) tmpData;
-            String tmpUniqueValue = removeQuotesAndHandleConcat(ctx.unique().getText());
+        if (listener.getParsedDataStack().peek() instanceof YangUniqueHolder) {
+            YangUniqueHolder uniqueHolder = (YangUniqueHolder) tmpData;
+            String tmpUniqueValue = removeQuotesAndHandleConcat(
+                    ctx.unique().getText());
 
-            if (tmpUniqueValue.contains(" ")) {
-                String[] uniqueValues = tmpUniqueValue.split(" ");
+            if (tmpUniqueValue.contains(SPACE)) {
+                String[] uniqueValues = tmpUniqueValue.split(SPACE);
                 for (String uniqueValue : uniqueValues) {
                     try {
-                        yangList.addUnique(uniqueValue);
+                        uniqueHolder.addUnique(uniqueValue);
                     } catch (DataModelException e) {
-                        throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
-                                UNIQUE_DATA,
-                                ctx.unique().getText(), ENTRY, e.getMessage()));
+                        throw new ParserException(
+                                constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                                                                      UNIQUE_DATA,
+                                                                      ctx.unique().getText(),
+                                                                      ENTRY, e.getMessage()));
                     }
                 }
             } else {
                 try {
-                    yangList.addUnique(tmpUniqueValue);
+                    uniqueHolder.addUnique(tmpUniqueValue);
                 } catch (DataModelException e) {
-                    throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA, UNIQUE_DATA,
-                            ctx.unique().getText(), ENTRY, e.getMessage()));
+                    throw new ParserException(
+                            constructExtendedListenerErrorMessage(
+                                    UNHANDLED_PARSED_DATA, UNIQUE_DATA,
+                                    ctx.unique().getText(), ENTRY, e.getMessage()));
                 }
             }
         } else {
-            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, UNIQUE_DATA, ctx.unique().getText(),
-                    ENTRY));
+            throw new ParserException(
+                    constructListenerErrorMessage(INVALID_HOLDER, UNIQUE_DATA,
+                                                  ctx.unique().getText(),
+                                                  ENTRY));
         }
     }
 }
\ No newline at end of file
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/UnitsListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/UnitsListener.java
index f8db2cf..b5eb1f7 100644
--- a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/UnitsListener.java
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/UnitsListener.java
@@ -16,12 +16,15 @@
 
 package org.onosproject.yang.compiler.parser.impl.listeners;
 
+import org.onosproject.yang.compiler.datamodel.YangDeviateAdd;
+import org.onosproject.yang.compiler.datamodel.YangDeviateDelete;
+import org.onosproject.yang.compiler.datamodel.YangDeviateReplace;
 import org.onosproject.yang.compiler.datamodel.YangLeaf;
 import org.onosproject.yang.compiler.datamodel.YangLeafList;
+import org.onosproject.yang.compiler.datamodel.YangTypeDef;
 import org.onosproject.yang.compiler.datamodel.utils.Parsable;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
 import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
-import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType;
 
 import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.UNITS_DATA;
 import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.UnitsStatementContext;
@@ -78,11 +81,27 @@
                 leafList.setUnits(ctx.string().getText());
                 break;
             case TYPEDEF_DATA:
-                // TODO
+                YangTypeDef typeDef = (YangTypeDef) tmpData;
+                typeDef.setUnits(ctx.string().getText());
+                break;
+            case DEVIATE_ADD:
+                YangDeviateAdd deviateAdd = (YangDeviateAdd) tmpData;
+                deviateAdd.setUnits(ctx.string().getText());
+                break;
+            case DEVIATE_DELETE:
+                YangDeviateDelete deviateDelete = (YangDeviateDelete) tmpData;
+                deviateDelete.setUnits(ctx.string().getText());
+                break;
+            case DEVIATE_REPLACE:
+                YangDeviateReplace replace = (YangDeviateReplace) tmpData;
+                replace.setUnits(ctx.string().getText());
                 break;
             default:
-                throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, UNITS_DATA,
-                                ctx.string().getText(), ENTRY));
+                throw new ParserException(
+                        constructListenerErrorMessage(INVALID_HOLDER,
+                                                      UNITS_DATA,
+                                                      ctx.string().getText(),
+                                                      ENTRY));
         }
     }
 }
\ No newline at end of file
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerUtil.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerUtil.java
index e71eb98..328b6bc 100644
--- a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerUtil.java
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerUtil.java
@@ -90,6 +90,7 @@
     private static final String DATE_FORMAT = "yyyy-MM-dd";
     private static final String REGEX_EQUAL = "[=]";
     private static final String REGEX_OPEN_BRACE = "[(]";
+    public static final String SPACE = " ";
 
     // No instantiation.
     private ListenerUtil() {
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerValidation.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerValidation.java
index eeb1dc9..4b45fcd 100644
--- a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerValidation.java
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerValidation.java
@@ -240,4 +240,38 @@
             throw parserException;
         }
     }
+
+    /**
+     * Checks if a either of one construct occurrence.
+     *
+     * @param ctx1       first optional child's context
+     * @param type1      first child construct for whom cardinality is
+     *                   to be validated
+     * @param ctx2       second optional child's context
+     * @param type2      second child construct for whom cardinality is
+     *                   to be validated
+     * @param type       parent construct
+     * @param parentName parent name
+     * @param ctx        parents's context
+     * @throws ParserException exception if cardinality check fails
+     */
+    public static void validateCardinalityMutuallyExclusive(List<?> ctx1,
+                                                            YangConstructType type1,
+                                                            List<?> ctx2,
+                                                            YangConstructType type2,
+                                                            YangConstructType type,
+                                                            String parentName,
+                                                            ParserRuleContext ctx)
+            throws ParserException {
+
+        if (!ctx1.isEmpty() && !ctx2.isEmpty()) {
+            String error = "YANG file error: Either " + getYangConstructType(type1)
+                    + " or " + getYangConstructType(type2) + " should be present in "
+                    + getYangConstructType(type) + " " + parentName + ".";
+            ParserException parserException = new ParserException(error);
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+    }
 }
diff --git a/compiler/base/parser/src/main/resources/GeneratedYang.g4 b/compiler/base/parser/src/main/resources/GeneratedYang.g4
index 3ba1201..af16c05 100644
--- a/compiler/base/parser/src/main/resources/GeneratedYang.g4
+++ b/compiler/base/parser/src/main/resources/GeneratedYang.g4
@@ -1207,9 +1207,12 @@
      *                             [max-elements-stmt stmtsep]
      *                         "}")
      */
-    deviateAddStatement: DEVIATE_KEYWORD ADD_KEYWORD (STMTEND | (LEFT_CURLY_BRACE unitsStatement? mustStatement* uniqueStatement*
-                      defaultStatement? configStatement? mandatoryStatement? minElementsStatement? maxElementsStatement?
-                      RIGHT_CURLY_BRACE));
+    deviateAddStatement: DEVIATE_KEYWORD ADD_KEYWORD (STMTEND
+                       | LEFT_CURLY_BRACE (unitsStatement | mustStatement
+                         | uniqueStatement| defaultStatement| configStatement
+                         | mandatoryStatement | minElementsStatement
+                         | maxElementsStatement)*
+                       RIGHT_CURLY_BRACE);
 
     /**
      *  deviate-delete-stmt = deviate-keyword sep delete-keyword optsep
@@ -1222,7 +1225,8 @@
      *                           "}")
      */
     deviateDeleteStatement: DEVIATE_KEYWORD DELETE_KEYWORD (STMTEND
-                       | (LEFT_CURLY_BRACE  unitsStatement? mustStatement* uniqueStatement* defaultStatement? RIGHT_CURLY_BRACE));
+                       | LEFT_CURLY_BRACE (unitsStatement | mustStatement |
+                       uniqueStatement | defaultStatement)* RIGHT_CURLY_BRACE);
 
     /**
      *   deviate-replace-stmt = deviate-keyword sep replace-keyword optsep
@@ -1237,9 +1241,11 @@
      *                              [max-elements-stmt stmtsep]
      *                          "}")
      */
-    deviateReplaceStatement: DEVIATE_KEYWORD REPLACE_KEYWORD (STMTEND | (LEFT_CURLY_BRACE typeStatement? unitsStatement?
-                           defaultStatement? configStatement? mandatoryStatement? minElementsStatement?
-                           maxElementsStatement? RIGHT_CURLY_BRACE));
+    deviateReplaceStatement: DEVIATE_KEYWORD REPLACE_KEYWORD (STMTEND
+                           | LEFT_CURLY_BRACE (typeStatement | unitsStatement
+                             | defaultStatement | configStatement
+                             | mandatoryStatement | minElementsStatement
+                             | maxElementsStatement)* RIGHT_CURLY_BRACE);
 
     /**
      *   compiler-annotation-stmt = prefix:compiler-annotation-keyword string
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/DeviationListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/DeviationListenerTest.java
new file mode 100644
index 0000000..cca24d1
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/DeviationListenerTest.java
@@ -0,0 +1,212 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.compiler.parser.impl.listeners;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.onosproject.yang.compiler.datamodel.YangAtomicPath;
+import org.onosproject.yang.compiler.datamodel.YangDeviateAdd;
+import org.onosproject.yang.compiler.datamodel.YangDeviateDelete;
+import org.onosproject.yang.compiler.datamodel.YangDeviateReplace;
+import org.onosproject.yang.compiler.datamodel.YangDeviation;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.List;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+import static org.onosproject.yang.compiler.datamodel.YangNodeType.MODULE_NODE;
+import static org.onosproject.yang.compiler.datamodel.utils.ResolvableStatus.UNRESOLVED;
+import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.INT8;
+
+/**
+ * Test cases for testing deviation listener.
+ */
+public class DeviationListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks deviation statement as sub-statement of module.
+     */
+    @Test
+    public void processDeviationNotSupported() throws IOException,
+            ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/" +
+                                                     "ValidDeviationNotSupported.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the container is child of module
+        YangDeviation deviation = (YangDeviation) yangNode.getChild();
+        assertThat(deviation.getName(), is("/base:system/base:daytime"));
+        assertThat(deviation.getDescription(), is("\"desc\""));
+        assertThat(deviation.getReference(), is("\"ref\""));
+        assertThat(deviation.isDeviateNotSupported(), is(true));
+        List<YangAtomicPath> targetNode = deviation.getTargetNode();
+        assertThat(targetNode.get(0).getNodeIdentifier().getName(),
+                   is("system"));
+        assertThat(targetNode.get(1).getNodeIdentifier().getName(),
+                   is("daytime"));
+        assertThat(targetNode.get(0).getNodeIdentifier().getPrefix(),
+                   is("base"));
+        assertThat(deviation.getResolvableStatus(), is(UNRESOLVED));
+    }
+
+    /**
+     * Checks deviation add statement as sub-statement of module.
+     */
+    @Test
+    public void processDeviationAddStatement() throws IOException,
+            ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/" +
+                                                     "ValidDeviateAdd.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangDeviation deviation = (YangDeviation) yangNode.getChild();
+        assertThat(deviation.getName(), is("/base:system/base:user/base:type"));
+        assertThat(deviation.isDeviateNotSupported(), is(false));
+        List<YangAtomicPath> targetNode = deviation.getTargetNode();
+        assertThat(targetNode.get(0).getNodeIdentifier().getName(),
+                   is("system"));
+        assertThat(targetNode.get(0).getNodeIdentifier().getPrefix(),
+                   is("base"));
+        assertThat(targetNode.get(1).getNodeIdentifier().getName(),
+                   is("user"));
+        assertThat(targetNode.get(2).getNodeIdentifier().getName(),
+                   is("type"));
+
+        YangDeviateAdd deviateAdd = deviation.getDeviateAdd().get(0);
+        assertThat(deviateAdd.getUnits(), is("\"units\""));
+        assertThat(deviateAdd.getListOfMust().get(0).getConstraint(),
+                   is("/base:system"));
+        assertThat(deviateAdd.getUniqueList().get(0), is("id"));
+        assertThat(deviateAdd.getDefaultValueInString(), is("admin"));
+        assertThat(deviateAdd.isConfig(), is(true));
+        assertThat(deviateAdd.isMandatory(), is(true));
+        assertThat(deviateAdd.getMinElements().getMinElement(), is(0));
+        assertThat(deviateAdd.getMaxElements().getMaxElement(), is(12343));
+        assertThat(deviation.getResolvableStatus(), is(UNRESOLVED));
+    }
+
+    /**
+     * Checks deviation delete statement as sub-statement of module.
+     */
+    @Test
+    public void processDeviationDeleteStatement() throws IOException,
+            ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/" +
+                                                     "ValidDeviateDelete.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangDeviation deviation = (YangDeviation) yangNode.getChild();
+        assertThat(deviation.getName(), is("/base:system"));
+        assertThat(deviation.isDeviateNotSupported(), is(false));
+        List<YangAtomicPath> targetNode = deviation.getTargetNode();
+        assertThat(targetNode.get(0).getNodeIdentifier().getName(),
+                   is("system"));
+        assertThat(targetNode.get(0).getNodeIdentifier().getPrefix(),
+                   is("base"));
+
+        YangDeviateDelete deviateDelete = deviation.getDeviateDelete().get(0);
+        assertThat(deviateDelete.getUnits(), is("\"units\""));
+        assertThat(deviateDelete.getListOfMust().get(0).getConstraint(),
+                   is("daytime or time"));
+        assertThat(deviateDelete.getUniqueList().get(0), is("id"));
+        assertThat(deviateDelete.getDefaultValueInString(), is("defaultValue"));
+        assertThat(deviation.getResolvableStatus(), is(UNRESOLVED));
+    }
+
+    /**
+     * Checks deviation replace statement as sub-statement of module.
+     */
+    @Test
+    public void processDeviationReplaceStatement() throws IOException,
+            ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/" +
+                                                     "ValidDeviateReplace.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangDeviation deviation = (YangDeviation) yangNode.getChild();
+        assertThat(deviation.getName(), is("/base:system/base:name-server"));
+        assertThat(deviation.isDeviateNotSupported(), is(false));
+        List<YangAtomicPath> targetNode = deviation.getTargetNode();
+        assertThat(targetNode.get(0).getNodeIdentifier().getName(),
+                   is("system"));
+        assertThat(targetNode.get(0).getNodeIdentifier().getPrefix(),
+                   is("base"));
+        assertThat(targetNode.get(1).getNodeIdentifier().getName(),
+                   is("name-server"));
+
+        YangDeviateReplace replace = deviation.getDeviateReplace().get(0);
+        assertThat(replace.getDataType().getDataType(), is(INT8));
+        assertThat(replace.getUnits(), is("\"units\""));
+        assertThat(replace.getDefaultValueInString(), is("0"));
+        assertThat(replace.isConfig(), is(true));
+        assertThat(replace.isMandatory(), is(true));
+        assertThat(replace.getMinElements().getMinElement(), is(0));
+        assertThat(replace.getMaxElements().getMaxElement(), is(3));
+        assertThat(deviation.getResolvableStatus(), is(UNRESOLVED));
+    }
+
+    /**
+     * Checks deviation unsupported statement and deviate add as
+     * sub-statement of module.
+     */
+    @Test
+    public void processInvalidDeviateStatement() throws
+            IOException, ParserException {
+        String error = "YANG file error: Either deviate-not-supported-stmt or" +
+                " deviate-replace should be present in deviation" +
+                " /base:system/base:daytime";
+        thrown.expect(ParserException.class);
+        thrown.expectMessage(error);
+        YangNode node = manager.getDataModel("src/test/resources/InvalidDeviateStatement.yang");
+    }
+}
+
diff --git a/compiler/base/parser/src/test/resources/InvalidDeviateStatement.yang b/compiler/base/parser/src/test/resources/InvalidDeviateStatement.yang
new file mode 100644
index 0000000..9068050
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/InvalidDeviateStatement.yang
@@ -0,0 +1,19 @@
+module Test {
+    yang-version 1;
+    namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+    prefix On;
+    deviation /base:system/base:daytime {
+        description "desc";
+        reference "ref";
+        deviate not-supported;
+        deviate replace {
+            type int8;
+            units "units";
+            default "0";
+            config "true";
+            mandatory "true";
+            min-elements 0;
+            max-elements 3;
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ValidDeviateAdd.yang b/compiler/base/parser/src/test/resources/ValidDeviateAdd.yang
new file mode 100644
index 0000000..7915d54
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ValidDeviateAdd.yang
@@ -0,0 +1,17 @@
+module Test {
+    yang-version 1;
+    namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+    prefix On;
+    deviation /base:system/base:user/base:type {
+        deviate add {
+            units "units";
+            must "/base:system";
+            unique "id";
+            default "admin";
+            config "true";
+            mandatory "true";
+            min-elements "0";
+            max-elements "12343";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ValidDeviateDelete.yang b/compiler/base/parser/src/test/resources/ValidDeviateDelete.yang
new file mode 100644
index 0000000..767f3de
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ValidDeviateDelete.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+    prefix On;
+    deviation "/base:system" {
+        deviate delete {
+           units "units";
+           must "daytime or time";
+           unique "id";
+           default "defaultValue";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ValidDeviateReplace.yang b/compiler/base/parser/src/test/resources/ValidDeviateReplace.yang
new file mode 100644
index 0000000..dc7f0fb
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ValidDeviateReplace.yang
@@ -0,0 +1,16 @@
+module Test {
+    yang-version 1;
+    namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+    prefix On;
+    deviation /base:system/base:name-server {
+        deviate replace {
+            type int8;
+            units "units";
+            default "0";
+            config "true";
+            mandatory "true";
+            min-elements 0;
+            max-elements 3;
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ValidDeviationNotSupported.yang b/compiler/base/parser/src/test/resources/ValidDeviationNotSupported.yang
new file mode 100644
index 0000000..979f29f
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ValidDeviationNotSupported.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+    prefix On;
+    deviation /base:system/base:daytime {
+        description "desc";
+        reference "ref";
+        deviate not-supported;
+    }
+}
diff --git a/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/base/tool/YangToolManager.java b/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/base/tool/YangToolManager.java
index 7378728..548511d 100644
--- a/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/base/tool/YangToolManager.java
+++ b/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/base/tool/YangToolManager.java
@@ -16,16 +16,17 @@
 
 package org.onosproject.yang.compiler.base.tool;
 
-import org.onosproject.yang.compiler.parser.YangUtilsParser;
-import org.onosproject.yang.compiler.parser.exceptions.ParserException;
-import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
 import org.onosproject.yang.compiler.base.tool.exception.YangToolException;
+import org.onosproject.yang.compiler.datamodel.YangDeviationHolder;
 import org.onosproject.yang.compiler.datamodel.YangNode;
 import org.onosproject.yang.compiler.datamodel.YangReferenceResolver;
 import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
 import org.onosproject.yang.compiler.linker.YangLinker;
 import org.onosproject.yang.compiler.linker.exceptions.LinkerException;
 import org.onosproject.yang.compiler.linker.impl.YangLinkerManager;
+import org.onosproject.yang.compiler.parser.YangUtilsParser;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
 import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
 import org.slf4j.Logger;
 
@@ -302,7 +303,8 @@
         yangNodeSortedList.addAll(yangNodeSet);
         sort(yangNodeSortedList);
         for (YangNode node : yangNodeSortedList) {
-            if (node.isToTranslate()) {
+            if (node.isToTranslate() && !(!((YangDeviationHolder) node)
+                    .isModuleForDeviation())) {
                 generateJavaCode(node, pluginConfig);
             }
         }
diff --git a/compiler/base/utils/src/main/java/org/onosproject/yang/compiler/utils/UtilConstants.java b/compiler/base/utils/src/main/java/org/onosproject/yang/compiler/utils/UtilConstants.java
index 05073fc..bec4e2d 100644
--- a/compiler/base/utils/src/main/java/org/onosproject/yang/compiler/utils/UtilConstants.java
+++ b/compiler/base/utils/src/main/java/org/onosproject/yang/compiler/utils/UtilConstants.java
@@ -18,6 +18,7 @@
 
 import java.io.File;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 
 /**
@@ -1228,20 +1229,20 @@
      * List of keywords in java, this is used for checking if the input does not
      * contain these keywords.
      */
-    public static final List<String> JAVA_KEY_WORDS =
-            Arrays.asList("abstract", "assert", "boolean", "break", "byte",
-                          "case", "catch", "char", "class", "const", "continue",
-                          "default", "do", "double", "else", "extends", "false",
-                          "final", "finally", "float", "for", "goto", "if",
-                          "implements", "import", "instanceof", "enum", "int",
-                          "interface", "long", "native", "new", "null",
-                          "package", "private", "protected", "public", "return",
-                          "short", "static", "strictfp", "super", "switch",
-                          "synchronized", "this", "throw", "throws", "transient",
-                          "true", "try", "void", "volatile", "while", "list",
-                          "map", "arrayList", "hashMap", "linkedList", "notify",
-                          "notifyAll", "Method",
-                          "collections");
+    public static final List<String> JAVA_KEY_WORDS = Collections
+            .unmodifiableList(Arrays.asList("abstract", "assert", "boolean", "break", "byte",
+                                            "case", "catch", "char", "class", "const", "continue",
+                                            "default", "do", "double", "else", "extends", "false",
+                                            "final", "finally", "float", "for", "goto", "if",
+                                            "implements", "import", "instanceof", "enum", "int",
+                                            "interface", "long", "native", "new", "null",
+                                            "package", "private", "protected", "public", "return",
+                                            "short", "static", "strictfp", "super", "switch",
+                                            "synchronized", "this", "throw", "throws", "transient",
+                                            "true", "try", "void", "volatile", "while", "list",
+                                            "map", "arrayList", "hashMap", "linkedList", "notify",
+                                            "notifyAll", "Method",
+                                            "collections"));
 
     /**
      * Static attribute for regex for all the special characters.
@@ -1671,6 +1672,13 @@
             "compiler annotation ";
 
     /**
+     * Static attribute for compiler annotation resolve entity error
+     * information.
+     */
+    public static final String FAILED_TO_FIND_DEVIATION = "Failed to link " +
+            "deviation ";
+
+    /**
      * Static attribute for failed to link entity error information.
      */
     public static final String FAILED_TO_LINK = "Failed to link ";
diff --git a/compiler/plugin/maven/src/main/java/org/onosproject/yang/compiler/plugin/maven/YangUtilManager.java b/compiler/plugin/maven/src/main/java/org/onosproject/yang/compiler/plugin/maven/YangUtilManager.java
index a9d0ce0..903c705 100644
--- a/compiler/plugin/maven/src/main/java/org/onosproject/yang/compiler/plugin/maven/YangUtilManager.java
+++ b/compiler/plugin/maven/src/main/java/org/onosproject/yang/compiler/plugin/maven/YangUtilManager.java
@@ -25,6 +25,7 @@
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.rtinfo.RuntimeInformation;
+import org.onosproject.yang.compiler.datamodel.YangDeviationHolder;
 import org.onosproject.yang.compiler.parser.YangUtilsParser;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
 import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
@@ -295,7 +296,7 @@
      * TODO: Delete me and use the tool code for UT test cases
      * Creates YANG nodes set.
      */
-    protected void createYangNodeSet() {
+    public void createYangNodeSet() {
         for (YangFileInfo yangFileInfo : yangFileInfoSet) {
             yangNodeSet.add(yangFileInfo.getRootNode());
         }
@@ -351,7 +352,8 @@
         yangNodeSortedList.addAll(yangNodeSet);
         sort(yangNodeSortedList);
         for (YangNode node : yangNodeSortedList) {
-            if (node.isToTranslate()) {
+            if (node.isToTranslate() && (!((YangDeviationHolder) node)
+                    .isModuleForDeviation())) {
                 JavaCodeGeneratorUtil.generateJavaCode(node, yangPlugin);
             }
         }
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileDeviationLinkingTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileDeviationLinkingTest.java
new file mode 100644
index 0000000..e1cf83f
--- /dev/null
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileDeviationLinkingTest.java
@@ -0,0 +1,551 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.compiler.plugin.maven;
+
+import org.junit.Test;
+import org.onosproject.yang.compiler.datamodel.YangAtomicPath;
+import org.onosproject.yang.compiler.datamodel.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangDeviateAdd;
+import org.onosproject.yang.compiler.datamodel.YangDeviateDelete;
+import org.onosproject.yang.compiler.datamodel.YangDeviateReplace;
+import org.onosproject.yang.compiler.datamodel.YangDeviation;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangLeavesHolder;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.linker.exceptions.LinkerException;
+import org.onosproject.yang.compiler.linker.impl.YangLinkerManager;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.translator.tojava.JavaFileInfoContainer;
+import org.onosproject.yang.compiler.translator.tojava.JavaFileInfoTranslator;
+import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
+import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+import static org.onosproject.yang.compiler.datamodel.YangNodeType.MODULE_NODE;
+import static org.onosproject.yang.compiler.datamodel.YangStatusType.CURRENT;
+import static org.onosproject.yang.compiler.datamodel.utils.ResolvableStatus.UNRESOLVED;
+import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.INT8;
+import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.UINT16;
+import static org.onosproject.yang.compiler.linker.impl.YangLinkerUtils.updateFilePriority;
+import static org.onosproject.yang.compiler.utils.io.YangPluginConfig.compileCode;
+import static org.onosproject.yang.compiler.utils.io.impl.YangIoUtils.deleteDirectory;
+
+
+/**
+ * Unit test case for deviation linking.
+ */
+public class InterFileDeviationLinkingTest {
+
+    private static final String DIR = "target/deviationTest/";
+    private final YangUtilManager utilManager = new YangUtilManager();
+    private final YangLinkerManager yangLinkerManager = new YangLinkerManager();
+    private static final String COMP = System.getProperty("user.dir") + File
+            .separator + DIR;
+
+    /**
+     * Checks deviation not supported statement linking.
+     */
+    @Test
+    public void processDeviationNotSupportedLinking() throws IOException,
+            ParserException {
+
+        String searchDir = "src/test/resources/deviationLinking";
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+
+        YangNode refNode = null;
+        YangNode selfNode = null;
+
+        // Create YANG node set
+        yangLinkerManager.createYangNodeSet(utilManager.getYangNodeSet());
+
+        // Add references to import list.
+        yangLinkerManager.addRefToYangFilesImportList(utilManager.getYangNodeSet());
+
+        updateFilePriority(utilManager.getYangNodeSet());
+
+        Iterator<YangNode> yangNodeIterator = utilManager.getYangNodeSet().iterator();
+
+        while (yangNodeIterator.hasNext()) {
+            YangNode rootNode = yangNodeIterator.next();
+            if (rootNode.getName().equals("deviation-module")) {
+                selfNode = rootNode;
+            } else if (rootNode.getName().equals("Test2")) {
+                refNode = rootNode;
+            }
+        }
+
+        // Check whether the node type is set properly to module.
+        assertThat(selfNode.getNodeType(), is(MODULE_NODE));
+
+        // Check whether the deviation module info is set correctly after
+        // parsing.
+        YangModule yangNode = (YangModule) selfNode;
+        assertThat(yangNode.getName(), is("deviation-module"));
+
+        // Check whether the container is child of module
+        YangDeviation deviation = (YangDeviation) yangNode.getChild();
+        assertThat(deviation.getName(), is("/t:ospf"));
+        assertThat(deviation.getDescription(), is("\"desc\""));
+        assertThat(deviation.getReference(), is("\"ref\""));
+        assertThat(deviation.isDeviateNotSupported(), is(true));
+        List<YangAtomicPath> targetNode = deviation.getTargetNode();
+        assertThat(targetNode.get(0).getNodeIdentifier().getName(), is("ospf"));
+        assertThat(targetNode.get(0).getNodeIdentifier().getPrefix(), is("t"));
+        assertThat(deviation.getResolvableStatus(), is(UNRESOLVED));
+
+        // Check whether the base module - test information is set correctly.
+        YangModule yangRefNode = (YangModule) refNode;
+        assertThat(yangRefNode.getName(), is("Test2"));
+
+        YangNode ospfNode = yangRefNode.getChild();
+        assertThat(ospfNode.getName(), is("ospf"));
+
+        YangNode testValid = ospfNode.getNextSibling();
+        assertThat(testValid.getName(), is("valid"));
+
+        assertThat(testValid.getNextSibling(), nullValue());
+
+        // Carry out inter-file linking.
+        yangLinkerManager.processInterFileLinking(utilManager.getYangNodeSet());
+        YangPluginConfig yangPluginConfig = new YangPluginConfig();
+        yangPluginConfig.setCodeGenDir(DIR);
+        utilManager.translateToJava(yangPluginConfig);
+
+        compileCode(COMP);
+        deleteDirectory(DIR);
+
+        // Check whether the data model tree returned is of type module.
+        assertThat(selfNode instanceof YangModule, is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(selfNode.getNodeType(), is(MODULE_NODE));
+
+
+        // Check whether the module name is set correctly.
+        yangRefNode = (YangModule) refNode;
+        assertThat(yangRefNode.getName(), is("Test2"));
+
+        YangNode childNode2 = yangRefNode.getChild();
+        assertThat(childNode2.getName(), is("ospf"));
+
+        testValid = childNode2.getNextSibling();
+        assertThat(testValid.getName(), is("valid"));
+
+        // Check whether the module name is set correctly.
+        yangNode = (YangModule) selfNode;
+        assertThat(yangNode.getName(), is("deviation-module"));
+
+        YangNode deviationValid = yangNode.getChild().getNextSibling()
+                .getNextSibling();
+        assertThat(deviationValid.getName(), is("valid"));
+
+        List<YangLeaf> lisfOfLeaf = ((YangLeavesHolder) deviationValid).getListOfLeaf();
+        assertThat(lisfOfLeaf.isEmpty(), is(true));
+        assertThat(deviationValid.getNextSibling(), nullValue());
+
+        assertThat(testValid.getYangSchemaNodeIdentifier(), is
+                (deviationValid.getYangSchemaNodeIdentifier()));
+
+        JavaFileInfoTranslator deviateJavaFile = ((JavaFileInfoContainer)
+                deviationValid).getJavaFileInfo();
+
+        JavaFileInfoTranslator testJavaFile = ((JavaFileInfoContainer)
+                testValid).getJavaFileInfo();
+        assertThat(testJavaFile, is(deviateJavaFile));
+    }
+
+    /**
+     * Checks deviate add statement linking.
+     */
+    @Test
+    public void processDeviationAddLinking() throws IOException,
+            ParserException {
+
+        String searchDir = "src/test/resources/deviationLinking";
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+
+        YangNode refNode = null;
+        YangNode selfNode = null;
+
+        // Create YANG node set
+        yangLinkerManager.createYangNodeSet(utilManager.getYangNodeSet());
+
+        // Add references to import list.
+        yangLinkerManager.addRefToYangFilesImportList(utilManager.getYangNodeSet());
+
+        updateFilePriority(utilManager.getYangNodeSet());
+
+        Iterator<YangNode> yangNodeIterator = utilManager.getYangNodeSet().iterator();
+
+        while (yangNodeIterator.hasNext()) {
+            YangNode rootNode = yangNodeIterator.next();
+            if (rootNode.getName().equals("deviation-module2")) {
+                selfNode = rootNode;
+            } else if (rootNode.getName().equals("Test2")) {
+                refNode = rootNode;
+            }
+        }
+
+        // Check whether the node type is set properly to module.
+        assertThat(selfNode.getNodeType(), is(MODULE_NODE));
+
+        // Check whether the deviation module info is set correctly after
+        // parsing.
+        YangModule yangNode = (YangModule) selfNode;
+        assertThat(yangNode.getName(), is("deviation-module2"));
+
+        // Check whether the container is child of module
+        YangDeviation deviation = (YangDeviation) yangNode.getChild();
+        assertThat(deviation.getName(), is("/t:ospf"));
+        assertThat(deviation.getDescription(), is("\"desc\""));
+        assertThat(deviation.getReference(), is("\"ref\""));
+
+        List<YangAtomicPath> targetNode = deviation.getTargetNode();
+        assertThat(targetNode.get(0).getNodeIdentifier().getName(), is("ospf"));
+        assertThat(targetNode.get(0).getNodeIdentifier().getPrefix(), is("t"));
+
+        YangDeviateAdd deviateAdd = deviation.getDeviateAdd().get(0);
+        assertThat(deviateAdd.getListOfMust().get(0).getConstraint(),
+                   is("/base:system"));
+        assertThat(deviateAdd.isConfig(), is(false));
+        assertThat(deviation.getResolvableStatus(), is(UNRESOLVED));
+
+        // Check whether the base module - test information is set correctly.
+        YangModule yangRefNode = (YangModule) refNode;
+        assertThat(yangRefNode.getName(), is("Test2"));
+
+        YangNode ospfNode = yangRefNode.getChild();
+        assertThat(ospfNode.getName(), is("ospf"));
+        assertThat(((YangContainer) ospfNode).getListOfMust().isEmpty(), is(true));
+        assertThat(((YangContainer) ospfNode).isConfig(), is(true));
+
+        // Carry out inter-file linking.
+        yangLinkerManager.processInterFileLinking(utilManager.getYangNodeSet());
+
+        YangPluginConfig yangPluginConfig = new YangPluginConfig();
+        yangPluginConfig.setCodeGenDir(DIR);
+        utilManager.translateToJava(yangPluginConfig);
+
+        compileCode(COMP);
+        deleteDirectory(DIR);
+
+        // Check whether the data model tree returned is of type module.
+        assertThat(selfNode instanceof YangModule, is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(selfNode.getNodeType(), is(MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        yangNode = (YangModule) selfNode;
+        assertThat(yangNode.getName(), is("deviation-module2"));
+
+        YangContainer deviationValid = ((YangContainer) yangNode.getChild()
+                .getNextSibling()
+                .getNextSibling());
+        assertThat(deviationValid.getName(), is("ospf"));
+        assertThat(deviationValid.getListOfMust().get(0).getConstraint(),
+                   is("/base:system"));
+        assertThat(deviationValid.isConfig(), is(false));
+    }
+
+    /**
+     * Checks deviate delete statement linking.
+     */
+    @Test
+    public void processDeviationDeleteLinking() throws IOException,
+            ParserException {
+
+        String searchDir = "src/test/resources/deviationLinking";
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+
+        YangNode refNode = null;
+        YangNode selfNode = null;
+
+        // Create YANG node set
+        yangLinkerManager.createYangNodeSet(utilManager.getYangNodeSet());
+
+        // Add references to import list.
+        yangLinkerManager.addRefToYangFilesImportList(utilManager.getYangNodeSet());
+
+        updateFilePriority(utilManager.getYangNodeSet());
+
+        Iterator<YangNode> yangNodeIterator = utilManager.getYangNodeSet().iterator();
+
+        while (yangNodeIterator.hasNext()) {
+            YangNode rootNode = yangNodeIterator.next();
+            if (rootNode.getName().equals("deviation-module4")) {
+                selfNode = rootNode;
+            } else if (rootNode.getName().equals("Test2")) {
+                refNode = rootNode;
+            }
+        }
+
+        // Check whether the node type is set properly to module.
+        assertThat(selfNode.getNodeType(), is(MODULE_NODE));
+
+        // Check whether the deviation module info is set correctly after
+        // parsing.
+        YangModule yangNode = (YangModule) selfNode;
+        assertThat(yangNode.getName(), is("deviation-module4"));
+
+        // Check whether the container is child of module
+        YangDeviation deviation = (YangDeviation) yangNode.getChild();
+        assertThat(deviation.getName(), is("/t:ospf/t:process-id"));
+        assertThat(deviation.getDescription(), is("\"desc\""));
+        assertThat(deviation.getReference(), is("\"ref\""));
+
+        List<YangAtomicPath> targetNode = deviation.getTargetNode();
+        assertThat(targetNode.get(0).getNodeIdentifier().getName(), is("ospf"));
+        assertThat(targetNode.get(0).getNodeIdentifier().getPrefix(), is("t"));
+        assertThat(targetNode.get(1).getNodeIdentifier().getName(), is("process-id"));
+        assertThat(targetNode.get(1).getNodeIdentifier().getPrefix(), is("t"));
+
+        YangDeviateDelete delete = deviation.getDeviateDelete().get(0);
+        assertThat(delete.getUnits(), is("\"units\""));
+        assertThat(delete.getDefaultValueInString(), is("defaultValue"));
+        assertThat(deviation.getResolvableStatus(), is(UNRESOLVED));
+
+        // Check whether the base module - test information is set correctly.
+        YangModule yangRefNode = (YangModule) refNode;
+        assertThat(yangRefNode.getName(), is("Test2"));
+
+        YangNode ospfNode = yangRefNode.getChild();
+        assertThat(ospfNode.getName(), is("ospf"));
+        YangLeaf leaf = ((YangLeavesHolder) ospfNode).getListOfLeaf().get(0);
+        assertThat(leaf.getName(), is("process-id"));
+        assertThat(leaf.getDataType().getDataType(), is(UINT16));
+        assertThat(leaf.getUnits(), is("\"seconds\""));
+        assertThat(leaf.getStatus(), is(CURRENT));
+        assertThat(leaf.getReference(), is("\"RFC 6020\""));
+        assertThat(leaf.getDefaultValueInString(), is("1"));
+
+        // Carry out inter-file linking.
+        yangLinkerManager.processInterFileLinking(utilManager.getYangNodeSet());
+
+        YangPluginConfig yangPluginConfig = new YangPluginConfig();
+        yangPluginConfig.setCodeGenDir(DIR);
+        utilManager.translateToJava(yangPluginConfig);
+
+        compileCode(COMP);
+        deleteDirectory(DIR);
+
+        // Check whether the data model tree returned is of type module.
+        assertThat(selfNode instanceof YangModule, is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(selfNode.getNodeType(), is(MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        yangNode = (YangModule) selfNode;
+        assertThat(yangNode.getName(), is("deviation-module4"));
+
+        YangContainer ospf = (YangContainer) yangNode.getChild()
+                .getNextSibling();
+        assertThat(ospf.getName(), is("ospf"));
+
+        leaf = ospf.getListOfLeaf().get(0);
+        assertThat(leaf.getName(), is("process-id"));
+        assertThat(leaf.getDataType().getDataType(), is(UINT16));
+        assertThat(leaf.getUnits(), nullValue());
+        assertThat(leaf.getDefaultValueInString(), nullValue());
+    }
+
+    /**
+     * Checks deviate replace statement linking.
+     */
+    @Test
+    public void processDeviationReplaceLinking() throws IOException,
+            ParserException {
+
+        String searchDir = "src/test/resources/deviationLinking";
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+
+        YangNode refNode = null;
+        YangNode selfNode = null;
+
+        // Create YANG node set
+        yangLinkerManager.createYangNodeSet(utilManager.getYangNodeSet());
+
+        // Add references to import list.
+        yangLinkerManager.addRefToYangFilesImportList(utilManager.getYangNodeSet());
+
+        updateFilePriority(utilManager.getYangNodeSet());
+
+        Iterator<YangNode> yangNodeIterator = utilManager.getYangNodeSet().iterator();
+
+        while (yangNodeIterator.hasNext()) {
+            YangNode rootNode = yangNodeIterator.next();
+            if (rootNode.getName().equals("deviation-module3")) {
+                selfNode = rootNode;
+            } else if (rootNode.getName().equals("Test2")) {
+                refNode = rootNode;
+            }
+        }
+
+        // Check whether the node type is set properly to module.
+        assertThat(selfNode.getNodeType(), is(MODULE_NODE));
+
+        // Check whether the deviation module info is set correctly after
+        // parsing.
+        YangModule yangNode = (YangModule) selfNode;
+        assertThat(yangNode.getName(), is("deviation-module3"));
+
+        // Check whether the container is child of module
+        YangDeviation deviation = (YangDeviation) yangNode.getChild();
+        assertThat(deviation.getName(), is("/t:ospf/t:process-id"));
+        assertThat(deviation.getDescription(), is("\"desc\""));
+        assertThat(deviation.getReference(), is("\"ref\""));
+
+        List<YangAtomicPath> targetNode = deviation.getTargetNode();
+        assertThat(targetNode.get(0).getNodeIdentifier().getName(), is("ospf"));
+        assertThat(targetNode.get(0).getNodeIdentifier().getPrefix(), is("t"));
+        assertThat(targetNode.get(1).getNodeIdentifier().getName(), is("process-id"));
+        assertThat(targetNode.get(1).getNodeIdentifier().getPrefix(), is("t"));
+
+        YangDeviateReplace replace = deviation.getDeviateReplace().get(0);
+        assertThat(replace.getDataType().getDataType(), is(INT8));
+        assertThat(replace.getUnits(), is("\"units\""));
+        assertThat(replace.getDefaultValueInString(), is("0"));
+        assertThat(replace.isConfig(), is(true));
+        assertThat(replace.isMandatory(), is(true));
+        assertThat(replace.getMinElements().getMinElement(), is(0));
+        assertThat(replace.getMaxElements().getMaxElement(), is(3));
+        assertThat(deviation.getResolvableStatus(), is(UNRESOLVED));
+
+        // Check whether the base module - test information is set correctly.
+        YangModule yangRefNode = (YangModule) refNode;
+        assertThat(yangRefNode.getName(), is("Test2"));
+
+        YangNode ospfNode = yangRefNode.getChild();
+        assertThat(ospfNode.getName(), is("ospf"));
+        YangLeaf leaf = ((YangLeavesHolder) ospfNode).getListOfLeaf().get(0);
+        assertThat(leaf.getName(), is("process-id"));
+        assertThat(leaf.getDataType().getDataType(), is(UINT16));
+        assertThat(leaf.getUnits(), is("\"seconds\""));
+        assertThat(leaf.getStatus(), is(CURRENT));
+        assertThat(leaf.getReference(), is("\"RFC 6020\""));
+
+        // Carry out inter-file linking.
+        yangLinkerManager.processInterFileLinking(utilManager.getYangNodeSet());
+
+        YangPluginConfig yangPluginConfig = new YangPluginConfig();
+        yangPluginConfig.setCodeGenDir(DIR);
+        utilManager.translateToJava(yangPluginConfig);
+
+        compileCode(COMP);
+        deleteDirectory(DIR);
+
+        // Check whether the data model tree returned is of type module.
+        assertThat(selfNode instanceof YangModule, is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(selfNode.getNodeType(), is(MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        yangNode = (YangModule) selfNode;
+        assertThat(yangNode.getName(), is("deviation-module3"));
+
+        YangContainer ospf = (YangContainer) yangNode.getChild()
+                .getNextSibling();
+        assertThat(ospf.getName(), is("ospf"));
+
+        leaf = ospf.getListOfLeaf().get(0);
+        assertThat(leaf.getName(), is("process-id"));
+        assertThat(leaf.getDataType().getDataType(), is(INT8));
+        assertThat(leaf.getUnits(), is("\"units\""));
+        assertThat(leaf.getDefaultValueInString(), is("0"));
+        assertThat(leaf.isConfig(), is(true));
+        assertThat(leaf.isMandatory(), is(true));
+        assertThat(leaf.getStatus(), is(CURRENT));
+        assertThat(leaf.getReference(), is("\"RFC 6020\""));
+    }
+
+    /**
+     * Checks whether exception is thrown when deviation target is invalid.
+     */
+    @Test(expected = LinkerException.class)
+    public void processDeviationInvalidTarget() throws IOException,
+            ParserException {
+
+        String searchDir = "src/test/resources/InvalidDeviation";
+        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        utilManager.parseYangFileInfoSet();
+        utilManager.createYangNodeSet();
+
+        YangNode selfNode = null;
+
+        // Create YANG node set
+        yangLinkerManager.createYangNodeSet(utilManager.getYangNodeSet());
+
+        // Add references to import list.
+        yangLinkerManager.addRefToYangFilesImportList(utilManager.getYangNodeSet());
+
+        updateFilePriority(utilManager.getYangNodeSet());
+
+        Iterator<YangNode> yangNodeIterator = utilManager.getYangNodeSet().iterator();
+
+        while (yangNodeIterator.hasNext()) {
+            YangNode rootNode = yangNodeIterator.next();
+            if (rootNode.getName().equals("deviation-module5")) {
+                selfNode = rootNode;
+            }
+        }
+
+        // Check whether the node type is set properly to module.
+        assertThat(selfNode.getNodeType(), is(MODULE_NODE));
+
+        // Check whether the deviation module info is set correctly after
+        // parsing.
+        YangModule yangNode = (YangModule) selfNode;
+        assertThat(yangNode.getName(), is("deviation-module5"));
+
+        // Check whether the container is child of module
+        YangDeviation deviation = (YangDeviation) yangNode.getChild();
+        assertThat(deviation.getName(), is("/t:ospf/t:intf-id"));
+        assertThat(deviation.getDescription(), is("\"desc\""));
+        assertThat(deviation.getReference(), is("\"ref\""));
+
+        List<YangAtomicPath> targetNode = deviation.getTargetNode();
+        assertThat(targetNode.get(0).getNodeIdentifier().getName(), is("ospf"));
+        assertThat(targetNode.get(0).getNodeIdentifier().getPrefix(), is("t"));
+        assertThat(targetNode.get(1).getNodeIdentifier().getName(), is("intf-id"));
+        assertThat(targetNode.get(1).getNodeIdentifier().getPrefix(), is("t"));
+
+        // Carry out inter-file linking.
+        yangLinkerManager.processInterFileLinking(utilManager.getYangNodeSet());
+
+        YangPluginConfig yangPluginConfig = new YangPluginConfig();
+        yangPluginConfig.setCodeGenDir(DIR);
+        utilManager.translateToJava(yangPluginConfig);
+    }
+}
diff --git a/compiler/plugin/maven/src/test/resources/InvalidDeviation/InvalidDeviationTarget.yang b/compiler/plugin/maven/src/test/resources/InvalidDeviation/InvalidDeviationTarget.yang
new file mode 100644
index 0000000..eff4726
--- /dev/null
+++ b/compiler/plugin/maven/src/test/resources/InvalidDeviation/InvalidDeviationTarget.yang
@@ -0,0 +1,16 @@
+module deviation-module5 {
+    yang-version 1;
+    namespace test:deviation5;
+    prefix On;
+    import "target" {
+        prefix "t";
+    }
+    deviation /t:ospf/t:intf-id {
+        description "desc";
+        reference "ref";
+         deviate delete {
+           units "units";
+           default "defaultValue";
+         }
+    }
+}
diff --git a/compiler/plugin/maven/src/test/resources/InvalidDeviation/deviationTarget.yang b/compiler/plugin/maven/src/test/resources/InvalidDeviation/deviationTarget.yang
new file mode 100644
index 0000000..cddfd0c
--- /dev/null
+++ b/compiler/plugin/maven/src/test/resources/InvalidDeviation/deviationTarget.yang
@@ -0,0 +1,14 @@
+module target {
+    yang-version 1;
+    namespace "test:deviation";
+    prefix test;
+    container ospf {
+        leaf process-id {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+            default "1";
+         }
+    }
+}
\ No newline at end of file
diff --git a/compiler/plugin/maven/src/test/resources/deviationLinking/DeviationAddStatement.yang b/compiler/plugin/maven/src/test/resources/deviationLinking/DeviationAddStatement.yang
new file mode 100644
index 0000000..5aa8ba5
--- /dev/null
+++ b/compiler/plugin/maven/src/test/resources/deviationLinking/DeviationAddStatement.yang
@@ -0,0 +1,22 @@
+module deviation-module2 {
+    yang-version 1;
+    namespace test:deviation2;
+    prefix On;
+    import "Test2" {
+        prefix "t";
+    }
+    deviation /t:ospf {
+        description "desc";
+        reference "ref";
+         deviate add {
+            must "/base:system";
+            config "false";
+         }
+    }
+
+    deviation /t:valid/t:invalid-interval {
+            description "desc";
+            reference "ref";
+            deviate not-supported;
+    }
+}
diff --git a/compiler/plugin/maven/src/test/resources/deviationLinking/DeviationDeleteStatement.yang b/compiler/plugin/maven/src/test/resources/deviationLinking/DeviationDeleteStatement.yang
new file mode 100644
index 0000000..e129726
--- /dev/null
+++ b/compiler/plugin/maven/src/test/resources/deviationLinking/DeviationDeleteStatement.yang
@@ -0,0 +1,16 @@
+module deviation-module4 {
+    yang-version 1;
+    namespace test:deviation4;
+    prefix On;
+    import "Test2" {
+        prefix "t";
+    }
+    deviation /t:ospf/t:process-id {
+        description "desc";
+        reference "ref";
+         deviate delete {
+           units "units";
+           default "defaultValue";
+         }
+    }
+}
diff --git a/compiler/plugin/maven/src/test/resources/deviationLinking/DeviationNotSupported.yang b/compiler/plugin/maven/src/test/resources/deviationLinking/DeviationNotSupported.yang
new file mode 100644
index 0000000..3cce4c5
--- /dev/null
+++ b/compiler/plugin/maven/src/test/resources/deviationLinking/DeviationNotSupported.yang
@@ -0,0 +1,19 @@
+module deviation-module {
+    yang-version 1;
+    namespace test:deviation;
+    prefix On;
+    import "Test2" {
+        prefix "t";
+    }
+    deviation /t:ospf {
+        description "desc";
+        reference "ref";
+        deviate not-supported;
+    }
+
+    deviation /t:valid/t:invalid-interval {
+            description "desc";
+            reference "ref";
+            deviate not-supported;
+    }
+}
diff --git a/compiler/plugin/maven/src/test/resources/deviationLinking/DeviationReplaceStatement.yang b/compiler/plugin/maven/src/test/resources/deviationLinking/DeviationReplaceStatement.yang
new file mode 100644
index 0000000..6ed6545
--- /dev/null
+++ b/compiler/plugin/maven/src/test/resources/deviationLinking/DeviationReplaceStatement.yang
@@ -0,0 +1,21 @@
+module deviation-module3 {
+    yang-version 1;
+    namespace test:deviation3;
+    prefix On;
+    import "Test2" {
+        prefix "t";
+    }
+    deviation /t:ospf/t:process-id {
+        description "desc";
+        reference "ref";
+         deviate replace {
+            type int8;
+            units "units";
+            default "0";
+            config "true";
+            mandatory "true";
+            min-elements 0;
+            max-elements 3;
+         }
+    }
+}
diff --git a/compiler/plugin/maven/src/test/resources/deviationLinking/DeviationTarget.yang b/compiler/plugin/maven/src/test/resources/deviationLinking/DeviationTarget.yang
new file mode 100644
index 0000000..e072c08
--- /dev/null
+++ b/compiler/plugin/maven/src/test/resources/deviationLinking/DeviationTarget.yang
@@ -0,0 +1,23 @@
+module Test2 {
+    yang-version 1;
+    namespace "test2:deviation";
+    prefix test;
+    container ospf {
+        leaf process-id {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+            default "1";
+         }
+    }
+
+    container valid {
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+         }
+    }
+}
\ No newline at end of file
