[ONOS-5785] Refactor code into new folder structure

Change-Id: I115d5af1cd7bfbde71a3092973fe160ec1d9bae5
diff --git a/compiler/base/parser/pom.xml b/compiler/base/parser/pom.xml
new file mode 100644
index 0000000..671bd15
--- /dev/null
+++ b/compiler/base/parser/pom.xml
@@ -0,0 +1,147 @@
+<!--
+  ~ 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.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-yang-compiler-base</artifactId>
+        <version>1.12-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>onos-yang-compiler-parser</artifactId>
+    <version>1.12-SNAPSHOT</version>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-yang-compiler-datamodel</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-yang-compiler-translator</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-yang-compiler-linker</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.antlr</groupId>
+            <artifactId>antlr4-runtime</artifactId>
+            <version>4.5.3</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.12</version>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.antlr</groupId>
+                <artifactId>antlr4-maven-plugin</artifactId>
+                <version>4.5</version>
+                <executions>
+                    <execution>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>antlr4</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <sourceDirectory>src/main/resources</sourceDirectory>
+                    <outputDirectory>
+                        target/generated-sources/org/onosproject/yang/compiler/parser/antlrgencode
+                    </outputDirectory>
+                    <visitor>false</visitor>
+                    <listener>true</listener>
+                </configuration>
+            </plugin>
+            <plugin>
+                <artifactId>maven-clean-plugin</artifactId>
+                <version>3.0.0</version>
+                <executions>
+                    <execution>
+                        <id>Deleting auto-generated listener interfaces</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>clean</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <excludeDefaultDirectories>true</excludeDefaultDirectories>
+                    <filesets>
+                        <fileset>
+                            <directory>target</directory>
+                            <followSymlinks>false</followSymlinks>
+                            <useDefaultExcludes>true</useDefaultExcludes>
+                            <excludes>
+                                <exclude>
+                                    **/generated-sources/org/onosproject/yang/compiler/parser/antlrgencode/GeneratedYangLexer.java
+                                </exclude>
+                                <exclude>
+                                    **/generated-sources/org/onosproject/yang/compiler/parser/antlrgencode/GeneratedYang.tokens
+                                </exclude>
+                                <exclude>
+                                    **/generated-sources/org/onosproject/yang/compiler/parser/antlrgencode/GeneratedYangParser.java
+                                </exclude>
+                                <exclude>
+                                    **/generated-sources/org/onosproject/yang/compiler/parser/antlrgencode/GeneratedYangLexer.tokens
+                                </exclude>
+                                <exclude>
+                                    **/generated-sources/org/onosproject/yang/compiler/parser/antlrgencode/YangLexer.java
+                                </exclude>
+                                <exclude>
+                                    **/generated-sources/org/onosproject/yang/compiler/parser/antlrgencode/YangLexer.tokens
+                                </exclude>
+                            </excludes>
+                        </fileset>
+                    </filesets>
+                    <verbose>false</verbose>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>3.0.2</version>
+                <configuration>
+                    <skipIfEmpty>true</skipIfEmpty>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>default</id>
+                        <goals>
+                            <goal>test-jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/YangUtilsParser.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/YangUtilsParser.java
new file mode 100644
index 0000000..67c611f
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/YangUtilsParser.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.parser;
+
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+
+import java.io.IOException;
+
+/**
+ * Abstraction of entity which provides parser service of YANG files for yangutils-maven-plugin.
+ */
+public interface YangUtilsParser {
+
+    /**
+     * Returns the data model node. It is an entry function to initiate the YANG file parsing.
+     *
+     * @param file input YANG file
+     * @return YangNode root node of the data model tree
+     * @throws ParserException when fails to get the data model
+     * @throws IOException when there is an exception in IO operation
+     */
+    YangNode getDataModel(String file) throws IOException, ParserException;
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/antlrgencode/GeneratedYangListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/antlrgencode/GeneratedYangListener.java
new file mode 100644
index 0000000..ff319df
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/antlrgencode/GeneratedYangListener.java
@@ -0,0 +1,2077 @@
+/*
+ * 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.
+ */
+
+// Generated from GeneratedYang.g4 by ANTLR 4.5
+
+package org.onosproject.yang.compiler.parser.antlrgencode;
+
+import org.antlr.v4.runtime.tree.ParseTreeListener;
+
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.AnyxmlStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.AppDataStructureContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.AppDataStructureStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.AppExtendedStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ArgumentBodyContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ArgumentStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.AugmentContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.AugmentStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.BaseStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.BelongstoStatementBodyContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.BelongstoStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.BitBodyStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.BitStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.BitsSpecificationContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.BodyStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.CaseStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ChoiceStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.CommonStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.CompilerAnnotationBodyStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.CompilerAnnotationStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ConfigContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ConfigStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ContactStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ContainerStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DataDefStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DataStructureKeyStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DateArgumentStringContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.Decimal64SpecificationContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DefaultStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DescriptionStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DeviateAddStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DeviateDeleteStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DeviateNotSupportedStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DeviateReplaceStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DeviationContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DeviationStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.EnumSpecificationContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.EnumStatementBodyContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.EnumStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ErrorAppTagStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ErrorMessageStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ExtendedNameContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ExtensionBodyContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ExtensionStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.FeatureBodyContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.FeatureStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.FractionContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.FractionDigitStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.GroupingStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.IdentifierContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.IdentityBodyContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.IdentityStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.IdentityrefSpecificationContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.IfFeatureStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ImportStatementBodyContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ImportStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.IncludeStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.InputStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.InstanceIdentifierSpecificationContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.KeyContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.KeyStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.LeafListStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.LeafStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.LeafrefSpecificationContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.LengthContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.LengthStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.LinkageStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ListStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.MandatoryContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.MandatoryStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.MaxElementsStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.MaxValueContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.MetaStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.MinElementsStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.MinValueContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ModuleBodyContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ModuleHeaderStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ModuleStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.MustStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.NamespaceStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.NotificationStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.NumericalRestrictionsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.OrderedByContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.OrderedByStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.OrganizationStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.OutputStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.PathContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.PathStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.PatternStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.PositionContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.PositionStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.PrefixStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.PresenceStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RangeContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RangeStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ReferenceStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RefineAnyxmlStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RefineCaseStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RefineChoiceStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RefineContainerStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RefineContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RefineLeafListStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RefineLeafStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RefineListStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RefineStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RequireInstanceContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RequireInstanceStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RevisionDateStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RevisionStatementBodyContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RevisionStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RevisionStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RpcStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ShortCaseStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.StatusContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.StatusStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.StringContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.StringRestrictionsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.SubModuleStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.SubmoduleBodyContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.SubmoduleHeaderStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.TypeBodyStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.TypeStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.TypedefStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.UnionSpecificationContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.UniqueContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.UniqueStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.UnitsStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.UsesStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ValueContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ValueStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.VersionContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.WhenStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.YangConstructContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.YangVersionStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.YangfileContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.YinElementStatementContext;
+
+/**
+ * Represents ANTLR interfaces to be implemented by listener to traverse the parse tree.
+ */
+public interface GeneratedYangListener extends ParseTreeListener {
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule yangfile.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterYangfile(YangfileContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule yangfile.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitYangfile(YangfileContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule moduleStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterModuleStatement(ModuleStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule moduleStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitModuleStatement(ModuleStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule moduleBody.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterModuleBody(ModuleBodyContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule moduleBody.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitModuleBody(ModuleBodyContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule moduleHeaderStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterModuleHeaderStatement(ModuleHeaderStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule moduleHeaderStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitModuleHeaderStatement(ModuleHeaderStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule linkageStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterLinkageStatements(LinkageStatementsContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule linkageStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitLinkageStatements(LinkageStatementsContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule metaStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterMetaStatements(MetaStatementsContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule metaStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitMetaStatements(MetaStatementsContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule revisionStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterRevisionStatements(RevisionStatementsContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule revisionStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitRevisionStatements(RevisionStatementsContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule bodyStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterBodyStatements(BodyStatementsContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule bodyStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitBodyStatements(BodyStatementsContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule yangVersionStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterYangVersionStatement(YangVersionStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule yangVersionStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitYangVersionStatement(YangVersionStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule namespaceStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterNamespaceStatement(NamespaceStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule namespaceStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitNamespaceStatement(NamespaceStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule prefixStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterPrefixStatement(PrefixStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule prefixStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitPrefixStatement(PrefixStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule importStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterImportStatement(ImportStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule importStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitImportStatement(ImportStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule importStatementBody.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterImportStatementBody(ImportStatementBodyContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule importStatementBody.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitImportStatementBody(ImportStatementBodyContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule revisionDateStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterRevisionDateStatement(RevisionDateStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule revisionDateStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitRevisionDateStatement(RevisionDateStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule includeStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterIncludeStatement(IncludeStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule includeStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitIncludeStatement(IncludeStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule organizationStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterOrganizationStatement(OrganizationStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule organizationStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitOrganizationStatement(OrganizationStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule contactStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterContactStatement(ContactStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule contactStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitContactStatement(ContactStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule descriptionStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterDescriptionStatement(DescriptionStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule descriptionStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitDescriptionStatement(DescriptionStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule referenceStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterReferenceStatement(ReferenceStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule referenceStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitReferenceStatement(ReferenceStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule revisionStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterRevisionStatement(RevisionStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule revisionStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitRevisionStatement(RevisionStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule revisionStatementBody.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterRevisionStatementBody(RevisionStatementBodyContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule revisionStatementBody.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitRevisionStatementBody(RevisionStatementBodyContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule subModuleStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterSubModuleStatement(SubModuleStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule subModuleStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitSubModuleStatement(SubModuleStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule submoduleBody.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterSubmoduleBody(SubmoduleBodyContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule submoduleBody.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitSubmoduleBody(SubmoduleBodyContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule submoduleHeaderStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterSubmoduleHeaderStatement(SubmoduleHeaderStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule submoduleHeaderStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitSubmoduleHeaderStatement(SubmoduleHeaderStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule belongstoStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterBelongstoStatement(BelongstoStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule belongstoStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitBelongstoStatement(BelongstoStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule belongstoStatementBody.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterBelongstoStatementBody(BelongstoStatementBodyContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule belongstoStatementBody.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitBelongstoStatementBody(BelongstoStatementBodyContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule extensionStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterExtensionStatement(ExtensionStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule extensionStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitExtensionStatement(ExtensionStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule extensionBody.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterExtensionBody(ExtensionBodyContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule extensionBody.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitExtensionBody(ExtensionBodyContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule argumentStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterArgumentStatement(ArgumentStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule argumentStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitArgumentStatement(ArgumentStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule argumentBody.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterArgumentBody(ArgumentBodyContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule argumentBody.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitArgumentBody(ArgumentBodyContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule yinElementStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterYinElementStatement(YinElementStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule yinElementStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitYinElementStatement(YinElementStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule identityStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterIdentityStatement(IdentityStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule identityStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitIdentityStatement(IdentityStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule identityBody.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterIdentityBody(IdentityBodyContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule identityBody.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitIdentityBody(IdentityBodyContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule baseStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterBaseStatement(BaseStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule baseStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitBaseStatement(BaseStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule featureStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterFeatureStatement(FeatureStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule featureStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitFeatureStatement(FeatureStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule featureBody.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterFeatureBody(FeatureBodyContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule featureBody.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitFeatureBody(FeatureBodyContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule dataDefStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterDataDefStatement(DataDefStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule dataDefStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitDataDefStatement(DataDefStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule ifFeatureStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterIfFeatureStatement(IfFeatureStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule ifFeatureStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitIfFeatureStatement(IfFeatureStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule unitsStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterUnitsStatement(UnitsStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule unitsStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitUnitsStatement(UnitsStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule typedefStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterTypedefStatement(TypedefStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule typedefStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitTypedefStatement(TypedefStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule typeStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterTypeStatement(TypeStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule typeStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitTypeStatement(TypeStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule typeBodyStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterTypeBodyStatements(TypeBodyStatementsContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule typeBodyStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitTypeBodyStatements(TypeBodyStatementsContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule numericalRestrictions.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterDecimal64Specification(Decimal64SpecificationContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule numericalRestrictions.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitDecimal64Specification(Decimal64SpecificationContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule numericalRestrictions.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterFractionDigitStatement(FractionDigitStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule
+     * numericalRestrictions.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitFractionDigitStatement(FractionDigitStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule
+     * numericalRestrictions.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterNumericalRestrictions(NumericalRestrictionsContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule numericalRestrictions.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitNumericalRestrictions(NumericalRestrictionsContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule rangeStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterRangeStatement(RangeStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule rangeStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitRangeStatement(RangeStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule commonStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterCommonStatements(CommonStatementsContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule commonStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitCommonStatements(CommonStatementsContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule stringRestrictions.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterStringRestrictions(StringRestrictionsContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule stringRestrictions.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitStringRestrictions(StringRestrictionsContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule lengthStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterLengthStatement(LengthStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule lengthStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitLengthStatement(LengthStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule patternStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterPatternStatement(PatternStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule patternStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitPatternStatement(PatternStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule defaultStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterDefaultStatement(DefaultStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule defaultStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitDefaultStatement(DefaultStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule enumSpecification.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterEnumSpecification(EnumSpecificationContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule enumSpecification.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitEnumSpecification(EnumSpecificationContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule enumStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterEnumStatement(EnumStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule enumStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitEnumStatement(EnumStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule enumStatementBody.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterEnumStatementBody(EnumStatementBodyContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule enumStatementBody.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitEnumStatementBody(EnumStatementBodyContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule leafrefSpecification.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterLeafrefSpecification(LeafrefSpecificationContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule leafrefSpecification.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitLeafrefSpecification(LeafrefSpecificationContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule pathStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterPathStatement(PathStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule pathStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitPathStatement(PathStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule requireInstanceStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterRequireInstanceStatement(RequireInstanceStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule requireInstanceStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitRequireInstanceStatement(RequireInstanceStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule instanceIdentifierSpecification.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterInstanceIdentifierSpecification(
+            InstanceIdentifierSpecificationContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule instanceIdentifierSpecification.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitInstanceIdentifierSpecification(InstanceIdentifierSpecificationContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule identityrefSpecification.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterIdentityrefSpecification(IdentityrefSpecificationContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule identityrefSpecification.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitIdentityrefSpecification(IdentityrefSpecificationContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule unionSpecification.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterUnionSpecification(UnionSpecificationContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule unionSpecification.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitUnionSpecification(UnionSpecificationContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule bitsSpecification.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterBitsSpecification(BitsSpecificationContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule bitsSpecification.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitBitsSpecification(BitsSpecificationContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule bitStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterBitStatement(BitStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule bitStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitBitStatement(BitStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule bitBodyStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterBitBodyStatement(BitBodyStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule bitBodyStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitBitBodyStatement(BitBodyStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule positionStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterPositionStatement(PositionStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule positionStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitPositionStatement(PositionStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule statusStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterStatusStatement(StatusStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule statusStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitStatusStatement(StatusStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule configStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterConfigStatement(ConfigStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule configStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitConfigStatement(ConfigStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule mandatoryStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterMandatoryStatement(MandatoryStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule mandatoryStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitMandatoryStatement(MandatoryStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule presenceStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterPresenceStatement(PresenceStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule presenceStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitPresenceStatement(PresenceStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule orderedByStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterOrderedByStatement(OrderedByStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule orderedByStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitOrderedByStatement(OrderedByStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule mustStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterMustStatement(MustStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule mustStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitMustStatement(MustStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule errorMessageStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterErrorMessageStatement(ErrorMessageStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule errorMessageStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitErrorMessageStatement(ErrorMessageStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule errorAppTagStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterErrorAppTagStatement(ErrorAppTagStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule errorAppTagStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitErrorAppTagStatement(ErrorAppTagStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule minElementsStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterMinElementsStatement(MinElementsStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule minElementsStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitMinElementsStatement(MinElementsStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule maxElementsStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterMaxElementsStatement(MaxElementsStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule maxElementsStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitMaxElementsStatement(MaxElementsStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule valueStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterValueStatement(ValueStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule valueStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitValueStatement(ValueStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule groupingStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterGroupingStatement(GroupingStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule groupingStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitGroupingStatement(GroupingStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule containerStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterContainerStatement(ContainerStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule containerStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitContainerStatement(ContainerStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule leafStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterLeafStatement(LeafStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule leafStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitLeafStatement(LeafStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule leafListStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterLeafListStatement(LeafListStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule leafListStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitLeafListStatement(LeafListStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule listStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterListStatement(ListStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule listStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitListStatement(ListStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule keyStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterKeyStatement(KeyStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule keyStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitKeyStatement(KeyStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule uniqueStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterUniqueStatement(UniqueStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule uniqueStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitUniqueStatement(UniqueStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule choiceStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterChoiceStatement(ChoiceStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule choiceStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitChoiceStatement(ChoiceStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule shortCaseStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterShortCaseStatement(ShortCaseStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule shortCaseStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitShortCaseStatement(ShortCaseStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule caseStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterCaseStatement(CaseStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule caseStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitCaseStatement(CaseStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule anyxmlStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterAnyxmlStatement(AnyxmlStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule anyxmlStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitAnyxmlStatement(AnyxmlStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule usesStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterUsesStatement(UsesStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule usesStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitUsesStatement(UsesStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule refineStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterRefineStatement(RefineStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule refineStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitRefineStatement(RefineStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule refineContainerStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterRefineContainerStatements(RefineContainerStatementsContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule refineContainerStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitRefineContainerStatements(RefineContainerStatementsContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule refineLeafStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterRefineLeafStatements(RefineLeafStatementsContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule refineLeafStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitRefineLeafStatements(RefineLeafStatementsContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule refineLeafListStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterRefineLeafListStatements(RefineLeafListStatementsContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule refineLeafListStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitRefineLeafListStatements(RefineLeafListStatementsContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule refineListStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterRefineListStatements(RefineListStatementsContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule refineListStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitRefineListStatements(RefineListStatementsContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule refineChoiceStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterRefineChoiceStatements(RefineChoiceStatementsContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule refineChoiceStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitRefineChoiceStatements(RefineChoiceStatementsContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule refineCaseStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterRefineCaseStatements(RefineCaseStatementsContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule refineCaseStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitRefineCaseStatements(RefineCaseStatementsContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule refineAnyxmlStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterRefineAnyxmlStatements(RefineAnyxmlStatementsContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule refineAnyxmlStatements.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitRefineAnyxmlStatements(RefineAnyxmlStatementsContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule augmentStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterAugmentStatement(AugmentStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule augmentStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitAugmentStatement(AugmentStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule whenStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterWhenStatement(WhenStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule whenStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitWhenStatement(WhenStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule rpcStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterRpcStatement(RpcStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule rpcStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitRpcStatement(RpcStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule inputStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterInputStatement(InputStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule inputStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitInputStatement(InputStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule outputStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterOutputStatement(OutputStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule outputStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitOutputStatement(OutputStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule notificationStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterNotificationStatement(NotificationStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule notificationStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitNotificationStatement(NotificationStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule deviationStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterDeviationStatement(DeviationStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule deviationStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitDeviationStatement(DeviationStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule deviateNotSupportedStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterDeviateNotSupportedStatement(DeviateNotSupportedStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule deviateNotSupportedStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitDeviateNotSupportedStatement(DeviateNotSupportedStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule deviateAddStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterDeviateAddStatement(DeviateAddStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule deviateAddStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitDeviateAddStatement(DeviateAddStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule deviateDeleteStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterDeviateDeleteStatement(DeviateDeleteStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule deviateDeleteStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitDeviateDeleteStatement(DeviateDeleteStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule deviateReplaceStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterDeviateReplaceStatement(DeviateReplaceStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule deviateReplaceStatement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitDeviateReplaceStatement(DeviateReplaceStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule string.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterString(StringContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule string.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitString(StringContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule identifier.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterIdentifier(IdentifierContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule identifier.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitIdentifier(IdentifierContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule version.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterVersion(VersionContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule version.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitVersion(VersionContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule range.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterRange(RangeContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule range.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitRange(RangeContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule dateArgumentString.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterDateArgumentString(DateArgumentStringContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule dateArgumentString.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitDateArgumentString(DateArgumentStringContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule length.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterLength(LengthContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule length.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitLength(LengthContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule path.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterPath(PathContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule path.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitPath(PathContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule position.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterPosition(PositionContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule position.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitPosition(PositionContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule status.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterStatus(StatusContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule status.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitStatus(StatusContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule config.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterConfig(ConfigContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule config.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitConfig(ConfigContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule mandatory.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterMandatory(MandatoryContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule mandatory.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitMandatory(MandatoryContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule ordered-by.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterOrderedBy(OrderedByContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule ordered-by.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitOrderedBy(OrderedByContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule min elements value.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterMinValue(MinValueContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule min elements value.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitMinValue(MinValueContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule  max elements value.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterMaxValue(MaxValueContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule max elements value.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitMaxValue(MaxValueContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule key.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterKey(KeyContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule key.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitKey(KeyContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule unique.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterUnique(UniqueContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule unique.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitUnique(UniqueContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule refine.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterRefine(RefineContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule refine.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitRefine(RefineContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule augment.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterAugment(AugmentContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule augment.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitAugment(AugmentContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule augment.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterFraction(FractionContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule augment.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitFraction(FractionContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule deviation.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterDeviation(DeviationContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule deviation.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitDeviation(DeviationContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule deviation.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterValue(ValueContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule deviation.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitValue(ValueContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule yang construct.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterYangConstruct(YangConstructContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule yang construct.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitYangConstruct(YangConstructContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule compiler annotation statement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterCompilerAnnotationStatement(CompilerAnnotationStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule compiler annotation statement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitCompilerAnnotationStatement(CompilerAnnotationStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule compiler annotation body statement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterCompilerAnnotationBodyStatement(CompilerAnnotationBodyStatementContext
+                                                      currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule compiler annotation body statement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitCompilerAnnotationBodyStatement(CompilerAnnotationBodyStatementContext
+                                                     currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule app data structure statement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterAppDataStructureStatement(AppDataStructureStatementContext
+                                                currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule app data structure statement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitAppDataStructureStatement(AppDataStructureStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule app data structure.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterAppDataStructure(AppDataStructureContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule app data strcuture.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitAppDataStructure(AppDataStructureContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule app extended statement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterAppExtendedStatement(AppExtendedStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule app extended statement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitAppExtendedStatement(AppExtendedStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule extended name.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterExtendedName(ExtendedNameContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule extended name.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitExtendedName(ExtendedNameContext currentContext);
+
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule
+     * data structure key statement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterDataStructureKeyStatement(DataStructureKeyStatementContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar rule
+     * data structure key statement.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitDataStructureKeyStatement(DataStructureKeyStatementContext currentContext);
+
+    /**
+     * Enters a parse tree produced by GeneratedYangParser for grammar rule require instance.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void enterRequireInstance(RequireInstanceContext currentContext);
+
+    /**
+     * Exits a parse tree produced by GeneratedYangParser for grammar require instance.
+     *
+     * @param currentContext current context in the parsed tree
+     */
+    void exitRequireInstance(RequireInstanceContext currentContext);
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/antlrgencode/package-info.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/antlrgencode/package-info.java
new file mode 100644
index 0000000..a8abeab
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/antlrgencode/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+/**
+ * ANTLR interfaces to be implemented by listener.
+ */
+package org.onosproject.yang.compiler.parser.antlrgencode;
\ No newline at end of file
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/exceptions/ParserException.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/exceptions/ParserException.java
new file mode 100644
index 0000000..dd019c8
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/exceptions/ParserException.java
@@ -0,0 +1,117 @@
+/*
+ * 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.exceptions;
+
+/**
+ * Represents base class for exceptions in parser operations.
+ */
+public class ParserException extends RuntimeException {
+
+    private static final long serialVersionUID = 20160211L;
+    private transient int lineNumber;
+    private transient int charPositionInLine;
+    private transient String fileName;
+
+    /**
+     * Creates a new parser exception.
+     */
+    public ParserException() {
+        super();
+    }
+
+    /**
+     * Creates a new parser exception with given message.
+     *
+     * @param message the detail of exception in string
+     */
+    public ParserException(String message) {
+        super(message);
+    }
+
+    /**
+     * Creates a new parser exception from given message and cause.
+     *
+     * @param message the detail of exception in string
+     * @param cause   underlying cause of the error
+     */
+    public ParserException(final String message, final Throwable cause) {
+        super(message, cause);
+    }
+
+    /**
+     * Creates a new parser exception from cause.
+     *
+     * @param cause underlying cause of the error
+     */
+    public ParserException(final Throwable cause) {
+        super(cause);
+    }
+
+    /**
+     * Returns line number of the exception.
+     *
+     * @return line number of the exception
+     */
+    public int getLineNumber() {
+        return this.lineNumber;
+    }
+
+    /**
+     * Returns YANG file name of the exception.
+     *
+     * @return YANG file name of the exception
+     */
+    public String getFileName() {
+        return this.fileName;
+    }
+
+    /**
+     * Returns position of the exception.
+     *
+     * @return position of the exception
+     */
+    public int getCharPositionInLine() {
+        return this.charPositionInLine;
+    }
+
+    /**
+     * Sets line number of YANG file.
+     *
+     * @param line line number of YANG file
+     */
+    public void setLine(int line) {
+        this.lineNumber = line;
+    }
+
+    /**
+     * Sets position of exception.
+     *
+     * @param charPosition position of exception
+     */
+    public void setCharPosition(int charPosition) {
+        this.charPositionInLine = charPosition;
+    }
+
+    /**
+     * Sets file name in parser exception.
+     *
+     * @param fileName YANG file name
+     */
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/exceptions/package-info.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/exceptions/package-info.java
new file mode 100644
index 0000000..f9cb0e4
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/exceptions/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+/**
+ * Custom parser exceptions.
+ */
+package org.onosproject.yang.compiler.parser.exceptions;
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
new file mode 100644
index 0000000..42fe6ca
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/TreeWalkListener.java
@@ -0,0 +1,1845 @@
+/*
+ * 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;
+
+import org.antlr.v4.runtime.ParserRuleContext;
+import org.antlr.v4.runtime.tree.ErrorNode;
+import org.antlr.v4.runtime.tree.TerminalNode;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.datamodel.utils.YangConstructType;
+import org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.AppDataStructureListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.AppExtendedNameListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.ArgumentListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.AugmentListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.BaseFileListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.BaseListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.BelongsToListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.BitListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.BitsListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.CaseListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.ChoiceListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.CompilerAnnotationListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.ConfigListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.ContactListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.ContainerListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.DataStructureKeyListener;
+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.EnumListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.EnumerationListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.ErrorAppTagListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.ErrorMessageListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.ExtensionListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.FeatureListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.FractionDigitsListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.GroupingListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.IdentityListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.IdentityRefListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.IfFeatureListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.ImportListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.IncludeListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.InputListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.KeyListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.LeafListListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.LeafListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.LeafrefListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.LengthRestrictionListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.ListListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.MandatoryListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.MaxElementsListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.MinElementsListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.ModuleListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.MustListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.NamespaceListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.NotificationListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.OrganizationListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.OutputListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.PathListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.PatternRestrictionListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.PositionListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.PrefixListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.PresenceListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.RangeRestrictionListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.ReferenceListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.RequireInstanceListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.RevisionDateListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.RevisionListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.RpcListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.ShortCaseListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.StatusListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.SubModuleListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.TypeDefListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.TypeListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.UnionListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.UniqueListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.UnitsListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.UsesListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.ValueListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.VersionListener;
+import org.onosproject.yang.compiler.parser.impl.listeners.WhenListener;
+import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil;
+import org.onosproject.yang.compiler.utils.UtilConstants;
+
+import java.util.Stack;
+
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.AnyxmlStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.AppDataStructureContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.AppDataStructureStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.AppExtendedStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ArgumentBodyContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ArgumentStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.AugmentContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.AugmentStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.BaseStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.BelongstoStatementBodyContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.BelongstoStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.BitBodyStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.BitStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.BitsSpecificationContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.BodyStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.CaseStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ChoiceStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.CommonStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.CompilerAnnotationBodyStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.CompilerAnnotationStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ConfigContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ConfigStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ContactStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ContainerStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DataDefStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DataStructureKeyStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DateArgumentStringContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.Decimal64SpecificationContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DefaultStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DescriptionStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DeviateAddStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DeviateDeleteStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DeviateNotSupportedStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DeviateReplaceStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DeviationContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DeviationStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.EnumSpecificationContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.EnumStatementBodyContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.EnumStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ErrorAppTagStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ErrorMessageStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ExtendedNameContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ExtensionBodyContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ExtensionStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.FeatureBodyContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.FeatureStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.FractionContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.FractionDigitStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.GroupingStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.IdentifierContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.IdentityBodyContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.IdentityStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.IdentityrefSpecificationContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.IfFeatureStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ImportStatementBodyContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ImportStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.IncludeStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.InputStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.InstanceIdentifierSpecificationContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.KeyContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.KeyStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.LeafListStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.LeafStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.LeafrefSpecificationContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.LengthContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.LengthStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.LinkageStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ListStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.MandatoryContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.MandatoryStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.MaxElementsStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.MaxValueContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.MetaStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.MinElementsStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.MinValueContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ModuleBodyContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ModuleHeaderStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ModuleStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.MustStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.NamespaceStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.NotificationStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.NumericalRestrictionsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.OrderedByContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.OrderedByStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.OrganizationStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.OutputStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.PathContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.PathStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.PatternStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.PositionContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.PositionStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.PrefixStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.PresenceStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RangeContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RangeStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ReferenceStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RefineAnyxmlStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RefineCaseStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RefineChoiceStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RefineContainerStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RefineContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RefineLeafListStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RefineLeafStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RefineListStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RefineStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RequireInstanceContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RequireInstanceStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RevisionDateStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RevisionStatementBodyContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RevisionStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RevisionStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RpcStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ShortCaseStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.StatusContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.StatusStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.StringContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.StringRestrictionsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.SubModuleStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.SubmoduleBodyContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.SubmoduleHeaderStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.TypeBodyStatementsContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.TypeStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.TypedefStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.UnionSpecificationContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.UniqueContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.UniqueStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.UnitsStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.UsesStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ValueContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ValueStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.VersionContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.WhenStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.YangConstructContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.YangVersionStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.YangfileContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.YinElementStatementContext;
+
+/**
+ * Represents ANTLR generates parse-tree. ANTLR generates a parse-tree listener interface that responds to events
+ * triggered by the built-in tree walker. The methods in listener are just
+ * callbacks. This class implements listener interface and generates the
+ * corresponding data model tree.
+ */
+public class TreeWalkListener implements GeneratedYangListener {
+
+    // List of parsable node entries maintained in stack
+    private Stack<Parsable> parsedDataStack = new Stack<>();
+
+    // Parse tree root node
+    private YangNode rootNode;
+
+    // YANG file name.
+    private String fileName;
+
+    /**
+     * Parent depth of grouping count for any node.
+     */
+    private int groupingDepth;
+
+    /**
+     * Parent depth of unsupported yang construct count for any node.
+     */
+    private int unsupportedYangConstructDepth;
+
+    /**
+     * Returns number of unsupported yang constructs parents, by a node, at any level.
+     *
+     * @return depth of unsupported yang constructs
+     */
+    public int getUnsupportedYangConstructDepth() {
+        return unsupportedYangConstructDepth;
+    }
+
+    /**
+     * Sets number of unsupported yang constructs by a node at any level.
+     */
+    private void increaseUnsupportedYangConstructDepth() {
+        unsupportedYangConstructDepth++;
+    }
+
+    /**
+     * Sets number of unsupported yang constructs by a node at any level.
+     */
+    private void decreaseUnsupportedYangConstructDepth() {
+        unsupportedYangConstructDepth--;
+    }
+
+    /**
+     * Returns number of grouping parents, by a node, at any level.
+     *
+     * @return depth of grouping
+     */
+    public int getGroupingDepth() {
+        return groupingDepth;
+    }
+
+    /**
+     * Sets number of grouping parents by a node at any level.
+     */
+    public void increaseGroupingDepth() {
+        groupingDepth++;
+    }
+
+    /**
+     * Sets number of grouping parents by a node at any level.
+     */
+    public void decreaseGroupingDepth() {
+        groupingDepth--;
+    }
+
+    /**
+     * Returns stack of parsable data.
+     *
+     * @return stack of parsable data
+     */
+    public Stack<Parsable> getParsedDataStack() {
+        return parsedDataStack;
+    }
+
+    /**
+     * Set parsed data stack.
+     *
+     * @param parsedDataStack stack of parsable data objects
+     */
+    public void setParsedDataStack(Stack<Parsable> parsedDataStack) {
+        this.parsedDataStack = parsedDataStack;
+    }
+
+    /**
+     * Returns root node.
+     *
+     * @return rootNode of data model tree
+     */
+    public YangNode getRootNode() {
+        return rootNode;
+    }
+
+    /**
+     * Set root node.
+     *
+     * @param rootNode root node of data model tree
+     */
+    public void setRootNode(YangNode rootNode) {
+        this.rootNode = rootNode;
+    }
+
+    /**
+     * Returns YANG file name.
+     *
+     * @return YANG file name
+     */
+    public String getFileName() {
+        return fileName;
+    }
+
+    /**
+     * Sets YANG file name.
+     *
+     * @param fileName YANG file name
+     */
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    @Override
+    public void enterYangfile(YangfileContext ctx) {
+        BaseFileListener.processYangFileEntry(this, ctx);
+    }
+
+    @Override
+    public void exitYangfile(YangfileContext ctx) {
+        BaseFileListener.processYangFileExit(this, ctx);
+    }
+
+    @Override
+    public void enterModuleStatement(ModuleStatementContext ctx) {
+        ModuleListener.processModuleEntry(this, ctx);
+    }
+
+    @Override
+    public void exitModuleStatement(ModuleStatementContext ctx) {
+        ModuleListener.processModuleExit(this, ctx);
+    }
+
+    @Override
+    public void enterModuleBody(ModuleBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitModuleBody(ModuleBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterModuleHeaderStatement(ModuleHeaderStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitModuleHeaderStatement(ModuleHeaderStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterLinkageStatements(LinkageStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitLinkageStatements(LinkageStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterMetaStatements(MetaStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitMetaStatements(MetaStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRevisionStatements(RevisionStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRevisionStatements(RevisionStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterBodyStatements(BodyStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitBodyStatements(BodyStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterYangVersionStatement(YangVersionStatementContext ctx) {
+        VersionListener.processVersionEntry(this, ctx);
+    }
+
+    @Override
+    public void exitYangVersionStatement(YangVersionStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterNamespaceStatement(NamespaceStatementContext ctx) {
+        NamespaceListener.processNamespaceEntry(this, ctx);
+    }
+
+    @Override
+    public void exitNamespaceStatement(NamespaceStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterPrefixStatement(PrefixStatementContext ctx) {
+        PrefixListener.processPrefixEntry(this, ctx);
+    }
+
+    @Override
+    public void exitPrefixStatement(PrefixStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterImportStatement(ImportStatementContext ctx) {
+        ImportListener.processImportEntry(this, ctx);
+    }
+
+    @Override
+    public void exitImportStatement(ImportStatementContext ctx) {
+        ImportListener.processImportExit(this, ctx);
+    }
+
+    @Override
+    public void enterImportStatementBody(ImportStatementBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitImportStatementBody(ImportStatementBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRevisionDateStatement(RevisionDateStatementContext ctx) {
+        RevisionDateListener.processRevisionDateEntry(this, ctx);
+    }
+
+    @Override
+    public void exitRevisionDateStatement(RevisionDateStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterIncludeStatement(IncludeStatementContext ctx) {
+        IncludeListener.processIncludeEntry(this, ctx);
+    }
+
+    @Override
+    public void exitIncludeStatement(IncludeStatementContext ctx) {
+        IncludeListener.processIncludeExit(this, ctx);
+    }
+
+    @Override
+    public void enterOrganizationStatement(OrganizationStatementContext ctx) {
+        OrganizationListener.processOrganizationEntry(this, ctx);
+    }
+
+    @Override
+    public void exitOrganizationStatement(OrganizationStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterContactStatement(ContactStatementContext ctx) {
+        ContactListener.processContactEntry(this, ctx);
+    }
+
+    @Override
+    public void exitContactStatement(ContactStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterDescriptionStatement(DescriptionStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            DescriptionListener.processDescriptionEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitDescriptionStatement(DescriptionStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterReferenceStatement(ReferenceStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            ReferenceListener.processReferenceEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitReferenceStatement(ReferenceStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRevisionStatement(RevisionStatementContext ctx) {
+        RevisionListener.processRevisionEntry(this, ctx);
+    }
+
+    @Override
+    public void exitRevisionStatement(RevisionStatementContext ctx) {
+        RevisionListener.processRevisionExit(this, ctx);
+    }
+
+    @Override
+    public void enterRevisionStatementBody(RevisionStatementBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRevisionStatementBody(RevisionStatementBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterSubModuleStatement(SubModuleStatementContext ctx) {
+        SubModuleListener.processSubModuleEntry(this, ctx);
+    }
+
+    @Override
+    public void exitSubModuleStatement(SubModuleStatementContext ctx) {
+        SubModuleListener.processSubModuleExit(this, ctx);
+    }
+
+    @Override
+    public void enterSubmoduleBody(SubmoduleBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitSubmoduleBody(SubmoduleBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterSubmoduleHeaderStatement(SubmoduleHeaderStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitSubmoduleHeaderStatement(SubmoduleHeaderStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterBelongstoStatement(BelongstoStatementContext ctx) {
+        BelongsToListener.processBelongsToEntry(this, ctx);
+    }
+
+    @Override
+    public void exitBelongstoStatement(BelongstoStatementContext ctx) {
+        BelongsToListener.processBelongsToExit(this, ctx);
+    }
+
+    @Override
+    public void enterBelongstoStatementBody(BelongstoStatementBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitBelongstoStatementBody(BelongstoStatementBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterExtensionStatement(ExtensionStatementContext ctx) {
+        ExtensionListener.processExtensionEntry(this, ctx);
+    }
+
+    @Override
+    public void exitExtensionStatement(ExtensionStatementContext ctx) {
+        ExtensionListener.processExtensionExit(this, ctx);
+    }
+
+    @Override
+    public void enterExtensionBody(ExtensionBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitExtensionBody(ExtensionBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterArgumentStatement(ArgumentStatementContext ctx) {
+        ArgumentListener.processArgumentEntry(this, ctx);
+    }
+
+    @Override
+    public void exitArgumentStatement(ArgumentStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterArgumentBody(ArgumentBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitArgumentBody(ArgumentBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterYinElementStatement(YinElementStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitYinElementStatement(YinElementStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterIdentityStatement(IdentityStatementContext ctx) {
+        IdentityListener.processIdentityEntry(this, ctx);
+    }
+
+    @Override
+    public void exitIdentityStatement(IdentityStatementContext ctx) {
+        IdentityListener.processIdentityExit(this, ctx);
+    }
+
+    @Override
+    public void enterIdentityBody(IdentityBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitIdentityBody(IdentityBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterBaseStatement(BaseStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            BaseListener.processBaseEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitBaseStatement(BaseStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterFeatureStatement(FeatureStatementContext ctx) {
+        FeatureListener.processFeatureEntry(this, ctx);
+    }
+
+    @Override
+    public void exitFeatureStatement(FeatureStatementContext ctx) {
+        FeatureListener.processFeatureExit(this, ctx);
+    }
+
+    @Override
+    public void enterFeatureBody(FeatureBodyContext ctx) {
+        // do nothing
+    }
+
+    @Override
+    public void exitFeatureBody(FeatureBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterDataDefStatement(DataDefStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitDataDefStatement(DataDefStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterIfFeatureStatement(IfFeatureStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            IfFeatureListener.processIfFeatureEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitIfFeatureStatement(IfFeatureStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterUnitsStatement(UnitsStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            UnitsListener.processUnitsEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitUnitsStatement(UnitsStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterTypedefStatement(TypedefStatementContext ctx) {
+        TypeDefListener.processTypeDefEntry(this, ctx);
+    }
+
+    @Override
+    public void exitTypedefStatement(TypedefStatementContext ctx) {
+        TypeDefListener.processTypeDefExit(this, ctx);
+    }
+
+    @Override
+    public void enterTypeStatement(TypeStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            TypeListener.processTypeEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitTypeStatement(TypeStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            TypeListener.processTypeExit(this, ctx);
+        }
+    }
+
+    @Override
+    public void enterTypeBodyStatements(TypeBodyStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitTypeBodyStatements(TypeBodyStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterDecimal64Specification(Decimal64SpecificationContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            Decimal64Listener.processDecimal64Entry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitDecimal64Specification(Decimal64SpecificationContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            Decimal64Listener.processDecimal64Exit(this, ctx);
+        }
+    }
+
+    @Override
+    public void enterFractionDigitStatement(FractionDigitStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            FractionDigitsListener.processFractionDigitsEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitFractionDigitStatement(FractionDigitStatementContext currentContext) {
+        // do nothing
+    }
+
+    @Override
+    public void enterNumericalRestrictions(NumericalRestrictionsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitNumericalRestrictions(NumericalRestrictionsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRangeStatement(RangeStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            RangeRestrictionListener.processRangeRestrictionEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitRangeStatement(RangeStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            RangeRestrictionListener.processRangeRestrictionExit(this, ctx);
+        }
+    }
+
+    @Override
+    public void enterCommonStatements(CommonStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitCommonStatements(CommonStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterStringRestrictions(StringRestrictionsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitStringRestrictions(StringRestrictionsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterLengthStatement(LengthStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            LengthRestrictionListener.processLengthRestrictionEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitLengthStatement(LengthStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            LengthRestrictionListener.processLengthRestrictionExit(this, ctx);
+        }
+    }
+
+    @Override
+    public void enterPatternStatement(PatternStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            PatternRestrictionListener.processPatternRestrictionEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitPatternStatement(PatternStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            PatternRestrictionListener.processPatternRestrictionExit(this, ctx);
+        }
+    }
+
+    @Override
+    public void enterDefaultStatement(DefaultStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            DefaultListener.processDefaultEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitDefaultStatement(DefaultStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterEnumSpecification(EnumSpecificationContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            EnumerationListener.processEnumerationEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitEnumSpecification(EnumSpecificationContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            EnumerationListener.processEnumerationExit(this, ctx);
+        }
+    }
+
+    @Override
+    public void enterEnumStatement(EnumStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            EnumListener.processEnumEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitEnumStatement(EnumStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            EnumListener.processEnumExit(this, ctx);
+        }
+    }
+
+    @Override
+    public void enterEnumStatementBody(EnumStatementBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitEnumStatementBody(EnumStatementBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterLeafrefSpecification(LeafrefSpecificationContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            LeafrefListener.processLeafrefEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitLeafrefSpecification(LeafrefSpecificationContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            LeafrefListener.processLeafrefExit(this, ctx);
+        }
+    }
+
+    @Override
+    public void enterPathStatement(PathStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            PathListener.processPathEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitPathStatement(PathStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRequireInstanceStatement(RequireInstanceStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            RequireInstanceListener.processRequireInstanceEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitRequireInstanceStatement(RequireInstanceStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterInstanceIdentifierSpecification(InstanceIdentifierSpecificationContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitInstanceIdentifierSpecification(InstanceIdentifierSpecificationContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterIdentityrefSpecification(IdentityrefSpecificationContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            IdentityRefListener.processIdentityRefEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitIdentityrefSpecification(IdentityrefSpecificationContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            IdentityRefListener.processIdentityRefExit(this, ctx);
+        }
+    }
+
+    @Override
+    public void enterUnionSpecification(UnionSpecificationContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            UnionListener.processUnionEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitUnionSpecification(UnionSpecificationContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            UnionListener.processUnionExit(this, ctx);
+        }
+    }
+
+    @Override
+    public void enterBitsSpecification(BitsSpecificationContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            BitsListener.processBitsEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitBitsSpecification(BitsSpecificationContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            BitsListener.processBitsExit(this, ctx);
+        }
+    }
+
+    @Override
+    public void enterBitStatement(BitStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            BitListener.processBitEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitBitStatement(BitStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            BitListener.processBitExit(this, ctx);
+        }
+    }
+
+    @Override
+    public void enterBitBodyStatement(BitBodyStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitBitBodyStatement(BitBodyStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterPositionStatement(PositionStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            PositionListener.processPositionEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitPositionStatement(PositionStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterStatusStatement(StatusStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            StatusListener.processStatusEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitStatusStatement(StatusStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterConfigStatement(ConfigStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            ConfigListener.processConfigEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitConfigStatement(ConfigStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterMandatoryStatement(MandatoryStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            MandatoryListener.processMandatoryEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitMandatoryStatement(MandatoryStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterPresenceStatement(PresenceStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            PresenceListener.processPresenceEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitPresenceStatement(PresenceStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterOrderedByStatement(OrderedByStatementContext ctx) {
+        ListenerUtil.handleUnsupportedYangConstruct(YangConstructType.ORDERED_BY_DATA, ctx, UtilConstants.CURRENTLY_UNSUPPORTED, getFileName());
+    }
+
+    @Override
+    public void exitOrderedByStatement(OrderedByStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterMustStatement(MustStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            MustListener.processMustEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitMustStatement(MustStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            MustListener.processMustExit(this, ctx);
+        }
+    }
+
+    @Override
+    public void enterErrorMessageStatement(ErrorMessageStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            ErrorMessageListener.processErrorMessageEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitErrorMessageStatement(ErrorMessageStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterErrorAppTagStatement(ErrorAppTagStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            ErrorAppTagListener.processErrorAppTagMessageEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitErrorAppTagStatement(ErrorAppTagStatementContext ctx) {
+        //do nothing
+    }
+
+    @Override
+    public void enterMinElementsStatement(MinElementsStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            MinElementsListener.processMinElementsEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitMinElementsStatement(MinElementsStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterMaxElementsStatement(MaxElementsStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            MaxElementsListener.processMaxElementsEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitMaxElementsStatement(MaxElementsStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterValueStatement(ValueStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            ValueListener.processValueEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitValueStatement(ValueStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterGroupingStatement(GroupingStatementContext ctx) {
+        GroupingListener.processGroupingEntry(this, ctx);
+    }
+
+    @Override
+    public void exitGroupingStatement(GroupingStatementContext ctx) {
+        GroupingListener.processGroupingExit(this, ctx);
+    }
+
+    @Override
+    public void enterContainerStatement(ContainerStatementContext ctx) {
+        ContainerListener.processContainerEntry(this, ctx);
+    }
+
+    @Override
+    public void exitContainerStatement(ContainerStatementContext ctx) {
+        ContainerListener.processContainerExit(this, ctx);
+    }
+
+    @Override
+    public void enterLeafStatement(LeafStatementContext ctx) {
+        LeafListener.processLeafEntry(this, ctx);
+    }
+
+    @Override
+    public void exitLeafStatement(LeafStatementContext ctx) {
+        LeafListener.processLeafExit(this, ctx);
+    }
+
+    @Override
+    public void enterLeafListStatement(LeafListStatementContext ctx) {
+        LeafListListener.processLeafListEntry(this, ctx);
+    }
+
+    @Override
+    public void exitLeafListStatement(LeafListStatementContext ctx) {
+        LeafListListener.processLeafListExit(this, ctx);
+    }
+
+    @Override
+    public void enterListStatement(ListStatementContext ctx) {
+        ListListener.processListEntry(this, ctx);
+    }
+
+    @Override
+    public void exitListStatement(ListStatementContext ctx) {
+        ListListener.processListExit(this, ctx);
+    }
+
+    @Override
+    public void enterKeyStatement(KeyStatementContext ctx) {
+        KeyListener.processKeyEntry(this, ctx);
+    }
+
+    @Override
+    public void exitKeyStatement(KeyStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterUniqueStatement(UniqueStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            UniqueListener.processUniqueEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitUniqueStatement(UniqueStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterChoiceStatement(ChoiceStatementContext ctx) {
+        ChoiceListener.processChoiceEntry(this, ctx);
+    }
+
+    @Override
+    public void exitChoiceStatement(ChoiceStatementContext ctx) {
+        ChoiceListener.processChoiceExit(this, ctx);
+    }
+
+    @Override
+    public void enterShortCaseStatement(ShortCaseStatementContext ctx) {
+        ShortCaseListener.processShortCaseEntry(this, ctx);
+    }
+
+    @Override
+    public void exitShortCaseStatement(ShortCaseStatementContext ctx) {
+        ShortCaseListener.processShortCaseExit(this, ctx);
+    }
+
+    @Override
+    public void enterCaseStatement(CaseStatementContext ctx) {
+        CaseListener.processCaseEntry(this, ctx);
+    }
+
+    @Override
+    public void exitCaseStatement(CaseStatementContext ctx) {
+        CaseListener.processCaseExit(this, ctx);
+    }
+
+    @Override
+    public void enterAnyxmlStatement(AnyxmlStatementContext ctx) {
+        increaseUnsupportedYangConstructDepth();
+        ListenerUtil.handleUnsupportedYangConstruct(YangConstructType.ANYXML_DATA, ctx, UtilConstants.UNSUPPORTED_YANG_CONSTRUCT, getFileName());
+    }
+
+    @Override
+    public void exitAnyxmlStatement(AnyxmlStatementContext ctx) {
+        decreaseUnsupportedYangConstructDepth();
+    }
+
+    @Override
+    public void enterUsesStatement(UsesStatementContext ctx) {
+        UsesListener.processUsesEntry(this, ctx);
+    }
+
+    @Override
+    public void exitUsesStatement(UsesStatementContext ctx) {
+        UsesListener.processUsesExit(this, ctx);
+    }
+
+    @Override
+    public void enterRefineStatement(RefineStatementContext ctx) {
+        increaseUnsupportedYangConstructDepth();
+        ListenerUtil.handleUnsupportedYangConstruct(YangConstructType.REFINE_DATA, ctx, UtilConstants.UNSUPPORTED_YANG_CONSTRUCT, getFileName());
+    }
+
+    @Override
+    public void exitRefineStatement(RefineStatementContext ctx) {
+        decreaseUnsupportedYangConstructDepth();
+    }
+
+    @Override
+    public void enterRefineContainerStatements(RefineContainerStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRefineContainerStatements(RefineContainerStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRefineLeafStatements(RefineLeafStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRefineLeafStatements(RefineLeafStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRefineLeafListStatements(RefineLeafListStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRefineLeafListStatements(RefineLeafListStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRefineListStatements(RefineListStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRefineListStatements(RefineListStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRefineChoiceStatements(RefineChoiceStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRefineChoiceStatements(RefineChoiceStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRefineCaseStatements(RefineCaseStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRefineCaseStatements(RefineCaseStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRefineAnyxmlStatements(RefineAnyxmlStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRefineAnyxmlStatements(RefineAnyxmlStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterAugmentStatement(AugmentStatementContext ctx) {
+        AugmentListener.processAugmentEntry(this, ctx);
+    }
+
+    @Override
+    public void exitAugmentStatement(AugmentStatementContext ctx) {
+        AugmentListener.processAugmentExit(this, ctx);
+    }
+
+    @Override
+    public void enterWhenStatement(WhenStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            WhenListener.processWhenEntry(this, ctx);
+        }
+    }
+
+    @Override
+    public void exitWhenStatement(WhenStatementContext ctx) {
+        if (getUnsupportedYangConstructDepth() == 0) {
+            WhenListener.processWhenExit(this, ctx);
+        }
+    }
+
+    @Override
+    public void enterRpcStatement(RpcStatementContext ctx) {
+        RpcListener.processRpcEntry(this, ctx);
+    }
+
+    @Override
+    public void exitRpcStatement(RpcStatementContext ctx) {
+        RpcListener.processRpcExit(this, ctx);
+    }
+
+    @Override
+    public void enterInputStatement(InputStatementContext ctx) {
+        InputListener.processInputEntry(this, ctx);
+    }
+
+    @Override
+    public void exitInputStatement(InputStatementContext ctx) {
+        InputListener.processInputExit(this, ctx);
+    }
+
+    @Override
+    public void enterOutputStatement(OutputStatementContext ctx) {
+        OutputListener.processOutputEntry(this, ctx);
+    }
+
+    @Override
+    public void exitOutputStatement(OutputStatementContext ctx) {
+        OutputListener.processOutputExit(this, ctx);
+    }
+
+    @Override
+    public void enterNotificationStatement(NotificationStatementContext ctx) {
+        NotificationListener.processNotificationEntry(this, ctx);
+    }
+
+    @Override
+    public void exitNotificationStatement(NotificationStatementContext ctx) {
+        NotificationListener.processNotificationExit(this, ctx);
+    }
+
+    @Override
+    public void enterDeviationStatement(DeviationStatementContext ctx) {
+        increaseUnsupportedYangConstructDepth();
+        ListenerUtil.handleUnsupportedYangConstruct(YangConstructType.DEVIATION_DATA, ctx, UtilConstants.UNSUPPORTED_YANG_CONSTRUCT,
+                                                    getFileName());
+    }
+
+    @Override
+    public void exitDeviationStatement(DeviationStatementContext ctx) {
+        decreaseUnsupportedYangConstructDepth();
+    }
+
+    @Override
+    public void enterDeviateNotSupportedStatement(DeviateNotSupportedStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitDeviateNotSupportedStatement(DeviateNotSupportedStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterDeviateAddStatement(DeviateAddStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitDeviateAddStatement(DeviateAddStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterDeviateDeleteStatement(DeviateDeleteStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitDeviateDeleteStatement(DeviateDeleteStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterDeviateReplaceStatement(DeviateReplaceStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitDeviateReplaceStatement(DeviateReplaceStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterString(StringContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitString(StringContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterIdentifier(IdentifierContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitIdentifier(IdentifierContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterDateArgumentString(DateArgumentStringContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitDateArgumentString(DateArgumentStringContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRange(RangeContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRange(RangeContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterLength(LengthContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitLength(LengthContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterPath(PathContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitPath(PathContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterPosition(PositionContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitPosition(PositionContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterStatus(StatusContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitStatus(StatusContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterConfig(ConfigContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitConfig(ConfigContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterMandatory(MandatoryContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitMandatory(MandatoryContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterOrderedBy(OrderedByContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitOrderedBy(OrderedByContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterMinValue(MinValueContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitMinValue(MinValueContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterMaxValue(MaxValueContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitMaxValue(MaxValueContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterKey(KeyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitKey(KeyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterUnique(UniqueContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitUnique(UniqueContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRefine(RefineContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRefine(RefineContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterAugment(AugmentContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitAugment(AugmentContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterDeviation(DeviationContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitDeviation(DeviationContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterYangConstruct(YangConstructContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitYangConstruct(YangConstructContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterCompilerAnnotationStatement(CompilerAnnotationStatementContext ctx) {
+        CompilerAnnotationListener.processCompilerAnnotationEntry(this, ctx);
+    }
+
+    @Override
+    public void exitCompilerAnnotationStatement(CompilerAnnotationStatementContext ctx) {
+        CompilerAnnotationListener.processCompilerAnnotationExit(this, ctx);
+    }
+
+    @Override
+    public void enterCompilerAnnotationBodyStatement(CompilerAnnotationBodyStatementContext ctx) {
+        // do nothing
+    }
+
+    @Override
+    public void exitCompilerAnnotationBodyStatement(CompilerAnnotationBodyStatementContext ctx) {
+        // do nothing
+    }
+
+    @Override
+    public void enterAppDataStructureStatement(AppDataStructureStatementContext ctx) {
+        AppDataStructureListener.processAppDataStructureEntry(this, ctx);
+    }
+
+    @Override
+    public void exitAppDataStructureStatement(AppDataStructureStatementContext ctx) {
+        AppDataStructureListener.processAppDataStructureExit(this, ctx);
+    }
+
+    @Override
+    public void enterAppDataStructure(AppDataStructureContext currentContext) {
+        // do nothing
+    }
+
+    @Override
+    public void exitAppDataStructure(AppDataStructureContext currentContext) {
+        // do nothing
+    }
+
+    @Override
+    public void enterAppExtendedStatement(AppExtendedStatementContext currentContext) {
+        AppExtendedNameListener.processAppExtendedNameEntry(this, currentContext);
+    }
+
+    @Override
+    public void exitAppExtendedStatement(AppExtendedStatementContext currentContext) {
+        // TODO : to be implemented
+    }
+
+    @Override
+    public void enterExtendedName(ExtendedNameContext currentContext) {
+        // do nothing
+    }
+
+    @Override
+    public void exitExtendedName(ExtendedNameContext currentContext) {
+        // do nothing
+    }
+
+    @Override
+    public void enterDataStructureKeyStatement(DataStructureKeyStatementContext ctx) {
+        DataStructureKeyListener.processDataStructureKeyEntry(this, ctx);
+    }
+
+    @Override
+    public void exitDataStructureKeyStatement(DataStructureKeyStatementContext ctx) {
+        // do nothing
+    }
+
+    @Override
+    public void enterVersion(VersionContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitVersion(VersionContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterValue(ValueContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitValue(ValueContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRequireInstance(RequireInstanceContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRequireInstance(RequireInstanceContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterFraction(FractionContext ctx) {
+        // TODO: implement the method.
+    }
+
+    @Override
+    public void exitFraction(FractionContext ctx) {
+        // TODO: implement the method.
+    }
+
+    @Override
+    public void visitTerminal(TerminalNode terminalNode) {
+        // do nothing.
+    }
+
+    @Override
+    public void visitErrorNode(ErrorNode errorNode) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterEveryRule(ParserRuleContext parserRuleContext) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitEveryRule(ParserRuleContext parserRuleContext) {
+        // do nothing.
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/YangUtilsParserManager.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/YangUtilsParserManager.java
new file mode 100644
index 0000000..e9f1bdc
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/YangUtilsParserManager.java
@@ -0,0 +1,104 @@
+/*
+ * 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;
+
+import org.antlr.v4.runtime.ANTLRFileStream;
+import org.antlr.v4.runtime.ANTLRInputStream;
+import org.antlr.v4.runtime.CommonTokenStream;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.antlr.v4.runtime.tree.ParseTreeWalker;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.parser.YangUtilsParser;
+import org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangLexer;
+import org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.parserutils.ParseTreeErrorListener;
+
+import java.io.IOException;
+
+/**
+ * Represents file parsing, parse tree creation and data model tree creation
+ * corresponding to an input YANG file.
+ */
+public class YangUtilsParserManager implements YangUtilsParser {
+
+    @Override
+    public YangNode getDataModel(String yangFile) throws IOException, ParserException {
+
+        /**
+         * Create a char stream that reads from YANG file. Throws an exception
+         * in case input YANG file is either null or non existent.
+         */
+        ANTLRInputStream input;
+        try {
+            input = new ANTLRFileStream(yangFile);
+        } catch (IOException e) {
+            throw new ParserException("YANG file error : YANG file does not exist. " + yangFile);
+        }
+
+        // Create a lexer that feeds off of input char stream.
+        GeneratedYangLexer lexer = new GeneratedYangLexer(input);
+
+        // Create a buffer of tokens pulled from the lexer.
+        CommonTokenStream tokens = new CommonTokenStream(lexer);
+
+        // Create a parser that feeds off the tokens buffer.
+        GeneratedYangParser parser = new GeneratedYangParser(tokens);
+
+        // Remove console error listener.
+        parser.removeErrorListeners();
+
+        // Create instance of customized error listener.
+        ParseTreeErrorListener parseTreeErrorListener = new ParseTreeErrorListener();
+
+        // Add customized error listener to catch errors during parsing.
+        parser.addErrorListener(parseTreeErrorListener);
+
+        ParseTree tree;
+
+        try {
+            // Begin parsing YANG file and generate parse tree.
+            tree = parser.yangfile();
+        } catch (ParserException parserException) {
+            parserException.setFileName(yangFile);
+            throw parserException;
+        }
+
+        // Create a walker to walk the parse tree.
+        ParseTreeWalker walker = new ParseTreeWalker();
+
+        // Create a listener implementation class object.
+        TreeWalkListener treeWalker = new TreeWalkListener();
+        treeWalker.setFileName(yangFile);
+        /**
+         * Walk parse tree, provide call backs to methods in listener and build
+         * data model tree.
+         */
+        try {
+            walker.walk(treeWalker, tree);
+        } catch (ParserException listenerException) {
+            // TODO free incomplete data model tree.
+            listenerException.setFileName(yangFile);
+            throw listenerException;
+        } finally {
+            // TODO free parsable stack
+        }
+
+        // Returns the Root Node of the constructed data model tree.
+        return treeWalker.getRootNode();
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/AppDataStructureListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/AppDataStructureListener.java
new file mode 100644
index 0000000..931122f
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/AppDataStructureListener.java
@@ -0,0 +1,119 @@
+/*
+ * 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.YangAppDataStructure;
+import org.onosproject.yang.compiler.datamodel.YangCompilerAnnotation;
+import org.onosproject.yang.compiler.datamodel.YangDataStructure;
+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.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.YangDataStructure.getDataStructureType;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.APP_DATA_STRUCTURE;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.AppDataStructureStatementContext;
+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.ListenerUtil.getValidPrefix;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *   app-data-structure-stmt = prefix:app-data-structure-keyword string
+ *                         (";" /
+ *                          "{"
+ *                              [data-structure-key-stmt stmtsep]
+ *                          "}")
+ *
+ * ANTLR grammar rule
+ *   appDataStructureStatement : APP_DATA_STRUCTURE appDataStructure (STMTEND | (LEFT_CURLY_BRACE
+ *       dataStructureKeyStatement? RIGHT_CURLY_BRACE));
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "app-data-structure"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class AppDataStructureListener {
+
+    /**
+     * Creates a new app-data-structure listener.
+     */
+    private AppDataStructureListener() {
+    }
+
+    /**
+     * Performs validation and updates the data model tree. It is called when parser receives an
+     * input matching the grammar rule(app-data-structure).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processAppDataStructureEntry(TreeWalkListener listener,
+                                                    AppDataStructureStatementContext ctx) {
+
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, APP_DATA_STRUCTURE, "", ENTRY);
+
+        String prefix = getValidPrefix(ctx.APP_DATA_STRUCTURE().getText(), APP_DATA_STRUCTURE, ctx);
+        YangDataStructure dataStructure = getDataStructureType(ctx.appDataStructure().getText());
+
+        YangAppDataStructure appDataStructure = new YangAppDataStructure();
+        appDataStructure.setPrefix(prefix);
+        appDataStructure.setDataStructure(dataStructure);
+        appDataStructure.setLineNumber(ctx.getStart().getLine());
+        appDataStructure.setCharPosition(ctx.getStart().getCharPositionInLine());
+        appDataStructure.setFileName(listener.getFileName());
+
+        Parsable curData = listener.getParsedDataStack().peek();
+        if (curData instanceof YangCompilerAnnotation) {
+            YangCompilerAnnotation compilerAnnotation = ((YangCompilerAnnotation) curData);
+            compilerAnnotation.setYangAppDataStructure(appDataStructure);
+            listener.getParsedDataStack().push(appDataStructure);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, APP_DATA_STRUCTURE,
+                    "", ENTRY));
+        }
+    }
+
+    /**
+     * Performs validation and updates the data model tree. It is called when parser
+     * exits from grammar rule (app-data-structure).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processAppDataStructureExit(TreeWalkListener listener,
+                                                   AppDataStructureStatementContext ctx) {
+
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, APP_DATA_STRUCTURE, "", EXIT);
+        if (!(listener.getParsedDataStack().peek() instanceof YangAppDataStructure)) {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, APP_DATA_STRUCTURE,
+                    "", EXIT));
+        }
+        listener.getParsedDataStack().pop();
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/AppExtendedNameListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/AppExtendedNameListener.java
new file mode 100644
index 0000000..24fc9c1
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/AppExtendedNameListener.java
@@ -0,0 +1,90 @@
+/*
+ * 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.YangAppExtended;
+import org.onosproject.yang.compiler.datamodel.YangCompilerAnnotation;
+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 org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.APP_EXTENDED_NAME_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.getValidPrefix;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil.removeQuotesAndHandleConcat;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *   app-extended-stmt = prefix:app-extended-name-keyword string ";"
+ *
+ * ANTLR grammar rule
+ * appExtendedStatement : APP_EXTENDED extendedName STMTEND;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "app-extended-name"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class AppExtendedNameListener {
+
+    /**
+     * Creates a new app-extended-name listener.
+     */
+    private AppExtendedNameListener() {
+    }
+
+    /**
+     * Performs validation and updates the data model tree. It is called when parser receives an
+     * input matching the grammar rule(app-extended-name).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processAppExtendedNameEntry(TreeWalkListener listener,
+                                                   GeneratedYangParser.AppExtendedStatementContext ctx) {
+
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, APP_EXTENDED_NAME_DATA, ctx.extendedName().getText(), ENTRY);
+
+        String prefix = getValidPrefix(ctx.APP_EXTENDED().getText(), APP_EXTENDED_NAME_DATA, ctx);
+        YangAppExtended extendedName = new YangAppExtended();
+        extendedName.setPrefix(prefix);
+        extendedName.setYangAppExtendedName(removeQuotesAndHandleConcat(ctx.extendedName().getText()));
+
+        extendedName.setLineNumber(ctx.getStart().getLine());
+        extendedName.setCharPosition(ctx.getStart().getCharPositionInLine());
+        extendedName.setFileName(listener.getFileName());
+        Parsable curData = listener.getParsedDataStack().peek();
+        if (curData instanceof YangCompilerAnnotation) {
+            YangCompilerAnnotation compilerAnnotation = ((YangCompilerAnnotation) curData);
+            compilerAnnotation.setYangAppExtendedName(extendedName);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, APP_EXTENDED_NAME_DATA,
+                    ctx.extendedName().getText(), ENTRY));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ArgumentListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ArgumentListener.java
new file mode 100644
index 0000000..7da7699
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ArgumentListener.java
@@ -0,0 +1,92 @@
+/*
+ * 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.YangExtension;
+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 org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.ARGUMENT_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ArgumentStatementContext;
+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.getValidIdentifier;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * argument-stmt       = argument-keyword sep identifier-arg-str optsep
+ *                       (";" /
+ *                        "{" stmtsep
+ *                            [yin-element-stmt stmtsep]
+ *                        "}")
+ * *
+ * ANTLR grammar rule
+ * argumentStatement : ARGUMENT_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE argumentBody RIGHT_CURLY_BRACE);
+ * argumentBody : yinElementStatement?;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "argument"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class ArgumentListener {
+
+    /**
+     * Creates a new argument listener.
+     */
+    private ArgumentListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (argument), performs validation and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processArgumentEntry(TreeWalkListener listener,
+                                            ArgumentStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, ARGUMENT_DATA, ctx.identifier().getText(), ENTRY);
+
+        String identifier = getValidIdentifier(ctx.identifier().getText(), ARGUMENT_DATA, ctx);
+
+        Parsable curData = listener.getParsedDataStack().peek();
+        if (curData instanceof YangExtension) {
+            YangExtension extension = ((YangExtension) curData);
+
+            extension.setLineNumber(ctx.getStart().getLine());
+            extension.setCharPosition(ctx.getStart().getCharPositionInLine());
+            extension.setFileName(listener.getFileName());
+            extension.setArgumentName(identifier);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, ARGUMENT_DATA,
+                    ctx.identifier().getText(), ENTRY));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/AugmentListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/AugmentListener.java
new file mode 100644
index 0000000..77f5ca3
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/AugmentListener.java
@@ -0,0 +1,223 @@
+/*
+ * 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.YangAtomicPath;
+import org.onosproject.yang.compiler.datamodel.YangAugment;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+import org.onosproject.yang.compiler.datamodel.YangUses;
+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.AugmentStatementContext;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
+import org.onosproject.yang.compiler.utils.UtilConstants;
+
+import java.util.List;
+
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.addResolutionInfo;
+import static org.onosproject.yang.compiler.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.AUGMENT_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.CASE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DATA_DEF_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.WHEN_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.getPrefixRemovedName;
+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.validateCardinalityEitherOne;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yang.compiler.translator.tojava.YangDataModelFactory.getYangAugmentNode;
+import static org.onosproject.yang.compiler.utils.UtilConstants.EMPTY_STRING;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *  augment-stmt        = augment-keyword sep augment-arg-str optsep
+ *                        "{" stmtsep
+ *                            ;; these stmts can appear in any order
+ *                            [when-stmt stmtsep]
+ *                            *(if-feature-stmt stmtsep)
+ *                            [status-stmt stmtsep]
+ *                            [description-stmt stmtsep]
+ *                            [reference-stmt stmtsep]
+ *                            1*((data-def-stmt stmtsep) /
+ *                               (case-stmt stmtsep))
+ *                         "}"
+ *
+ * ANTLR grammar rule
+ * augmentStatement : AUGMENT_KEYWORD augment LEFT_CURLY_BRACE (whenStatement |
+ * ifFeatureStatement | statusStatement | descriptionStatement |
+ * referenceStatement | dataDefStatement  | caseStatement)* RIGHT_CURLY_BRACE;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "augment"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class AugmentListener {
+
+    // No instantiation.
+    private AugmentListener() {
+    }
+
+    /**
+     * Performs validation and updates the data model tree when parser
+     * receives an input matching the grammar rule (augment), performs
+     * validation and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object
+     */
+    public static void processAugmentEntry(TreeWalkListener listener,
+                                           AugmentStatementContext ctx) {
+
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, AUGMENT_DATA,
+                             ctx.augment().getText(), ENTRY);
+
+        Parsable curData = listener.getParsedDataStack().peek();
+
+        if (curData instanceof YangUses) {
+            throw new ParserException(constructListenerErrorMessage(
+                    UNHANDLED_PARSED_DATA, AUGMENT_DATA,
+                    ctx.augment().getText(), ENTRY));
+        }
+
+        if (!(curData instanceof YangModule) &&
+                !(curData instanceof YangSubModule)) {
+            throw new ParserException(constructListenerErrorMessage(
+                    INVALID_HOLDER, AUGMENT_DATA,
+                    ctx.augment().getText(), ENTRY));
+        }
+
+        // Validates augment argument string
+        List<YangAtomicPath> atomics =
+                getValidAbsoluteSchemaNodeId(ctx.augment().getText(),
+                                             AUGMENT_DATA, ctx);
+        valSubStatCardinality(ctx);
+
+        int line = ctx.getStart().getLine();
+        int pos = ctx.getStart().getCharPositionInLine();
+
+        detectCollidingChildUtil(listener, line, pos, EMPTY_STRING,
+                                 AUGMENT_DATA);
+
+        YangNode root = (YangNode) curData;
+        String name = getPrefixRemovedName(atomics, root);
+        YangAugment augment = getYangAugmentNode(JAVA_GENERATION);
+        augment.setLineNumber(line);
+        augment.setCharPosition(pos);
+        augment.setFileName(listener.getFileName());
+        augment.setTargetNode(atomics);
+        augment.setName(removeQuotesAndHandleConcat(ctx.augment().getText()));
+        augment.setPrefixRemovedName(name);
+
+        try {
+            root.addChild(augment);
+        } catch (DataModelException e) {
+            throw new ParserException(constructExtendedListenerErrorMessage(
+                    UNHANDLED_PARSED_DATA, AUGMENT_DATA,
+                    ctx.augment().getText(), ENTRY, e.getMessage()));
+        }
+        listener.getParsedDataStack().push(augment);
+
+        // Adds resolution info to the list
+        YangResolutionInfoImpl<YangAugment> info =
+                new YangResolutionInfoImpl<>(augment, root, line, pos);
+        addToResolution(info, ctx);
+    }
+
+    /**
+     * Performs validations and update the data model tree when parser exits
+     * from grammar rule (augment).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processAugmentExit(TreeWalkListener listener,
+                                          AugmentStatementContext ctx) {
+
+        //Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, AUGMENT_DATA,
+                             ctx.augment().getText(), EXIT);
+
+        if (!(listener.getParsedDataStack().peek() instanceof YangAugment)) {
+            throw new ParserException(constructListenerErrorMessage(
+                    MISSING_CURRENT_HOLDER, AUGMENT_DATA,
+                    ctx.augment().getText(), EXIT));
+        }
+        listener.getParsedDataStack().pop();
+    }
+
+    /**
+     * Validates the cardinality of augment sub-statements as per grammar.
+     *
+     * @param ctx context object
+     */
+    private static void valSubStatCardinality(AugmentStatementContext ctx) {
+
+        validateCardinalityMaxOne(ctx.statusStatement(), STATUS_DATA,
+                                  AUGMENT_DATA, ctx.augment().getText());
+
+        validateCardinalityMaxOne(ctx.descriptionStatement(), DESCRIPTION_DATA,
+                                  AUGMENT_DATA, ctx.augment().getText());
+
+        validateCardinalityMaxOne(ctx.referenceStatement(), REFERENCE_DATA,
+                                  AUGMENT_DATA, ctx.augment().getText());
+
+        validateCardinalityMaxOne(ctx.whenStatement(), WHEN_DATA, AUGMENT_DATA,
+                                  ctx.augment().getText());
+
+        validateCardinalityEitherOne(ctx.dataDefStatement(), DATA_DEF_DATA,
+                                     ctx.caseStatement(), CASE_DATA,
+                                     AUGMENT_DATA, ctx.augment().getText(),
+                                     ctx);
+    }
+
+    /**
+     * Add to resolution list.
+     *
+     * @param info resolution info
+     * @param ctx  context object
+     */
+    private static void addToResolution(YangResolutionInfoImpl<YangAugment> info,
+                                        AugmentStatementContext ctx) {
+        try {
+            addResolutionInfo(info);
+        } catch (DataModelException e) {
+            throw new ParserException(constructExtendedListenerErrorMessage(
+                    UNHANDLED_PARSED_DATA, AUGMENT_DATA,
+                    ctx.augment().getText(), EXIT, e.getMessage()));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/BaseFileListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/BaseFileListener.java
new file mode 100644
index 0000000..b1130ca
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/BaseFileListener.java
@@ -0,0 +1,92 @@
+/*
+ * 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.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+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.YANGBASE_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.YangfileContext;
+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_CHILD;
+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.ListenerValidation.checkStackIsEmpty;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ANTLR grammar rule
+ * yangfile : module_stmt
+ *          | submodule_stmt;
+ */
+
+/**
+ * Representation of call back function corresponding to the "base rule" defined in
+ * ANTLR grammar file.
+ */
+public final class BaseFileListener {
+
+    /**
+     * Creates a new base listener.
+     */
+    private BaseFileListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (yangfile), perform validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processYangFileEntry(TreeWalkListener listener, YangfileContext ctx) {
+
+        // Check if stack is empty.
+        checkStackIsEmpty(listener, INVALID_HOLDER, YANGBASE_DATA, "", ENTRY);
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (yangfile), it perform
+     * validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processYangFileExit(TreeWalkListener listener, YangfileContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, YANGBASE_DATA, "", EXIT);
+
+        // Data Model tree root node is set.
+        if (listener.getParsedDataStack().peek() instanceof YangModule
+                || listener.getParsedDataStack().peek() instanceof YangSubModule) {
+            listener.setRootNode((YangNode) listener.getParsedDataStack().pop());
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_CHILD, YANGBASE_DATA, "", EXIT));
+        }
+
+        // Check if stack is empty.
+        checkStackIsEmpty(listener, INVALID_HOLDER, YANGBASE_DATA, "", EXIT);
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/BaseListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/BaseListener.java
new file mode 100644
index 0000000..c05cd38
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/BaseListener.java
@@ -0,0 +1,123 @@
+/*
+ * 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.YangBase;
+import org.onosproject.yang.compiler.datamodel.YangIdentity;
+import org.onosproject.yang.compiler.datamodel.YangIdentityRef;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeIdentifier;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+import org.onosproject.yang.compiler.datamodel.utils.DataModelUtils;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.linker.impl.YangResolutionInfoImpl;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
+import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil;
+
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.addResolutionInfo;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.BASE_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.BaseStatementContext;
+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_HOLDER;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil.getValidNodeIdentifier;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/**
+ * base-stmt           = base-keyword sep identifier-ref-arg-str
+ * optsep stmtend*
+ * identifier-ref-arg  = [prefix ":"] identifier
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "base"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class BaseListener {
+
+    //Creates a new base listener.
+    private BaseListener() {
+    }
+
+    /**
+     * Performs validation and updates the data model tree when parser receives an
+     * input matching the grammar rule (base).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processBaseEntry(TreeWalkListener listener,
+                                        BaseStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, BASE_DATA, ctx.string().getText(), ENTRY);
+
+        YangNodeIdentifier nodeIdentifier = getValidNodeIdentifier(ctx.string().getText(), BASE_DATA, ctx);
+
+        Parsable tmpData = listener.getParsedDataStack().peek();
+
+        /**
+         * For identityref base node identifier is copied in identity listener itself, so no need to process
+         * base statement for indentityref
+         */
+        if (tmpData instanceof YangIdentityRef) {
+            return;
+        }
+
+        if (!(tmpData instanceof YangIdentity)) {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, BASE_DATA,
+                                                                    ctx.string().getText(), ENTRY));
+        }
+
+        YangBase yangBase = new YangBase();
+        yangBase.setBaseIdentifier(nodeIdentifier);
+        ((YangIdentity) tmpData).setBaseNode(yangBase);
+
+        int errorLine = ctx.getStart().getLine();
+        int errorPosition = ctx.getStart().getCharPositionInLine();
+
+        yangBase.setLineNumber(errorLine);
+        yangBase.setCharPosition(errorPosition);
+        yangBase.setFileName(listener.getFileName());
+
+        // Add resolution information to the list
+        YangResolutionInfoImpl resolutionInfo =
+                new YangResolutionInfoImpl<YangBase>(yangBase, (YangNode) tmpData, errorLine, errorPosition);
+        addToResolutionList(resolutionInfo, ctx);
+    }
+
+    /**
+     * Add to resolution list.
+     *
+     * @param resolutionInfo resolution information
+     * @param ctx            context object of the grammar rule
+     */
+    private static void addToResolutionList(YangResolutionInfoImpl<YangBase> resolutionInfo,
+                                            BaseStatementContext ctx) {
+
+        try {
+            addResolutionInfo(resolutionInfo);
+        } catch (DataModelException e) {
+            throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                                                                            BASE_DATA, ctx.string().getText(), EXIT, e.getMessage()));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/BelongsToListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/BelongsToListener.java
new file mode 100644
index 0000000..277f2e5
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/BelongsToListener.java
@@ -0,0 +1,145 @@
+/*
+ * 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.YangBelongsTo;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+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.BELONGS_TO_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.BelongstoStatementContext;
+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.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * submodule-header-stmts =
+ *                            ;; these stmts can appear in any order
+ *                            [yang-version-stmt stmtsep]
+ *                             belongs-to-stmt stmtsep
+ *
+ * belongs-to-stmt     = belongs-to-keyword sep identifier-arg-str
+ *                       optsep
+ *                       "{" stmtsep
+ *                           prefix-stmt stmtsep
+ *                       "}"
+ *
+ * ANTLR grammar rule
+ * submodule_header_statement : yang_version_stmt? belongs_to_stmt
+ *                            | belongs_to_stmt yang_version_stmt?
+ *                            ;
+ * belongs_to_stmt : BELONGS_TO_KEYWORD identifier LEFT_CURLY_BRACE belongs_to_stmt_body RIGHT_CURLY_BRACE;
+ * belongs_to_stmt_body : prefix_stmt;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the
+ * "belongs to" rule defined in ANTLR grammar file for corresponding ABNF rule
+ * in RFC 6020.
+ */
+public final class BelongsToListener {
+
+    /**
+     * Creates a new belongto listener.
+     */
+    private BelongsToListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (belongsto), perform validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processBelongsToEntry(TreeWalkListener listener,
+                                             BelongstoStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, BELONGS_TO_DATA, ctx.identifier().getText(),
+                ENTRY);
+
+        String identifier = getValidIdentifier(ctx.identifier().getText(), BELONGS_TO_DATA, ctx);
+
+        YangBelongsTo belongstoNode = new YangBelongsTo();
+        belongstoNode.setBelongsToModuleName(identifier);
+
+        // Set the line number and character position in line for the belongs to.
+        int errorLine = ctx.getStart().getLine();
+        int errorPosition = ctx.getStart().getCharPositionInLine();
+        belongstoNode.setLineNumber(errorLine);
+        belongstoNode.setCharPosition(errorPosition);
+        belongstoNode.setFileName(listener.getFileName());
+
+        // Push belongsto into the stack.
+        listener.getParsedDataStack().push(belongstoNode);
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (belongsto), it perform
+     * validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processBelongsToExit(TreeWalkListener listener,
+                                            BelongstoStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, BELONGS_TO_DATA, ctx.identifier().getText(),
+                EXIT);
+
+        Parsable tmpBelongstoNode = listener.getParsedDataStack().peek();
+        if (tmpBelongstoNode instanceof YangBelongsTo) {
+            listener.getParsedDataStack().pop();
+
+            // Check for stack to be empty.
+            checkStackIsNotEmpty(listener, MISSING_HOLDER, BELONGS_TO_DATA,
+                    ctx.identifier().getText(), EXIT);
+
+            Parsable tmpNode = listener.getParsedDataStack().peek();
+            switch (tmpNode.getYangConstructType()) {
+                case SUB_MODULE_DATA: {
+                    YangSubModule subModule = (YangSubModule) tmpNode;
+                    subModule.setBelongsTo((YangBelongsTo) tmpBelongstoNode);
+                    subModule.setPrefix(subModule.getBelongsTo().getPrefix());
+                    break;
+                }
+                default:
+                    throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, BELONGS_TO_DATA,
+                            ctx.identifier().getText(),
+                            EXIT));
+            }
+        } else {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, BELONGS_TO_DATA,
+                    ctx.identifier().getText(), EXIT));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/BitListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/BitListener.java
new file mode 100644
index 0000000..c1c0046
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/BitListener.java
@@ -0,0 +1,187 @@
+/*
+ * 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
+ * bit-stmt            = bit-keyword sep identifier-arg-str optsep
+ *                       (";" /
+ *                        "{" stmtsep
+ *                            ;; these stmts can appear in any order
+ *                            [position-stmt stmtsep]
+ *                            [status-stmt stmtsep]
+ *                            [description-stmt stmtsep]
+ *                            [reference-stmt stmtsep]
+ *                          "}"
+ *                        "}")
+ *
+ * ANTLR grammar rule
+ * bitStatement : BIT_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE bitBodyStatement RIGHT_CURLY_BRACE);
+ *
+ * bitBodyStatement : positionStatement? statusStatement? descriptionStatement? referenceStatement?
+ *               | positionStatement? statusStatement? referenceStatement? descriptionStatement?
+ *               | positionStatement? descriptionStatement? statusStatement? referenceStatement?
+ *               | positionStatement? descriptionStatement? referenceStatement? statusStatement?
+ *               | positionStatement? referenceStatement? statusStatement? descriptionStatement?
+ *               | positionStatement? referenceStatement? descriptionStatement? statusStatement?
+ *               | statusStatement? positionStatement? descriptionStatement? referenceStatement?
+ *               | statusStatement? positionStatement? referenceStatement? descriptionStatement?
+ *               | statusStatement? descriptionStatement? descriptionStatement? positionStatement?
+ *               | statusStatement? descriptionStatement? positionStatement? descriptionStatement?
+ *               | statusStatement? referenceStatement? positionStatement? descriptionStatement?
+ *               | statusStatement? referenceStatement? descriptionStatement? positionStatement?
+ *               | descriptionStatement? positionStatement? statusStatement? referenceStatement?
+ *               | descriptionStatement? positionStatement? referenceStatement? statusStatement?
+ *               | descriptionStatement? statusStatement? positionStatement? referenceStatement?
+ *               | descriptionStatement? statusStatement? referenceStatement? positionStatement?
+ *               | descriptionStatement? referenceStatement? positionStatement? statusStatement?
+ *               | descriptionStatement? referenceStatement? statusStatement? positionStatement?
+ *               | referenceStatement? positionStatement? descriptionStatement? statusStatement?
+ *               | referenceStatement? positionStatement? statusStatement? descriptionStatement?
+ *               | referenceStatement? statusStatement? descriptionStatement? positionStatement?
+ *               | referenceStatement? statusStatement? positionStatement? descriptionStatement?
+ *               | referenceStatement? descriptionStatement? positionStatement? statusStatement?
+ *               | referenceStatement? descriptionStatement? statusStatement? positionStatement?
+ *               ;
+ */
+
+import org.onosproject.yang.compiler.datamodel.YangBit;
+import org.onosproject.yang.compiler.datamodel.YangBits;
+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.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 java.util.Map;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.BIT_DATA;
+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_CONTENT;
+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.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/**
+ * Represents listener based call back function corresponding to the "bit"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class BitListener {
+
+    /**
+     * Creates a new bit listener.
+     */
+    private BitListener() {
+    }
+
+    /**
+     * It is called when parser enters grammar rule (bit), it perform
+     * validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processBitEntry(TreeWalkListener listener,
+                                       GeneratedYangParser.BitStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, BIT_DATA, ctx.identifier().getText(), ENTRY);
+
+        String identifier = getValidIdentifier(ctx.identifier().getText(), BIT_DATA, ctx);
+
+        YangBit bitNode = new YangBit();
+        bitNode.setBitName(identifier);
+
+        bitNode.setLineNumber(ctx.getStart().getLine());
+        bitNode.setCharPosition(ctx.getStart().getCharPositionInLine());
+        bitNode.setFileName(listener.getFileName());
+        listener.getParsedDataStack().push(bitNode);
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (bit), it perform
+     * validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processBitExit(TreeWalkListener listener,
+                                      GeneratedYangParser.BitStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, BIT_DATA, ctx.identifier().getText(), EXIT);
+
+        Parsable tmpBitNode = listener.getParsedDataStack().peek();
+        if (tmpBitNode instanceof YangBit) {
+            listener.getParsedDataStack().pop();
+
+            // Check for stack to be non empty.
+            checkStackIsNotEmpty(listener, MISSING_HOLDER, BIT_DATA, ctx.identifier().getText(), EXIT);
+
+            Parsable tmpNode = listener.getParsedDataStack().peek();
+            switch (tmpNode.getYangConstructType()) {
+                case BITS_DATA: {
+                    YangBits yangBits = (YangBits) tmpNode;
+                    if (ctx.bitBodyStatement() == null || ctx.bitBodyStatement().positionStatement() == null) {
+                        int maxPosition = 0;
+                        boolean isPositionPresent = false;
+
+                        for (Map.Entry<Integer, YangBit> element : yangBits.getBitPositionMap().entrySet()) {
+                            if (maxPosition <= element.getKey()) {
+                                maxPosition = element.getKey();
+                                isPositionPresent = true;
+                            }
+                        }
+
+                        if (isPositionPresent) {
+                            maxPosition++;
+                        }
+                        ((YangBit) tmpBitNode).setPosition(maxPosition);
+                    }
+                    try {
+                        yangBits.addBitInfo((YangBit) tmpBitNode);
+                    } catch (DataModelException e) {
+                        ParserException parserException = new ParserException(constructExtendedListenerErrorMessage(
+                                INVALID_CONTENT, BIT_DATA, ctx.identifier().getText(), EXIT, e.getMessage()));
+                        parserException.setLine(ctx.getStart().getLine());
+                        parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+                        throw parserException;
+                    }
+                    break;
+                }
+                default:
+                    throw new ParserException(
+                            constructListenerErrorMessage(INVALID_HOLDER, BIT_DATA, ctx.identifier().getText(), EXIT));
+            }
+        } else {
+            throw new ParserException(
+                    constructListenerErrorMessage(MISSING_CURRENT_HOLDER, BIT_DATA, ctx.identifier().getText(), EXIT));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/BitsListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/BitsListener.java
new file mode 100644
index 0000000..c037aae
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/BitsListener.java
@@ -0,0 +1,165 @@
+/*
+ * 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
+ * type-body-stmts     = numerical-restrictions /
+ *                       decimal64-specification /
+ *                      string-restrictions /
+ *                       enum-specification /
+ *                       leafref-specification /
+ *                       identityref-specification /
+ *                       instance-identifier-specification /
+ *                       bits-specification /
+ *                       union-specification
+ *
+ * bits-specification  = 1*(bit-stmt stmtsep)
+ *
+ * ANTLR grammar rule
+ *
+ * typeBodyStatements : numericalRestrictions | stringRestrictions | enumSpecification
+ *                 | leafrefSpecification | identityrefSpecification | instanceIdentifierSpecification
+ *                 | bitsSpecification | unionSpecification;
+ *
+ * bitsSpecification : bitStatement+;
+ */
+
+import org.onosproject.yang.compiler.datamodel.YangBits;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangLeafList;
+import org.onosproject.yang.compiler.datamodel.YangType;
+import org.onosproject.yang.compiler.datamodel.YangTypeDef;
+import org.onosproject.yang.compiler.datamodel.YangUnion;
+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 static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.BITS_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.TYPE_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.BitsSpecificationContext;
+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;
+
+/**
+ * Represents listener based call back function corresponding to the "bits" rule
+ * defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class BitsListener {
+
+    /**
+     * Creates a new bits listener.
+     */
+    private BitsListener() {
+    }
+
+    /**
+     * It is called when parser enters grammar rule (bits), it perform
+     * validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processBitsEntry(TreeWalkListener listener,
+                                        BitsSpecificationContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, BITS_DATA, "", ENTRY);
+
+        if (listener.getParsedDataStack().peek() instanceof YangType) {
+            YangBits bitsNode = new YangBits();
+
+            bitsNode.setLineNumber(ctx.getStart().getLine());
+            bitsNode.setCharPosition(ctx.getStart().getCharPositionInLine());
+            bitsNode.setFileName(listener.getFileName());
+            Parsable typeData = listener.getParsedDataStack().pop();
+
+            // Check for stack to be non empty.
+            checkStackIsNotEmpty(listener, MISSING_HOLDER, BITS_DATA, "", ENTRY);
+
+            Parsable tmpData = listener.getParsedDataStack().peek();
+
+            switch (tmpData.getYangConstructType()) {
+                case LEAF_DATA:
+                    bitsNode.setBitsName(((YangLeaf) tmpData).getName());
+                    break;
+                case LEAF_LIST_DATA:
+                    bitsNode.setBitsName(((YangLeafList) tmpData).getName());
+                    break;
+                case TYPEDEF_DATA:
+                    bitsNode.setBitsName(((YangTypeDef) tmpData).getName());
+                    break;
+                case UNION_DATA:
+                    bitsNode.setBitsName(((YangUnion) tmpData).getName());
+                    break;
+                // TODO typedef, union, deviate.
+                default:
+                    throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, TYPE_DATA,
+                                                                            ((YangType<?>) typeData).getDataTypeName(), ENTRY));
+            }
+            listener.getParsedDataStack().push(typeData);
+            listener.getParsedDataStack().push(bitsNode);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, BITS_DATA, "", ENTRY));
+        }
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (bits), it perform
+     * validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processBitsExit(TreeWalkListener listener,
+                                       BitsSpecificationContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, BITS_DATA, "", EXIT);
+
+        Parsable tmpBitsNode = listener.getParsedDataStack().peek();
+        if (tmpBitsNode instanceof YangBits) {
+            YangBits bitsNode = (YangBits) tmpBitsNode;
+            listener.getParsedDataStack().pop();
+
+            // Check for stack to be non empty.
+            checkStackIsNotEmpty(listener, MISSING_HOLDER, BITS_DATA, "", EXIT);
+
+            Parsable tmpNode = listener.getParsedDataStack().peek();
+            switch (tmpNode.getYangConstructType()) {
+                case TYPE_DATA: {
+                    YangType<YangBits> typeNode = (YangType<YangBits>) tmpNode;
+                    typeNode.setDataTypeExtendedInfo(bitsNode);
+                    break;
+                }
+                default:
+                    throw new ParserException(
+                            constructListenerErrorMessage(INVALID_HOLDER, BITS_DATA, "", EXIT));
+            }
+        } else {
+            throw new ParserException(
+                    constructListenerErrorMessage(MISSING_CURRENT_HOLDER, BITS_DATA, "", EXIT));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/CaseListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/CaseListener.java
new file mode 100644
index 0000000..1ae7cbb
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/CaseListener.java
@@ -0,0 +1,166 @@
+/*
+ * 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.YangAugment;
+import org.onosproject.yang.compiler.datamodel.YangCase;
+import org.onosproject.yang.compiler.datamodel.YangChoice;
+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.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.ListenerCollisionDetector;
+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 org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation;
+
+import static org.onosproject.yang.compiler.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.CASE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.WHEN_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.getValidIdentifier;
+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.translator.tojava.YangDataModelFactory.getYangCaseNode;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *  case-stmt           = case-keyword sep identifier-arg-str optsep
+ *                        (";" /
+ *                         "{" stmtsep
+ *                             ;; these stmts can appear in any order
+ *                             [when-stmt stmtsep]
+ *                             *(if-feature-stmt stmtsep)
+ *                             [status-stmt stmtsep]
+ *                             [description-stmt stmtsep]
+ *                             [reference-stmt stmtsep]
+ *                             *(data-def-stmt stmtsep)
+ *                         "}")
+ *
+ * ANTLR grammar rule
+ * caseStatement : CASE_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement
+ *               | statusStatement | descriptionStatement | referenceStatement | dataDefStatement)* RIGHT_CURLY_BRACE);
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "case" rule
+ * defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class CaseListener {
+
+    /**
+     * Create a new case listener.
+     */
+    private CaseListener() {
+    }
+
+    /**
+     * It is called when parser enters grammar rule (case), it perform
+     * validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processCaseEntry(TreeWalkListener listener,
+                                        GeneratedYangParser.CaseStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, CASE_DATA, ctx.identifier().getText(), ENTRY);
+
+        // Check validity of identifier and remove double quotes.
+        String identifier = getValidIdentifier(ctx.identifier().getText(), CASE_DATA, ctx);
+
+        // Validate sub statement cardinality.
+        validateSubStatementsCardinality(ctx);
+
+        Parsable curData = listener.getParsedDataStack().peek();
+
+        // Check for identifier collision
+        int line = ctx.getStart().getLine();
+        int charPositionInLine = ctx.getStart().getCharPositionInLine();
+        detectCollidingChildUtil(listener, line, charPositionInLine, identifier, CASE_DATA);
+
+        if (curData instanceof YangChoice || curData instanceof YangAugment) {
+            YangCase caseNode = getYangCaseNode(JAVA_GENERATION);
+            caseNode.setName(identifier);
+            caseNode.setLineNumber(line);
+            caseNode.setCharPosition(charPositionInLine);
+            caseNode.setFileName(listener.getFileName());
+            YangNode curNode = (YangNode) curData;
+            try {
+                curNode.addChild(caseNode);
+            } catch (DataModelException e) {
+                throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                        CASE_DATA, ctx.identifier().getText(), ENTRY, e.getMessage()));
+            }
+            listener.getParsedDataStack().push(caseNode);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, CASE_DATA,
+                    ctx.identifier().getText(), ENTRY));
+        }
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (case), it perform
+     * validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processCaseExit(TreeWalkListener listener,
+                                       GeneratedYangParser.CaseStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, CASE_DATA, ctx.identifier().getText(), EXIT);
+
+        if (listener.getParsedDataStack().peek() instanceof YangCase) {
+            listener.getParsedDataStack().pop();
+        } else {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, CASE_DATA,
+                    ctx.identifier().getText(), EXIT));
+        }
+    }
+
+    /**
+     * Validates the cardinality of case sub-statements as per grammar.
+     *
+     * @param ctx context object of the grammar rule
+     */
+    private static void validateSubStatementsCardinality(GeneratedYangParser.CaseStatementContext ctx) {
+
+        validateCardinalityMaxOne(ctx.whenStatement(), WHEN_DATA, CASE_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.statusStatement(), STATUS_DATA, CASE_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.descriptionStatement(), DESCRIPTION_DATA, CASE_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.referenceStatement(), REFERENCE_DATA, CASE_DATA, ctx.identifier().getText());
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ChoiceListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ChoiceListener.java
new file mode 100644
index 0000000..cc078bf
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ChoiceListener.java
@@ -0,0 +1,206 @@
+/*
+ * 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.YangAugment;
+import org.onosproject.yang.compiler.datamodel.YangCase;
+import org.onosproject.yang.compiler.datamodel.YangChoice;
+import org.onosproject.yang.compiler.datamodel.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangGrouping;
+import org.onosproject.yang.compiler.datamodel.YangInput;
+import org.onosproject.yang.compiler.datamodel.YangList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNotification;
+import org.onosproject.yang.compiler.datamodel.YangOutput;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+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.ListenerCollisionDetector;
+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.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.CHOICE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.CONFIG_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DEFAULT_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.MANDATORY_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.WHEN_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ChoiceStatementContext;
+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_CONTENT;
+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.getValidIdentifier;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.getParentNodeConfig;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yang.compiler.translator.tojava.YangDataModelFactory.getYangChoiceNode;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *  choice-stmt         = choice-keyword sep identifier-arg-str optsep
+ *                        (";" /
+ *                         "{" stmtsep
+ *                             ;; these stmts can appear in any order
+ *                             [when-stmt stmtsep]
+ *                             *(if-feature-stmt stmtsep)
+ *                             [default-stmt stmtsep]
+ *                             [config-stmt stmtsep]
+ *                             [mandatory-stmt stmtsep]
+ *                             [status-stmt stmtsep]
+ *                             [description-stmt stmtsep]
+ *                             [reference-stmt stmtsep]
+ *                             *((short-case-stmt / case-stmt) stmtsep)
+ *                         "}")
+ *
+ * ANTLR grammar rule
+ * choiceStatement : CHOICE_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement
+ *                 | defaultStatement | configStatement | mandatoryStatement | statusStatement | descriptionStatement
+ *                 | referenceStatement | shortCaseStatement | caseStatement)* RIGHT_CURLY_BRACE);
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "choice"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class ChoiceListener {
+
+    /**
+     * Create a new choice listener.
+     */
+    private ChoiceListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (choice), perform validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processChoiceEntry(TreeWalkListener listener,
+                                          ChoiceStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, CHOICE_DATA, ctx.identifier().getText(), ENTRY);
+
+        // Check validity of identifier and remove double quotes.
+        String identifier = getValidIdentifier(ctx.identifier().getText(), CHOICE_DATA, ctx);
+
+        // Validate sub statement cardinality.
+        validateSubStatementsCardinality(ctx);
+
+        Parsable curData = listener.getParsedDataStack().peek();
+
+        // Check for identifier collision
+        int line = ctx.getStart().getLine();
+        int charPositionInLine = ctx.getStart().getCharPositionInLine();
+        detectCollidingChildUtil(listener, line, charPositionInLine, identifier, CHOICE_DATA);
+
+        if (curData instanceof YangModule || curData instanceof YangSubModule || curData instanceof YangContainer
+                || curData instanceof YangList || curData instanceof YangCase || curData instanceof YangGrouping
+                || curData instanceof YangAugment || curData instanceof YangInput || curData instanceof YangOutput
+                || curData instanceof YangNotification) {
+
+            YangChoice choiceNode = getYangChoiceNode(JAVA_GENERATION);
+            choiceNode.setName(identifier);
+            choiceNode.setLineNumber(line);
+            choiceNode.setCharPosition(charPositionInLine);
+            choiceNode.setFileName(listener.getFileName());
+            /*
+             * If "config" is not specified, the default is the same as the parent
+             * schema node's "config" value.
+             */
+            if (ctx.configStatement().isEmpty()) {
+                boolean parentConfig = getParentNodeConfig(listener);
+                choiceNode.setConfig(parentConfig);
+            }
+
+            YangNode curNode = (YangNode) curData;
+            try {
+                curNode.addChild(choiceNode);
+            } catch (DataModelException e) {
+                throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                        CHOICE_DATA, ctx.identifier().getText(), ENTRY, e.getMessage()));
+            }
+            listener.getParsedDataStack().push(choiceNode);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER,
+                    CHOICE_DATA, ctx.identifier().getText(), ENTRY));
+        }
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (choice), it perform
+     * validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processChoiceExit(TreeWalkListener listener,
+                                         ChoiceStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, CHOICE_DATA, ctx.identifier().getText(), EXIT);
+
+        if (listener.getParsedDataStack().peek() instanceof YangChoice) {
+            YangChoice choiceNode = (YangChoice) listener.getParsedDataStack().peek();
+            try {
+                choiceNode.validateDataOnExit();
+            } catch (DataModelException e) {
+                throw new ParserException(constructListenerErrorMessage(INVALID_CONTENT, CHOICE_DATA,
+                                                                        ctx.identifier().getText(), EXIT));
+            }
+            listener.getParsedDataStack().pop();
+        } else {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, CHOICE_DATA,
+                    ctx.identifier().getText(), EXIT));
+        }
+    }
+
+    /**
+     * Validates the cardinality of choice sub-statements as per grammar.
+     *
+     * @param ctx context object of the grammar rule.
+     */
+    private static void validateSubStatementsCardinality(ChoiceStatementContext ctx) {
+
+        validateCardinalityMaxOne(ctx.whenStatement(), WHEN_DATA, CHOICE_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.defaultStatement(), DEFAULT_DATA, CHOICE_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.configStatement(), CONFIG_DATA, CHOICE_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.mandatoryStatement(), MANDATORY_DATA, CHOICE_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.statusStatement(), STATUS_DATA, CHOICE_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.descriptionStatement(), DESCRIPTION_DATA, CHOICE_DATA,
+                                  ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.referenceStatement(), REFERENCE_DATA, CHOICE_DATA, ctx.identifier().getText());
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/CompilerAnnotationListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/CompilerAnnotationListener.java
new file mode 100644
index 0000000..22a68f7
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/CompilerAnnotationListener.java
@@ -0,0 +1,157 @@
+/*
+ * 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.YangAtomicPath;
+import org.onosproject.yang.compiler.datamodel.YangCompilerAnnotation;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+import org.onosproject.yang.compiler.datamodel.utils.DataModelUtils;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.linker.impl.YangResolutionInfoImpl;
+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 java.util.List;
+
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.addResolutionInfo;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.COMPILER_ANNOTATION_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.CompilerAnnotationStatementContext;
+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.getValidPrefix;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil.removeQuotesAndHandleConcat;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *   compiler-annotation-stmt = prefix:compiler-annotation-keyword string
+ *                          "{"
+ *                              [app-data-structure-stmt stmtsep]
+ *                              [app-extended-stmt stmtsep]
+ *                          "}"
+ *
+ * ANTLR grammar rule
+ *   compilerAnnotationStatement : COMPILER_ANNOTATION string LEFT_CURLY_BRACE
+ *        compilerAnnotationBodyStatement RIGHT_CURLY_BRACE;
+ *
+ *   compilerAnnotationBodyStatement : appDataStructureStatement? appExtendedStatement? ;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "compiler-annotation"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class CompilerAnnotationListener {
+
+    /**
+     * Creates a new compiler-annotation listener.
+     */
+    private CompilerAnnotationListener() {
+    }
+
+    /**
+     * Performs validation and updates the data model tree. It is called when parser receives an
+     * input matching the grammar rule(compiler-annotation).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processCompilerAnnotationEntry(TreeWalkListener listener,
+                                                      CompilerAnnotationStatementContext ctx) {
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, COMPILER_ANNOTATION_DATA, ctx.string().getText(), ENTRY);
+        String prefix = getValidPrefix(ctx.COMPILER_ANNOTATION().getText(), COMPILER_ANNOTATION_DATA, ctx);
+
+        YangCompilerAnnotation compilerAnnotation = new YangCompilerAnnotation();
+        compilerAnnotation.setPrefix(prefix);
+        compilerAnnotation.setPath(removeQuotesAndHandleConcat(ctx.string().getText()));
+
+        compilerAnnotation.setLineNumber(ctx.getStart().getLine());
+        compilerAnnotation.setCharPosition(ctx.getStart().getCharPositionInLine());
+        compilerAnnotation.setFileName(listener.getFileName());
+        // Validate augment argument string
+        List<YangAtomicPath> targetNodes = getValidAbsoluteSchemaNodeId(ctx.string().getText(),
+                                                                        COMPILER_ANNOTATION_DATA, ctx);
+
+        compilerAnnotation.setAtomicPathList(targetNodes);
+
+        int line = ctx.getStart().getLine();
+        int charPositionInLine = ctx.getStart().getCharPositionInLine();
+
+        Parsable curData = listener.getParsedDataStack().peek();
+        if (!(curData instanceof YangModule || curData instanceof YangSubModule)) {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, COMPILER_ANNOTATION_DATA,
+                                                                    ctx.string().getText(), ENTRY));
+        }
+
+        // Add resolution information to the list
+        YangResolutionInfoImpl resolutionInfo = new YangResolutionInfoImpl<>(
+                compilerAnnotation, (YangNode) curData, line, charPositionInLine);
+        addToResolutionList(resolutionInfo, ctx);
+
+        listener.getParsedDataStack().push(compilerAnnotation);
+    }
+
+    /**
+     * Performs validation and updates the data model tree. It is called when parser
+     * exits from grammar rule (compiler-annotation).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processCompilerAnnotationExit(TreeWalkListener listener,
+                                                     CompilerAnnotationStatementContext ctx) {
+
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, COMPILER_ANNOTATION_DATA, ctx.string().getText(), EXIT);
+        if (!(listener.getParsedDataStack().peek() instanceof YangCompilerAnnotation)) {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, COMPILER_ANNOTATION_DATA,
+                    ctx.string().getText(), EXIT));
+        }
+        listener.getParsedDataStack().pop();
+    }
+
+    /**
+     * Adds to resolution list.
+     *
+     * @param resolutionInfo resolution information.
+     * @param ctx            context object of the grammar rule
+     */
+    private static void addToResolutionList(YangResolutionInfoImpl<YangCompilerAnnotation> resolutionInfo,
+                                            CompilerAnnotationStatementContext ctx) {
+
+        try {
+            addResolutionInfo(resolutionInfo);
+        } catch (DataModelException e) {
+            throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                    COMPILER_ANNOTATION_DATA, ctx.COMPILER_ANNOTATION().getText(), ENTRY, e.getMessage()));
+        }
+    }
+}
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
new file mode 100644
index 0000000..186e1c8
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ConfigListener.java
@@ -0,0 +1,107 @@
+/*
+ * 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.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
+ *
+ * ABNF grammar as per RFC6020
+ * config-stmt         = config-keyword sep
+ *                       config-arg-str stmtend
+ * config-arg-str      = < a string that matches the rule
+ *                         config-arg >
+ * config-arg          = true-keyword / false-keyword
+ *
+ * ANTLR grammar rule
+ * configStatement : CONFIG_KEYWORD config STMTEND;
+ * config          : string;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "config"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class ConfigListener {
+
+    /**
+     * Creates a new config listener.
+     */
+    private ConfigListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (config), performs validation and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processConfigEntry(TreeWalkListener listener,
+                                          GeneratedYangParser.ConfigStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, CONFIG_DATA, "", ENTRY);
+
+        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));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ContactListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ContactListener.java
new file mode 100644
index 0000000..d648e52
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ContactListener.java
@@ -0,0 +1,115 @@
+/*
+ * 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.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+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 static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.CONTACT_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ContactStatementContext;
+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.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * meta-stmts          = ;; these stmts can appear in any order
+ *                       [organization-stmt stmtsep]
+ *                       [contact-stmt stmtsep]
+ *                       [description-stmt stmtsep]
+ *                       [reference-stmt stmtsep]
+ * contact-stmt        = contact-keyword sep string optsep stmtend
+ *
+ * ANTLR grammar rule
+ * meta_stmts : organization_stmt? contact_stmt? description_stmt? reference_stmt?
+ *            | organization_stmt? contact_stmt? reference_stmt? description_stmt?
+ *            | organization_stmt? description_stmt? contact_stmt? reference_stmt?
+ *            | organization_stmt? description_stmt? reference_stmt? contact_stmt?
+ *            | organization_stmt? reference_stmt? contact_stmt? description_stmt?
+ *            | organization_stmt? reference_stmt? description_stmt? contact_stmt?
+ *            | contact_stmt? organization_stmt? description_stmt? reference_stmt?
+ *            | contact_stmt? organization_stmt? reference_stmt? description_stmt?
+ *            | contact_stmt? reference_stmt? organization_stmt? description_stmt?
+ *            | contact_stmt? reference_stmt? description_stmt? organization_stmt?
+ *            | contact_stmt? description_stmt? reference_stmt? organization_stmt?
+ *            | contact_stmt? description_stmt? organization_stmt? reference_stmt?
+ *            | reference_stmt? contact_stmt? organization_stmt? description_stmt?
+ *            | reference_stmt? contact_stmt? description_stmt? organization_stmt?
+ *            | reference_stmt? organization_stmt? contact_stmt? description_stmt?
+ *            | reference_stmt? organization_stmt? description_stmt? contact_stmt?
+ *            | reference_stmt? description_stmt? organization_stmt? contact_stmt?
+ *            | reference_stmt? description_stmt? contact_stmt? organization_stmt?
+ *            | description_stmt? reference_stmt? contact_stmt? organization_stmt?
+ *            | description_stmt? reference_stmt? organization_stmt? contact_stmt?
+ *            | description_stmt? contact_stmt? reference_stmt? organization_stmt?
+ *            | description_stmt? contact_stmt? organization_stmt? reference_stmt?
+ *            | description_stmt? organization_stmt? contact_stmt? reference_stmt?
+ *            | description_stmt? organization_stmt? reference_stmt? contact_stmt?
+ *            ;
+ * contact_stmt : CONTACT_KEYWORD string STMTEND;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "contact"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class ContactListener {
+
+    /**
+     * Creates a new contact listener.
+     */
+    private ContactListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (contact), perform validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processContactEntry(TreeWalkListener listener, ContactStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, CONTACT_DATA, ctx.string().getText(), ENTRY);
+
+        // Obtain the node of the stack.
+        Parsable tmpNode = listener.getParsedDataStack().peek();
+        switch (tmpNode.getYangConstructType()) {
+            case MODULE_DATA: {
+                YangModule module = (YangModule) tmpNode;
+                module.setContact(ctx.string().getText());
+                break;
+            }
+            case SUB_MODULE_DATA: {
+                YangSubModule subModule = (YangSubModule) tmpNode;
+                subModule.setContact(ctx.string().getText());
+                break;
+            }
+            default:
+                throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, CONTACT_DATA,
+                                                                        ctx.string().getText(), ENTRY));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ContainerListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ContainerListener.java
new file mode 100644
index 0000000..abe01fa
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ContainerListener.java
@@ -0,0 +1,204 @@
+/*
+ * 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.YangAugment;
+import org.onosproject.yang.compiler.datamodel.YangCase;
+import org.onosproject.yang.compiler.datamodel.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangGrouping;
+import org.onosproject.yang.compiler.datamodel.YangInput;
+import org.onosproject.yang.compiler.datamodel.YangList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNotification;
+import org.onosproject.yang.compiler.datamodel.YangOutput;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+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 static org.onosproject.yang.compiler.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.CONFIG_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.CONTAINER_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.PRESENCE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ContainerStatementContext;
+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.getValidIdentifier;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.getParentNodeConfig;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yang.compiler.translator.tojava.YangDataModelFactory.getYangContainerNode;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *  container-stmt      = container-keyword sep identifier-arg-str optsep
+ *                        (";" /
+ *                         "{" stmtsep
+ *                             ;; these stmts can appear in any order
+ *                             [when-stmt stmtsep]
+ *                             *(if-feature-stmt stmtsep)
+ *                             *(must-stmt stmtsep)
+ *                             [presence-stmt stmtsep]
+ *                             [config-stmt stmtsep]
+ *                             [status-stmt stmtsep]
+ *                             [description-stmt stmtsep]
+ *                             [reference-stmt stmtsep]
+ *                             *((typedef-stmt /
+ *                                grouping-stmt) stmtsep)
+ *                             *(data-def-stmt stmtsep)
+ *                         "}")
+ *
+ * ANTLR grammar rule
+ *  containerStatement : CONTAINER_KEYWORD identifier
+ *                   (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | mustStatement |
+ *                   presenceStatement | configStatement | statusStatement | descriptionStatement |
+ *                   referenceStatement | typedefStatement | groupingStatement
+ *                    | dataDefStatement)* RIGHT_CURLY_BRACE);
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "container"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class ContainerListener {
+
+    /**
+     * Creates a new container listener.
+     */
+    private ContainerListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (container), performs validation and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processContainerEntry(TreeWalkListener listener,
+                                             ContainerStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, CONTAINER_DATA, ctx.identifier().getText(), ENTRY);
+
+        String identifier = getValidIdentifier(ctx.identifier().getText(), CONTAINER_DATA, ctx);
+
+        // Validate sub statement cardinality.
+        validateSubStatementsCardinality(ctx);
+
+        // Check for identifier collision
+        int line = ctx.getStart().getLine();
+        int charPositionInLine = ctx.getStart().getCharPositionInLine();
+        detectCollidingChildUtil(listener, line, charPositionInLine, identifier, CONTAINER_DATA);
+
+        YangContainer container = getYangContainerNode(JAVA_GENERATION);
+        container.setName(identifier);
+
+        container.setLineNumber(line);
+        container.setCharPosition(charPositionInLine);
+        container.setFileName(listener.getFileName());
+        /*
+         * If "config" is not specified, the default is the same as the parent
+         * schema node's "config" value.
+         */
+        if (ctx.configStatement().isEmpty()) {
+            boolean parentConfig = getParentNodeConfig(listener);
+            container.setConfig(parentConfig);
+        }
+
+        Parsable curData = listener.getParsedDataStack().peek();
+        if (curData instanceof YangModule || curData instanceof YangSubModule
+                || curData instanceof YangContainer || curData instanceof YangList
+                || curData instanceof YangCase || curData instanceof YangNotification
+                || curData instanceof YangInput || curData instanceof YangOutput
+                || curData instanceof YangAugment || curData instanceof YangGrouping) {
+            YangNode curNode = (YangNode) curData;
+            try {
+                curNode.addChild(container);
+            } catch (DataModelException e) {
+                throw new ParserException(constructExtendedListenerErrorMessage(
+                        UNHANDLED_PARSED_DATA, CONTAINER_DATA,
+                        ctx.identifier().getText(), ENTRY, e.getMessage()));
+            }
+            listener.getParsedDataStack().push(container);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, CONTAINER_DATA,
+                                                                    ctx.identifier().getText(), ENTRY));
+        }
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (container), it perform
+     * validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processContainerExit(TreeWalkListener listener,
+                                            ContainerStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, CONTAINER_DATA, ctx.identifier().getText(), EXIT);
+
+        if (listener.getParsedDataStack().peek() instanceof YangContainer) {
+            YangContainer yangContainer = (YangContainer) listener.getParsedDataStack().peek();
+            try {
+                yangContainer.validateDataOnExit();
+            } catch (DataModelException e) {
+                ParserException parserException = new ParserException(constructExtendedListenerErrorMessage(
+                        UNHANDLED_PARSED_DATA, CONTAINER_DATA, ctx.identifier().getText(), EXIT, e.getMessage()));
+                parserException.setLine(ctx.getStart().getLine());
+                parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+                throw parserException;
+            }
+            listener.getParsedDataStack().pop();
+        } else {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, CONTAINER_DATA,
+                                                                    ctx.identifier().getText(), EXIT));
+        }
+    }
+
+    /**
+     * Validates the cardinality of container sub-statements as per grammar.
+     *
+     * @param ctx context object of the grammar rule
+     */
+    private static void validateSubStatementsCardinality(ContainerStatementContext ctx) {
+
+        validateCardinalityMaxOne(ctx.presenceStatement(), PRESENCE_DATA, CONTAINER_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.configStatement(), CONFIG_DATA, CONTAINER_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.descriptionStatement(), DESCRIPTION_DATA, CONTAINER_DATA,
+                                  ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.referenceStatement(), REFERENCE_DATA, CONTAINER_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.statusStatement(), STATUS_DATA, CONTAINER_DATA, ctx.identifier().getText());
+        // TODO validate 'when' cardinality
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DataStructureKeyListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DataStructureKeyListener.java
new file mode 100644
index 0000000..eed8185
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DataStructureKeyListener.java
@@ -0,0 +1,93 @@
+/*
+ * 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.YangAppDataStructure;
+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 org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.KEY_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DataStructureKeyStatementContext;
+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.removeQuotesAndHandleConcat;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yang.compiler.utils.UtilConstants.SPACE;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *   data-structure-key-stmt = prefix:key-keyword string ";"
+ *
+ * ANTLR grammar rule
+ *   dataStructureKeyStatement : DATA_STRUCTURE_KEY string STMTEND;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "key"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class DataStructureKeyListener {
+
+    /**
+     * Creates a new data-structure-key listener.
+     */
+    private DataStructureKeyListener() {
+    }
+
+    /**
+     * Performs validation and updates the data model tree. It is called when parser receives an
+     * input matching the grammar rule(key).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processDataStructureKeyEntry(TreeWalkListener listener,
+                                                    DataStructureKeyStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, KEY_DATA, ctx.string().getText(), ENTRY);
+
+        Parsable tmpData = listener.getParsedDataStack().peek();
+        if (listener.getParsedDataStack().peek() instanceof YangAppDataStructure) {
+            YangAppDataStructure dataStructure = (YangAppDataStructure) tmpData;
+
+            dataStructure.setLineNumber(ctx.getStart().getLine());
+            dataStructure.setCharPosition(ctx.getStart().getCharPositionInLine());
+            dataStructure.setFileName(listener.getFileName());
+            String tmpKeyValue = removeQuotesAndHandleConcat(ctx.string().getText());
+            if (tmpKeyValue.contains(SPACE)) {
+                String[] keyValues = tmpKeyValue.split(SPACE);
+                for (String keyValue : keyValues) {
+                    dataStructure.addKey(keyValue);
+                }
+            } else {
+                dataStructure.addKey(tmpKeyValue);
+            }
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, KEY_DATA, ctx.string().getText(),
+                    ENTRY));
+        }
+    }
+}
+
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/Decimal64Listener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/Decimal64Listener.java
new file mode 100644
index 0000000..5ebd7f1
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/Decimal64Listener.java
@@ -0,0 +1,153 @@
+/*
+ * 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
+ * type-body-stmts     = numerical-restrictions /
+ *                       decimal64-specification /
+ *                       string-restrictions /
+ *                       enum-specification /
+ *                       leafref-specification /
+ *                       identityref-specification /
+ *                       instance-identifier-specification /
+ *                       bits-specification /
+ *                       union-specification
+ *
+ * decimal64-specification = fraction-digits-stmt [range-stmt stmtsep]
+ *
+ * fraction-digits-stmt = fraction-digits-keyword sep
+ *                         fraction-digits-arg-str stmtend
+ *
+ * fraction-digits-arg-str = < a string that matches the rule
+ *                             fraction-digits-arg >
+ *
+ * fraction-digits-arg = ("1" ["0" / "1" / "2" / "3" / "4" /
+ *                              "5" / "6" / "7" / "8"])
+ *                        / "2" / "3" / "4" / "5" / "6" / "7" / "8" / "9"
+ *
+ * range-stmt          = range-keyword sep range-arg-str optsep
+ *                        (";" /
+ *                         "{" stmtsep
+ *                             ;; these stmts can appear in any order
+ *                             [error-message-stmt stmtsep]
+ *                             [error-app-tag-stmt stmtsep]
+ *                             [description-stmt stmtsep]
+ *                             [reference-stmt stmtsep]
+ *                          "}")
+ * ANTLR grammar rule
+ *
+ * typeBodyStatements : numericalRestrictions | decimal64Specification | stringRestrictions | enumSpecification
+ *                     | leafrefSpecification | identityrefSpecification | instanceIdentifierSpecification
+ *                     | bitsSpecification | unionSpecification;
+ *
+ * decimal64Specification : fractionDigitStatement rangeStatement?;
+ *
+ * fractionDigitStatement : FRACTION_DIGITS_KEYWORD fraction STMTEND;
+ *
+ * fraction : string;
+ */
+
+import org.onosproject.yang.compiler.datamodel.YangDecimal64;
+import org.onosproject.yang.compiler.datamodel.YangRangeRestriction;
+import org.onosproject.yang.compiler.datamodel.YangType;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.Decimal64SpecificationContext;
+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.DECIMAL64_DATA;
+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_HOLDER;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+
+/**
+ * Represents listener based call back function corresponding to the "decimal64" rule
+ * defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class Decimal64Listener {
+
+    /**
+     * Creates a new Decimal64 listener.
+     */
+    private Decimal64Listener() {
+    }
+
+    /**
+     * It is called when parser enters grammar rule (decimal64), it perform
+     * validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processDecimal64Entry(TreeWalkListener listener,
+                                             Decimal64SpecificationContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, DECIMAL64_DATA, "", ENTRY);
+
+        Parsable tmpNode = listener.getParsedDataStack().peek();
+        if (tmpNode instanceof YangType) {
+            YangType<YangDecimal64<YangRangeRestriction>> typeNode =
+                    (YangType<YangDecimal64<YangRangeRestriction>>) tmpNode;
+            YangDecimal64 decimal64Node = new YangDecimal64();
+            typeNode.setDataTypeExtendedInfo(decimal64Node);
+
+            decimal64Node.setLineNumber(ctx.getStart().getLine());
+            decimal64Node.setCharPosition(ctx.getStart().getCharPositionInLine());
+            decimal64Node.setFileName(listener.getFileName());
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, DECIMAL64_DATA, "", ENTRY));
+        }
+    }
+
+    /**
+     * Performs validation and updates the data model tree.
+     * It is called when parser exits from grammar rule (decimal64).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processDecimal64Exit(TreeWalkListener listener,
+                                            Decimal64SpecificationContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, DECIMAL64_DATA, "", EXIT);
+
+        Parsable tmpNode = listener.getParsedDataStack().peek();
+        if (tmpNode instanceof YangType) {
+            YangType<YangDecimal64<YangRangeRestriction>> typeNode =
+                    (YangType<YangDecimal64<YangRangeRestriction>>) tmpNode;
+            YangDecimal64<YangRangeRestriction> decimal64Node = typeNode.getDataTypeExtendedInfo();
+            try {
+                decimal64Node.validateRange();
+            } catch (DataModelException e) {
+                throw new ParserException(e);
+            }
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, DECIMAL64_DATA, "", EXIT));
+        }
+    }
+}
\ No newline at end of file
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
new file mode 100644
index 0000000..0000aff
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DefaultListener.java
@@ -0,0 +1,104 @@
+/*
+ * 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
+ *
+ * typedef-stmt        = typedef-keyword sep identifier-arg-str optsep
+ *                       "{" stmtsep
+ *                           ;; these stmts can appear in any order
+ *                           type-stmt stmtsep
+ *                          [units-stmt stmtsep]
+ *                           [default-stmt stmtsep]
+ *                           [status-stmt stmtsep]
+ *                           [description-stmt stmtsep]
+ *                           [reference-stmt stmtsep]
+ *                         "}"
+ * default-stmt        = default-keyword sep string stmtend
+
+ *
+ * ANTLR grammar rule
+ * typedefStatement : TYPEDEF_KEYWORD IDENTIFIER LEFT_CURLY_BRACE
+ *                (typeStatement | unitsStatement | defaultStatement | statusStatement
+ *                | descriptionStatement | referenceStatement)* RIGHT_CURLY_BRACE;
+ * 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.utils.Parsable;
+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.DEFAULT_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DefaultStatementContext;
+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.removeQuotesAndHandleConcat;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/**
+ * Represents listener for default YANG statement.
+ */
+public final class DefaultListener {
+
+    /**
+     * Creates a new default listener.
+     */
+    private DefaultListener() {
+    }
+
+    /**
+     * It is called when parser enters grammar rule (default), it perform
+     * validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processDefaultEntry(TreeWalkListener listener,
+                                           DefaultStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, DEFAULT_DATA, ctx.string().getText(), ENTRY);
+
+        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));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DescriptionListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DescriptionListener.java
new file mode 100644
index 0000000..fdc5cc4
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/DescriptionListener.java
@@ -0,0 +1,77 @@
+/*
+ * 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.YangDesc;
+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 static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.DescriptionStatementContext;
+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.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * description-stmt    = description-keyword sep string optsep stmtend
+ *
+ * ANTLR grammar rule
+ * descriptionStatement : DESCRIPTION_KEYWORD string STMTEND;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the
+ * "description" rule defined in ANTLR grammar file for corresponding ABNF rule
+ * in RFC 6020.
+ */
+public final class DescriptionListener {
+
+    /**
+     * Creates a new description listener.
+     */
+    private DescriptionListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (description), perform validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processDescriptionEntry(TreeWalkListener listener,
+                                               DescriptionStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, DESCRIPTION_DATA, ctx.string().getText(), ENTRY);
+
+        Parsable tmpData = listener.getParsedDataStack().peek();
+        if (tmpData instanceof YangDesc) {
+            YangDesc description = (YangDesc) tmpData;
+            description.setDescription(ctx.string().getText());
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, DESCRIPTION_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/listeners/EnumListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/EnumListener.java
new file mode 100644
index 0000000..46f2e86
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/EnumListener.java
@@ -0,0 +1,191 @@
+/*
+ * 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
+ *  enum-stmt           = enum-keyword sep string optsep
+ *                        (";" /
+ *                         "{" stmtsep
+ *                             ;; these stmts can appear in any order
+ *                             [value-stmt stmtsep]
+ *                             [status-stmt stmtsep]
+ *                             [description-stmt stmtsep]
+ *                             [reference-stmt stmtsep]
+ *                          "}")
+ *
+ * ANTLR grammar rule
+ * enumStatement : ENUM_KEYWORD string (STMTEND | LEFT_CURLY_BRACE enumStatementBody RIGHT_CURLY_BRACE);
+ *
+ *         enumStatementBody : valueStatement? statusStatement? descriptionStatement? referenceStatement?
+ *         | valueStatement? statusStatement? referenceStatement? descriptionStatement?
+ *         | valueStatement? descriptionStatement? statusStatement? referenceStatement?
+ *         | valueStatement? descriptionStatement? referenceStatement? statusStatement?
+ *         | valueStatement? referenceStatement? statusStatement? descriptionStatement?
+ *         | valueStatement? referenceStatement? descriptionStatement? statusStatement?
+ *         | statusStatement? valueStatement? descriptionStatement? referenceStatement?
+ *         | statusStatement? valueStatement? referenceStatement? descriptionStatement?
+ *         | statusStatement? descriptionStatement? descriptionStatement? valueStatement?
+ *         | statusStatement? descriptionStatement? valueStatement? descriptionStatement?
+ *         | statusStatement? referenceStatement? valueStatement? descriptionStatement?
+ *         | statusStatement? referenceStatement? descriptionStatement? valueStatement?
+ *         | descriptionStatement? valueStatement? statusStatement? referenceStatement?
+ *         | descriptionStatement? valueStatement? referenceStatement? statusStatement?
+ *         | descriptionStatement? statusStatement? valueStatement? referenceStatement?
+ *         | descriptionStatement? statusStatement? referenceStatement? valueStatement?
+ *         | descriptionStatement? referenceStatement? valueStatement? statusStatement?
+ *         | descriptionStatement? referenceStatement? statusStatement? valueStatement?
+ *         | referenceStatement? valueStatement? descriptionStatement? statusStatement?
+ *         | referenceStatement? valueStatement? statusStatement? descriptionStatement?
+ *         | referenceStatement? statusStatement? descriptionStatement? valueStatement?
+ *         | referenceStatement? statusStatement? valueStatement? descriptionStatement?
+ *         | referenceStatement? descriptionStatement? valueStatement? statusStatement?
+ *         | referenceStatement? descriptionStatement? statusStatement? valueStatement?
+ *         ;
+ */
+
+import org.onosproject.yang.compiler.datamodel.YangEnum;
+import org.onosproject.yang.compiler.datamodel.YangEnumeration;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+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.ENUM_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.EnumStatementContext;
+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.DUPLICATE_ENTRY;
+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;
+import static org.onosproject.yang.compiler.utils.UtilConstants.EMPTY_STRING;
+import static org.onosproject.yang.compiler.utils.UtilConstants.QUOTES;
+
+/**
+ * Represents listener based call back function corresponding to the "enum" rule
+ * defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class EnumListener {
+
+    /**
+     * Creates a new enum listener.
+     */
+    private EnumListener() {
+    }
+
+    /**
+     * It is called when parser enters grammar rule (enum), it perform
+     * validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processEnumEntry(TreeWalkListener listener, EnumStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, ENUM_DATA, ctx.string().getText(), ENTRY);
+
+        YangEnum enumNode = new YangEnum();
+        enumNode.setNamedValue(getValidNamedValue(ctx.string().getText()));
+
+        enumNode.setLineNumber(ctx.getStart().getLine());
+        enumNode.setCharPosition(ctx.getStart().getCharPositionInLine());
+        enumNode.setFileName(listener.getFileName());
+        listener.getParsedDataStack().push(enumNode);
+    }
+
+    /*Removes quotes from the enum name if present.*/
+    private static String getValidNamedValue(String name) {
+        if (name.contains(QUOTES)) {
+            name = name.replace(QUOTES, EMPTY_STRING);
+        }
+        return name;
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (enum), it perform
+     * validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processEnumExit(TreeWalkListener listener, EnumStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, ENUM_DATA, ctx.string().getText(), EXIT);
+
+        Parsable tmpEnumNode = listener.getParsedDataStack().peek();
+        if (tmpEnumNode instanceof YangEnum) {
+            listener.getParsedDataStack().pop();
+
+            // Check for stack to be non empty.
+            checkStackIsNotEmpty(listener, MISSING_HOLDER, ENUM_DATA, ctx.string().getText(), EXIT);
+
+            Parsable tmpNode = listener.getParsedDataStack().peek();
+            switch (tmpNode.getYangConstructType()) {
+                case ENUMERATION_DATA: {
+                    YangEnumeration yangEnumeration = (YangEnumeration) tmpNode;
+                    if (ctx.enumStatementBody() == null || ctx.enumStatementBody().valueStatement() == null) {
+                        int maxValue = 0;
+                        boolean isValuePresent = false;
+
+                        for (YangEnum curEnum : yangEnumeration.getEnumSet()) {
+                            if (curEnum.getValue() == Integer.MAX_VALUE) {
+                                ParserException parserException = new ParserException("YANG file error : "
+                                                                                              + "An enum value MUST be specified for enum substatements following the one"
+                                                                                              + "with the current highest value");
+                                parserException.setLine(ctx.getStart().getLine());
+                                parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+                                throw parserException;
+                            } else if (maxValue <= curEnum.getValue()) {
+                                maxValue = curEnum.getValue();
+                                isValuePresent = true;
+                            }
+                        }
+                        if (isValuePresent) {
+                            maxValue++;
+                        }
+                        ((YangEnum) tmpEnumNode).setValue(maxValue);
+                    }
+                    try {
+                        yangEnumeration.addEnumInfo((YangEnum) tmpEnumNode);
+                    } catch (DataModelException e) {
+                        ParserException parserException = new ParserException(constructExtendedListenerErrorMessage(
+                                DUPLICATE_ENTRY, ENUM_DATA, ctx.string().getText(), EXIT, e.getMessage()));
+                        parserException.setLine(ctx.getStart().getLine());
+                        parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+                        throw parserException;
+                    }
+                    break;
+                }
+                default:
+                    throw new ParserException(
+                            constructListenerErrorMessage(INVALID_HOLDER, ENUM_DATA, ctx.string().getText(), EXIT));
+            }
+        } else {
+            throw new ParserException(
+                    constructListenerErrorMessage(MISSING_CURRENT_HOLDER, ENUM_DATA, ctx.string().getText(), EXIT));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/EnumerationListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/EnumerationListener.java
new file mode 100644
index 0000000..c73ea68
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/EnumerationListener.java
@@ -0,0 +1,227 @@
+/*
+ * 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
+ * type-body-stmts     = numerical-restrictions /
+ *                       decimal64-specification /
+ *                      string-restrictions /
+ *                       enum-specification /
+ *                       leafref-specification /
+ *                       identityref-specification /
+ *                       instance-identifier-specification /
+ *                       bits-specification /
+ *                       union-specification
+ *
+ * enum-specification  = 1*(enum-stmt stmtsep)
+ *
+ * ANTLR grammar rule
+ *
+ * typeBodyStatements : numericalRestrictions | stringRestrictions | enumSpecification
+ *                 | leafrefSpecification | identityrefSpecification | instanceIdentifierSpecification
+ *                 | bitsSpecification | unionSpecification;
+ *
+ * enumSpecification : enumStatement+;
+ */
+
+import org.onosproject.yang.compiler.datamodel.YangEnumeration;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangLeafList;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangType;
+import org.onosproject.yang.compiler.datamodel.YangTypeDef;
+import org.onosproject.yang.compiler.datamodel.YangUnion;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.EnumSpecificationContext;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yang.compiler.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.ENUMERATION_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.TYPE_DATA;
+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.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yang.compiler.translator.tojava.YangDataModelFactory.getYangEnumerationNode;
+
+/**
+ * Represents listener based call back function corresponding to the
+ * "enumeration" rule defined in ANTLR grammar file for corresponding ABNF rule
+ * in RFC 6020.
+ */
+public final class EnumerationListener {
+
+    /**
+     * Suffix to be used while creating enumeration class.
+     */
+    private static final String ENUMERATION_CLASS_SUFFIX = "_enum";
+
+    /**
+     * Creates a new enumeration listener.
+     */
+    private EnumerationListener() {
+    }
+
+    /**
+     * It is called when parser enters grammar rule (enumeration), it perform
+     * validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processEnumerationEntry(TreeWalkListener listener,
+                                               EnumSpecificationContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, ENUMERATION_DATA, "", ENTRY);
+
+        if (listener.getParsedDataStack().peek() instanceof YangType) {
+            YangEnumeration enumerationNode = getYangEnumerationNode(JAVA_GENERATION);
+            enumerationNode.setLineNumber(ctx.getStart().getLine());
+            enumerationNode.setCharPosition(ctx.getStart().getCharPositionInLine());
+            enumerationNode.setFileName(listener.getFileName());
+            Parsable typeData = listener.getParsedDataStack().pop();
+
+            // Check for stack to be non empty.
+            checkStackIsNotEmpty(listener, MISSING_HOLDER, ENUMERATION_DATA, "", ENTRY);
+
+            Parsable tmpData = listener.getParsedDataStack().peek();
+
+            switch (tmpData.getYangConstructType()) {
+                case LEAF_DATA:
+                    // Set the name of enumeration same as leaf.
+                    enumerationNode.setName(((YangLeaf) tmpData).getName() + ENUMERATION_CLASS_SUFFIX);
+                    // Pop the stack entry to obtain the parent YANG node.
+                    Parsable leaf = listener.getParsedDataStack().pop();
+                    // Add the enumeration node to the parent holder of leaf.
+                    addChildToParentNode(listener, enumerationNode);
+                    // Push the popped entry back to the stack.
+                    listener.getParsedDataStack().push(leaf);
+                    break;
+                case LEAF_LIST_DATA:
+                    // Set the name of enumeration same as leaf list.
+                    enumerationNode.setName(((YangLeafList) tmpData).getName() + ENUMERATION_CLASS_SUFFIX);
+                    // Pop the stack entry to obtain the parent YANG node.
+                    Parsable leafList = listener.getParsedDataStack().pop();
+                    // Add the enumeration node to the parent holder of leaf.
+                    addChildToParentNode(listener, enumerationNode);
+                    // Push the popped entry back to the stack.
+                    listener.getParsedDataStack().push(leafList);
+                    break;
+                case UNION_DATA:
+                    YangUnion yangUnion = (YangUnion) tmpData;
+                    /*
+                     * In case parent of enumeration is a union, name of the
+                     * enumeration is parent union name suffixed with running
+                     * integer number, this is done because under union there
+                     * could be multiple child union types.
+                     */
+                    enumerationNode.setName(yangUnion.getName() + ENUMERATION_CLASS_SUFFIX
+                                                    + yangUnion.getChildUnionNumber());
+                    // Increment the running number.
+                    yangUnion.setChildUnionNumber(yangUnion.getChildUnionNumber() + 1);
+                    // Add union as a child to parent union.
+                    addChildToParentNode(listener, enumerationNode);
+                    break;
+                case TYPEDEF_DATA:
+                    YangTypeDef typeDef = (YangTypeDef) tmpData;
+                    // Set the name of enumeration same as typedef name.
+                    enumerationNode.setName(typeDef.getName() + ENUMERATION_CLASS_SUFFIX);
+                    // Add enumeration as a child to parent type def.
+                    addChildToParentNode(listener, enumerationNode);
+                    break;
+                // TODO deviate.
+                default:
+                    throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, TYPE_DATA,
+                                                                            ((YangType<?>) typeData).getDataTypeName(), ENTRY));
+            }
+            listener.getParsedDataStack().push(typeData);
+            listener.getParsedDataStack().push(enumerationNode);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, ENUMERATION_DATA, "", ENTRY));
+        }
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (enumeration), it
+     * perform validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processEnumerationExit(TreeWalkListener listener,
+                                              EnumSpecificationContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, ENUMERATION_DATA, "", EXIT);
+
+        Parsable tmpEnumerationNode = listener.getParsedDataStack().peek();
+        if (tmpEnumerationNode instanceof YangEnumeration) {
+            YangEnumeration enumerationNode = (YangEnumeration) tmpEnumerationNode;
+            listener.getParsedDataStack().pop();
+
+            // Check for stack to be non empty.
+            checkStackIsNotEmpty(listener, MISSING_HOLDER, ENUMERATION_DATA, "", EXIT);
+
+            Parsable tmpNode = listener.getParsedDataStack().peek();
+            switch (tmpNode.getYangConstructType()) {
+                case TYPE_DATA: {
+                    YangType<YangEnumeration> typeNode = (YangType<YangEnumeration>) tmpNode;
+                    typeNode.setDataTypeExtendedInfo(enumerationNode);
+                    break;
+                }
+                default:
+                    throw new ParserException(
+                            constructListenerErrorMessage(INVALID_HOLDER, ENUMERATION_DATA, "", EXIT));
+            }
+        } else {
+            throw new ParserException(
+                    constructListenerErrorMessage(MISSING_CURRENT_HOLDER, ENUMERATION_DATA, "", EXIT));
+        }
+    }
+
+    /**
+     * Adds the enumeration node to the parent holder.
+     *
+     * @param listener        listener's object
+     * @param enumerationNode enumeration node which needs to be added to parent
+     */
+    private static void addChildToParentNode(TreeWalkListener listener, YangEnumeration enumerationNode) {
+        if (!(listener.getParsedDataStack().peek() instanceof YangNode)) {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, ENUMERATION_DATA,
+                                                                    "", ENTRY));
+        } else {
+            YangNode curNode = (YangNode) listener.getParsedDataStack().peek();
+            try {
+                curNode.addChild(enumerationNode);
+            } catch (DataModelException e) {
+                throw new ParserException(constructExtendedListenerErrorMessage(
+                        UNHANDLED_PARSED_DATA, ENUMERATION_DATA, "", ENTRY, e.getMessage()));
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ErrorAppTagListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ErrorAppTagListener.java
new file mode 100644
index 0000000..6c2c05f
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ErrorAppTagListener.java
@@ -0,0 +1,87 @@
+/*
+ * 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.YangAppErrorHolder;
+import org.onosproject.yang.compiler.datamodel.YangAppErrorInfo;
+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.ERROR_APP_TAG_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ErrorAppTagStatementContext;
+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.removeQuotesAndHandleConcat;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC 6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC 6020
+ *
+ *  error-app-tag-stmt  = error-app-tag-keyword sep string stmtend
+ *
+ * ANTLR grammar rule
+ * errorAppTagStatement : ERROR_APP_TAG_KEYWORD string STMTEND;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the
+ * error app tag defined in ANTLR grammar file for corresponding ABNF rule
+ * in RFC 6020.
+ */
+public final class ErrorAppTagListener {
+
+    /**
+     * Creates a new error app tag listener.
+     */
+    private ErrorAppTagListener() {
+    }
+
+    /**
+     * Performs validations and updates the data model tree. It is called when parser
+     * receives an input matching the grammar rule error app tag.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processErrorAppTagMessageEntry(TreeWalkListener listener,
+                                                      ErrorAppTagStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, ERROR_APP_TAG_DATA, ctx.string().getText(), ENTRY);
+        String errorMessage = removeQuotesAndHandleConcat(ctx.string().getText());
+        // Obtain the node of the stack.
+        Parsable tmpNode = listener.getParsedDataStack().peek();
+        if (tmpNode instanceof YangAppErrorHolder) {
+            YangAppErrorInfo yangAppErrorInfo = ((YangAppErrorHolder) tmpNode).getAppErrorInfo();
+            yangAppErrorInfo.setErrorAppTag(errorMessage);
+            yangAppErrorInfo.setLineNumber(ctx.getStart().getLine());
+            yangAppErrorInfo.setCharPosition(ctx.getStart().getCharPositionInLine());
+            yangAppErrorInfo.setFileName(listener.getFileName());
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, ERROR_APP_TAG_DATA,
+                                                                    ctx.string().getText(), ENTRY));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ErrorMessageListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ErrorMessageListener.java
new file mode 100644
index 0000000..137502d
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ErrorMessageListener.java
@@ -0,0 +1,86 @@
+/*
+ * 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.YangAppErrorHolder;
+import org.onosproject.yang.compiler.datamodel.YangAppErrorInfo;
+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 static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.ERROR_MESSAGE_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ErrorMessageStatementContext;
+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.removeQuotesAndHandleConcat;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *
+ *  error-message-stmt  = error-message-keyword sep string stmtend
+ *
+ * ANTLR grammar rule
+ * errorMessageStatement : ERROR_MESSAGE_KEYWORD string STMTEND;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the
+ * app error message defined in ANTLR grammar file for corresponding ABNF rule
+ * in RFC 6020.
+ */
+public final class ErrorMessageListener {
+
+    /**
+     * Creates a new must listener.
+     */
+    private ErrorMessageListener() {
+    }
+
+    /**
+     * Performs validations and updates the data model tree. It is called when parser
+     * receives an input matching the grammar rule (app error message).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processErrorMessageEntry(TreeWalkListener listener,
+                                                ErrorMessageStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, ERROR_MESSAGE_DATA, ctx.string().getText(), ENTRY);
+        String errorMessage = removeQuotesAndHandleConcat(ctx.string().getText());
+
+        // Obtain the node of the stack.
+        Parsable tmpNode = listener.getParsedDataStack().peek();
+        if (tmpNode instanceof YangAppErrorHolder) {
+            YangAppErrorInfo yangAppErrorInfo = ((YangAppErrorHolder) tmpNode).getAppErrorInfo();
+            yangAppErrorInfo.setErrorMessage(errorMessage);
+
+            yangAppErrorInfo.setLineNumber(ctx.getStart().getLine());
+            yangAppErrorInfo.setCharPosition(ctx.getStart().getCharPositionInLine());
+            yangAppErrorInfo.setFileName(listener.getFileName());
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, ERROR_MESSAGE_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/listeners/ExtensionListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ExtensionListener.java
new file mode 100644
index 0000000..d4d1749
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ExtensionListener.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.YangExtension;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+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.ListenerUtil;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.EXTENSION_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ExtensionStatementContext;
+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.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * extension-stmt      = extension-keyword sep identifier-arg-str optsep
+ *                       (";" /
+ *                        "{" stmtsep
+ *                            ;; these stmts can appear in any order
+ *                            [argument-stmt stmtsep]
+ *                            [status-stmt stmtsep]
+ *                            [description-stmt stmtsep]
+ *                            [reference-stmt stmtsep]
+ *                        "}")
+ *
+ * ANTLR grammar rule
+ * extensionStatement : EXTENSION_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE extensionBody RIGHT_CURLY_BRACE);
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "extension"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class ExtensionListener {
+
+    /**
+     * Creates a new extension listener.
+     */
+    private ExtensionListener() {
+    }
+
+    /**
+     * Performs validation and updates the data model tree. It is called when parser
+     * receives an input matching the grammar rule (extension).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processExtensionEntry(TreeWalkListener listener,
+                                             ExtensionStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, EXTENSION_DATA, ctx.identifier().getText(), ENTRY);
+
+        String identifier = getValidIdentifier(ctx.identifier().getText(), EXTENSION_DATA, ctx);
+
+        YangExtension extension = new YangExtension();
+
+        extension.setLineNumber(ctx.getStart().getLine());
+        extension.setCharPosition(ctx.getStart().getCharPositionInLine());
+        extension.setFileName(listener.getFileName());
+        extension.setName(identifier);
+
+        Parsable curData = listener.getParsedDataStack().peek();
+        switch (curData.getYangConstructType()) {
+            case MODULE_DATA:
+                YangModule module = ((YangModule) curData);
+                module.addExtension(extension);
+                break;
+            case SUB_MODULE_DATA:
+                YangSubModule subModule = ((YangSubModule) curData);
+                subModule.addExtension(extension);
+                break;
+            default:
+                throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, EXTENSION_DATA,
+                                                                        ctx.identifier().getText(), ENTRY));
+        }
+        listener.getParsedDataStack().push(extension);
+    }
+
+    /**
+     * Performs validation and updates the data model tree. It is called when parser exits
+     * from grammar rule(extension).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processExtensionExit(TreeWalkListener listener,
+                                            ExtensionStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, EXTENSION_DATA, ctx.identifier().getText(), EXIT);
+
+        if (!(listener.getParsedDataStack().peek() instanceof YangExtension)) {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, EXTENSION_DATA,
+                                                                    ctx.identifier().getText(), EXIT));
+        }
+        listener.getParsedDataStack().pop();
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/FeatureListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/FeatureListener.java
new file mode 100644
index 0000000..5b14c25
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/FeatureListener.java
@@ -0,0 +1,124 @@
+/*
+ * 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
+ *  feature-stmt        = feature-keyword sep identifier-arg-str optsep
+ *                        (";" /
+ *                         "{" stmtsep
+ *                             ;; these stmts can appear in any order
+ *                             *(if-feature-stmt stmtsep)
+ *                             [status-stmt stmtsep]
+ *                             [description-stmt stmtsep]
+ *                             [reference-stmt stmtsep]
+ *                         "}")
+ *
+ *
+ *
+ * ANTLR grammar rule
+ * featureStatement : FEATURE_KEYWORD string (STMTEND | LEFT_CURLY_BRACE featureBody RIGHT_CURLY_BRACE);
+ */
+
+import org.onosproject.yang.compiler.datamodel.YangFeature;
+import org.onosproject.yang.compiler.datamodel.YangFeatureHolder;
+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 org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.FEATURE_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.FeatureStatementContext;
+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.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/**
+ * Represents listener based call back function corresponding to the "feature"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class FeatureListener {
+
+    /**
+     * Creates a new feature listener.
+     */
+    private FeatureListener() {
+    }
+
+    /**
+     * Performs validation and updates the data model tree.It is called when parser receives
+     * an input matching the grammar rule (feature).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processFeatureEntry(TreeWalkListener listener,
+                                           FeatureStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, FEATURE_DATA, ctx.string().getText(), ENTRY);
+
+        String identifier = getValidIdentifier(ctx.string().getText(), FEATURE_DATA, ctx);
+
+        // Obtain the node of the stack.
+        Parsable tmpNode = listener.getParsedDataStack().peek();
+        if (tmpNode instanceof YangFeatureHolder) {
+            YangFeatureHolder featureHolder = (YangFeatureHolder) tmpNode;
+
+            YangFeature feature = new YangFeature();
+            feature.setName(identifier);
+
+            feature.setLineNumber(ctx.getStart().getLine());
+            feature.setCharPosition(ctx.getStart().getCharPositionInLine());
+            feature.setFileName(listener.getFileName());
+            featureHolder.addFeatureList(feature);
+            listener.getParsedDataStack().push(feature);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, FEATURE_DATA,
+                    ctx.string().getText(), ENTRY));
+        }
+    }
+
+    /**
+     * Perform validations and updates the data model tree.It is called when parser exits from
+     * grammar rule(feature).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processFeatureExit(TreeWalkListener listener,
+                                          FeatureStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, FEATURE_DATA, ctx.string().getText(), EXIT);
+
+        if (listener.getParsedDataStack().peek() instanceof YangFeature) {
+            listener.getParsedDataStack().pop();
+        } else {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, FEATURE_DATA,
+                    ctx.string().getText(), EXIT));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/FractionDigitsListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/FractionDigitsListener.java
new file mode 100644
index 0000000..ae68da0
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/FractionDigitsListener.java
@@ -0,0 +1,130 @@
+/*
+ * 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
+ * decimal64-specification = fraction-digits-stmt
+ *
+ * fraction-digits-stmt = fraction-digits-keyword sep
+ *                        fraction-digits-arg-str stmtend
+ *
+ * fraction-digits-arg-str = < a string that matches the rule
+ *                             fraction-digits-arg >
+ *
+ * fraction-digits-arg = ("1" ["0" / "1" / "2" / "3" / "4" /
+ *                              "5" / "6" / "7" / "8"])
+ *                       / "2" / "3" / "4" / "5" / "6" / "7" / "8" / "9"
+ *
+ * ANTLR grammar rule
+ * decimal64Specification : FRACTION_DIGITS_KEYWORD fraction STMTEND;
+ *
+ * fraction : string;
+ */
+
+import org.onosproject.yang.compiler.datamodel.YangDecimal64;
+import org.onosproject.yang.compiler.datamodel.YangRangeRestriction;
+import org.onosproject.yang.compiler.datamodel.YangType;
+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.YangDecimal64.MAX_FRACTION_DIGITS_VALUE;
+import static org.onosproject.yang.compiler.datamodel.YangDecimal64.MIN_FRACTION_DIGITS_VALUE;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.FRACTION_DIGITS_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.FractionDigitStatementContext;
+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_CONTENT;
+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.ListenerValidation.checkStackIsNotEmpty;
+
+/**
+ * Represents listener based call back function corresponding to the "fraction-digits"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class FractionDigitsListener {
+
+    /**
+     * Creates a new bit listener.
+     */
+    private FractionDigitsListener() {
+    }
+
+    /**
+     * It is called when parser enters grammar rule (fraction-digits), it perform
+     * validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processFractionDigitsEntry(TreeWalkListener listener,
+                                                  FractionDigitStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, FRACTION_DIGITS_DATA,
+                             ctx.fraction().getText(), ENTRY);
+        int value = getValidFractionDigits(ctx);
+        Parsable tmpNode = listener.getParsedDataStack().peek();
+        if (tmpNode instanceof YangType) {
+            YangType<YangDecimal64<YangRangeRestriction>> typeNode =
+                    (YangType<YangDecimal64<YangRangeRestriction>>) tmpNode;
+            YangDecimal64 decimal64Node = typeNode.getDataTypeExtendedInfo();
+            decimal64Node.setFractionDigit(value);
+            if (!decimal64Node.isValidFractionDigit()) {
+                throw new ParserException(constructErrorMsg(ctx, INVALID_CONTENT));
+            }
+        } else {
+            throw new ParserException(constructErrorMsg(ctx, INVALID_HOLDER));
+        }
+    }
+
+    private static String constructErrorMsg(
+            FractionDigitStatementContext ctx,
+            ListenerErrorType type) {
+        return constructListenerErrorMessage(type, FRACTION_DIGITS_DATA,
+                                             ctx.fraction().getText(), ENTRY);
+    }
+
+    /**
+     * Validate fraction digits.
+     *
+     * @param ctx context object of the grammar rule
+     * @return validated fraction-digits
+     */
+    private static int getValidFractionDigits(FractionDigitStatementContext ctx) {
+        String value = ctx.fraction().getText().trim();
+        ParserException parserException;
+
+        int fractionDigits = Integer.parseInt(value);
+        if (fractionDigits >= MIN_FRACTION_DIGITS_VALUE &&
+                fractionDigits <= MAX_FRACTION_DIGITS_VALUE) {
+            return fractionDigits;
+        } else {
+            parserException =
+                    new ParserException("YANG file error : fraction-digits value" +
+                                                " should be between 1 and 18.");
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/GroupingListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/GroupingListener.java
new file mode 100644
index 0000000..d47d577
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/GroupingListener.java
@@ -0,0 +1,181 @@
+/*
+ * 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.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangGrouping;
+import org.onosproject.yang.compiler.datamodel.YangInput;
+import org.onosproject.yang.compiler.datamodel.YangList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNotification;
+import org.onosproject.yang.compiler.datamodel.YangOutput;
+import org.onosproject.yang.compiler.datamodel.YangRpc;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+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.ListenerCollisionDetector;
+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.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.GROUPING_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.GroupingStatementContext;
+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.getValidIdentifier;
+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.translator.tojava.YangDataModelFactory.getYangGroupingNode;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * grouping-stmt       = grouping-keyword sep identifier-arg-str optsep
+ *                      (";" /
+ *                       "{" stmtsep
+ *                          ;; these stmts can appear in any order
+ *                          [status-stmt stmtsep]
+ *                           [description-stmt stmtsep]
+ *                           [reference-stmt stmtsep]
+ *                           *((typedef-stmt /
+ *                              grouping-stmt) stmtsep)
+ *                           *(data-def-stmt stmtsep)
+ *                       "}")
+ *
+ * ANTLR grammar rule
+ * groupingStatement : GROUPING_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE
+ *       (statusStatement | descriptionStatement | referenceStatement | typedefStatement | groupingStatement
+ *       | dataDefStatement)* RIGHT_CURLY_BRACE);
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "grouping"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class GroupingListener {
+
+    /**
+     * Creates a new grouping listener.
+     */
+    private GroupingListener() {
+    }
+
+    /**
+     * It is called when parser enters grammar rule (grouping), it perform
+     * validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processGroupingEntry(TreeWalkListener listener,
+                                            GroupingStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, GROUPING_DATA, ctx.identifier().getText(), ENTRY);
+
+        // Check validity of identifier and remove double quotes.
+        String identifier = getValidIdentifier(ctx.identifier().getText(), GROUPING_DATA, ctx);
+
+        // Validate sub statement cardinality.
+        validateSubStatementsCardinality(ctx);
+
+        // Increase the grouping count by one.
+        listener.increaseGroupingDepth();
+        Parsable curData = listener.getParsedDataStack().peek();
+
+        // Check for identifier collision
+        int line = ctx.getStart().getLine();
+        int charPositionInLine = ctx.getStart().getCharPositionInLine();
+        detectCollidingChildUtil(listener, line, charPositionInLine, identifier, GROUPING_DATA);
+
+        if (curData instanceof YangModule || curData instanceof YangSubModule
+                || curData instanceof YangContainer || curData instanceof YangNotification
+                || curData instanceof YangList || curData instanceof YangGrouping
+                || curData instanceof YangRpc || curData instanceof YangInput
+                || curData instanceof YangOutput) {
+
+            YangGrouping groupingNode = getYangGroupingNode(JAVA_GENERATION);
+            groupingNode.setName(identifier);
+            groupingNode.setGroupingDepth(listener.getGroupingDepth());
+
+            groupingNode.setLineNumber(line);
+            groupingNode.setCharPosition(charPositionInLine);
+            groupingNode.setFileName(listener.getFileName());
+            YangNode curNode = (YangNode) curData;
+            try {
+                curNode.addChild(groupingNode);
+            } catch (DataModelException e) {
+                throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                        GROUPING_DATA, ctx.identifier().getText(), ENTRY, e.getMessage()));
+            }
+            listener.getParsedDataStack().push(groupingNode);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER,
+                    GROUPING_DATA, ctx.identifier().getText(), ENTRY));
+        }
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (grouping), it perform
+     * validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processGroupingExit(TreeWalkListener listener,
+                                           GroupingStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, GROUPING_DATA, ctx.identifier().getText(), EXIT);
+
+        // Decrease the grouping count by one.
+        listener.decreaseGroupingDepth();
+        if (listener.getParsedDataStack().peek() instanceof YangGrouping) {
+            listener.getParsedDataStack().pop();
+        } else {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, GROUPING_DATA,
+                    ctx.identifier().getText(), EXIT));
+        }
+    }
+
+    /**
+     * Validates the cardinality of case sub-statements as per grammar.
+     *
+     * @param ctx context object of the grammar rule
+     */
+    private static void validateSubStatementsCardinality(GroupingStatementContext ctx) {
+
+        validateCardinalityMaxOne(ctx.statusStatement(), STATUS_DATA, GROUPING_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.descriptionStatement(), DESCRIPTION_DATA, GROUPING_DATA,
+                                  ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.referenceStatement(), REFERENCE_DATA, GROUPING_DATA, ctx.identifier().getText());
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/IdentityListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/IdentityListener.java
new file mode 100644
index 0000000..e47b2d6
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/IdentityListener.java
@@ -0,0 +1,124 @@
+/*
+ * 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.YangIdentity;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+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 static org.onosproject.yang.compiler.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.IDENTITY_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.IdentityStatementContext;
+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.getValidIdentifier;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yang.compiler.translator.tojava.YangDataModelFactory.getYangIdentityNode;
+
+/**
+ * Reference: RFC6020 and YANG ANTLR Grammar.
+ * <p>
+ * ABNF grammar as per RFC6020
+ * identity-stmt       = identity-keyword sep identifier-arg-str optsep
+ * (";" /
+ * "{" stmtsep
+ * ;; these stmts can appear in any order
+ * [base-stmt stmtsep]
+ * [status-stmt stmtsep]
+ * [description-stmt stmtsep]
+ * [reference-stmt stmtsep]
+ * "}")
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "identity"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class IdentityListener {
+
+    //Creates a identity listener.
+    private IdentityListener() {
+    }
+
+    /**
+     * Performs validations and update the data model tree when parser receives an input
+     * matching the grammar rule (identity).
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processIdentityEntry(TreeWalkListener listener,
+                                            IdentityStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, IDENTITY_DATA, ctx.identifier().getText(), ENTRY);
+
+        String identifier = getValidIdentifier(ctx.identifier().getText(), IDENTITY_DATA, ctx);
+
+        YangIdentity identity = getYangIdentityNode(JAVA_GENERATION);
+        identity.setName(identifier);
+
+        identity.setLineNumber(ctx.getStart().getLine());
+        identity.setCharPosition(ctx.getStart().getCharPositionInLine());
+        identity.setFileName(listener.getFileName());
+        Parsable curData = listener.getParsedDataStack().peek();
+        if (curData instanceof YangModule || curData instanceof YangSubModule) {
+            YangNode curNode = (YangNode) curData;
+            try {
+                curNode.addChild(identity);
+            } catch (DataModelException e) {
+                throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                                                                                IDENTITY_DATA, ctx.identifier().getText(), ENTRY, e.getMessage()));
+            }
+            // Push identity node to the stack.
+            listener.getParsedDataStack().push(identity);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, IDENTITY_DATA,
+                                                                    ctx.identifier().getText(), ENTRY));
+        }
+    }
+
+    /**
+     * Performs validations and update the data model tree when parser exits from grammar
+     * rule (identity).
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processIdentityExit(TreeWalkListener listener,
+                                           IdentityStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_CURRENT_HOLDER, IDENTITY_DATA, ctx.identifier().getText(), EXIT);
+
+        Parsable parsableType = listener.getParsedDataStack().pop();
+        if (!(parsableType instanceof YangIdentity)) {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, IDENTITY_DATA,
+                                                                    ctx.identifier().getText(), EXIT));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/IdentityRefListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/IdentityRefListener.java
new file mode 100644
index 0000000..adcdee1
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/IdentityRefListener.java
@@ -0,0 +1,188 @@
+/*
+ * 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.YangIdentityRef;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeIdentifier;
+import org.onosproject.yang.compiler.datamodel.YangType;
+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.linker.impl.YangResolutionInfoImpl;
+import org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.IdentityrefSpecificationContext;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.addResolutionInfo;
+import static org.onosproject.yang.compiler.datamodel.utils.ResolvableStatus.UNRESOLVED;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.BASE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.IDENTITYREF_DATA;
+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.getValidNodeIdentifier;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yang.compiler.utils.UtilConstants.EMPTY_STRING;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ * <p/>
+ * ABNF grammar as per RFC6020
+ * identityref-specification =
+ * base-stmt stmtsep
+ * base-stmt           = base-keyword sep identifier-ref-arg-str
+ * optsep stmtend*
+ * identifier-ref-arg  = [prefix ":"] identifier
+ */
+
+/**
+ * Represents listener based call back function corresponding to the
+ * "identityref" rule defined in ANTLR grammar file for corresponding ABNF
+ * rule in RFC 6020.
+ */
+public final class IdentityRefListener {
+
+    // No instantiation.
+    private IdentityRefListener() {
+    }
+
+    /**
+     * Performs validation and updates the data model tree when parser receives an input
+     * matching the grammar rule (identity-ref).
+     *
+     * @param listener listener object
+     * @param ctx      context object
+     */
+    public static void processIdentityRefEntry(TreeWalkListener listener,
+                                               IdentityrefSpecificationContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, IDENTITYREF_DATA,
+                             EMPTY_STRING, ENTRY);
+
+        if (!(listener.getParsedDataStack().peek() instanceof YangType)) {
+            throw new ParserException(constructListenerErrorMessage(
+                    INVALID_HOLDER, IDENTITYREF_DATA, EMPTY_STRING, ENTRY));
+        }
+
+        YangIdentityRef idRef = new YangIdentityRef();
+        Parsable typeData = listener.getParsedDataStack().pop();
+        YangResolutionInfoImpl<YangIdentityRef> resolutionInfo;
+
+        // Validate node identifier.
+        YangNodeIdentifier nodeId = getValidNodeIdentifier(
+                ctx.baseStatement().string().getText(), BASE_DATA, ctx);
+        idRef.setBaseIdentity(nodeId);
+        ((YangType) typeData).setDataTypeExtendedInfo(idRef);
+
+        int errLine = ctx.getStart().getLine();
+        int errPos = ctx.getStart().getCharPositionInLine();
+
+        idRef.setLineNumber(errLine);
+        idRef.setCharPosition(errPos);
+        idRef.setFileName(listener.getFileName());
+
+        Parsable tmpData = listener.getParsedDataStack().peek();
+        Parsable parentNode;
+        switch (tmpData.getYangConstructType()) {
+
+            case LEAF_DATA:
+                Parsable leaf = listener.getParsedDataStack().pop();
+                parentNode = listener.getParsedDataStack().peek();
+                listener.getParsedDataStack().push(leaf);
+                break;
+
+            case LEAF_LIST_DATA:
+                Parsable leafList = listener.getParsedDataStack().pop();
+                parentNode = listener.getParsedDataStack().peek();
+                listener.getParsedDataStack().push(leafList);
+                break;
+
+            case UNION_DATA:
+                parentNode = listener.getParsedDataStack().peek();
+                break;
+
+            case TYPEDEF_DATA:
+                parentNode = listener.getParsedDataStack().peek();
+                break;
+
+            default:
+                throw new ParserException(
+                        constructListenerErrorMessage(INVALID_HOLDER,
+                                                      IDENTITYREF_DATA,
+                                                      ctx.getText(), EXIT));
+        }
+
+        if (!(parentNode instanceof YangNode)) {
+            throw new ParserException(
+                    constructListenerErrorMessage(INVALID_HOLDER,
+                                                  IDENTITYREF_DATA,
+                                                  ctx.getText(), EXIT));
+        }
+        idRef.setResolvableStatus(UNRESOLVED);
+        // Adds resolution information to the list
+        resolutionInfo = new YangResolutionInfoImpl<>(
+                idRef, (YangNode) parentNode, errLine, errPos);
+        addToResolution(resolutionInfo, ctx);
+
+        listener.getParsedDataStack().push(typeData);
+        listener.getParsedDataStack().push(idRef);
+    }
+
+    /**
+     * Performs validations and update the data model tree when parser exits
+     * from grammar rule (identity-ref).
+     *
+     * @param listener Listener's object
+     * @param ctx      context object
+     */
+    public static void processIdentityRefExit(TreeWalkListener listener,
+                                              IdentityrefSpecificationContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_CURRENT_HOLDER, IDENTITYREF_DATA,
+                             ctx.getText(), EXIT);
+
+        Parsable parsableType = listener.getParsedDataStack().pop();
+        if (!(parsableType instanceof YangIdentityRef)) {
+            throw new ParserException(constructListenerErrorMessage(
+                    INVALID_HOLDER, IDENTITYREF_DATA, ctx.getText(), EXIT));
+        }
+    }
+
+    /**
+     * Adds to resolution list.
+     *
+     * @param info resolution info
+     * @param ctx  context object
+     */
+    private static void addToResolution(YangResolutionInfoImpl<YangIdentityRef> info,
+                                        IdentityrefSpecificationContext ctx) {
+        try {
+            addResolutionInfo(info);
+        } catch (DataModelException e) {
+            throw new ParserException(constructExtendedListenerErrorMessage(
+                    UNHANDLED_PARSED_DATA, IDENTITYREF_DATA, ctx.getText(),
+                    ENTRY, e.getMessage()));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/IfFeatureListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/IfFeatureListener.java
new file mode 100644
index 0000000..9a56209
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/IfFeatureListener.java
@@ -0,0 +1,147 @@
+/*
+ * 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
+ *
+ * if-feature-stmt     = if-feature-keyword sep identifier-ref-arg-str
+ *                        optsep stmtend
+ *
+ * ANTLR grammar rule
+ * ifFeatureStatement : IF_FEATURE_KEYWORD string STMTEND;
+ */
+
+import org.onosproject.yang.compiler.datamodel.YangFeature;
+import org.onosproject.yang.compiler.datamodel.YangIfFeature;
+import org.onosproject.yang.compiler.datamodel.YangIfFeatureHolder;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangLeafList;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeIdentifier;
+import org.onosproject.yang.compiler.datamodel.YangResolutionInfo;
+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.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.addResolutionInfo;
+import static org.onosproject.yang.compiler.datamodel.utils.ResolvableStatus.UNRESOLVED;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.IF_FEATURE_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.IfFeatureStatementContext;
+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_HOLDER;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil.getValidNodeIdentifier;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/**
+ * Represents listener based call back function corresponding to the "if-feature"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class IfFeatureListener {
+
+    /**
+     * Creates a new IfFeature listener.
+     */
+    private IfFeatureListener() {
+    }
+
+    /**
+     * Performs validation and updates the data model tree.It is called when parser receives
+     * an input matching the grammar rule (if-feature).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processIfFeatureEntry(TreeWalkListener listener,
+                                             IfFeatureStatementContext ctx) {
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, IF_FEATURE_DATA, ctx.string().getText(), ENTRY);
+
+        // Validate if-feature argument string
+        YangNodeIdentifier nodeIdentifier = getValidNodeIdentifier(ctx.string().getText(),
+                                                                   IF_FEATURE_DATA, ctx);
+
+        YangIfFeature ifFeature = new YangIfFeature();
+        ifFeature.setName(nodeIdentifier);
+        ifFeature.setResolvableStatus(UNRESOLVED);
+
+        ifFeature.setLineNumber(ctx.getStart().getLine());
+        ifFeature.setCharPosition(ctx.getStart().getCharPositionInLine());
+        ifFeature.setFileName(listener.getFileName());
+        YangIfFeatureHolder ifFeatureHolder;
+
+        // Obtain the node of the stack.
+        Parsable tmpNode = listener.getParsedDataStack().peek();
+        if (tmpNode instanceof YangIfFeatureHolder) {
+            ifFeatureHolder = (YangIfFeatureHolder) tmpNode;
+            ifFeatureHolder.addIfFeatureList(ifFeature);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, IF_FEATURE_DATA,
+                                                                    ctx.string().getText(), ENTRY));
+        }
+
+        // Add resolution information to the list
+        Parsable parentNode;
+        if (tmpNode instanceof YangLeafList || tmpNode instanceof YangLeaf
+                || tmpNode instanceof YangFeature) {
+            Parsable leafData = listener.getParsedDataStack().pop();
+            parentNode = listener.getParsedDataStack().peek();
+            listener.getParsedDataStack().push(leafData);
+        } else {
+            parentNode = tmpNode;
+        }
+
+        // Verify parent node of leaf
+        if (!(parentNode instanceof YangNode)) {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, IF_FEATURE_DATA,
+                                                                    ctx.string().getText(), EXIT));
+        }
+
+        int errorLine = ctx.getStart().getLine();
+        int errorPosition = ctx.getStart().getCharPositionInLine();
+        YangResolutionInfoImpl resolutionInfo = new YangResolutionInfoImpl<YangIfFeature>(ifFeature,
+                                                                                          (YangNode) parentNode, errorLine,
+                                                                                          errorPosition);
+        addToResolutionList(resolutionInfo, ctx);
+    }
+
+    /**
+     * Add to resolution list.
+     *
+     * @param resolutionInfo resolution information.
+     * @param ctx            context object of the grammar rule
+     */
+    private static void addToResolutionList(YangResolutionInfo<YangIfFeature> resolutionInfo,
+                                            IfFeatureStatementContext ctx) {
+
+        try {
+            addResolutionInfo(resolutionInfo);
+        } catch (DataModelException e) {
+            throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                                                                            IF_FEATURE_DATA, ctx.string().getText(), EXIT, e.getMessage()));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ImportListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ImportListener.java
new file mode 100644
index 0000000..57694f3
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ImportListener.java
@@ -0,0 +1,141 @@
+/*
+ * 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.YangImport;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+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 static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.IMPORT_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ImportStatementContext;
+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.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * linkage-stmts       = ;; these stmts can appear in any order
+ *                       *(import-stmt stmtsep)
+ *                       *(include-stmt stmtsep)
+ *
+ * import-stmt         = import-keyword sep identifier-arg-str optsep
+ *                       "{" stmtsep
+ *                           prefix-stmt stmtsep
+ *                           [revision-date-stmt stmtsep]
+ *                        "}"
+ *
+ * ANTLR grammar rule
+ * linkage_stmts : (import_stmt
+ *               | include_stmt)*;
+ * import_stmt : IMPORT_KEYWORD identifier LEFT_CURLY_BRACE import_stmt_body
+ *               RIGHT_CURLY_BRACE;
+ * import_stmt_body : prefix_stmt revision_date_stmt?;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "import"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class ImportListener {
+
+    /**
+     * Creates a new import listener.
+     */
+    private ImportListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (import), perform validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processImportEntry(TreeWalkListener listener, ImportStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, IMPORT_DATA, ctx.identifier().getText(), ENTRY);
+
+        String identifier = getValidIdentifier(ctx.identifier().getText(), IMPORT_DATA, ctx);
+
+        YangImport importNode = new YangImport();
+        importNode.setModuleName(identifier);
+
+        // Set the line number and character position in line for the belongs to.
+        int errorLine = ctx.getStart().getLine();
+        int errorPosition = ctx.getStart().getCharPositionInLine();
+        importNode.setLineNumber(errorLine);
+        importNode.setCharPosition(errorPosition);
+        importNode.setFileName(listener.getFileName());
+
+        // Push import node to the stack.
+        listener.getParsedDataStack().push(importNode);
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (import), it perform
+     * validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processImportExit(TreeWalkListener listener, ImportStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, IMPORT_DATA, ctx.identifier().getText(), EXIT);
+
+        Parsable tmpImportNode = listener.getParsedDataStack().peek();
+        if (tmpImportNode instanceof YangImport) {
+            listener.getParsedDataStack().pop();
+
+            // Check for stack to be non empty.
+            checkStackIsNotEmpty(listener, MISSING_HOLDER, IMPORT_DATA, ctx.identifier().getText(),
+                                 EXIT);
+
+            Parsable tmpNode = listener.getParsedDataStack().peek();
+            switch (tmpNode.getYangConstructType()) {
+                case MODULE_DATA: {
+                    YangModule module = (YangModule) tmpNode;
+                    module.addToImportList((YangImport) tmpImportNode);
+                    break;
+                }
+                case SUB_MODULE_DATA: {
+                    YangSubModule subModule = (YangSubModule) tmpNode;
+                    subModule.addToImportList((YangImport) tmpImportNode);
+                    break;
+                }
+                default:
+                    throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, IMPORT_DATA,
+                                                                            ctx.identifier().getText(),
+                                                                            EXIT));
+            }
+        } else {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, IMPORT_DATA,
+                                                                    ctx.identifier().getText(), EXIT));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/IncludeListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/IncludeListener.java
new file mode 100644
index 0000000..773a789
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/IncludeListener.java
@@ -0,0 +1,142 @@
+/*
+ * 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.YangInclude;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+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 org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.INCLUDE_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.IncludeStatementContext;
+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.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * linkage-stmts       = ;; these stmts can appear in any order
+ *                       *(import-stmt stmtsep)
+ *                       *(include-stmt stmtsep)
+ *
+ * include-stmt        = include-keyword sep identifier-arg-str optsep
+ *                             (";" /
+ *                              "{" stmtsep
+ *                                  [revision-date-stmt stmtsep]
+ *                            "}")
+ *
+ * ANTLR grammar rule
+ * linkage_stmts : (import_stmt
+ *               | include_stmt)*;
+ * include_stmt : INCLUDE_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE
+ *                revision_date_stmt? RIGHT_CURLY_BRACE);
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "include"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class IncludeListener {
+
+    /**
+     * Creates a new include listener.
+     */
+    private IncludeListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (include), perform validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processIncludeEntry(TreeWalkListener listener, IncludeStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, INCLUDE_DATA, ctx.identifier().getText(),
+                ENTRY);
+
+        String identifier = getValidIdentifier(ctx.identifier().getText(), INCLUDE_DATA, ctx);
+
+        YangInclude includeNode = new YangInclude();
+        includeNode.setSubModuleName(identifier);
+
+        // Set the line number and character position in line for the belongs to.
+        int errorLine = ctx.getStart().getLine();
+        int errorPosition = ctx.getStart().getCharPositionInLine();
+        includeNode.setLineNumber(errorLine);
+        includeNode.setCharPosition(errorPosition);
+        includeNode.setFileName(listener.getFileName());
+
+        listener.getParsedDataStack().push(includeNode);
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (include), it perform
+     * validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processIncludeExit(TreeWalkListener listener, IncludeStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, INCLUDE_DATA, ctx.identifier().getText(), EXIT);
+
+        Parsable tmpIncludeNode = listener.getParsedDataStack().peek();
+        if (tmpIncludeNode instanceof YangInclude) {
+            listener.getParsedDataStack().pop();
+
+            // Check for stack to be non empty.
+            checkStackIsNotEmpty(listener, MISSING_HOLDER, INCLUDE_DATA, ctx.identifier().getText(),
+                    EXIT);
+
+            Parsable tmpNode = listener.getParsedDataStack().peek();
+            switch (tmpNode.getYangConstructType()) {
+                case MODULE_DATA: {
+                    YangModule module = (YangModule) tmpNode;
+                    module.addToIncludeList((YangInclude) tmpIncludeNode);
+                    break;
+                }
+                case SUB_MODULE_DATA: {
+                    YangSubModule subModule = (YangSubModule) tmpNode;
+                    subModule.addToIncludeList((YangInclude) tmpIncludeNode);
+                    break;
+                }
+                default:
+                    throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, INCLUDE_DATA,
+                            ctx.identifier().getText(),
+                            EXIT));
+            }
+        } else {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, INCLUDE_DATA,
+                    ctx.identifier().getText(), EXIT));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/InputListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/InputListener.java
new file mode 100644
index 0000000..a350b18
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/InputListener.java
@@ -0,0 +1,130 @@
+/*
+ * 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.YangInput;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangRpc;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+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.utils.UtilConstants;
+
+import static org.onosproject.yang.compiler.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.INPUT_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.InputStatementContext;
+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.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yang.compiler.translator.tojava.YangDataModelFactory.getYangInputNode;
+import static org.onosproject.yang.compiler.utils.UtilConstants.INPUT;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *
+ * input-stmt          = input-keyword optsep
+ *                       "{" stmtsep
+ *                           ;; these stmts can appear in any order
+ *                           *((typedef-stmt /
+ *                              grouping-stmt) stmtsep)
+ *                           1*(data-def-stmt stmtsep)
+ *                         "}"
+ *
+ * inputStatement : INPUT_KEYWORD LEFT_CURLY_BRACE inputStatementBody RIGHT_CURLY_BRACE;
+
+ * inputStatementBody : typedefStatement* dataDefStatement+
+ *                    | dataDefStatement+ typedefStatement*
+ *                    | groupingStatement* dataDefStatement+
+ *                    | dataDefStatement+ groupingStatement*;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "input"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class InputListener {
+
+    /**
+     * Creates a new input listener.
+     */
+    private InputListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (input), performs validation and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processInputEntry(TreeWalkListener listener,
+                                         InputStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, INPUT_DATA, "", ENTRY);
+
+        Parsable curData = listener.getParsedDataStack().peek();
+        if (curData instanceof YangRpc) {
+
+            YangInput yangInput = getYangInputNode(JAVA_GENERATION);
+            yangInput.setName(INPUT);
+            yangInput.setLineNumber(ctx.getStart().getLine());
+            yangInput.setCharPosition(ctx.getStart().getCharPositionInLine());
+            yangInput.setFileName(listener.getFileName());
+            YangNode curNode = (YangNode) curData;
+            try {
+                curNode.addChild(yangInput);
+            } catch (DataModelException e) {
+                throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                                                                                INPUT_DATA, "", ENTRY, e.getMessage()));
+            }
+            listener.getParsedDataStack().push(yangInput);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, INPUT_DATA,
+                                                                    "", ENTRY));
+        }
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (input), it perform
+     * validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processInputExit(TreeWalkListener listener,
+                                        InputStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, INPUT_DATA, "", EXIT);
+
+        if (!(listener.getParsedDataStack().peek() instanceof YangInput)) {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, INPUT_DATA,
+                                                                    "", EXIT));
+        }
+        listener.getParsedDataStack().pop();
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/KeyListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/KeyListener.java
new file mode 100644
index 0000000..5b67812
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/KeyListener.java
@@ -0,0 +1,103 @@
+/*
+ * 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.YangList;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+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 org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.KEY_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.KeyStatementContext;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+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_HOLDER;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil.removeQuotesAndHandleConcat;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * key-stmt            = key-keyword sep key-arg-str stmtend
+ *
+ * ANTLR grammar rule
+ * keyStatement : KEY_KEYWORD key STMTEND;
+ * key          : string;
+ */
+
+/**
+ * Represesnts listener based call back function corresponding to the "key" rule
+ * defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class KeyListener {
+
+    /**
+     * Creates a new key listener.
+     */
+    private KeyListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (key), perform validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processKeyEntry(TreeWalkListener listener,
+                                       KeyStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, KEY_DATA, ctx.key().getText(), ENTRY);
+
+        Parsable tmpData = listener.getParsedDataStack().peek();
+        if (listener.getParsedDataStack().peek() instanceof YangList) {
+            YangList yangList = (YangList) tmpData;
+            String tmpKeyValue = removeQuotesAndHandleConcat(ctx.key().getText());
+            if (tmpKeyValue.contains(" ")) {
+                String[] keyValues = tmpKeyValue.split(" ");
+                for (String keyValue : keyValues) {
+                    try {
+                        yangList.addKey(keyValue);
+                    } catch (DataModelException e) {
+                        throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA, KEY_DATA,
+                                ctx.key().getText(), ENTRY, e.getMessage()));
+                    }
+                }
+            } else {
+                try {
+                    yangList.addKey(tmpKeyValue);
+                } catch (DataModelException e) {
+                    throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA, KEY_DATA,
+                            ctx.key().getText(), ENTRY, e.getMessage()));
+                }
+            }
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, KEY_DATA, ctx.key().getText(),
+                    ENTRY));
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/LeafListListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/LeafListListener.java
new file mode 100644
index 0000000..75dde98
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/LeafListListener.java
@@ -0,0 +1,181 @@
+/*
+ * 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.YangLeafList;
+import org.onosproject.yang.compiler.datamodel.YangLeavesHolder;
+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 static org.onosproject.yang.compiler.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.CONFIG_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.LEAF_LIST_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.MAX_ELEMENT_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.MIN_ELEMENT_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.TYPE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.UNITS_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.LeafListStatementContext;
+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.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.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.getParentNodeConfig;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.validateCardinalityEqualsOne;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yang.compiler.translator.tojava.YangDataModelFactory.getYangLeafList;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *  leaf-list-stmt      = leaf-list-keyword sep identifier-arg-str optsep
+ *                        "{" stmtsep
+ *                            ;; these stmts can appear in any order
+ *                            [when-stmt stmtsep]
+ *                            *(if-feature-stmt stmtsep)
+ *                            type-stmt stmtsep
+ *                            [units-stmt stmtsep]
+ *                            *(must-stmt stmtsep)
+ *                            [config-stmt stmtsep]
+ *                            [min-elements-stmt stmtsep]
+ *                            [max-elements-stmt stmtsep]
+ *                            [ordered-by-stmt stmtsep]
+ *                            [status-stmt stmtsep]
+ *                            [description-stmt stmtsep]
+ *                            [reference-stmt stmtsep]
+ *                         "}"
+ *
+ * ANTLR grammar rule
+ *  leafListStatement : LEAF_LIST_KEYWORD identifier LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement |
+ *  typeStatement | unitsStatement | mustStatement | configStatement | minElementsStatement | maxElementsStatement |
+ *  orderedByStatement | statusStatement | descriptionStatement | referenceStatement)* RIGHT_CURLY_BRACE;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "leaf-list"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class LeafListListener {
+
+    /**
+     * Creates a new leaf list listener.
+     */
+    private LeafListListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (leaf-list), performs validation and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processLeafListEntry(TreeWalkListener listener,
+                                            LeafListStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, LEAF_LIST_DATA, ctx.identifier().getText(), ENTRY);
+
+        String identifier = getValidIdentifier(ctx.identifier().getText(), LEAF_LIST_DATA, ctx);
+
+        // Validate sub statement cardinality.
+        validateSubStatementsCardinality(ctx);
+
+        // Check for identifier collision
+        int line = ctx.getStart().getLine();
+        int charPositionInLine = ctx.getStart().getCharPositionInLine();
+        detectCollidingChildUtil(listener, line, charPositionInLine, identifier, LEAF_LIST_DATA);
+
+        YangLeafList leafList = getYangLeafList(JAVA_GENERATION);
+        leafList.setName(identifier);
+        leafList.setLineNumber(line);
+        leafList.setCharPosition(charPositionInLine);
+        leafList.setFileName(listener.getFileName());
+        /*
+         * If "config" is not specified, the default is the same as the parent
+         * schema node's "config" value.
+         */
+        if (ctx.configStatement().isEmpty()) {
+            boolean parentConfig = getParentNodeConfig(listener);
+            leafList.setConfig(parentConfig);
+        }
+
+        Parsable tmpData = listener.getParsedDataStack().peek();
+        YangLeavesHolder leavesHolder;
+
+        if (tmpData instanceof YangLeavesHolder) {
+            leavesHolder = (YangLeavesHolder) tmpData;
+            leavesHolder.addLeafList(leafList);
+            leafList.setContainedIn(leavesHolder);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, LEAF_LIST_DATA,
+                                                                    ctx.identifier().getText(), ENTRY));
+        }
+        listener.getParsedDataStack().push(leafList);
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (leaf-list), it performs
+     * validation and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processLeafListExit(TreeWalkListener listener,
+                                           LeafListStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, LEAF_LIST_DATA, ctx.identifier().getText(), EXIT);
+
+        if (listener.getParsedDataStack().peek() instanceof YangLeafList) {
+            listener.getParsedDataStack().pop();
+        } else {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, LEAF_LIST_DATA,
+                                                                    ctx.identifier().getText(), EXIT));
+        }
+    }
+
+    /**
+     * Validates the cardinality of leaf-list sub-statements as per grammar.
+     *
+     * @param ctx context object of the grammar rule
+     */
+    private static void validateSubStatementsCardinality(LeafListStatementContext ctx) {
+
+        validateCardinalityEqualsOne(ctx.typeStatement(), TYPE_DATA, LEAF_LIST_DATA, ctx.identifier().getText(), ctx);
+        validateCardinalityMaxOne(ctx.unitsStatement(), UNITS_DATA, LEAF_LIST_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.configStatement(), CONFIG_DATA, LEAF_LIST_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.maxElementsStatement(), MAX_ELEMENT_DATA, LEAF_LIST_DATA,
+                                  ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.minElementsStatement(), MIN_ELEMENT_DATA, LEAF_LIST_DATA,
+                                  ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.descriptionStatement(), DESCRIPTION_DATA, LEAF_LIST_DATA,
+                                  ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.referenceStatement(), REFERENCE_DATA, LEAF_LIST_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.statusStatement(), STATUS_DATA, LEAF_LIST_DATA, ctx.identifier().getText());
+        //TODO ordered by
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/LeafListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/LeafListener.java
new file mode 100644
index 0000000..6331361
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/LeafListener.java
@@ -0,0 +1,206 @@
+/*
+ * 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.
+ */
+
+/**
+ * Implements listener based call back function corresponding to the "leaf"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+package org.onosproject.yang.compiler.parser.impl.listeners;
+
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangLeavesHolder;
+import org.onosproject.yang.compiler.datamodel.YangList;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+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.ListenerCollisionDetector;
+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 org.onosproject.yang.compiler.translator.tojava.YangDataModelFactory;
+
+import static org.onosproject.yang.compiler.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.CONFIG_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.LEAF_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.MANDATORY_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.TYPE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.UNITS_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.LeafStatementContext;
+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.constructListenerErrorMessage;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.INVALID_CONTENT;
+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.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.getParentNodeConfig;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.validateCardinalityEqualsOne;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yang.compiler.translator.tojava.YangDataModelFactory.getYangLeaf;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *  leaf-stmt           = leaf-keyword sep identifier-arg-str optsep
+ *                        "{" stmtsep
+ *                            ;; these stmts can appear in any order
+ *                            [when-stmt stmtsep]
+ *                            *(if-feature-stmt stmtsep)
+ *                            type-stmt stmtsep
+ *                            [units-stmt stmtsep]
+ *                            *(must-stmt stmtsep)
+ *                            [default-stmt stmtsep]
+ *                            [config-stmt stmtsep]
+ *                            [mandatory-stmt stmtsep]
+ *                            [status-stmt stmtsep]
+ *                            [description-stmt stmtsep]
+ *                            [reference-stmt stmtsep]
+ *                         "}"
+ *
+ * ANTLR grammar rule
+ *  leafStatement : LEAF_KEYWORD identifier LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | typeStatement |
+ *  unitsStatement | mustStatement | defaultStatement | configStatement | mandatoryStatement | statusStatement  |
+ *  descriptionStatement | referenceStatement)* RIGHT_CURLY_BRACE;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "leaf" rule
+ * defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class LeafListener {
+
+    /**
+     * Creates a new leaf listener.
+     */
+    private LeafListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (leaf), performs validation and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processLeafEntry(TreeWalkListener listener,
+                                        LeafStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, LEAF_DATA, ctx.identifier().getText(), ENTRY);
+
+        String identifier = getValidIdentifier(ctx.identifier().getText(), LEAF_DATA, ctx);
+
+        // Validate sub statement cardinality.
+        validateSubStatementsCardinality(ctx);
+
+        // Check for identifier collision
+        int line = ctx.getStart().getLine();
+        int charPositionInLine = ctx.getStart().getCharPositionInLine();
+        detectCollidingChildUtil(listener, line, charPositionInLine, identifier, LEAF_DATA);
+
+        YangLeaf leaf = getYangLeaf(JAVA_GENERATION);
+        leaf.setName(identifier);
+        leaf.setLineNumber(line);
+        leaf.setCharPosition(charPositionInLine);
+        leaf.setFileName(listener.getFileName());
+
+        /*
+         * If "config" is not specified, the default is the same as the parent
+         * schema node's "config" value.
+         */
+        if (ctx.configStatement().isEmpty()) {
+            boolean parentConfig = ListenerValidation.getParentNodeConfig(listener);
+            leaf.setConfig(parentConfig);
+        }
+
+        Parsable tmpData = listener.getParsedDataStack().peek();
+        YangLeavesHolder leavesHolder;
+
+        if (tmpData instanceof YangLeavesHolder) {
+            leavesHolder = (YangLeavesHolder) tmpData;
+            leavesHolder.addLeaf(leaf);
+            leaf.setContainedIn(leavesHolder);
+            if (tmpData instanceof YangList) {
+                YangList list = (YangList) tmpData;
+                if (list.isConfig()) {
+                    for (String key : list.getKeyList()) {
+                        if (key.equals(leaf.getName())) {
+                            leaf.setKeyLeaf(true);
+                        }
+                    }
+                }
+            }
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, LEAF_DATA,
+                    ctx.identifier().getText(), ENTRY));
+        }
+
+        listener.getParsedDataStack().push(leaf);
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (leaf), performs
+     * validation and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processLeafExit(TreeWalkListener listener,
+                                       LeafStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, LEAF_DATA, ctx.identifier().getText(), EXIT);
+
+        if (listener.getParsedDataStack().peek() instanceof YangLeaf) {
+            YangLeaf leafNode = (YangLeaf) listener.getParsedDataStack().peek();
+            try {
+                leafNode.validateDataOnExit();
+            } catch (DataModelException e) {
+                throw new ParserException(constructListenerErrorMessage(INVALID_CONTENT, LEAF_DATA,
+                        ctx.identifier().getText(), EXIT));
+            }
+            listener.getParsedDataStack().pop();
+        } else {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, LEAF_DATA,
+                    ctx.identifier().getText(), EXIT));
+        }
+    }
+
+    /**
+     * Validates the cardinality of leaf sub-statements as per grammar.
+     *
+     * @param ctx context object of the grammar rule
+     */
+    private static void validateSubStatementsCardinality(LeafStatementContext ctx) {
+
+        validateCardinalityEqualsOne(ctx.typeStatement(), TYPE_DATA, LEAF_DATA, ctx.identifier().getText(), ctx);
+        validateCardinalityMaxOne(ctx.unitsStatement(), UNITS_DATA, LEAF_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.configStatement(), CONFIG_DATA, LEAF_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.mandatoryStatement(), MANDATORY_DATA, LEAF_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.descriptionStatement(), DESCRIPTION_DATA, LEAF_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.referenceStatement(), REFERENCE_DATA, LEAF_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.statusStatement(), STATUS_DATA, LEAF_DATA, ctx.identifier().getText());
+        //TODO when.
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/LeafrefListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/LeafrefListener.java
new file mode 100644
index 0000000..4935a8e
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/LeafrefListener.java
@@ -0,0 +1,230 @@
+/*
+ * 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.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangLeafList;
+import org.onosproject.yang.compiler.datamodel.YangLeafRef;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangType;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+import org.onosproject.yang.compiler.datamodel.utils.DataModelUtils;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.linker.impl.YangResolutionInfoImpl;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.addResolutionInfo;
+import static org.onosproject.yang.compiler.datamodel.utils.ResolvableStatus.UNRESOLVED;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.LEAFREF_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.LeafrefSpecificationContext;
+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.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * type-body-stmts     = numerical-restrictions /
+ *                       decimal64-specification /
+ *                       string-restrictions /
+ *                       enum-specification /
+ *                       leafref-specification /
+ *                       identityref-specification /
+ *                       instance-identifier-specification /
+ *                       bits-specification /
+ *                       union-specification
+ *
+ * leafref-specification =
+ *                         ;; these stmts can appear in any order
+ *                        path-stmt stmtsep
+ *                        [require-instance-stmt stmtsep]
+ *
+ * ANTLR grammar rule
+ *
+ * typeBodyStatements : numericalRestrictions | stringRestrictions | enumSpecification
+ *                 | leafrefSpecification | identityrefSpecification | instanceIdentifierSpecification
+ *                 | bitsSpecification | unionSpecification;
+ *
+ * leafrefSpecification : (pathStatement (requireInstanceStatement)?) | ((requireInstanceStatement)? pathStatement);
+ */
+
+/**
+ * Represents listener based call back function corresponding to the
+ * "leafref" rule defined in ANTLR grammar file for corresponding ABNF rule
+ * in RFC 6020.
+ */
+public final class LeafrefListener {
+
+    /**
+     * Creates a new leafref listener.
+     */
+    private LeafrefListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (leafref), perform validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processLeafrefEntry(TreeWalkListener listener,
+                                           LeafrefSpecificationContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, LEAFREF_DATA, "", ENTRY);
+
+        int errorLine = ctx.getStart().getLine();
+        int errorPosition = ctx.getStart().getCharPositionInLine();
+
+        YangLeafRef<?> leafRef = new YangLeafRef<>();
+
+        leafRef.setLineNumber(errorLine);
+        leafRef.setCharPosition(errorPosition);
+        leafRef.setFileName(listener.getFileName());
+        Parsable typeData = listener.getParsedDataStack().pop();
+
+        if (!(typeData instanceof YangType)) {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, LEAFREF_DATA,
+                                                                    "", ENTRY));
+        }
+
+        YangType type = (YangType) typeData;
+        type.setDataTypeExtendedInfo(leafRef);
+
+        // Setting by default the value of require-instance as true.
+        leafRef.setRequireInstance(true);
+        Parsable tmpData = listener.getParsedDataStack().peek();
+
+        switch (tmpData.getYangConstructType()) {
+
+            case LEAF_DATA:
+
+                // Parent YANG node of leaf to be added in resolution information.
+                YangLeaf leaf = (YangLeaf) listener.getParsedDataStack().pop();
+                Parsable parentNodeOfLeaf = listener.getParsedDataStack().peek();
+                listener.getParsedDataStack().push(leaf);
+
+                // Verify parent node of leaf.
+                if (!(parentNodeOfLeaf instanceof YangNode)) {
+                    throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, LEAFREF_DATA,
+                                                                            "", ENTRY));
+                }
+
+                leafRef.setResolvableStatus(UNRESOLVED);
+                leafRef.setParentNode((YangNode) parentNodeOfLeaf);
+                if (listener.getGroupingDepth() == 0) {
+                    // Add resolution information to the list.
+                    YangResolutionInfoImpl resolutionInfo = new YangResolutionInfoImpl<YangLeafRef>(leafRef,
+                                                                                                    (YangNode) parentNodeOfLeaf, errorLine, errorPosition);
+                    addToResolutionList(resolutionInfo);
+                } else {
+                    leafRef.setInGrouping(true);
+                }
+                break;
+
+            case LEAF_LIST_DATA:
+
+                // Parent YANG node of leaf-list to be added in resolution information.
+                YangLeafList leafList = (YangLeafList) listener.getParsedDataStack().pop();
+                Parsable parentNodeOfLeafList = listener.getParsedDataStack().peek();
+                listener.getParsedDataStack().push(leafList);
+
+                // Verify parent node of leaf-list.
+                if (!(parentNodeOfLeafList instanceof YangNode)) {
+                    throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, LEAFREF_DATA,
+                                                                            "", ENTRY));
+                }
+
+                leafRef.setResolvableStatus(UNRESOLVED);
+                leafRef.setParentNode((YangNode) parentNodeOfLeafList);
+
+                if (listener.getGroupingDepth() == 0) {
+                    // Add resolution information to the list.
+                    YangResolutionInfoImpl resolutionInfoImpl = new YangResolutionInfoImpl<YangLeafRef>(leafRef,
+                                                                                                        (YangNode) parentNodeOfLeafList, errorLine, errorPosition);
+                    addToResolutionList(resolutionInfoImpl);
+                } else {
+                    leafRef.setInGrouping(true);
+                }
+                break;
+
+            case TYPEDEF_DATA:
+                Parsable parentNodeOfLeafref = listener.getParsedDataStack().peek();
+                leafRef.setParentNode((YangNode) parentNodeOfLeafref);
+                if (listener.getGroupingDepth() != 0) {
+                    leafRef.setInGrouping(true);
+                }
+                /*
+                 * Do not add the leaf ref to resolution list. It needs to be
+                 * added to resolution list, when leaf/leaf list references to
+                 * this typedef. At this time that leaf/leaf-list becomes the
+                 * parent for the leafref.
+                 */
+                break;
+
+            default:
+                throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, LEAFREF_DATA,
+                                                                        "", ENTRY));
+        }
+        listener.getParsedDataStack().push(typeData);
+        listener.getParsedDataStack().push(leafRef);
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (leafref), it performs
+     * validation and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processLeafrefExit(TreeWalkListener listener,
+                                          LeafrefSpecificationContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_CURRENT_HOLDER, LEAFREF_DATA, "", EXIT);
+
+        Parsable parsableType = listener.getParsedDataStack().pop();
+        if (!(parsableType instanceof YangLeafRef)) {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, LEAFREF_DATA,
+                                                                    "", EXIT));
+        }
+    }
+
+    /**
+     * Adds to resolution list.
+     *
+     * @param resolutionInfo resolution information
+     */
+    private static void addToResolutionList(YangResolutionInfoImpl resolutionInfo) {
+
+        try {
+            addResolutionInfo(resolutionInfo);
+        } catch (DataModelException e) {
+            throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                                                                            LEAFREF_DATA, "", ENTRY, e.getMessage()));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/LengthRestrictionListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/LengthRestrictionListener.java
new file mode 100644
index 0000000..f682a30
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/LengthRestrictionListener.java
@@ -0,0 +1,190 @@
+/*
+ * 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.YangDerivedInfo;
+import org.onosproject.yang.compiler.datamodel.YangRangeRestriction;
+import org.onosproject.yang.compiler.datamodel.YangStringRestriction;
+import org.onosproject.yang.compiler.datamodel.YangType;
+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.ListenerValidation;
+
+import static org.onosproject.yang.compiler.datamodel.utils.RestrictionResolver.processLengthRestriction;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.LENGTH_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.TYPE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.getYangConstructType;
+import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.BINARY;
+import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.DERIVED;
+import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.STRING;
+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
+ *  length-stmt         = length-keyword sep length-arg-str optsep
+ *                        (";" /
+ *                         "{" stmtsep
+ *                             ;; these stmts can appear in any order
+ *                             [error-message-stmt stmtsep]
+ *                             [error-app-tag-stmt stmtsep]
+ *                             [description-stmt stmtsep]
+ *                             [reference-stmt stmtsep]
+ *                          "}")
+ *
+ *
+ * ANTLR grammar rule
+ * lengthStatement : LENGTH_KEYWORD length
+ *                 (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE);
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "length"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class LengthRestrictionListener {
+
+    /**
+     * Creates a new length restriction listener.
+     */
+    private LengthRestrictionListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar
+     * rule (length), performs validation and updates the data model
+     * tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processLengthRestrictionEntry(TreeWalkListener listener,
+                                                     GeneratedYangParser.LengthStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, LENGTH_DATA, ctx.length().getText(), ENTRY);
+
+        Parsable tmpData = listener.getParsedDataStack().peek();
+        if (tmpData.getYangConstructType() == TYPE_DATA) {
+            YangType type = (YangType) tmpData;
+            setLengthRestriction(listener, type, ctx);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, LENGTH_DATA,
+                                                                    ctx.length().getText(), ENTRY));
+        }
+    }
+
+    /**
+     * Sets the length restriction to type.
+     *
+     * @param listener listener's object
+     * @param type     Yang type for which length restriction to be set
+     * @param ctx      context object of the grammar rule
+     */
+    private static void setLengthRestriction(TreeWalkListener listener, YangType type,
+                                             GeneratedYangParser.LengthStatementContext ctx) {
+
+        if (type.getDataType() == DERIVED) {
+            ((YangDerivedInfo<YangRangeRestriction>) type.getDataTypeExtendedInfo())
+                    .setLengthRestrictionString(ctx.length().getText());
+            ((YangDerivedInfo<YangRangeRestriction>) type.getDataTypeExtendedInfo())
+                    .setLineNumber(ctx.getStart().getLine());
+            ((YangDerivedInfo<YangRangeRestriction>) type.getDataTypeExtendedInfo())
+                    .setCharPosition(ctx.getStart().getCharPositionInLine());
+            return;
+        }
+
+        if (type.getDataType() != STRING && type.getDataType() != BINARY) {
+            ParserException parserException =
+                    new ParserException(
+                            "YANG file error : " +
+                                    getYangConstructType(LENGTH_DATA) +
+                                    " name " + ctx.length().getText() +
+                                    " can be used to restrict the built-in type string/binary" +
+                                    " or types derived from string/binary.");
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+
+        YangRangeRestriction lengthRestriction = null;
+        try {
+            lengthRestriction = processLengthRestriction(null, ctx.getStart().getLine(),
+                                                         ctx.getStart().getCharPositionInLine(), false, ctx.length
+                            ().getText(), listener.getFileName());
+        } catch (DataModelException e) {
+            ParserException parserException = new ParserException(e.getMessage());
+            parserException.setCharPosition(e.getCharPositionInLine());
+            parserException.setLine(e.getLineNumber());
+            throw parserException;
+        }
+
+        if (type.getDataType() == STRING) {
+            YangStringRestriction stringRestriction = (YangStringRestriction) type.getDataTypeExtendedInfo();
+            if (stringRestriction == null) {
+                stringRestriction = new YangStringRestriction();
+                stringRestriction.setFileName(listener.getFileName());
+                stringRestriction.setCharPosition(ctx.getStart().getCharPositionInLine());
+                stringRestriction.setLineNumber(ctx.getStart().getLine());
+                type.setDataTypeExtendedInfo(stringRestriction);
+            }
+
+            stringRestriction.setLengthRestriction(lengthRestriction);
+        } else {
+            type.setDataTypeExtendedInfo(lengthRestriction);
+        }
+
+        listener.getParsedDataStack().push(lengthRestriction);
+    }
+
+    /**
+     * Performs validation and updates the data model tree.
+     * It is called when parser exits from grammar rule (length).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processLengthRestrictionExit(TreeWalkListener listener,
+                                                    GeneratedYangParser.LengthStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, LENGTH_DATA, ctx.length().getText(), EXIT);
+
+        Parsable tmpData = listener.getParsedDataStack().peek();
+        if (tmpData instanceof YangRangeRestriction) {
+            listener.getParsedDataStack().pop();
+        } else if (tmpData instanceof YangType
+                && ((YangType) tmpData).getDataType() == DERIVED) {
+            // TODO : need to handle in linker
+        } else {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, LENGTH_DATA,
+                                                                    ctx.length().getText(), EXIT));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ListListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ListListener.java
new file mode 100644
index 0000000..0048c16
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ListListener.java
@@ -0,0 +1,213 @@
+/*
+ * 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.YangAugment;
+import org.onosproject.yang.compiler.datamodel.YangCase;
+import org.onosproject.yang.compiler.datamodel.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangGrouping;
+import org.onosproject.yang.compiler.datamodel.YangInput;
+import org.onosproject.yang.compiler.datamodel.YangList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNotification;
+import org.onosproject.yang.compiler.datamodel.YangOutput;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+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.translator.tojava.YangDataModelFactory;
+
+import static org.onosproject.yang.compiler.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.CONFIG_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DATA_DEF_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.KEY_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.LIST_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.MAX_ELEMENT_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.MIN_ELEMENT_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ListStatementContext;
+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.getValidIdentifier;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil.validateUniqueInList;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.getParentNodeConfig;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.validateCardinalityNonZero;
+import static org.onosproject.yang.compiler.translator.tojava.YangDataModelFactory.getYangListNode;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *  list-stmt           = list-keyword sep identifier-arg-str optsep
+ *                        "{" stmtsep
+ *                            ;; these stmts can appear in any order
+ *                            [when-stmt stmtsep]
+ *                            *(if-feature-stmt stmtsep)
+ *                            *(must-stmt stmtsep)
+ *                            [key-stmt stmtsep]
+ *                            *(unique-stmt stmtsep)
+ *                            [config-stmt stmtsep]
+ *                            [min-elements-stmt stmtsep]
+ *                            [max-elements-stmt stmtsep]
+ *                            [ordered-by-stmt stmtsep]
+ *                            [status-stmt stmtsep]
+ *                            [description-stmt stmtsep]
+ *                            [reference-stmt stmtsep]
+ *                            *((typedef-stmt /
+ *                               grouping-stmt) stmtsep)
+ *                            1*(data-def-stmt stmtsep)
+ *                         "}"
+ *
+ * ANTLR grammar rule
+ *  listStatement : LIST_KEYWORD identifier LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | mustStatement |
+ *  keyStatement | uniqueStatement | configStatement | minElementsStatement | maxElementsStatement |
+ *  orderedByStatement | statusStatement | descriptionStatement | referenceStatement | typedefStatement |
+ *  groupingStatement| dataDefStatement)* RIGHT_CURLY_BRACE;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "list" rule
+ * defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class ListListener {
+
+    /**
+     * Creates a new list listener.
+     */
+    private ListListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (list), performs validation and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processListEntry(TreeWalkListener listener,
+                                        ListStatementContext ctx) {
+
+        YangNode curNode;
+
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, LIST_DATA, ctx.identifier().getText(), ENTRY);
+
+        String identifier = getValidIdentifier(ctx.identifier().getText(), LIST_DATA, ctx);
+
+        // Validate sub statement cardinality.
+        validateSubStatementsCardinality(ctx);
+
+        // Check for identifier collision
+        int line = ctx.getStart().getLine();
+        int charPositionInLine = ctx.getStart().getCharPositionInLine();
+        detectCollidingChildUtil(listener, line, charPositionInLine, identifier, LIST_DATA);
+
+        YangList yangList = getYangListNode(JAVA_GENERATION);
+        yangList.setName(identifier);
+        yangList.setLineNumber(line);
+        yangList.setCharPosition(charPositionInLine);
+        yangList.setFileName(listener.getFileName());
+        /*
+         * If "config" is not specified, the default is the same as the parent
+         * schema node's "config" value.
+         */
+        if (ctx.configStatement().isEmpty()) {
+            boolean parentConfig = getParentNodeConfig(listener);
+            yangList.setConfig(parentConfig);
+        }
+
+        Parsable curData = listener.getParsedDataStack().peek();
+        if (curData instanceof YangModule || curData instanceof YangContainer
+                || curData instanceof YangList || curData instanceof YangCase
+                || curData instanceof YangNotification || curData instanceof YangInput
+                || curData instanceof YangOutput || curData instanceof YangAugment
+                || curData instanceof YangGrouping || curData instanceof YangSubModule) {
+            curNode = (YangNode) curData;
+            try {
+                curNode.addChild(yangList);
+            } catch (DataModelException e) {
+                throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                                                                                LIST_DATA, ctx.identifier().getText(), ENTRY, e.getMessage()));
+            }
+            listener.getParsedDataStack().push(yangList);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, LIST_DATA,
+                                                                    ctx.identifier().getText(), ENTRY));
+        }
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (list), it performs
+     * validation and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processListExit(TreeWalkListener listener,
+                                       ListStatementContext ctx) {
+
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, LIST_DATA, ctx.identifier().getText(), EXIT);
+
+        if (listener.getParsedDataStack().peek() instanceof YangList) {
+            YangList yangList = (YangList) listener.getParsedDataStack().peek();
+            try {
+                yangList.validateDataOnExit();
+                validateUniqueInList(yangList, ctx);
+            } catch (DataModelException e) {
+                ParserException parserException = new ParserException(constructExtendedListenerErrorMessage(
+                        UNHANDLED_PARSED_DATA, LIST_DATA, ctx.identifier().getText(), EXIT, e.getMessage()));
+                parserException.setLine(ctx.getStart().getLine());
+                parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+                throw parserException;
+            }
+            listener.getParsedDataStack().pop();
+        } else {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, LIST_DATA,
+                                                                    ctx.identifier().getText(), EXIT));
+        }
+    }
+
+    /**
+     * Validates the cardinality of list sub-statements as per grammar.
+     *
+     * @param ctx context object of the grammar rule
+     */
+    private static void validateSubStatementsCardinality(ListStatementContext ctx) {
+
+        validateCardinalityMaxOne(ctx.keyStatement(), KEY_DATA, LIST_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.configStatement(), CONFIG_DATA, LIST_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.maxElementsStatement(), MAX_ELEMENT_DATA, LIST_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.minElementsStatement(), MIN_ELEMENT_DATA, LIST_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.descriptionStatement(), DESCRIPTION_DATA, LIST_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.referenceStatement(), REFERENCE_DATA, LIST_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.statusStatement(), STATUS_DATA, LIST_DATA, ctx.identifier().getText());
+        validateCardinalityNonZero(ctx.dataDefStatement(), DATA_DEF_DATA, LIST_DATA, ctx.identifier().getText(), ctx);
+        //TODO when, typedef, grouping, unique
+    }
+}
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
new file mode 100644
index 0000000..b711592
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/MandatoryListener.java
@@ -0,0 +1,90 @@
+/*
+ * 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.YangLeaf;
+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 static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.MANDATORY_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.MandatoryStatementContext;
+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
+ *
+ * ABNF grammar as per RFC6020
+ *  mandatory-stmt      = mandatory-keyword sep
+ *                        mandatory-arg-str stmtend
+ *
+ *  mandatory-arg-str   = < a string that matches the rule
+ *                          mandatory-arg >
+ *
+ *  mandatory-arg       = true-keyword / false-keyword
+ *
+ * ANTLR grammar rule
+ *  mandatoryStatement : MANDATORY_KEYWORD mandatory STMTEND;
+ *  mandatory          : string;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "mandatory"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class MandatoryListener {
+
+    /**
+     * Creates a new mandatory listener.
+     */
+    private MandatoryListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar
+     * rule (mandatory), performs validation and updates the data model
+     * tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processMandatoryEntry(TreeWalkListener listener,
+                                             MandatoryStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, MANDATORY_DATA, "", ENTRY);
+
+        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));
+        }
+    }
+}
\ 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
new file mode 100644
index 0000000..ee7f1ef
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/MaxElementsListener.java
@@ -0,0 +1,141 @@
+/*
+ * 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.YangLeafList;
+import org.onosproject.yang.compiler.datamodel.YangList;
+import org.onosproject.yang.compiler.datamodel.YangMaxElement;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.datamodel.utils.YangConstructType;
+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.MAX_ELEMENT_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.MaxElementsStatementContext;
+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.removeQuotesAndHandleConcat;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *  max-elements-stmt   = max-elements-keyword sep
+ *                        max-value-arg-str stmtend
+ *  max-value-arg-str   = < a string that matches the rule
+ *                          max-value-arg >
+ *
+ * ANTLR grammar rule
+ * maxElementsStatement : MAX_ELEMENTS_KEYWORD maxValue STMTEND;
+ * maxValue             : string;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the
+ * "max-elements" rule defined in ANTLR grammar file for corresponding ABNF rule
+ * in RFC 6020.
+ */
+public final class MaxElementsListener {
+
+    private static final String POSITIVE_INTEGER_PATTERN = "[1-9][0-9]*";
+    private static final String UNBOUNDED_KEYWORD = "unbounded";
+
+    /**
+     * Creates a new max-elements listener.
+     */
+    private MaxElementsListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (max-elements), performs validation and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processMaxElementsEntry(TreeWalkListener listener,
+                                               MaxElementsStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, MAX_ELEMENT_DATA, "", ENTRY);
+
+        int maxElementsValue = getValidMaxElementValue(ctx);
+
+        YangMaxElement maxElement = new YangMaxElement();
+        maxElement.setMaxElement(maxElementsValue);
+
+        maxElement.setLineNumber(ctx.getStart().getLine());
+        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));
+        }
+    }
+
+    /**
+     * Validates max element value and returns the value from context.
+     *
+     * @param ctx context object of the grammar rule
+     * @return max element's value
+     */
+    private static int getValidMaxElementValue(MaxElementsStatementContext ctx) {
+
+        int maxElementsValue;
+
+        String value = removeQuotesAndHandleConcat(ctx.maxValue().getText());
+        if (value.equals(UNBOUNDED_KEYWORD)) {
+            maxElementsValue = Integer.MAX_VALUE;
+        } else if (value.matches(POSITIVE_INTEGER_PATTERN)) {
+            try {
+                maxElementsValue = Integer.parseInt(value);
+            } catch (NumberFormatException e) {
+                ParserException parserException = new ParserException("YANG file error : " +
+                                                                              YangConstructType.getYangConstructType(
+                                                                                      MAX_ELEMENT_DATA) + " value " +
+                                                                              value + " is not " +
+                                                                              "valid.");
+                parserException.setLine(ctx.getStart().getLine());
+                parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+                throw parserException;
+            }
+        } else {
+            ParserException parserException = new ParserException("YANG file error : " +
+                                                                          YangConstructType.getYangConstructType(
+                                                                                  MAX_ELEMENT_DATA) + " value " +
+                                                                          value + " is not " +
+                                                                          "valid.");
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+
+        return maxElementsValue;
+    }
+}
\ No newline at end of file
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
new file mode 100644
index 0000000..ed80c4c
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/MinElementsListener.java
@@ -0,0 +1,102 @@
+/*
+ * 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.YangLeafList;
+import org.onosproject.yang.compiler.datamodel.YangList;
+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;
+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.getValidNonNegativeIntegerValue;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *  min-elements-stmt   = min-elements-keyword sep
+ *                        min-value-arg-str stmtend
+ *  min-value-arg-str   = < a string that matches the rule
+ *                          min-value-arg >
+ *  min-value-arg       = non-negative-integer-value
+ *
+ * ANTLR grammar rule
+ * minElementsStatement : MIN_ELEMENTS_KEYWORD minValue STMTEND;
+ * minValue             : string;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "min-elements"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class MinElementsListener {
+
+    /**
+     * Creates a new min-elements listener.
+     */
+    private MinElementsListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar
+     * rule (min-elements), performs validation and updates the data model
+     * tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processMinElementsEntry(TreeWalkListener listener,
+                                               MinElementsStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, MIN_ELEMENT_DATA, ctx.minValue().getText(), ENTRY);
+
+        int minElementValue = getValidNonNegativeIntegerValue(ctx.minValue().getText(), MIN_ELEMENT_DATA, ctx);
+
+        YangMinElement minElement = new YangMinElement();
+
+        minElement.setMinElement(minElementValue);
+        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));
+        }
+    }
+}
\ 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
new file mode 100644
index 0000000..346e35c
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ModuleListener.java
@@ -0,0 +1,158 @@
+/*
+ * 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.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangReferenceResolver;
+import org.onosproject.yang.compiler.datamodel.YangResolutionInfo;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.linker.exceptions.LinkerException;
+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 java.util.List;
+
+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_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.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.MODULE_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ModuleStatementContext;
+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_CHILD;
+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.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsEmpty;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yang.compiler.translator.tojava.YangDataModelFactory.getYangModuleNode;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * module-stmt         = optsep module-keyword sep identifier-arg-str
+ *                       optsep
+ *                       "{" stmtsep
+ *                           module-header-stmts
+ *                           linkage-stmts
+ *                           meta-stmts
+ *                           revision-stmts
+ *                           body-stmts
+ *                       "}" optsep
+ *
+ * ANTLR grammar rule
+ * module_stmt : MODULE_KEYWORD identifier LEFT_CURLY_BRACE module_body* RIGHT_CURLY_BRACE;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "module"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class ModuleListener {
+
+    /**
+     * Creates a new module listener.
+     */
+    private ModuleListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (module), perform validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processModuleEntry(TreeWalkListener listener,
+                                          ModuleStatementContext ctx) {
+
+        // Check if stack is empty.
+        checkStackIsEmpty(listener, INVALID_HOLDER, MODULE_DATA,
+                          ctx.identifier().getText(), ENTRY);
+        String identifier = getValidIdentifier(ctx.identifier().getText(),
+                                               MODULE_DATA, ctx);
+        YangModule yangModule = getYangModuleNode(JAVA_GENERATION);
+        yangModule.setName(identifier);
+        yangModule.setLineNumber(ctx.getStart().getLine());
+        yangModule.setCharPosition(ctx.getStart().getCharPositionInLine());
+        yangModule.setFileName(listener.getFileName());
+
+        if (ctx.moduleBody().moduleHeaderStatement().yangVersionStatement() == null) {
+            yangModule.setVersion((byte) 1);
+        }
+
+        listener.getParsedDataStack().push(yangModule);
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (module), it perform
+     * validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processModuleExit(TreeWalkListener listener,
+                                         ModuleStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, MODULE_DATA,
+                             ctx.identifier().getText(), EXIT);
+        Parsable tmpNode = listener.getParsedDataStack().peek();
+        if (!(tmpNode instanceof YangModule)) {
+            throwError(MISSING_CURRENT_HOLDER, ctx);
+        }
+
+        YangModule module = (YangModule) tmpNode;
+        List<YangResolutionInfo> info = module.getUnresolvedResolutionList(
+                YANG_COMPILER_ANNOTATION);
+        if (info != null && !info.isEmpty() && module.getChild() != null) {
+            throwError(INVALID_CHILD, ctx);
+        }
+        YangReferenceResolver resolver = (YangReferenceResolver) listener
+                .getParsedDataStack().peek();
+        try {
+            resolver.resolveSelfFileLinking(YANG_IF_FEATURE);
+            resolver.resolveSelfFileLinking(YANG_USES);
+            resolver.resolveSelfFileLinking(YANG_DERIVED_DATA_TYPE);
+            resolver.resolveSelfFileLinking(YANG_LEAFREF);
+            resolver.resolveSelfFileLinking(YANG_BASE);
+            resolver.resolveSelfFileLinking(YANG_IDENTITYREF);
+        } catch (DataModelException e) {
+            LinkerException linkerException = new LinkerException(e.getMessage());
+            linkerException.setLine(e.getLineNumber());
+            linkerException.setCharPosition(e.getCharPositionInLine());
+            linkerException.setFileName(listener.getFileName());
+            throw linkerException;
+        }
+    }
+
+    private static void throwError(ListenerErrorType type,
+                                   ModuleStatementContext ctx) {
+        throw new ParserException(constructListenerErrorMessage(
+                type, MODULE_DATA, ctx.identifier().getText(), EXIT));
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/MustListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/MustListener.java
new file mode 100644
index 0000000..b9e542d
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/MustListener.java
@@ -0,0 +1,122 @@
+/*
+ * 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.YangMust;
+import org.onosproject.yang.compiler.datamodel.YangMustHolder;
+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 static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.MUST_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.MustStatementContext;
+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.ListenerUtil.removeQuotesAndHandleConcat;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *
+ *  must-stmt           = must-keyword sep string optsep
+ *                        (";" /
+ *                         "{" stmtsep
+ *                             ;; these stmts can appear in any order
+ *                             [error-message-stmt stmtsep]
+ *                             [error-app-tag-stmt stmtsep]
+ *                             [description-stmt stmtsep]
+ *                             [reference-stmt stmtsep]
+ *                          "}")
+ *
+ * ANTLR grammar rule
+ * mustStatement : MUST_KEYWORD string (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE);
+ */
+
+/**
+ * Represents listener based call back function corresponding to the
+ * "must" rule defined in ANTLR grammar file for corresponding ABNF rule
+ * in RFC 6020.
+ */
+public final class MustListener {
+
+    /**
+     * Creates a new must listener.
+     */
+    private MustListener() {
+    }
+
+    /**
+     * Perform validations and updates the data model tree.It is called when parser
+     * receives an input matching the grammar rule (must).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processMustEntry(TreeWalkListener listener,
+                                        MustStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, MUST_DATA, ctx.string().getText(), ENTRY);
+        String constraint = removeQuotesAndHandleConcat(ctx.string().getText());
+
+        // Obtain the node of the stack.
+        Parsable tmpNode = listener.getParsedDataStack().peek();
+        if (tmpNode instanceof YangMustHolder) {
+
+            YangMust must = new YangMust();
+            must.setConstraint(constraint);
+
+            must.setLineNumber(ctx.getStart().getLine());
+            must.setCharPosition(ctx.getStart().getCharPositionInLine());
+            must.setFileName(listener.getFileName());
+            YangMustHolder mustHolder = (YangMustHolder) tmpNode;
+            mustHolder.addMust(must);
+
+            listener.getParsedDataStack().push(must);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, MUST_DATA,
+                                                                    ctx.string().getText(), ENTRY));
+        }
+    }
+
+    /**
+     * Performs validation and updates the data model tree.It is called when parser
+     * exits from grammar rule (must).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processMustExit(TreeWalkListener listener,
+                                       MustStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, MUST_DATA, ctx.string().getText(), EXIT);
+
+        if (listener.getParsedDataStack().peek() instanceof YangMust) {
+            listener.getParsedDataStack().pop();
+        } else {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, MUST_DATA,
+                                                                    ctx.string().getText(), EXIT));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/NamespaceListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/NamespaceListener.java
new file mode 100644
index 0000000..b783c09
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/NamespaceListener.java
@@ -0,0 +1,118 @@
+/*
+ * 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.YangModule;
+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 java.net.URI;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.NAMESPACE_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.NamespaceStatementContext;
+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.removeQuotesAndHandleConcat;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * module-header-stmts = ;; these stmts can appear in any order
+ *                       [yang-version-stmt stmtsep]
+ *                        namespace-stmt stmtsep
+ *                        prefix-stmt stmtsep
+ *
+ * namespace-stmt      = namespace-keyword sep uri-str optsep stmtend
+ *
+ * ANTLR grammar rule
+ * module_header_statement : yang_version_stmt? namespace_stmt prefix_stmt
+ *                         | yang_version_stmt? prefix_stmt namespace_stmt
+ *                         | namespace_stmt yang_version_stmt? prefix_stmt
+ *                         | namespace_stmt prefix_stmt yang_version_stmt?
+ *                         | prefix_stmt namespace_stmt yang_version_stmt?
+ *                         | prefix_stmt yang_version_stmt? namespace_stmt
+ *                         ;
+ * namespace_stmt : NAMESPACE_KEYWORD string STMTEND;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "namespace"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class NamespaceListener {
+
+    /**
+     * Creates a new namespace listener.
+     */
+    private NamespaceListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (namespace), perform validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processNamespaceEntry(TreeWalkListener listener,
+                                             NamespaceStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, NAMESPACE_DATA, ctx.string().getText(), ENTRY);
+
+        if (!validateUriValue(ctx.string().getText())) {
+            ParserException parserException = new ParserException("YANG file error: Invalid namespace URI");
+            parserException.setLine(ctx.string().STRING(0).getSymbol().getLine());
+            parserException.setCharPosition(ctx.string().STRING(0).getSymbol().getCharPositionInLine());
+            throw parserException;
+        }
+
+        // Obtain the node of the stack.
+        Parsable tmpNode = listener.getParsedDataStack().peek();
+        switch (tmpNode.getYangConstructType()) {
+            case MODULE_DATA: {
+                YangModule module = (YangModule) tmpNode;
+                module.setModuleNamespace(removeQuotesAndHandleConcat(ctx.string().getText()));
+                break;
+            }
+            default:
+                throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, NAMESPACE_DATA,
+                                                                        ctx.string().getText(), ENTRY));
+        }
+    }
+
+    /**
+     * Validate input URI.
+     *
+     * @param uri input namespace URI
+     * @return validation result
+     */
+    private static boolean validateUriValue(String uri) {
+        uri = uri.replace("\"", "");
+        try {
+            URI.create(uri);
+        } catch (Exception e1) {
+            return false;
+        }
+        return true;
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/NotificationListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/NotificationListener.java
new file mode 100644
index 0000000..94bcee4
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/NotificationListener.java
@@ -0,0 +1,171 @@
+/*
+ * 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.RpcNotificationContainer;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNotification;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+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.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.NOTIFICATION_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.NotificationStatementContext;
+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.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.getValidIdentifier;
+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.translator.tojava.YangDataModelFactory.getYangNotificationNode;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *  notification-stmt   = notification-keyword sep
+ *                        identifier-arg-str optsep
+ *                        (";" /
+ *                         "{" stmtsep
+ *                             ;; these stmts can appear in any order
+ *                             *(if-feature-stmt stmtsep)
+ *                             [status-stmt stmtsep]
+ *                             [description-stmt stmtsep]
+ *                             [reference-stmt stmtsep]
+ *                             *((typedef-stmt /
+ *                                grouping-stmt) stmtsep)
+ *                             *(data-def-stmt stmtsep)
+ *                         "}")
+ *
+ * ANTLR grammar rule
+ *    notificationStatement : NOTIFICATION_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (ifFeatureStatement
+ *                          | statusStatement | descriptionStatement | referenceStatement | typedefStatement
+ *                          | groupingStatement | dataDefStatement)* RIGHT_CURLY_BRACE);
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "notification"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class NotificationListener {
+
+    /**
+     * Creates a new notification listener.
+     */
+    private NotificationListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (notification), performs validation and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processNotificationEntry(TreeWalkListener listener,
+                                                NotificationStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, NOTIFICATION_DATA,
+                             ctx.identifier().getText(), ENTRY);
+
+        String identifier = getValidIdentifier(ctx.identifier().getText(),
+                                               NOTIFICATION_DATA, ctx);
+
+        // Validate sub statement cardinality.
+        validateSubStatementsCardinality(ctx);
+
+        // Check for identifier collision
+        int line = ctx.getStart().getLine();
+        int charPositionInLine = ctx.getStart().getCharPositionInLine();
+        detectCollidingChildUtil(listener, line, charPositionInLine, identifier,
+                                 NOTIFICATION_DATA);
+
+        Parsable curData = listener.getParsedDataStack().peek();
+        if (curData instanceof RpcNotificationContainer) {
+
+            YangNotification notification = getYangNotificationNode(JAVA_GENERATION);
+            notification.setName(identifier);
+
+            notification.setLineNumber(ctx.getStart().getLine());
+            notification.setCharPosition(ctx.getStart().getCharPositionInLine());
+            notification.setFileName(listener.getFileName());
+            ((RpcNotificationContainer) curData).setNotificationPresenceFlag(true);
+            YangNode curNode = (YangNode) curData;
+            try {
+                curNode.addChild(notification);
+            } catch (DataModelException e) {
+                throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                                                                                NOTIFICATION_DATA, ctx.identifier().getText(), ENTRY, e.getMessage()));
+            }
+            listener.getParsedDataStack().push(notification);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(ListenerErrorType.INVALID_HOLDER, NOTIFICATION_DATA,
+                                                                    ctx.identifier().getText(), ENTRY));
+        }
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (notification), it perform
+     * validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processNotificationExit(TreeWalkListener listener,
+                                               NotificationStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, NOTIFICATION_DATA,
+                             ctx.identifier().getText(), EXIT);
+
+        if (listener.getParsedDataStack().peek() instanceof YangNotification) {
+            listener.getParsedDataStack().pop();
+        } else {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, NOTIFICATION_DATA,
+                                                                    ctx.identifier().getText(), EXIT));
+        }
+    }
+
+    /**
+     * Validates the cardinality of notification sub-statements as per grammar.
+     *
+     * @param ctx context object of the grammar rule
+     */
+    private static void validateSubStatementsCardinality(NotificationStatementContext ctx) {
+
+        validateCardinalityMaxOne(ctx.statusStatement(), STATUS_DATA,
+                                  NOTIFICATION_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.descriptionStatement(),
+                                  DESCRIPTION_DATA, NOTIFICATION_DATA,
+                                  ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.referenceStatement(), REFERENCE_DATA,
+                                  NOTIFICATION_DATA,
+                                  ctx.identifier().getText());
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/OrganizationListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/OrganizationListener.java
new file mode 100644
index 0000000..9fc259f
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/OrganizationListener.java
@@ -0,0 +1,119 @@
+/*
+ * 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.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+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 static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.ORGANIZATION_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.OrganizationStatementContext;
+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.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * meta-stmts          = ;; these stmts can appear in any order
+ *                       [organization-stmt stmtsep]
+ *                       [contact-stmt stmtsep]
+ *                       [description-stmt stmtsep]
+ *                       [reference-stmt stmtsep]
+ * organization-stmt   = organization-keyword sep string
+ *                            optsep stmtend
+ *
+ * ANTLR grammar rule
+ * meta_stmts : organization_stmt? contact_stmt? description_stmt? reference_stmt?
+ *            | organization_stmt? contact_stmt? reference_stmt? description_stmt?
+ *            | organization_stmt? description_stmt? contact_stmt? reference_stmt?
+ *            | organization_stmt? description_stmt? reference_stmt? contact_stmt?
+ *            | organization_stmt? reference_stmt? contact_stmt? description_stmt?
+ *            | organization_stmt? reference_stmt? description_stmt? contact_stmt?
+ *            | contact_stmt? organization_stmt? description_stmt? reference_stmt?
+ *            | contact_stmt? organization_stmt? reference_stmt? description_stmt?
+ *            | contact_stmt? reference_stmt? organization_stmt? description_stmt?
+ *            | contact_stmt? reference_stmt? description_stmt? organization_stmt?
+ *            | contact_stmt? description_stmt? reference_stmt? organization_stmt?
+ *            | contact_stmt? description_stmt? organization_stmt? reference_stmt?
+ *            | reference_stmt? contact_stmt? organization_stmt? description_stmt?
+ *            | reference_stmt? contact_stmt? description_stmt? organization_stmt?
+ *            | reference_stmt? organization_stmt? contact_stmt? description_stmt?
+ *            | reference_stmt? organization_stmt? description_stmt? contact_stmt?
+ *            | reference_stmt? description_stmt? organization_stmt? contact_stmt?
+ *            | reference_stmt? description_stmt? contact_stmt? organization_stmt?
+ *            | description_stmt? reference_stmt? contact_stmt? organization_stmt?
+ *            | description_stmt? reference_stmt? organization_stmt? contact_stmt?
+ *            | description_stmt? contact_stmt? reference_stmt? organization_stmt?
+ *            | description_stmt? contact_stmt? organization_stmt? reference_stmt?
+ *            | description_stmt? organization_stmt? contact_stmt? reference_stmt?
+ *            | description_stmt? organization_stmt? reference_stmt? contact_stmt?
+ *            ;
+ * organization_stmt : ORGANIZATION_KEYWORD string STMTEND;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the
+ * "organization" rule defined in ANTLR grammar file for corresponding ABNF rule
+ * in RFC 6020.
+ */
+public final class OrganizationListener {
+
+    /**
+     * Creates a new organization listener.
+     */
+    private OrganizationListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (organization), perform validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processOrganizationEntry(TreeWalkListener listener,
+                                                OrganizationStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, ORGANIZATION_DATA, ctx.string().getText(),
+                             ENTRY);
+
+        // Obtain the node of the stack.
+        Parsable tmpNode = listener.getParsedDataStack().peek();
+        switch (tmpNode.getYangConstructType()) {
+            case MODULE_DATA: {
+                YangModule module = (YangModule) tmpNode;
+                module.setOrganization(ctx.string().getText());
+                break;
+            }
+            case SUB_MODULE_DATA: {
+                YangSubModule subModule = (YangSubModule) tmpNode;
+                subModule.setOrganization(ctx.string().getText());
+                break;
+            }
+            default:
+                throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, ORGANIZATION_DATA,
+                                                                        ctx.string().getText(), ENTRY));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/OutputListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/OutputListener.java
new file mode 100644
index 0000000..ae240b4
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/OutputListener.java
@@ -0,0 +1,130 @@
+/*
+ * 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.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangOutput;
+import org.onosproject.yang.compiler.datamodel.YangRpc;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+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.utils.UtilConstants;
+
+import static org.onosproject.yang.compiler.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.OUTPUT_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.OutputStatementContext;
+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.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yang.compiler.translator.tojava.YangDataModelFactory.getYangOutputNode;
+import static org.onosproject.yang.compiler.utils.UtilConstants.OUTPUT;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *
+ *  output-stmt         = output-keyword optsep
+ *                        "{" stmtsep
+ *                            ;; these stmts can appear in any order
+ *                            *((typedef-stmt /
+ *                               grouping-stmt) stmtsep)
+ *                            1*(data-def-stmt stmtsep)
+ *                        "}"
+ *
+ *  outputStatement : OUTPUT_KEYWORD LEFT_CURLY_BRACE outputStatementBody RIGHT_CURLY_BRACE;
+
+ *  outputStatementBody : typedefStatement* dataDefStatement+
+ *                      | dataDefStatement+ typedefStatement*
+ *                      | groupingStatement* dataDefStatement+
+ *                      | dataDefStatement+ groupingStatement*;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "output"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class OutputListener {
+
+    /**
+     * Creates a new output listener.
+     */
+    private OutputListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (output), performs validation and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processOutputEntry(TreeWalkListener listener,
+                                          OutputStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, OUTPUT_DATA, "", ENTRY);
+
+        Parsable curData = listener.getParsedDataStack().peek();
+        if (curData instanceof YangRpc) {
+
+            YangOutput yangOutput = getYangOutputNode(JAVA_GENERATION);
+            yangOutput.setName(OUTPUT);
+            yangOutput.setLineNumber(ctx.getStart().getLine());
+            yangOutput.setCharPosition(ctx.getStart().getCharPositionInLine());
+            yangOutput.setFileName(listener.getFileName());
+            YangNode curNode = (YangNode) curData;
+            try {
+                curNode.addChild(yangOutput);
+            } catch (DataModelException e) {
+                throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                                                                                OUTPUT_DATA, "", ENTRY, e.getMessage()));
+            }
+            listener.getParsedDataStack().push(yangOutput);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, OUTPUT_DATA,
+                                                                    "", ENTRY));
+        }
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (output), it perform
+     * validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processOutputExit(TreeWalkListener listener,
+                                         OutputStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, OUTPUT_DATA, "", EXIT);
+
+        if (!(listener.getParsedDataStack().peek() instanceof YangOutput)) {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, OUTPUT_DATA,
+                                                                    "", EXIT));
+        }
+        listener.getParsedDataStack().pop();
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/PathListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/PathListener.java
new file mode 100644
index 0000000..c1e8b7c
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/PathListener.java
@@ -0,0 +1,92 @@
+/*
+ * 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.YangLeafRef;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.PathStatementContext;
+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.YangConstructType.PATH_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.validatePath;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *  leafref-specification =
+ *                        ;; these stmts can appear in any order
+ *                        path-stmt stmtsep
+ *                        [require-instance-stmt stmtsep]
+ *
+ * path-stmt           = path-keyword sep path-arg-str stmtend
+ *
+ * ANTLR grammar rule
+ *
+ * leafrefSpecification : (pathStatement (requireInstanceStatement)?) |
+ * ((requireInstanceStatement)? pathStatement);
+ *
+ * pathStatement : PATH_KEYWORD path STMTEND;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the
+ * "path" rule defined in ANTLR grammar file for corresponding ABNF rule
+ * in RFC 6020.
+ */
+public final class PathListener {
+
+    // No instantiation.
+    private PathListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (path), performs validation and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processPathEntry(TreeWalkListener listener,
+                                        PathStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, PATH_DATA,
+                             ctx.path().getText(), ENTRY);
+
+        Parsable curData = listener.getParsedDataStack().peek();
+
+        // Checks the holder of path as leaf-ref, else throws error.
+        if (curData instanceof YangLeafRef) {
+            // Parsing the path and updating in leaf-ref path.
+            validatePath(ctx.path().getText(), PATH_DATA, ctx,
+                         (YangLeafRef) curData);
+        } else {
+            throw new ParserException(
+                    constructListenerErrorMessage(INVALID_HOLDER, PATH_DATA,
+                                                  ctx.path().getText(), ENTRY));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/PatternRestrictionListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/PatternRestrictionListener.java
new file mode 100644
index 0000000..c522c4b
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/PatternRestrictionListener.java
@@ -0,0 +1,203 @@
+/*
+ * 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.antlr.v4.runtime.tree.TerminalNode;
+import org.onosproject.yang.compiler.datamodel.YangDerivedInfo;
+import org.onosproject.yang.compiler.datamodel.YangPatternRestriction;
+import org.onosproject.yang.compiler.datamodel.YangStringRestriction;
+import org.onosproject.yang.compiler.datamodel.YangType;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
+
+import java.util.List;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.PATTERN_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.TYPE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.getYangConstructType;
+import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.DERIVED;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.PatternStatementContext;
+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
+ *  pattern-stmt        = pattern-keyword sep string optsep
+ *                        (";" /
+ *                         "{" stmtsep
+ *                             ;; these stmts can appear in any order
+ *                             [error-message-stmt stmtsep]
+ *                             [error-app-tag-stmt stmtsep]
+ *                             [description-stmt stmtsep]
+ *                             [reference-stmt stmtsep]
+ *                          "}")
+ *
+ * ANTLR grammar rule
+ *  patternStatement : PATTERN_KEYWORD string (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE);
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "pattern"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class PatternRestrictionListener {
+
+    private static final String EMPTY_STRING = "";
+
+    /**
+     * Creates a new pattern restriction listener.
+     */
+    private PatternRestrictionListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar
+     * rule (pattern), performs validation and updates the data model
+     * tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processPatternRestrictionEntry(TreeWalkListener listener,
+                                                      PatternStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, PATTERN_DATA, ctx.string().getText(), ENTRY);
+
+        Parsable tmpData = listener.getParsedDataStack().peek();
+        if (tmpData.getYangConstructType() == TYPE_DATA) {
+            YangType type = (YangType) tmpData;
+            setPatternRestriction(listener, type, ctx);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, PATTERN_DATA,
+                                                                    ctx.string().getText(), ENTRY));
+        }
+    }
+
+    /**
+     * Sets the pattern restriction to type.
+     *
+     * @param listener listener's object
+     * @param type     Yang type for which pattern restriction to be set
+     * @param ctx      context object of the grammar rule
+     */
+    private static void setPatternRestriction(TreeWalkListener listener, YangType type,
+                                              PatternStatementContext ctx) {
+
+        if (type.getDataType() != YangDataTypes.STRING && type.getDataType() != YangDataTypes.DERIVED) {
+
+            ParserException parserException = new ParserException("YANG file error : " +
+                                                                          getYangConstructType(PATTERN_DATA) + " name " + ctx.string().getText() +
+                                                                          " can be used to restrict the built-in type string or types derived from string.");
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+
+        // Validate and get valid pattern restriction string.
+        String patternArgument = getValidPattern(ctx);
+
+        if (type.getDataType() == YangDataTypes.STRING) {
+            YangStringRestriction stringRestriction = (YangStringRestriction) type.getDataTypeExtendedInfo();
+            if (stringRestriction == null) {
+                stringRestriction = new YangStringRestriction();
+                stringRestriction.setFileName(listener.getFileName());
+                stringRestriction.setCharPosition(ctx.getStart().getCharPositionInLine());
+                stringRestriction.setLineNumber(ctx.getStart().getLine());
+                type.setDataTypeExtendedInfo(stringRestriction);
+                stringRestriction.addPattern(patternArgument);
+            } else {
+                stringRestriction.addPattern(patternArgument);
+            }
+            listener.getParsedDataStack().push(stringRestriction);
+        } else {
+            YangPatternRestriction patternRestriction = ((YangDerivedInfo<?>) type
+                    .getDataTypeExtendedInfo()).getPatternRestriction();
+            if (patternRestriction == null) {
+                patternRestriction = new YangPatternRestriction();
+                ((YangDerivedInfo<?>) type.getDataTypeExtendedInfo()).setPatternRestriction(patternRestriction);
+                patternRestriction.addPattern(patternArgument);
+            } else {
+                ((YangDerivedInfo<?>) type.getDataTypeExtendedInfo()).setPatternRestriction(patternRestriction);
+                patternRestriction.addPattern(patternArgument);
+            }
+        }
+    }
+
+    /**
+     * Performs validation and updates the data model tree.
+     * It is called when parser exits from grammar rule (pattern).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processPatternRestrictionExit(TreeWalkListener listener,
+                                                     PatternStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, PATTERN_DATA, ctx.string().getText(), EXIT);
+
+        Parsable tmpData = listener.getParsedDataStack().peek();
+        if (tmpData instanceof YangStringRestriction) {
+            listener.getParsedDataStack().pop();
+        } else if (tmpData instanceof YangType
+                && ((YangType) tmpData).getDataType() == DERIVED) {
+            // TODO : need to handle in linker
+        } else {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, PATTERN_DATA,
+                                                                    ctx.string().getText(), EXIT));
+        }
+    }
+
+    /**
+     * Validates and return the valid pattern.
+     *
+     * @param ctx context object of the grammar rule
+     * @return validated string
+     */
+    private static String getValidPattern(PatternStatementContext ctx) {
+        List<TerminalNode> patternList = ctx.string().STRING();
+        StringBuilder userInputPattern = new StringBuilder();
+        String compile;
+        for (TerminalNode pattern : patternList) {
+            userInputPattern.append(pattern.getText());
+        }
+        compile = userInputPattern.toString().replaceAll("[\'\"]", EMPTY_STRING);
+        try {
+            Pattern.compile(compile);
+        } catch (PatternSyntaxException exception) {
+            ParserException parserException = new ParserException("YANG file error : " +
+                                                                          getYangConstructType(PATTERN_DATA) + " name " + ctx.string().getText() +
+                                                                          " is not a valid regular expression");
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+        return compile;
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/PositionListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/PositionListener.java
new file mode 100644
index 0000000..a29d3a0
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/PositionListener.java
@@ -0,0 +1,130 @@
+/*
+ * 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
+ * position-stmt       = position-keyword sep
+ *                       position-value-arg-str stmtend
+ * position-value-arg-str = < a string that matches the rule
+ *                            position-value-arg >
+ * position-value-arg  = non-negative-integer-value
+ * non-negative-integer-value = "0" / positive-integer-value
+ * positive-integer-value = (non-zero-digit *DIGIT)
+ * zero-integer-value  = 1*DIGIT
+ *
+ * ANTLR grammar rule
+ * positionStatement : POSITION_KEYWORD position STMTEND;
+ * position          : string;
+ */
+
+import org.onosproject.yang.compiler.datamodel.YangBit;
+import org.onosproject.yang.compiler.datamodel.YangBits;
+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 org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.POSITION_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.PositionStatementContext;
+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.getValidNonNegativeIntegerValue;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/**
+ * Represents listener based call back function corresponding to the "position"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class PositionListener {
+
+    /**
+     * Creates a new position listener.
+     */
+    private PositionListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (position), perform validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processPositionEntry(TreeWalkListener listener,
+                                            PositionStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, POSITION_DATA, ctx.position().getText(), ENTRY);
+
+        // Obtain the node of the stack.
+        Parsable tmpNode = listener.getParsedDataStack().peek();
+        switch (tmpNode.getYangConstructType()) {
+            case BIT_DATA: {
+                YangBit bitNode = (YangBit) tmpNode;
+                int positionValue = getValidBitPosition(listener, ctx);
+                bitNode.setPosition(positionValue);
+                break;
+            }
+            default:
+                throw new ParserException(
+                        constructListenerErrorMessage(INVALID_HOLDER, POSITION_DATA, ctx.position().getText(), ENTRY));
+        }
+    }
+
+    /**
+     * Validates BITS position value correctness and uniqueness.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     * @return position value
+     */
+    private static int getValidBitPosition(TreeWalkListener listener,
+                                           PositionStatementContext ctx) {
+        Parsable bitNode = listener.getParsedDataStack().pop();
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, POSITION_DATA, ctx.position().getText(), ENTRY);
+
+        int positionValue = getValidNonNegativeIntegerValue(ctx.position().getText(), POSITION_DATA, ctx);
+
+        Parsable tmpNode = listener.getParsedDataStack().peek();
+        switch (tmpNode.getYangConstructType()) {
+            case BITS_DATA: {
+                YangBits yangBits = (YangBits) tmpNode;
+                listener.getParsedDataStack().push(bitNode);
+                if (yangBits.isBitPositionExists(positionValue)) {
+                    ParserException parserException = new ParserException("YANG file error: Duplicate value of " +
+                                                                                  "position is invalid.");
+                    parserException.setLine(ctx.getStart().getLine());
+                    parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+                    throw parserException;
+                }
+                return positionValue;
+            }
+            default:
+                listener.getParsedDataStack().push(bitNode);
+                throw new ParserException(
+                        constructListenerErrorMessage(INVALID_HOLDER, POSITION_DATA, ctx.position().getText(), ENTRY));
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/PrefixListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/PrefixListener.java
new file mode 100644
index 0000000..5aadc65
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/PrefixListener.java
@@ -0,0 +1,109 @@
+/*
+ * 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.YangBelongsTo;
+import org.onosproject.yang.compiler.datamodel.YangImport;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+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 org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.PREFIX_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.PrefixStatementContext;
+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.getValidIdentifier;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * module-header-stmts = ;; these stmts can appear in any order
+ *                       [yang-version-stmt stmtsep]
+ *                        namespace-stmt stmtsep
+ *                        prefix-stmt stmtsep
+ *
+ * prefix-stmt         = prefix-keyword sep prefix-arg-str
+ *                       optsep stmtend
+ *
+ * ANTLR grammar rule
+ * module_header_statement : yang_version_stmt? namespace_stmt prefix_stmt
+ *                         | yang_version_stmt? prefix_stmt namespace_stmt
+ *                         | namespace_stmt yang_version_stmt? prefix_stmt
+ *                         | namespace_stmt prefix_stmt yang_version_stmt?
+ *                         | prefix_stmt namespace_stmt yang_version_stmt?
+ *                         | prefix_stmt yang_version_stmt? namespace_stmt
+ *                         ;
+ * prefix_stmt : PREFIX_KEYWORD identifier STMTEND;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "prefix"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class PrefixListener {
+
+    /**
+     * Creates a new prefix listener.
+     */
+    private PrefixListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (prefix),perform validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processPrefixEntry(TreeWalkListener listener, PrefixStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, PREFIX_DATA, ctx.identifier().getText(), ENTRY);
+
+        String identifier = getValidIdentifier(ctx.identifier().getText(), PREFIX_DATA, ctx);
+
+        // Obtain the node of the stack.
+        Parsable tmpNode = listener.getParsedDataStack().peek();
+        switch (tmpNode.getYangConstructType()) {
+            case MODULE_DATA: {
+                YangModule module = (YangModule) tmpNode;
+                module.setPrefix(identifier);
+                break;
+            }
+            case IMPORT_DATA: {
+                YangImport importNode = (YangImport) tmpNode;
+                importNode.setPrefixId(identifier);
+                break;
+            }
+            case BELONGS_TO_DATA: {
+                YangBelongsTo belongstoNode = (YangBelongsTo) tmpNode;
+                belongstoNode.setPrefix(identifier);
+                break;
+            }
+            default:
+                throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, PREFIX_DATA,
+                        ctx.identifier().getText(), ENTRY));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/PresenceListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/PresenceListener.java
new file mode 100644
index 0000000..27b9061
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/PresenceListener.java
@@ -0,0 +1,79 @@
+/*
+ * 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.YangContainer;
+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.CONTAINER_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.PRESENCE_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.PresenceStatementContext;
+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.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * presence-stmt       = presence-keyword sep string stmtend
+ *
+ * ANTLR grammar rule
+ * presenceStatement : PRESENCE_KEYWORD string STMTEND;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "presence"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class PresenceListener {
+
+    /**
+     * Creates a new presence listener.
+     */
+    private PresenceListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar
+     * rule (presence), performs validation and updates the data model
+     * tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processPresenceEntry(TreeWalkListener listener,
+                                            PresenceStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, PRESENCE_DATA, ctx.string().getText(), ENTRY);
+
+        Parsable tmpData = listener.getParsedDataStack().peek();
+        if (tmpData.getYangConstructType() == CONTAINER_DATA) {
+            YangContainer container = (YangContainer) tmpData;
+            container.setPresence(ctx.string().getText());
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, PRESENCE_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/listeners/RangeRestrictionListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/RangeRestrictionListener.java
new file mode 100644
index 0000000..418482f
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/RangeRestrictionListener.java
@@ -0,0 +1,186 @@
+/*
+ * 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.YangDecimal64;
+import org.onosproject.yang.compiler.datamodel.YangDerivedInfo;
+import org.onosproject.yang.compiler.datamodel.YangRangeRestriction;
+import org.onosproject.yang.compiler.datamodel.YangType;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+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 static org.onosproject.yang.compiler.datamodel.utils.RestrictionResolver.processRangeRestriction;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.RANGE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.TYPE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypeUtils.isOfRangeRestrictedType;
+import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.DECIMAL64;
+import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.DERIVED;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RangeStatementContext;
+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
+ *  range-stmt          = range-keyword sep range-arg-str optsep
+ *                        (";" /
+ *                         "{" stmtsep
+ *                             ;; these stmts can appear in any order
+ *                             [error-message-stmt stmtsep]
+ *                             [error-app-tag-stmt stmtsep]
+ *                             [description-stmt stmtsep]
+ *                             [reference-stmt stmtsep]
+ *                          "}")
+ *
+ * ANTLR grammar rule
+ *  rangeStatement : RANGE_KEYWORD range (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE);
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "range"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class RangeRestrictionListener {
+
+    /**
+     * Creates a new range restriction listener.
+     */
+    private RangeRestrictionListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar
+     * rule (range), performs validation and updates the data model
+     * tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processRangeRestrictionEntry(TreeWalkListener listener,
+                                                    RangeStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, RANGE_DATA, ctx.range().getText(), ENTRY);
+
+        Parsable tmpData = listener.getParsedDataStack().peek();
+        if (tmpData.getYangConstructType() == TYPE_DATA) {
+            YangType type = (YangType) tmpData;
+            setRangeRestriction(listener, type, ctx);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, RANGE_DATA,
+                                                                    ctx.range().getText(), ENTRY));
+        }
+    }
+
+    /**
+     * Sets the range restriction to type.
+     *
+     * @param listener listener's object
+     * @param type     YANG type for which range restriction to be added
+     * @param ctx      context object of the grammar rule
+     */
+    private static void setRangeRestriction(TreeWalkListener listener, YangType type,
+                                            RangeStatementContext ctx) {
+
+        if (type.getDataType() == DERIVED) {
+            ((YangDerivedInfo<YangRangeRestriction>) type.getDataTypeExtendedInfo())
+                    .setRangeRestrictionString(ctx.range().getText());
+            ((YangDerivedInfo<YangRangeRestriction>) type.getDataTypeExtendedInfo())
+                    .setLineNumber(ctx.getStart().getLine());
+            ((YangDerivedInfo<YangRangeRestriction>) type.getDataTypeExtendedInfo())
+                    .setCharPosition(ctx.getStart().getCharPositionInLine());
+            return;
+        }
+
+        if (!(isOfRangeRestrictedType(type.getDataType())) && (type.getDataType() != DECIMAL64)) {
+            ParserException parserException = new ParserException("YANG file error: Range restriction can't be " +
+                                                                          "applied to a given type");
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+
+        YangRangeRestriction rangeRestriction = null;
+        try {
+            if (type.getDataType() == DECIMAL64) {
+                YangDecimal64 yangDecimal64 = (YangDecimal64) type.getDataTypeExtendedInfo();
+                rangeRestriction =
+                        processRangeRestriction(yangDecimal64.getDefaultRangeRestriction(),
+                                                ctx.getStart().getLine(),
+                                                ctx.getStart().getCharPositionInLine(),
+                                                true, ctx.range().getText(),
+                                                type.getDataType(), listener.getFileName());
+            } else {
+                rangeRestriction =
+                        processRangeRestriction(null, ctx.getStart().getLine(),
+                                                ctx.getStart().getCharPositionInLine(),
+                                                false, ctx.range()
+                                                        .getText(), type
+                                                        .getDataType(),
+                                                listener.getFileName());
+            }
+        } catch (DataModelException e) {
+            ParserException parserException = new ParserException(e.getMessage());
+            parserException.setCharPosition(e.getCharPositionInLine());
+            parserException.setLine(e.getLineNumber());
+            throw parserException;
+        }
+
+        if (rangeRestriction != null) {
+            if (type.getDataType() == DECIMAL64) {
+                ((YangDecimal64<YangRangeRestriction>) type.getDataTypeExtendedInfo())
+                        .setRangeRestrictedExtendedInfo(rangeRestriction);
+            } else {
+                type.setDataTypeExtendedInfo(rangeRestriction);
+            }
+        }
+        listener.getParsedDataStack().push(rangeRestriction);
+    }
+
+    /**
+     * Performs validation and updates the data model tree.
+     * It is called when parser exits from grammar rule (range).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processRangeRestrictionExit(TreeWalkListener listener,
+                                                   RangeStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, RANGE_DATA, ctx.range().getText(), EXIT);
+
+        Parsable tmpData = listener.getParsedDataStack().peek();
+        if (tmpData instanceof YangRangeRestriction) {
+            listener.getParsedDataStack().pop();
+        } else if (tmpData instanceof YangType
+                && ((YangType) tmpData).getDataType() == DERIVED) {
+            // TODO : need to handle in linker
+        } else {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, RANGE_DATA,
+                                                                    ctx.range().getText(), EXIT));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ReferenceListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ReferenceListener.java
new file mode 100644
index 0000000..877ad35
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ReferenceListener.java
@@ -0,0 +1,77 @@
+/*
+ * 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.YangReference;
+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 static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ReferenceStatementContext;
+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.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * reference-stmt      = reference-keyword sep string optsep stmtend
+ *
+ * ANTLR grammar rule
+ * referenceStatement : REFERENCE_KEYWORD string STMTEND;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "reference"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class ReferenceListener {
+
+    /**
+     * Creates a new reference listener.
+     */
+    private ReferenceListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar
+     * rule (reference), performs validation and updates the data model
+     * tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processReferenceEntry(TreeWalkListener listener,
+                                             ReferenceStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, REFERENCE_DATA, ctx.string().getText(), ENTRY);
+
+        Parsable tmpData = listener.getParsedDataStack().peek();
+        if (tmpData instanceof YangReference) {
+            YangReference reference = (YangReference) tmpData;
+            reference.setReference(ctx.string().getText());
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, REFERENCE_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/listeners/RequireInstanceListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/RequireInstanceListener.java
new file mode 100644
index 0000000..c83623a
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/RequireInstanceListener.java
@@ -0,0 +1,109 @@
+/*
+ * 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.YangLeafRef;
+import org.onosproject.yang.compiler.datamodel.YangType;
+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.REQUIRE_INSTANCE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.INSTANCE_IDENTIFIER;
+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
+ *
+ * ABNF grammar as per RFC6020
+ * require-instance-stmt = require-instance-keyword sep
+ *                            require-instance-arg-str stmtend
+ *
+ * require-instance-arg-str = < a string that matches the rule
+ *                            require-instance-arg >
+ *
+ * require-instance-arg = true-keyword / false-keyword
+ *
+ * ANTLR grammar rule
+ *
+ * requireInstanceStatement : REQUIRE_INSTANCE_KEYWORD requireInstance STMTEND;
+ *
+ * requireInstance : string;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the
+ * "require-instance" rule defined in ANTLR grammar file for corresponding ABNF rule
+ * in RFC 6020.
+ */
+public final class RequireInstanceListener {
+
+    /**
+     * Creates a new require instance listener.
+     */
+    private RequireInstanceListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (require-instance), performs validation and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processRequireInstanceEntry(TreeWalkListener listener,
+                                                   GeneratedYangParser.RequireInstanceStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, REQUIRE_INSTANCE_DATA, "", ENTRY);
+
+        Parsable curData = listener.getParsedDataStack().peek();
+
+        // Gets the status of require instance
+        boolean isRequireInstance = getValidBooleanValue(ctx.requireInstance().getText(), REQUIRE_INSTANCE_DATA, ctx);
+
+        // Checks the holder of require-instance as leafref or type, else throws error.
+        if (curData instanceof YangLeafRef) {
+
+            // Sets the require-instance status to leafref.
+            ((YangLeafRef) curData).setRequireInstance(isRequireInstance);
+        } else if (curData instanceof YangType) {
+
+            // Checks type should be instance-identifier, else throw error.
+            if (((YangType) curData).getDataType() == INSTANCE_IDENTIFIER) {
+
+                // Sets the require-instance status to instance-identifier type.
+                ((YangType) curData).setDataTypeExtendedInfo(isRequireInstance);
+            } else {
+                throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, REQUIRE_INSTANCE_DATA,
+                        ctx.getText(), ENTRY));
+            }
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, REQUIRE_INSTANCE_DATA,
+                    ctx.getText(), ENTRY));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/RevisionDateListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/RevisionDateListener.java
new file mode 100644
index 0000000..7a49388
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/RevisionDateListener.java
@@ -0,0 +1,114 @@
+/*
+ * 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.YangImport;
+import org.onosproject.yang.compiler.datamodel.YangInclude;
+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 java.util.Date;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.REVISION_DATE_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RevisionDateStatementContext;
+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.getValidDateFromString;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * import-stmt         = import-keyword sep identifier-arg-str optsep
+ *                       "{" stmtsep
+ *                           prefix-stmt stmtsep
+ *                           [revision-date-stmt stmtsep]
+ *                        "}"
+ * include-stmt        = include-keyword sep identifier-arg-str optsep
+ *                             (";" /
+ *                              "{" stmtsep
+ *                                  [revision-date-stmt stmtsep]
+ *                            "}")
+ * revision-date-stmt = revision-date-keyword sep revision-date stmtend
+ *
+ * ANTLR grammar rule
+ * import_stmt : IMPORT_KEYWORD IDENTIFIER LEFT_CURLY_BRACE import_stmt_body
+ *               RIGHT_CURLY_BRACE;
+ * import_stmt_body : prefix_stmt revision_date_stmt?;
+ *
+ * include_stmt : INCLUDE_KEYWORD IDENTIFIER (STMTEND | LEFT_CURLY_BRACE
+ *                revision_date_stmt_body? RIGHT_CURLY_BRACE);
+ *
+ * revision_date_stmt : REVISION_DATE_KEYWORD DATE_ARG STMTEND;
+ *
+ */
+
+/**
+ * Represents listener based call back function corresponding to the
+ * "revision date" rule defined in ANTLR grammar file for corresponding ABNF
+ * rule in RFC 6020.
+ */
+public final class RevisionDateListener {
+
+    /**
+     * Creates a new revision date listener.
+     */
+    private RevisionDateListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (revision date),perform validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processRevisionDateEntry(TreeWalkListener listener,
+                                                RevisionDateStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, REVISION_DATE_DATA, ctx.dateArgumentString().getText(),
+                ENTRY);
+
+        Date date = getValidDateFromString(ctx.dateArgumentString().getText(), ctx);
+
+        // Obtain the node of the stack.
+        Parsable tmpNode = listener.getParsedDataStack().peek();
+        switch (tmpNode.getYangConstructType()) {
+            case IMPORT_DATA: {
+                YangImport importNode = (YangImport) tmpNode;
+                importNode.setRevision(date);
+                break;
+            }
+            case INCLUDE_DATA: {
+                YangInclude includeNode = (YangInclude) tmpNode;
+                includeNode.setRevision(date);
+                break;
+            }
+            default:
+                throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, REVISION_DATE_DATA,
+                        ctx.dateArgumentString().getText(), ENTRY));
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/RevisionListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/RevisionListener.java
new file mode 100644
index 0000000..50b630d
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/RevisionListener.java
@@ -0,0 +1,170 @@
+/*
+ * 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.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangRevision;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+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 java.util.Date;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.REVISION_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RevisionStatementContext;
+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.ListenerUtil.getValidDateFromString;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * module-stmt         = optsep module-keyword sep identifier-arg-str
+ *                       optsep
+ *                       "{" stmtsep
+ *                           module-header-stmts
+ *                           linkage-stmts
+ *                           meta-stmts
+ *                           revision-stmts
+ *                           body-stmts
+ *                       "}" optsep
+ *
+ * revision-stmt       = revision-keyword sep revision-date optsep
+ *                             (";" /
+ *                              "{" stmtsep
+ *                                  [description-stmt stmtsep]
+ *                                  [reference-stmt stmtsep]
+ *                              "}")
+ *
+ * ANTLR grammar rule
+ * module_stmt : MODULE_KEYWORD IDENTIFIER LEFT_CURLY_BRACE module_body* RIGHT_CURLY_BRACE;
+ *
+ * revision_stmt : REVISION_KEYWORD DATE_ARG (STMTEND | LEFT_CURLY_BRACE revision_stmt_body RIGHT_CURLY_BRACE);
+ * revision_stmt_body : description_stmt? reference_stmt?;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "revision"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class RevisionListener {
+
+    /**
+     * Creates a new revision listener.
+     */
+    private RevisionListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (revision),perform validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processRevisionEntry(TreeWalkListener listener,
+                                            RevisionStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, REVISION_DATA, ctx.dateArgumentString().getText(), ENTRY);
+
+        Date date = getValidDateFromString(ctx.dateArgumentString().getText(), ctx);
+
+        YangRevision revisionNode = new YangRevision();
+        revisionNode.setRevDate(date);
+
+        listener.getParsedDataStack().push(revisionNode);
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (revision), it perform
+     * validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processRevisionExit(TreeWalkListener listener, RevisionStatementContext
+            ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, REVISION_DATA, ctx.dateArgumentString().getText(), EXIT);
+
+        Parsable tmpRevisionNode = listener.getParsedDataStack().peek();
+        if (tmpRevisionNode instanceof YangRevision) {
+            listener.getParsedDataStack().pop();
+
+            // Check for stack to be non empty.
+            checkStackIsNotEmpty(listener, MISSING_HOLDER, REVISION_DATA, ctx.dateArgumentString().getText(),
+                                 EXIT);
+
+            Parsable tmpNode = listener.getParsedDataStack().peek();
+            switch (tmpNode.getYangConstructType()) {
+                case MODULE_DATA: {
+                    YangModule module = (YangModule) tmpNode;
+                    if (module.getRevision() != null) {
+                        Date curRevisionDate = module.getRevision().getRevDate();
+                        if (curRevisionDate.before(((YangRevision) tmpRevisionNode).getRevDate())) {
+                            module.setRevision((YangRevision) tmpRevisionNode);
+                        }
+                    } else {
+                        module.setRevision((YangRevision) tmpRevisionNode);
+                    }
+                    break;
+                }
+                case SUB_MODULE_DATA: {
+                    YangSubModule subModule = (YangSubModule) tmpNode;
+                    if (subModule.getRevision() != null) {
+                        Date curRevisionDate = subModule.getRevision().getRevDate();
+                        if (curRevisionDate.before(((YangRevision) tmpRevisionNode).getRevDate())) {
+                            subModule.setRevision((YangRevision) tmpRevisionNode);
+                        }
+                    } else {
+                        subModule.setRevision((YangRevision) tmpRevisionNode);
+                    }
+                    break;
+                }
+                default:
+                    throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, REVISION_DATA,
+                                                                            ctx.dateArgumentString().getText(),
+                                                                            EXIT));
+            }
+        } else {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, REVISION_DATA,
+                                                                    ctx.dateArgumentString().getText(), EXIT));
+        }
+    }
+
+    /**
+     * Validate revision.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     * @return validation result
+     */
+    private static boolean validateRevision(TreeWalkListener listener,
+                                            RevisionStatementContext ctx) {
+        // TODO to be implemented
+        return true;
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/RpcListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/RpcListener.java
new file mode 100644
index 0000000..25baa54
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/RpcListener.java
@@ -0,0 +1,165 @@
+/*
+ * 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.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangRpc;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+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 static org.onosproject.yang.compiler.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.INPUT_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.OUTPUT_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.RPC_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.RpcStatementContext;
+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.getValidIdentifier;
+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.translator.tojava.YangDataModelFactory.getYangRpcNode;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *  rpc-stmt            = rpc-keyword sep identifier-arg-str optsep
+ *                        (";" /
+ *                         "{" stmtsep
+ *                             ;; these stmts can appear in any order
+ *                             *(if-feature-stmt stmtsep)
+ *                             [status-stmt stmtsep]
+ *                             [description-stmt stmtsep]
+ *                             [reference-stmt stmtsep]
+ *                             *((typedef-stmt /
+ *                                grouping-stmt) stmtsep)
+ *                             [input-stmt stmtsep]
+ *                             [output-stmt stmtsep]
+ *                         "}")
+ *
+ * ANTLR grammar rule
+ *  rpcStatement : RPC_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (ifFeatureStatement | statusStatement
+ *               | descriptionStatement | referenceStatement | typedefStatement | groupingStatement | inputStatement
+ *               | outputStatement)* RIGHT_CURLY_BRACE);
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "rpc"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class RpcListener {
+
+    /**
+     * Creates a new rpc listener.
+     */
+    private RpcListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (rpc), performs validation and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processRpcEntry(TreeWalkListener listener,
+                                       RpcStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, RPC_DATA, ctx.identifier().getText(), ENTRY);
+
+        String identifier = getValidIdentifier(ctx.identifier().getText(), RPC_DATA, ctx);
+
+        // Validate sub statement cardinality.
+        validateSubStatementsCardinality(ctx);
+
+        // Check for identifier collision
+        int line = ctx.getStart().getLine();
+        int charPositionInLine = ctx.getStart().getCharPositionInLine();
+        detectCollidingChildUtil(listener, line, charPositionInLine, identifier, RPC_DATA);
+
+        Parsable curData = listener.getParsedDataStack().peek();
+        if (curData instanceof YangModule || curData instanceof YangSubModule) {
+
+            YangNode curNode = (YangNode) curData;
+            YangRpc yangRpc = getYangRpcNode(JAVA_GENERATION);
+
+            yangRpc.setLineNumber(ctx.getStart().getLine());
+            yangRpc.setCharPosition(ctx.getStart().getCharPositionInLine());
+            yangRpc.setFileName(listener.getFileName());
+            yangRpc.setName(identifier);
+            try {
+                curNode.addChild(yangRpc);
+            } catch (DataModelException e) {
+                throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                                                                                RPC_DATA, ctx.identifier().getText(), ENTRY, e.getMessage()));
+            }
+            listener.getParsedDataStack().push(yangRpc);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, RPC_DATA,
+                                                                    ctx.identifier().getText(), ENTRY));
+        }
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (rpc), it perform
+     * validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processRpcExit(TreeWalkListener listener,
+                                      RpcStatementContext ctx) {
+
+        //Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, RPC_DATA, ctx.identifier().getText(), EXIT);
+
+        if (!(listener.getParsedDataStack().peek() instanceof YangRpc)) {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, RPC_DATA,
+                                                                    ctx.identifier().getText(), EXIT));
+        }
+        listener.getParsedDataStack().pop();
+    }
+
+    /**
+     * Validates the cardinality of rpc sub-statements as per grammar.
+     *
+     * @param ctx context object of the grammar rule
+     */
+    private static void validateSubStatementsCardinality(RpcStatementContext ctx) {
+
+        validateCardinalityMaxOne(ctx.statusStatement(), STATUS_DATA, RPC_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.descriptionStatement(), DESCRIPTION_DATA, RPC_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.referenceStatement(), REFERENCE_DATA, RPC_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.inputStatement(), INPUT_DATA, RPC_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.outputStatement(), OUTPUT_DATA, RPC_DATA, ctx.identifier().getText());
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ShortCaseListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ShortCaseListener.java
new file mode 100644
index 0000000..8876bda
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ShortCaseListener.java
@@ -0,0 +1,160 @@
+/*
+ * 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.antlr.v4.runtime.ParserRuleContext;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.onosproject.yang.compiler.datamodel.YangCase;
+import org.onosproject.yang.compiler.datamodel.YangChoice;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
+import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerCollisionDetector;
+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 org.onosproject.yang.compiler.translator.tojava.YangDataModelFactory;
+
+import static org.onosproject.yang.compiler.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.CASE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.SHORT_CASE_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ShortCaseStatementContext;
+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_CHILD;
+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.getValidIdentifier;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yang.compiler.translator.tojava.YangDataModelFactory.getYangCaseNode;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * short-case-stmt     = container-stmt /
+ *                       leaf-stmt /
+ *                       leaf-list-stmt /
+ *                       list-stmt /
+ *                       anyxml-stmt
+ *
+ * ANTLR grammar rule
+ * shortCaseStatement : containerStatement | leafStatement | leafListStatement | listStatement;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "short
+ * case" rule defined in ANTLR grammar file for corresponding ABNF rule in RFC
+ * 6020.
+ */
+public final class ShortCaseListener {
+
+    /**
+     * Create a new short case listener.
+     */
+    private ShortCaseListener() {
+    }
+
+    /**
+     * It is called when parser enters grammar rule (short case), it perform
+     * validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processShortCaseEntry(TreeWalkListener listener,
+                                             ShortCaseStatementContext ctx) {
+
+        ParseTree errorConstructContext;
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, SHORT_CASE_DATA, "", ENTRY);
+
+        YangCase caseNode = getYangCaseNode(JAVA_GENERATION);
+
+        caseNode.setLineNumber(ctx.getStart().getLine());
+        caseNode.setCharPosition(ctx.getStart().getCharPositionInLine());
+        caseNode.setFileName(listener.getFileName());
+        if (ctx.containerStatement() != null) {
+            caseNode.setName(getValidIdentifier(ctx.containerStatement().identifier().getText(), CASE_DATA, ctx));
+            errorConstructContext = ctx.containerStatement();
+        } else if (ctx.listStatement() != null) {
+            caseNode.setName(getValidIdentifier(ctx.listStatement().identifier().getText(), CASE_DATA, ctx));
+            errorConstructContext = ctx.listStatement();
+        } else if (ctx.leafListStatement() != null) {
+            caseNode.setName(getValidIdentifier(ctx.leafListStatement().identifier().getText(), CASE_DATA, ctx));
+            errorConstructContext = ctx.leafListStatement();
+        } else if (ctx.leafStatement() != null) {
+            caseNode.setName(getValidIdentifier(ctx.leafStatement().identifier().getText(), CASE_DATA, ctx));
+            errorConstructContext = ctx.leafStatement();
+        } else if (ctx.anyxmlStatement() != null) {
+            // Anyxml statement is not supported
+            return;
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_CHILD, SHORT_CASE_DATA, "", ENTRY));
+        }
+        // TODO implement for augment.
+
+        int line = ((ParserRuleContext) errorConstructContext).getStart().getLine();
+        int charPositionInLine = ((ParserRuleContext) errorConstructContext).getStart().getCharPositionInLine();
+
+        // Check for identifier collision
+        detectCollidingChildUtil(listener, line, charPositionInLine, caseNode.getName(), CASE_DATA);
+
+        if ((listener.getParsedDataStack().peek()) instanceof YangChoice) {
+            try {
+                ((YangChoice) listener.getParsedDataStack().peek()).addChild(caseNode);
+            } catch (DataModelException e) {
+                throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                        SHORT_CASE_DATA, caseNode.getName(), ENTRY, e.getMessage()));
+            }
+            listener.getParsedDataStack().push(caseNode);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, SHORT_CASE_DATA,
+                    caseNode.getName(), ENTRY));
+        }
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (short case), it perform
+     * validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processShortCaseExit(TreeWalkListener listener,
+                                            ShortCaseStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, SHORT_CASE_DATA, "", EXIT);
+
+        if (listener.getParsedDataStack().peek() instanceof YangCase) {
+            listener.getParsedDataStack().pop();
+        } else if (ctx.anyxmlStatement() != null) {
+            // Anyxml statement is not supported
+            return;
+        } else {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, SHORT_CASE_DATA,
+                    "", EXIT));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/StatusListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/StatusListener.java
new file mode 100644
index 0000000..d00afd1
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/StatusListener.java
@@ -0,0 +1,133 @@
+/*
+ * 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.YangStatus;
+import org.onosproject.yang.compiler.datamodel.YangStatusType;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.datamodel.utils.YangConstructType;
+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.STATUS_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.getYangConstructType;
+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.removeQuotesAndHandleConcat;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *  status-stmt         = status-keyword sep status-arg-str stmtend
+ *  status-arg-str      = < a string that matches the rule
+ *                         status-arg >
+ *  status-arg          = current-keyword /
+ *                        obsolete-keyword /
+ *                        deprecated-keyword
+ *
+ * ANTLR grammar rule
+ * statusStatement : STATUS_KEYWORD status STMTEND;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "status"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class StatusListener {
+
+    private static final String CURRENT_KEYWORD = "current";
+    private static final String DEPRECATED_KEYWORD = "deprecated";
+    private static final String OBSOLETE_KEYWORD = "obsolete";
+
+    /**
+     * Creates a new status listener.
+     */
+    private StatusListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar
+     * rule (status), performs validation and updates the data model
+     * tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processStatusEntry(TreeWalkListener listener,
+                                          GeneratedYangParser.StatusStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, STATUS_DATA, "", ENTRY);
+
+        YangStatusType status = getValidStatus(ctx);
+
+        Parsable tmpData = listener.getParsedDataStack().peek();
+        if (tmpData instanceof YangStatus) {
+            YangStatus yangStatus = (YangStatus) tmpData;
+            yangStatus.setStatus(status);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, STATUS_DATA, "", ENTRY));
+        }
+    }
+
+    /**
+     * Validates status value and returns the value from context.
+     *
+     * @param ctx context object of the grammar rule
+     * @return status current/deprecated/obsolete
+     */
+    private static YangStatusType getValidStatus(GeneratedYangParser.StatusStatementContext ctx) {
+
+        YangStatusType status;
+
+        String value = removeQuotesAndHandleConcat(ctx.status().getText());
+        switch (value) {
+            case CURRENT_KEYWORD: {
+                status = YangStatusType.CURRENT;
+                break;
+            }
+            case DEPRECATED_KEYWORD: {
+                status = YangStatusType.DEPRECATED;
+                break;
+            }
+            case OBSOLETE_KEYWORD: {
+                status = YangStatusType.OBSOLETE;
+                break;
+            }
+            default: {
+                ParserException parserException = new ParserException("YANG file error : " +
+                        getYangConstructType(STATUS_DATA) + " " + ctx.status().getText() +
+                        " is not valid.");
+                parserException.setLine(ctx.getStart().getLine());
+                parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+                throw parserException;
+            }
+        }
+
+        return status;
+    }
+}
\ No newline at end of file
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
new file mode 100644
index 0000000..7b18d5b
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/SubModuleListener.java
@@ -0,0 +1,158 @@
+/*
+ * 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.ResolvableType;
+import org.onosproject.yang.compiler.datamodel.YangReferenceResolver;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.linker.exceptions.LinkerException;
+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.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;
+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_CHILD;
+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.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsEmpty;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yang.compiler.translator.tojava.YangDataModelFactory.getYangSubModuleNode;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * submodule-stmt      = optsep submodule-keyword sep identifier-arg-str
+ *                             optsep
+ *                             "{" stmtsep
+ *                                 submodule-header-stmts
+ *                                 linkage-stmts
+ *                                 meta-stmts
+ *                                 revision-stmts
+ *                                 body-stmts
+ *                             "}" optsep
+ *
+ * ANTLR grammar rule
+ * submodule_stmt : SUBMODULE_KEYWORD identifier LEFT_CURLY_BRACE submodule_body* RIGHT_CURLY_BRACE;
+ * submodule_body : submodule_header_statement linkage_stmts meta_stmts revision_stmts body_stmts;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "submodule"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class SubModuleListener {
+
+    /**
+     * Creates a new sub module listener.
+     */
+    private SubModuleListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule (sub
+     * module), perform validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processSubModuleEntry(TreeWalkListener listener,
+                                             GeneratedYangParser.SubModuleStatementContext ctx) {
+
+        // Check if stack is empty.
+        checkStackIsEmpty(listener, INVALID_HOLDER, SUB_MODULE_DATA, ctx.identifier().getText(),
+                          ENTRY);
+
+        String identifier = getValidIdentifier(ctx.identifier().getText(), SUB_MODULE_DATA, ctx);
+
+        YangSubModule yangSubModule = getYangSubModuleNode(JAVA_GENERATION);
+        yangSubModule.setName(identifier);
+
+        yangSubModule.setLineNumber(ctx.getStart().getLine());
+        yangSubModule.setCharPosition(ctx.getStart().getCharPositionInLine());
+        yangSubModule.setFileName(listener.getFileName());
+        if (ctx.submoduleBody().submoduleHeaderStatement().yangVersionStatement() == null) {
+            yangSubModule.setVersion((byte) 1);
+        }
+
+        listener.getParsedDataStack().push(yangSubModule);
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (submodule), it perform
+     * validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processSubModuleExit(TreeWalkListener listener,
+                                            GeneratedYangParser.SubModuleStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, SUB_MODULE_DATA, ctx.identifier().getText(),
+                             EXIT);
+
+        Parsable tmpNode = listener.getParsedDataStack().peek();
+        if (!(tmpNode instanceof YangSubModule)) {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, SUB_MODULE_DATA,
+                                                                    ctx.identifier().getText(), EXIT));
+        }
+
+        YangSubModule subModule = (YangSubModule) tmpNode;
+        if (subModule.getUnresolvedResolutionList(ResolvableType.YANG_COMPILER_ANNOTATION) != null
+                && subModule.getUnresolvedResolutionList(ResolvableType.YANG_COMPILER_ANNOTATION).size() != 0
+                && subModule.getChild() != null) {
+            throw new ParserException(constructListenerErrorMessage(INVALID_CHILD, MODULE_DATA,
+                                                                    ctx.identifier().getText(), EXIT));
+        }
+
+        try {
+            ((YangReferenceResolver) listener.getParsedDataStack().peek())
+                    .resolveSelfFileLinking(ResolvableType.YANG_IF_FEATURE);
+            ((YangReferenceResolver) listener.getParsedDataStack().peek())
+                    .resolveSelfFileLinking(ResolvableType.YANG_USES);
+            ((YangReferenceResolver) listener.getParsedDataStack().peek())
+                    .resolveSelfFileLinking(ResolvableType.YANG_DERIVED_DATA_TYPE);
+            ((YangReferenceResolver) listener.getParsedDataStack().peek())
+                    .resolveSelfFileLinking(ResolvableType.YANG_LEAFREF);
+            ((YangReferenceResolver) listener.getParsedDataStack().peek())
+                    .resolveSelfFileLinking(ResolvableType.YANG_BASE);
+            ((YangReferenceResolver) listener.getParsedDataStack().peek())
+                    .resolveSelfFileLinking(ResolvableType.YANG_IDENTITYREF);
+        } catch (DataModelException e) {
+            LinkerException linkerException = new LinkerException(e.getMessage());
+            linkerException.setLine(e.getLineNumber());
+            linkerException.setCharPosition(e.getCharPositionInLine());
+            linkerException.setFileName(listener.getFileName());
+            throw linkerException;
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/TypeDefListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/TypeDefListener.java
new file mode 100644
index 0000000..5e9d7a6
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/TypeDefListener.java
@@ -0,0 +1,204 @@
+/*
+ * 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.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangGrouping;
+import org.onosproject.yang.compiler.datamodel.YangInput;
+import org.onosproject.yang.compiler.datamodel.YangList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNotification;
+import org.onosproject.yang.compiler.datamodel.YangOutput;
+import org.onosproject.yang.compiler.datamodel.YangRpc;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+import org.onosproject.yang.compiler.datamodel.YangTypeDef;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+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.ListenerCollisionDetector;
+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.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DEFAULT_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.TYPEDEF_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.TYPE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.UNITS_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.TypedefStatementContext;
+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_CONTENT;
+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.getValidIdentifier;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.validateCardinalityEqualsOne;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yang.compiler.translator.tojava.YangDataModelFactory.getYangTypeDefNode;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * body-stmts          = *((extension-stmt /
+ *                          feature-stmt /
+ *                          identity-stmt /
+ *                          typedef-stmt /
+ *                          grouping-stmt /
+ *                          data-def-stmt /
+ *                          augment-stmt /
+ *                          rpc-stmt /
+ *                          notification-stmt /
+ *                          deviation-stmt) stmtsep)
+ *
+ * typedef-stmt        = typedef-keyword sep identifier-arg-str optsep
+ *                       "{" stmtsep
+ *                           ;; these stmts can appear in any order
+ *                           type-stmt stmtsep
+ *                          [units-stmt stmtsep]
+ *                           [default-stmt stmtsep]
+ *                           [status-stmt stmtsep]
+ *                           [description-stmt stmtsep]
+ *                           [reference-stmt stmtsep]
+ *                         "}"
+ *
+ * ANTLR grammar rule
+ * typedefStatement : TYPEDEF_KEYWORD identifier LEFT_CURLY_BRACE
+ *                (typeStatement | unitsStatement | defaultStatement | statusStatement
+ *                | descriptionStatement | referenceStatement)* RIGHT_CURLY_BRACE;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "typedef"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class TypeDefListener {
+
+    /**
+     * Creates a new typedef listener.
+     */
+    private TypeDefListener() {
+    }
+
+    /**
+     * It is called when parser enters grammar rule (typedef), it perform
+     * validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processTypeDefEntry(TreeWalkListener listener,
+                                           TypedefStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, TYPEDEF_DATA, ctx.identifier().getText(), ENTRY);
+
+        String identifier = getValidIdentifier(ctx.identifier().getText(), TYPEDEF_DATA, ctx);
+
+        // Validate sub statement cardinality.
+        validateSubStatementsCardinality(ctx);
+
+        // Check for identifier collision
+        int line = ctx.getStart().getLine();
+        int charPositionInLine = ctx.getStart().getCharPositionInLine();
+        detectCollidingChildUtil(listener, line, charPositionInLine, identifier, TYPEDEF_DATA);
+
+        /*
+         * Create a derived type information, the base type must be set in type
+         * listener.
+         */
+        YangTypeDef typeDefNode = getYangTypeDefNode(JAVA_GENERATION);
+        typeDefNode.setName(identifier);
+
+        typeDefNode.setLineNumber(ctx.getStart().getLine());
+        typeDefNode.setCharPosition(ctx.getStart().getCharPositionInLine());
+        typeDefNode.setFileName(listener.getFileName());
+        Parsable curData = listener.getParsedDataStack().peek();
+
+        if (curData instanceof YangModule || curData instanceof YangSubModule || curData instanceof YangContainer
+                || curData instanceof YangList || curData instanceof YangNotification || curData instanceof YangRpc
+                || curData instanceof YangInput || curData instanceof YangOutput || curData instanceof YangGrouping) {
+
+            YangNode curNode = (YangNode) curData;
+            try {
+                curNode.addChild(typeDefNode);
+            } catch (DataModelException e) {
+                throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                        TYPEDEF_DATA, ctx.identifier().getText(), ENTRY, e.getMessage()));
+            }
+            listener.getParsedDataStack().push(typeDefNode);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER,
+                    TYPEDEF_DATA, ctx.identifier().getText(), ENTRY));
+        }
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (typedef), it perform
+     * validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processTypeDefExit(TreeWalkListener listener,
+                                          TypedefStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, TYPEDEF_DATA, ctx.identifier().getText(), EXIT);
+
+        if (listener.getParsedDataStack().peek() instanceof YangTypeDef) {
+            YangTypeDef typeDefNode = (YangTypeDef) listener.getParsedDataStack().peek();
+            try {
+                typeDefNode.validateDataOnExit();
+            } catch (DataModelException e) {
+                throw new ParserException(constructListenerErrorMessage(INVALID_CONTENT, TYPEDEF_DATA,
+                        ctx.identifier().getText(), EXIT));
+            }
+
+            listener.getParsedDataStack().pop();
+        } else {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, TYPEDEF_DATA,
+                    ctx.identifier().getText(), EXIT));
+        }
+    }
+
+    /**
+     * Validates the cardinality of typedef sub-statements as per grammar.
+     *
+     * @param ctx context object of the grammar rule
+     */
+    private static void validateSubStatementsCardinality(TypedefStatementContext ctx) {
+
+        validateCardinalityMaxOne(ctx.unitsStatement(), UNITS_DATA, TYPEDEF_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.defaultStatement(), DEFAULT_DATA, TYPEDEF_DATA, ctx.identifier().getText());
+        validateCardinalityEqualsOne(ctx.typeStatement(), TYPE_DATA, TYPEDEF_DATA, ctx.identifier().getText(), ctx);
+        validateCardinalityMaxOne(ctx.descriptionStatement(), DESCRIPTION_DATA, TYPEDEF_DATA,
+                                  ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.referenceStatement(), REFERENCE_DATA, TYPEDEF_DATA, ctx.identifier().getText());
+        validateCardinalityMaxOne(ctx.statusStatement(), STATUS_DATA, TYPEDEF_DATA, ctx.identifier().getText());
+    }
+}
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
new file mode 100644
index 0000000..0b16af7
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/TypeListener.java
@@ -0,0 +1,352 @@
+/*
+ * 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.YangDerivedInfo;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangLeafList;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeIdentifier;
+import org.onosproject.yang.compiler.datamodel.YangType;
+import org.onosproject.yang.compiler.datamodel.YangTypeDef;
+import org.onosproject.yang.compiler.datamodel.YangUnion;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+import org.onosproject.yang.compiler.datamodel.utils.DataModelUtils;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.linker.impl.YangResolutionInfoImpl;
+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;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.TYPE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.DERIVED;
+import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.INSTANCE_IDENTIFIER;
+import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.getType;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.TypeStatementContext;
+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_HOLDER;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil.getValidNodeIdentifier;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yang.compiler.translator.tojava.YangDataModelFactory.getYangType;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *  type-stmt           = type-keyword sep identifier-ref-arg-str optsep
+ *                        (";" /
+ *                         "{" stmtsep
+ *                            type-body-stmts
+ *                         "}")
+ *
+ * ANTLR grammar rule
+ * typeStatement : TYPE_KEYWORD string (STMTEND | LEFT_CURLY_BRACE typeBodyStatements RIGHT_CURLY_BRACE);
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "type" rule
+ * defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class TypeListener {
+
+    /**
+     * Creates a new type listener.
+     */
+    private TypeListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (type), performs validation and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processTypeEntry(TreeWalkListener listener,
+                                        TypeStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, TYPE_DATA, ctx.string().getText(), ENTRY);
+
+        // Validate node identifier.
+        YangNodeIdentifier nodeIdentifier = getValidNodeIdentifier(ctx.string().getText(), TYPE_DATA,
+                                                                   ctx);
+
+        // Obtain the YANG data type.
+        YangDataTypes yangDataTypes = getType(ctx.string().getText());
+
+        // validate type sub-statement cardinality
+        validateTypeSubStatementCardinality(ctx, yangDataTypes);
+
+        // Create YANG type object and fill the values.
+        YangType<?> type = getYangType(JAVA_GENERATION);
+        type.setNodeId(nodeIdentifier);
+        type.setDataType(yangDataTypes);
+
+        type.setLineNumber(ctx.getStart().getLine());
+        type.setCharPosition(ctx.getStart().getCharPositionInLine());
+        type.setFileName(listener.getFileName());
+        // Set default require instance value as true for instance identifier.
+        setDefaultRequireInstanceForInstanceIdentifier(type);
+
+        int errorLine = ctx.getStart().getLine();
+        int errorPosition = ctx.getStart().getCharPositionInLine();
+
+        Parsable tmpData = listener.getParsedDataStack().peek();
+        switch (tmpData.getYangConstructType()) {
+            case LEAF_DATA:
+                YangLeaf leaf = (YangLeaf) tmpData;
+                leaf.setDataType(type);
+
+                /*
+                 * If data type is derived, resolution information to be added
+                 * in resolution list.
+                 */
+                if (yangDataTypes == DERIVED) {
+                    // Parent YANG node of leaf to be added in resolution information.
+                    Parsable leafData = listener.getParsedDataStack().pop();
+                    Parsable parentNodeOfLeaf = listener.getParsedDataStack().peek();
+                    listener.getParsedDataStack().push(leafData);
+
+                    // Verify parent node of leaf
+                    if (!(parentNodeOfLeaf instanceof YangNode)) {
+                        throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, TYPE_DATA,
+                                                                                ctx.string().getText(), EXIT));
+                    }
+
+                    // Create empty derived info and attach it to type extended info.
+                    YangDerivedInfo<?> yangDerivedInfo = new YangDerivedInfo<>();
+                    yangDerivedInfo.setLineNumber(ctx.getStart().getLine());
+                    yangDerivedInfo.setCharPosition(ctx.getStart().getCharPositionInLine());
+                    yangDerivedInfo.setFileName(listener.getFileName());
+                    ((YangType<YangDerivedInfo>) type).setDataTypeExtendedInfo(yangDerivedInfo);
+
+                    type.setResolvableStatus(UNRESOLVED);
+
+                    // Add resolution information to the list
+                    YangResolutionInfoImpl resolutionInfo =
+                            new YangResolutionInfoImpl<YangType>(
+                                    type, (YangNode) parentNodeOfLeaf, errorLine,
+                                    errorPosition);
+                    addToResolutionList(resolutionInfo, ctx);
+                }
+                break;
+            case LEAF_LIST_DATA:
+                YangLeafList leafList = (YangLeafList) tmpData;
+                leafList.setDataType(type);
+
+                /*
+                 * If data type is derived, resolution information to be added
+                 * in resolution list.
+                 */
+                if (yangDataTypes == DERIVED) {
+                    // Parent YANG node of leaf list to be added in resolution information.
+                    Parsable leafListData = listener.getParsedDataStack().pop();
+                    Parsable parentNodeOfLeafList = listener.getParsedDataStack().peek();
+                    listener.getParsedDataStack().push(leafListData);
+
+                    // Verify parent node of leaf
+                    if (!(parentNodeOfLeafList instanceof YangNode)) {
+                        throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, TYPE_DATA,
+                                                                                ctx.string().getText(), EXIT));
+                    }
+
+                    // Create empty derived info and attach it to type extended info.
+                    YangDerivedInfo<?> yangDerivedInfo = new YangDerivedInfo<>();
+                    yangDerivedInfo.setLineNumber(ctx.getStart().getLine());
+                    yangDerivedInfo.setCharPosition(ctx.getStart().getCharPositionInLine());
+                    yangDerivedInfo.setFileName(listener.getFileName());
+                    ((YangType<YangDerivedInfo>) type).setDataTypeExtendedInfo(yangDerivedInfo);
+
+                    // Add resolution information to the list
+                    YangResolutionInfoImpl resolutionInfo =
+                            new YangResolutionInfoImpl<YangType>(
+                                    type, (YangNode) parentNodeOfLeafList,
+                                    errorLine, errorPosition);
+                    addToResolutionList(resolutionInfo, ctx);
+                }
+                break;
+            case UNION_DATA:
+                YangUnion unionNode = (YangUnion) tmpData;
+                try {
+                    unionNode.addType(type);
+                } catch (DataModelException e) {
+                    ParserException parserException = new ParserException(e.getMessage());
+                    parserException.setLine(ctx.getStart().getLine());
+                    parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+                    throw parserException;
+                }
+
+                /*
+                 * If data type is derived, resolution information to be added
+                 * in resolution list.
+                 */
+                if (yangDataTypes == DERIVED) {
+
+                    // Create empty derived info and attach it to type extended info.
+                    YangDerivedInfo<?> yangDerivedInfo = new YangDerivedInfo<>();
+                    yangDerivedInfo.setLineNumber(ctx.getStart().getLine());
+                    yangDerivedInfo.setCharPosition(ctx.getStart().getCharPositionInLine());
+                    yangDerivedInfo.setFileName(listener.getFileName());
+                    ((YangType<YangDerivedInfo>) type).setDataTypeExtendedInfo(yangDerivedInfo);
+
+                    type.setResolvableStatus(UNRESOLVED);
+
+                    // Add resolution information to the list
+                    YangResolutionInfoImpl resolutionInfo =
+                            new YangResolutionInfoImpl<YangType>(
+                                    type, unionNode, errorLine, errorPosition);
+                    addToResolutionList(resolutionInfo, ctx);
+                }
+
+                break;
+            case TYPEDEF_DATA:
+                /* Prepare the base type info and set in derived type */
+                YangTypeDef typeDef = (YangTypeDef) tmpData;
+                typeDef.setDataType(type);
+
+                /*
+                 * If data type is derived, resolution information to be added
+                 * in resolution list.
+                 */
+                if (yangDataTypes == DERIVED) {
+                    // Create empty derived info and attach it to type extended info.
+                    YangDerivedInfo<?> yangDerivedInfo = new YangDerivedInfo<>();
+                    yangDerivedInfo.setLineNumber(ctx.getStart().getLine());
+                    yangDerivedInfo.setCharPosition(ctx.getStart().getCharPositionInLine());
+                    yangDerivedInfo.setFileName(listener.getFileName());
+                    ((YangType<YangDerivedInfo>) type).setDataTypeExtendedInfo(yangDerivedInfo);
+
+                    type.setResolvableStatus(UNRESOLVED);
+                    // Add resolution information to the list
+                    YangResolutionInfoImpl resolutionInfo =
+                            new YangResolutionInfoImpl<YangType>(
+                                    type, typeDef, errorLine, errorPosition);
+                    addToResolutionList(resolutionInfo, ctx);
+                }
+                break;
+            //TODO: deviate replacement statement.
+
+            default:
+                throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, TYPE_DATA,
+                                                                        ctx.string().getText(), EXIT));
+        }
+
+        // Push the type to the stack.
+        listener.getParsedDataStack().push(type);
+    }
+
+    /**
+     * Sets the default require instance value as true when the type is instance identifier.
+     *
+     * @param type type to which the value has to be set
+     */
+    private static void setDefaultRequireInstanceForInstanceIdentifier(YangType<?> type) {
+
+        if (type.getDataType() == INSTANCE_IDENTIFIER) {
+            ((YangType<Boolean>) type).setDataTypeExtendedInfo(true);
+        }
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (type), it perform
+     * validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processTypeExit(TreeWalkListener listener,
+                                       TypeStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, ListenerErrorType.MISSING_CURRENT_HOLDER, TYPE_DATA, ctx.string().getText(), EXIT);
+
+        Parsable parsableType = listener.getParsedDataStack().pop();
+        if (!(parsableType instanceof YangType)) {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, TYPE_DATA,
+                                                                    ctx.string().getText(), EXIT));
+        }
+    }
+
+    /**
+     * Adds to resolution list.
+     *
+     * @param resolutionInfo resolution information
+     * @param ctx            context object of the grammar rule
+     */
+    private static void addToResolutionList(YangResolutionInfoImpl<YangType> resolutionInfo,
+                                            TypeStatementContext ctx) {
+        try {
+            DataModelUtils.addResolutionInfo(resolutionInfo);
+        } catch (DataModelException e) {
+            throw new ParserException(constructExtendedListenerErrorMessage(ListenerErrorType.UNHANDLED_PARSED_DATA,
+                                                                            TYPE_DATA, ctx.string().getText(), ENTRY, e.getMessage()));
+        }
+    }
+
+    /**
+     * Validates type body statements cardinality.
+     *
+     * @param ctx          context object of the grammar rule
+     * @param yangDataType yang data type
+     */
+    private static void validateTypeSubStatementCardinality(TypeStatementContext ctx,
+                                                            YangDataTypes yangDataType) {
+        if (ctx.typeBodyStatements() == null || ctx.typeBodyStatements().isEmpty()) {
+            ParserException parserException;
+            switch (yangDataType) {
+                case UNION:
+                    parserException = new ParserException("YANG file error : a type union" +
+                                                                  " must have atleast one type statement.");
+                    break;
+                case ENUMERATION:
+                    parserException = new ParserException("YANG file error : a type enumeration" +
+                                                                  " must have atleast one enum statement.");
+                    break;
+                case BITS:
+                    parserException = new ParserException("YANG file error : a type bits" +
+                                                                  " must have atleast one bit statement.");
+                    break;
+                case DECIMAL64:
+                    parserException = new ParserException("YANG file error : a type decimal64" +
+                                                                  " must have fraction-digits statement.");
+                    break;
+                case LEAFREF:
+                    parserException = new ParserException("YANG file error : a type leafref" +
+                                                                  " must have one path statement.");
+                    break;
+                case IDENTITYREF:
+                    parserException = new ParserException("YANG file error : a type identityref" +
+                                                                  " must have base statement.");
+                    break;
+                default:
+                    return;
+            }
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/UnionListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/UnionListener.java
new file mode 100644
index 0000000..54aa1c0
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/UnionListener.java
@@ -0,0 +1,223 @@
+/*
+ * 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
+ * type-body-stmts     = numerical-restrictions /
+ *                       decimal64-specification /
+ *                      string-restrictions /
+ *                       enum-specification /
+ *                       leafref-specification /
+ *                       identityref-specification /
+ *                       instance-identifier-specification /
+ *                       bits-specification /
+ *                       union-specification
+ *
+ * union-specification = 1*(type-stmt stmtsep)
+ *
+ * ANTLR grammar rule
+ * typeBodyStatements : numericalRestrictions | stringRestrictions | enumSpecification
+ *                 | leafrefSpecification | identityrefSpecification | instanceIdentifierSpecification
+ *                 | bitsSpecification | unionSpecification;
+ *
+ * unionSpecification : typeStatement+;
+ */
+
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangLeafList;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangType;
+import org.onosproject.yang.compiler.datamodel.YangTypeDef;
+import org.onosproject.yang.compiler.datamodel.YangUnion;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+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.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.TYPE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.UNION_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.UnionSpecificationContext;
+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.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yang.compiler.translator.tojava.YangDataModelFactory.getYangUnionNode;
+
+/**
+ * Represents listener based call back function corresponding to the "union" rule
+ * defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class UnionListener {
+
+    /**
+     * Suffix to be used while creating union class.
+     */
+    private static final String UNION_CLASS_SUFFIX = "_union";
+
+    /**
+     * Creates a new union listener.
+     */
+    private UnionListener() {
+    }
+
+    /**
+     * It is called when parser enters grammar rule (union), it perform
+     * validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processUnionEntry(TreeWalkListener listener,
+                                         UnionSpecificationContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, UNION_DATA, "", ENTRY);
+
+        if (listener.getParsedDataStack().peek() instanceof YangType) {
+            YangUnion unionNode = getYangUnionNode(JAVA_GENERATION);
+            Parsable typeData = listener.getParsedDataStack().pop();
+
+            unionNode.setLineNumber(ctx.getStart().getLine());
+            unionNode.setCharPosition(ctx.getStart().getCharPositionInLine());
+            unionNode.setFileName(listener.getFileName());
+            // Check for stack to be non empty.
+            checkStackIsNotEmpty(listener, MISSING_HOLDER, UNION_DATA, "", ENTRY);
+
+            Parsable tmpData = listener.getParsedDataStack().peek();
+
+            switch (tmpData.getYangConstructType()) {
+                case LEAF_DATA:
+                    // Set the name of union same as leaf.
+                    unionNode.setName(((YangLeaf) tmpData).getName() + UNION_CLASS_SUFFIX);
+                    // Pop the stack entry to obtain the parent YANG node.
+                    Parsable leaf = listener.getParsedDataStack().pop();
+                    // Add the union node to the parent holder of leaf.
+                    addChildToParentNode(listener, unionNode);
+                    // Push the popped entry back to the stack.
+                    listener.getParsedDataStack().push(leaf);
+                    break;
+                case LEAF_LIST_DATA:
+                    // Set the name of union same as leaf list.
+                    unionNode.setName(((YangLeafList) tmpData).getName() + UNION_CLASS_SUFFIX);
+                    // Pop the stack entry to obtain the parent YANG node.
+                    Parsable leafList = listener.getParsedDataStack().pop();
+                    // Add the union node to the parent holder of leaf.
+                    addChildToParentNode(listener, unionNode);
+                    // Push the popped entry back to the stack.
+                    listener.getParsedDataStack().push(leafList);
+                    break;
+                case UNION_DATA:
+                    YangUnion parentUnion = (YangUnion) tmpData;
+                    /*
+                     * In case parent of union is again a union, name of the
+                     * child union is parent union name suffixed with running
+                     * integer number, this is done because under union there
+                     * could be multiple child union types.
+                     */
+                    unionNode.setName(parentUnion.getName() + UNION_CLASS_SUFFIX + parentUnion.getChildUnionNumber());
+                    // Increment the running number.
+                    parentUnion.setChildUnionNumber(parentUnion.getChildUnionNumber() + 1);
+                    // Add union as a child to parent union.
+                    addChildToParentNode(listener, unionNode);
+                    break;
+                case TYPEDEF_DATA:
+                    YangTypeDef typeDef = (YangTypeDef) tmpData;
+                    // Set the name of union same as typedef name.
+                    unionNode.setName(typeDef.getName() + UNION_CLASS_SUFFIX);
+                    // Add union as a child to parent type def.
+                    addChildToParentNode(listener, unionNode);
+                    break;
+                // TODO deviate.
+                default:
+                    throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, TYPE_DATA,
+                            ((YangType<?>) typeData).getDataTypeName(), ENTRY));
+            }
+            listener.getParsedDataStack().push(typeData);
+            listener.getParsedDataStack().push(unionNode);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, UNION_DATA, "", ENTRY));
+        }
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (union), it perform
+     * validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processUnionExit(TreeWalkListener listener,
+                                        UnionSpecificationContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, UNION_DATA, "", EXIT);
+
+        Parsable tmpUnionNode = listener.getParsedDataStack().peek();
+        if (tmpUnionNode instanceof YangUnion) {
+            YangUnion unionNode = (YangUnion) tmpUnionNode;
+            listener.getParsedDataStack().pop();
+
+            // Check for stack to be non empty.
+            checkStackIsNotEmpty(listener, MISSING_HOLDER, UNION_DATA, "", EXIT);
+
+            Parsable tmpNode = listener.getParsedDataStack().peek();
+            switch (tmpNode.getYangConstructType()) {
+                case TYPE_DATA: {
+                    YangType<YangUnion> typeNode = (YangType<YangUnion>) tmpNode;
+                    typeNode.setDataTypeExtendedInfo(unionNode);
+                    break;
+                }
+                default:
+                    throw new ParserException(
+                            constructListenerErrorMessage(INVALID_HOLDER, UNION_DATA, "", EXIT));
+            }
+        } else {
+            throw new ParserException(
+                    constructListenerErrorMessage(MISSING_CURRENT_HOLDER, UNION_DATA, "", EXIT));
+        }
+    }
+
+    /**
+     * Adds the union node to the parent holder.
+     *
+     * @param listener  listener's object
+     * @param unionNode union node which needs to be added to parent
+     */
+    private static void addChildToParentNode(TreeWalkListener listener, YangUnion unionNode) {
+        if (!(listener.getParsedDataStack().peek() instanceof YangNode)) {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, UNION_DATA,
+                    "", ENTRY));
+        } else {
+            YangNode curNode = (YangNode) listener.getParsedDataStack().peek();
+            try {
+                curNode.addChild(unionNode);
+            } catch (DataModelException e) {
+                throw new ParserException(constructExtendedListenerErrorMessage(ListenerErrorType.UNHANDLED_PARSED_DATA,
+                                                                                UNION_DATA, "", ENTRY, e.getMessage()));
+            }
+        }
+    }
+}
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
new file mode 100644
index 0000000..e222422
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/UniqueListener.java
@@ -0,0 +1,104 @@
+/*
+ * 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.YangList;
+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;
+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_HOLDER;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil.removeQuotesAndHandleConcat;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * unique-stmt         = unique-keyword sep unique-arg-str stmtend
+ *
+ * ANTLR grammar rule
+ * uniqueStatement: UNIQUE_KEYWORD unique STMTEND;
+ * unique : string;
+ */
+
+/**
+ * Represesnts listener based call back function corresponding to the "unique" rule
+ * defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class UniqueListener {
+
+    /**
+     * Creates a new unique listener.
+     */
+    private UniqueListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (unique), perform validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processUniqueEntry(TreeWalkListener listener,
+                                          GeneratedYangParser.UniqueStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        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 (tmpUniqueValue.contains(" ")) {
+                String[] uniqueValues = tmpUniqueValue.split(" ");
+                for (String uniqueValue : uniqueValues) {
+                    try {
+                        yangList.addUnique(uniqueValue);
+                    } catch (DataModelException e) {
+                        throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                                UNIQUE_DATA,
+                                ctx.unique().getText(), ENTRY, e.getMessage()));
+                    }
+                }
+            } else {
+                try {
+                    yangList.addUnique(tmpUniqueValue);
+                } catch (DataModelException e) {
+                    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));
+        }
+    }
+}
\ 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
new file mode 100644
index 0000000..f8db2cf
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/UnitsListener.java
@@ -0,0 +1,88 @@
+/*
+ * 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.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangLeafList;
+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;
+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.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * units-stmt          = units-keyword sep string optsep stmtend
+ *
+ * ANTLR grammar rule
+ * unitsStatement : UNITS_KEYWORD string STMTEND;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "units"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class UnitsListener {
+
+    /**
+     * Creates a new units listener.
+     */
+    private UnitsListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar
+     * rule (units), performs validation and updates the data model
+     * tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processUnitsEntry(TreeWalkListener listener,
+                                         UnitsStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, UNITS_DATA, ctx.string().getText(), ENTRY);
+
+        Parsable tmpData = listener.getParsedDataStack().peek();
+        switch (tmpData.getYangConstructType()) {
+            case LEAF_DATA:
+                YangLeaf leaf = (YangLeaf) tmpData;
+                leaf.setUnits(ctx.string().getText());
+                break;
+            case LEAF_LIST_DATA:
+                YangLeafList leafList = (YangLeafList) tmpData;
+                leafList.setUnits(ctx.string().getText());
+                break;
+            case TYPEDEF_DATA:
+                // TODO
+                break;
+            default:
+                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/listeners/UsesListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/UsesListener.java
new file mode 100644
index 0000000..616d761
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/UsesListener.java
@@ -0,0 +1,231 @@
+/*
+ * 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.YangAugment;
+import org.onosproject.yang.compiler.datamodel.YangCase;
+import org.onosproject.yang.compiler.datamodel.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangGrouping;
+import org.onosproject.yang.compiler.datamodel.YangInput;
+import org.onosproject.yang.compiler.datamodel.YangList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeIdentifier;
+import org.onosproject.yang.compiler.datamodel.YangNotification;
+import org.onosproject.yang.compiler.datamodel.YangOutput;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+import org.onosproject.yang.compiler.datamodel.YangUses;
+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.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
+import org.onosproject.yang.compiler.parser.impl.parserutils.ListenerCollisionDetector;
+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.DataModelUtils.addResolutionInfo;
+import static org.onosproject.yang.compiler.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.USES_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.WHEN_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.UsesStatementContext;
+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_HOLDER;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerUtil.getValidNodeIdentifier;
+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.translator.tojava.YangDataModelFactory.getYangUsesNode;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * data-def-stmt       = container-stmt /
+ *                      leaf-stmt /
+ *                      leaf-list-stmt /
+ *                      list-stmt /
+ *                      choice-stmt /
+ *                      anyxml-stmt /
+ *                      uses-stmt
+ *
+ * uses-stmt           = uses-keyword sep identifier-ref-arg-str optsep
+ *                       (";" /
+ *                        "{" stmtsep
+ *                            ;; these stmts can appear in any order
+ *                            [when-stmt stmtsep]
+ *                            *(if-feature-stmt stmtsep)
+ *                            [status-stmt stmtsep]
+ *                            [description-stmt stmtsep]
+ *                            [reference-stmt stmtsep]
+ *                            *(refine-stmt stmtsep)
+ *                            *(uses-augment-stmt stmtsep)
+ *                        "}")
+ *
+ * ANTLR grammar rule
+ * dataDefStatement : containerStatement
+ *                 | leafStatement
+ *                 | leafListStatement
+ *                 | listStatement
+ *                 | choiceStatement
+ *                 | usesStatement;
+ *
+ * usesStatement : USES_KEYWORD string (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement
+ *                 | statusStatement | descriptionStatement | referenceStatement | refineStatement
+ *                 | usesAugmentStatement)* RIGHT_CURLY_BRACE);
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "uses"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class UsesListener {
+
+    /**
+     * Creates a new uses listener.
+     */
+    private UsesListener() {
+    }
+
+    /**
+     * It is called when parser enters grammar rule (uses), it perform
+     * validations and updates the data model tree.
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processUsesEntry(TreeWalkListener listener, UsesStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, USES_DATA, ctx.string().getText(), ENTRY);
+
+        // Validate sub statement cardinality.
+        validateSubStatementsCardinality(ctx);
+
+        // Check for identifier collision
+        int line = ctx.getStart().getLine();
+        int charPositionInLine = ctx.getStart().getCharPositionInLine();
+
+        detectCollidingChildUtil(listener, line, charPositionInLine, ctx.string().getText(), USES_DATA);
+        Parsable curData = listener.getParsedDataStack().peek();
+
+        if (curData instanceof YangModule || curData instanceof YangSubModule
+                || curData instanceof YangContainer || curData instanceof YangList
+                || curData instanceof YangUses || curData instanceof YangAugment
+                || curData instanceof YangCase || curData instanceof YangGrouping
+                || curData instanceof YangInput || curData instanceof YangOutput
+                || curData instanceof YangNotification) {
+
+            YangUses usesNode = getYangUsesNode(JAVA_GENERATION);
+
+            usesNode.setLineNumber(ctx.getStart().getLine());
+            usesNode.setCharPosition(ctx.getStart().getCharPositionInLine());
+            usesNode.setFileName(listener.getFileName());
+            YangNodeIdentifier nodeIdentifier = getValidNodeIdentifier(ctx.string().getText(), USES_DATA, ctx);
+            usesNode.setNodeIdentifier(nodeIdentifier);
+            usesNode.setCurrentGroupingDepth(listener.getGroupingDepth());
+            YangNode curNode = (YangNode) curData;
+
+            try {
+                curNode.addChild(usesNode);
+            } catch (DataModelException e) {
+                throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                        USES_DATA, ctx.string().getText(), ENTRY, e.getMessage()));
+            }
+            listener.getParsedDataStack().push(usesNode);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER,
+                    USES_DATA, ctx.string().getText(), ENTRY));
+        }
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (uses), it perform
+     * validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processUsesExit(TreeWalkListener listener,
+                                       UsesStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, USES_DATA, ctx.string().getText(), EXIT);
+
+        Parsable parsableUses = listener.getParsedDataStack().pop();
+        if (!(parsableUses instanceof YangUses)) {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, USES_DATA,
+                    ctx.string().getText(), EXIT));
+        }
+        YangUses uses = (YangUses) parsableUses;
+        int errorLine = ctx.getStart().getLine();
+        int errorPosition = ctx.getStart().getCharPositionInLine();
+
+        // Parent YANG node of uses to be added in resolution information.
+        Parsable parentNode = listener.getParsedDataStack().peek();
+
+        // Verify parent node of leaf
+        if (!(parentNode instanceof YangNode)) {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, USES_DATA,
+                    ctx.string().getText(), EXIT));
+        }
+
+        // Add resolution information to the list
+        YangResolutionInfoImpl resolutionInfo = new YangResolutionInfoImpl<YangUses>(uses,
+                                                                                     (YangNode) parentNode, errorLine,
+                                                                                     errorPosition);
+        addToResolutionList(resolutionInfo, ctx);
+    }
+
+    // TODO linker to handle collision scenarios like leaf obtained by uses, conflicts with some existing leaf.
+
+    /**
+     * Validates the cardinality of case sub-statements as per grammar.
+     *
+     * @param ctx context object of the grammar rule
+     */
+    private static void validateSubStatementsCardinality(UsesStatementContext ctx) {
+        validateCardinalityMaxOne(ctx.whenStatement(), WHEN_DATA, USES_DATA, ctx.string().getText());
+        validateCardinalityMaxOne(ctx.statusStatement(), STATUS_DATA, USES_DATA, ctx.string().getText());
+        validateCardinalityMaxOne(ctx.descriptionStatement(), DESCRIPTION_DATA, USES_DATA, ctx.string().getText());
+        validateCardinalityMaxOne(ctx.referenceStatement(), REFERENCE_DATA, USES_DATA, ctx.string().getText());
+    }
+
+    /**
+     * Add to resolution list.
+     *
+     * @param resolutionInfo resolution information.
+     * @param ctx            context object of the grammar rule
+     */
+    private static void addToResolutionList(YangResolutionInfoImpl<YangUses> resolutionInfo,
+                                            UsesStatementContext ctx) {
+
+        try {
+            addResolutionInfo(resolutionInfo);
+        } catch (DataModelException e) {
+            throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                    USES_DATA, ctx.string().getText(), EXIT, e.getMessage()));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ValueListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ValueListener.java
new file mode 100644
index 0000000..c28b694
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/ValueListener.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;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * value-stmt = value-keyword sep integer-value stmtend
+ *
+ * ANTLR grammar rule
+ * valueStatement : VALUE_KEYWORD ((MINUS INTEGER) | INTEGER) STMTEND;
+ */
+
+import org.onosproject.yang.compiler.datamodel.YangEnum;
+import org.onosproject.yang.compiler.datamodel.YangEnumeration;
+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 static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.VALUE_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.ValueStatementContext;
+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.getValidIntegerValue;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/**
+ * Represents listener based call back function corresponding to the "value"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class ValueListener {
+
+    /**
+     * Creates a new value listener.
+     */
+    private ValueListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (value), perform validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processValueEntry(TreeWalkListener listener, ValueStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, VALUE_DATA, ctx.value().getText(), ENTRY);
+
+        // Validate value
+        int value = getValidIntegerValue(ctx.value().getText(), VALUE_DATA, ctx);
+
+        // Obtain the node of the stack.
+        Parsable tmpNode = listener.getParsedDataStack().peek();
+        switch (tmpNode.getYangConstructType()) {
+            case ENUM_DATA: {
+                YangEnum enumNode = (YangEnum) tmpNode;
+                if (!isEnumValueValid(listener, ctx, value)) {
+                    ParserException parserException = new ParserException("Duplicate Value Entry");
+                    parserException.setLine(ctx.getStart().getLine());
+                    parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+                    throw parserException;
+                }
+                enumNode.setValue(value);
+                break;
+            }
+            default:
+                throw new ParserException(
+                        constructListenerErrorMessage(INVALID_HOLDER, VALUE_DATA, ctx.value().getText(), ENTRY));
+        }
+    }
+
+    /**
+     * Validates ENUM value uniqueness.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     * @param value    enum value
+     * @return validation result
+     */
+    private static boolean isEnumValueValid(TreeWalkListener listener, ValueStatementContext ctx,
+                                            int value) {
+        Parsable enumNode = listener.getParsedDataStack().pop();
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, VALUE_DATA, ctx.value().getText(), ENTRY);
+
+        Parsable tmpNode = listener.getParsedDataStack().peek();
+        switch (tmpNode.getYangConstructType()) {
+            case ENUMERATION_DATA: {
+                YangEnumeration yangEnumeration = (YangEnumeration) tmpNode;
+                for (YangEnum curEnum : yangEnumeration.getEnumSet()) {
+                    if (value == curEnum.getValue()) {
+                        listener.getParsedDataStack().push(enumNode);
+                        return false;
+                    }
+                }
+                listener.getParsedDataStack().push(enumNode);
+                return true;
+            }
+            default:
+                listener.getParsedDataStack().push(enumNode);
+                throw new ParserException(
+                        constructListenerErrorMessage(INVALID_HOLDER, VALUE_DATA, ctx.value().getText(), ENTRY));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/VersionListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/VersionListener.java
new file mode 100644
index 0000000..9c46b26
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/VersionListener.java
@@ -0,0 +1,112 @@
+/*
+ * 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.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+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.VERSION_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.getValidVersion;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ * module-header-stmts = ;; these stmts can appear in any order
+ *                       [yang-version-stmt stmtsep]
+ *                        namespace-stmt stmtsep
+ *                        prefix-stmt stmtsep
+ *
+ * submodule-header-stmts =
+ *                            ;; these stmts can appear in any order
+ *                            [yang-version-stmt stmtsep]
+ *                             belongs-to-stmt stmtsep
+ *
+ * yang-version-stmt   = yang-version-keyword sep yang-version-arg-str
+ *                       optsep stmtend
+ *
+ *
+ * ANTLR grammar rule
+ * module_header_statement : yang_version_stmt? namespace_stmt prefix_stmt
+ *                         | yang_version_stmt? prefix_stmt namespace_stmt
+ *                         | namespace_stmt yang_version_stmt? prefix_stmt
+ *                         | namespace_stmt prefix_stmt yang_version_stmt?
+ *                         | prefix_stmt namespace_stmt yang_version_stmt?
+ *                         | prefix_stmt yang_version_stmt? namespace_stmt?
+ *                         ;
+ * submodule_header_statement : yang_version_stmt? belongs_to_stmt
+ *                            | belongs_to_stmt yang_version_stmt?
+ *                            ;
+ * yang_version_stmt : YANG_VERSION_KEYWORD version STMTEND;
+ * version           : string;
+ */
+
+/**
+ * Represents listener based call back function corresponding to the "version"
+ * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ */
+public final class VersionListener {
+
+    /**
+     * Creates a new version listener.
+     */
+    private VersionListener() {
+    }
+
+    /**
+     * It is called when parser receives an input matching the grammar rule
+     * (version), perform validations and update the data model tree.
+     *
+     * @param listener Listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processVersionEntry(TreeWalkListener listener,
+                                           GeneratedYangParser.YangVersionStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, VERSION_DATA, ctx.version().getText(), ENTRY);
+
+        byte version = getValidVersion(ctx);
+
+        // Obtain the node of the stack.
+        Parsable tmpNode = listener.getParsedDataStack().peek();
+        switch (tmpNode.getYangConstructType()) {
+            case MODULE_DATA: {
+                YangModule module = (YangModule) tmpNode;
+                module.setVersion(version);
+                break;
+            }
+            case SUB_MODULE_DATA: {
+                YangSubModule subModule = (YangSubModule) tmpNode;
+                subModule.setVersion(version);
+                break;
+            }
+            default:
+                throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, VERSION_DATA,
+                        ctx.version().getText(), ENTRY));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/WhenListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/WhenListener.java
new file mode 100644
index 0000000..3f9602d
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/WhenListener.java
@@ -0,0 +1,123 @@
+/*
+ * 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.YangWhen;
+import org.onosproject.yang.compiler.datamodel.YangWhenHolder;
+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 static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.WHEN_DATA;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.WhenStatementContext;
+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.ListenerUtil.removeQuotesAndHandleConcat;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+
+/*
+ * Reference: RFC6020 and YANG ANTLR Grammar
+ *
+ * ABNF grammar as per RFC6020
+ *
+ *  when-stmt           = when-keyword sep string optsep
+ *                        (";" /
+ *                         "{" stmtsep
+ *                             ;; these stmts can appear in any order
+ *                             [description-stmt stmtsep]
+ *                             [reference-stmt stmtsep]
+ *                          "}")
+ *
+ * ANTLR grammar rule
+ * whenStatement : WHEN_KEYWORD string (STMTEND | LEFT_CURLY_BRACE ((descriptionStatement? referenceStatement?)
+ *       | (referenceStatement? descriptionStatement?)) RIGHT_CURLY_BRACE);
+ */
+
+/**
+ * Represents listener based call back function corresponding to the
+ * "when" rule defined in ANTLR grammar file for corresponding ABNF rule
+ * in RFC 6020.
+ */
+public final class WhenListener {
+
+    /**
+     * Creates a new when listener.
+     */
+    private WhenListener() {
+    }
+
+    /**
+     * Perform validations and updates the data model tree.It is called when parser
+     * receives an input matching the grammar rule (when).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processWhenEntry(TreeWalkListener listener,
+                                        WhenStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, WHEN_DATA, ctx.string().getText(), ENTRY);
+        String condition = removeQuotesAndHandleConcat(ctx.string().getText());
+
+        YangWhenHolder whenHolder;
+
+        // Obtain the node of the stack.
+        Parsable tmpNode = listener.getParsedDataStack().peek();
+        if (tmpNode instanceof YangWhenHolder) {
+            whenHolder = (YangWhenHolder) tmpNode;
+
+            YangWhen when = new YangWhen();
+            when.setCondition(condition);
+
+            when.setLineNumber(ctx.getStart().getLine());
+            when.setCharPosition(ctx.getStart().getCharPositionInLine());
+            when.setFileName(listener.getFileName());
+
+            whenHolder.setWhen(when);
+            listener.getParsedDataStack().push(when);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER,
+                                                                    WHEN_DATA, ctx.string().getText(), ENTRY));
+        }
+    }
+
+    /**
+     * Performs validation and updates the data model tree.It is called when parser
+     * exits from grammar rule (when).
+     *
+     * @param listener listener's object
+     * @param ctx      context object of the grammar rule
+     */
+    public static void processWhenExit(TreeWalkListener listener,
+                                       WhenStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, WHEN_DATA, ctx.string().getText(), EXIT);
+
+        if (listener.getParsedDataStack().peek() instanceof YangWhen) {
+            listener.getParsedDataStack().pop();
+        } else {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, WHEN_DATA,
+                                                                    ctx.string().getText(), EXIT));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/package-info.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/package-info.java
new file mode 100644
index 0000000..71a1796
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+/**
+ * Provide call back functions for listeners based tree walk.
+ */
+package org.onosproject.yang.compiler.parser.impl.listeners;
\ No newline at end of file
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/package-info.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/package-info.java
new file mode 100644
index 0000000..1dfb458
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+/**
+ * Parse the YANG information from ANTLR generated parse tree.
+ */
+package org.onosproject.yang.compiler.parser.impl;
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerCollisionDetector.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerCollisionDetector.java
new file mode 100644
index 0000000..d13e7f9
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerCollisionDetector.java
@@ -0,0 +1,74 @@
+/*
+ * 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.parserutils;
+
+import org.onosproject.yang.compiler.datamodel.CollisionDetector;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+import org.onosproject.yang.compiler.datamodel.utils.YangConstructType;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
+
+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;
+
+/**
+ * Represents the detector of YANG construct collision in a YANG file.
+ */
+public final class ListenerCollisionDetector {
+
+    /**
+     * Creates a new listener collision.
+     */
+    private ListenerCollisionDetector() {
+    }
+
+    /**
+     * Detects that the identifiers of all these child nodes must be unique
+     * within all cases in a choice.
+     *
+     * @param listener listener's object
+     * @param line line of identifier in YANG file, required for error
+     *            reporting
+     * @param charPosition character position of identifier in YANG file,
+     *            required for error reporting
+     * @param identifierName name for which uniqueness is to be detected
+     * @param constructType type of YANG construct for which collision check is
+     *            to be performed
+     * @throws ParserException if identifier is not unique
+     */
+    public static void detectCollidingChildUtil(TreeWalkListener listener, int line, int charPosition,
+            String identifierName, YangConstructType constructType)
+            throws ParserException {
+
+        Object obj = listener.getParsedDataStack().peek();
+        if (obj instanceof CollisionDetector) {
+            try {
+                ((CollisionDetector) obj).detectCollidingChild(
+                        identifierName, constructType);
+            } catch (DataModelException e) {
+                ParserException parserException = new ParserException(e.getMessage());
+                parserException.setLine(line);
+                parserException.setCharPosition(charPosition);
+                throw parserException;
+            }
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, constructType, identifierName,
+                    EXIT));
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerErrorLocation.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerErrorLocation.java
new file mode 100644
index 0000000..8d98840
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerErrorLocation.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.parser.impl.parserutils;
+
+/**
+ * Represents listener error location.
+ */
+public enum ListenerErrorLocation {
+    /**
+     * Represents that the error location is before processing.
+     */
+    ENTRY(),
+
+    /**
+     * Represents that the error location is before processing.
+     */
+    EXIT();
+
+    /**
+     * Returns the message corresponding to listener error location.
+     *
+     * @param errorLocation enum value for type of error
+     * @return message corresponding to listener error location
+     */
+    public static String getErrorLocationMessage(ListenerErrorLocation errorLocation) {
+
+        switch (errorLocation) {
+            case ENTRY:
+                return "before";
+            case EXIT:
+                return "after";
+            default:
+                return "during";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerErrorMessageConstruction.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerErrorMessageConstruction.java
new file mode 100644
index 0000000..db20b50
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerErrorMessageConstruction.java
@@ -0,0 +1,92 @@
+/*
+ * 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.parserutils;
+
+import org.onosproject.yang.compiler.datamodel.utils.YangConstructType;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.getYangConstructType;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorLocation.getErrorLocationMessage;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorType.getErrorType;
+
+/**
+ * Represents a utility to help construct detailed error message.
+ */
+public final class ListenerErrorMessageConstruction {
+
+    /**
+     * Creates a object of listen error message.
+     */
+    private ListenerErrorMessageConstruction() {
+    }
+
+    /**
+     * Constructs message for error with extended information and returns the
+     * same.
+     *
+     * @param errorType error type needs to be set in error message
+     * @param yangConstructType type of parsable data in which error occurred
+     * @param parsableDataTypeName identifier/string of parsable data type in
+     *            which error occurred
+     * @param errorLocation location where error occurred
+     * @param extendedErrorInformation extended error information
+     * @return constructed error message
+     */
+    public static String constructExtendedListenerErrorMessage(ListenerErrorType errorType,
+                                                               YangConstructType yangConstructType,
+                                                               String parsableDataTypeName,
+                                                               ListenerErrorLocation errorLocation,
+                                                               String extendedErrorInformation) {
+        String newErrorMessage;
+        newErrorMessage = constructListenerErrorMessage(errorType, yangConstructType, parsableDataTypeName,
+                                                        errorLocation)
+                + "\n"
+                + "Error Information: "
+                + extendedErrorInformation;
+        return newErrorMessage;
+    }
+
+    /**
+     * Constructs message for error during listener based tree walk and returns
+     * the same.
+     *
+     * @param errorType error type needs to be set in error message
+     * @param yangConstructType type of parsable data in which error occurred
+     * @param parsableDataTypeName identifier/string of parsable data type in
+     *            which error occurred
+     * @param errorLocation location where error occurred
+     * @return constructed error message
+     */
+    public static String constructListenerErrorMessage(ListenerErrorType errorType,
+                                                       YangConstructType yangConstructType,
+                                                       String parsableDataTypeName,
+                                                       ListenerErrorLocation errorLocation) {
+
+        String errorMessage;
+
+        errorMessage = "Internal parser error detected: " + getErrorType(errorType) + " "
+                + getYangConstructType(yangConstructType);
+
+        if (!parsableDataTypeName.isEmpty()) {
+            errorMessage = errorMessage + " \"" + parsableDataTypeName + "\" ";
+        } else {
+            errorMessage = errorMessage + " ";
+
+        }
+        errorMessage = errorMessage + getErrorLocationMessage(errorLocation) + " processing.";
+        return errorMessage;
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerErrorType.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerErrorType.java
new file mode 100644
index 0000000..7e0aa5c
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerErrorType.java
@@ -0,0 +1,103 @@
+/*
+ * 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.parserutils;
+
+/**
+ * Represents listener error type.
+ */
+public enum ListenerErrorType {
+    /**
+     * Represents the parent holder in parsable stack for given YANG construct
+     * is invalid.
+     */
+    INVALID_HOLDER(),
+
+    /**
+     * Represents the parent holder in parsable stack for given YANG construct
+     * is missing.
+     */
+    MISSING_HOLDER(),
+
+    /**
+     * Represents the current holder in parsable stack for given YANG construct
+     * is missing.
+     */
+    MISSING_CURRENT_HOLDER(),
+
+    /**
+     * Represents that the child in parsable stack for given YANG construct is
+     * invalid.
+     */
+    INVALID_CHILD(),
+
+    /**
+     * Represents that the cardinality for given YANG construct is invalid.
+     */
+    INVALID_CARDINALITY(),
+
+    /**
+     * Represents that the entry is duplicate.
+     */
+    DUPLICATE_ENTRY(),
+
+    /**
+     * Represents that the content is invalid.
+     */
+    INVALID_CONTENT(),
+
+    /**
+     * Represents that the identifier collision is detected.
+     */
+    IDENTIFIER_COLLISION(),
+
+    /**
+     * Represents that some of earlier parsed data is not handled correctly.
+     */
+    UNHANDLED_PARSED_DATA();
+
+    /**
+     * Returns the message corresponding to listener error type.
+     *
+     * @param errorType enum value for type of error
+     * @return message corresponding to listener error type
+     */
+    public static String getErrorType(ListenerErrorType errorType) {
+
+        switch (errorType) {
+            case INVALID_HOLDER:
+                return "Invalid holder for";
+            case MISSING_HOLDER:
+                return "Missing holder at";
+            case MISSING_CURRENT_HOLDER:
+                return "Missing";
+            case INVALID_CHILD:
+                return "Invalid child in";
+            case INVALID_CARDINALITY:
+                return "Invalid cardinality in";
+            case DUPLICATE_ENTRY:
+                return "Duplicate";
+            case INVALID_CONTENT:
+                return "Invalid content in";
+            case IDENTIFIER_COLLISION:
+                return "Identifier collision detected for";
+            case UNHANDLED_PARSED_DATA:
+                return "Unhandled parsed data at";
+            default:
+                return "Problem in";
+        }
+    }
+}
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
new file mode 100644
index 0000000..e71eb98
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerUtil.java
@@ -0,0 +1,1061 @@
+/*
+ * 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.parserutils;
+
+import org.antlr.v4.runtime.ParserRuleContext;
+import org.onosproject.yang.compiler.datamodel.YangAtomicPath;
+import org.onosproject.yang.compiler.datamodel.YangImport;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+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.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeIdentifier;
+import org.onosproject.yang.compiler.datamodel.YangPathArgType;
+import org.onosproject.yang.compiler.datamodel.YangPathPredicate;
+import org.onosproject.yang.compiler.datamodel.YangReferenceResolver;
+import org.onosproject.yang.compiler.datamodel.YangRelativePath;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+import org.onosproject.yang.compiler.datamodel.utils.YangConstructType;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import static org.onosproject.yang.compiler.datamodel.YangPathOperator.EQUALTO;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.UNIQUE_DATA;
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.getYangConstructType;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.PathStatementContext;
+import static org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser.YangVersionStatementContext;
+import static org.onosproject.yang.compiler.utils.UtilConstants.ADD;
+import static org.onosproject.yang.compiler.utils.UtilConstants.ANCESTOR;
+import static org.onosproject.yang.compiler.utils.UtilConstants.CARET;
+import static org.onosproject.yang.compiler.utils.UtilConstants.CHAR_OF_OPEN_SQUARE_BRACKET;
+import static org.onosproject.yang.compiler.utils.UtilConstants.CHAR_OF_SLASH;
+import static org.onosproject.yang.compiler.utils.UtilConstants.CLOSE_PARENTHESIS;
+import static org.onosproject.yang.compiler.utils.UtilConstants.COLON;
+import static org.onosproject.yang.compiler.utils.UtilConstants.CURRENT;
+import static org.onosproject.yang.compiler.utils.UtilConstants.EMPTY_STRING;
+import static org.onosproject.yang.compiler.utils.UtilConstants.FALSE;
+import static org.onosproject.yang.compiler.utils.UtilConstants.INVALID_TREE;
+import static org.onosproject.yang.compiler.utils.UtilConstants.OPEN_SQUARE_BRACKET;
+import static org.onosproject.yang.compiler.utils.UtilConstants.QUOTES;
+import static org.onosproject.yang.compiler.utils.UtilConstants.SLASH;
+import static org.onosproject.yang.compiler.utils.UtilConstants.SLASH_ANCESTOR;
+import static org.onosproject.yang.compiler.utils.UtilConstants.SLASH_FOR_STRING;
+import static org.onosproject.yang.compiler.utils.UtilConstants.TRUE;
+import static org.onosproject.yang.compiler.utils.UtilConstants.YANG_FILE_ERROR;
+
+/**
+ * Represents an utility for listener.
+ */
+public final class ListenerUtil {
+
+    private static final Pattern IDENTIFIER_PATTERN =
+            Pattern.compile("[a-zA-Z_][a-zA-Z0-9_.-]*");
+    private static final String DATE_PATTERN =
+            "[0-9]{4}-([0-9]{2}|[0-9])-([0-9]{2}|[0-9])";
+    private static final String NON_NEGATIVE_INTEGER_PATTERN = "[0-9]+";
+    private static final Pattern INTEGER_PATTERN =
+            Pattern.compile("[-][0-9]+|[0-9]+");
+    private static final Pattern PREDICATE =
+            Pattern.compile("\\[(.*?)\\]");
+    private static final String XML = "xml";
+    private static final String ONE = "1";
+    private static final int IDENTIFIER_LENGTH = 64;
+    private static final String DATE_FORMAT = "yyyy-MM-dd";
+    private static final String REGEX_EQUAL = "[=]";
+    private static final String REGEX_OPEN_BRACE = "[(]";
+
+    // No instantiation.
+    private ListenerUtil() {
+    }
+
+    /**
+     * Removes doubles quotes and concatenates if string has plus symbol.
+     *
+     * @param yangStringData string from yang file
+     * @return concatenated string after removing double quotes
+     */
+    public static String removeQuotesAndHandleConcat(String yangStringData) {
+
+        yangStringData = yangStringData.replace("\"", EMPTY_STRING);
+        String[] tmpData = yangStringData.split(Pattern.quote(ADD));
+        StringBuilder builder = new StringBuilder();
+        for (String yangString : tmpData) {
+            builder.append(yangString);
+        }
+        return builder.toString();
+    }
+
+    /**
+     * Validates identifier and returns concatenated string if string contains plus symbol.
+     *
+     * @param identifier    string from yang file
+     * @param yangConstruct yang construct for creating error message
+     * @param ctx           yang construct's context to get the line number and character position
+     * @return concatenated string after removing double quotes
+     */
+    public static String getValidIdentifier(String identifier,
+                                            YangConstructType yangConstruct,
+                                            ParserRuleContext ctx) {
+
+        String identifierString = removeQuotesAndHandleConcat(identifier);
+        ParserException parserException;
+
+        if (identifierString.length() > IDENTIFIER_LENGTH) {
+            parserException = new ParserException("YANG file error : " +
+                                                          getYangConstructType(yangConstruct) + " name " + identifierString + " is " +
+                                                          "greater than 64 characters.");
+        } else if (!IDENTIFIER_PATTERN.matcher(identifierString).matches()) {
+            parserException = new ParserException("YANG file error : " +
+                                                          getYangConstructType(yangConstruct) + " name " + identifierString + " is not " +
+                                                          "valid.");
+        } else if (identifierString.toLowerCase().startsWith(XML)) {
+            parserException = new ParserException("YANG file error : " +
+                                                          getYangConstructType(yangConstruct) + " identifier " + identifierString +
+                                                          " must not start with (('X'|'x') ('M'|'m') ('L'|'l')).");
+        } else {
+            return identifierString;
+        }
+
+        parserException.setLine(ctx.getStart().getLine());
+        parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+        throw parserException;
+    }
+
+    /**
+     * Validates the revision date.
+     *
+     * @param dateToValidate input revision date
+     * @return validation result, true for success, false for failure
+     */
+    public static boolean isDateValid(String dateToValidate) {
+        if (dateToValidate == null || !dateToValidate.matches(DATE_PATTERN)) {
+            return false;
+        }
+
+        SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
+        sdf.setLenient(false);
+
+        try {
+            //if not valid, it will throw ParseException
+            sdf.parse(dateToValidate);
+        } catch (ParseException e) {
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * Validates YANG version.
+     *
+     * @param ctx version context object of the grammar rule
+     * @return valid version
+     */
+    public static byte getValidVersion(YangVersionStatementContext ctx) {
+
+        String value = removeQuotesAndHandleConcat(ctx.version().getText());
+        if (!value.equals(ONE)) {
+            ParserException parserException = new ParserException("YANG file error: Input version not supported");
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+
+        return Byte.valueOf(value);
+    }
+
+    /**
+     * Validates non negative integer value.
+     *
+     * @param integerValue  integer to be validated
+     * @param yangConstruct yang construct for creating error message
+     * @param ctx           context object of the grammar rule
+     * @return valid non negative integer value
+     */
+    public static int getValidNonNegativeIntegerValue(String integerValue, YangConstructType yangConstruct,
+                                                      ParserRuleContext ctx) {
+
+        String value = removeQuotesAndHandleConcat(integerValue);
+        if (!value.matches(NON_NEGATIVE_INTEGER_PATTERN)) {
+            ParserException parserException = new ParserException("YANG file error : " +
+                                                                          getYangConstructType(yangConstruct) + " value " + value + " is not " +
+                                                                          "valid.");
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+
+        int valueInInteger;
+        try {
+            valueInInteger = Integer.parseInt(value);
+        } catch (NumberFormatException e) {
+            ParserException parserException = new ParserException("YANG file error : " +
+                                                                          getYangConstructType(yangConstruct) + " value " + value + " is not " +
+                                                                          "valid.");
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+        return valueInInteger;
+    }
+
+    /**
+     * Validates integer value.
+     *
+     * @param integerValue  integer to be validated
+     * @param yangConstruct yang construct for creating error message
+     * @param ctx           context object of the grammar rule
+     * @return valid integer value
+     */
+    public static int getValidIntegerValue(String integerValue, YangConstructType yangConstruct,
+                                           ParserRuleContext ctx) {
+
+        String value = removeQuotesAndHandleConcat(integerValue);
+        if (!INTEGER_PATTERN.matcher(value).matches()) {
+            ParserException parserException = new ParserException("YANG file error : " +
+                                                                          getYangConstructType(yangConstruct) + " value " + value + " is not " +
+                                                                          "valid.");
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+
+        int valueInInteger;
+        try {
+            valueInInteger = Integer.parseInt(value);
+        } catch (NumberFormatException e) {
+            ParserException parserException = new ParserException("YANG file error : " +
+                                                                          getYangConstructType(yangConstruct) + " value " + value + " is not " +
+                                                                          "valid.");
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+        return valueInInteger;
+    }
+
+    /**
+     * Validates boolean value.
+     *
+     * @param booleanValue  value to be validated
+     * @param yangConstruct yang construct for creating error message
+     * @param ctx           context object of the grammar rule
+     * @return boolean value either true or false
+     */
+    public static boolean getValidBooleanValue(String booleanValue, YangConstructType yangConstruct,
+                                               ParserRuleContext ctx) {
+
+        String value = removeQuotesAndHandleConcat(booleanValue);
+        if (value.equals(TRUE)) {
+            return true;
+        } else if (value.equals(FALSE)) {
+            return false;
+        } else {
+            ParserException parserException = new ParserException("YANG file error : " +
+                                                                          getYangConstructType(yangConstruct) + " value " + value + " is not " +
+                                                                          "valid.");
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+    }
+
+    /**
+     * Returns current date and makes it in usable format for revision.
+     *
+     * @return usable current date format for revision
+     */
+    public static Date getCurrentDateForRevision() {
+
+        SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
+
+        Date date = new Date();
+        String dateInString = dateFormat.format(date);
+        try {
+            //if not valid, it will throw ParseException
+            Date now = dateFormat.parse(dateInString);
+            return date;
+        } catch (ParseException e) {
+            ParserException parserException = new ParserException("YANG file error: Input date is not correct");
+            throw parserException;
+        }
+    }
+
+    /**
+     * Checks and return valid node identifier.
+     *
+     * @param nodeIdentifierString string from yang file
+     * @param yangConstruct        yang construct for creating error message
+     * @param ctx                  yang construct's context to get the line number and character position
+     * @return valid node identifier
+     */
+    public static YangNodeIdentifier getValidNodeIdentifier(String nodeIdentifierString,
+                                                            YangConstructType yangConstruct, ParserRuleContext ctx) {
+        String tmpIdentifierString = removeQuotesAndHandleConcat(nodeIdentifierString);
+        String[] tmpData = tmpIdentifierString.split(Pattern.quote(COLON));
+        if (tmpData.length == 1) {
+            YangNodeIdentifier nodeIdentifier = new YangNodeIdentifier();
+            nodeIdentifier.setName(getValidIdentifier(tmpData[0], yangConstruct, ctx));
+            return nodeIdentifier;
+        } else if (tmpData.length == 2) {
+            YangNodeIdentifier nodeIdentifier = new YangNodeIdentifier();
+            nodeIdentifier.setPrefix(getValidIdentifier(tmpData[0], yangConstruct, ctx));
+            nodeIdentifier.setName(getValidIdentifier(tmpData[1], yangConstruct, ctx));
+            return nodeIdentifier;
+        } else {
+            ParserException parserException = new ParserException("YANG file error : " +
+                                                                          getYangConstructType(yangConstruct) + " name " + nodeIdentifierString +
+                                                                          " is not valid.");
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+    }
+
+    /**
+     * Validates the prefix of the YANG file where leaf-ref is present and
+     * puts it in the map of node and prefix in leaf-ref.
+     *
+     * @param atomicList atomic content list in leaf-ref
+     * @param leafRef    YANG leaf-ref
+     */
+    private static void valPrefix(List<YangAtomicPath> atomicList,
+                                  YangLeafRef leafRef) {
+
+        for (YangAtomicPath atomicPath : atomicList) {
+            String prefix = atomicPath.getNodeIdentifier().getPrefix();
+            YangNode parent = leafRef.getParentNode();
+            YangNode rootNode = getRootNode(parent);
+
+            List<YangImport> imports;
+            if (rootNode instanceof YangModule) {
+                imports = ((YangModule) rootNode).getImportList();
+            } else {
+                imports = ((YangSubModule) rootNode).getImportList();
+            }
+            updatePrefixWithNode(rootNode, imports, prefix, leafRef);
+        }
+    }
+
+    /**
+     * Updates the prefix and its respective node in the leaf-ref by taking
+     * the node from the import list of the root node which matches with the
+     * prefix.
+     *
+     * @param root    root node
+     * @param imports import list
+     * @param prefix  prefix in path
+     * @param leafRef YANG leaf-ref
+     */
+    private static void updatePrefixWithNode(YangNode root,
+                                             List<YangImport> imports,
+                                             String prefix,
+                                             YangLeafRef<?> leafRef) {
+
+        Map<String, String> prefixMap = leafRef.getPrefixAndNode();
+        if (prefixMap == null) {
+            prefixMap = new HashMap<>();
+            leafRef.setPrefixAndNode(prefixMap);
+        }
+
+        if (prefix == null ||
+                prefix.equals(((YangReferenceResolver) root).getPrefix())) {
+            prefixMap.put(prefix, root.getName());
+            return;
+        }
+
+        if (imports != null) {
+            for (YangImport yangImp : imports) {
+                if (yangImp.getPrefixId().equals(prefix)) {
+                    prefixMap.put(prefix, yangImp.getModuleName());
+                }
+            }
+        }
+    }
+
+    /**
+     * Returns the root node from the current node.
+     *
+     * @param node YANG node
+     * @return root node
+     */
+    private static YangNode getRootNode(YangNode node) {
+
+        YangNode curNode = node;
+        while (!(curNode instanceof YangModule) &&
+                !(curNode instanceof YangSubModule)) {
+            if (curNode == null) {
+                throw new ParserException(INVALID_TREE);
+            }
+            curNode = curNode.getParent();
+        }
+        return curNode;
+    }
+
+    /**
+     * Validates the unique syntax from the reference path.
+     *
+     * @param uniquePath   path of unique
+     * @param prefixOfFile current file's prefix
+     * @param ctx          yang construct's context to get the line number and character position
+     * @return list of absolute path
+     */
+    private static List<YangAtomicPath> validateUniqueValues(String uniquePath, String prefixOfFile,
+                                                             ParserRuleContext ctx) {
+        List<YangAtomicPath> atomicPath = new LinkedList<>();
+        String[] pathInUnique = uniquePath.split(SLASH_FOR_STRING);
+        for (String uniqueValue : pathInUnique) {
+            YangAtomicPath yangAtomicPathPath = new YangAtomicPath();
+            YangNodeIdentifier nodeIdentifier = getValidNodeIdentifier(uniqueValue, UNIQUE_DATA, ctx);
+            yangAtomicPathPath.setNodeIdentifier(nodeIdentifier);
+            atomicPath.add(yangAtomicPathPath);
+            if (nodeIdentifier.getPrefix() != null && nodeIdentifier.getPrefix() != prefixOfFile) {
+                ParserException parserException = new ParserException("YANG file error : A leaf reference, in unique," +
+                                                                              " must refer to a leaf in the list");
+                parserException.setLine(ctx.getStart().getLine());
+                parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+                throw parserException;
+            }
+        }
+        return atomicPath;
+    }
+
+    /**
+     * Validates unique field from the list.
+     *
+     * @param yangList instance of YANG list
+     * @param ctx      yang construct's context to get the line number and character position
+     */
+    public static void validateUniqueInList(YangList yangList, ParserRuleContext ctx) {
+        YangLeaf leaf;
+        // Returns the prefix for the file where unique is present.
+        String prefixOfTheFile = getRootPrefix(yangList);
+        List<String> uniques = yangList.getUniqueList();
+        if (uniques != null && !uniques.isEmpty()) {
+            Iterator<String> uniqueList = uniques.listIterator();
+            while (uniqueList.hasNext()) {
+                String pathInUnique = uniqueList.next();
+                List<YangAtomicPath> atomicPathInUnique = validateUniqueValues(pathInUnique, prefixOfTheFile, ctx);
+                YangAtomicPath leafInPath = atomicPathInUnique.get(atomicPathInUnique.size() - 1);
+                if (atomicPathInUnique.size() == 1) {
+                    leaf = getReferenceLeafFromUnique(yangList, leafInPath);
+                } else {
+                    atomicPathInUnique.remove(atomicPathInUnique.size() - 1);
+                    YangNode holderOfLeaf = getNodeUnderListFromPath(atomicPathInUnique, yangList, ctx);
+                    leaf = getReferenceLeafFromUnique(holderOfLeaf, leafInPath);
+                }
+                if (leaf == null) {
+                    ParserException parserException = new ParserException("YANG file error : A leaf reference, in " +
+                                                                                  "unique," +
+                                                                                  " must refer to a leaf under the list");
+                    parserException.setLine(ctx.getStart().getLine());
+                    parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+                    throw parserException;
+                }
+            }
+        }
+    }
+
+    /**
+     * Returns the last node under the unique path.
+     *
+     * @param uniquePath atomic path list
+     * @param node       root node from where it starts searching
+     * @param ctx        yang construct's context to get the line number and character position
+     * @return last node in the list
+     */
+    private static YangNode getNodeUnderListFromPath(List<YangAtomicPath> uniquePath, YangNode node,
+                                                     ParserRuleContext ctx) {
+        Iterator<YangAtomicPath> nodesInReference = uniquePath.listIterator();
+        YangNode potentialReferredNode = node.getChild();
+        while (nodesInReference.hasNext()) {
+            YangAtomicPath nodeInUnique = nodesInReference.next();
+            YangNode referredNode = getReferredNodeFromTheUniqueNodes(nodeInUnique.getNodeIdentifier(),
+                                                                      potentialReferredNode);
+            if (referredNode == null) {
+                ParserException parserException = new ParserException("YANG file error : The target node in unique " +
+                                                                              "reference path is invalid");
+                parserException.setLine(ctx.getStart().getLine());
+                parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+                throw parserException;
+            } else {
+                potentialReferredNode = referredNode.getChild();
+            }
+        }
+        return potentialReferredNode;
+    }
+
+    /**
+     * Returns the node that matches with the name of the node in path.
+     *
+     * @param nodeInUnique          node name in path
+     * @param potentialReferredNode node under which it has to match
+     * @return referred node
+     */
+    private static YangNode getReferredNodeFromTheUniqueNodes(YangNodeIdentifier nodeInUnique, YangNode
+            potentialReferredNode) {
+        while (potentialReferredNode != null) {
+            // Check if the potential referred node is the actual referred node
+            if (potentialReferredNode.getName().equals(nodeInUnique.getName())) {
+                return potentialReferredNode;
+            }
+            potentialReferredNode = potentialReferredNode.getNextSibling();
+        }
+        return null;
+    }
+
+    /**
+     * Returns the leaf which unique refers.
+     *
+     * @param nodeForLeaf  last node where leaf is referred
+     * @param leafInUnique leaf in unique path
+     * @return YANG leaf
+     */
+    private static YangLeaf getReferenceLeafFromUnique(YangNode nodeForLeaf, YangAtomicPath leafInUnique) {
+        YangLeavesHolder leavesHolder = (YangLeavesHolder) nodeForLeaf;
+        List<YangLeaf> leaves = leavesHolder.getListOfLeaf();
+        if (leaves != null && !leaves.isEmpty()) {
+            for (YangLeaf leaf : leaves) {
+                if (leafInUnique.getNodeIdentifier().getName().equals(leaf.getName())) {
+                    return leaf;
+                }
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Returns the prefix of the root node from any node inside it.
+     *
+     * @param curNode YANG node
+     * @return prefix of the root node
+     */
+    public static String getRootPrefix(YangNode curNode) {
+
+        String prefix;
+        YangNode node = getRootNode(curNode);
+        if (node instanceof YangModule) {
+            YangModule yangModule = (YangModule) node;
+            prefix = yangModule.getPrefix();
+        } else {
+            YangSubModule yangSubModule = (YangSubModule) node;
+            prefix = yangSubModule.getPrefix();
+        }
+        return prefix;
+    }
+
+    /**
+     * Returns the matched first path predicate in a given string. Returns
+     * null if match is not found.
+     *
+     * @param str string to be matched
+     * @return the matched string
+     */
+    private static String getMatchedPredicate(String str) {
+
+        Matcher matcher = PREDICATE.matcher(str);
+        if (matcher.find()) {
+            return matcher.group(0);
+        }
+        return null;
+    }
+
+    /**
+     * Checks and return valid absolute schema node id.
+     *
+     * @param argumentString    string from yang file
+     * @param yangConstructType yang construct for creating error message
+     * @param ctx               yang construct's context to get the line number and character position
+     * @return target nodes list of absolute schema node id
+     */
+    public static List<YangAtomicPath> getValidAbsoluteSchemaNodeId(String argumentString,
+                                                                    YangConstructType yangConstructType,
+                                                                    ParserRuleContext ctx) {
+
+        List<YangAtomicPath> targetNodes = new ArrayList<>();
+        YangNodeIdentifier yangNodeIdentifier;
+        String tmpSchemaNodeId = removeQuotesAndHandleConcat(argumentString);
+
+        // absolute-schema-nodeid = 1*("/" node-identifier)
+        if (!tmpSchemaNodeId.startsWith(SLASH)) {
+            ParserException parserException = new ParserException("YANG file error : " +
+                                                                          getYangConstructType(yangConstructType) + " name " + argumentString +
+                                                                          "is not valid");
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+        String[] tmpData = tmpSchemaNodeId.replaceFirst(CARET + SLASH, EMPTY_STRING).split(SLASH);
+        for (String nodeIdentifiers : tmpData) {
+            yangNodeIdentifier = getValidNodeIdentifier(nodeIdentifiers, yangConstructType, ctx);
+            YangAtomicPath yangAbsPath = new YangAtomicPath();
+            yangAbsPath.setNodeIdentifier(yangNodeIdentifier);
+            targetNodes.add(yangAbsPath);
+        }
+        return targetNodes;
+    }
+
+    /**
+     * Throws parser exception for unsupported YANG constructs.
+     *
+     * @param type      construct type
+     * @param ctx       construct context
+     * @param errorInfo error msg
+     * @param fileName  YANG file name
+     */
+    public static void handleUnsupportedYangConstruct(YangConstructType type,
+                                                      ParserRuleContext ctx,
+                                                      String errorInfo,
+                                                      String fileName) {
+        ParserException parserException = new ParserException(
+                YANG_FILE_ERROR + QUOTES + getYangConstructType(
+                        type) + QUOTES + errorInfo);
+        parserException.setLine(ctx.getStart().getLine());
+        parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+        //FIXME this exception should probably be thrown rather than just logged
+        //throw parserException;
+    }
+
+    /**
+     * Returns date and makes it in usable format for revision.
+     *
+     * @param dateInString date argument string from yang file
+     * @param ctx          yang construct's context to get the line number and character position
+     * @return date format for revision
+     */
+    public static Date getValidDateFromString(String dateInString, ParserRuleContext ctx) {
+        String dateArgument = removeQuotesAndHandleConcat(dateInString);
+        if (!dateArgument.matches(DATE_PATTERN)) {
+            ParserException parserException = new ParserException("YANG file error: Input date is not correct");
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+
+        SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
+        sdf.setLenient(false);
+
+        try {
+            //if not valid, it will throw ParseException
+            return sdf.parse(dateArgument);
+        } catch (ParseException e) {
+            ParserException parserException = new ParserException("YANG file error: Input date is not correct");
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+    }
+
+    /**
+     * Checks and return valid prefix.
+     *
+     * @param inputString   string from yang file
+     * @param yangConstruct yang construct for creating error message
+     * @param ctx           yang construct's context to get the line number and character position
+     * @return valid prefix
+     */
+    public static String getValidPrefix(String inputString,
+                                        YangConstructType yangConstruct, ParserRuleContext ctx) {
+        String tmpPrefixString = removeQuotesAndHandleConcat(inputString);
+        String[] tmpData = tmpPrefixString.split(Pattern.quote(COLON));
+        if (tmpData.length == 2) {
+            return tmpData[0];
+        } else {
+            ParserException parserException = new ParserException("YANG file error : " +
+                                                                          getYangConstructType(yangConstruct) + " name " + inputString +
+                                                                          " is not valid.");
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+    }
+
+    /**
+     * Validates path under leaf-ref and parses the path and stores in the
+     * leaf-ref.
+     *
+     * @param path    path of leaf-ref
+     * @param type    construct type
+     * @param ctx     construct details
+     * @param leafRef YANG leaf-ref having path
+     */
+    public static void validatePath(String path, YangConstructType type,
+                                    PathStatementContext ctx,
+                                    YangLeafRef leafRef) {
+
+        String concatPath = removeQuotesAndHandleConcat(path);
+        if (!concatPath.startsWith(SLASH_FOR_STRING) &&
+                !concatPath.startsWith(ANCESTOR)) {
+            throw getPathException(ctx, leafRef);
+        }
+        leafRef.setPath(concatPath);
+        if (concatPath.startsWith(SLASH_FOR_STRING)) {
+            List<YangAtomicPath> atomicList = new LinkedList<>();
+            valAbsPath(concatPath, atomicList, ctx, leafRef, type);
+            leafRef.setPathType(YangPathArgType.ABSOLUTE_PATH);
+            valPrefix(atomicList, leafRef);
+            leafRef.setAtomicPath(atomicList);
+            return;
+        }
+        leafRef.setPathType(YangPathArgType.RELATIVE_PATH);
+        valRelPath(concatPath, leafRef, ctx, type);
+    }
+
+    /**
+     * Validates relative path, parses the string and stores it in the leaf-ref.
+     *
+     * @param path     leaf-ref path
+     * @param leafRef  YANG leaf-ref data model information
+     * @param pathType yang construct for creating error message
+     */
+    private static void valRelPath(String path, YangLeafRef leafRef,
+                                   PathStatementContext pathCtx,
+                                   YangConstructType pathType) {
+
+        YangRelativePath relPath = new YangRelativePath();
+        int count = 0;
+        while (path.startsWith(SLASH_ANCESTOR)) {
+            path = path.replaceFirst(SLASH_ANCESTOR, EMPTY_STRING);
+            count = count + 1;
+        }
+        if (path.isEmpty()) {
+            throw getPathException(pathCtx, leafRef);
+        }
+
+        List<YangAtomicPath> atomicList = new ArrayList<>();
+        relPath.setAncestorNodeCount(count);
+        valAbsPath(SLASH_FOR_STRING + path, atomicList, pathCtx, leafRef,
+                   pathType);
+        valPrefix(atomicList, leafRef);
+        relPath.setAtomicPathList(atomicList);
+        leafRef.setRelativePath(relPath);
+    }
+
+    /**
+     * Validates absolute path, parses the string and stores it in leaf-ref.
+     *
+     * @param path        leaf-ref path
+     * @param atomics     atomic content list
+     * @param pathCtx     path statement context
+     * @param yangLeafRef YANG leaf ref
+     * @param pathType    yang construct for creating error message
+     */
+    private static void valAbsPath(String path, List<YangAtomicPath> atomics,
+                                   PathStatementContext pathCtx,
+                                   YangLeafRef yangLeafRef,
+                                   YangConstructType pathType) {
+
+        String comPath = path;
+        while (comPath != null) {
+            comPath = comPath.substring(1);
+            if (comPath.isEmpty()) {
+                throw getPathException(pathCtx, yangLeafRef);
+            }
+            int nodeId = comPath.indexOf(CHAR_OF_SLASH);
+            int predicate = comPath.indexOf(CHAR_OF_OPEN_SQUARE_BRACKET);
+            if (predicate < nodeId && predicate != -1) {
+                comPath = getPathWithPredicate(comPath, atomics,
+                                               pathCtx, yangLeafRef, pathType);
+            } else {
+                comPath = getPath(comPath, atomics, pathType, pathCtx);
+            }
+        }
+    }
+
+    /**
+     * Returns the remaining path after parsing and the predicates of an atomic
+     * content.
+     *
+     * @param path        leaf-ref path
+     * @param atomics     atomic content list
+     * @param pathCtx     yang construct's context to get the line number and
+     *                    character position
+     * @param yangLeafRef YANG leaf-ref data model information
+     * @param pathType    yang construct for creating error message
+     * @return parsed path after removing one atomic content.
+     */
+    private static String getPathWithPredicate(String path,
+                                               List<YangAtomicPath> atomics,
+                                               PathStatementContext pathCtx,
+                                               YangLeafRef yangLeafRef,
+                                               YangConstructType pathType) {
+
+        String[] node = new String[2];
+        int bracket = path.indexOf(CHAR_OF_OPEN_SQUARE_BRACKET);
+        node[0] = path.substring(0, bracket);
+        node[1] = path.substring(bracket);
+        return getParsedPath(node[0], node[1], atomics, pathCtx, yangLeafRef,
+                             pathType);
+    }
+
+    /**
+     * Returns the path after taking all the path predicates of an atomic
+     * content.
+     *
+     * @param nodeId      atomic content nodeId
+     * @param path        leaf-ref path
+     * @param atomics     atomic content list
+     * @param pathCtx     yang construct's context to get the line number
+     *                    and character position
+     * @param yangLeafRef YANG leaf-ref data model information
+     * @param pathType    yang construct for creating error message
+     * @return parsed path after removing one atomic content.
+     */
+    public static String getParsedPath(String nodeId, String path,
+                                       List<YangAtomicPath> atomics,
+                                       PathStatementContext pathCtx,
+                                       YangLeafRef yangLeafRef,
+                                       YangConstructType pathType) {
+
+        String comPath = path;
+        List<String> predicateList = new ArrayList<>();
+        while (comPath.startsWith(OPEN_SQUARE_BRACKET)) {
+            String matchedVal = getMatchedPredicate(comPath);
+            if (matchedVal == null || matchedVal.isEmpty()) {
+                throw getPathException(pathCtx, yangLeafRef);
+            }
+            predicateList.add(matchedVal);
+            comPath = comPath.substring(matchedVal.length());
+        }
+
+        YangAtomicPath atomicPath = new YangAtomicPath();
+        YangNodeIdentifier validId =
+                getValidNodeIdentifier(nodeId, pathType, pathCtx);
+
+        List<YangPathPredicate> predicates = valPathPredicates(predicateList,
+                                                               pathType,
+                                                               pathCtx, yangLeafRef);
+        atomicPath.setNodeIdentifier(validId);
+        atomicPath.setPathPredicatesList(predicates);
+        atomics.add(atomicPath);
+        return comPath;
+    }
+
+    /**
+     * Validates the path predicates of an atomic content after parsing the
+     * predicates and storing it in the leaf-ref.
+     *
+     * @param predicates  list of predicates
+     * @param pathType    yang construct for creating error message
+     * @param pathCtx     yang construct's context to get the line number
+     *                    and character position
+     * @param yangLeafRef YANG leaf-ref data model information
+     * @return list of path predicates of an atomic content
+     */
+    private static List<YangPathPredicate> valPathPredicates(List<String> predicates,
+                                                             YangConstructType pathType,
+                                                             PathStatementContext pathCtx,
+                                                             YangLeafRef yangLeafRef) {
+
+        List<YangPathPredicate> result = new ArrayList<>();
+        for (String p : predicates) {
+            p = p.substring(1, p.length() - 1);
+            result.add(valPathEqualityExp(p.trim(), pathType, pathCtx, yangLeafRef));
+        }
+        return result;
+    }
+
+    /**
+     * Validates the path equality expression of a path predicate and after
+     * parsing the string assigns it to the YANG path predicate.
+     *
+     * @param predicate   path predicate
+     * @param pathType    yang construct for creating error message
+     * @param pathCtx     yang construct's context to get the line number
+     *                    and character position
+     * @param yangLeafRef YANG leaf-ref data model information
+     * @return YANG path predicate
+     */
+    private static YangPathPredicate valPathEqualityExp(String predicate,
+                                                        YangConstructType pathType,
+                                                        PathStatementContext pathCtx,
+                                                        YangLeafRef yangLeafRef) {
+
+        String[] exp = predicate.split(REGEX_EQUAL);
+        YangNodeIdentifier nodeId =
+                getValidNodeIdentifier(exp[0].trim(), pathType, pathCtx);
+        YangRelativePath relPath = valPathKeyExp(exp[1].trim(), pathType,
+                                                 pathCtx, yangLeafRef);
+
+        YangPathPredicate pathPredicate = new YangPathPredicate();
+        pathPredicate.setNodeId(nodeId);
+        pathPredicate.setPathOp(EQUALTO);
+        pathPredicate.setRelPath(relPath);
+        return pathPredicate;
+    }
+
+    /**
+     * Validates the path key expression of the path-predicate and stores it
+     * in the relative path of the leaf-ref.
+     *
+     * @param relPath     relative path
+     * @param pathType    yang construct for creating error message
+     * @param pathCtx     yang construct's context to get the line number
+     *                    and character position
+     * @param yangLeafRef YANG leaf-ref data model information
+     * @return YANG relative path
+     */
+    private static YangRelativePath valPathKeyExp(String relPath,
+                                                  YangConstructType pathType,
+                                                  PathStatementContext pathCtx,
+                                                  YangLeafRef yangLeafRef) {
+
+        String[] relative = relPath.split(SLASH_FOR_STRING);
+        int count = 0;
+        List<String> atomicContent = new ArrayList<>();
+        for (String val : relative) {
+            if (val.trim().equals(ANCESTOR)) {
+                count = count + 1;
+            } else {
+                atomicContent.add(val);
+            }
+        }
+
+        YangRelativePath relativePath = new YangRelativePath();
+        relativePath.setAncestorNodeCount(count);
+        relativePath.setAtomicPathList(valRelPathKeyExp(atomicContent,
+                                                        pathType,
+                                                        pathCtx, yangLeafRef));
+        return relativePath;
+    }
+
+    /**
+     * Validates relative path key expression in the right relative path of
+     * the path predicate, by taking every atomic content in it.
+     *
+     * @param content     atomic content list
+     * @param pathType    yang construct for creating error message
+     * @param pathCtx     yang construct's context to get the line number
+     *                    and character position
+     * @param yangLeafRef YANG leaf-ref data model information
+     * @return YANG atomic content list
+     */
+    private static List<YangAtomicPath> valRelPathKeyExp(List<String> content,
+                                                         YangConstructType pathType,
+                                                         PathStatementContext pathCtx,
+                                                         YangLeafRef yangLeafRef) {
+
+        String current = content.get(0);
+        String[] curStr = (current.trim()).split(REGEX_OPEN_BRACE);
+        if (!(curStr[0].trim().equals(CURRENT)) ||
+                !(curStr[1].trim().equals(CLOSE_PARENTHESIS))) {
+            throw getPathException(pathCtx, yangLeafRef);
+        }
+
+        content.remove(0);
+        List<YangAtomicPath> atomicList = new ArrayList<>();
+        for (String relPath : content) {
+            YangNodeIdentifier nodeId =
+                    getValidNodeIdentifier(relPath, pathType, pathCtx);
+            YangAtomicPath atomicPath = new YangAtomicPath();
+            atomicPath.setNodeIdentifier(nodeId);
+            atomicList.add(atomicPath);
+        }
+        return atomicList;
+    }
+
+    /**
+     * Returns the remaining path after parsing and processing an atomic
+     * content which doesn't have path-predicate.
+     *
+     * @param path       leaf-ref path
+     * @param atomicList atomic content list
+     * @param pathType   yang construct for creating error message
+     * @param pathCtx    yang construct's context to get the line number
+     *                   and character position
+     * @return remaining path after parsing one atomic content
+     */
+    public static String getPath(String path, List<YangAtomicPath> atomicList,
+                                 YangConstructType pathType,
+                                 PathStatementContext pathCtx) {
+
+        String comPath = path;
+        String nodeId;
+        if (comPath.contains(SLASH_FOR_STRING)) {
+            nodeId = comPath.substring(0, comPath.indexOf(CHAR_OF_SLASH));
+            comPath = comPath.substring(comPath.indexOf(CHAR_OF_SLASH));
+        } else {
+            nodeId = comPath;
+            comPath = null;
+        }
+
+        YangNodeIdentifier validNodeId =
+                getValidNodeIdentifier(nodeId, pathType, pathCtx);
+        YangAtomicPath atomicPath = new YangAtomicPath();
+        atomicPath.setNodeIdentifier(validNodeId);
+        atomicList.add(atomicPath);
+        return comPath;
+    }
+
+    /**
+     * Returns the path syntax parser exception.
+     *
+     * @param pathCtx     yang construct's context to get the line number
+     *                    and character position
+     * @param yangLeafRef YANG leaf-ref data model information
+     * @return parser exception
+     */
+    private static ParserException getPathException(PathStatementContext pathCtx,
+                                                    YangLeafRef yangLeafRef) {
+        ParserException exception = new ParserException(
+                "YANG file error : Path " + yangLeafRef.getPath() +
+                        " does not follow valid path syntax");
+        exception.setLine(pathCtx.getStart().getLine());
+        exception.setCharPosition(pathCtx.getStart().getCharPositionInLine());
+        return exception;
+    }
+
+    /**
+     * Returns the augment name, after removing the prefix, in each atomic
+     * content, which is equal to the root prefix.
+     *
+     * @param atomics atomic content list
+     * @param root    root node
+     * @return prefix removed augment name
+     */
+    public static String getPrefixRemovedName(List<YangAtomicPath> atomics,
+                                              YangNode root) {
+
+        String rootPrefix = getRootPrefix(root);
+        StringBuilder builder = new StringBuilder();
+        for (YangAtomicPath atomic : atomics) {
+            String id;
+            String prefix = atomic.getNodeIdentifier().getPrefix();
+            String name = atomic.getNodeIdentifier().getName();
+            if (rootPrefix.equals(prefix) || prefix == null) {
+                id = SLASH_FOR_STRING + name;
+            } else {
+                id = SLASH_FOR_STRING + prefix + COLON + name;
+            }
+            builder.append(id);
+        }
+        return builder.toString();
+    }
+}
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
new file mode 100644
index 0000000..eeb1dc9
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerValidation.java
@@ -0,0 +1,243 @@
+/*
+ * 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.parserutils;
+
+import org.antlr.v4.runtime.ParserRuleContext;
+import org.onosproject.yang.compiler.datamodel.YangCase;
+import org.onosproject.yang.compiler.datamodel.YangChoice;
+import org.onosproject.yang.compiler.datamodel.YangConfig;
+import org.onosproject.yang.compiler.datamodel.YangInput;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNotification;
+import org.onosproject.yang.compiler.datamodel.YangOutput;
+import org.onosproject.yang.compiler.datamodel.YangRpc;
+import org.onosproject.yang.compiler.datamodel.utils.Parsable;
+import org.onosproject.yang.compiler.datamodel.utils.YangConstructType;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
+
+import java.util.Iterator;
+import java.util.List;
+
+import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.getYangConstructType;
+import static org.onosproject.yang.compiler.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+
+/**
+ * Represents a utility to carry out listener validation.
+ */
+public final class ListenerValidation {
+
+    /**
+     * Creates a new listener validation.
+     */
+    private ListenerValidation() {
+    }
+
+    /**
+     * Checks parsed data stack is not empty.
+     *
+     * @param listener Listener's object
+     * @param errorType error type needs to be set in error message
+     * @param yangConstructType type of parsable data in which error occurred
+     * @param parsableDataTypeName name of parsable data type in which error
+     *            occurred
+     * @param errorLocation location where error occurred
+     */
+    public static void checkStackIsNotEmpty(TreeWalkListener listener, ListenerErrorType errorType,
+                                            YangConstructType yangConstructType, String parsableDataTypeName,
+                                            ListenerErrorLocation errorLocation) {
+
+        if (listener.getParsedDataStack().empty()) {
+            /*
+             * If stack is empty it indicates error condition, value of
+             * parsableDataTypeName will be null in case there is no name
+             * attached to parsable data type.
+             */
+            String message = constructListenerErrorMessage(errorType, yangConstructType, parsableDataTypeName,
+                    errorLocation);
+            throw new ParserException(message);
+        }
+    }
+
+    /**
+     * Checks parsed data stack is empty.
+     *
+     * @param listener Listener's object
+     * @param errorType error type needs to be set in error message
+     * @param yangConstructType type of parsable data in which error occurred
+     * @param parsableDataTypeName name of parsable data type in which error
+     *            occurred
+     * @param errorLocation location where error occurred
+     */
+    public static void checkStackIsEmpty(TreeWalkListener listener, ListenerErrorType errorType,
+            YangConstructType yangConstructType, String parsableDataTypeName,
+            ListenerErrorLocation errorLocation) {
+
+        if (!listener.getParsedDataStack().empty()) {
+            /*
+             * If stack is empty it indicates error condition, value of
+             * parsableDataTypeName will be null in case there is no name
+             * attached to parsable data type.
+             */
+            String message = constructListenerErrorMessage(errorType, yangConstructType, parsableDataTypeName,
+                    errorLocation);
+            throw new ParserException(message);
+        }
+    }
+
+    /**
+     * Returns parent node config value, if top node does not specify a config
+     * statement then default value true is returned.
+     *
+     * @param listener listener's object
+     * @return true/false parent's config value
+     */
+    public static boolean getParentNodeConfig(TreeWalkListener listener) {
+        Parsable curData = listener.getParsedDataStack().peek();
+        YangNode parentNode = ((YangNode) curData).getParent();
+        if (curData instanceof YangConfig) {
+            return ((YangConfig) curData).isConfig();
+        } else if (curData instanceof YangRpc || curData instanceof YangOutput
+                || curData instanceof YangInput || curData instanceof YangNotification) {
+            return false;
+        } else if (curData instanceof YangCase && parentNode instanceof YangChoice) {
+            return ((YangChoice) parentNode).isConfig();
+        } else {
+            return true;
+        }
+    }
+
+    /**
+     * Checks if a rule occurrences is as per the expected YANG grammar's
+     * cardinality.
+     *
+     * @param childContext child's context
+     * @param yangChildConstruct child construct for whom cardinality is to be
+     *            validated
+     * @param yangParentConstruct parent construct
+     * @param parentName parent name
+     * @throws ParserException exception if cardinality check fails
+     */
+    public static void validateCardinalityMaxOne(List<?> childContext, YangConstructType yangChildConstruct,
+            YangConstructType yangParentConstruct, String parentName)
+            throws ParserException {
+
+        if (!childContext.isEmpty() && childContext.size() != 1) {
+            ParserException parserException = new ParserException("YANG file error: \""
+                    + getYangConstructType(yangChildConstruct) + "\" is defined more than once in \""
+                    + getYangConstructType(yangParentConstruct) + " " + parentName + "\".");
+
+            Iterator<?> context = childContext.iterator();
+            parserException.setLine(((ParserRuleContext) context.next()).getStart().getLine());
+            parserException.setCharPosition(((ParserRuleContext) context.next()).getStart().getCharPositionInLine());
+            throw parserException;
+        }
+    }
+
+    /**
+     * Checks if a rule occurrences is exactly 1.
+     *
+     * @param childContext child's context
+     * @param yangChildConstruct child construct for whom cardinality is to be
+     *                           validated
+     * @param yangParentConstruct parent construct
+     * @param parentName parent name
+     * @param parentContext parents's context
+     * @throws ParserException exception if cardinality check fails
+     */
+    public static void validateCardinalityEqualsOne(List<?> childContext, YangConstructType yangChildConstruct,
+            YangConstructType yangParentConstruct, String parentName,
+            ParserRuleContext parentContext)
+            throws ParserException {
+
+        if (childContext.isEmpty()) {
+            ParserException parserException = new ParserException("YANG file error: Missing \""
+                    + getYangConstructType(yangChildConstruct) + "\" in \"" + getYangConstructType(yangParentConstruct)
+                    + " " + parentName + "\".");
+            parserException.setLine(parentContext.getStart().getLine());
+            parserException.setCharPosition(parentContext.getStart().getCharPositionInLine());
+            throw parserException;
+        } else if (!childContext.isEmpty() && childContext.size() != 1) {
+            Iterator<?> childcontext = childContext.iterator();
+            ParserException parserException = new ParserException("YANG file error: \""
+                    + getYangConstructType(yangChildConstruct) + "\" is present more than once in \""
+                    + getYangConstructType(yangParentConstruct) + " " + parentName + "\".");
+            parserException.setLine(((ParserRuleContext) childcontext.next()).getStart().getLine());
+            parserException.setCharPosition(((ParserRuleContext) childcontext.next()).getStart()
+                    .getCharPositionInLine());
+            throw parserException;
+        }
+    }
+
+    /**
+     * Checks if a rule occurrences is minimum 1.
+     *
+     * @param childContext child's context
+     * @param yangChildConstruct child construct for whom cardinality is to be
+     *                           validated
+     * @param yangParentConstruct parent construct
+     * @param parentName parent name
+     * @param parentContext parents's context
+     * @throws ParserException exception if cardinality check fails
+     */
+    public static void validateCardinalityNonZero(List<?> childContext, YangConstructType yangChildConstruct,
+            YangConstructType yangParentConstruct, String parentName,
+            ParserRuleContext parentContext)
+            throws ParserException {
+
+        if (childContext.isEmpty()) {
+            ParserException parserException = new ParserException("YANG file error: Missing \""
+                    + getYangConstructType(yangChildConstruct) + "\" in \"" + getYangConstructType(yangParentConstruct)
+                    + " " + parentName + "\".");
+
+            parserException.setLine(parentContext.getStart().getLine());
+            parserException.setCharPosition(parentContext.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+    }
+
+    /**
+     * Checks if a either of one construct occurrence.
+     *
+     * @param child1Context       first optional child's context
+     * @param yangChild1Construct first child construct for whom cardinality is
+     *                            to be validated
+     * @param child2Context       second optional child's context
+     * @param yangChild2Construct second child construct for whom cardinality is
+     *                            to be validated
+     * @param yangParentConstruct parent construct
+     * @param parentName          parent name
+     * @param parentContext       parents's context
+     * @throws ParserException exception if cardinality check fails
+     */
+    public static void validateCardinalityEitherOne(List<?> child1Context, YangConstructType yangChild1Construct,
+                                                    List<?> child2Context, YangConstructType yangChild2Construct,
+                                                    YangConstructType yangParentConstruct, String parentName,
+                                                    ParserRuleContext parentContext)
+            throws ParserException {
+
+        if (child1Context.isEmpty() && child2Context.isEmpty()) {
+            ParserException parserException = new ParserException("YANG file error: Either \""
+                    + getYangConstructType(yangChild1Construct) + "\" or \"" + getYangConstructType(yangChild2Construct)
+                    + "\" should be present in \"" + getYangConstructType(yangParentConstruct) + " "
+                    + parentName + "\".");
+            parserException.setLine(parentContext.getStart().getLine());
+            parserException.setCharPosition(parentContext.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+    }
+}
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ParseTreeErrorListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ParseTreeErrorListener.java
new file mode 100644
index 0000000..e839e2c
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/ParseTreeErrorListener.java
@@ -0,0 +1,41 @@
+/*
+ * 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.parserutils;
+
+import org.antlr.v4.runtime.BaseErrorListener;
+import org.antlr.v4.runtime.RecognitionException;
+import org.antlr.v4.runtime.Recognizer;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+
+/**
+ * Represent the parse tree error listener.
+ * By default, ANTLR sends all errors to standard error, this is changed by
+ * providing this new implementation of interface ANTLRErrorListener. The
+ * interface has a syntaxError() method that applies to both lexer and parser.
+ */
+public class ParseTreeErrorListener extends BaseErrorListener {
+
+    @Override
+    public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol, int line, int charPositionInLine,
+            String msg, RecognitionException e) {
+
+        ParserException parserException = new ParserException(msg);
+        parserException.setLine(line);
+        parserException.setCharPosition(charPositionInLine);
+        throw parserException;
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/package-info.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/package-info.java
new file mode 100644
index 0000000..5662cff
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/parserutils/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+/**
+ * Provide common utils for parser implementation.
+ */
+package org.onosproject.yang.compiler.parser.impl.parserutils;
\ No newline at end of file
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/package-info.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/package-info.java
new file mode 100644
index 0000000..ac4cd7d
--- /dev/null
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+/**
+ * Interfaces to process YANG information from ANTLR generated listeners.
+ */
+package org.onosproject.yang.compiler.parser;
diff --git a/compiler/base/parser/src/main/resources/GeneratedYang.g4 b/compiler/base/parser/src/main/resources/GeneratedYang.g4
new file mode 100644
index 0000000..3ba1201
--- /dev/null
+++ b/compiler/base/parser/src/main/resources/GeneratedYang.g4
@@ -0,0 +1,1347 @@
+/*
+ * 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.
+ */
+
+/**
+ * This is a YANG grammar for parser based on which ANTLR will generate YANG parser.
+ */
+
+grammar GeneratedYang;
+import YangLexer;
+
+@header {
+package org.onosproject.yang.compiler.parser.antlrgencode;
+}
+
+    yangfile : moduleStatement EOF
+             | subModuleStatement EOF;
+
+    /**
+     * module-stmt         = optsep module-keyword sep identifier-arg-str
+     *                       optsep
+     *                       "{" stmtsep
+     *                           module-header-stmts
+     *                           linkage-stmts
+     *                           meta-stmts
+     *                           revision-stmts
+     *                           body-stmts
+     *                       "}" optsep
+     */
+
+    moduleStatement : MODULE_KEYWORD identifier LEFT_CURLY_BRACE moduleBody RIGHT_CURLY_BRACE;
+
+    moduleBody : moduleHeaderStatement linkageStatements metaStatements revisionStatements bodyStatements;
+
+    /**
+     * module-header-stmts = ;; these stmts can appear in any order
+     *                       [yang-version-stmt stmtsep]
+     *                        namespace-stmt stmtsep
+     *                        prefix-stmt stmtsep
+     */
+
+    moduleHeaderStatement : yangVersionStatement? namespaceStatement prefixStatement
+                            | yangVersionStatement? prefixStatement namespaceStatement
+                            | namespaceStatement yangVersionStatement? prefixStatement
+                            | namespaceStatement prefixStatement yangVersionStatement?
+                            | prefixStatement namespaceStatement yangVersionStatement?
+                            | prefixStatement yangVersionStatement? namespaceStatement
+                            ;
+
+    /**
+     * linkage-stmts       = ;; these stmts can appear in any order
+     *                       *(import-stmt stmtsep)
+     *                       *(include-stmt stmtsep)
+     */
+    linkageStatements : (importStatement
+                  | includeStatement)*;
+
+    /**
+     * meta-stmts          = ;; these stmts can appear in any order
+     *                       [organization-stmt stmtsep]
+     *                       [contact-stmt stmtsep]
+     *                       [description-stmt stmtsep]
+     *                       [reference-stmt stmtsep]
+     */
+    metaStatements : organizationStatement? contactStatement? descriptionStatement? referenceStatement?
+               | organizationStatement? contactStatement? referenceStatement? descriptionStatement?
+               | organizationStatement? descriptionStatement? contactStatement? referenceStatement?
+               | organizationStatement? descriptionStatement? referenceStatement? contactStatement?
+               | organizationStatement? referenceStatement? contactStatement? descriptionStatement?
+               | organizationStatement? referenceStatement? descriptionStatement? contactStatement?
+               | contactStatement? organizationStatement? descriptionStatement? referenceStatement?
+               | contactStatement? organizationStatement? referenceStatement? descriptionStatement?
+               | contactStatement? referenceStatement? organizationStatement? descriptionStatement?
+               | contactStatement? referenceStatement? descriptionStatement? organizationStatement?
+               | contactStatement? descriptionStatement? referenceStatement? organizationStatement?
+               | contactStatement? descriptionStatement? organizationStatement? referenceStatement?
+               | referenceStatement? contactStatement? organizationStatement? descriptionStatement?
+               | referenceStatement? contactStatement? descriptionStatement? organizationStatement?
+               | referenceStatement? organizationStatement? contactStatement? descriptionStatement?
+               | referenceStatement? organizationStatement? descriptionStatement? contactStatement?
+               | referenceStatement? descriptionStatement? organizationStatement? contactStatement?
+               | referenceStatement? descriptionStatement? contactStatement? organizationStatement?
+               | descriptionStatement? referenceStatement? contactStatement? organizationStatement?
+               | descriptionStatement? referenceStatement? organizationStatement? contactStatement?
+               | descriptionStatement? contactStatement? referenceStatement? organizationStatement?
+               | descriptionStatement? contactStatement? organizationStatement? referenceStatement?
+               | descriptionStatement? organizationStatement? contactStatement? referenceStatement?
+               | descriptionStatement? organizationStatement? referenceStatement? contactStatement?
+               ;
+
+    // revision-stmts      = *(revision-stmt stmtsep)
+    revisionStatements : revisionStatement*;
+
+    /**
+     * body-stmts          = *((extension-stmt /
+     *                          feature-stmt /
+     *                          identity-stmt /
+     *                          typedef-stmt /
+     *                          grouping-stmt /
+     *                          data-def-stmt /
+     *                          augment-stmt /
+     *                          rpc-stmt /
+     *                          notification-stmt /
+     *                          deviation-stmt) stmtsep)
+     */
+    bodyStatements : (extensionStatement
+               | featureStatement
+               | identityStatement
+               | typedefStatement
+               | groupingStatement
+               | dataDefStatement
+               | augmentStatement
+               | rpcStatement
+               | notificationStatement
+               | deviationStatement
+               | compilerAnnotationStatement)*
+               ;
+
+    /**
+     * yang-version-stmt   = yang-version-keyword sep yang-version-arg-str
+     *                       optsep stmtend
+     */
+    yangVersionStatement :   YANG_VERSION_KEYWORD version STMTEND;
+
+
+    /**
+     * namespace-stmt      = namespace-keyword sep uri-str optsep stmtend
+     * For namespace validation TODO in Listener
+     */
+    namespaceStatement : NAMESPACE_KEYWORD string STMTEND;
+
+    /**
+     * prefix-stmt         = prefix-keyword sep prefix-arg-str
+     *                       optsep stmtend
+     */
+    prefixStatement : PREFIX_KEYWORD identifier STMTEND;
+
+    /**
+     * import-stmt         = import-keyword sep identifier-arg-str optsep
+     *                       "{" stmtsep
+     *                           prefix-stmt stmtsep
+     *                           [revision-date-stmt stmtsep]
+     *                        "}"
+     */
+    importStatement : IMPORT_KEYWORD identifier LEFT_CURLY_BRACE importStatementBody RIGHT_CURLY_BRACE;
+
+    importStatementBody : prefixStatement revisionDateStatement?;
+
+    // revision-date-stmt = revision-date-keyword sep revision-date stmtend
+    revisionDateStatement : REVISION_DATE_KEYWORD dateArgumentString STMTEND;
+
+    /**
+     * include-stmt        = include-keyword sep identifier-arg-str optsep
+     *                             (";" /
+     *                              "{" stmtsep
+     *                                  [revision-date-stmt stmtsep]
+     *                            "}")
+     */
+    includeStatement : INCLUDE_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE revisionDateStatement? RIGHT_CURLY_BRACE);
+
+    /**
+     * organization-stmt   = organization-keyword sep string
+     *                            optsep stmtend
+     */
+    organizationStatement : ORGANIZATION_KEYWORD string STMTEND;
+
+    // contact-stmt        = contact-keyword sep string optsep stmtend
+    contactStatement : CONTACT_KEYWORD string STMTEND;
+
+    // description-stmt    = description-keyword sep string optsep stmtend
+    descriptionStatement : DESCRIPTION_KEYWORD string STMTEND;
+
+    // reference-stmt      = reference-keyword sep string optsep stmtend
+    referenceStatement : REFERENCE_KEYWORD string STMTEND;
+
+    /**
+     * revision-stmt       = revision-keyword sep revision-date optsep
+     *                             (";" /
+     *                              "{" stmtsep
+     *                                  [description-stmt stmtsep]
+     *                                  [reference-stmt stmtsep]
+     *                              "}")
+     */
+    revisionStatement : REVISION_KEYWORD dateArgumentString (STMTEND | LEFT_CURLY_BRACE revisionStatementBody RIGHT_CURLY_BRACE);
+    revisionStatementBody : descriptionStatement? referenceStatement?;
+
+    /**
+     * submodule-stmt      = optsep submodule-keyword sep identifier-arg-str
+     *                             optsep
+     *                             "{" stmtsep
+     *                                 submodule-header-stmts
+     *                                 linkage-stmts
+     *                                 meta-stmts
+     *                                 revision-stmts
+     *                                 body-stmts
+     *                             "}" optsep
+     */
+    subModuleStatement : SUBMODULE_KEYWORD identifier LEFT_CURLY_BRACE submoduleBody RIGHT_CURLY_BRACE;
+    submoduleBody : submoduleHeaderStatement linkageStatements metaStatements revisionStatements bodyStatements;
+
+    /** submodule-header-stmts =
+     *                            ;; these stmts can appear in any order
+     *                            [yang-version-stmt stmtsep]
+     *                             belongs-to-stmt stmtsep
+     */
+    submoduleHeaderStatement : yangVersionStatement? belongstoStatement
+                               | belongstoStatement yangVersionStatement?
+                              ;
+
+    /**
+     * belongs-to-stmt     = belongs-to-keyword sep identifier-arg-str
+     *                       optsep
+     *                       "{" stmtsep
+     *                           prefix-stmt stmtsep
+     *                       "}"
+     */
+    belongstoStatement : BELONGS_TO_KEYWORD identifier LEFT_CURLY_BRACE belongstoStatementBody RIGHT_CURLY_BRACE;
+    belongstoStatementBody : prefixStatement;
+
+    /**
+     * extension-stmt      = extension-keyword sep identifier-arg-str optsep
+     *                       (";" /
+     *                        "{" stmtsep
+     *                            ;; these stmts can appear in any order
+     *                            [argument-stmt stmtsep]
+     *                            [status-stmt stmtsep]
+     *                            [description-stmt stmtsep]
+     *                            [reference-stmt stmtsep]
+     *                        "}")
+     */
+    extensionStatement : EXTENSION_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE extensionBody RIGHT_CURLY_BRACE);
+    extensionBody : argumentStatement? statusStatement? descriptionStatement? referenceStatement?
+                   | argumentStatement? statusStatement? referenceStatement? descriptionStatement?
+                   | argumentStatement? descriptionStatement? statusStatement? referenceStatement?
+                   | argumentStatement? descriptionStatement? referenceStatement? statusStatement?
+                   | argumentStatement? referenceStatement? descriptionStatement? statusStatement?
+                   | argumentStatement? referenceStatement? statusStatement? descriptionStatement?
+                   | statusStatement? referenceStatement? argumentStatement? descriptionStatement?
+                   | statusStatement? referenceStatement? descriptionStatement? argumentStatement?
+                   | statusStatement? descriptionStatement? referenceStatement? argumentStatement?
+                   | statusStatement? descriptionStatement? argumentStatement? referenceStatement?
+                   | statusStatement? argumentStatement? referenceStatement? descriptionStatement?
+                   | statusStatement? argumentStatement? descriptionStatement? referenceStatement?
+                   | descriptionStatement? argumentStatement? statusStatement? referenceStatement?
+                   | descriptionStatement? argumentStatement? referenceStatement? statusStatement?
+                   | descriptionStatement? statusStatement? argumentStatement? referenceStatement?
+                   | descriptionStatement? statusStatement? referenceStatement? argumentStatement?
+                   | descriptionStatement? referenceStatement? statusStatement? argumentStatement?
+                   | descriptionStatement? referenceStatement? argumentStatement? statusStatement?
+                   | referenceStatement? descriptionStatement? argumentStatement? statusStatement?
+                   | referenceStatement? descriptionStatement? statusStatement? argumentStatement?
+                   | referenceStatement? statusStatement? argumentStatement? descriptionStatement?
+                   | referenceStatement? statusStatement? descriptionStatement? argumentStatement?
+                   | referenceStatement? argumentStatement? descriptionStatement? statusStatement?
+                   | referenceStatement? argumentStatement? statusStatement? descriptionStatement?
+                   ;
+
+    /**
+     * argument-stmt       = argument-keyword sep identifier-arg-str optsep
+     *                       (";" /
+     *                        "{" stmtsep
+     *                            [yin-element-stmt stmtsep]
+     *                        "}")
+     */
+    argumentStatement : ARGUMENT_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE argumentBody RIGHT_CURLY_BRACE);
+    argumentBody : yinElementStatement?;
+
+    /**
+     * yin-element-stmt    = yin-element-keyword sep yin-element-arg-str
+     *                       stmtend
+     */
+    yinElementStatement : YIN_ELEMENT_KEYWORD (TRUE_KEYWORD | FALSE_KEYWORD) STMTEND;
+
+    /**
+     * identity-stmt       = identity-keyword sep identifier-arg-str optsep
+     *                       (";" /
+     *                        "{" stmtsep
+     *                            ;; these stmts can appear in any order
+     *                            [base-stmt stmtsep]
+     *                            [status-stmt stmtsep]
+     *                            [description-stmt stmtsep]
+     *                            [reference-stmt stmtsep]
+     *                        "}")
+     */
+    identityStatement : IDENTITY_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE identityBody RIGHT_CURLY_BRACE);
+    identityBody : baseStatement? statusStatement? descriptionStatement? referenceStatement?
+                  | baseStatement? statusStatement? referenceStatement? descriptionStatement?
+                  | baseStatement? descriptionStatement? statusStatement? referenceStatement?
+                  | baseStatement? descriptionStatement? referenceStatement? statusStatement?
+                  | baseStatement? referenceStatement? descriptionStatement? statusStatement?
+                  | baseStatement? referenceStatement? statusStatement? descriptionStatement?
+                  | referenceStatement? baseStatement? statusStatement? descriptionStatement?
+                  | referenceStatement? baseStatement? descriptionStatement? statusStatement?
+                  | referenceStatement? statusStatement? baseStatement? descriptionStatement?
+                  | referenceStatement? statusStatement? descriptionStatement? baseStatement?
+                  | referenceStatement? descriptionStatement? statusStatement? baseStatement?
+                  | referenceStatement? descriptionStatement? baseStatement? statusStatement?
+                  | descriptionStatement? referenceStatement? statusStatement? baseStatement?
+                  | descriptionStatement? referenceStatement? statusStatement? baseStatement?
+                  | descriptionStatement? referenceStatement? baseStatement? statusStatement?
+                  | descriptionStatement? statusStatement? baseStatement? referenceStatement?
+                  | descriptionStatement? statusStatement? referenceStatement? baseStatement?
+                  | descriptionStatement? baseStatement? referenceStatement? statusStatement?
+                  | descriptionStatement? baseStatement? statusStatement? referenceStatement?
+                  | statusStatement? baseStatement? descriptionStatement? referenceStatement?
+                  | statusStatement? baseStatement? referenceStatement? descriptionStatement?
+                  | statusStatement? descriptionStatement? baseStatement? referenceStatement?
+                  | statusStatement? descriptionStatement? referenceStatement? baseStatement?
+                  | statusStatement? referenceStatement? descriptionStatement? baseStatement?
+                  | statusStatement? referenceStatement? baseStatement? descriptionStatement?
+                  ;
+
+    /**
+     * base-stmt           = base-keyword sep identifier-ref-arg-str
+     *                          optsep stmtend*
+     * identifier-ref-arg  = [prefix ":"] identifier
+     */
+    baseStatement : BASE_KEYWORD string STMTEND;
+
+    /**
+     *  feature-stmt        = feature-keyword sep identifier-arg-str optsep
+     *                        (";" /
+     *                         "{" stmtsep
+     *                             ;; these stmts can appear in any order
+     *                             *(if-feature-stmt stmtsep)
+     *                             [status-stmt stmtsep]
+     *                             [description-stmt stmtsep]
+     *                             [reference-stmt stmtsep]
+     *                         "}")
+     */
+    featureStatement : FEATURE_KEYWORD string (STMTEND | LEFT_CURLY_BRACE featureBody RIGHT_CURLY_BRACE);
+    featureBody : ifFeatureStatement* statusStatement? descriptionStatement? referenceStatement?
+                 | ifFeatureStatement* statusStatement? referenceStatement? descriptionStatement?
+                 | ifFeatureStatement* descriptionStatement? statusStatement? referenceStatement?
+                 | ifFeatureStatement* descriptionStatement? referenceStatement? statusStatement?
+                 | ifFeatureStatement* referenceStatement? statusStatement? descriptionStatement?
+                 | ifFeatureStatement* referenceStatement? descriptionStatement? statusStatement?
+                 | statusStatement? ifFeatureStatement* descriptionStatement? referenceStatement?
+                 | statusStatement? ifFeatureStatement* referenceStatement? descriptionStatement?
+                 | statusStatement? descriptionStatement? ifFeatureStatement* referenceStatement?
+                 | statusStatement? descriptionStatement? referenceStatement? ifFeatureStatement*
+                 | statusStatement? referenceStatement? ifFeatureStatement* descriptionStatement?
+                 | statusStatement? referenceStatement? descriptionStatement? ifFeatureStatement*
+                 | descriptionStatement? ifFeatureStatement* statusStatement? referenceStatement?
+                 | descriptionStatement? ifFeatureStatement* referenceStatement? statusStatement?
+                 | descriptionStatement? statusStatement? ifFeatureStatement* referenceStatement?
+                 | descriptionStatement? statusStatement? referenceStatement? ifFeatureStatement*
+                 | descriptionStatement? referenceStatement* statusStatement? ifFeatureStatement*
+                 | descriptionStatement? referenceStatement* ifFeatureStatement? statusStatement?
+                 | referenceStatement? ifFeatureStatement* statusStatement? descriptionStatement?
+                 | referenceStatement? ifFeatureStatement* descriptionStatement? statusStatement?
+                 | referenceStatement? descriptionStatement? statusStatement? ifFeatureStatement*
+                 | referenceStatement? descriptionStatement? ifFeatureStatement* statusStatement?
+                 | referenceStatement? statusStatement? descriptionStatement? ifFeatureStatement*
+                 | referenceStatement? statusStatement? ifFeatureStatement* descriptionStatement?
+                 ;
+
+    /**
+     *  data-def-stmt       = container-stmt /
+     *                       leaf-stmt /
+     *                       leaf-list-stmt /
+     *                       list-stmt /
+     *                       choice-stmt /
+     *                       anyxml-stmt /
+     *                       uses-stmt
+     */
+    dataDefStatement : containerStatement
+                    | leafStatement
+                    | leafListStatement
+                    | listStatement
+                    | choiceStatement
+                    | anyxmlStatement
+                    | usesStatement;
+
+    /**
+     *  if-feature-stmt     = if-feature-keyword sep identifier-ref-arg-str
+     *                        optsep stmtend
+     */
+    ifFeatureStatement : IF_FEATURE_KEYWORD string STMTEND;
+
+    /**
+    *    units-stmt          = units-keyword sep string optsep stmtend
+    */
+    unitsStatement : UNITS_KEYWORD string STMTEND;
+
+    /**
+     *   typedef-stmt        = typedef-keyword sep identifier-arg-str optsep
+     *                         "{" stmtsep
+     *                             ;; these stmts can appear in any order
+     *                             type-stmt stmtsep
+     *                            [units-stmt stmtsep]
+     *                             [default-stmt stmtsep]
+     *                             [status-stmt stmtsep]
+     *                             [description-stmt stmtsep]
+     *                             [reference-stmt stmtsep]
+     *                           "}"
+     * TODO : 0..1 occurance to be validated in listener
+     */
+    typedefStatement : TYPEDEF_KEYWORD identifier LEFT_CURLY_BRACE
+                   (typeStatement | unitsStatement | defaultStatement | statusStatement | descriptionStatement | referenceStatement)*
+                   RIGHT_CURLY_BRACE;
+
+    /**
+     *  type-stmt           = type-keyword sep identifier-ref-arg-str optsep
+     *                        (";" /
+     *                         "{" stmtsep
+     *                            type-body-stmts
+     *                         "}")
+     */
+    typeStatement : TYPE_KEYWORD string (STMTEND | LEFT_CURLY_BRACE typeBodyStatements RIGHT_CURLY_BRACE);
+
+    /**
+     *  type-body-stmts     = numerical-restrictions /
+     *                        decimal64-specification /
+     *                       string-restrictions /
+     *                        enum-specification /
+     *                        leafref-specification /
+     *                        identityref-specification /
+     *                        instance-identifier-specification /
+     *                        bits-specification /
+     *                        union-specification
+     *
+     */
+    typeBodyStatements : numericalRestrictions | decimal64Specification | stringRestrictions | enumSpecification
+                    | leafrefSpecification | identityrefSpecification | instanceIdentifierSpecification
+                    | bitsSpecification | unionSpecification;
+
+    /**
+     *    decimal64-specification = ;; these stmts can appear in any order
+     *                               fraction-digits-stmt
+     *                               [range-stmt]
+     */
+     decimal64Specification : fractionDigitStatement rangeStatement?;
+
+    /**
+     *  fraction-digits-stmt = fraction-digits-keyword sep
+     *                         fraction-digits-arg-str stmtend
+     *
+     *  fraction-digits-arg-str = < a string that matches the rule
+     *                             fraction-digits-arg >
+     *
+     *  fraction-digits-arg = ("1" ["0" / "1" / "2" / "3" / "4" /
+     *                              "5" / "6" / "7" / "8"])
+     *                        / "2" / "3" / "4" / "5" / "6" / "7" / "8" / "9"
+     */
+    fractionDigitStatement : FRACTION_DIGITS_KEYWORD fraction STMTEND;
+
+    /**
+     *  numerical-restrictions = range-stmt stmtsep
+     */
+    numericalRestrictions : rangeStatement;
+
+    /**
+     *  range-stmt          = range-keyword sep range-arg-str optsep
+     *                        (";" /
+     *                         "{" stmtsep
+     *                             ;; these stmts can appear in any order
+     *                             [error-message-stmt stmtsep]
+     *                             [error-app-tag-stmt stmtsep]
+     *                             [description-stmt stmtsep]
+     *                             [reference-stmt stmtsep]
+     *                          "}")
+     */
+    rangeStatement : RANGE_KEYWORD range (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE);
+
+    commonStatements : errorMessageStatement? errorAppTagStatement? descriptionStatement? referenceStatement?
+                 | errorMessageStatement? errorAppTagStatement? referenceStatement? descriptionStatement?
+                 | errorMessageStatement? descriptionStatement? errorAppTagStatement? referenceStatement?
+                 | errorMessageStatement? descriptionStatement? referenceStatement? errorAppTagStatement?
+                 | errorMessageStatement? referenceStatement? errorAppTagStatement? descriptionStatement?
+                 | errorMessageStatement? referenceStatement? descriptionStatement? errorAppTagStatement?
+                 | errorAppTagStatement? errorMessageStatement? descriptionStatement? referenceStatement?
+                 | errorAppTagStatement? errorMessageStatement? referenceStatement? descriptionStatement?
+                 | errorAppTagStatement? descriptionStatement? descriptionStatement? errorMessageStatement?
+                 | errorAppTagStatement? descriptionStatement? errorMessageStatement? descriptionStatement?
+                 | errorAppTagStatement? referenceStatement? errorMessageStatement? descriptionStatement?
+                 | errorAppTagStatement? referenceStatement? descriptionStatement? errorMessageStatement?
+                 | descriptionStatement? errorMessageStatement? errorAppTagStatement? referenceStatement?
+                 | descriptionStatement? errorMessageStatement? referenceStatement? errorAppTagStatement?
+                 | descriptionStatement? errorAppTagStatement? errorMessageStatement? referenceStatement?
+                 | descriptionStatement? errorAppTagStatement? referenceStatement? errorMessageStatement?
+                 | descriptionStatement? referenceStatement? errorMessageStatement? errorAppTagStatement?
+                 | descriptionStatement? referenceStatement? errorAppTagStatement? errorMessageStatement?
+                 | referenceStatement? errorMessageStatement? descriptionStatement? errorAppTagStatement?
+                 | referenceStatement? errorMessageStatement? errorAppTagStatement? descriptionStatement?
+                 | referenceStatement? errorAppTagStatement? descriptionStatement? errorMessageStatement?
+                 | referenceStatement? errorAppTagStatement? errorMessageStatement? descriptionStatement?
+                 | referenceStatement? descriptionStatement? errorMessageStatement? errorAppTagStatement?
+                 | referenceStatement? descriptionStatement? errorAppTagStatement? errorMessageStatement?
+                 ;
+
+    /**
+     *  string-restrictions = ;; these stmts can appear in any order
+     *                        [length-stmt stmtsep]
+     *                        *(pattern-stmt stmtsep)
+     */
+    stringRestrictions : ((lengthStatement)? (patternStatement)*) | ((patternStatement)* (lengthStatement)?);
+
+    /**
+     *  length-stmt         = length-keyword sep length-arg-str optsep
+     *                        (";" /
+     *                         "{" stmtsep
+     *                             ;; these stmts can appear in any order
+     *                             [error-message-stmt stmtsep]
+     *                             [error-app-tag-stmt stmtsep]
+     *                             [description-stmt stmtsep]
+     *                             [reference-stmt stmtsep]
+     *                          "}")
+     */
+    lengthStatement : LENGTH_KEYWORD length
+                  (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE);
+
+    /**
+     *  pattern-stmt        = pattern-keyword sep string optsep
+     *                        (";" /
+     *                         "{" stmtsep
+     *                             ;; these stmts can appear in any order
+     *                             [error-message-stmt stmtsep]
+     *                             [error-app-tag-stmt stmtsep]
+     *                             [description-stmt stmtsep]
+     *                             [reference-stmt stmtsep]
+     *                          "}")
+     */
+    patternStatement : PATTERN_KEYWORD string (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE);
+
+    /**
+     *  default-stmt        = default-keyword sep string stmtend
+     */
+    defaultStatement : DEFAULT_KEYWORD string STMTEND;
+
+    /**
+     *  enum-specification  = 1*(enum-stmt stmtsep)
+     */
+    enumSpecification : enumStatement+;
+
+    /**
+     *  enum-stmt           = enum-keyword sep string optsep
+     *                        (";" /
+     *                         "{" stmtsep
+     *                             ;; these stmts can appear in any order
+     *                             [value-stmt stmtsep]
+     *                             [status-stmt stmtsep]
+     *                             [description-stmt stmtsep]
+     *                             [reference-stmt stmtsep]
+     *                          "}")
+     */
+    enumStatement : ENUM_KEYWORD string (STMTEND | LEFT_CURLY_BRACE enumStatementBody RIGHT_CURLY_BRACE);
+
+    enumStatementBody : valueStatement? statusStatement? descriptionStatement? referenceStatement?
+                   | valueStatement? statusStatement? referenceStatement? descriptionStatement?
+                   | valueStatement? descriptionStatement? statusStatement? referenceStatement?
+                   | valueStatement? descriptionStatement? referenceStatement? statusStatement?
+                   | valueStatement? referenceStatement? statusStatement? descriptionStatement?
+                   | valueStatement? referenceStatement? descriptionStatement? statusStatement?
+                   | statusStatement? valueStatement? descriptionStatement? referenceStatement?
+                   | statusStatement? valueStatement? referenceStatement? descriptionStatement?
+                   | statusStatement? descriptionStatement? descriptionStatement? valueStatement?
+                   | statusStatement? descriptionStatement? valueStatement? descriptionStatement?
+                   | statusStatement? referenceStatement? valueStatement? descriptionStatement?
+                   | statusStatement? referenceStatement? descriptionStatement? valueStatement?
+                   | descriptionStatement? valueStatement? statusStatement? referenceStatement?
+                   | descriptionStatement? valueStatement? referenceStatement? statusStatement?
+                   | descriptionStatement? statusStatement? valueStatement? referenceStatement?
+                   | descriptionStatement? statusStatement? referenceStatement? valueStatement?
+                   | descriptionStatement? referenceStatement? valueStatement? statusStatement?
+                   | descriptionStatement? referenceStatement? statusStatement? valueStatement?
+                   | referenceStatement? valueStatement? descriptionStatement? statusStatement?
+                   | referenceStatement? valueStatement? statusStatement? descriptionStatement?
+                   | referenceStatement? statusStatement? descriptionStatement? valueStatement?
+                   | referenceStatement? statusStatement? valueStatement? descriptionStatement?
+                   | referenceStatement? descriptionStatement? valueStatement? statusStatement?
+                   | referenceStatement? descriptionStatement? statusStatement? valueStatement?
+                   ;
+
+    /**
+     *  leafref-specification =
+     *                        ;; these stmts can appear in any order
+     *                        path-stmt stmtsep
+     *                        [require-instance-stmt stmtsep]
+     */
+    leafrefSpecification : (pathStatement (requireInstanceStatement)?) | ((requireInstanceStatement)? pathStatement);
+
+    /**
+     *  path-stmt           = path-keyword sep path-arg-str stmtend
+     */
+    pathStatement : PATH_KEYWORD path STMTEND;
+
+    /**
+     *  require-instance-stmt = require-instance-keyword sep
+     *                           require-instance-arg-str stmtend
+     *  require-instance-arg-str = < a string that matches the rule
+     *                             require-instance-arg >
+     *  require-instance-arg = true-keyword / false-keyword
+     */
+    requireInstanceStatement : REQUIRE_INSTANCE_KEYWORD requireInstance STMTEND;
+
+    /**
+     *  instance-identifier-specification =
+     *                        [require-instance-stmt stmtsep]
+     */
+    instanceIdentifierSpecification : requireInstanceStatement?;
+
+    /**
+     * identityref-specification =
+     *                        base-stmt stmtsep
+     */
+    identityrefSpecification : baseStatement;
+
+    /**
+     *  union-specification = 1*(type-stmt stmtsep)
+     */
+    unionSpecification : typeStatement+;
+
+    /**
+     *  bits-specification  = 1*(bit-stmt stmtsep)
+     */
+    bitsSpecification : bitStatement+;
+
+    /**
+     * bit-stmt            = bit-keyword sep identifier-arg-str optsep
+     *                       (";" /
+     *                        "{" stmtsep
+     *                            ;; these stmts can appear in any order
+     *                            [position-stmt stmtsep]
+     *                            [status-stmt stmtsep]
+     *                            [description-stmt stmtsep]
+     *                            [reference-stmt stmtsep]
+     *                          "}"
+     *                        "}")
+     */
+    bitStatement : BIT_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE bitBodyStatement RIGHT_CURLY_BRACE);
+
+    bitBodyStatement : positionStatement? statusStatement? descriptionStatement? referenceStatement?
+                  | positionStatement? statusStatement? referenceStatement? descriptionStatement?
+                  | positionStatement? descriptionStatement? statusStatement? referenceStatement?
+                  | positionStatement? descriptionStatement? referenceStatement? statusStatement?
+                  | positionStatement? referenceStatement? statusStatement? descriptionStatement?
+                  | positionStatement? referenceStatement? descriptionStatement? statusStatement?
+                  | statusStatement? positionStatement? descriptionStatement? referenceStatement?
+                  | statusStatement? positionStatement? referenceStatement? descriptionStatement?
+                  | statusStatement? descriptionStatement? descriptionStatement? positionStatement?
+                  | statusStatement? descriptionStatement? positionStatement? descriptionStatement?
+                  | statusStatement? referenceStatement? positionStatement? descriptionStatement?
+                  | statusStatement? referenceStatement? descriptionStatement? positionStatement?
+                  | descriptionStatement? positionStatement? statusStatement? referenceStatement?
+                  | descriptionStatement? positionStatement? referenceStatement? statusStatement?
+                  | descriptionStatement? statusStatement? positionStatement? referenceStatement?
+                  | descriptionStatement? statusStatement? referenceStatement? positionStatement?
+                  | descriptionStatement? referenceStatement? positionStatement? statusStatement?
+                  | descriptionStatement? referenceStatement? statusStatement? positionStatement?
+                  | referenceStatement? positionStatement? descriptionStatement? statusStatement?
+                  | referenceStatement? positionStatement? statusStatement? descriptionStatement?
+                  | referenceStatement? statusStatement? descriptionStatement? positionStatement?
+                  | referenceStatement? statusStatement? positionStatement? descriptionStatement?
+                  | referenceStatement? descriptionStatement? positionStatement? statusStatement?
+                  | referenceStatement? descriptionStatement? statusStatement? positionStatement?
+                  ;
+
+    /**
+     *  position-stmt       = position-keyword sep
+     *                        position-value-arg-str stmtend
+     *  position-value-arg-str = < a string that matches the rule
+     *                              position-value-arg >
+     *  position-value-arg  = non-negative-integer-value
+     */
+    positionStatement : POSITION_KEYWORD position STMTEND;
+
+    /**
+     *  status-stmt         = status-keyword sep status-arg-str stmtend
+     *  status-arg-str      = < a string that matches the rule
+     *                         status-arg >
+     *  status-arg          = current-keyword /
+     *                        obsolete-keyword /
+     *                        deprecated-keyword
+     */
+    statusStatement : STATUS_KEYWORD status STMTEND;
+
+    /**
+     *  config-stmt         = config-keyword sep
+     *                        config-arg-str stmtend
+     *  config-arg-str      = < a string that matches the rule
+     *                          config-arg >
+     *  config-arg          = true-keyword / false-keyword
+     */
+    configStatement : CONFIG_KEYWORD config STMTEND;
+
+    /**
+     *  mandatory-stmt      = mandatory-keyword sep
+     *                        mandatory-arg-str stmtend
+     *
+     *  mandatory-arg-str   = < a string that matches the rule
+     *                          mandatory-arg >
+     *
+     *  mandatory-arg       = true-keyword / false-keyword
+     */
+    mandatoryStatement : MANDATORY_KEYWORD mandatory STMTEND;
+
+    /**
+     *  presence-stmt       = presence-keyword sep string stmtend
+     */
+    presenceStatement : PRESENCE_KEYWORD string STMTEND;
+
+    /**
+     *  ordered-by-stmt     = ordered-by-keyword sep
+     *                        ordered-by-arg-str stmtend
+     *
+     *  ordered-by-arg-str  = < a string that matches the rule
+     *                          ordered-by-arg >
+     *
+     *  ordered-by-arg      = user-keyword / system-keyword
+     */
+    orderedByStatement : ORDERED_BY_KEYWORD orderedBy STMTEND;
+
+    /**
+     *  must-stmt           = must-keyword sep string optsep
+     *                        (";" /
+     *                         "{" stmtsep
+     *                             ;; these stmts can appear in any order
+     *                             [error-message-stmt stmtsep]
+     *                             [error-app-tag-stmt stmtsep]
+     *                             [description-stmt stmtsep]
+     *                             [reference-stmt stmtsep]
+     *                          "}")
+     */
+    mustStatement : MUST_KEYWORD string (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE);
+
+    /**
+     *   error-message-stmt  = error-message-keyword sep string stmtend
+     */
+    errorMessageStatement : ERROR_MESSAGE_KEYWORD string STMTEND;
+
+    /**
+     *  error-app-tag-stmt  = error-app-tag-keyword sep string stmtend
+     */
+    errorAppTagStatement : ERROR_APP_TAG_KEYWORD string STMTEND;
+
+    /**
+     *  min-elements-stmt   = min-elements-keyword sep
+     *                        min-value-arg-str stmtend
+     *  min-value-arg-str   = < a string that matches the rule
+     *                          min-value-arg >
+     *  min-value-arg       = non-negative-integer-value
+     */
+    minElementsStatement : MIN_ELEMENTS_KEYWORD minValue STMTEND;
+
+    /**
+     *  max-elements-stmt   = max-elements-keyword sep
+     *                        max-value-arg-str stmtend
+     *  max-value-arg-str   = < a string that matches the rule
+     *                          max-value-arg >
+     *  max-value-arg       = unbounded-keyword /
+     *                        positive-integer-value
+     */
+    maxElementsStatement :  MAX_ELEMENTS_KEYWORD maxValue STMTEND;
+
+    /**
+     *  value-stmt          = value-keyword sep integer-value stmtend
+     */
+    valueStatement : VALUE_KEYWORD value STMTEND;
+
+    /**
+     *   grouping-stmt       = grouping-keyword sep identifier-arg-str optsep
+     *                        (";" /
+     *                         "{" stmtsep
+     *                            ;; these stmts can appear in any order
+     *                            [status-stmt stmtsep]
+     *                             [description-stmt stmtsep]
+     *                             [reference-stmt stmtsep]
+     *                             *((typedef-stmt /
+     *                                grouping-stmt) stmtsep)
+     *                             *(data-def-stmt stmtsep)
+     *                         "}")
+     * TODO : 0..1 occurance to be checked in listener
+     */
+    groupingStatement : GROUPING_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE
+                      (statusStatement | descriptionStatement | referenceStatement | typedefStatement | groupingStatement
+                       | dataDefStatement)* RIGHT_CURLY_BRACE);
+
+    /**
+     *  container-stmt      = container-keyword sep identifier-arg-str optsep
+     *                        (";" /
+     *                         "{" stmtsep
+     *                             ;; these stmts can appear in any order
+     *                             [when-stmt stmtsep]
+     *                             *(if-feature-stmt stmtsep)
+     *                             *(must-stmt stmtsep)
+     *                             [presence-stmt stmtsep]
+     *                             [config-stmt stmtsep]
+     *                             [status-stmt stmtsep]
+     *                             [description-stmt stmtsep]
+     *                             [reference-stmt stmtsep]
+     *                             *((typedef-stmt /
+     *                                grouping-stmt) stmtsep)
+     *                             *(data-def-stmt stmtsep)
+     *                         "}")
+     * TODO : 0..1 occurance to be checked in listener
+     */
+    containerStatement : CONTAINER_KEYWORD identifier
+                     (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | mustStatement | presenceStatement | configStatement
+                     | statusStatement | descriptionStatement | referenceStatement | typedefStatement | groupingStatement
+                     | dataDefStatement)* RIGHT_CURLY_BRACE);
+
+    /**
+     *  leaf-stmt           = leaf-keyword sep identifier-arg-str optsep
+     *                        "{" stmtsep
+     *                            ;; these stmts can appear in any order
+     *                            [when-stmt stmtsep]
+     *                            *(if-feature-stmt stmtsep)
+     *                            type-stmt stmtsep
+     *                            [units-stmt stmtsep]
+     *                            *(must-stmt stmtsep)
+     *                            [default-stmt stmtsep]
+     *                            [config-stmt stmtsep]
+     *                            [mandatory-stmt stmtsep]
+     *                            [status-stmt stmtsep]
+     *                            [description-stmt stmtsep]
+     *                            [reference-stmt stmtsep]
+     *                         "}"
+     * TODO : 0..1 occurance to be checked in listener
+     */
+    leafStatement : LEAF_KEYWORD identifier LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | typeStatement | unitsStatement
+              | mustStatement | defaultStatement | configStatement | mandatoryStatement | statusStatement  | descriptionStatement
+              | referenceStatement)* RIGHT_CURLY_BRACE;
+
+    /**
+     *  leaf-list-stmt      = leaf-list-keyword sep identifier-arg-str optsep
+     *                        "{" stmtsep
+     *                            ;; these stmts can appear in any order
+     *                            [when-stmt stmtsep]
+     *                            *(if-feature-stmt stmtsep)
+     *                            type-stmt stmtsep
+     *                            [units-stmt stmtsep]
+     *                            *(must-stmt stmtsep)
+     *                            [config-stmt stmtsep]
+     *                            [min-elements-stmt stmtsep]
+     *                            [max-elements-stmt stmtsep]
+     *                            [ordered-by-stmt stmtsep]
+     *                            [status-stmt stmtsep]
+     *                            [description-stmt stmtsep]
+     *                            [reference-stmt stmtsep]
+     *                         "}"
+     * TODO : 0..1 occurance to be checked in listener
+     */
+    leafListStatement : LEAF_LIST_KEYWORD identifier LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | typeStatement
+                     | unitsStatement | mustStatement | configStatement | minElementsStatement | maxElementsStatement | orderedByStatement
+                     | statusStatement | descriptionStatement | referenceStatement)* RIGHT_CURLY_BRACE;
+
+    /**
+     *  list-stmt           = list-keyword sep identifier-arg-str optsep
+     *                        "{" stmtsep
+     *                            ;; these stmts can appear in any order
+     *                            [when-stmt stmtsep]
+     *                            *(if-feature-stmt stmtsep)
+     *                            *(must-stmt stmtsep)
+     *                            [key-stmt stmtsep]
+     *                            *(unique-stmt stmtsep)
+     *                            [config-stmt stmtsep]
+     *                            [min-elements-stmt stmtsep]
+     *                            [max-elements-stmt stmtsep]
+     *                            [ordered-by-stmt stmtsep]
+     *                            [status-stmt stmtsep]
+     *                            [description-stmt stmtsep]
+     *                            [reference-stmt stmtsep]
+     *                            *((typedef-stmt /
+     *                               grouping-stmt) stmtsep)
+     *                            1*(data-def-stmt stmtsep)
+     *                         "}"
+     * TODO : 0..1 occurance to be checked in listener
+     */
+    listStatement : LIST_KEYWORD identifier LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | mustStatement | keyStatement
+              | uniqueStatement | configStatement | minElementsStatement | maxElementsStatement | orderedByStatement | statusStatement
+              | descriptionStatement | referenceStatement | typedefStatement | groupingStatement| dataDefStatement)* RIGHT_CURLY_BRACE;
+
+    /**
+     *  key-stmt            = key-keyword sep key-arg-str stmtend
+     */
+    keyStatement : KEY_KEYWORD key STMTEND;
+
+    /**
+     *  unique-stmt         = unique-keyword sep unique-arg-str stmtend
+     */
+    uniqueStatement: UNIQUE_KEYWORD unique STMTEND;
+
+    /**
+     *  choice-stmt         = choice-keyword sep identifier-arg-str optsep
+     *                        (";" /
+     *                         "{" stmtsep
+     *                             ;; these stmts can appear in any order
+     *                             [when-stmt stmtsep]
+     *                             *(if-feature-stmt stmtsep)
+     *                             [default-stmt stmtsep]
+     *                             [config-stmt stmtsep]
+     *                             [mandatory-stmt stmtsep]
+     *                             [status-stmt stmtsep]
+     *                             [description-stmt stmtsep]
+     *                             [reference-stmt stmtsep]
+     *                             *((short-case-stmt / case-stmt) stmtsep)
+     *                         "}")
+     * TODO : 0..1 occurance to be checked in listener
+     */
+    choiceStatement : CHOICE_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | defaultStatement
+                  | configStatement | mandatoryStatement | statusStatement | descriptionStatement | referenceStatement | shortCaseStatement
+                  | caseStatement)* RIGHT_CURLY_BRACE);
+
+    /**
+     *  short-case-stmt     = container-stmt /
+     *                        leaf-stmt /
+     *                        leaf-list-stmt /
+     *                        list-stmt /
+     *                        anyxml-stmt
+     */
+    shortCaseStatement : containerStatement | leafStatement | leafListStatement | listStatement | anyxmlStatement;
+
+    /**
+     *  case-stmt           = case-keyword sep identifier-arg-str optsep
+     *                        (";" /
+     *                         "{" stmtsep
+     *                             ;; these stmts can appear in any order
+     *                             [when-stmt stmtsep]
+     *                             *(if-feature-stmt stmtsep)
+     *                             [status-stmt stmtsep]
+     *                             [description-stmt stmtsep]
+     *                             [reference-stmt stmtsep]
+     *                             *(data-def-stmt stmtsep)
+     *                         "}")
+     * TODO : 0..1 occurance to be checked in listener
+     */
+    caseStatement : CASE_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | statusStatement
+              | descriptionStatement | referenceStatement | dataDefStatement)* RIGHT_CURLY_BRACE);
+
+    /**
+     *    anyxml-stmt         = anyxml-keyword sep identifier-arg-str optsep
+     *                         (";" /
+     *                         "{" stmtsep
+     *                             ;; these stmts can appear in any order
+     *                             [when-stmt stmtsep]
+     *                             *(if-feature-stmt stmtsep)
+     *                             *(must-stmt stmtsep)
+     *                             [config-stmt stmtsep]
+     *                             [mandatory-stmt stmtsep]
+     *                             [status-stmt stmtsep]
+     *                             [description-stmt stmtsep]
+     *                             [reference-stmt stmtsep]
+     *                          "}")
+     */
+     anyxmlStatement : ANYXML_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement
+                     | mustStatement | configStatement | mandatoryStatement | statusStatement | descriptionStatement
+                     | referenceStatement)* RIGHT_CURLY_BRACE);
+
+    /**
+     *  uses-stmt           = uses-keyword sep identifier-ref-arg-str optsep
+     *                        (";" /
+     *                         "{" stmtsep
+     *                             ;; these stmts can appear in any order
+     *                             [when-stmt stmtsep]
+     *                             *(if-feature-stmt stmtsep)
+     *                             [status-stmt stmtsep]
+     *                             [description-stmt stmtsep]
+     *                             [reference-stmt stmtsep]
+     *                             *(refine-stmt stmtsep)
+     *                             *(uses-augment-stmt stmtsep)
+     *                         "}")
+     * TODO : 0..1 occurance to be checked in listener
+     */
+    usesStatement : USES_KEYWORD string (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | statusStatement
+                | descriptionStatement | referenceStatement | refineStatement | augmentStatement)* RIGHT_CURLY_BRACE);
+
+    /**
+     *  refine-stmt         = refine-keyword sep refine-arg-str optsep
+     *                        (";" /
+     *                         "{" stmtsep
+     *                             (refine-container-stmts /
+     *                              refine-leaf-stmts /
+     *                              refine-leaf-list-stmts /
+     *                              refine-list-stmts /
+     *                              refine-choice-stmts /
+     *                              refine-case-stmts /
+     *                              refine-anyxml-stmts)
+     *                         "}")
+     */
+    refineStatement : REFINE_KEYWORD refine (STMTEND  | LEFT_CURLY_BRACE (refineContainerStatements
+                    | refineLeafStatements | refineLeafListStatements | refineListStatements | refineChoiceStatements
+                    | refineCaseStatements | refineAnyxmlStatements) RIGHT_CURLY_BRACE);
+
+    /**
+     *  refine-container-stmts =
+     *                        ;; these stmts can appear in any order
+     *                        *(must-stmt stmtsep)
+     *                        [presence-stmt stmtsep]
+     *                        [config-stmt stmtsep]
+     *                        [description-stmt stmtsep]
+     *                         [reference-stmt stmtsep]
+     * TODO : 0..1 occurance to be checked in listener
+     */
+    refineContainerStatements : (mustStatement | presenceStatement | configStatement | descriptionStatement | referenceStatement)* ;
+
+    /**
+     *   refine-leaf-stmts   = ;; these stmts can appear in any order
+     *                         *(must-stmt stmtsep)
+     *                         [default-stmt stmtsep]
+     *                         [config-stmt stmtsep]
+     *                        [mandatory-stmt stmtsep]
+     *                        [description-stmt stmtsep]
+     *                        [reference-stmt stmtsep]
+     * TODO : 0..1 occurance to be checked in listener
+     */
+    refineLeafStatements : (mustStatement | defaultStatement | configStatement | mandatoryStatement | descriptionStatement | referenceStatement)*;
+
+    /**
+     *  refine-leaf-list-stmts =
+     *                        ;; these stmts can appear in any order
+     *                        *(must-stmt stmtsep)
+     *                        [config-stmt stmtsep]
+     *                        [min-elements-stmt stmtsep]
+     *                        [max-elements-stmt stmtsep]
+     *                        [description-stmt stmtsep]
+     *                        [reference-stmt stmtsep]
+     * TODO : 0..1 occurance to be checked in listener
+     */
+    refineLeafListStatements : (mustStatement | configStatement | minElementsStatement | maxElementsStatement | descriptionStatement
+                             | referenceStatement)*;
+
+    /**
+     *  refine-list-stmts   = ;; these stmts can appear in any order
+     *                        *(must-stmt stmtsep)
+     *                        [config-stmt stmtsep]
+     *                        [min-elements-stmt stmtsep]
+     *                        [max-elements-stmt stmtsep]
+     *                        [description-stmt stmtsep]
+     *                        [reference-stmt stmtsep]
+     * TODO : 0..1 occurance to be checked in listener
+     */
+    refineListStatements : (mustStatement | configStatement | minElementsStatement | maxElementsStatement | descriptionStatement
+                        | referenceStatement)*;
+
+    /**
+     *  refine-choice-stmts = ;; these stmts can appear in any order
+     *                        [default-stmt stmtsep]
+     *                        [config-stmt stmtsep]
+     *                        [mandatory-stmt stmtsep]
+     *                        [description-stmt stmtsep]
+     *                        [reference-stmt stmtsep]
+     * TODO : 0..1 occurance to be checked in listener
+     */
+    refineChoiceStatements : (defaultStatement | configStatement | mandatoryStatement | descriptionStatement | referenceStatement)*;
+
+    /**
+     *  refine-case-stmts   = ;; these stmts can appear in any order
+     *                        [description-stmt stmtsep]
+     *                        [reference-stmt stmtsep]
+     *
+     */
+    refineCaseStatements : (descriptionStatement | referenceStatement)? | (referenceStatement | descriptionStatement)?;
+
+    /**
+     *  refine-anyxml-stmts = ;; these stmts can appear in any order
+     *                        *(must-stmt stmtsep)
+     *                        [config-stmt stmtsep]
+     *                        [mandatory-stmt stmtsep]
+     *                        [description-stmt stmtsep]
+     *                        [reference-stmt stmtsep]
+     */
+     refineAnyxmlStatements : (mustStatement | configStatement | mandatoryStatement | descriptionStatement
+                            | referenceStatement)*;
+
+    /**
+     *  augment-stmt        = augment-keyword sep augment-arg-str optsep
+     *                        "{" stmtsep
+     *                            ;; these stmts can appear in any order
+     *                            [when-stmt stmtsep]
+     *                            *(if-feature-stmt stmtsep)
+     *                            [status-stmt stmtsep]
+     *                            [description-stmt stmtsep]
+     *                            [reference-stmt stmtsep]
+     *                            1*((data-def-stmt stmtsep) /
+     *                               (case-stmt stmtsep))
+     *                         "}"
+     * TODO : 0..1 occurance to be checked in listener
+     */
+    augmentStatement : AUGMENT_KEYWORD augment LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | statusStatement
+                   | descriptionStatement | referenceStatement | dataDefStatement  | caseStatement)* RIGHT_CURLY_BRACE;
+
+    /**
+     *  when-stmt           = when-keyword sep string optsep
+     *                        (";" /
+     *                         "{" stmtsep
+     *                             ;; these stmts can appear in any order
+     *                             [description-stmt stmtsep]
+     *                             [reference-stmt stmtsep]
+     *                          "}")
+     *
+     */
+    whenStatement : WHEN_KEYWORD string (STMTEND | LEFT_CURLY_BRACE ((descriptionStatement? referenceStatement?)
+                       | (referenceStatement? descriptionStatement?)) RIGHT_CURLY_BRACE);
+
+    /**
+     *  rpc-stmt            = rpc-keyword sep identifier-arg-str optsep
+     *                        (";" /
+     *                         "{" stmtsep
+     *                             ;; these stmts can appear in any order
+     *                             *(if-feature-stmt stmtsep)
+     *                             [status-stmt stmtsep]
+     *                             [description-stmt stmtsep]
+     *                             [reference-stmt stmtsep]
+     *                             *((typedef-stmt /
+     *                                grouping-stmt) stmtsep)
+     *                             [input-stmt stmtsep]
+     *                             [output-stmt stmtsep]
+     *                         "}")
+     */
+    rpcStatement : RPC_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (ifFeatureStatement | statusStatement | descriptionStatement
+                | referenceStatement | typedefStatement | groupingStatement | inputStatement | outputStatement)* RIGHT_CURLY_BRACE);
+
+    /**
+     * input-stmt          = input-keyword optsep
+     *                       "{" stmtsep
+     *                           ;; these stmts can appear in any order
+     *                           *((typedef-stmt /
+     *                              grouping-stmt) stmtsep)
+     *                           1*(data-def-stmt stmtsep)
+     *                         "}"
+     */
+    inputStatement : INPUT_KEYWORD LEFT_CURLY_BRACE (typedefStatement | groupingStatement | dataDefStatement)* RIGHT_CURLY_BRACE;
+
+    /**
+     *  output-stmt         = output-keyword optsep
+     *                        "{" stmtsep
+     *                            ;; these stmts can appear in any order
+     *                            *((typedef-stmt /
+     *                               grouping-stmt) stmtsep)
+     *                            1*(data-def-stmt stmtsep)
+     *                        "}"
+     */
+    outputStatement : OUTPUT_KEYWORD LEFT_CURLY_BRACE (typedefStatement | groupingStatement | dataDefStatement)* RIGHT_CURLY_BRACE;
+
+    /**
+     *  notification-stmt   = notification-keyword sep
+     *                        identifier-arg-str optsep
+     *                        (";" /
+     *                         "{" stmtsep
+     *                             ;; these stmts can appear in any order
+     *                             *(if-feature-stmt stmtsep)
+     *                             [status-stmt stmtsep]
+     *                             [description-stmt stmtsep]
+     *                             [reference-stmt stmtsep]
+     *                             *((typedef-stmt /
+     *                                grouping-stmt) stmtsep)
+     *                             *(data-def-stmt stmtsep)
+     *                         "}")
+     * TODO : 0..1 occurance to be checked in listener
+     */
+     notificationStatement : NOTIFICATION_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (ifFeatureStatement
+                           | statusStatement | descriptionStatement | referenceStatement | typedefStatement
+                           | groupingStatement | dataDefStatement)* RIGHT_CURLY_BRACE);
+
+    /**
+     *  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))
+     *                        "}"
+     * TODO : 0..1 occurance to be checked in listener
+     */
+    deviationStatement: DEVIATION_KEYWORD deviation LEFT_CURLY_BRACE (descriptionStatement | referenceStatement
+                      | deviateNotSupportedStatement | deviateAddStatement | deviateReplaceStatement
+                      | deviateDeleteStatement)* RIGHT_CURLY_BRACE;
+
+    /**
+     * deviate-not-supported-stmt =
+     *                       deviate-keyword sep
+     *                       not-supported-keyword optsep
+     *                       (";" /
+     *                        "{" stmtsep
+     *                        "}")
+     */
+    deviateNotSupportedStatement: DEVIATE_KEYWORD NOT_SUPPORTED_KEYWORD (STMTEND | LEFT_CURLY_BRACE RIGHT_CURLY_BRACE);
+
+    /**
+     *  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]
+     *                         "}")
+     */
+    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
+     *                        (";" /
+     *                         "{" stmtsep
+     *                             [units-stmt stmtsep]
+     *                             *(must-stmt stmtsep)
+     *                             *(unique-stmt stmtsep)
+     *                               [default-stmt stmtsep]
+     *                           "}")
+     */
+    deviateDeleteStatement: DEVIATE_KEYWORD DELETE_KEYWORD (STMTEND
+                       | (LEFT_CURLY_BRACE  unitsStatement? mustStatement* uniqueStatement* defaultStatement? RIGHT_CURLY_BRACE));
+
+    /**
+     *   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]
+     *                          "}")
+     */
+    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
+     *                          "{"
+     *                              [app-data-structure-stmt stmtsep]
+     *                              [app-extended-stmt stmtsep]
+     *                          "}"
+     */
+    compilerAnnotationStatement : COMPILER_ANNOTATION string LEFT_CURLY_BRACE
+                                       compilerAnnotationBodyStatement RIGHT_CURLY_BRACE;
+
+    compilerAnnotationBodyStatement : appDataStructureStatement? appExtendedStatement? ;
+
+    /**
+     *   app-data-structure-stmt = prefix:app-data-structure-keyword string
+     *                         (";" /
+     *                          "{"
+     *                              [data-structure-key-stmt stmtsep]
+     *                          "}")
+     */
+    appDataStructureStatement : APP_DATA_STRUCTURE appDataStructure (STMTEND | (LEFT_CURLY_BRACE
+                  dataStructureKeyStatement? RIGHT_CURLY_BRACE));
+
+    /**
+     *   data-structure-key-stmt = prefix:key-keyword string ";"
+     */
+    dataStructureKeyStatement : DATA_STRUCTURE_KEY string STMTEND;
+
+    /**
+     *   app-extended-stmt = prefix:app-extended-name-keyword string ";"
+     */
+    appExtendedStatement : APP_EXTENDED extendedName STMTEND;
+
+    string : STRING (PLUS STRING)*
+           | IDENTIFIER
+           | INTEGER
+           | yangConstruct;
+
+    identifier : STRING (PLUS STRING)*
+               | IDENTIFIER
+               | yangConstruct;
+
+    dateArgumentString : DATE_ARG
+                       | STRING (PLUS STRING)*;
+
+    version : string;
+
+    range : string;
+
+    length : string;
+
+    path : string;
+
+    position : string;
+
+    status : string;
+
+    config : string;
+
+    mandatory : string;
+
+    orderedBy : string;
+
+    minValue : string;
+
+    maxValue : string;
+
+    key : string;
+
+    unique : string;
+
+    refine : string;
+
+    requireInstance : string;
+
+    augment : string;
+
+    deviation : string;
+
+    value : string;
+
+    fraction : string;
+
+    appDataStructure : string;
+
+    extendedName : string;
+
+    yangConstruct : ANYXML_KEYWORD | ARGUMENT_KEYWORD | AUGMENT_KEYWORD | BASE_KEYWORD | BELONGS_TO_KEYWORD
+                  | BIT_KEYWORD | CASE_KEYWORD | CHOICE_KEYWORD | CONFIG_KEYWORD | CONTACT_KEYWORD | CONTAINER_KEYWORD
+                  | DEFAULT_KEYWORD | DESCRIPTION_KEYWORD | ENUM_KEYWORD | ERROR_APP_TAG_KEYWORD | ERROR_MESSAGE_KEYWORD
+                  | EXTENSION_KEYWORD | DEVIATION_KEYWORD | DEVIATE_KEYWORD | FEATURE_KEYWORD
+                  | FRACTION_DIGITS_KEYWORD | GROUPING_KEYWORD | IDENTITY_KEYWORD | IF_FEATURE_KEYWORD
+                  | IMPORT_KEYWORD | INCLUDE_KEYWORD | INPUT_KEYWORD | KEY_KEYWORD | LEAF_KEYWORD | LEAF_LIST_KEYWORD
+                  | LENGTH_KEYWORD | LIST_KEYWORD | MANDATORY_KEYWORD | MAX_ELEMENTS_KEYWORD | MIN_ELEMENTS_KEYWORD
+                  | MODULE_KEYWORD | MUST_KEYWORD | NAMESPACE_KEYWORD | NOTIFICATION_KEYWORD | ORDERED_BY_KEYWORD
+                  | ORGANIZATION_KEYWORD | OUTPUT_KEYWORD | PATH_KEYWORD | PATTERN_KEYWORD | POSITION_KEYWORD
+                  | PREFIX_KEYWORD | PRESENCE_KEYWORD | RANGE_KEYWORD | REFERENCE_KEYWORD | REFINE_KEYWORD
+                  | REQUIRE_INSTANCE_KEYWORD | REVISION_KEYWORD | REVISION_DATE_KEYWORD | RPC_KEYWORD
+                  | STATUS_KEYWORD | SUBMODULE_KEYWORD | TYPE_KEYWORD | TYPEDEF_KEYWORD | UNIQUE_KEYWORD
+                  | UNITS_KEYWORD | USES_KEYWORD | VALUE_KEYWORD | WHEN_KEYWORD | YANG_VERSION_KEYWORD
+                  | YIN_ELEMENT_KEYWORD | ADD_KEYWORD | CURRENT_KEYWORD | DELETE_KEYWORD | DEPRECATED_KEYWORD
+                  | FALSE_KEYWORD | MAX_KEYWORD | MIN_KEYWORD | NOT_SUPPORTED_KEYWORD | OBSOLETE_KEYWORD
+                  | REPLACE_KEYWORD | SYSTEM_KEYWORD | TRUE_KEYWORD | UNBOUNDED_KEYWORD | USER_KEYWORD
+                  | COMPILER_ANNOTATION_KEYWORD | APP_DATA_STRUCTURE_KEYWORD | DATA_STRUCTURE_KEYWORD
+                  | APP_EXTENDED_KEYWORD;
diff --git a/compiler/base/parser/src/main/resources/YangLexer.g4 b/compiler/base/parser/src/main/resources/YangLexer.g4
new file mode 100644
index 0000000..51a9231
--- /dev/null
+++ b/compiler/base/parser/src/main/resources/YangLexer.g4
@@ -0,0 +1,146 @@
+/*
+ * 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.
+ */
+
+/**
+ * This is a YANG grammar for lexer based on which ANTLR will generate YANG lexer.
+ */
+
+lexer grammar YangLexer;
+
+    // Statements keywords
+    ANYXML_KEYWORD      : 'anyxml';
+    ARGUMENT_KEYWORD    : 'argument';
+    AUGMENT_KEYWORD     : 'augment';
+    BASE_KEYWORD        : 'base';
+    BELONGS_TO_KEYWORD  : 'belongs-to';
+    BIT_KEYWORD         : 'bit';
+    CASE_KEYWORD        : 'case';
+    CHOICE_KEYWORD      : 'choice';
+    CONFIG_KEYWORD      : 'config';
+    CONTACT_KEYWORD     : 'contact';
+    CONTAINER_KEYWORD   : 'container';
+    DEFAULT_KEYWORD     : 'default';
+    DESCRIPTION_KEYWORD : 'description';
+    ENUM_KEYWORD        : 'enum';
+    ERROR_APP_TAG_KEYWORD : 'error-app-tag';
+    ERROR_MESSAGE_KEYWORD : 'error-message';
+    EXTENSION_KEYWORD   : 'extension';
+    DEVIATION_KEYWORD   : 'deviation';
+    DEVIATE_KEYWORD     : 'deviate';
+    FEATURE_KEYWORD     : 'feature';
+    FRACTION_DIGITS_KEYWORD : 'fraction-digits';
+    GROUPING_KEYWORD    : 'grouping';
+    IDENTITY_KEYWORD    : 'identity';
+    IF_FEATURE_KEYWORD  : 'if-feature';
+    IMPORT_KEYWORD      : 'import';
+    INCLUDE_KEYWORD     : 'include';
+    INPUT_KEYWORD       : 'input';
+    KEY_KEYWORD         : 'key';
+    LEAF_KEYWORD        : 'leaf';
+    LEAF_LIST_KEYWORD   : 'leaf-list';
+    LENGTH_KEYWORD      : 'length';
+    LIST_KEYWORD        : 'list';
+    MANDATORY_KEYWORD   : 'mandatory';
+    MAX_ELEMENTS_KEYWORD : 'max-elements';
+    MIN_ELEMENTS_KEYWORD : 'min-elements';
+    MODULE_KEYWORD      : 'module';
+    MUST_KEYWORD        : 'must';
+    NAMESPACE_KEYWORD   : 'namespace';
+    NOTIFICATION_KEYWORD: 'notification';
+    ORDERED_BY_KEYWORD  : 'ordered-by';
+    ORGANIZATION_KEYWORD: 'organization';
+    OUTPUT_KEYWORD      : 'output';
+    PATH_KEYWORD        : 'path';
+    PATTERN_KEYWORD     : 'pattern';
+    POSITION_KEYWORD    : 'position';
+    PREFIX_KEYWORD      : 'prefix';
+    PRESENCE_KEYWORD    : 'presence';
+    RANGE_KEYWORD       : 'range';
+    REFERENCE_KEYWORD   : 'reference';
+    REFINE_KEYWORD      : 'refine';
+    REQUIRE_INSTANCE_KEYWORD : 'require-instance';
+    REVISION_KEYWORD    : 'revision';
+    REVISION_DATE_KEYWORD : 'revision-date';
+    RPC_KEYWORD         : 'rpc';
+    STATUS_KEYWORD      : 'status';
+    SUBMODULE_KEYWORD   : 'submodule';
+    TYPE_KEYWORD        : 'type';
+    TYPEDEF_KEYWORD     : 'typedef';
+    UNIQUE_KEYWORD      : 'unique';
+    UNITS_KEYWORD       : 'units';
+    USES_KEYWORD        : 'uses';
+    VALUE_KEYWORD       : 'value';
+    WHEN_KEYWORD        : 'when';
+    YANG_VERSION_KEYWORD: 'yang-version';
+    YIN_ELEMENT_KEYWORD : 'yin-element';
+    ADD_KEYWORD         : 'add';
+    CURRENT_KEYWORD     : 'current';
+    DELETE_KEYWORD      : 'delete';
+    DEPRECATED_KEYWORD  : 'deprecated';
+    FALSE_KEYWORD       : 'false';
+    MAX_KEYWORD         : 'max';
+    MIN_KEYWORD         : 'min';
+    NOT_SUPPORTED_KEYWORD : 'not-supported';
+    OBSOLETE_KEYWORD    : 'obsolete';
+    REPLACE_KEYWORD     : 'replace';
+    SYSTEM_KEYWORD      : 'system';
+    TRUE_KEYWORD        : 'true';
+    UNBOUNDED_KEYWORD   : 'unbounded';
+    USER_KEYWORD        : 'user';
+    COMPILER_ANNOTATION_KEYWORD : 'compiler-annotation';
+    COMPILER_ANNOTATION : IDENTIFIER COLON COMPILER_ANNOTATION_KEYWORD;
+    APP_DATA_STRUCTURE_KEYWORD : 'app-data-structure';
+    APP_DATA_STRUCTURE : IDENTIFIER COLON APP_DATA_STRUCTURE_KEYWORD;
+    DATA_STRUCTURE_KEYWORD : 'data-structure';
+    DATA_STRUCTURE : IDENTIFIER COLON DATA_STRUCTURE_KEYWORD;
+    DATA_STRUCTURE_KEY : IDENTIFIER COLON KEY_KEYWORD;
+    APP_EXTENDED_KEYWORD : 'app-extended-name';
+    APP_EXTENDED : IDENTIFIER COLON APP_EXTENDED_KEYWORD;
+
+    // Lexer tokens to be skipped
+    COMMENT
+        :   '/*' .*? '*/'    -> channel(HIDDEN)
+        ;
+    WS  :   [ \r\t\u000C\n]+ -> channel(HIDDEN)
+        ;
+    LINE_COMMENT
+        : '//' ~[\r\n]* '\r'? '\n' -> channel(HIDDEN)
+        ;
+
+    // Additional rules
+    INTEGER             : DIGIT+;
+    DATE_ARG            : DIGIT DIGIT DIGIT DIGIT '-' DIGIT DIGIT '-' DIGIT DIGIT;
+    LEFT_CURLY_BRACE    : '{';
+    RIGHT_CURLY_BRACE   : '}';
+    IDENTIFIER          : (ALPHA | '_')
+                          (ALPHA | DIGIT | '_' | '-' | '.')*;
+    STMTEND             : ';';
+    DQUOTE              : '"';
+    COLON               : ':';
+    PLUS : '+';
+    MINUS: '-';
+
+    STRING : ((~( '\r' | '\n' | '\t' | ' ' | ';' | '{' | '"' | '+' | '\'')~( '\r' | '\n' | '\t' | ' ' | ';' | '{' | '+')* ) | SUB_STRING );
+
+    //Fragment rules
+    fragment SUB_STRING : ('"' (ESC | ~["])*'"') | ('\'' (ESC | ~['])*'\'') ;
+    fragment ESC :  '\\' (["\\/bfnrt] | UNICODE) ;
+    fragment UNICODE : 'u' HEX HEX HEX HEX ;
+    fragment HEX : [0-9a-fA-F] ;
+    fragment ALPHA      : [A-Za-z];
+    fragment DIGIT      : [0-9];
+    fragment URN        : [u][r][n];
+    fragment HTTP       : [h][t][t][p];
\ No newline at end of file
diff --git a/compiler/base/parser/src/main/resources/YangLexer.tokens b/compiler/base/parser/src/main/resources/YangLexer.tokens
new file mode 100644
index 0000000..6111f71
--- /dev/null
+++ b/compiler/base/parser/src/main/resources/YangLexer.tokens
@@ -0,0 +1,192 @@
+ANYXML_KEYWORD=1
+ARGUMENT_KEYWORD=2
+AUGMENT_KEYWORD=3
+BASE_KEYWORD=4
+BELONGS_TO_KEYWORD=5
+BIT_KEYWORD=6
+CASE_KEYWORD=7
+CHOICE_KEYWORD=8
+CONFIG_KEYWORD=9
+CONTACT_KEYWORD=10
+CONTAINER_KEYWORD=11
+DEFAULT_KEYWORD=12
+DESCRIPTION_KEYWORD=13
+ENUM_KEYWORD=14
+ERROR_APP_TAG_KEYWORD=15
+ERROR_MESSAGE_KEYWORD=16
+EXTENSION_KEYWORD=17
+DEVIATION_KEYWORD=18
+DEVIATE_KEYWORD=19
+FEATURE_KEYWORD=20
+FRACTION_DIGITS_KEYWORD=21
+GROUPING_KEYWORD=22
+IDENTITY_KEYWORD=23
+IF_FEATURE_KEYWORD=24
+IMPORT_KEYWORD=25
+INCLUDE_KEYWORD=26
+INPUT_KEYWORD=27
+KEY_KEYWORD=28
+LEAF_KEYWORD=29
+LEAF_LIST_KEYWORD=30
+LENGTH_KEYWORD=31
+LIST_KEYWORD=32
+MANDATORY_KEYWORD=33
+MAX_ELEMENTS_KEYWORD=34
+MIN_ELEMENTS_KEYWORD=35
+MODULE_KEYWORD=36
+MUST_KEYWORD=37
+NAMESPACE_KEYWORD=38
+NOTIFICATION_KEYWORD=39
+ORDERED_BY_KEYWORD=40
+ORGANIZATION_KEYWORD=41
+OUTPUT_KEYWORD=42
+PATH_KEYWORD=43
+PATTERN_KEYWORD=44
+POSITION_KEYWORD=45
+PREFIX_KEYWORD=46
+PRESENCE_KEYWORD=47
+RANGE_KEYWORD=48
+REFERENCE_KEYWORD=49
+REFINE_KEYWORD=50
+REQUIRE_INSTANCE_KEYWORD=51
+REVISION_KEYWORD=52
+REVISION_DATE_KEYWORD=53
+RPC_KEYWORD=54
+STATUS_KEYWORD=55
+SUBMODULE_KEYWORD=56
+TYPE_KEYWORD=57
+TYPEDEF_KEYWORD=58
+UNIQUE_KEYWORD=59
+UNITS_KEYWORD=60
+USES_KEYWORD=61
+VALUE_KEYWORD=62
+WHEN_KEYWORD=63
+YANG_VERSION_KEYWORD=64
+YIN_ELEMENT_KEYWORD=65
+ADD_KEYWORD=66
+CURRENT_KEYWORD=67
+DELETE_KEYWORD=68
+DEPRECATED_KEYWORD=69
+FALSE_KEYWORD=70
+MAX_KEYWORD=71
+MIN_KEYWORD=72
+NOT_SUPPORTED_KEYWORD=73
+OBSOLETE_KEYWORD=74
+REPLACE_KEYWORD=75
+SYSTEM_KEYWORD=76
+TRUE_KEYWORD=77
+UNBOUNDED_KEYWORD=78
+USER_KEYWORD=79
+COMPILER_ANNOTATION_KEYWORD=80
+COMPILER_ANNOTATION=81
+APP_DATA_STRUCTURE_KEYWORD=82
+APP_DATA_STRUCTURE=83
+DATA_STRUCTURE_KEYWORD=84
+DATA_STRUCTURE=85
+DATA_STRUCTURE_KEY=86
+APP_EXTENDED_KEYWORD=87
+APP_EXTENDED=88
+COMMENT=89
+WS=90
+LINE_COMMENT=91
+INTEGER=92
+DATE_ARG=93
+LEFT_CURLY_BRACE=94
+RIGHT_CURLY_BRACE=95
+IDENTIFIER=96
+STMTEND=97
+DQUOTE=98
+COLON=99
+PLUS=100
+MINUS=101
+STRING=102
+'anyxml'=1
+'argument'=2
+'augment'=3
+'base'=4
+'belongs-to'=5
+'bit'=6
+'case'=7
+'choice'=8
+'config'=9
+'contact'=10
+'container'=11
+'default'=12
+'description'=13
+'enum'=14
+'error-app-tag'=15
+'error-message'=16
+'extension'=17
+'deviation'=18
+'deviate'=19
+'feature'=20
+'fraction-digits'=21
+'grouping'=22
+'identity'=23
+'if-feature'=24
+'import'=25
+'include'=26
+'input'=27
+'key'=28
+'leaf'=29
+'leaf-list'=30
+'length'=31
+'list'=32
+'mandatory'=33
+'max-elements'=34
+'min-elements'=35
+'module'=36
+'must'=37
+'namespace'=38
+'notification'=39
+'ordered-by'=40
+'organization'=41
+'output'=42
+'path'=43
+'pattern'=44
+'position'=45
+'prefix'=46
+'presence'=47
+'range'=48
+'reference'=49
+'refine'=50
+'require-instance'=51
+'revision'=52
+'revision-date'=53
+'rpc'=54
+'status'=55
+'submodule'=56
+'type'=57
+'typedef'=58
+'unique'=59
+'units'=60
+'uses'=61
+'value'=62
+'when'=63
+'yang-version'=64
+'yin-element'=65
+'add'=66
+'current'=67
+'delete'=68
+'deprecated'=69
+'false'=70
+'max'=71
+'min'=72
+'not-supported'=73
+'obsolete'=74
+'replace'=75
+'system'=76
+'true'=77
+'unbounded'=78
+'user'=79
+'compiler-annotation'=80
+'app-data-structure'=82
+'data-structure'=84
+'app-extended-name'=87
+'{'=94
+'}'=95
+';'=97
+'"'=98
+':'=99
+'+'=100
+'-'=101
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/CustomExceptionMatcher.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/CustomExceptionMatcher.java
new file mode 100644
index 0000000..2f3e9ed
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/CustomExceptionMatcher.java
@@ -0,0 +1,65 @@
+/*
+ * 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;
+
+import org.hamcrest.Description;
+import org.hamcrest.TypeSafeMatcher;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+
+/**
+ * ExpectedException framework can use the Hamcrest matcher's to test
+ * custom/extended exceptions. This class extends the type safe matcher to
+ * define the custom exception matcher.
+ */
+public final class CustomExceptionMatcher extends TypeSafeMatcher<ParserException> {
+
+    private int actualLine;
+    private final int expectedLine;
+    private int actualCharPosition;
+    private final int expectedCharPosition;
+
+    /**
+     * Customized exception matcher to match error location.
+     *
+     * @param line error line
+     * @param charPosition error character position
+     * @return customized exception matcher to match error location
+     */
+    public static CustomExceptionMatcher errorLocation(int line, int charPosition) {
+        return new CustomExceptionMatcher(line, charPosition);
+    }
+
+    private CustomExceptionMatcher(int expectedLine, int expectedCharPosition) {
+        this.expectedLine = expectedLine;
+        this.expectedCharPosition = expectedCharPosition;
+    }
+
+    @Override
+    protected boolean matchesSafely(final ParserException exception) {
+        actualLine = exception.getLineNumber();
+        actualCharPosition = exception.getCharPositionInLine();
+        return ((actualLine == expectedLine) && (actualCharPosition == expectedCharPosition));
+    }
+
+    @Override
+    public void describeTo(Description description) {
+        description.appendText(" Error reported location ")
+                .appendText("Line " + actualLine + ", " + "CharPosition " + actualCharPosition)
+                .appendText(" instead of expected ")
+                .appendText("Line " + expectedLine + ", " + "CharPosition " + expectedCharPosition);
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/TreeWalkListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/TreeWalkListenerTest.java
new file mode 100644
index 0000000..d199b38
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/TreeWalkListenerTest.java
@@ -0,0 +1,83 @@
+/*
+ * 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;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+
+import java.io.IOException;
+
+/**
+ * Test cases for testing tree walk listener functionality.
+ */
+public class TreeWalkListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    /**
+     * Checks whether exception is thrown for ordered statement.
+     */
+    @Test
+    public void processOrderedByStatement() throws IOException, ParserException {
+        // Now no exception should be thrown. logs should come.
+        manager.getDataModel("src/test/resources/OrderedByStatement.yang");
+    }
+
+    /**
+     * Checks whether exception is thrown for anyxml statement.
+     */
+    @Test
+    public void processAnyXmlStatement() throws IOException, ParserException {
+        // Now no exception should be thrown. logs should come.
+        manager.getDataModel("src/test/resources/AnyxmlStatement.yang");
+    }
+
+    /**
+     * Checks whether exception is thrown when extra brace is added in the EOF.
+     */
+    @Test
+    public void processFileWithExtraBrace() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("mismatched input '}' expecting <EOF>");
+        manager.getDataModel("src/test/resources/ProcessFileWithExtraBrace.yang");
+    }
+
+    /**
+     * Checks whether exception is thrown when leaf is given after module ends.
+     */
+    @Test
+    public void processFileWithExtraLeaf() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("mismatched input 'leaf' expecting <EOF>");
+        manager.getDataModel("src/test/resources/ProcessFileWithExtraLeaf.yang");
+    }
+
+    /**
+     * Checks whether exception is thrown when extra brace is added in between the EOF.
+     */
+    @Test
+    public void processFileWithExtraBraceInBetween() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("mismatched input 'container' expecting <EOF>");
+        manager.getDataModel("src/test/resources/ProcessFileWithExtraBraceInBetween.yang");
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/YangUtilsParserManagerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/YangUtilsParserManagerTest.java
new file mode 100644
index 0000000..c74869b
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/YangUtilsParserManagerTest.java
@@ -0,0 +1,104 @@
+/*
+ * 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;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+/**
+ * Test case for testing YANG utils parser manager.
+ */
+public class YangUtilsParserManagerTest {
+
+    YangUtilsParserManager manager = new YangUtilsParserManager();
+    File file;
+    BufferedWriter out;
+
+    @Before
+    public void setUp() throws Exception {
+        file = new File("demo.yang");
+        out = new BufferedWriter(new FileWriter(file));
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        file.delete();
+    }
+
+    /**
+     * This test case checks whether the null pointer exception is generated
+     * when the input YANG file is null.
+     */
+    @Test(expected = NullPointerException.class)
+    public void getDataModelNullFileTest() throws IOException, ParserException {
+        YangUtilsParserManager manager = new YangUtilsParserManager();
+        YangNode node = manager.getDataModel(null);
+    }
+
+    /**
+     * This test case checks whether the io exception is generated
+     * when the input YANG file is non existent.
+     */
+    @Test(expected = ParserException.class)
+    public void getDataModelNonExistentFileTest() throws IOException, ParserException {
+
+        YangUtilsParserManager manager = new YangUtilsParserManager();
+        YangNode node = manager.getDataModel("nonexistent.yang");
+    }
+
+    /**
+     * This test case checks if the input YANG file is correct no exception
+     * should be generated.
+     */
+    @Test
+    public void getDataModelCorrectFileTest() throws IOException, ParserException {
+
+        out.write("module ONOS {\n");
+        out.write("yang-version 1;\n");
+        out.write("namespace urn:ietf:params:xml:ns:yang:ietf-ospf;\n");
+        out.write("prefix On;\n");
+        out.write("}\n");
+        out.close();
+
+        YangNode node = manager.getDataModel("demo.yang");
+    }
+
+    /**
+     * This test case checks if the input YANG file with wrong YANG constructs
+     * than parser exception should be generated.
+     */
+    @Test(expected = ParserException.class)
+    public void getDataModelIncorrectFileTest() throws IOException, ParserException {
+
+        out.write("module ONOS {\n");
+        out.write("yang-version 1\n");
+        out.write("namespace urn:ietf:params:xml:ns:yang:ietf-ospf;\n");
+        out.write("prefix On;\n");
+        out.write("}\n");
+        out.close();
+
+        YangNode node = manager.getDataModel("demo.yang");
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/AugmentListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/AugmentListenerTest.java
new file mode 100644
index 0000000..0e0fd10
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/AugmentListenerTest.java
@@ -0,0 +1,70 @@
+/*
+ * 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.hamcrest.core.Is;
+import org.junit.Test;
+import org.onosproject.yang.compiler.datamodel.YangAtomicPath;
+import org.onosproject.yang.compiler.datamodel.YangAugment;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test cases for testing augment listener functionality.
+ */
+public class AugmentListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks valid augment statement.
+     */
+    @Test
+    public void processValidAugmentStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ValidAugmentStatement.yang");
+
+        assertThat(node instanceof YangModule, is(true));
+        assertThat(node.getNodeType(), Is.is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangAugment yangAugment = (YangAugment) yangNode.getChild();
+        ListIterator<YangAtomicPath> absPathIterator = yangAugment.getTargetNode().listIterator();
+        YangAtomicPath absPathIdentifier = absPathIterator.next();
+        assertThat(absPathIdentifier.getNodeIdentifier().getPrefix(), is("if"));
+        assertThat(absPathIdentifier.getNodeIdentifier().getName(), is("interfaces"));
+
+        ListIterator<YangLeaf> leafIterator = yangAugment.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("ds0ChannelNumber"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("ChannelNumber"));
+        assertThat(leafInfo.getDataType().getDataType(), Is.is(YangDataTypes.DERIVED));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/BaseFileListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/BaseFileListenerTest.java
new file mode 100644
index 0000000..3a3c744
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/BaseFileListenerTest.java
@@ -0,0 +1,107 @@
+/*
+ * 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.YangModule;
+import org.onosproject.yang.compiler.datamodel.javadatamodel.YangJavaModule;
+import org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
+
+/**
+ * Test cases for testing base rule listener functionality.
+ */
+public class BaseFileListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    /**
+     * Checks for exception if stack of parsable data is not empty at the entry
+     * of yang base rule.
+     */
+    @Test
+    public void processYangFileEntryNonEmptyStack() {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("Internal parser error detected: Invalid holder for yangbase before processing.");
+
+        YangModule tmpModule = new YangJavaModule();
+        TreeWalkListener listener = new TreeWalkListener();
+        listener.getParsedDataStack().push(tmpModule);
+        GeneratedYangParser.YangfileContext ctx = null;
+        BaseFileListener.processYangFileEntry(listener, ctx);
+    }
+
+    /**
+     * Checks that exception shouldn't be generated if stack of parsable data is
+     * empty at the entry of yang base rule.
+     */
+    @Test
+    public void processYangFileEntryEmptyStack() {
+
+        TreeWalkListener listener = new TreeWalkListener();
+        GeneratedYangParser.YangfileContext ctx = null;
+        BaseFileListener.processYangFileEntry(listener, ctx);
+    }
+
+    /**
+     * Checks that exception should be generated if stack of parsable data is
+     * not empty at the exit of yang base rule.
+     */
+    @Test
+    public void processYangFileExitEmptyStack() {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("Internal parser error detected: Missing holder at yangbase after processing.");
+
+        TreeWalkListener listener = new TreeWalkListener();
+        GeneratedYangParser.YangfileContext ctx = null;
+        BaseFileListener.processYangFileExit(listener, ctx);
+    }
+
+    /**
+     * Checks that exception shouldn't be generated if stack of parsable data is
+     * empty at the exit of yang base rule.
+     */
+    @Test
+    public void processYangFileExitNonEmptyStack() {
+
+        TreeWalkListener listener = new TreeWalkListener();
+        GeneratedYangParser.YangfileContext ctx = null;
+        BaseFileListener.processYangFileEntry(listener, ctx);
+    }
+
+    /**
+     * Checks that after popping out the parsable node from stack it should be
+     * empty.
+     */
+    @Test
+    public void processYangFileExitStackErrorExtraEntryTest() {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("Internal parser error detected: Invalid holder for yangbase after processing.");
+
+        YangModule tmpModule = new YangJavaModule();
+        YangModule tmpModule2 = new YangJavaModule();
+        TreeWalkListener listener = new TreeWalkListener();
+        listener.getParsedDataStack().push(tmpModule);
+        listener.getParsedDataStack().push(tmpModule2);
+        GeneratedYangParser.YangfileContext ctx = null;
+        BaseFileListener.processYangFileExit(listener, ctx);
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/BelongstoListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/BelongstoListenerTest.java
new file mode 100644
index 0000000..c9336ce
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/BelongstoListenerTest.java
@@ -0,0 +1,86 @@
+/*
+ * 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.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.CustomExceptionMatcher;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test cases for testing belongsto listener functionality.
+ */
+public class BelongstoListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks if mandatory belongsto parameter "prefix" is not present.
+     */
+    @Test
+    public void processBelongsToWithoutPrefix() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("mismatched input '}' expecting 'prefix'");
+        thrown.expect(CustomExceptionMatcher.errorLocation(4, 0));
+        YangNode node = manager.getDataModel("src/test/resources/BelongsToWithoutPrefix.yang");
+    }
+
+    /**
+     * Checks that prefix must be present only once in belongsto.
+     */
+    @Test
+    public void processBelongsToDualPrefix() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("mismatched input 'prefix' expecting '}'");
+        thrown.expect(CustomExceptionMatcher.errorLocation(5, 0));
+        YangNode node = manager.getDataModel("src/test/resources/BelongsToDualPrefix.yang");
+    }
+
+    /**
+     * Checks if belongsto listener updates the date model tree.
+     */
+    @Test
+    public void processBelongsToWithPrefix() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/BelongsToWithPrefix.yang");
+        YangSubModule yangNode = (YangSubModule) node;
+        assertThat(yangNode.getBelongsTo().getBelongsToModuleName(), is("ONOS"));
+    }
+
+    /**
+     * Checks if mandatory parameter "belongsto" is present.
+     */
+    @Test
+    public void processSubModuleWithoutBelongsTo() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("mismatched input '}' expecting 'belongs-to'");
+        thrown.expect(CustomExceptionMatcher.errorLocation(3, 0));
+        YangNode node = manager.getDataModel("src/test/resources/SubModuleWithoutBelongsTo.yang");
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/BitListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/BitListenerTest.java
new file mode 100644
index 0000000..b6f6c64
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/BitListenerTest.java
@@ -0,0 +1,362 @@
+/*
+ * 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.hamcrest.core.Is;
+import org.junit.Test;
+import org.onosproject.yang.compiler.datamodel.YangBit;
+import org.onosproject.yang.compiler.datamodel.YangBits;
+import org.onosproject.yang.compiler.datamodel.YangDerivedInfo;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangType;
+import org.onosproject.yang.compiler.datamodel.YangTypeDef;
+import org.onosproject.yang.compiler.datamodel.YangUnion;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+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 java.util.ListIterator;
+import java.util.Map;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for bit listener.
+ */
+public class BitListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks bit statement without position.
+     */
+    @Test
+    public void processBitTypeStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/BitTypeStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), Is.is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("mybits"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("bits"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.BITS));
+        assertThat(((YangBits) leafInfo.getDataType().getDataTypeExtendedInfo()).getBitsName(),
+                is("mybits"));
+
+        // Check bit name map
+        Map<String, YangBit> bitNameMap = ((YangBits) leafInfo.getDataType().getDataTypeExtendedInfo()).getBitNameMap();
+        assertThat(bitNameMap.size(), is(3));
+        for (Map.Entry<String, YangBit> element : bitNameMap.entrySet()) {
+            String bitName = element.getKey();
+            YangBit yangBit = element.getValue();
+            if (bitName.equals("disable-nagle")) {
+                assertThat(yangBit.getPosition(), is(0));
+            } else if (bitName.equals("auto-sense-speed")) {
+                assertThat(yangBit.getPosition(), is(1));
+            } else if (bitName.equals("Ten-Mb-only")) {
+                assertThat(yangBit.getPosition(), is(2));
+            } else {
+                throw new IOException("Invalid bit name: " + bitName);
+            }
+        }
+
+        // Check bit position map
+        Map<Integer, YangBit> bitPositionMap = ((YangBits) leafInfo.getDataType().getDataTypeExtendedInfo())
+                                                                                 .getBitPositionMap();
+        assertThat(bitPositionMap.size(), is(3));
+        for (Map.Entry<Integer, YangBit> element : bitPositionMap.entrySet()) {
+            int position = element.getKey();
+            YangBit yangBit = element.getValue();
+            if (position == 0) {
+                assertThat(yangBit.getBitName(), is("disable-nagle"));
+            } else if (position == 1) {
+                assertThat(yangBit.getBitName(), is("auto-sense-speed"));
+            } else if (position == 2) {
+                assertThat(yangBit.getBitName(), is("Ten-Mb-only"));
+            } else {
+                throw new IOException("Invalid bit position: " + position);
+            }
+        }
+    }
+
+    /**
+     * Checks bit statement with typedef.
+     */
+    @Test
+    public void processBitTypedefStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/BitTypedefStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangTypeDef typedef = (YangTypeDef) yangNode.getChild();
+        assertThat(typedef.getName(), is("type15"));
+
+        YangType type = typedef.getTypeList().iterator().next();
+        assertThat(type.getDataType(), is(YangDataTypes.BITS));
+        assertThat(type.getDataTypeName(), is("bits"));
+
+        // Check bit name map
+        Map<String, YangBit> bitNameMap = ((YangBits) type.getDataTypeExtendedInfo()).getBitNameMap();
+        assertThat(bitNameMap.size(), is(3));
+        for (Map.Entry<String, YangBit> element : bitNameMap.entrySet()) {
+            String bitName = element.getKey();
+            YangBit yangBit = element.getValue();
+            if (bitName.equals("disable-nagle")) {
+                assertThat(yangBit.getPosition(), is(0));
+            } else if (bitName.equals("auto-sense-speed")) {
+                assertThat(yangBit.getPosition(), is(1));
+            } else if (bitName.equals("Mb-only")) {
+                assertThat(yangBit.getPosition(), is(2));
+            } else {
+                throw new IOException("Invalid bit name: " + bitName);
+            }
+        }
+
+        // Check bit position map
+        Map<Integer, YangBit> bitPositionMap = ((YangBits) type.getDataTypeExtendedInfo()).getBitPositionMap();
+        assertThat(bitPositionMap.size(), is(3));
+        for (Map.Entry<Integer, YangBit> element : bitPositionMap.entrySet()) {
+            int position = element.getKey();
+            YangBit yangBit = element.getValue();
+            if (position == 0) {
+                assertThat(yangBit.getBitName(), is("disable-nagle"));
+            } else if (position == 1) {
+                assertThat(yangBit.getBitName(), is("auto-sense-speed"));
+            } else if (position == 2) {
+                assertThat(yangBit.getBitName(), is("Mb-only"));
+            } else {
+                throw new IOException("Invalid bit position: " + position);
+            }
+        }
+    }
+
+    /**
+     * Checks bit statement with typedef with referred leaf.
+     */
+    @Test
+    public void processBitTypedefReferredLeafStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/BitTypedefReferredLeafStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangTypeDef typedef = (YangTypeDef) yangNode.getChild();
+        assertThat(typedef.getName(), is("topBits"));
+
+        YangType type = typedef.getTypeList().iterator().next();
+        assertThat(type.getDataType(), is(YangDataTypes.BITS));
+        assertThat(type.getDataTypeName(), is("bits"));
+
+        // Check bit name map
+        Map<String, YangBit> bitNameMap = ((YangBits) type.getDataTypeExtendedInfo()).getBitNameMap();
+        assertThat(bitNameMap.size(), is(3));
+        for (Map.Entry<String, YangBit> element : bitNameMap.entrySet()) {
+            String bitName = element.getKey();
+            YangBit yangBit = element.getValue();
+            if (bitName.equals("disable-nagle")) {
+                assertThat(yangBit.getPosition(), is(0));
+            } else if (bitName.equals("auto-sense-speed")) {
+                assertThat(yangBit.getPosition(), is(1));
+            } else if (bitName.equals("Mb-only")) {
+                assertThat(yangBit.getPosition(), is(2));
+            } else {
+                throw new IOException("Invalid bit name: " + bitName);
+            }
+        }
+
+        // Check bit position map
+        Map<Integer, YangBit> bitPositionMap = ((YangBits) type.getDataTypeExtendedInfo()).getBitPositionMap();
+        assertThat(bitPositionMap.size(), is(3));
+        for (Map.Entry<Integer, YangBit> element : bitPositionMap.entrySet()) {
+            int position = element.getKey();
+            YangBit yangBit = element.getValue();
+            if (position == 0) {
+                assertThat(yangBit.getBitName(), is("disable-nagle"));
+            } else if (position == 1) {
+                assertThat(yangBit.getBitName(), is("auto-sense-speed"));
+            } else if (position == 2) {
+                assertThat(yangBit.getBitName(), is("Mb-only"));
+            } else {
+                throw new IOException("Invalid bit position: " + position);
+            }
+        }
+
+        // Check leaf reffered typedef
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("myBits"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("topBits"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.DERIVED));
+        YangType<YangDerivedInfo> typeDerived = (YangType<YangDerivedInfo>) leafInfo.getDataType();
+        YangDerivedInfo derivedInfo = (YangDerivedInfo) typeDerived.getDataTypeExtendedInfo();
+        YangTypeDef prevTypedef = (YangTypeDef) derivedInfo.getReferredTypeDef();
+        assertThat(prevTypedef.getName(), is("topBits"));
+        YangType topType = prevTypedef.getTypeList().iterator().next();
+        assertThat(topType.getDataType(), is(YangDataTypes.BITS));
+        assertThat(topType.getDataTypeName(), is("bits"));
+        YangType<YangBits> typeBits = (YangType<YangBits>) topType;
+        YangBits bits = typeBits.getDataTypeExtendedInfo();
+
+        // Check bit name map
+        bitNameMap = bits.getBitNameMap();
+        assertThat(bitNameMap.size(), is(3));
+        for (Map.Entry<String, YangBit> element : bitNameMap.entrySet()) {
+            String bitName = element.getKey();
+            YangBit yangBit = element.getValue();
+            if (bitName.equals("disable-nagle")) {
+                assertThat(yangBit.getPosition(), is(0));
+            } else if (bitName.equals("auto-sense-speed")) {
+                assertThat(yangBit.getPosition(), is(1));
+            } else if (bitName.equals("Mb-only")) {
+                assertThat(yangBit.getPosition(), is(2));
+            } else {
+                throw new IOException("Invalid bit name: " + bitName);
+            }
+        }
+
+        // Check bit position map
+        bitPositionMap = bits.getBitPositionMap();
+        assertThat(bitPositionMap.size(), is(3));
+        for (Map.Entry<Integer, YangBit> element : bitPositionMap.entrySet()) {
+            int position = element.getKey();
+            YangBit yangBit = element.getValue();
+            if (position == 0) {
+                assertThat(yangBit.getBitName(), is("disable-nagle"));
+            } else if (position == 1) {
+                assertThat(yangBit.getBitName(), is("auto-sense-speed"));
+            } else if (position == 2) {
+                assertThat(yangBit.getBitName(), is("Mb-only"));
+            } else {
+                throw new IOException("Invalid bit position: " + position);
+            }
+        }
+    }
+
+    /**
+     * Checks bit statement with union.
+     */
+    @Test
+    public void processBitUnionStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/BitUnionStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("type15"));
+
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UNION));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("union"));
+
+        YangUnion yangUnion = (YangUnion) leafInfo.getDataType().getDataTypeExtendedInfo();
+
+        List<YangType<?>> typeList = yangUnion.getTypeList();
+        ListIterator<YangType<?>> typeListIterator = typeList.listIterator();
+        YangType<?> yangType = typeListIterator.next();
+
+        assertThat(yangType.getDataType(), is(YangDataTypes.BITS));
+        assertThat(yangType.getDataTypeName(), is("bits"));
+
+        // Check bit name map
+        Map<String, YangBit> bitNameMap = ((YangBits) yangType.getDataTypeExtendedInfo()).getBitNameMap();
+        assertThat(bitNameMap.size(), is(3));
+        for (Map.Entry<String, YangBit> element : bitNameMap.entrySet()) {
+            String bitName = element.getKey();
+            YangBit yangBit = element.getValue();
+            if (bitName.equals("disable-nagle")) {
+                assertThat(yangBit.getPosition(), is(0));
+            } else if (bitName.equals("auto-sense-speed")) {
+                assertThat(yangBit.getPosition(), is(1));
+            } else if (bitName.equals("Mb-only")) {
+                assertThat(yangBit.getPosition(), is(2));
+            } else {
+                throw new IOException("Invalid bit name: " + bitName);
+            }
+        }
+
+        // Check bit position map
+        Map<Integer, YangBit> bitPositionMap = ((YangBits) yangType.getDataTypeExtendedInfo()).getBitPositionMap();
+        assertThat(bitPositionMap.size(), is(3));
+        for (Map.Entry<Integer, YangBit> element : bitPositionMap.entrySet()) {
+            int position = element.getKey();
+            YangBit yangBit = element.getValue();
+            if (position == 0) {
+                assertThat(yangBit.getBitName(), is("disable-nagle"));
+            } else if (position == 1) {
+                assertThat(yangBit.getBitName(), is("auto-sense-speed"));
+            } else if (position == 2) {
+                assertThat(yangBit.getBitName(), is("Mb-only"));
+            } else {
+                throw new IOException("Invalid bit position: " + position);
+            }
+        }
+    }
+
+    /**
+     * Checks if enum with same name is not allowed.
+     */
+    @Test(expected = ParserException.class)
+    public void processBitWithDuplicateName() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/BitWithDuplicateName.yang");
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/CaseListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/CaseListenerTest.java
new file mode 100644
index 0000000..a032297
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/CaseListenerTest.java
@@ -0,0 +1,239 @@
+/*
+ * 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.Test;
+import org.onosproject.yang.compiler.datamodel.YangAugment;
+import org.onosproject.yang.compiler.datamodel.YangCase;
+import org.onosproject.yang.compiler.datamodel.YangChoice;
+import org.onosproject.yang.compiler.datamodel.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for case listener.
+ */
+public class CaseListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks multiple case statement.
+     */
+    @Test
+    public void processCaseStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/CaseStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangContainer yangContainer = (YangContainer) yangNode.getChild();
+        assertThat(yangContainer.getName(), is("food"));
+
+        YangChoice yangChoice = (YangChoice) yangContainer.getChild();
+        assertThat(yangChoice.getName(), is("snack"));
+
+        YangCase yangCase1 = (YangCase) yangChoice.getChild();
+        assertThat(yangCase1.getName(), is("sports-arena"));
+
+        // Check whether leaf properties as set correctly.
+        ListIterator<YangLeaf> leafIterator1 = yangCase1.getListOfLeaf().listIterator();
+        YangLeaf leafInfo1 = leafIterator1.next();
+
+        assertThat(leafInfo1.getName(), is("pretzel"));
+
+        YangCase yangCase2 = (YangCase) yangCase1.getNextSibling();
+        assertThat(yangCase2.getName(), is("late-night"));
+
+        // Check whether leaf properties as set correctly.
+        ListIterator<YangLeaf> leafIterator2 = yangCase2.getListOfLeaf().listIterator();
+        YangLeaf leafInfo2 = leafIterator2.next();
+
+        assertThat(leafInfo2.getName(), is("chocolate"));
+    }
+
+    /**
+     * Checks duplicate case in choice.
+     */
+    @Test(expected = ParserException.class)
+    public void processDuplicateCaseInChoice() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/DuplicateCaseInChoice.yang");
+    }
+
+    /**
+     * Checks duplicate leaf at different hierarchy.
+     */
+    @Test(expected = ParserException.class)
+    public void processDuplicateLeafInHierarchy() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/DuplicateLeafInHierarchy.yang");
+    }
+
+    /**
+     * Checks duplicate leaf in different case within choice.
+     */
+    @Test(expected = ParserException.class)
+    public void processDuplicateLeafInChoice() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/DuplicateLeafInChoice.yang");
+    }
+
+    /**
+     * Checks same case within different choice.
+     */
+    @Test
+    public void processCaseStatementSameEntryDifferentChoice() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/CaseStatementSameEntryDifferentChoice.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangContainer yangContainer = (YangContainer) yangNode.getChild();
+        assertThat(yangContainer.getName(), is("food"));
+
+        YangChoice yangChoice = (YangChoice) yangContainer.getChild();
+        assertThat(yangChoice.getName(), is("snack"));
+
+        YangCase yangCase1 = (YangCase) yangChoice.getChild();
+        assertThat(yangCase1.getName(), is("sports-arena"));
+
+        // Check whether leaf properties as set correctly.
+        ListIterator<YangLeaf> leafIterator1 = yangCase1.getListOfLeaf().listIterator();
+        YangLeaf leafInfo1 = leafIterator1.next();
+
+        assertThat(leafInfo1.getName(), is("pretzel"));
+
+        YangChoice yangChoice2 = (YangChoice) yangChoice.getNextSibling();
+        assertThat(yangChoice2.getName(), is("lunch"));
+
+        YangCase yangCase2 = (YangCase) yangChoice2.getChild();
+        assertThat(yangCase2.getName(), is("sports-arena"));
+
+        // Check whether leaf properties as set correctly.
+        ListIterator<YangLeaf> leafIterator2 = yangCase2.getListOfLeaf().listIterator();
+        YangLeaf leafInfo2 = leafIterator2.next();
+
+        assertThat(leafInfo2.getName(), is("chocolate"));
+    }
+
+    /**
+     * Checks case choice hierarchy.
+     */
+    @Test
+    public void processCaseChoiceHierarchy() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/CaseChoiceHierarchy.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangContainer yangContainer = (YangContainer) yangNode.getChild();
+        assertThat(yangContainer.getName(), is("food"));
+
+        YangChoice yangChoice1 = (YangChoice) yangContainer.getChild();
+        assertThat(yangChoice1.getName(), is("snack"));
+
+        YangCase yangCase1 = (YangCase) yangChoice1.getChild();
+        assertThat(yangCase1.getName(), is("sports-arena"));
+
+        // Check whether leaf properties as set correctly.
+        ListIterator<YangLeaf> leafIterator1 = yangCase1.getListOfLeaf().listIterator();
+        YangLeaf leafInfo1 = leafIterator1.next();
+
+        assertThat(leafInfo1.getName(), is("pretzel"));
+
+        YangCase yangCase2 = (YangCase) yangCase1.getNextSibling();
+        assertThat(yangCase2.getName(), is("late-night"));
+
+        YangChoice yangChoice2 = (YangChoice) yangCase2.getChild();
+        assertThat(yangChoice2.getName(), is("dinner"));
+
+        YangCase yangCase3 = (YangCase) yangChoice2.getChild();
+        assertThat(yangCase3.getName(), is("late-night"));
+
+        // Check whether leaf properties as set correctly.
+        ListIterator<YangLeaf> leafIterator2 = yangCase3.getListOfLeaf().listIterator();
+        YangLeaf leafInfo2 = leafIterator2.next();
+        assertThat(leafInfo2.getName(), is("beer"));
+    }
+
+    /**
+     * Checks case substatement of augment.
+     */
+    @Test
+    public void processCaseSubStatementOfAugment() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/CaseSubStatementOfAugment.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("event"));
+
+        YangAugment augment = ((YangAugment) yangNode.getChild());
+        assertThat(augment.getName(), is("/snmp:snmp/snmp:engine/snmp:listen/snmp:transport"));
+
+        YangCase yangCase = ((YangCase) augment.getChild());
+        assertThat(yangCase.getName(), is("tls"));
+
+        YangCase yangCase1 = ((YangCase) yangCase.getNextSibling());
+        assertThat(yangCase1.getName(), is("dtls"));
+
+        YangContainer container = ((YangContainer) yangCase.getChild());
+        assertThat(container.getName(), is("tls"));
+        assertThat(container.getListOfLeaf().iterator().next().getName(), is("ip"));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ChoiceListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ChoiceListenerTest.java
new file mode 100644
index 0000000..834acb8
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ChoiceListenerTest.java
@@ -0,0 +1,129 @@
+/*
+ * 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.Test;
+import org.onosproject.yang.compiler.datamodel.YangChoice;
+import org.onosproject.yang.compiler.datamodel.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for choice listener.
+ */
+public class ChoiceListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks choice statement without body.
+     */
+    @Test
+    public void processChoiceStatementWithoutBody() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ChoiceStatementWithoutBody.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangContainer yangContainer = (YangContainer) yangNode.getChild();
+        assertThat(yangContainer.getName(), is("food"));
+
+        YangChoice yangChoice = (YangChoice) yangContainer.getChild();
+        assertThat(yangChoice.getName(), is("snack"));
+    }
+
+    /**
+     * Checks choice statement with stmt end.
+     */
+    @Test
+    public void processChoiceStatementWithStmtend() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ChoiceStatementWithStmtend.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangContainer yangContainer = (YangContainer) yangNode.getChild();
+        assertThat(yangContainer.getName(), is("food"));
+
+        YangChoice yangChoice = (YangChoice) yangContainer.getChild();
+        assertThat(yangChoice.getName(), is("snack"));
+    }
+
+    /**
+     * Checks choice statement duplicate entry.
+     */
+    @Test(expected = ParserException.class)
+    public void processChoiceStatementDuplicateEntry() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ChoiceStatementDuplicateEntry.yang");
+    }
+
+    /**
+     * Checks choice statement with same entry in two different container.
+     */
+    @Test
+    public void processChoiceStatementSameEntryDifferentContainer() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ChoiceStatementSameEntryDifferentContainer.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangContainer yangContainer1 = (YangContainer) yangNode.getChild();
+        assertThat(yangContainer1.getName(), is("food1"));
+
+        YangChoice yangChoice1 = (YangChoice) yangContainer1.getChild();
+        assertThat(yangChoice1.getName(), is("snack"));
+
+        YangContainer yangContainer2 = (YangContainer) yangNode.getChild().getNextSibling();
+        assertThat(yangContainer2.getName(), is("food2"));
+
+        YangChoice yangChoice2 = (YangChoice) yangContainer2.getChild();
+        assertThat(yangChoice2.getName(), is("snack"));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ConfigListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ConfigListenerTest.java
new file mode 100644
index 0000000..b7a0d41
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ConfigListenerTest.java
@@ -0,0 +1,495 @@
+/*
+ * 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.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.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangStatusType;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for config listener.
+ */
+public class ConfigListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks valid config statement.
+     */
+    @Test
+    public void processConfigTrue() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ConfigTrue.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // Check whether the Config value is set correctly.
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.isConfig(), is(true));
+    }
+
+    /**
+     * Checks valid config statement.
+     */
+    @Test
+    public void processConfigFalse() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ConfigFalse.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // Check whether the Config value is set correctly.
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.isConfig(), is(false));
+    }
+
+    /**
+     * Checks invalid config statement and expects parser exception.
+     */
+    @Test
+    public void processConfigWithoutStatementEnd() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("missing ';' at '}'");
+        YangNode node = manager.getDataModel("src/test/resources/ConfigWithoutStatementEnd.yang");
+    }
+
+    /**
+     * Checks invalid config statement and expects parser exception.
+     */
+    @Test
+    public void processConfigInvalidValue() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : config value invalid is not valid.");
+        YangNode node = manager.getDataModel("src/test/resources/ConfigInvalidValue.yang");
+    }
+
+    /**
+     * Checks invalid config statement and expects parser exception.
+     */
+    @Test
+    public void processConfigEmptyValue() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("no viable alternative at input ';'");
+        YangNode node = manager.getDataModel("src/test/resources/ConfigEmptyValue.yang");
+    }
+
+    /**
+     * Checks config statement as sub-statement of container.
+     */
+    @Test
+    public void processContainerSubStatementConfig() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ContainerSubStatementConfig.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the config value is set correctly.
+        YangContainer container = (YangContainer) yangNode.getChild();
+        assertThat(container.getName(), is("valid"));
+        assertThat(container.isConfig(), is(true));
+
+        // Check whether leaf properties as set correctly.
+        ListIterator<YangLeaf> leafIterator = container.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
+        assertThat(leafInfo.getUnits(), is("\"seconds\""));
+        assertThat(leafInfo.getDescription(), is("\"Interval before a route is declared invalid\""));
+        assertThat(leafInfo.isMandatory(), is(true));
+        assertThat(leafInfo.getStatus(), is(YangStatusType.CURRENT));
+        assertThat(leafInfo.getReference(), is("\"RFC 6020\""));
+    }
+
+    /**
+     * Checks config statement as sub-statement of list.
+     */
+    @Test
+    public void processListSubStatementConfig() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ListSubStatementConfig.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module and config value is set.
+        YangList yangList = (YangList) yangNode.getChild();
+        assertThat(yangList.getName(), is("valid"));
+        assertThat(yangList.isConfig(), is(true));
+
+        // Check whether leaf properties as set correctly.
+        ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
+        assertThat(leafInfo.getUnits(), is("\"seconds\""));
+        assertThat(leafInfo.getDescription(), is("\"Interval before a route is declared invalid\""));
+        assertThat(leafInfo.isMandatory(), is(true));
+        assertThat(leafInfo.getStatus(), is(YangStatusType.CURRENT));
+        assertThat(leafInfo.getReference(), is("\"RFC 6020\""));
+    }
+
+    /**
+     * Checks valid config statement as sub-statement of leaf-list.
+     */
+    @Test
+    public void processLeafListSubStatementConfig() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/LeafListSubStatementConfig.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        // Check whether config value is set correctly.
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.isConfig(), is(true));
+    }
+
+    /**
+     * Checks config statement's default Value.
+     */
+    @Test
+    public void processConfigDefaultValue() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ConfigDefaultValue.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the config value is set correctly.
+        YangContainer container = (YangContainer) yangNode.getChild();
+        assertThat(container.getName(), is("valid"));
+        assertThat(container.isConfig(), is(true));
+
+        // Check whether leaf properties as set correctly.
+        ListIterator<YangLeaf> leafIterator = container.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.isConfig(), is(true));
+    }
+
+    /**
+     * Checks whether exception is throw when node's parent config set to false,
+     * no node underneath it can have config set to true.
+     */
+    @Test
+    public void processConfigFalseParentContainerChildLeafList() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("Internal parser error detected: Unhandled parsed data at container \"valid\" after "
+                + "processing.\nError Information: If a container has \"config\" set to \"false\", no node underneath "
+                + "it can have \"config\" set to \"true\".");
+        YangNode node = manager.getDataModel("src/test/resources/ConfigFalseParentContainerChildLeafList.yang");
+    }
+
+    /**
+     * Checks whether exception is throw when node's parent config set to false,
+     * no node underneath it can have config set to true.
+     */
+    @Test
+    public void processConfigFalseParentContainerChildLeaf() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("Internal parser error detected: Unhandled parsed data at container \"valid\" after "
+                + "processing.\nError Information: If a container has \"config\" set to \"false\", no node underneath "
+                + "it can have \"config\" set to \"true\".");
+        YangNode node = manager.getDataModel("src/test/resources/ConfigFalseParentContainerChildLeaf.yang");
+    }
+
+    /**
+     * Checks whether exception is throw when node's parent config set to false,
+     * no node underneath it can have config set to true.
+     */
+    @Test
+    public void processConfigFalseParentListChildLeafList() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("Internal parser error detected: Unhandled parsed data at list \"valid\" after"
+                + " processing.\nError Information: If a list has \"config\" set to \"false\", no node underneath"
+                + " it can have \"config\" set to \"true\".");
+        YangNode node = manager.getDataModel("src/test/resources/ConfigFalseParentListChildLeafList.yang");
+    }
+
+    /**
+     * Checks whether exception is throw when node's parent config set to false,
+     * no node underneath it can have config set to true.
+     */
+    @Test
+    public void processConfigFalseParentListChildLeaf() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("Internal parser error detected: Unhandled parsed data at list \"valid\" after"
+                + " processing.\nError Information: If a list has \"config\" set to \"false\", no node underneath"
+                + " it can have \"config\" set to \"true\".");
+        YangNode node = manager.getDataModel("src/test/resources/ConfigFalseParentListChildLeaf.yang");
+    }
+
+    /**
+     * Checks when config is not specified, the default is same as the parent's schema node's
+     * config statement's value.
+     */
+    @Test
+    public void processNoConfigContainerSubStatementContainer() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/NoConfigContainerSubStatementContainer.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the config value is set correctly.
+        YangContainer container = (YangContainer) yangNode.getChild();
+        assertThat(container.getName(), is("hello"));
+        assertThat(container.isConfig(), is(true));
+
+        YangNode containerNode = container.getChild();
+        assertThat(containerNode instanceof YangContainer, is(true));
+        YangContainer childContainer = (YangContainer) containerNode;
+        assertThat(childContainer.getName(), is("valid"));
+        assertThat(childContainer.isConfig(), is(true));
+    }
+
+    /**
+     * Checks when config is not specified, the default is same as the parent's schema node's
+     * config statement's value.
+     */
+    @Test
+    public void processNoConfigContainerSubStatementLeafList() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/NoConfigContainerSubStatementLeafList.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the config value is set correctly.
+        YangContainer container = (YangContainer) yangNode.getChild();
+        assertThat(container.getName(), is("valid"));
+        assertThat(container.isConfig(), is(true));
+
+        ListIterator<YangLeafList> leafListIterator = container.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        // Check whether config value is set correctly.
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.isConfig(), is(true));
+
+    }
+
+    /**
+     * Checks when config is not specified, the default is same as the parent's schema node's
+     * config statement's value.
+     */
+    @Test
+    public void processNoConfigContainerSubStatementLeaf() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/NoConfigContainerSubStatementLeaf.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the config value is set correctly.
+        YangContainer container = (YangContainer) yangNode.getChild();
+        assertThat(container.getName(), is("valid"));
+        assertThat(container.isConfig(), is(true));
+
+        // Check whether leaf properties as set correctly.
+        ListIterator<YangLeaf> leafIterator = container.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.isConfig(), is(true));
+    }
+
+    /**
+     * Checks when config is not specified, the default is same as the parent's schema node's
+     * config statement's value.
+     */
+    @Test
+    public void processNoConfigContainerSubStatementList() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/NoConfigContainerSubStatementList.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the config value is set correctly.
+        YangContainer container = (YangContainer) yangNode.getChild();
+        assertThat(container.getName(), is("hello"));
+        assertThat(container.isConfig(), is(true));
+
+        YangNode listNode = container.getChild();
+        assertThat(listNode instanceof YangList, is(true));
+        YangList childList = (YangList) listNode;
+        assertThat(childList.getName(), is("valid"));
+        assertThat(childList.isConfig(), is(true));
+
+    }
+
+    /**
+     * Checks when config is not specified, the default is same as the parent's schema node's
+     * config statement's value.
+     */
+    @Test
+    public void processNoConfigListSubStatementContainer() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/NoConfigListSubStatementContainer.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the config value is set correctly.
+        YangList list1 = (YangList) yangNode.getChild();
+        assertThat(list1.getName(), is("list1"));
+        assertThat(list1.isConfig(), is(true));
+
+        YangNode containerNode = list1.getChild();
+        assertThat(containerNode instanceof YangContainer, is(true));
+        YangContainer childContainer = (YangContainer) containerNode;
+        assertThat(childContainer.getName(), is("container1"));
+        assertThat(childContainer.isConfig(), is(true));
+    }
+
+    /**
+     * Checks when config is not specified, the default is same as the parent's schema node's
+     * config statement's value.
+     */
+    @Test
+    public void processNoConfigListSubStatementLeaf() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/NoConfigListSubStatementLeaf.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the config value is set correctly.
+        YangList list1 = (YangList) yangNode.getChild();
+        assertThat(list1.getName(), is("valid"));
+        assertThat(list1.isConfig(), is(true));
+
+        // Check whether leaf properties as set correctly.
+        ListIterator<YangLeaf> leafIterator = list1.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.isConfig(), is(true));
+    }
+
+    /**
+     * Checks when config is not specified, the default is same as the parent's schema node's
+     * config statement's value.
+     */
+    @Test
+    public void processNoConfigListSubStatementList() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/NoConfigListSubStatementList.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the config value is set correctly.
+        YangList list1 = (YangList) yangNode.getChild();
+        assertThat(list1.getName(), is("valid"));
+        assertThat(list1.isConfig(), is(true));
+
+        YangNode listNode = list1.getChild();
+        assertThat(listNode instanceof YangList, is(true));
+        YangList childList = (YangList) listNode;
+        assertThat(childList.getName(), is("list1"));
+        assertThat(childList.isConfig(), is(true));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ContactListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ContactListenerTest.java
new file mode 100644
index 0000000..4b1ef2d
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ContactListenerTest.java
@@ -0,0 +1,94 @@
+/*
+ * 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.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 static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test cases for testing contact listener functionality.
+ */
+public class ContactListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks if contact listener updates the data model tree.
+     */
+    @Test
+    public void processContactValidEntry() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ContactValidEntry.yang");
+
+        // Checks for the contact value in data model tree.
+        assertThat(((YangModule) node).getContact(), is("\"WG List:  <mailto:spring@ietf.org>\nEditor:    "
+                + "Stephane Litkowski\n           " + "<mailto:stephane.litkowski@orange.com>\""));
+    }
+
+    /**
+     * Checks that contact must be present only once.
+     */
+    @Test(expected = ParserException.class)
+    public void processContactDualEntryTest() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ContactDualEntryTest.yang");
+
+    }
+
+    /**
+     * Checks that contact can have a string value without double quotes.
+     */
+    @Test
+    public void processContactWithoutQuotes() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ContactWithoutQuotes.yang");
+
+        // Checks for the contact value in data model tree.
+        assertThat(((YangModule) node).getContact(), is("WG"));
+    }
+
+    /**
+     * Checks if contact is not empty.
+     */
+    @Test(expected = ParserException.class)
+    public void processContactWithEmptyString() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ContactWithEmptyString.yang");
+    }
+
+    /**
+     * Checks that contact must be present after namespace.
+     */
+    @Test(expected = ParserException.class)
+    public void processContactIncorrectOrder() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ContactIncorrectOrder.yang");
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ContainerListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ContainerListenerTest.java
new file mode 100644
index 0000000..572131e
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ContainerListenerTest.java
@@ -0,0 +1,232 @@
+/*
+ * 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.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangStatusType;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for testing container listener.
+ */
+public class ContainerListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks container statement as sub-statement of module.
+     */
+    @Test
+    public void processModuleSubStatementContainer() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ModuleSubStatementContainer.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.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
+        YangContainer yangContainer = (YangContainer) yangNode.getChild();
+        assertThat(yangContainer.getName(), is("valid"));
+    }
+
+    /**
+     * Checks if container identifier in module is duplicate.
+     */
+    @Test(expected = ParserException.class)
+    public void processModuleDuplicateContainer() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ModuleDuplicateContainer.yang");
+    }
+
+    /**
+     * Checks if container identifier in container is duplicate.
+     */
+    @Test(expected = ParserException.class)
+    public void processContainerDuplicateContainer() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ContainerDuplicateContainer.yang");
+    }
+
+    /**
+     * Checks if container identifier in list is duplicate.
+     */
+    @Test(expected = ParserException.class)
+    public void processListDuplicateContainer() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ListDuplicateContainer.yang");
+    }
+
+    /**
+     * Checks if container identifier collides with list at same level.
+     */
+    @Test(expected = ParserException.class)
+    public void processDuplicateContainerAndList() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/DuplicateContainerAndList.yang");
+    }
+
+    /**
+     * Checks container statement as sub-statement of container.
+     */
+    @Test
+    public void processContainerSubStatementContainer() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ContainerSubStatementContainer.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.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
+        YangContainer yangContainer = (YangContainer) yangNode.getChild();
+        assertThat(yangContainer.getName(), is("ospf"));
+
+        // Check whether the container is child of container
+        YangContainer yangContainer1 = (YangContainer) yangContainer.getChild();
+        assertThat(yangContainer1.getName(), is("valid"));
+    }
+
+    /**
+     * Checks container statement as sub-statement of list.
+     */
+    @Test
+    public void processListSubStatementContainer() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ListSubStatementContainer.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module
+        YangList yangList1 = (YangList) yangNode.getChild();
+        assertThat(yangList1.getName(), is("ospf"));
+
+        ListIterator<String> keyList = yangList1.getKeyList().listIterator();
+        assertThat(keyList.next(), is("process-id"));
+
+        // Check whether the list is child of list
+        YangContainer yangContainer = (YangContainer) yangList1.getChild();
+        assertThat(yangContainer.getName(), is("interface"));
+    }
+
+    /**
+     * Checks container with all its sub-statements.
+     */
+    @Test
+    public void processContainerSubStatements() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ContainerSubStatements.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.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
+        YangContainer yangContainer = (YangContainer) yangNode.getChild();
+
+        // Check whether container properties as set correctly.
+        assertThat(yangContainer.getName(), is("ospf"));
+
+        assertThat(yangContainer.isConfig(), is(true));
+        assertThat(yangContainer.getPresence(), is("\"ospf logs\""));
+        assertThat(yangContainer.getDescription(), is("\"container description\""));
+        assertThat(yangContainer.getStatus(), is(YangStatusType.CURRENT));
+        assertThat(yangContainer.getReference(), is("\"container reference\""));
+
+        // Check whether leaf properties as set correctly.
+        ListIterator<YangLeaf> leafIterator = yangContainer.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
+        assertThat(leafInfo.getUnits(), is("\"seconds\""));
+        assertThat(leafInfo.getStatus(), is(YangStatusType.CURRENT));
+        assertThat(leafInfo.getReference(), is("\"RFC 6020\""));
+    }
+
+    /**
+     * Checks cardinality of sub-statements of container.
+     */
+    @Test
+    public void processContainerSubStatementCardinality() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error: \"reference\" is defined more than once in \"container valid\".");
+        YangNode node = manager.getDataModel("src/test/resources/ContainerSubStatementCardinality.yang");
+    }
+
+    /**
+     * Checks container as root node.
+     */
+    @Test
+    public void processContainerRootNode() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("no viable alternative at input 'container'");
+        YangNode node = manager.getDataModel("src/test/resources/ContainerRootNode.yang");
+    }
+
+    /**
+     * Checks invalid identifier for container statement.
+     */
+    @Test
+    public void processContainerInvalidIdentifier() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : container name 1valid is not valid.");
+        YangNode node = manager.getDataModel("src/test/resources/ContainerInvalidIdentifier.yang");
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/Decimal64ListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/Decimal64ListenerTest.java
new file mode 100644
index 0000000..8a54a51
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/Decimal64ListenerTest.java
@@ -0,0 +1,636 @@
+/*
+ * 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.hamcrest.core.Is;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.onosproject.yang.compiler.datamodel.YangDecimal64;
+import org.onosproject.yang.compiler.datamodel.YangDerivedInfo;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangRangeInterval;
+import org.onosproject.yang.compiler.datamodel.YangRangeRestriction;
+import org.onosproject.yang.compiler.datamodel.YangType;
+import org.onosproject.yang.compiler.datamodel.YangTypeDef;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.linker.exceptions.LinkerException;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for decimal64 listener.
+ */
+public class Decimal64ListenerTest {
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    /**
+     * Checks decimal64 statement with fraction-digits.
+     */
+    @Test
+    public void processDecimal64TypeStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/decimal64/Decimal64TypeStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), Is.is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("validDecimal"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("decimal64"));
+        assertThat(leafInfo.getDataType().getDataType(), Is.is(YangDataTypes.DECIMAL64));
+        assertThat(((YangDecimal64) leafInfo.getDataType().getDataTypeExtendedInfo()).getFractionDigit(),
+                   is(2));
+    }
+
+    /**
+     * Checks decimal64 statement with range statement.
+     */
+    @Test
+    public void processDecimal64TypeWithRangeStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/decimal64/Decimal64TypeWithRangeStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("validDecimal"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("decimal64"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.DECIMAL64));
+        assertThat(((YangDecimal64) leafInfo.getDataType().getDataTypeExtendedInfo()).getFractionDigit(),
+                   is(8));
+
+        YangRangeRestriction rangeRestriction = ((YangDecimal64<YangRangeRestriction>) leafInfo.getDataType()
+                .getDataTypeExtendedInfo())
+                .getRangeRestrictedExtendedInfo();
+
+        ListIterator<YangRangeInterval> rangeListIterator = rangeRestriction.getAscendingRangeIntervals()
+                .listIterator();
+        YangRangeInterval rangeInterval = rangeListIterator.next();
+        assertThat(((YangDecimal64) rangeInterval.getStartValue()).getValue().doubleValue(), is(-92233720368.54775808));
+        assertThat(((YangDecimal64) rangeInterval.getEndValue()).getValue().doubleValue(), is(92233720368.54775807));
+    }
+
+    /**
+     * Successful validation of decimal64 statement.
+     */
+    @Test
+    public void processDecimal64ValueSuccessfulValidation() throws IOException, ParserException, DataModelException {
+
+        YangNode node = manager.getDataModel("src/test/resources/decimal64/Decimal64TypeValidation.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+        YangDecimal64 decimal64 = (YangDecimal64) leafInfo.getDataType().getDataTypeExtendedInfo();
+
+        assertThat(leafInfo.getName(), is("validDecimal"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("decimal64"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.DECIMAL64));
+        assertThat(decimal64.getFractionDigit(), is(18));
+
+        decimal64.setValue(new BigDecimal(-9.223372036854775808));
+        decimal64.validateDecimal64();
+        decimal64.setValue(new BigDecimal(9.223372036854775807));
+        decimal64.validateDecimal64();
+    }
+
+    /**
+     * Failure validation of decimal64 statement.
+     */
+    @Test
+    public void processDecimal64ValueFailureValidation() throws IOException, ParserException, DataModelException {
+        thrown.expect(DataModelException.class);
+        thrown.expectMessage(
+                "YANG file error : value is not in decimal64 range.");
+
+        YangNode node = manager.getDataModel("src/test/resources/decimal64/Decimal64TypeValidation.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+        YangDecimal64 decimal64 = (YangDecimal64) leafInfo.getDataType().getDataTypeExtendedInfo();
+
+        assertThat(leafInfo.getName(), is("validDecimal"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("decimal64"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.DECIMAL64));
+        assertThat(decimal64.getFractionDigit(), is(18));
+
+        decimal64.setValue(new BigDecimal(-92233720368547758.08));
+        // validation should fail
+        decimal64.validateDecimal64();
+    }
+
+    /**
+     * Validation of invalid maximum value limit of fraction-digits.
+     */
+    @Test
+    public void processDecimal64InvalidMaxFraction() throws IOException, ParserException, DataModelException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : fraction-digits value should be between 1 and 18.");
+
+        manager.getDataModel("src/test/resources/decimal64/Decimal64TypeInvalidMaxValueFraction.yang");
+    }
+
+    /**
+     * Validation of invalid (0) minimum value limit of fraction-digits.
+     */
+    @Test
+    public void processDecimal64InvalidMinFraction1() throws IOException, ParserException, DataModelException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : fraction-digits value should be between 1 and 18.");
+
+        manager.getDataModel("src/test/resources/decimal64/Decimal64TypeInvalidMinValueFraction1.yang");
+    }
+
+    /**
+     * Validation of invalid (-1) minimum value limit of fraction-digits.
+     */
+    @Test
+    public void processDecimal64InvalidMinFraction2() throws IOException, ParserException, DataModelException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : fraction-digits value should be between 1 and 18.");
+
+        manager.getDataModel("src/test/resources/decimal64/Decimal64TypeInvalidMinValueFraction2.yang");
+    }
+
+    /**
+     * Validation of decimal64 range statement.
+     */
+    @Test
+    public void processDecimal64TypeWithMultiValueRangeStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/decimal64/Decimal64TypeWithMultiValueRangeStmnt.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("validDecimal"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("decimal64"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.DECIMAL64));
+        assertThat(((YangDecimal64) leafInfo.getDataType().getDataTypeExtendedInfo()).getFractionDigit(),
+                   is(18));
+
+        YangRangeRestriction rangeRestriction = ((YangDecimal64<YangRangeRestriction>) leafInfo.getDataType()
+                .getDataTypeExtendedInfo())
+                .getRangeRestrictedExtendedInfo();
+
+        ListIterator<YangRangeInterval> rangeListIterator = rangeRestriction.getAscendingRangeIntervals()
+                .listIterator();
+        // range "1 .. 3.14 | 10 | 20..max";
+        // check first range 1 .. 3.14
+        YangRangeInterval rangeInterval = rangeListIterator.next();
+        assertThat(((YangDecimal64) rangeInterval.getStartValue()).getValue().doubleValue(), is(-9.22));
+        assertThat(((YangDecimal64) rangeInterval.getEndValue()).getValue().doubleValue(), is(7.22));
+        // check second range 10
+        rangeInterval = rangeListIterator.next();
+        assertThat(((YangDecimal64) rangeInterval.getStartValue()).getValue().doubleValue(), is(8.0));
+        assertThat(((YangDecimal64) rangeInterval.getEndValue()).getValue().doubleValue(), is(8.0));
+        // check third range 20..max
+        rangeInterval = rangeListIterator.next();
+        assertThat(((YangDecimal64) rangeInterval.getStartValue()).getValue().doubleValue(), is(9.0));
+        assertThat(((YangDecimal64) rangeInterval.getEndValue()).getValue().doubleValue(), is(9.223372036854776));
+    }
+
+    /**
+     * Validation of decimal64 with invalid range.
+     */
+    @Test
+    public void processDecimal64InvalidRange() throws IOException, ParserException, DataModelException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage(
+                "YANG file error : decimal64 validation failed.decimal64 in 7 at 12" +
+                        " in src/test/resources/decimal64/Decimal64TypeInvalidRangeStmnt.yang\"");
+
+        manager.getDataModel("src/test/resources/decimal64/Decimal64TypeInvalidRangeStmnt.yang");
+    }
+
+    /**
+     * Validation of decimal64 without fraction-digits. Fraction-digits must be present for decimal64.
+     */
+    @Test
+    public void processDecimal64WithoutFraction() throws IOException, ParserException, DataModelException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : a type decimal64 must have fraction-digits statement.");
+
+        manager.getDataModel("src/test/resources/decimal64/Decimal64TypeWithoutFraction.yang");
+    }
+
+    /**
+     * Checks decimal64 with typedef statement.
+     */
+    @Test
+    public void processDecimal64TypedefStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/decimal64/Decimal64TypedefStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("setFourDecimal"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("validDecimal"));
+        YangType<YangDerivedInfo> derivedInfoType = (YangType<YangDerivedInfo>) leafInfo.getDataType();
+        YangDerivedInfo derivedInfo = (YangDerivedInfo) derivedInfoType.getDataTypeExtendedInfo();
+        YangTypeDef typedef = (YangTypeDef) derivedInfo.getReferredTypeDef();
+        assertThat(typedef.getName(), is("validDecimal"));
+
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.DERIVED));
+        YangType type = typedef.getTypeList().iterator().next();
+        assertThat(type.getDataType(), is(YangDataTypes.DECIMAL64));
+        assertThat(type.getDataTypeName(), is("decimal64"));
+        YangType<YangDecimal64> decimal64Type = (YangType<YangDecimal64>) typedef.getTypeList().iterator().next();
+        YangDecimal64 decimal64 = decimal64Type.getDataTypeExtendedInfo();
+        assertThat(decimal64.getFractionDigit(), is(4));
+    }
+
+    /**
+     * Checks decimal64 with multiple typedef statement.
+     */
+    @Test
+    public void processDecimal64MultiTypedefStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/decimal64/Decimal64MultiTypedefStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // check leaf type
+        assertThat(leafInfo.getName(), is("lowerDecimal"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("midDecimal"));
+        YangType<YangDerivedInfo> derivedInfoType = (YangType<YangDerivedInfo>) leafInfo.getDataType();
+        assertThat(derivedInfoType.getDataType(), is(YangDataTypes.DERIVED));
+        YangDerivedInfo derivedInfo = (YangDerivedInfo) derivedInfoType.getDataTypeExtendedInfo();
+
+        // check previous typedef
+        YangTypeDef prevTypedef = (YangTypeDef) derivedInfo.getReferredTypeDef();
+        assertThat(prevTypedef.getName(), is("midDecimal"));
+        YangType type = prevTypedef.getTypeList().iterator().next();
+        assertThat(type.getDataType(), is(YangDataTypes.DERIVED));
+        derivedInfo = (YangDerivedInfo) type.getDataTypeExtendedInfo();
+
+        // check top typedef
+        YangTypeDef topTypedef = (YangTypeDef) derivedInfo.getReferredTypeDef();
+        assertThat(topTypedef.getName(), is("topDecimal"));
+        type = topTypedef.getTypeList().iterator().next();
+        assertThat(type.getDataType(), is(YangDataTypes.DECIMAL64));
+        assertThat(type.getDataTypeName(), is("decimal64"));
+        YangType<YangDecimal64> decimal64Type = (YangType<YangDecimal64>) type;
+        YangDecimal64 decimal64 = decimal64Type.getDataTypeExtendedInfo();
+        assertThat(decimal64.getFractionDigit(), is(4));
+    }
+
+    /**
+     * Checks decimal64 with multiple typedef with single range statement.
+     * Range value in typedef statement.
+     */
+    @Test
+    public void processDecimal64MultiTypedefRangeStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/decimal64/Decimal64MultiTypedefRangeStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // check leaf type
+        assertThat(leafInfo.getName(), is("lowerDecimal"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("midDecimal"));
+        YangType<YangDerivedInfo> derivedInfoType = (YangType<YangDerivedInfo>) leafInfo.getDataType();
+        assertThat(derivedInfoType.getDataType(), is(YangDataTypes.DERIVED));
+        YangDerivedInfo derivedInfo = (YangDerivedInfo) derivedInfoType.getDataTypeExtendedInfo();
+
+        // Check range restriction
+        YangRangeRestriction rangeRestriction = (YangRangeRestriction) derivedInfo.getResolvedExtendedInfo();
+        ListIterator<YangRangeInterval> rangeListIterator = rangeRestriction.getAscendingRangeIntervals()
+                .listIterator();
+        YangRangeInterval rangeInterval = rangeListIterator.next();
+        assertThat(((YangDecimal64) rangeInterval.getStartValue()).getValue().doubleValue(), is(1.0));
+        assertThat(((YangDecimal64) rangeInterval.getEndValue()).getValue().doubleValue(), is(12.0));
+
+        // check previous typedef
+        YangTypeDef prevTypedef = (YangTypeDef) derivedInfo.getReferredTypeDef();
+        assertThat(prevTypedef.getName(), is("midDecimal"));
+        YangType type = prevTypedef.getTypeList().iterator().next();
+        assertThat(type.getDataType(), is(YangDataTypes.DERIVED));
+        derivedInfo = (YangDerivedInfo) type.getDataTypeExtendedInfo();
+
+        // check top typedef
+        YangTypeDef topTypedef = (YangTypeDef) derivedInfo.getReferredTypeDef();
+        assertThat(topTypedef.getName(), is("topDecimal"));
+        type = topTypedef.getTypeList().iterator().next();
+        assertThat(type.getDataType(), is(YangDataTypes.DECIMAL64));
+        assertThat(type.getDataTypeName(), is("decimal64"));
+        YangType<YangDecimal64> decimal64Type = (YangType<YangDecimal64>) type;
+        YangDecimal64 decimal64 = decimal64Type.getDataTypeExtendedInfo();
+        assertThat(decimal64.getFractionDigit(), is(4));
+
+        // Check range restriction
+        rangeRestriction = (YangRangeRestriction) decimal64.getRangeRestrictedExtendedInfo();
+        rangeListIterator = rangeRestriction.getAscendingRangeIntervals().listIterator();
+        rangeInterval = rangeListIterator.next();
+        assertThat(((YangDecimal64) rangeInterval.getStartValue()).getValue().doubleValue(), is(1.0));
+        assertThat(((YangDecimal64) rangeInterval.getEndValue()).getValue().doubleValue(), is(12.0));
+    }
+
+    /**
+     * Checks decimal64 with multiple typedef with single range statement.
+     * Range value in leaf statement.
+     */
+    @Test
+    public void processDecimal64MultiTypedefRangeInLeafStatement() throws IOException, ParserException {
+
+        YangNode node = manager
+                .getDataModel("src/test/resources/decimal64/Decimal64MultiTypedefRangeInLeafStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // check leaf type
+        assertThat(leafInfo.getName(), is("lowerDecimal"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("midDecimal"));
+        YangType<YangDerivedInfo> derivedInfoType = (YangType<YangDerivedInfo>) leafInfo.getDataType();
+        assertThat(derivedInfoType.getDataType(), is(YangDataTypes.DERIVED));
+        YangDerivedInfo derivedInfo = (YangDerivedInfo) derivedInfoType.getDataTypeExtendedInfo();
+
+        // Check range restriction
+        YangRangeRestriction rangeRestriction = (YangRangeRestriction) derivedInfo.getResolvedExtendedInfo();
+        ListIterator<YangRangeInterval> rangeListIterator = rangeRestriction.getAscendingRangeIntervals()
+                .listIterator();
+        YangRangeInterval rangeInterval = rangeListIterator.next();
+        assertThat(((YangDecimal64) rangeInterval.getStartValue()).getValue().doubleValue(), is(1.0));
+        assertThat(((YangDecimal64) rangeInterval.getEndValue()).getValue().doubleValue(), is(12.0));
+
+        // check previous typedef
+        YangTypeDef prevTypedef = (YangTypeDef) derivedInfo.getReferredTypeDef();
+        assertThat(prevTypedef.getName(), is("midDecimal"));
+        YangType type = prevTypedef.getTypeList().iterator().next();
+        assertThat(type.getDataType(), is(YangDataTypes.DERIVED));
+        derivedInfo = (YangDerivedInfo) type.getDataTypeExtendedInfo();
+
+        // check top typedef
+        YangTypeDef topTypedef = (YangTypeDef) derivedInfo.getReferredTypeDef();
+        assertThat(topTypedef.getName(), is("topDecimal"));
+        type = topTypedef.getTypeList().iterator().next();
+        assertThat(type.getDataType(), is(YangDataTypes.DECIMAL64));
+        assertThat(type.getDataTypeName(), is("decimal64"));
+        YangType<YangDecimal64> decimal64Type = (YangType<YangDecimal64>) type;
+        YangDecimal64 decimal64 = decimal64Type.getDataTypeExtendedInfo();
+        assertThat(decimal64.getFractionDigit(), is(4));
+    }
+
+    /**
+     * Checks decimal64 with multiple typedef with multiple range statement.
+     * Having more restricted range at leaf.
+     */
+    @Test
+    public void processDecimal64MultiTypedefMultipleRangeStatement() throws IOException, ParserException {
+
+        YangNode node = manager
+                .getDataModel("src/test/resources/decimal64/Decimal64MultiTypedefMultiRangeStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // check leaf type
+        assertThat(leafInfo.getName(), is("lowerDecimal"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("midDecimal"));
+        YangType<YangDerivedInfo> derivedInfoType = (YangType<YangDerivedInfo>) leafInfo.getDataType();
+        assertThat(derivedInfoType.getDataType(), is(YangDataTypes.DERIVED));
+        YangDerivedInfo derivedInfo = (YangDerivedInfo) derivedInfoType.getDataTypeExtendedInfo();
+
+        // Check range restriction
+        YangRangeRestriction rangeRestriction = (YangRangeRestriction) derivedInfo.getResolvedExtendedInfo();
+
+        ListIterator<YangRangeInterval> rangeListIterator = rangeRestriction.getAscendingRangeIntervals()
+                .listIterator();
+        YangRangeInterval rangeInterval = rangeListIterator.next();
+        assertThat(((YangDecimal64) rangeInterval.getStartValue()).getValue().doubleValue(), is(4.0));
+        assertThat(((YangDecimal64) rangeInterval.getEndValue()).getValue().doubleValue(), is(11.0));
+
+        // check previous typedef
+        YangTypeDef prevTypedef = (YangTypeDef) derivedInfo.getReferredTypeDef();
+        assertThat(prevTypedef.getName(), is("midDecimal"));
+        YangType type = prevTypedef.getTypeList().iterator().next();
+        assertThat(type.getDataType(), is(YangDataTypes.DERIVED));
+        derivedInfo = (YangDerivedInfo) type.getDataTypeExtendedInfo();
+
+        // check top typedef
+        YangTypeDef topTypedef = (YangTypeDef) derivedInfo.getReferredTypeDef();
+        assertThat(topTypedef.getName(), is("topDecimal"));
+        type = topTypedef.getTypeList().iterator().next();
+        assertThat(type.getDataType(), is(YangDataTypes.DECIMAL64));
+        assertThat(type.getDataTypeName(), is("decimal64"));
+        YangType<YangDecimal64> decimal64Type = (YangType<YangDecimal64>) type;
+        YangDecimal64 decimal64 = decimal64Type.getDataTypeExtendedInfo();
+        assertThat(decimal64.getFractionDigit(), is(4));
+
+        // Check range restriction
+        rangeRestriction = (YangRangeRestriction) decimal64.getRangeRestrictedExtendedInfo();
+        rangeListIterator = rangeRestriction.getAscendingRangeIntervals().listIterator();
+        rangeInterval = rangeListIterator.next();
+        assertThat(((YangDecimal64) rangeInterval.getStartValue()).getValue().doubleValue(), is(1.0));
+        assertThat(((YangDecimal64) rangeInterval.getEndValue()).getValue().doubleValue(), is(12.0));
+    }
+
+    /**
+     * Checks decimal64 with multiple typedef with multiple range statement.
+     * But having more restricted range at top of typedef.
+     */
+    @Test
+    public void processDecimal64MultiTypedefMultiInvalidRangeStatement() throws IOException, LinkerException {
+        thrown.expect(LinkerException.class);
+        thrown.expectMessage(
+                "Range interval doesn't fall within the referred restriction ranges" +
+                        " restriction ranges. in 0 at 0 in src/test/resources/decimal64/" +
+                        "Decimal64MultiTypedefMultiInvalidRangeStatement.yang\"type." +
+                        " in 19 at 12 in src/test/resources/decimal64/Decimal64MultiTypedef" +
+                        "MultiInvalidRangeStatement.yang");
+
+        manager.getDataModel("src/test/resources/decimal64/Decimal64MultiTypedefMultiInvalidRangeStatement.yang");
+    }
+
+    /**
+     * Checks decimal64 with multiple typedef with max range statement.
+     */
+    @Test
+    public void processDecimal64MultiTypedefWithMaxRange() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/decimal64/Decimal64MultiTypedefWithMaxRange.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // check leaf type
+        assertThat(leafInfo.getName(), is("lowerDecimal"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("midDecimal"));
+        YangType<YangDerivedInfo> derivedInfoType = (YangType<YangDerivedInfo>) leafInfo.getDataType();
+        assertThat(derivedInfoType.getDataType(), is(YangDataTypes.DERIVED));
+        YangDerivedInfo derivedInfo = (YangDerivedInfo) derivedInfoType.getDataTypeExtendedInfo();
+
+        // Check range restriction
+        YangRangeRestriction rangeRestriction = (YangRangeRestriction) derivedInfo.getResolvedExtendedInfo();
+
+        ListIterator<YangRangeInterval> rangeListIterator = rangeRestriction.getAscendingRangeIntervals()
+                .listIterator();
+        YangRangeInterval rangeInterval = rangeListIterator.next();
+        assertThat(((YangDecimal64) rangeInterval.getStartValue()).getValue().doubleValue(), is(4.0));
+        assertThat(((YangDecimal64) rangeInterval.getEndValue()).getValue().doubleValue(), is(12.0));
+
+        // check previous typedef
+        YangTypeDef prevTypedef = (YangTypeDef) derivedInfo.getReferredTypeDef();
+        assertThat(prevTypedef.getName(), is("midDecimal"));
+        YangType type = prevTypedef.getTypeList().iterator().next();
+        assertThat(type.getDataType(), is(YangDataTypes.DERIVED));
+        derivedInfo = (YangDerivedInfo) type.getDataTypeExtendedInfo();
+
+        // check top typedef
+        YangTypeDef topTypedef = (YangTypeDef) derivedInfo.getReferredTypeDef();
+        assertThat(topTypedef.getName(), is("topDecimal"));
+        type = topTypedef.getTypeList().iterator().next();
+        assertThat(type.getDataType(), is(YangDataTypes.DECIMAL64));
+        assertThat(type.getDataTypeName(), is("decimal64"));
+        YangType<YangDecimal64> decimal64Type = (YangType<YangDecimal64>) type;
+        YangDecimal64 decimal64 = decimal64Type.getDataTypeExtendedInfo();
+        assertThat(decimal64.getFractionDigit(), is(4));
+
+        // Check range restriction
+        rangeRestriction = (YangRangeRestriction) decimal64.getRangeRestrictedExtendedInfo();
+        rangeListIterator = rangeRestriction.getAscendingRangeIntervals().listIterator();
+        rangeInterval = rangeListIterator.next();
+        assertThat(((YangDecimal64) rangeInterval.getStartValue()).getValue().doubleValue(), is(1.0));
+        assertThat(((YangDecimal64) rangeInterval.getEndValue()).getValue().doubleValue(), is(12.0));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/DefaultListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/DefaultListenerTest.java
new file mode 100644
index 0000000..b2c0ef0
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/DefaultListenerTest.java
@@ -0,0 +1,525 @@
+/*
+ * 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.YangChoice;
+import org.onosproject.yang.compiler.datamodel.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangDerivedInfo;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangType;
+import org.onosproject.yang.compiler.datamodel.YangTypeDef;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.DataTypeException;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangInt64;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test cases for testing default listener functionality.
+ */
+public class DefaultListenerTest {
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks if default value is set correctly.
+     */
+    @Test
+    public void processDefaultValueInLeafSubStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/default/DefaultValueInLeafSubStatement.yang");
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDefaultValueInString(), is("1"));
+    }
+
+    /**
+     * Validates default invalid value in leaf.
+     */
+    @Test
+    public void processDefaultInalueInLeafSubStatement() throws IOException, ParserException {
+
+        thrown.expect(DataTypeException.class);
+        thrown.expectMessage("YANG file error : Input value \"x\" is not a valid uint16.");
+
+        manager.getDataModel("src/test/resources/default/DefaultInvalidValueInLeafSubStatement.yang");
+    }
+
+    /**
+     * Validates default case value in choice statement.
+     */
+    @Test
+    public void processDefaultCaseInChoiceSubStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/default/DefaultCaseInChoiceSubStatement.yang");
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangContainer yangContainer = (YangContainer) yangNode.getChild();
+        assertThat(yangContainer.getName(), is("food"));
+
+        YangChoice yangChoice = (YangChoice) yangContainer.getChild();
+        assertThat(yangChoice.getName(), is("snack"));
+        assertThat(yangChoice.getDefaultValueInString(), is("sports-arena"));
+    }
+
+    /**
+     * Validates default invalide case in choice statement.
+     */
+    @Test
+    public void processDefaultInvalidCaseInChoiceSubStatement() throws IOException, ParserException {
+
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("Internal parser error detected: Invalid content in choice \"snack\" after processing.");
+
+        manager.getDataModel("src/test/resources/default/DefaultInvalidValueInChoiceSubStmt.yang");
+    }
+
+    /**
+     * Validates default value in typedef.
+     */
+    @Test
+    public void processDefaultInTypedef() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/default/DefaultValueInTypeDef.yang");
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // check typedef
+        YangTypeDef typedef = (YangTypeDef) yangNode.getChild();
+        assertThat(typedef.getName(), is("topInt"));
+        assertThat(typedef.getDefaultValueInString(), is("10"));
+
+        YangType type = typedef.getTypeList().iterator().next();
+        assertThat(type.getDataType(), is(YangDataTypes.INT64));
+        assertThat(type.getDataTypeName(), is("int64"));
+
+        // check leaf
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+        assertThat(leafInfo.getName(), is("myValue"));
+
+        // Check leaf reffered typedef
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("topInt"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.DERIVED));
+        YangType<YangDerivedInfo> typeDerived = (YangType<YangDerivedInfo>) leafInfo.getDataType();
+        YangDerivedInfo derivedInfo = (YangDerivedInfo) typeDerived.getDataTypeExtendedInfo();
+        YangTypeDef prevTypedef = (YangTypeDef) derivedInfo.getReferredTypeDef();
+        assertThat(prevTypedef.getName(), is("topInt"));
+        assertThat(prevTypedef.getDefaultValueInString(), is("10"));
+        YangType topType = prevTypedef.getTypeList().iterator().next();
+        assertThat(topType.getDataType(), is(YangDataTypes.INT64));
+        assertThat(topType.getDataTypeName(), is("int64"));
+        YangType<YangInt64> typeInt64 = (YangType<YangInt64>) topType;
+        YangInt64 int64Obj = typeInt64.getDataTypeExtendedInfo();
+    }
+
+    /**
+     * Validates invalid default value in typedef.
+     */
+    @Test
+    public void processInvalidDefaultValueInTypdeDef() throws IOException, ParserException {
+        thrown.expect(DataTypeException.class);
+        thrown.expectMessage("YANG file error : Input value \"x\" is not a valid int64.");
+
+        manager.getDataModel("src/test/resources/default/DefaultInvalidValueInTypeDef.yang");
+    }
+
+    /**
+     * Validates default invalid value in typedef.
+     */
+    @Test
+    public void processDefaultInvalidValueInTypedef() throws IOException, ParserException {
+        thrown.expect(DataTypeException.class);
+        thrown.expectMessage("YANG file error : Input value \"0\" is not a valid INT32");
+
+        manager.getDataModel("src/test/resources/default/DefaultInvalidValueWithRangeInTypedef.yang");
+    }
+
+    /**
+     * Validates default value decimal64 in leaf.
+     */
+    @Test
+    public void processDefaultValueDecimal64InLeaf() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/default/DefaultValueDecimal64InLeaf.yang");
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // check leaf
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // check the default value
+        // This default value is verified by YangType.isValidValue() called from LeafListener.processLeafExit()
+        assertThat(leafInfo.getName(), is("mydecimal"));
+        assertThat(leafInfo.getDefaultValueInString(), is("5"));
+    }
+
+    /**
+     * Validates default invalid value decimal64 in leaf.
+     */
+    @Test
+    public void processDefaultInvalidValueDecimal64InLeaf() throws IOException, ParserException {
+        thrown.expect(DataTypeException.class);
+        thrown.expectMessage("YANG file error : Input value \"x\" is not a valid decimal64.");
+
+        manager.getDataModel("src/test/resources/default/DefaultInvalidValueDecimal64InLeaf.yang");
+    }
+
+    /**
+     * Validates default value string in leaf.
+     */
+    @Test
+    public void processDefaultValueStringInLeaf() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/default/DefaultValueStringInLeaf.yang");
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // check leaf
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // check the default value
+        // This default value is verified by YangType.isValidValue() called from LeafListener.processLeafExit()
+        assertThat(leafInfo.getName(), is("MyString"));
+        assertThat(leafInfo.getDefaultValueInString(), is("2bB"));
+    }
+
+    /**
+     * Validates default invalid value string in leaf.
+     */
+    @Test
+    public void processDefaultInvalidValueStringInLeaf() throws IOException, ParserException {
+        thrown.expect(DataTypeException.class);
+        thrown.expectMessage("YANG file error : Input value \"2bB2bB\" is not a valid STRING");
+
+        manager.getDataModel("src/test/resources/default/DefaultInvalidValueStringInLeaf.yang");
+    }
+
+    /**
+     * Validates default value boolean in leaf.
+     */
+    @Test
+    public void processDefaultValueBooleanInLeaf() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/default/DefaultValueBooleanInLeaf.yang");
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // check leaf
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // check the default value
+        // This default value is verified by YangType.isValidValue() called from LeafListener.processLeafExit()
+        assertThat(leafInfo.getName(), is("myboolean"));
+        assertThat(leafInfo.getDefaultValueInString(), is("true"));
+    }
+
+    /**
+     * Validates default invalid value boolean in leaf.
+     */
+    @Test
+    public void processDefaultInvalidValueBooleanInLeaf() throws IOException, ParserException {
+        thrown.expect(DataTypeException.class);
+        thrown.expectMessage("YANG file error : Input value \"yes\" is not a valid BOOLEAN");
+
+        manager.getDataModel("src/test/resources/default/DefaultInvalidValueBooleanInLeaf.yang");
+    }
+
+    /**
+     * Validates default value enumeration in leaf.
+     */
+    @Test
+    public void processDefaultValueEnumberationInLeaf() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/default/DefaultValueEnumerationInLeaf.yang");
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // check leaf
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // check the default value
+        // This default value is verified by YangType.isValidValue() called from LeafListener.processLeafExit()
+        assertThat(leafInfo.getName(), is("myenum"));
+        assertThat(leafInfo.getDefaultValueInString(), is("one"));
+    }
+
+    /**
+     * Validates default invalid value enumeration in leaf.
+     */
+    @Test
+    public void processDefaultInvalidValueEnumberationInLeaf() throws IOException, ParserException {
+        thrown.expect(DataTypeException.class);
+        thrown.expectMessage("YANG file error : Input value \"xyz\" is not a valid ENUMERATION");
+
+        manager.getDataModel("src/test/resources/default/DefaultInvalidValueEnumerationInLeaf.yang");
+    }
+
+    /**
+     * Validates default value bits in leaf.
+     */
+    @Test
+    public void processDefaultValueBitsInLeaf() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/default/DefaultValueBitsInLeaf.yang");
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // check leaf
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // check the default value
+        // This default value is verified by YangType.isValidValue() called from LeafListener.processLeafExit()
+        assertThat(leafInfo.getName(), is("mybits"));
+        assertThat(leafInfo.getDefaultValueInString(), is("auto-sense-speed"));
+    }
+
+    /**
+     * Validates default invalid value bits in leaf.
+     */
+    @Test
+    public void processDefaultInvalidValueBitsInLeaf() throws IOException, ParserException {
+        thrown.expect(DataTypeException.class);
+        thrown.expectMessage("YANG file error : Input value \"xyz\" is not a valid BITS");
+
+        manager.getDataModel("src/test/resources/default/DefaultInvalidValueBitsInLeaf.yang");
+    }
+
+    /**
+     * Validates default value binary in leaf.
+     */
+    @Test
+    public void processDefaultValueBinaryInLeaf() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/default/DefaultValueBinaryInLeaf.yang");
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // check leaf
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // check the default value
+        // This default value is verified by YangType.isValidValue() called from LeafListener.processLeafExit()
+        assertThat(leafInfo.getName(), is("message"));
+        assertThat(leafInfo.getDefaultValueInString(), is("10010010"));
+    }
+
+    /**
+     * Validates default invalid value binary in leaf.
+     */
+    @Test
+    public void processDefaultInvlaidValueBinaryInLeaf() throws IOException, ParserException {
+        thrown.expect(DataTypeException.class);
+        thrown.expectMessage("YANG file error : Input value \"000\" is not a valid BINARY");
+
+        manager.getDataModel("src/test/resources/default/DefaultInvalidValueBinaryInLeaf.yang");
+    }
+
+    /**
+     * Validates default value empty in leaf.
+     */
+    @Test
+    public void processDefaultValueEmptyInLeaf() throws IOException, ParserException {
+        thrown.expect(DataTypeException.class);
+        thrown.expectMessage("YANG file error : Input value \"something\" is not allowed for a data type EMPTY");
+
+        manager.getDataModel("src/test/resources/default/DefaultValueEmptyInLeaf.yang");
+    }
+
+    /**
+     * Validates default value union in leaf.
+     */
+    @Test
+    public void processDefaultValueUnionInLeaf() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/default/DefaultValueUnionInLeaf.yang");
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // check leaf
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // check the default value
+        // This default value is verified by YangType.isValidValue() called from LeafListener.processLeafExit()
+        assertThat(leafInfo.getName(), is("message"));
+        assertThat(leafInfo.getDefaultValueInString(), is("unbounded"));
+    }
+
+    /**
+     * Validates default invalid value union in leaf.
+     */
+    @Test
+    public void processDefaultInvalidValueUnionInLeaf() throws IOException, ParserException {
+        thrown.expect(DataTypeException.class);
+        thrown.expectMessage("YANG file error : Input value \"xyz\" is not a valid UNION");
+
+        manager.getDataModel("src/test/resources/default/DefaultInvalidValueUnionInLeaf.yang");
+    }
+
+    /**
+     * Validates default value in multiple typedef.
+     */
+    @Test
+    public void processDefaultInMultiTypedef() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/default/DefaultValueInMultiTypeDef.yang");
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // check typedef
+        YangTypeDef typedef = (YangTypeDef) yangNode.getChild();
+        assertThat(typedef.getName(), is("topInt"));
+        assertThat(typedef.getDefaultValueInString(), is("10"));
+
+        YangType type = typedef.getTypeList().iterator().next();
+        assertThat(type.getDataType(), is(YangDataTypes.INT64));
+        assertThat(type.getDataTypeName(), is("int64"));
+
+        // check leaf
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+        assertThat(leafInfo.getName(), is("lowInt"));
+
+        // check leaf type
+        assertThat(leafInfo.getName(), is("lowInt"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("midInt"));
+        YangType<YangDerivedInfo> derivedInfoType = (YangType<YangDerivedInfo>) leafInfo.getDataType();
+        assertThat(derivedInfoType.getDataType(), is(YangDataTypes.DERIVED));
+        YangDerivedInfo derivedInfo = (YangDerivedInfo) derivedInfoType.getDataTypeExtendedInfo();
+
+        // check previous typedef
+        YangTypeDef prevTypedef = (YangTypeDef) derivedInfo.getReferredTypeDef();
+        assertThat(prevTypedef.getName(), is("midInt"));
+        type = prevTypedef.getTypeList().iterator().next();
+        assertThat(type.getDataType(), is(YangDataTypes.DERIVED));
+        derivedInfo = (YangDerivedInfo) type.getDataTypeExtendedInfo();
+
+        // check top typedef
+        YangTypeDef topTypedef = (YangTypeDef) derivedInfo.getReferredTypeDef();
+        assertThat(topTypedef.getName(), is("topInt"));
+        assertThat(topTypedef.getDefaultValueInString(), is("10"));
+        YangType topType = topTypedef.getTypeList().iterator().next();
+        assertThat(topType.getDataType(), is(YangDataTypes.INT64));
+        assertThat(topType.getDataTypeName(), is("int64"));
+        YangType<YangInt64> typeInt64 = (YangType<YangInt64>) topType;
+        YangInt64 int64Obj = typeInt64.getDataTypeExtendedInfo();
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/DescriptionListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/DescriptionListenerTest.java
new file mode 100644
index 0000000..43b73d4
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/DescriptionListenerTest.java
@@ -0,0 +1,252 @@
+/*
+ * 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.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.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangStatusType;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for description listener.
+ */
+public class DescriptionListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks valid description statement.
+     */
+    @Test
+    public void processDescriptionValidStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/DescriptionValidStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // Check whether the description is set correctly.
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDescription(), is("\"Interval before a route is declared invalid\""));
+    }
+
+    /**
+     * Checks whether exception is thrown for invalid description statement.
+     */
+    @Test
+    public void processDescriptionWithoutStatementEnd() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("extraneous input '}' expecting {';', '+'}");
+        YangNode node = manager.getDataModel("src/test/resources/DescriptionWithoutStatementEnd.yang");
+    }
+
+    /**
+     * Checks valid description statement as sub-statement of module.
+     */
+    @Test
+    public void processModuleSubStatementDescription() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ModuleSubStatementDescription.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the description is set correctly.
+        assertThat(yangNode.getDescription(), is("\"Interval before a route is declared invalid\""));
+    }
+
+    /**
+     * Checks valid description statement as sub-statement of module.
+     */
+    @Test
+    public void processDescriptionEmptyStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/DescriptionEmptyStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the description is set correctly.
+        assertThat(yangNode.getDescription(), is("\"\""));
+    }
+
+    /**
+     * Checks valid description statement as sub-statement of revision.
+     */
+    @Test
+    public void processRevisionSubStatementRevision() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RevisionSubStatementRevision.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the description is set correctly.
+        assertThat(yangNode.getDescription(), is("\"module description\""));
+        assertThat(yangNode.getRevision().getDescription(), is("\"revision description\""));
+    }
+
+    /**
+     * Checks description statement as sub-statement of container.
+     */
+    @Test
+    public void processContainerSubStatementDescription() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ContainerSubStatementDescription.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the description value is set correctly.
+        YangContainer container = (YangContainer) yangNode.getChild();
+        assertThat(container.getName(), is("valid"));
+        assertThat(container.getDescription(), is("\"container description\""));
+
+        // Check whether leaf properties as set correctly.
+        ListIterator<YangLeaf> leafIterator = container.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
+        assertThat(leafInfo.getUnits(), is("\"seconds\""));
+        assertThat(leafInfo.getDescription(), is("\"Interval before a route is declared invalid\""));
+        assertThat(leafInfo.isMandatory(), is(true));
+        assertThat(leafInfo.getStatus(), is(YangStatusType.CURRENT));
+        assertThat(leafInfo.getReference(), is("\"RFC 6020\""));
+    }
+
+    /**
+     * Checks description statement as sub-statement of list.
+     */
+    @Test
+    public void processListSubStatementDescription() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ListSubStatementDescription.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module and description value is set correctly.
+        YangList yangList = (YangList) yangNode.getChild();
+        assertThat(yangList.getName(), is("valid"));
+        assertThat(yangList.isConfig(), is(true));
+        assertThat(yangList.getDescription(), is("\"list description\""));
+
+        // Check whether leaf properties as set correctly.
+        ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
+        assertThat(leafInfo.getUnits(), is("\"seconds\""));
+        assertThat(leafInfo.getDescription(), is("\"Interval before a route is declared invalid\""));
+        assertThat(leafInfo.isMandatory(), is(true));
+        assertThat(leafInfo.getStatus(), is(YangStatusType.CURRENT));
+        assertThat(leafInfo.getReference(), is("\"RFC 6020\""));
+    }
+
+    /**
+     * Checks valid description statement as sub-statement of leaf-list.
+     */
+    @Test
+    public void processLeafListSubStatementDescription() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/LeafListSubStatementDescription.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        // Check whether description value is set correctly.
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.getDescription(), is("\"Interval before a route is declared invalid\""));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/EnumListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/EnumListenerTest.java
new file mode 100644
index 0000000..4f56ef8
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/EnumListenerTest.java
@@ -0,0 +1,148 @@
+/*
+ * 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.YangEnum;
+import org.onosproject.yang.compiler.datamodel.YangEnumeration;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.ListIterator;
+import java.util.SortedSet;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for enum listener.
+ */
+public class EnumListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks enum statement without value.
+     */
+    @Test
+    public void processEnumTypeStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/EnumTypeStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("speed"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("enumeration"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.ENUMERATION));
+        assertThat(((YangEnumeration) leafInfo.getDataType().getDataTypeExtendedInfo()).getName(),
+                is("speed_enum"));
+
+        SortedSet<YangEnum> enumSet = ((YangEnumeration) leafInfo.getDataType().getDataTypeExtendedInfo()).getEnumSet();
+        for (YangEnum tmp : enumSet) {
+            if (tmp.getNamedValue().equals("10m")) {
+                assertThat(tmp.getValue(), is(0));
+            } else if (tmp.getNamedValue().equals("100m")) {
+                assertThat(tmp.getValue(), is(1));
+            } else if (tmp.getNamedValue().equals("auto")) {
+                assertThat(tmp.getValue(), is(2));
+            }
+        }
+    }
+
+    /**
+     * Checks if enum with same name is not allowed.
+     */
+    @Test(expected = ParserException.class)
+    public void processEnumWithDuplicateName() throws IOException, ParserException {
+        YangNode node = manager.getDataModel("src/test/resources/EnumWithDuplicateName.yang");
+    }
+
+    /**
+     * Checks enum boundary value.
+     */
+    @Test
+    public void processEnumBoundaryValue() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : value value 21474836472147483647 is not valid.");
+        YangNode node = manager.getDataModel("src/test/resources/EnumBoundaryValue.yang");
+    }
+
+    /**
+     * Checks whether exception is thrown if value is not specified following max enum value.
+     */
+    @Test
+    public void processEnumMaxNextValue() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : "
+                + "An enum value MUST be specified for enum substatements following the one"
+                + "with the current highest value");
+        YangNode node = manager.getDataModel("src/test/resources/EnumMaxNextValue.yang");
+    }
+
+    /**
+     * Checks enum values stored are sorted.
+     */
+    @Test
+    public void processEnumSorted() throws IOException, ParserException {
+        YangNode node = manager.getDataModel("src/test/resources/EnumSorted.yang");
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("ifType"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("enumeration"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.ENUMERATION));
+        assertThat(((YangEnumeration) leafInfo.getDataType().getDataTypeExtendedInfo()).getName(),
+                is("ifType_enum"));
+
+        SortedSet<YangEnum> enumSet = ((YangEnumeration) leafInfo.getDataType().getDataTypeExtendedInfo()).getEnumSet();
+        Iterator<YangEnum> enumIterator = enumSet.iterator();
+        assertThat(enumIterator.next().getNamedValue(), is("five"));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ErrorAppTagListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ErrorAppTagListenerTest.java
new file mode 100644
index 0000000..8bd140c
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ErrorAppTagListenerTest.java
@@ -0,0 +1,83 @@
+/*
+ * 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.Test;
+import org.onosproject.yang.compiler.datamodel.YangAppErrorInfo;
+import org.onosproject.yang.compiler.datamodel.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangMust;
+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.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test-cases for testing error app tag message listener functionality.
+ */
+public class ErrorAppTagListenerTest {
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks if error app tag message is default updated in the data model.
+     */
+    @Test
+    public void processContainerSubStatementErrorDefaultAppTag() throws IOException, ParserException {
+        YangNode node = manager.getDataModel("src/test/resources/ContainerSubStatementErrorDefaultAppTag.yang");
+
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("ErrorAppTag"));
+
+        YangContainer yangContainer = (YangContainer) yangNode.getChild();
+        assertThat(yangContainer.getName(), is("interface"));
+
+        String expectedConstraint = "ifType != 'ethernet' or (ifType = 'ethernet' and ifMTU = 1500)";
+        List<YangMust> mustConstraintList = yangContainer.getListOfMust();
+        assertThat(mustConstraintList.iterator().next().getConstraint(), is(expectedConstraint));
+
+        YangAppErrorInfo yangAppErrorInfo = mustConstraintList.iterator().next().getAppErrorInfo();
+        assertThat(yangAppErrorInfo.getGetErrorAppTag(), is("must-violation"));
+        assertThat(yangAppErrorInfo.getGetErrorTag(), is("operation-failed"));
+    }
+
+    /**
+     * Checks if error app tag message listener updates the data model.
+     */
+    @Test
+    public void processContainerSubStatementErrorAppTag() throws IOException, ParserException {
+        YangNode node = manager.getDataModel("src/test/resources/ContainerSubStatementErrorAppTag.yang");
+
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("ErrorAppTag"));
+
+        YangContainer yangContainer = (YangContainer) yangNode.getChild();
+        assertThat(yangContainer.getName(), is("interface"));
+
+        String expectedConstraint = "ifType != 'ethernet' or (ifType = 'ethernet' and ifMTU = 1500)";
+        List<YangMust> mustConstraintList = yangContainer.getListOfMust();
+        assertThat(mustConstraintList.iterator().next().getConstraint(), is(expectedConstraint));
+
+        YangAppErrorInfo yangAppErrorInfo = mustConstraintList.iterator().next().getAppErrorInfo();
+        assertThat(yangAppErrorInfo.getGetErrorAppTag(), is("An ethernet MTU must be 1500"));
+        assertThat(yangAppErrorInfo.getGetErrorTag(), is("operation-failed"));
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ErrorMessageListnerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ErrorMessageListnerTest.java
new file mode 100644
index 0000000..7080ef4
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ErrorMessageListnerTest.java
@@ -0,0 +1,61 @@
+/*
+ * 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.Test;
+import org.onosproject.yang.compiler.datamodel.YangAppErrorInfo;
+import org.onosproject.yang.compiler.datamodel.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangMust;
+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.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test-cases for testing error message listener functionality.
+ */
+public class ErrorMessageListnerTest {
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks if error message listener updates the data model.
+     */
+    @Test
+    public void processContainerSubStatementErrorMessage() throws IOException, ParserException {
+        YangNode node = manager.getDataModel("src/test/resources/ContainerSubStatementErrorMessage.yang");
+
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("ErrorMessage"));
+
+        YangContainer yangContainer = (YangContainer) yangNode.getChild();
+        assertThat(yangContainer.getName(), is("interface"));
+
+        String expectedConstraint = "ifType != 'ethernet' or (ifType = 'ethernet' and ifMTU = 1500)";
+        List<YangMust> mustConstraintList = yangContainer.getListOfMust();
+        assertThat(mustConstraintList.iterator().next().getConstraint(), is(expectedConstraint));
+
+        YangAppErrorInfo yangAppErrorInfo = mustConstraintList.iterator().next().getAppErrorInfo();
+        assertThat(yangAppErrorInfo.getGetErrorMessage(), is("An ethernet MTU must be 1500"));
+        assertThat(yangAppErrorInfo.getGetErrorTag(), is("operation-failed"));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ExtensionListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ExtensionListenerTest.java
new file mode 100644
index 0000000..9fcc24d
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ExtensionListenerTest.java
@@ -0,0 +1,61 @@
+/*
+ * 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.Test;
+import org.onosproject.yang.compiler.datamodel.YangExtension;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for testing extension listener.
+ */
+public class ExtensionListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks extension statement as sub-statement of module.
+     */
+    @Test
+    public void processValidExtensionStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ValidExtensionStatement.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("ietf-yang-compiler-annotation"));
+
+        YangExtension extension = yangNode.getExtensionList().iterator().next();
+        assertThat(extension.getName(), is("compiler-annotation"));
+        assertThat(extension.getArgumentName(), is("target"));
+        assertThat(extension.getDescription(), is("\"This extension allows for defining compiler annotations\""));
+    }
+}
+
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/GroupingListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/GroupingListenerTest.java
new file mode 100644
index 0000000..a017265
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/GroupingListenerTest.java
@@ -0,0 +1,190 @@
+/*
+ * 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.Test;
+import org.onosproject.yang.compiler.datamodel.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangGrouping;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangStatusType;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for testing grouping listener.
+ */
+public class GroupingListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks grouping statement inside module.
+     */
+    @Test
+    public void processGroupingInModule() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/GroupingInModule.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangGrouping yangGrouping = (YangGrouping) yangNode.getChild();
+        assertThat(yangGrouping.getName(), is("endpoint"));
+
+        ListIterator<YangLeaf> leafIterator = yangGrouping.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("address"));
+    }
+
+    /**
+     * Checks grouping statement inside container.
+     */
+    @Test
+    public void processGroupingInContainer() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/GroupingInContainer.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangContainer yangContainer = (YangContainer) yangNode.getChild();
+        assertThat(yangContainer.getName(), is("valid"));
+
+        YangGrouping yangGrouping = (YangGrouping) yangContainer.getChild();
+        assertThat(yangGrouping.getName(), is("endpoint"));
+
+        ListIterator<YangLeaf> leafIterator = yangGrouping.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("address"));
+    }
+
+    /**
+     * Checks grouping statement inside list.
+     */
+    @Test
+    public void processGroupingInList() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/GroupingInList.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangList yangList = (YangList) yangNode.getChild();
+        assertThat(yangList.getName(), is("valid"));
+
+        YangGrouping yangGrouping = (YangGrouping) yangList.getChild();
+        assertThat(yangGrouping.getName(), is("endpoint"));
+
+        ListIterator<YangLeaf> leafIterator = yangGrouping.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("address"));
+    }
+
+    /**
+     * Checks grouping with attributes.
+     */
+    @Test
+    public void processGroupingAttributes() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/GroupingAttributes.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangList yangList = (YangList) yangNode.getChild();
+        assertThat(yangList.getName(), is("valid"));
+
+        YangGrouping yangGrouping = (YangGrouping) yangList.getChild();
+        assertThat(yangGrouping.getName(), is("endpoint"));
+        assertThat(yangGrouping.getStatus(), is(YangStatusType.CURRENT));
+        assertThat(yangGrouping.getReference(), is("\"RFC 6020\""));
+        assertThat(yangGrouping.getDescription(), is("\"grouping under test\""));
+
+        ListIterator<YangLeaf> leafIterator = yangGrouping.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("address"));
+    }
+
+    /**
+     * Checks duplicate grouping in list.
+     */
+    @Test(expected = ParserException.class)
+    public void processDuplicateGroupingInList() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/DuplicateGroupingInList.yang");
+    }
+
+    /**
+     * Checks duplicate grouping in container.
+     */
+    @Test (expected = ParserException.class)
+    public void processDuplicateGroupingInContainer() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/DuplicateGroupingInContainer.yang");
+    }
+
+    /**
+     * Checks duplicate grouping in module.
+     */
+    @Test (expected = ParserException.class)
+    public void processDuplicateGroupingInModule() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/DuplicateGroupingInModule.yang");
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/IdentityListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/IdentityListenerTest.java
new file mode 100644
index 0000000..f657ded
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/IdentityListenerTest.java
@@ -0,0 +1,231 @@
+/*
+ * 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.hamcrest.core.Is;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.onosproject.yang.compiler.datamodel.YangDerivedInfo;
+import org.onosproject.yang.compiler.datamodel.YangIdentity;
+import org.onosproject.yang.compiler.datamodel.YangIdentityRef;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangLeafList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangType;
+import org.onosproject.yang.compiler.datamodel.YangTypeDef;
+import org.onosproject.yang.compiler.datamodel.utils.ResolvableStatus;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.IDENTITYREF;
+
+/**
+ * Test case for identity listener.
+ */
+public class IdentityListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    /**
+     * Checks for updating datamodel for identity/identityref.
+     */
+    @Test
+    public void processIdentityrefType() throws IOException, ParserException {
+
+        YangNode node = manager
+                .getDataModel("src/test/resources/IdentityListener.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("IdentityListener"));
+
+        YangIdentity yangIdentity = (YangIdentity) yangNode.getChild();
+        assertThat(yangIdentity.getName(), is("tunnel"));
+
+        yangIdentity = (YangIdentity) yangNode.getChild().getNextSibling();
+        assertThat(yangIdentity.getName(), is("tunnel-type"));
+
+        yangIdentity = (YangIdentity) yangNode.getChild().getNextSibling().getNextSibling();
+        assertThat(yangIdentity.getName(), is("ref-address-family"));
+
+        yangIdentity = (YangIdentity) yangNode.getChild().getNextSibling().getNextSibling()
+                .getNextSibling();
+        assertThat(yangIdentity.getName(), is("ipv4-address-family"));
+        assertThat(yangIdentity.getBaseNode().getBaseIdentifier().getName(), is("ref-address-family"));
+        assertThat(yangIdentity.getBaseNode().getReferredIdentity().getName(), is("ref-address-family"));
+
+        yangIdentity = (YangIdentity) yangNode.getChild().getNextSibling().getNextSibling()
+                .getNextSibling().getNextSibling();
+        assertThat(yangIdentity.getName(), is("ipv6-address-family"));
+        assertThat(yangIdentity.getBaseNode().getBaseIdentifier().getName(), is("ref-address-family"));
+        assertThat(yangIdentity.getBaseNode().getReferredIdentity().getName(), is("ref-address-family"));
+        assertThat(yangIdentity.getBaseNode().getResolvableStatus(), Is.is(ResolvableStatus.RESOLVED));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("tunnel"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("identityref"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.IDENTITYREF));
+        YangIdentityRef yangIdentityRef = (YangIdentityRef) leafInfo.getDataType().getDataTypeExtendedInfo();
+        assertThat(yangIdentityRef.getName(), is("ref-address-family"));
+        assertThat(yangIdentityRef.getBaseIdentity().getName(), is("ref-address-family"));
+        assertThat(yangIdentityRef.getReferredIdentity().getName(), is("ref-address-family"));
+        assertThat(yangIdentityRef.getResolvableStatus(), is(ResolvableStatus.RESOLVED));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        // Check whether the information in the leaf is correct.
+        assertThat(leafListInfo.getName(), is("network-ref"));
+        assertThat(leafListInfo.getDataType().getDataTypeName(), is("identityref"));
+        assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.IDENTITYREF));
+        yangIdentityRef = (YangIdentityRef) (leafListInfo.getDataType().getDataTypeExtendedInfo());
+
+        // Check whether identityref type got resolved.
+        assertThat(yangIdentityRef.getResolvableStatus(), is(ResolvableStatus.RESOLVED));
+    }
+
+    /**
+     * Checks for updating datamodel for intrafile resolution identity/identityref.
+     */
+    @Test
+    public void processIntraIdentityrefType() throws IOException, ParserException {
+
+        YangNode node = manager
+                .getDataModel("src/test/resources/IdentityIntraFile.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("IdentityIntraFile"));
+
+        YangIdentity yangIdentity = (YangIdentity) yangNode.getChild();
+        assertThat(yangIdentity.getName(), is("ipv4-address-family"));
+        assertThat(yangIdentity.getBaseNode().getBaseIdentifier().getName(), is("ref-address-family"));
+        assertThat(yangIdentity.getBaseNode().getResolvableStatus(), is(ResolvableStatus.INTRA_FILE_RESOLVED));
+    }
+
+    /**
+     * Checks for updating datamodel for identityref used in tydedef.
+     */
+    @Test
+    public void processIdentityTypedefStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/IdentityTypedef.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangIdentity yangIdentity = (YangIdentity) yangNode.getChild();
+        assertThat(yangIdentity.getName(), is("tunnel"));
+
+        YangTypeDef typedef = (YangTypeDef) yangNode.getChild().getNextSibling();
+        assertThat(typedef.getName(), is("type15"));
+
+        YangType type = typedef.getTypeList().iterator().next();
+        assertThat(type.getDataType(), is(YangDataTypes.IDENTITYREF));
+        assertThat(type.getDataTypeName(), is("identityref"));
+
+        YangIdentityRef identityRef = (YangIdentityRef) type.getDataTypeExtendedInfo();
+        assertThat(identityRef.getName(), is("tunnel"));
+        assertThat(identityRef.getBaseIdentity().getName(), is("tunnel"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("tunnel-value"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("type15"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.DERIVED));
+
+        YangDerivedInfo info = (YangDerivedInfo) leafInfo.getDataType()
+                .getDataTypeExtendedInfo();
+        assertThat(info.getEffectiveBuiltInType(), is(IDENTITYREF));
+        YangType type1 = info.getReferredTypeDef().getTypeList().get(0);
+        YangIdentityRef idRef1 =
+                (YangIdentityRef) type1.getDataTypeExtendedInfo();
+        assertThat(idRef1.getName(), is("tunnel"));
+        assertThat(idRef1.getBaseIdentity().getName(), is("tunnel"));
+        assertThat(idRef1.getReferredIdentity().getName(), is("tunnel"));
+        assertThat(idRef1.getResolvableStatus(), is(ResolvableStatus.RESOLVED));
+    }
+
+    /**
+     * Checks for updating datamodel for unresolved status of identityref used in tydedef.
+     */
+    @Test
+    public void processIdentityUnresolvedTypedefStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/IdentityTypedefUnresolved.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangIdentity yangIdentity = (YangIdentity) yangNode.getChild();
+        assertThat(yangIdentity.getName(), is("tunnel"));
+
+        YangTypeDef typedef = (YangTypeDef) yangNode.getChild().getNextSibling();
+        assertThat(typedef.getName(), is("type15"));
+
+        YangType type = typedef.getTypeList().iterator().next();
+        assertThat(type.getDataType(), is(YangDataTypes.IDENTITYREF));
+        assertThat(type.getDataTypeName(), is("identityref"));
+
+        YangIdentityRef idRef =
+                (YangIdentityRef) type.getDataTypeExtendedInfo();
+        assertThat(idRef.getName(), is("tunnel"));
+        assertThat(idRef.getBaseIdentity().getName(), is("tunnel"));
+        assertThat(idRef.getResolvableStatus(), is(ResolvableStatus.RESOLVED));
+
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ImportListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ImportListenerTest.java
new file mode 100644
index 0000000..0f92904
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ImportListenerTest.java
@@ -0,0 +1,116 @@
+/*
+ * 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.Test;
+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.text.ParseException;
+import java.text.SimpleDateFormat;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test cases for testing import listener functionality.
+ */
+public class ImportListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+    private static final String DATE_FORMAT = "yyyy-MM-dd";
+    private final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_FORMAT);
+
+    /**
+     * Checks if mandatory parameter prefix is present in import.
+     */
+    @Test(expected = ParserException.class)
+    public void processImportWithoutPrefix() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ImportWithoutPrefix.yang");
+    }
+
+    /**
+     * Checks that prefix must be present only once in import.
+     */
+    @Test(expected = ParserException.class)
+    public void processImportWithDualPrefix() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ImportWithDualPrefix.yang");
+    }
+
+    /**
+     * Checks for the correct order of prefix in import.
+     */
+    @Test(expected = ParserException.class)
+    public void processImportInvalidOrder() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ImportInvalidOrder.yang");
+    }
+
+    /**
+     * Checks if import listener updates the data model tree.
+     */
+    @Test
+    public void processImportValidEntry() throws IOException, ParserException, ParseException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ImportValidEntry.yang");
+
+        // Checks for the revision value in data model tree.
+        assertThat(((YangModule) node).getImportList().get(0).getRevision(), is(simpleDateFormat.parse("2015-02-03")));
+        // Checks for the prefix id in data model tree.
+        assertThat(((YangModule) node).getImportList().get(0).getPrefixId(), is("On2"));
+        // Checks for the module name in data model tree.
+        assertThat(((YangModule) node).getImportList().get(0).getModuleName(), is("ietf"));
+    }
+
+    /**
+     * Checks if optional parameter revision is not mandatory in import.
+     */
+    @Test
+    public void processImportWithoutRevision() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ImportWithoutRevision.yang");
+
+        // Checks for the prefix id in data model tree.
+        assertThat(((YangModule) node).getImportList().get(0).getPrefixId(), is("On2"));
+        // Checks for the module name in data model tree.
+        assertThat(((YangModule) node).getImportList().get(0).getModuleName(), is("ietf"));
+    }
+
+    /**
+     * Checks if multiple imports are allowed.
+     */
+    @Test()
+    public void processImportMultipleInstance() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ImportMultipleInstance.yang");
+
+        // Checks for the prefix id in data model tree.
+        assertThat(((YangModule) node).getImportList().get(0).getPrefixId(), is("On2"));
+        // Checks for the module name in data model tree.
+        assertThat(((YangModule) node).getImportList().get(0).getModuleName(), is("ietf"));
+
+        // Checks for the prefix id in data model tree.
+        assertThat(((YangModule) node).getImportList().get(1).getPrefixId(), is("On3"));
+        // Checks for the module name in data model tree.
+        assertThat(((YangModule) node).getImportList().get(1).getModuleName(), is("itut"));
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/IncludeListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/IncludeListenerTest.java
new file mode 100644
index 0000000..6dabbae
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/IncludeListenerTest.java
@@ -0,0 +1,128 @@
+/*
+ * 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.Test;
+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.text.ParseException;
+import java.text.SimpleDateFormat;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test cases for testing include listener functionality.
+ */
+public class IncludeListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+    private static final String DATE_FORMAT = "yyyy-MM-dd";
+    private final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_FORMAT);
+
+    /**
+     * Checks if include listener with ; is valid and updates the data
+     * model tree.
+     */
+    @Test
+    public void processIncludeWithStmtend() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/IncludeWithStmtend.yang");
+
+        // Checks for the sub module name in data model tree.
+        assertThat(((YangModule) node).getIncludeList().get(0).getSubModuleName(), is("itut"));
+    }
+
+    /**
+     * Checks if include listener with braces and without revision date is valid
+     * and updates the data model tree.
+     */
+    @Test
+    public void processIncludeWithEmptyBody() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/IncludeWithEmptyBody.yang");
+
+        // Checks for the sub module name in data model tree.
+        assertThat(((YangModule) node).getIncludeList().get(0).getSubModuleName(), is("itut"));
+    }
+
+    /**
+     * Checks if include listener with braces and with revision date is valid
+     * and updates the data model tree.
+     */
+    @Test
+    public void processIncludeWithDate() throws IOException, ParserException, ParseException {
+
+        YangNode node = manager.getDataModel("src/test/resources/IncludeWithDate.yang");
+
+        // Checks for the sub module name in data model tree.
+        assertThat(((YangModule) node).getIncludeList().get(0).getSubModuleName(), is("itut"));
+        assertThat(((YangModule) node).getIncludeList().get(0).getRevision(), is(simpleDateFormat.parse("2016-02-03")));
+    }
+
+    /**
+     * Checks if include has more than one occurrence.
+     */
+    @Test
+    public void processIncludeMultiInstance() throws IOException, ParserException, ParseException {
+
+        YangNode node = manager.getDataModel("src/test/resources/IncludeMultiInstance.yang");
+
+        // Checks for the sub module name in data model tree.
+        assertThat(((YangModule) node).getIncludeList().get(0).getSubModuleName(), is("itut"));
+        assertThat(((YangModule) node).getIncludeList().get(0).getRevision(), is(simpleDateFormat.parse("2016-02-03")));
+        assertThat(((YangModule) node).getIncludeList().get(1).getSubModuleName(), is("sdn"));
+        assertThat(((YangModule) node).getIncludeList().get(1).getRevision(), is(simpleDateFormat.parse("2014-02-03")));
+    }
+
+    /**
+     * Checks if include and import can come in any order.
+     */
+    @Test
+    public void processIncludeImportAnyOrder() throws IOException, ParserException, ParseException {
+
+        YangNode node = manager.getDataModel("src/test/resources/IncludeImportAnyOrder.yang");
+
+        // Checks for the sub module name in data model tree.
+        assertThat(((YangModule) node).getIncludeList().get(0).getSubModuleName(), is("itut"));
+        assertThat(((YangModule) node).getIncludeList().get(0).getRevision(), is(simpleDateFormat.parse("2016-02-03")));
+        assertThat(((YangModule) node).getIncludeList().get(1).getSubModuleName(), is("sdn"));
+        assertThat(((YangModule) node).getIncludeList().get(1).getRevision(), is(simpleDateFormat.parse("2014-02-03")));
+    }
+
+    /**
+     * Checks if syntax of Include is not correct.
+     */
+    @Test(expected = ParserException.class)
+    public void processIncludeInvalidSyntax() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/IncludeInvalidSyntax.yang");
+    }
+
+    /**
+     * Checks if syntax of revision date in Include is not correct.
+     */
+    @Test(expected = ParserException.class)
+    public void processIncludeInvalidDateSyntax() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/IncludeInvalidDateSyntax.yang");
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/InputListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/InputListenerTest.java
new file mode 100644
index 0000000..e0841a9
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/InputListenerTest.java
@@ -0,0 +1,111 @@
+/*
+ * 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.Test;
+import org.onosproject.yang.compiler.datamodel.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangInput;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangRpc;
+import org.onosproject.yang.compiler.datamodel.YangStatusType;
+import org.onosproject.yang.compiler.datamodel.YangTypeDef;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test cases for testing Input listener functionality.
+ */
+public class InputListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks input statements with data definition statements as sub-statements.
+     */
+    @Test
+    public void processInputStatementWithDataDefinition() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/InputStatementWithDataDefinition.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("rock"));
+
+        YangRpc yangRpc = (YangRpc) yangNode.getChild();
+        assertThat(yangRpc.getName(), is("activate-software-image"));
+
+        YangInput yangInput = (YangInput) yangRpc.getChild();
+        assertThat(yangInput.getName(), is("input"));
+        ListIterator<YangLeaf> leafIterator = yangInput.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("image-name"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("string"));
+
+        YangList yangList = (YangList) yangInput.getChild();
+        assertThat(yangList.getName(), is("ospf"));
+        assertThat(yangList.getKeyList().contains("invalid-interval"), is(true));
+        assertThat(yangList.isConfig(), is(true));
+        assertThat(yangList.getMaxElements().getMaxElement(), is(10));
+        assertThat(yangList.getMinElements().getMinElement(), is(3));
+        leafIterator = yangList.getListOfLeaf().listIterator();
+        leafInfo = leafIterator.next();
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
+
+        YangContainer yangContainer = (YangContainer) yangList.getNextSibling();
+        assertThat(yangContainer.getName(), is("isis"));
+
+        leafIterator = yangContainer.getListOfLeaf().listIterator();
+        leafInfo = leafIterator.next();
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
+    }
+
+    /**
+     * Checks input statements with type-def statement as sub-statements.
+     */
+    @Test
+    public void processInputStatementWithTypedef() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/InputStatementWithTypedef.yang");
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("rock"));
+
+        YangRpc yangRpc = (YangRpc) yangNode.getChild();
+        assertThat(yangRpc.getName(), is("activate-software-image"));
+
+        YangInput yangInput = (YangInput) yangRpc.getChild();
+        assertThat(yangInput.getName(), is("input"));
+        YangTypeDef typeDef = (YangTypeDef) yangInput.getChild();
+        assertThat(typeDef.getName(), is("my-type"));
+        assertThat(typeDef.getStatus(), is(YangStatusType.DEPRECATED));
+        assertThat(typeDef.getTypeDefBaseType().getDataType(), is(YangDataTypes.INT32));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/KeyListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/KeyListenerTest.java
new file mode 100644
index 0000000..b526d40
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/KeyListenerTest.java
@@ -0,0 +1,224 @@
+/*
+ * 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.hamcrest.core.Is;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.onosproject.yang.compiler.datamodel.YangList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+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 java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for key listener.
+ */
+public class KeyListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks key statement as sub-statement of list.
+     */
+    @Test
+    public void processListSubStatementKey() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ListSubStatementKey.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), Is.is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module
+        YangList yangList = (YangList) yangNode.getChild();
+        assertThat(yangList.getName(), is("valid"));
+
+        ListIterator<String> keyList = yangList.getKeyList().listIterator();
+        assertThat(keyList.next(), is("invalid-interval"));
+    }
+
+    /**
+     * Check multiple key values.
+     */
+    @Test
+    public void processMultipleKeyValues() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/MultipleKeyValues.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module
+        YangList yangList = (YangList) yangNode.getChild();
+        assertThat(yangList.getName(), is("valid"));
+
+        List<String> keyList = yangList.getKeyList();
+        assertThat(keyList.contains("ospf"), is(true));
+        assertThat(keyList.contains("isis"), is(true));
+    }
+
+    /**
+     * Checks key statement without statement end.
+     */
+    @Test
+    public void processKeyWithoutStatementEnd() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("mismatched input 'leaf' expecting {';', '+'}");
+        YangNode node = manager.getDataModel("src/test/resources/KeyWithoutStatementEnd.yang");
+    }
+
+    /**
+     * Checks key values are set correctly.
+     */
+    @Test
+    public void processConfigFalseNoKey() throws IOException, ParserException {
+        YangNode node = manager.getDataModel("src/test/resources/ConfigFalseNoKey.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module
+        YangList yangList = (YangList) yangNode.getChild();
+        assertThat(yangList.getName(), is("valid"));
+    }
+
+    /**
+     * Checks key values are set correctly.
+     */
+    @Test
+    public void processConfigFalseValidKeyValidLeaf() throws IOException, ParserException {
+        YangNode node = manager.getDataModel("src/test/resources/ConfigFalseValidKeyValidLeaf.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module
+        YangList yangList = (YangList) yangNode.getChild();
+        assertThat(yangList.getName(), is("valid"));
+
+        ListIterator<String> keyList = yangList.getKeyList().listIterator();
+        assertThat(keyList.next(), is("invalid-interval"));
+    }
+
+    /**
+     * Checks whether exception is thrown when list's config is set to true and there is no key.
+     */
+    @Test
+    public void processConfigTrueNoKey() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("A list must have atleast one key leaf if config is true");
+        YangNode node = manager.getDataModel("src/test/resources/ConfigTrueNoKey.yang");
+    }
+
+    /**
+     * Checks whether exception is thrown when list's config is set to true and there is no leaf.
+     */
+    @Test
+    public void processConfigTrueNoleafNoLeafList() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("A list must have atleast one key leaf if config is true");
+        YangNode node = manager.getDataModel("src/test/resources/ConfigTrueNoleafNoLeafList.yang");
+    }
+
+    /**
+     * Checks key values are set correctly.
+     */
+    @Test
+    public void processConfigTrueValidKeyValidLeaf() throws IOException, ParserException {
+        YangNode node = manager.getDataModel("src/test/resources/ConfigTrueValidKeyValidLeaf.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module
+        YangList yangList = (YangList) yangNode.getChild();
+        assertThat(yangList.getName(), is("valid"));
+
+        ListIterator<String> keyList = yangList.getKeyList().listIterator();
+        assertThat(keyList.next(), is("invalid-interval"));
+    }
+
+    /**
+     * Checks key values are set correctly.
+     */
+    @Test
+    public void processKeyWithUsesInList() throws IOException, ParserException {
+        YangNode node = manager.getDataModel("src/test/resources/KeyWithUsesInList.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module
+        YangList yangList = (YangList) yangNode.getChild().getNextSibling();
+        assertThat(yangList.getName(), is("valid"));
+
+        ListIterator<String> keyList = yangList.getKeyList().listIterator();
+        assertThat(keyList.next(), is("invalid-interval"));
+    }
+
+    /**
+     * Checks whether exception is thrown when key leaf identifier is not found in list.
+     */
+    @Test
+    public void processInvalidLeafIdentifier() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("An identifier, in key, must refer to a child leaf of the list");
+        YangNode node = manager.getDataModel("src/test/resources/InvalidLeafIdentifier.yang");
+    }
+
+    /**
+     * Checks whether exception is thrown when key leaf is of type empty.
+     */
+    @Test
+    public void processKeyLeafTypeEmpty() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("A leaf that is part of the key must not be the built-in type \"empty\".");
+        YangNode node = manager.getDataModel("src/test/resources/KeyLeafTypeEmpty.yang");
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/LeafListListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/LeafListListenerTest.java
new file mode 100644
index 0000000..8a5711f
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/LeafListListenerTest.java
@@ -0,0 +1,208 @@
+/*
+ * 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.hamcrest.core.Is;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.onosproject.yang.compiler.datamodel.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangLeafList;
+import org.onosproject.yang.compiler.datamodel.YangList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangStatusType;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for testing leaf-list listener.
+ */
+public class LeafListListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks all the values of leaf-list sub-statements are set correctly.
+     */
+    @Test
+    public void processLeafListSubStatements() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/LeafListSubStatements.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.getDataType().getDataTypeName(), is("uint16"));
+        assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
+        assertThat(leafListInfo.getUnits(), is("\"seconds\""));
+        assertThat(leafListInfo.getDescription(), is("\"Interval before a route is declared invalid\""));
+        assertThat(leafListInfo.isConfig(), is(true));
+        assertThat(leafListInfo.getMaxElements().getMaxElement(), is(3));
+        assertThat(leafListInfo.getStatus(), Is.is(YangStatusType.CURRENT));
+        assertThat(leafListInfo.getReference(), is("\"RFC 6020\""));
+    }
+
+    /**
+     * Checks whether exception is thrown when leaf-list identifier starts with
+     * digit.
+     */
+    @Test
+    public void processLeafListInvalidIdentifier() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : leaf-list name 1invalid-interval is not valid.");
+        YangNode node = manager.getDataModel("src/test/resources/LeafListInvalidIdentifier.yang");
+    }
+
+    /**
+     * Checks whether exception is thrown when leaf-list keyword is incorrect.
+     */
+    @Test(expected = ParserException.class)
+    public void processLeafListInvalidStatement() throws IOException, ParserException {
+        YangNode node = manager.getDataModel("src/test/resources/LeafListInvalidStatement.yang");
+    }
+
+    /**
+     * Checks whether exception is thrown when leaf-list keyword without Left
+     * brace as per grammar.
+     */
+    @Test
+    public void processLeafListWithoutLeftBrace() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("missing '{' at 'type'");
+        YangNode node = manager.getDataModel("src/test/resources/LeafListWithoutLeftBrace.yang");
+    }
+
+    /**
+     * Checks whether exception is thrown when config statement cardinality is
+     * not as per grammar.
+     */
+    @Test
+    public void processLeafListConfigInvalidCardinality() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error: \"config\" is defined more than once in \"leaf-list " +
+                "invalid-interval\".");
+        YangNode node = manager.getDataModel("src/test/resources/LeafListConfigInvalidCardinality.yang");
+    }
+
+    /**
+     * Checks whether exception is thrown when units statement cardinality is
+     * not as per grammar.
+     */
+    @Test
+    public void processLeafListUnitsInvalidCardinality() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error: \"units\" is defined more than once in \"leaf-list invalid-interval\"");
+        YangNode node = manager.getDataModel("src/test/resources/LeafListUnitsInvalidCardinality.yang");
+    }
+
+    /**
+     * Checks leaf-list statement as sub-statement of container.
+     */
+    @Test
+    public void processContainerSubStatementLeafList() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ContainerSubStatementLeafList.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.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.
+        YangContainer container = (YangContainer) yangNode.getChild();
+        assertThat(container.getName(), is("valid"));
+
+        // Check whether leaf-list properties as set correctly.
+        ListIterator<YangLeafList> leafListIterator = container.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.getDataType().getDataTypeName(), is("uint16"));
+        assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
+        assertThat(leafListInfo.getUnits(), is("\"seconds\""));
+        assertThat(leafListInfo.getDescription(), is("\"Interval before a route is declared invalid\""));
+        assertThat(leafListInfo.isConfig(), is(true));
+        assertThat(leafListInfo.getMinElements().getMinElement(), is(1));
+        assertThat(leafListInfo.getMaxElements().getMaxElement(), is(2147483647));
+        assertThat(leafListInfo.getStatus(), is(YangStatusType.CURRENT));
+        assertThat(leafListInfo.getReference(), is("\"RFC 6020\""));
+    }
+
+    /**
+     * Checks leaf-list statement as sub-statement of list.
+     */
+    @Test
+    public void processListSubStatementLeafList() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ListSubStatementLeafList.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module
+        YangList yangList = (YangList) yangNode.getChild();
+        assertThat(yangList.getName(), is("valid"));
+
+        // Check whether leaf-list properties as set correctly.
+        ListIterator<YangLeafList> leafListIterator = yangList.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.getDataType().getDataTypeName(), is("uint16"));
+        assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
+        assertThat(leafListInfo.getUnits(), is("\"seconds\""));
+        assertThat(leafListInfo.getDescription(), is("\"Interval before a route is declared invalid\""));
+        assertThat(leafListInfo.isConfig(), is(true));
+
+        assertThat(leafListInfo.getStatus(), is(YangStatusType.CURRENT));
+        assertThat(leafListInfo.getReference(), is("\"RFC 6020\""));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/LeafListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/LeafListenerTest.java
new file mode 100644
index 0000000..216033c
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/LeafListenerTest.java
@@ -0,0 +1,224 @@
+/*
+ * 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.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangStatusType;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for testing leaf listener.
+ */
+public class LeafListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks all the values of leaf sub-statements are set correctly.
+     */
+    @Test
+    public void processLeafSubStatements() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/LeafSubStatements.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
+        assertThat(leafInfo.getUnits(), is("\"seconds\""));
+        assertThat(leafInfo.getDescription(), is("\"Interval before a route is declared invalid\""));
+        assertThat(leafInfo.isConfig(), is(true));
+        assertThat(leafInfo.isMandatory(), is(true));
+        assertThat(leafInfo.getStatus(), is(YangStatusType.CURRENT));
+        assertThat(leafInfo.getReference(), is("\"RFC 6020\""));
+    }
+
+    /**
+     * Checks whether exception is thrown when leaf identifier starts with
+     * digit.
+     */
+    @Test
+    public void processLeafInvalidIdentifier() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : leaf name 1invalid-interval is not valid.");
+        YangNode node = manager.getDataModel("src/test/resources/LeafInvalidIdentifier.yang");
+    }
+
+    /**
+     * Checks whether exception is thrown when leaf keyword without Left brace
+     * as per grammar.
+     */
+    @Test
+    public void processLeafWithoutLeftBrace() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("missing '{' at 'type'");
+        YangNode node = manager.getDataModel("src/test/resources/LeafWithoutLeftBrace.yang");
+    }
+
+    /**
+     * Checks whether exception is thrown when config statement cardinality is
+     * not as per grammar.
+     */
+    @Test
+    public void processLeafConfigInvalidCardinality() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error: \"config\" is defined more than once in \"leaf invalid-interval\".");
+        YangNode node = manager.getDataModel("src/test/resources/LeafConfigInvalidCardinality.yang");
+    }
+
+    /**
+     * Checks whether exception is thrown when mandatory statement cardinality
+     * is not as per grammar.
+     */
+    @Test
+    public void processLeafMandatoryInvalidCardinality() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error: \"mandatory\" is defined more than once in \"leaf invalid-interval\".");
+        YangNode node = manager.getDataModel("src/test/resources/LeafMandatoryInvalidCardinality.yang");
+    }
+
+    /**
+     * Checks leaf statement as sub-statement of container.
+     */
+    @Test
+    public void processContainerSubStatementLeaf() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ContainerSubStatementLeaf.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.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.
+        YangContainer container = (YangContainer) yangNode.getChild();
+        assertThat(container.getName(), is("valid"));
+
+        // Check whether leaf properties as set correctly.
+        ListIterator<YangLeaf> leafIterator = container.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
+        assertThat(leafInfo.getUnits(), is("\"seconds\""));
+        assertThat(leafInfo.getDescription(), is("\"Interval before a route is declared invalid\""));
+        assertThat(leafInfo.isConfig(), is(true));
+        assertThat(leafInfo.isMandatory(), is(true));
+        assertThat(leafInfo.getStatus(), is(YangStatusType.CURRENT));
+        assertThat(leafInfo.getReference(), is("\"RFC 6020\""));
+    }
+
+    /**
+     * Checks duplicate leaf statement as sub-statement of module.
+     */
+    @Test(expected = ParserException.class)
+    public void processModuleWithDuplicateLeaf() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ModuleWithDuplicateLeaf.yang");
+    }
+
+    /**
+     * Checks duplicate leaf statement as sub-statement of container.
+     */
+    @Test(expected = ParserException.class)
+    public void processContainerWithDuplicateLeaf() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ContainerWithDuplicateLeaf.yang");
+    }
+
+    /**
+     * Checks duplicate leaf statement as sub-statement of list.
+     */
+    @Test(expected = ParserException.class)
+    public void processListWithDuplicateLeaf() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ListWithDuplicateLeaf.yang");
+    }
+
+    /**
+     * Checks leaf statement as sub-statement of list.
+     */
+    @Test
+    public void processListSubStatementLeaf() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ListSubStatementLeaf.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module
+        YangList yangList = (YangList) yangNode.getChild();
+        assertThat(yangList.getName(), is("valid"));
+
+        // Check whether leaf properties as set correctly.
+        ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
+        assertThat(leafInfo.getUnits(), is("\"seconds\""));
+        assertThat(leafInfo.getDescription(), is("\"Interval before a route is declared invalid\""));
+        assertThat(leafInfo.isConfig(), is(true));
+        assertThat(leafInfo.isMandatory(), is(true));
+        assertThat(leafInfo.getStatus(), is(YangStatusType.CURRENT));
+        assertThat(leafInfo.getReference(), is("\"RFC 6020\""));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/LengthRestrictionListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/LengthRestrictionListenerTest.java
new file mode 100644
index 0000000..af9572f
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/LengthRestrictionListenerTest.java
@@ -0,0 +1,334 @@
+/*
+ * 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.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangLeafList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangRangeInterval;
+import org.onosproject.yang.compiler.datamodel.YangRangeRestriction;
+import org.onosproject.yang.compiler.datamodel.YangStringRestriction;
+import org.onosproject.yang.compiler.datamodel.YangTypeDef;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangUint64;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.math.BigInteger;
+import java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for length restriction listener.
+ */
+public class LengthRestrictionListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks valid length statement as sub-statement of leaf statement.
+     */
+    @Test
+    public void processValidLengthStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ValidLengthStatement.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("string"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
+        YangStringRestriction stringRestriction = (YangStringRestriction) leafInfo
+                .getDataType().getDataTypeExtendedInfo();
+        YangRangeRestriction lengthRestriction = stringRestriction.getLengthRestriction();
+
+        ListIterator<YangRangeInterval> lengthListIterator = lengthRestriction.getAscendingRangeIntervals()
+                .listIterator();
+
+        YangRangeInterval rangeInterval = lengthListIterator.next();
+
+        assertThat(((YangUint64) rangeInterval.getStartValue()).getValue(), is(BigInteger.valueOf(0)));
+        assertThat(((YangUint64) rangeInterval.getEndValue()).getValue(), is(BigInteger.valueOf(100)));
+    }
+
+    /**
+     * Checks valid length statement as sub-statement of leaf-list.
+     */
+    @Test
+    public void processLengthStatementInsideLeafList() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/LengthStatementInsideLeafList.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.getDataType().getDataTypeName(), is("string"));
+        assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
+        YangStringRestriction stringRestriction = (YangStringRestriction) leafListInfo
+                .getDataType().getDataTypeExtendedInfo();
+        YangRangeRestriction lengthRestriction = stringRestriction.getLengthRestriction();
+
+        ListIterator<YangRangeInterval> lengthListIterator = lengthRestriction.getAscendingRangeIntervals()
+                .listIterator();
+
+        YangRangeInterval rangeInterval = lengthListIterator.next();
+        assertThat(((YangUint64) rangeInterval.getStartValue()).getValue(), is(BigInteger.valueOf(1)));
+        assertThat(((YangUint64) rangeInterval.getEndValue()).getValue(), is(BigInteger.valueOf(100)));
+    }
+
+    /**
+     * Checks valid length statement as sub-statement of typedef.
+     */
+    @Test
+    public void processLengthStatementInsideTypeDef() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/LengthStatementInsideTypeDef.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangTypeDef typedef = (YangTypeDef) yangNode.getChild();
+        YangStringRestriction stringRestriction = (YangStringRestriction) typedef.getTypeDefBaseType()
+                .getDataTypeExtendedInfo();
+
+        YangRangeRestriction lengthRestriction = stringRestriction.getLengthRestriction();
+        ListIterator<YangRangeInterval> lengthListIterator = lengthRestriction.getAscendingRangeIntervals()
+                .listIterator();
+        YangRangeInterval rangeInterval = lengthListIterator.next();
+        assertThat(((YangUint64) rangeInterval.getStartValue()).getValue(), is(BigInteger.valueOf(1)));
+        assertThat(((YangUint64) rangeInterval.getEndValue()).getValue(), is(BigInteger.valueOf(100)));
+    }
+
+    /**
+     * Checks valid length statement as sub-statement of binary statement.
+     */
+    @Test
+    public void processValidBinaryLengthStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ValidBinaryLengthStatement.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("message"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("binary"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.BINARY));
+        YangRangeRestriction lengthRestriction = (YangRangeRestriction) leafInfo
+                                                  .getDataType().getDataTypeExtendedInfo();
+
+        ListIterator<YangRangeInterval> lengthListIterator = lengthRestriction.getAscendingRangeIntervals()
+                .listIterator();
+
+        YangRangeInterval rangeInterval = lengthListIterator.next();
+
+        assertThat(((YangUint64) rangeInterval.getStartValue()).getValue(), is(BigInteger.valueOf(4)));
+        assertThat(((YangUint64) rangeInterval.getEndValue()).getValue(), is(BigInteger.valueOf(4)));
+    }
+
+    /**
+     * Checks length statement with invalid type.
+     */
+    @Test
+    public void processLengthWithInvalidType() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : length name \"1..100\" can be used to restrict the built-in type" +
+                " string/binary or types derived from string/binary.");
+        YangNode node = manager.getDataModel("src/test/resources/LengthWithInvalidType.yang");
+    }
+
+    /**
+     * Checks length statement with only start interval.
+     */
+    @Test
+    public void processLengthWithOneInterval() throws IOException, ParserException {
+
+
+        YangNode node = manager.getDataModel("src/test/resources/LengthWithOneInterval.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.getDataType().getDataTypeName(), is("string"));
+        assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
+        YangStringRestriction stringRestriction = (YangStringRestriction) leafListInfo
+                .getDataType().getDataTypeExtendedInfo();
+        YangRangeRestriction lengthRestriction = stringRestriction.getLengthRestriction();
+
+        ListIterator<YangRangeInterval> lengthListIterator = lengthRestriction.getAscendingRangeIntervals()
+                .listIterator();
+
+        YangRangeInterval rangeInterval = lengthListIterator.next();
+        assertThat(((YangUint64) rangeInterval.getStartValue()).getValue(), is(BigInteger.valueOf(1)));
+        assertThat(((YangUint64) rangeInterval.getEndValue()).getValue(), is(BigInteger.valueOf(1)));
+    }
+
+    /**
+     * Checks length statement with min and max.
+     */
+    @Test
+    public void processLengthWithMinMax() throws IOException, ParserException {
+
+
+        YangNode node = manager.getDataModel("src/test/resources/LengthWithMinMax.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.getDataType().getDataTypeName(), is("string"));
+        assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
+        YangStringRestriction stringRestriction = (YangStringRestriction) leafListInfo
+                .getDataType().getDataTypeExtendedInfo();
+        YangRangeRestriction lengthRestriction = stringRestriction.getLengthRestriction();
+
+        ListIterator<YangRangeInterval> lengthListIterator = lengthRestriction.getAscendingRangeIntervals()
+                .listIterator();
+
+        YangRangeInterval rangeInterval = lengthListIterator.next();
+        assertThat(((YangUint64) rangeInterval.getStartValue()).getValue(), is(BigInteger.valueOf(0)));
+        assertThat(((YangUint64) rangeInterval.getEndValue()).getValue(), is(new BigInteger("18446744073709551615")));
+    }
+
+    /**
+     * Checks length statement with invalid integer pattern.
+     */
+    @Test
+    public void processLengthWithInvalidIntegerPattern() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : Input value \"a\" is not a valid uint64.");
+        YangNode node = manager.getDataModel("src/test/resources/LengthWithInvalidIntegerPattern.yang");
+    }
+
+    /**
+     * Checks length statement with invalid interval.
+     */
+    @Test
+    public void processLengthWithInvalidInterval() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : 18446744073709551617 is greater than maximum value" +
+                " 18446744073709551615.");
+        YangNode node = manager.getDataModel("src/test/resources/LengthWithInvalidInterval.yang");
+    }
+
+    /**
+     * Checks valid length substatements.
+     */
+    @Test
+    public void processLengthSubStatements() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/LengthSubStatements.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("string"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
+        YangStringRestriction stringRestriction = (YangStringRestriction) leafInfo
+                .getDataType().getDataTypeExtendedInfo();
+        YangRangeRestriction lengthRestriction = stringRestriction.getLengthRestriction();
+
+        assertThat(lengthRestriction.getDescription(), is("\"length description\""));
+        assertThat(lengthRestriction.getReference(), is("\"length reference\""));
+
+        ListIterator<YangRangeInterval> lengthListIterator = lengthRestriction.getAscendingRangeIntervals()
+                .listIterator();
+
+        YangRangeInterval rangeInterval = lengthListIterator.next();
+
+        assertThat(((YangUint64) rangeInterval.getStartValue()).getValue(), is(BigInteger.valueOf(0)));
+        assertThat(((YangUint64) rangeInterval.getEndValue()).getValue(), is(BigInteger.valueOf(100)));
+    }
+
+    /**
+     * Checks whether space can be allowed when length statement is present.
+     */
+    @Test
+    public void processLengthStatementWithSpace() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/LengthStatementWithSpace.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("string"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
+        YangStringRestriction stringRestriction = (YangStringRestriction) leafInfo
+                .getDataType().getDataTypeExtendedInfo();
+        YangRangeRestriction lengthRestriction = stringRestriction.getLengthRestriction();
+
+        ListIterator<YangRangeInterval> lengthListIterator = lengthRestriction.getAscendingRangeIntervals()
+                .listIterator();
+
+        YangRangeInterval rangeInterval = lengthListIterator.next();
+
+        assertThat(((YangUint64) rangeInterval.getStartValue()).getValue(), is(BigInteger.valueOf(0)));
+        assertThat(((YangUint64) rangeInterval.getEndValue()).getValue(), is(BigInteger.valueOf(100)));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ListListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ListListenerTest.java
new file mode 100644
index 0000000..a8d1524
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ListListenerTest.java
@@ -0,0 +1,237 @@
+/*
+ * 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.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangStatusType;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for testing list listener.
+ */
+public class ListListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks list statement as sub-statement of module.
+     */
+    @Test
+    public void processModuleSubStatementList() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ModuleSubStatementList.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module
+        YangList yangList = (YangList) yangNode.getChild();
+        assertThat(yangList.getName(), is("valid"));
+
+        ListIterator<String> keyList = yangList.getKeyList().listIterator();
+        assertThat(keyList.next(), is("invalid-interval"));
+    }
+
+    /**
+     * Checks list statement as sub-statement of container.
+     */
+    @Test
+    public void processContainerSubStatementList() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ContainerSubStatementList.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.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
+        YangContainer yangContainer = (YangContainer) yangNode.getChild();
+        assertThat(yangContainer.getName(), is("ospf"));
+
+        // Check whether the list is child of container
+        YangList yangList = (YangList) yangContainer.getChild();
+        assertThat(yangList.getName(), is("valid"));
+        assertThat(yangList.getKeyList().contains("invalid-interval"), is(true));
+    }
+
+    /**
+     * Checks list statement as sub-statement of list.
+     */
+    @Test
+    public void processListSubStatementList() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ListSubStatementList.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module
+        YangList yangList1 = (YangList) yangNode.getChild();
+        assertThat(yangList1.getName(), is("ospf"));
+        assertThat(yangList1.getKeyList().contains("process-id"), is(true));
+
+        // Check whether the list is child of list
+        YangList yangList = (YangList) yangList1.getChild();
+        assertThat(yangList.getName(), is("valid"));
+        assertThat(yangList.getKeyList().contains("invalid-interval"), is(true));
+    }
+
+    /**
+     * Checks list with all its sub-statements.
+     */
+    @Test
+    public void processListSubStatements() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ListSubStatements.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module
+        YangList yangList = (YangList) yangNode.getChild();
+
+        // Check whether list properties as set correctly.
+        assertThat(yangList.getName(), is("ospf"));
+        assertThat(yangList.getKeyList().contains("invalid-interval"), is(true));
+
+        assertThat(yangList.isConfig(), is(true));
+        assertThat(yangList.getMaxElements().getMaxElement(), is(10));
+        assertThat(yangList.getMinElements().getMinElement(), is(3));
+        assertThat(yangList.getDescription(), is("\"list description\""));
+        assertThat(yangList.getStatus(), is(YangStatusType.CURRENT));
+        assertThat(yangList.getReference(), is("\"list reference\""));
+
+        // Check whether leaf properties as set correctly.
+        ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
+        assertThat(leafInfo.getUnits(), is("\"seconds\""));
+        assertThat(leafInfo.getStatus(), is(YangStatusType.CURRENT));
+        assertThat(leafInfo.getReference(), is("\"RFC 6020\""));
+    }
+
+    /**
+     * Checks cardinality of sub-statements of list.
+     */
+    @Test
+    public void processListSubStatementsCardinality() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error: \"reference\" is defined more than once in \"list valid\".");
+        YangNode node = manager.getDataModel("src/test/resources/ListSubStatementsCardinality.yang");
+    }
+
+    /**
+     * Checks list statement without child.
+     */
+    @Test
+    public void processListStatementWithoutChild() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error: Missing \"data-def-substatements\" in \"list valid\".");
+        YangNode node = manager.getDataModel("src/test/resources/ListStatementWithoutChild.yang");
+    }
+
+    /**
+     * Checks list as root node.
+     */
+    @Test
+    public void processListAsRootNode() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("no viable alternative at input 'list'");
+        YangNode node = manager.getDataModel("src/test/resources/ListAsRootNode.yang");
+    }
+
+    /**
+     * Checks invalid identifier for list statement.
+     */
+    @Test
+    public void processListInvalidIdentifier() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : list name 1valid is not valid.");
+        YangNode node = manager.getDataModel("src/test/resources/ListInvalidIdentifier.yang");
+    }
+
+    /**
+     * Checks list with identifier name as enum.
+     */
+    @Test
+    public void processListWithIdentifierNameEnum() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ListWithIdentifierNameEnum.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module
+        YangList yangList = (YangList) yangNode.getChild();
+        assertThat(yangList.getName(), is("enumList"));
+        assertThat(yangList.getKeyList().contains("enum"), is(true));
+        YangLeaf leaf = yangList.getListOfLeaf().iterator().next();
+        assertThat(leaf.getName(), is("enum"));
+        assertThat(leaf.getDataType().getDataType(), is(YangDataTypes.ENUMERATION));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/MandatoryListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/MandatoryListenerTest.java
new file mode 100644
index 0000000..31f0995
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/MandatoryListenerTest.java
@@ -0,0 +1,143 @@
+/*
+ * 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.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test case for mandatory listener.
+ */
+public class MandatoryListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks valid mandatory with value true statement.
+     */
+    @Test
+    public void processMandatoryTrue() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/MandatoryTrue.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // Check whether the mandatory value is set correctly.
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.isMandatory(), is(true));
+    }
+
+    /**
+     * Checks valid mandatory with value false statement.
+     */
+    @Test
+    public void processMandatoryFalse() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/MandatoryFalse.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // Check whether the mandatory value is set correctly.
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.isMandatory(), is(false));
+    }
+
+    /**
+     * Checks default value of mandatory statement.
+     */
+    @Test
+    public void processMandatoryDefaultValue() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/MandatoryDefaultValue.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // Check whether the mandatory value is set correctly.
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.isMandatory(), is(false));
+    }
+
+    /**
+     * Checks invalid of mandatory statement and expects exception.
+     */
+    @Test
+    public void processMandatoryEmptyStatement() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("no viable alternative at input ';'");
+        YangNode node = manager.getDataModel("src/test/resources/MandatoryEmptyStatement.yang");
+    }
+
+    /**
+     * Checks invalid mandatory statement(without statement end) and expects
+     * exception.
+     */
+    @Test
+    public void processMandatoryWithoutStatementEnd() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("missing ';' at '}'");
+        YangNode node = manager.getDataModel("src/test/resources/MandatoryWithoutStatementEnd.yang");
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/MaxElementsListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/MaxElementsListenerTest.java
new file mode 100644
index 0000000..7691acb
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/MaxElementsListenerTest.java
@@ -0,0 +1,177 @@
+/*
+ * 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.YangLeafList;
+import org.onosproject.yang.compiler.datamodel.YangList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for testing max-elements listener.
+ */
+public class MaxElementsListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks max-elements as sub-statements of leaf-list.
+     */
+    @Test
+    public void processLeafListSubStatementMaxElements() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/LeafListSubStatementMaxElements.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.getMaxElements().getMaxElement(), is(3));
+    }
+
+    /**
+     * Checks max-elements as sub-statements of list.
+     */
+    @Test
+    public void processListSubStatementMaxElements() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ListSubStatementMaxElements.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module
+        YangList yangList = (YangList) yangNode.getChild();
+        assertThat(yangList.getName(), is("valid"));
+        assertThat(yangList.getMaxElements().getMaxElement(), is(3));
+    }
+
+    /**
+     * Checks whether exception is thrown when max-elements statement without
+     * statement end is given as input.
+     */
+    @Test
+    public void processMaxElementsWithoutStatementEnd() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("missing ';' at 'description'");
+        YangNode node = manager.getDataModel("src/test/resources/MaxElementsWithoutStatementEnd.yang");
+    }
+
+    /**
+     * Checks whether exception is thrown when max-elements cardinality is not
+     * as per the grammar.
+     */
+    @Test
+    public void processMaxElementsCardinality() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error: \"max-elements\" is defined more than once in \"leaf-list " +
+                "invalid-interval\".");
+        YangNode node = manager.getDataModel("src/test/resources/MaxElementsCardinality.yang");
+    }
+
+    /**
+     * Checks unbounded value of max-elements statement.
+     */
+    @Test
+    public void processMaxElementsUnbounded() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/MaxElementsUnbounded.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.getMaxElements().getMaxElement(), is(2147483647));
+    }
+
+    /**
+     * Checks default value of max-elements statement.
+     */
+    @Test
+    public void processMaxElementsDefaultValue() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/MaxElementsDefaultValue.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.getMaxElements().getMaxElement(), is(2147483647));
+    }
+
+    /**
+     * Checks whether exception is thrown when invalid min-elements value is
+     * given as input.
+     */
+    @Test
+    public void processMaxElementsMaxValue() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : max-elements value 77777777777777777777777 is not valid.");
+        YangNode node = manager.getDataModel("src/test/resources/MaxElementsMaxValue.yang");
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/MinElementsListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/MinElementsListenerTest.java
new file mode 100644
index 0000000..e43c4e0
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/MinElementsListenerTest.java
@@ -0,0 +1,163 @@
+/*
+ * 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.YangLeafList;
+import org.onosproject.yang.compiler.datamodel.YangList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for testing min-elements listener.
+ */
+public class MinElementsListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks min-elements as sub-statements of leaf-list.
+     */
+    @Test
+    public void processLeafListSubStatementMinElements() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/LeafListSubStatementMinElements.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.getMinElements().getMinElement(), is(3));
+    }
+
+    /**
+     * Checks min-elements as sub-statements of list.
+     */
+    @Test
+    public void processListSubStatementMinElements() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ListSubStatementMinElements.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module
+        YangList yangList = (YangList) yangNode.getChild();
+        assertThat(yangList.getName(), is("valid"));
+        assertThat(yangList.getMinElements().getMinElement(), is(3));
+    }
+
+    /**
+     * Checks whether exception is thrown when invalid min-elements value is
+     * given as input.
+     */
+    @Test
+    public void processMinElementsInvalidValue() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : min-elements value asd is not valid.");
+        YangNode node = manager.getDataModel("src/test/resources/MinElementsInvalidValue.yang");
+    }
+
+    /**
+     * Checks whether exception is thrown when invalid min-elements value is
+     * given as input.
+     */
+    @Test
+    public void processMinElementsMaxValue() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : min-elements value 77777777777777777777777 is not valid.");
+        YangNode node = manager.getDataModel("src/test/resources/MinElementsMaxValue.yang");
+    }
+
+    /**
+     * Checks whether exception is thrown when min-elements statement without
+     * statement end is given as input.
+     */
+    @Test
+    public void processMinElementsWithoutStatementEnd() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("missing ';' at 'description'");
+        YangNode node = manager.getDataModel("src/test/resources/MinElementsWithoutStatementEnd.yang");
+    }
+
+    /**
+     * Checks whether exception is thrown when min-elements cardinality is not
+     * as per the grammar.
+     */
+    @Test
+    public void processMinElementsInvalidCardinality() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error: \"min-elements\" is defined more than once in \"leaf-list " +
+                "invalid-interval\".");
+        YangNode node = manager.getDataModel("src/test/resources/MinElementsInvalidCardinality.yang");
+    }
+
+    /**
+     * Checks min-element's default value.
+     */
+    @Test
+    public void processMinElementsDefaultValue() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/MinElementsDefaultValue.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.getMinElements().getMinElement(), is(0));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ModuleListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ModuleListenerTest.java
new file mode 100644
index 0000000..5483ea6
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ModuleListenerTest.java
@@ -0,0 +1,81 @@
+/*
+ * 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.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test cases for testing module listener functionality.
+ */
+public class ModuleListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    /**
+     * Checks if module listener updates the data model root node.
+     */
+    @Test
+    public void processModuleValidEntry() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ModuleValidEntry.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+    }
+
+    /**
+     * Checks if module name is set correctly.
+     */
+    @Test(expected = ParserException.class)
+    public void processModuleInvalidEntryTest() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ModuleWithInvalidIdentifier.yang");
+    }
+
+    /**
+     * Checks whether exception is thrown when module length is greater than 64 characters.
+     */
+    @Test
+    public void processModuleInvalidIdentifierLength() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : module name Testttttttttttttttttttttttttttttttttttttttttttttttttttt" +
+                "tttttttttt is greater than 64 characters.");
+        YangNode node = manager.getDataModel("src/test/resources/ModuleInvalidIdentifierLength.yang");
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/MustListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/MustListenerTest.java
new file mode 100644
index 0000000..2793420
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/MustListenerTest.java
@@ -0,0 +1,84 @@
+/*
+ * 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.Test;
+import org.onosproject.yang.compiler.datamodel.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangMust;
+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 java.util.ListIterator;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test cases for testing must listener functionality.
+ */
+public class MustListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks if must listener updates the data model.
+     */
+    @Test
+    public void processContainerSubStatementMust() throws IOException, ParserException {
+        YangNode node = manager.getDataModel("src/test/resources/ContainerSubStatementMust.yang");
+
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangContainer yangContainer = (YangContainer) yangNode.getChild();
+        assertThat(yangContainer.getName(), is("interface"));
+
+        String expectedConstraint = "ifType != 'ethernet' or (ifType = 'ethernet' and ifMTU = 1500)";
+        List<YangMust> mustConstraintList = yangContainer.getListOfMust();
+        assertThat(mustConstraintList.iterator().next().getConstraint(), is(expectedConstraint));
+    }
+
+    /**
+     * Checks if must listener updates the data model.
+     */
+    @Test
+    public void processLeafSubStatementMust() throws IOException, ParserException {
+        YangNode node = manager.getDataModel("src/test/resources/LeafSubStatementMust.yang");
+
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getListOfMust().iterator().next().getConstraint(), is("ifType != 'ethernet'"));
+    }
+
+    /**
+     * Checks whether there is no parser exception when must statement is sub-statement of
+     * unsupported yang construct.
+     */
+    @Test
+    public void processUnsupportedSubStatementMust() throws IOException, ParserException {
+        YangNode node = manager.getDataModel("src/test/resources/UnsupportedYangConstructSubStatementMust.yang");
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/NamespaceListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/NamespaceListenerTest.java
new file mode 100644
index 0000000..745b882
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/NamespaceListenerTest.java
@@ -0,0 +1,88 @@
+/*
+ * 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.Test;
+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 static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test cases for testing namespace listener functionality.
+ */
+public class NamespaceListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks that value of namespace shouldn't have invalid spaces.
+     */
+    @Test(expected = ParserException.class)
+    public void processNamespaceWithInvalidSpaces() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/NamespaceWithInvalidSpaces.yang");
+    }
+
+    /**
+     * Checks if namespace with double quotes is allowed.
+     */
+    @Test()
+    public void processNamespaceInDoubleQuotes() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/NamespaceInDoubleQuotes.yang");
+
+        // Checks for the version value in data model tree.
+        assertThat(((YangModule) node).getModuleNamespace(), is
+                ("urn:ietf:params:xml:ns:yang:ietf-ospf"));
+    }
+
+    /**
+     * Checks if namespace without double quotes is allowed.
+     */
+    @Test()
+    public void processNamespaceWithoutQuotes() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/NamespaceWithoutQuotes.yang");
+
+        // Checks for the version value in data model tree.
+        assertThat(((YangModule) node).getModuleNamespace(), is("urn:ietf:params:xml:ns:yang:ietf-ospf"));
+    }
+
+    /**
+     * Checks if namespace is present only once.
+     */
+    @Test(expected = ParserException.class)
+    public void processNamespaceDualEntry() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/NamespaceDualEntry.yang");
+    }
+
+    /**
+     * Checks if mandatory parameter namespace is present.
+     */
+    @Test(expected = ParserException.class)
+    public void processNamespaceNoEntryTest() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/NamespaceNoEntryTest.yang");
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/NotificationListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/NotificationListenerTest.java
new file mode 100644
index 0000000..2741786
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/NotificationListenerTest.java
@@ -0,0 +1,72 @@
+/*
+ * 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.Test;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangNotification;
+import org.onosproject.yang.compiler.datamodel.YangStatusType;
+import org.onosproject.yang.compiler.datamodel.YangTypeDef;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test cases for testing notification listener functionality.
+ */
+public class NotificationListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks valid notification statement.
+     */
+    @Test
+    public void processValidNotificationStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ValidNotificationStatement.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("rock"));
+
+        YangNotification yangNotification = (YangNotification) yangNode.getChild();
+        assertThat(yangNotification.getName(), is("link-failure"));
+        assertThat(yangNotification.getDescription(), is("\"A link failure has been detected\""));
+        assertThat(yangNotification.getStatus(), is(YangStatusType.DEPRECATED));
+        assertThat(yangNotification.getReference(), is("\"reference\""));
+
+        YangTypeDef typeDef = (YangTypeDef) yangNotification.getChild();
+        assertThat(typeDef.getName(), is("my-type"));
+        assertThat(typeDef.getStatus(), is(YangStatusType.DEPRECATED));
+
+        ListIterator<YangLeaf> leafIterator = yangNotification.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("if-name"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("string"));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/OrganizationListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/OrganizationListenerTest.java
new file mode 100644
index 0000000..b0b7fb0
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/OrganizationListenerTest.java
@@ -0,0 +1,75 @@
+/*
+ * 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.Test;
+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 static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test cases for testing organization listener functionality.
+ */
+public class OrganizationListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks if organization listener updates the data model tree.
+     */
+    @Test
+    public void processOrganizationValidEntry() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/OrganizationValidEntry.yang");
+
+        // Checks for the version value in data model tree.
+        assertThat(((YangModule) node).getOrganization(), is("\"IETF SPRING Working Group\""));
+    }
+
+    /**
+     * Checks that organization must be present only once.
+     */
+    @Test(expected = ParserException.class)
+    public void processOrganizationDualEntry() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/OrganizationDualEntry.yang");
+    }
+
+    /**
+     * Checks if organization entry syntax is correct.
+     */
+    @Test(expected = ParserException.class)
+    public void processOrganizationMissingValue() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/OrganizationMissingValue.yang");
+    }
+
+    /**
+     * Checks if organization and namespace is present in correct order.
+     */
+    @Test(expected = ParserException.class)
+    public void processOrganizationInvalidOrder() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/OrganizationInvalidOrder.yang");
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/OutputListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/OutputListenerTest.java
new file mode 100644
index 0000000..4a73a99
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/OutputListenerTest.java
@@ -0,0 +1,115 @@
+/*
+ * 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.Test;
+import org.onosproject.yang.compiler.datamodel.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangOutput;
+import org.onosproject.yang.compiler.datamodel.YangRpc;
+import org.onosproject.yang.compiler.datamodel.YangStatusType;
+import org.onosproject.yang.compiler.datamodel.YangTypeDef;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test cases for testing output listener functionality.
+ */
+public class OutputListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks output statements with data definition statements as sub-statements.
+     */
+    @Test
+    public void processOutputStatementWithDataDefinition() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/OutputStatementWithDataDefinition.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("rock"));
+
+        YangRpc yangRpc = (YangRpc) yangNode.getChild();
+        assertThat(yangRpc.getName(), is("activate-software-image"));
+
+        YangOutput yangOutput = (YangOutput) yangRpc.getChild();
+        assertThat(yangOutput.getName(), is("output"));
+
+        ListIterator<YangLeaf> leafIterator = yangOutput.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("image-name"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("string"));
+
+        YangList yangList = (YangList) yangOutput.getChild();
+        assertThat(yangList.getName(), is("ospf"));
+        assertThat(yangList.getKeyList().contains("invalid-interval"), is(true));
+        assertThat(yangList.isConfig(), is(true));
+        assertThat(yangList.getMaxElements().getMaxElement(), is(10));
+        assertThat(yangList.getMinElements().getMinElement(), is(3));
+        leafIterator = yangList.getListOfLeaf().listIterator();
+        leafInfo = leafIterator.next();
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
+
+        YangContainer yangContainer = (YangContainer) yangList.getNextSibling();
+        assertThat(yangContainer.getName(), is("isis"));
+
+        leafIterator = yangContainer.getListOfLeaf().listIterator();
+        leafInfo = leafIterator.next();
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
+    }
+
+    /**
+     * Checks output statements with type-def statement as sub-statements.
+     */
+    @Test
+    public void processOutputStatementWithTypedef() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/OutputStatementWithTypedef.yang");
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("rock"));
+
+        YangRpc yangRpc = (YangRpc) yangNode.getChild();
+        assertThat(yangRpc.getName(), is("activate-software-image"));
+
+        YangOutput yangOutput = (YangOutput) yangRpc.getChild();
+        assertThat(yangOutput.getName(), is("output"));
+
+        YangTypeDef typeDef = (YangTypeDef) yangOutput.getChild();
+        assertThat(typeDef.getName(), is("my-type"));
+        assertThat(typeDef.getStatus(), is(YangStatusType.DEPRECATED));
+        assertThat(typeDef.getName(), is("my-type"));
+        assertThat(typeDef.getStatus(), is(YangStatusType.DEPRECATED));
+        assertThat(typeDef.getTypeDefBaseType().getDataType(), is(YangDataTypes.INT32));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/PatternRestrictionListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/PatternRestrictionListenerTest.java
new file mode 100644
index 0000000..ce63ef2
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/PatternRestrictionListenerTest.java
@@ -0,0 +1,221 @@
+/*
+ * 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.hamcrest.core.Is;
+import org.junit.Test;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangLeafList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangPatternRestriction;
+import org.onosproject.yang.compiler.datamodel.YangStringRestriction;
+import org.onosproject.yang.compiler.datamodel.YangTypeDef;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for pattern restriction listener.
+ */
+public class PatternRestrictionListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks valid pattern statement as sub-statement of leaf statement.
+     */
+    @Test
+    public void processValidPatternStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ValidPatternStatement.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), Is.is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("string"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
+        YangStringRestriction stringRestriction = (YangStringRestriction) leafInfo
+                .getDataType().getDataTypeExtendedInfo();
+        ListIterator<String> patternListIterator = stringRestriction.getPatternRestriction()
+                .getPatternList().listIterator();
+        assertThat(patternListIterator.next(), is("[a-zA-Z]"));
+
+        leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("ipv4-address"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("string"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
+        stringRestriction = (YangStringRestriction) leafInfo
+                .getDataType().getDataTypeExtendedInfo();
+        patternListIterator = stringRestriction.getPatternRestriction()
+                .getPatternList().listIterator();
+        assertThat(patternListIterator.next(), is(
+                "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}" +
+                        "([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])" +
+                        "(%[\\p{N}\\p{L}]+)?"));
+    }
+
+    /**
+     * Checks valid pattern statement as sub-statement of leaf-list.
+     */
+    @Test
+    public void processPatternStatementInsideLeafList() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/PatternStatementInsideLeafList.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.getDataType().getDataTypeName(), is("string"));
+        assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
+        YangStringRestriction stringRestriction = (YangStringRestriction) leafListInfo
+                .getDataType().getDataTypeExtendedInfo();
+        ListIterator<String> patternListIterator = stringRestriction.getPatternRestriction()
+                .getPatternList().listIterator();
+        assertThat(patternListIterator.next(), is("[a-zA-Z]"));
+    }
+
+    /**
+     * Checks valid pattern statement as sub-statement of typedef.
+     */
+    @Test
+    public void processPatternStatementInsideTypeDef() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/PatternStatementInsideTypeDef.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangTypeDef typedef = (YangTypeDef) yangNode.getChild();
+        YangStringRestriction stringRestriction = (YangStringRestriction) typedef.getTypeDefBaseType()
+                .getDataTypeExtendedInfo();
+
+        YangPatternRestriction yangPatternRestriction = stringRestriction.getPatternRestriction();
+        assertThat(yangPatternRestriction.getPatternList().listIterator().next(), is("[a-zA-Z]"));
+    }
+
+    /**
+     * Checks valid multiple pattern statements.
+     */
+    @Test
+    public void processMultiplePatternStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/MultiplePatternStatement.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.getDataType().getDataTypeName(), is("string"));
+        assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
+        YangStringRestriction stringRestriction = (YangStringRestriction) leafListInfo
+                .getDataType().getDataTypeExtendedInfo();
+        ListIterator<String> patternListIterator = stringRestriction.getPatternRestriction()
+                .getPatternList().listIterator();
+        assertThat(patternListIterator.next(), is("[a-zA-Z]"));
+    }
+
+    /**
+     * Checks valid pattern statement with plus symbol in pattern.
+     */
+    @Test
+    public void processPatternStatementWithPlus() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/PatternStatementWithPlus.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.getDataType().getDataTypeName(), is("string"));
+        assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
+        YangStringRestriction stringRestriction = (YangStringRestriction) leafListInfo
+                .getDataType().getDataTypeExtendedInfo();
+        ListIterator<String> patternListIterator = stringRestriction.getPatternRestriction()
+                .getPatternList().listIterator();
+        //FIXME: + should not be remove from the end.
+        //assertThat(patternListIterator.next(), is("-[0-9]+|[0-9]+"));
+    }
+
+    /**
+     * Checks valid pattern substatement.
+     */
+    @Test
+    public void processPatternSubStatements() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/PatternSubStatements.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("string"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.STRING));
+        YangStringRestriction stringRestriction = (YangStringRestriction) leafInfo
+                .getDataType().getDataTypeExtendedInfo();
+        assertThat(stringRestriction.getDescription(), is("\"pattern description\""));
+        assertThat(stringRestriction.getReference(), is("\"pattern reference\""));
+        ListIterator<String> patternListIterator = stringRestriction.getPatternRestriction()
+                .getPatternList().listIterator();
+        assertThat(patternListIterator.next(), is("[a-zA-Z]"));
+    }
+
+    /**
+     * Checks invalid pattern sub-statement.
+     */
+    @Test(expected = ParserException.class)
+    public void processInvalidPatternSubStatements() throws IOException, ParserException {
+        YangNode node = manager.getDataModel("src/test/resources/InvalidPatternSubStatements.yang");
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/PositionListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/PositionListenerTest.java
new file mode 100644
index 0000000..ec9d0fc
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/PositionListenerTest.java
@@ -0,0 +1,260 @@
+/*
+ * 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.hamcrest.core.Is;
+import org.junit.Test;
+import org.onosproject.yang.compiler.datamodel.YangBit;
+import org.onosproject.yang.compiler.datamodel.YangBits;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+import java.util.Map;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for position listener.
+ */
+public class PositionListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks explicitly configured value.
+     */
+    @Test
+    public void processPositionStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/PositionStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), Is.is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("mybits"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("bits"));
+        assertThat(leafInfo.getDataType().getDataType(), Is.is(YangDataTypes.BITS));
+        assertThat(((YangBits) leafInfo.getDataType().getDataTypeExtendedInfo()).getBitsName(),
+                is("mybits"));
+
+        // Check bit name map
+        Map<String, YangBit> bitNameMap = ((YangBits) leafInfo.getDataType().getDataTypeExtendedInfo()).getBitNameMap();
+        assertThat(bitNameMap.size(), is(3));
+        for (Map.Entry<String, YangBit> element : bitNameMap.entrySet()) {
+            String bitName = element.getKey();
+            YangBit yangBit = element.getValue();
+            if (bitName.equals("disable-nagle")) {
+                assertThat(yangBit.getPosition(), is(0));
+            } else if (bitName.equals("auto-sense-speed")) {
+                assertThat(yangBit.getPosition(), is(1));
+            } else if (bitName.equals("Ten-Mb-only")) {
+                assertThat(yangBit.getPosition(), is(2));
+            } else {
+                throw new IOException("Invalid bit name: " + bitName);
+            }
+        }
+
+        // Check bit position map
+        Map<Integer, YangBit> bitPositionMap = ((YangBits) leafInfo.getDataType().getDataTypeExtendedInfo())
+                                                                                 .getBitPositionMap();
+        assertThat(bitPositionMap.size(), is(3));
+        for (Map.Entry<Integer, YangBit> element : bitPositionMap.entrySet()) {
+            int position = element.getKey();
+            YangBit yangBit = element.getValue();
+            if (position == 0) {
+                assertThat(yangBit.getBitName(), is("disable-nagle"));
+            } else if (position == 1) {
+                assertThat(yangBit.getBitName(), is("auto-sense-speed"));
+            } else if (position == 2) {
+                assertThat(yangBit.getBitName(), is("Ten-Mb-only"));
+            } else {
+                throw new IOException("Invalid bit position: " + position);
+            }
+        }
+    }
+
+    /**
+     * Checks position value with double quotes.
+     */
+    @Test
+    public void processPositionWithDoubleQuotes() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/PositionWithDoubleQuotes.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("mybits"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("bits"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.BITS));
+        assertThat(((YangBits) leafInfo.getDataType().getDataTypeExtendedInfo()).getBitsName(),
+                is("mybits"));
+
+        // Check bit name map
+        Map<String, YangBit> bitNameMap = ((YangBits) leafInfo.getDataType().getDataTypeExtendedInfo()).getBitNameMap();
+        assertThat(bitNameMap.size(), is(3));
+        for (Map.Entry<String, YangBit> element : bitNameMap.entrySet()) {
+            String bitName = element.getKey();
+            YangBit yangBit = element.getValue();
+            if (bitName.equals("disable-nagle")) {
+                assertThat(yangBit.getPosition(), is(0));
+            } else if (bitName.equals("auto-sense-speed")) {
+                assertThat(yangBit.getPosition(), is(1));
+            } else if (bitName.equals("Ten-Mb-only")) {
+                assertThat(yangBit.getPosition(), is(2));
+            } else {
+                throw new IOException("Invalid bit name: " + bitName);
+            }
+        }
+
+        // Check bit position map
+        Map<Integer, YangBit> bitPositionMap = ((YangBits) leafInfo.getDataType().getDataTypeExtendedInfo())
+                                                                                 .getBitPositionMap();
+        assertThat(bitPositionMap.size(), is(3));
+        for (Map.Entry<Integer, YangBit> element : bitPositionMap.entrySet()) {
+            int position = element.getKey();
+            YangBit yangBit = element.getValue();
+            if (position == 0) {
+                assertThat(yangBit.getBitName(), is("disable-nagle"));
+            } else if (position == 1) {
+                assertThat(yangBit.getBitName(), is("auto-sense-speed"));
+            } else if (position == 2) {
+                assertThat(yangBit.getBitName(), is("Ten-Mb-only"));
+            } else {
+                throw new IOException("Invalid bit position: " + position);
+            }
+        }
+    }
+
+    /**
+     * Checks explicit value and auto generated value.
+     */
+    @Test
+    public void processPositionImplicitAndExplicit() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/PositionImplicitAndExplicit.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("mybits"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("bits"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.BITS));
+        assertThat(((YangBits) leafInfo.getDataType().getDataTypeExtendedInfo()).getBitsName(),
+                is("mybits"));
+
+        // Check bit name map
+        Map<String, YangBit> bitNameMap = ((YangBits) leafInfo.getDataType().getDataTypeExtendedInfo()).getBitNameMap();
+        assertThat(bitNameMap.size(), is(3));
+        for (Map.Entry<String, YangBit> element : bitNameMap.entrySet()) {
+            String bitName = element.getKey();
+            YangBit yangBit = element.getValue();
+            if (bitName.equals("disable-nagle")) {
+                assertThat(yangBit.getPosition(), is(0));
+            } else if (bitName.equals("auto-sense-speed")) {
+                assertThat(yangBit.getPosition(), is(1));
+            } else if (bitName.equals("Ten-Mb-only")) {
+                assertThat(yangBit.getPosition(), is(2));
+            } else {
+                throw new IOException("Invalid bit name: " + bitName);
+            }
+        }
+
+        // Check bit position map
+        Map<Integer, YangBit> bitPositionMap = ((YangBits) leafInfo.getDataType().getDataTypeExtendedInfo())
+                                                                                 .getBitPositionMap();
+        assertThat(bitPositionMap.size(), is(3));
+        for (Map.Entry<Integer, YangBit> element : bitPositionMap.entrySet()) {
+            int position = element.getKey();
+            YangBit yangBit = element.getValue();
+            if (position == 0) {
+                assertThat(yangBit.getBitName(), is("disable-nagle"));
+            } else if (position == 1) {
+                assertThat(yangBit.getBitName(), is("auto-sense-speed"));
+            } else if (position == 2) {
+                assertThat(yangBit.getBitName(), is("Ten-Mb-only"));
+            } else {
+                throw new IOException("Invalid bit position: " + position);
+            }
+        }
+    }
+
+    /**
+     * Checks explicit value should not be repeated.
+     */
+    @Test(expected = ParserException.class)
+    public void processPositionDuplication() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/PositionDuplication.yang");
+    }
+
+    /**
+     * Checks explicit or auto generated value should not be repeated.
+     */
+    @Test(expected = ParserException.class)
+    public void processPositionImplicitAndExplicitDuplication() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/PositionImplicitAndExplicitDuplication.yang");
+    }
+
+    /**
+     * Checks if negative value of position is not allowed.
+     */
+    @Test(expected = ParserException.class)
+    public void processPositionNegativeValue() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/PositionNegativeValue.yang");
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/PrefixListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/PrefixListenerTest.java
new file mode 100644
index 0000000..7de221d
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/PrefixListenerTest.java
@@ -0,0 +1,94 @@
+/*
+ * 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.Test;
+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 static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test cases for testing prefix listener functionality.
+ */
+public class PrefixListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks if value of prefix is correct.
+     */
+    @Test(expected = ParserException.class)
+    public void processPrefixInvalidValue() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/PrefixInvalidValue.yang");
+    }
+
+    /**
+     * Checks if prefix listener updates the data model tree.
+     */
+    @Test
+    public void processPrefixValidEntry() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/PrefixValidEntry.yang");
+
+        // Checks for the version value in data model tree.
+        assertThat(((YangModule) node).getPrefix(), is("On"));
+    }
+
+    /**
+     * Checks prefix value with double quotes.
+     */
+    @Test
+    public void processPrefixWithDoubleQuotes() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/PrefixWithDoubleQuotes.yang");
+        assertThat(((YangModule) node).getPrefix(), is("On"));
+    }
+
+    /**
+     * Checks that prefix should be present just once.
+     */
+    @Test(expected = ParserException.class)
+    public void processPrefixDualEntry() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/PrefixDualEntry.yang");
+    }
+
+    /**
+     * Checks if prefix syntax is followed.
+     */
+    @Test(expected = ParserException.class)
+    public void processPrefixMissingValue() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/PrefixMissingValue.yang");
+    }
+
+    /**
+     * Checks that exception should be reported if prefix is missing.
+     */
+    @Test(expected = ParserException.class)
+    public void processPrefixOrder() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/PrefixOrder.yang");
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/PresenceListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/PresenceListenerTest.java
new file mode 100644
index 0000000..1a1da94
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/PresenceListenerTest.java
@@ -0,0 +1,100 @@
+/*
+ * 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.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.nullValue;
+
+/**
+ * Test cases for presence listener.
+ */
+public class PresenceListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks presence statement as sub-statement of container.
+     */
+    @Test
+    public void processContainerSubStatementPresence() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ContainerSubStatementPresence.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module
+        YangContainer yangContainer = (YangContainer) yangNode.getChild();
+        assertThat(yangContainer.getName(), is("valid"));
+        assertThat(yangContainer.getPresence(), is("\"invalid\""));
+    }
+
+    /**
+     * checks default value of presence statement.
+     */
+    @Test
+    public void processPresenceDefaultValue() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/PresenceDefaultValue.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module
+        YangContainer yangContainer = (YangContainer) yangNode.getChild();
+        assertThat(yangContainer.getName(), is("valid"));
+        assertThat(yangContainer.getPresence(), is(nullValue()));
+    }
+
+    /**
+     * Checks presence statement without statement end.
+     */
+    @Test
+    public void processPresenceWithoutStatementEnd() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("mismatched input 'leaf' expecting {';', '+'}");
+        YangNode node = manager.getDataModel("src/test/resources/PresenceWithoutStatementEnd.yang");
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/RangeRestrictionListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/RangeRestrictionListenerTest.java
new file mode 100644
index 0000000..ab3cc4c
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/RangeRestrictionListenerTest.java
@@ -0,0 +1,240 @@
+/*
+ * 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.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangLeafList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangRangeInterval;
+import org.onosproject.yang.compiler.datamodel.YangRangeRestriction;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangInt32;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for range restriction listener.
+ */
+public class RangeRestrictionListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks valid range statement as sub-statement of leaf statement.
+     */
+    @Test
+    public void processValidRangeStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ValidRangeStatement.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("int32"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.INT32));
+        YangRangeRestriction rangeRestriction = (YangRangeRestriction) leafInfo
+                .getDataType().getDataTypeExtendedInfo();
+
+        ListIterator<YangRangeInterval> rangeListIterator = rangeRestriction.getAscendingRangeIntervals()
+                .listIterator();
+        YangRangeInterval rangeInterval = rangeListIterator.next();
+        assertThat(((YangInt32) rangeInterval.getStartValue()).getValue(), is(1));
+        assertThat(((YangInt32) rangeInterval.getEndValue()).getValue(), is(4));
+    }
+
+    /**
+     * Checks valid range statement as sub-statement of leaf-list.
+     */
+    @Test
+    public void processRangeStatementInsideLeafList() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RangeStatementInsideLeafList.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.getDataType().getDataTypeName(), is("int32"));
+        assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.INT32));
+        YangRangeRestriction rangeRestriction = (YangRangeRestriction) leafListInfo
+                .getDataType().getDataTypeExtendedInfo();
+
+        ListIterator<YangRangeInterval> rangeListIterator = rangeRestriction.getAscendingRangeIntervals()
+                .listIterator();
+        YangRangeInterval rangeInterval = rangeListIterator.next();
+
+        assertThat(((YangInt32) rangeInterval.getStartValue()).getValue(), is(1));
+        assertThat(((YangInt32) rangeInterval.getEndValue()).getValue(), is(4));
+    }
+
+    /**
+     * Checks valid range statement with one interval.
+     */
+    @Test
+    public void processRangeWithOneInterval() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RangeWithOneInterval.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.getDataType().getDataTypeName(), is("int32"));
+        assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.INT32));
+        YangRangeRestriction rangeRestriction = (YangRangeRestriction) leafListInfo
+                .getDataType().getDataTypeExtendedInfo();
+
+        ListIterator<YangRangeInterval> rangeListIterator = rangeRestriction.getAscendingRangeIntervals()
+                .listIterator();
+        YangRangeInterval rangeInterval = rangeListIterator.next();
+
+        assertThat(((YangInt32) rangeInterval.getStartValue()).getValue(), is(1));
+        assertThat(((YangInt32) rangeInterval.getEndValue()).getValue(), is(1));
+    }
+
+    /**
+     * Checks valid range statement with min and max.
+     */
+    @Test
+    public void processRangeWithMinMax() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RangeWithMinMax.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.getDataType().getDataTypeName(), is("int32"));
+        assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.INT32));
+        YangRangeRestriction rangeRestriction = (YangRangeRestriction) leafListInfo
+                .getDataType().getDataTypeExtendedInfo();
+
+        ListIterator<YangRangeInterval> rangeListIterator = rangeRestriction.getAscendingRangeIntervals()
+                .listIterator();
+        YangRangeInterval rangeInterval = rangeListIterator.next();
+
+        assertThat(((YangInt32) rangeInterval.getStartValue()).getValue(), is(-2147483648));
+        assertThat(((YangInt32) rangeInterval.getEndValue()).getValue(), is(2147483647));
+    }
+
+    /**
+     * Checks valid range statement with invalid integer pattern.
+     */
+    @Test
+    public void processRangeWithInvalidIntegerPattern() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : Input value \"a\" is not a valid int32.");
+        YangNode node = manager.getDataModel("src/test/resources/RangeWithInvalidIntegerPattern.yang");
+    }
+
+    /**
+     * Checks valid range statement with description.
+     */
+    @Test
+    public void processRangeSubStatements() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RangeSubStatements.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("int32"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.INT32));
+        YangRangeRestriction rangeRestriction = (YangRangeRestriction) leafInfo
+                .getDataType().getDataTypeExtendedInfo();
+
+        assertThat(rangeRestriction.getDescription(), is("\"range description\""));
+        assertThat(rangeRestriction.getReference(), is("\"range reference\""));
+
+        ListIterator<YangRangeInterval> rangeListIterator = rangeRestriction.getAscendingRangeIntervals()
+                .listIterator();
+        YangRangeInterval rangeInterval = rangeListIterator.next();
+        assertThat(((YangInt32) rangeInterval.getStartValue()).getValue(), is(1));
+        assertThat(((YangInt32) rangeInterval.getEndValue()).getValue(), is(4));
+        assertThat(((YangInt32) rangeInterval.getEndValue()).getValue(), is(4));
+    }
+
+    /**
+     * Checks whether space can be allowed when range statement is present.
+     */
+    @Test
+    public void processRangeStatementWithSpace() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RangeStatementWithSpace.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("int32"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.INT32));
+        YangRangeRestriction rangeRestriction = (YangRangeRestriction) leafInfo
+                .getDataType().getDataTypeExtendedInfo();
+
+        ListIterator<YangRangeInterval> rangeListIterator = rangeRestriction.getAscendingRangeIntervals()
+                .listIterator();
+        YangRangeInterval rangeInterval = rangeListIterator.next();
+        assertThat(((YangInt32) rangeInterval.getStartValue()).getValue(), is(1));
+        assertThat(((YangInt32) rangeInterval.getEndValue()).getValue(), is(4));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ReferenceListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ReferenceListenerTest.java
new file mode 100644
index 0000000..f55bf42
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ReferenceListenerTest.java
@@ -0,0 +1,251 @@
+/*
+ * 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.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.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangStatusType;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test case for reference listener.
+ */
+public class ReferenceListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks valid reference statement.
+     */
+    @Test
+    public void processReferenceStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ReferenceStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // Check whether the reference is set correctly.
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getReference(), is("\"RFC 6020\""));
+    }
+
+    /**
+     * Checks whether exception is thrown for invalid reference statement.
+     */
+    @Test
+    public void processReferenceWithoutStatementEnd() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("mismatched input '}' expecting {';', '+'}");
+        YangNode node = manager.getDataModel("src/test/resources/ReferenceWithoutStatementEnd.yang");
+    }
+
+    /**
+     * Checks valid reference statement under module.
+     */
+    @Test
+    public void processModuleSubStatementReference() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ModuleSubStatementReference.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the reference is set correctly.
+        assertThat(yangNode.getReference(), is("\"RFC 6020\""));
+    }
+
+    /**
+     * Checks valid reference statement under module.
+     */
+    @Test
+    public void processReferenceEmptyStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ReferenceEmptyStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the reference is set correctly.
+        assertThat(yangNode.getReference(), is("\"\""));
+    }
+
+    /**
+     * Checks valid reference statement as sub-statement of revision.
+     */
+    @Test
+    public void processRevisionSubStatementReference() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RevisionSubStatementReference.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the reference is set correctly.
+        assertThat(yangNode.getRevision().getReference(), is("\"revision reference\""));
+    }
+
+    /**
+     * Checks reference statement as sub-statement of container.
+     */
+    @Test
+    public void processContainerSubStatementReference() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ContainerSubStatementReference.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the reference value is set correctly.
+        YangContainer container = (YangContainer) yangNode.getChild();
+        assertThat(container.getName(), is("valid"));
+        assertThat(container.getReference(), is("\"container reference\""));
+
+        // Check whether leaf properties as set correctly.
+        ListIterator<YangLeaf> leafIterator = container.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
+        assertThat(leafInfo.getUnits(), is("\"seconds\""));
+        assertThat(leafInfo.getDescription(), is("\"Interval before a route is declared invalid\""));
+        assertThat(leafInfo.isMandatory(), is(true));
+        assertThat(leafInfo.getStatus(), is(YangStatusType.CURRENT));
+        assertThat(leafInfo.getReference(), is("\"RFC 6020\""));
+    }
+
+    /**
+     * Checks reference statement as sub-statement of list.
+     */
+    @Test
+    public void processListSubStatementReference() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ListSubStatementReference.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module and description value is set correctly.
+        YangList yangList = (YangList) yangNode.getChild();
+        assertThat(yangList.getName(), is("valid"));
+        assertThat(yangList.isConfig(), is(true));
+        assertThat(yangList.getReference(), is("\"list reference\""));
+
+        // Check whether leaf properties as set correctly.
+        ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
+        assertThat(leafInfo.getUnits(), is("\"seconds\""));
+        assertThat(leafInfo.getDescription(), is("\"Interval before a route is declared invalid\""));
+        assertThat(leafInfo.isMandatory(), is(true));
+        assertThat(leafInfo.getStatus(), is(YangStatusType.CURRENT));
+        assertThat(leafInfo.getReference(), is("\"RFC 6020\""));
+    }
+
+    /**
+     * Checks valid reference statement as sub-statement of leaf-list.
+     */
+    @Test
+    public void processLeafListSubStatementReference() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/LeafListSubStatementReference.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        // Check whether description value is set correctly.
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.getReference(), is("\"RFC 6020\""));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/RequireInstanceListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/RequireInstanceListenerTest.java
new file mode 100644
index 0000000..ba578fe
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/RequireInstanceListenerTest.java
@@ -0,0 +1,168 @@
+/*
+ * 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.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangLeafRef;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangType;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for require-instance listener.
+ */
+public class RequireInstanceListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks require-statement with true as status.
+     */
+    @Test
+    public void processRequireInstanceTrue() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RequireInstanceTrue.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("PathListener"));
+
+        YangContainer container = (YangContainer) yangNode.getChild().getNextSibling();
+        ListIterator<YangLeaf> leafIterator = container.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // Check whether the require-instance value is set correctly in leafref.
+        assertThat(leafInfo.getName(), is("ifname"));
+        YangLeafRef yangLeafRef = (YangLeafRef) leafInfo.getDataType().getDataTypeExtendedInfo();
+        assertThat(yangLeafRef.getRequireInstance(), is(true));
+    }
+
+    /**
+     * Checks require-statement with false as status.
+     */
+    @Test
+    public void processRequireInstanceFalse() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RequireInstanceFalse.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("PathListener"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // Check whether the require-instance value is set correctly in instance-identifier.
+        assertThat(leafInfo.getName(), is("admin-status"));
+
+        YangType type = leafInfo.getDataType();
+
+        assertThat(type.getDataType(), is(YangDataTypes.INSTANCE_IDENTIFIER));
+        boolean status = ((YangType<Boolean>) type).getDataTypeExtendedInfo();
+
+        assertThat(status, is(false));
+    }
+
+    /**
+     * Checks require-statement default value when its not there in YANG under instance-identifier.
+     */
+    @Test
+    public void processRequireInstanceDefaultValueInInstanceIdentifier() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RequireInstanceDefaultValueInInstanceIdentifier.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("PathListener"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // Check whether the require-instance value is set correctly in instance-identifier.
+        assertThat(leafInfo.getName(), is("admin-status"));
+
+        YangType type = leafInfo.getDataType();
+
+        assertThat(type.getDataType(), is(YangDataTypes.INSTANCE_IDENTIFIER));
+
+        boolean status = ((YangType<Boolean>) type).getDataTypeExtendedInfo();
+        assertThat(status, is(true));
+    }
+
+    /**
+     * Checks require-statement default value when its not there in YANG under leafref.
+     */
+    @Test
+    public void processRequireInstanceDefaultValueForLeafref() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RequireInstanceDefaultValueForLeafref.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("PathListener"));
+
+        YangContainer container = (YangContainer) yangNode.getChild().getNextSibling();
+        ListIterator<YangLeaf> leafIterator = container.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // Check whether the require-instance value is set correctly in leafref.
+        assertThat(leafInfo.getName(), is("ifname"));
+        YangLeafRef yangLeafRef = (YangLeafRef) leafInfo.getDataType().getDataTypeExtendedInfo();
+        assertThat(yangLeafRef.getRequireInstance(), is(true));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/RevisionDateListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/RevisionDateListenerTest.java
new file mode 100644
index 0000000..bdcf28c
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/RevisionDateListenerTest.java
@@ -0,0 +1,116 @@
+/*
+ * 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.Test;
+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.text.ParseException;
+import java.text.SimpleDateFormat;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test cases for testing revision date listener functionality.
+ */
+public class RevisionDateListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+    private static final String DATE_FORMAT = "yyyy-MM-dd";
+    private final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_FORMAT);
+
+    /**
+     * Checks if revision date syntax is correct in include.
+     */
+    @Test(expected = ParserException.class)
+    public void processRevisionDateInvalidSyntaxAtInclude() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RevisionDateInvalidSyntaxAtInclude.yang");
+    }
+
+    /**
+     * Checks if revision date syntax is correct in import.
+     */
+    @Test(expected = ParserException.class)
+    public void processRevisionDateInvalidSyntaxAtImport() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RevisionDateInvalidSyntaxAtImport.yang");
+    }
+
+    /**
+     * Checks revision date in quotes inside include.
+     */
+    @Test
+    public void processRevisionDateInQuotesAtInclude() throws IOException, ParserException, ParseException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RevisionDateInQuotesAtInclude.yang");
+        // Checks for the version value in data model tree.
+        assertThat(((YangModule) node).getImportList().get(0).getRevision(), is(simpleDateFormat.parse("2015-02-03")));
+        assertThat(((YangModule) node).getIncludeList().get(0).getRevision(), is(simpleDateFormat.parse("2016-02-03")));
+        assertThat(((YangModule) node).getIncludeList().get(1).getRevision(), is(simpleDateFormat.parse("2014-02-03")));
+    }
+
+    /**
+     * Checks revision date in quotes inside import.
+     */
+    @Test
+    public void processRevisionDateInQuotesAtImport() throws IOException, ParserException, ParseException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RevisionDateInQuotesAtImport.yang");
+        // Checks for the version value in data model tree.
+        assertThat(((YangModule) node).getImportList().get(0).getRevision(), is(simpleDateFormat.parse("2015-02-03")));
+        assertThat(((YangModule) node).getIncludeList().get(0).getRevision(), is(simpleDateFormat.parse("2016-02-03")));
+        assertThat(((YangModule) node).getIncludeList().get(1).getRevision(), is(simpleDateFormat.parse("2014-02-03")));
+    }
+
+    /**
+     * Checks if revision date follows YYYY-MM-DD format.
+     */
+    @Test(expected = ParserException.class)
+    public void processRevisionDateInvalidFormat() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RevisionDateInvalidFormat.yang");
+    }
+
+    /**
+     * Checks if revision date is correct.
+     */
+    @Test(expected = ParserException.class)
+    public void processRevisionDateInvalid() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RevisionDateInvalid.yang");
+    }
+
+    /**
+     * Checks if revision date listener updates the data model tree.
+     */
+    @Test
+    public void processRevisionDateValidEntry() throws IOException, ParserException, ParseException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RevisionDateValidEntry.yang");
+
+        // Checks for the version value in data model tree.
+        assertThat(((YangModule) node).getImportList().get(0).getRevision(), is(simpleDateFormat.parse("2015-02-03")));
+        assertThat(((YangModule) node).getIncludeList().get(0).getRevision(), is(simpleDateFormat.parse("2016-02-03")));
+        assertThat(((YangModule) node).getIncludeList().get(1).getRevision(), is(simpleDateFormat.parse("2014-02-03")));
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/RevisionListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/RevisionListenerTest.java
new file mode 100644
index 0000000..d8bedbe
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/RevisionListenerTest.java
@@ -0,0 +1,90 @@
+/*
+ * 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.Test;
+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.text.ParseException;
+import java.text.SimpleDateFormat;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test cases for testing revision listener functionality.
+ */
+public class RevisionListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+    private static final String DATE_FORMAT = "yyyy-MM-dd";
+    private final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_FORMAT);
+
+    /**
+     * Checks if revision doesn't have optional parameters "revision and
+     * description".
+     */
+    @Test
+    public void processRevisionNoOptionalParameter() throws IOException, ParserException, ParseException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RevisionNoOptionalParameter.yang");
+        // Checks for the version value in data model tree.
+        assertThat(((YangModule) node).getRevision().getRevDate(), is(simpleDateFormat.parse("2016-02-03")));
+    }
+
+    /**
+     * Checks if the syntax of revision is correct.
+     */
+    @Test(expected = ParserException.class)
+    public void processRevisionInValidSyntax() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RevisionInValidSyntax.yang");
+    }
+
+    /**
+     * Checks if the correct order is followed.
+     */
+    @Test(expected = ParserException.class)
+    public void processRevisionInValidOrder() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RevisionInValidOrder.yang");
+    }
+
+    /**
+     * Checks the revision with current date is created for empty revision statement.
+     */
+    @Test
+    public void processWithoutRevision() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/RevisionAbsence.yang");
+        assertThat(true, is((node).getRevision() == null));
+    }
+
+    /**
+     * Checks latest date is stored when there are multiple revisions.
+     */
+    @Test
+    public void processWithMultipleRevision() throws IOException, ParserException, ParseException {
+
+        YangNode node = manager.getDataModel("src/test/resources/MultipleRevision.yang");
+        assertThat((node).getRevision().getRevDate(), is(simpleDateFormat.parse("2013-07-15")));
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/RpcListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/RpcListenerTest.java
new file mode 100644
index 0000000..902a324
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/RpcListenerTest.java
@@ -0,0 +1,66 @@
+/*
+ * 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.Test;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangRpc;
+import org.onosproject.yang.compiler.datamodel.YangStatusType;
+import org.onosproject.yang.compiler.datamodel.YangTypeDef;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test cases for testing Rpc listener functionality.
+ */
+public class RpcListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks valid rpc statements.
+     */
+    @Test
+    public void processValidRpcStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ValidRpcStatement.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("rock"));
+
+        YangRpc yangRpc = (YangRpc) yangNode.getChild();
+        assertThat(yangRpc.getName(), is("rock-the-house"));
+        assertThat(yangRpc.getDescription(), is("\"description\""));
+        assertThat(yangRpc.getReference(), is("\"reference\""));
+        assertThat(yangRpc.getStatus(), is(YangStatusType.CURRENT));
+
+        YangTypeDef typeDef = (YangTypeDef) yangRpc.getChild();
+        assertThat(typeDef.getName(), is("my-type"));
+        assertThat(typeDef.getStatus(), is(YangStatusType.DEPRECATED));
+        assertThat(typeDef.getTypeDefBaseType().getDataType(), is(YangDataTypes.INT32));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ShortCaseListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ShortCaseListenerTest.java
new file mode 100644
index 0000000..f809be2
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ShortCaseListenerTest.java
@@ -0,0 +1,103 @@
+/*
+ * 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.Test;
+import org.onosproject.yang.compiler.datamodel.YangCase;
+import org.onosproject.yang.compiler.datamodel.YangChoice;
+import org.onosproject.yang.compiler.datamodel.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for short case listener.
+ */
+public class ShortCaseListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks short case listener with container.
+     */
+    @Test
+    public void processShortCaseListenerWithContainer() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ShortCaseListenerWithContainer.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangContainer yangContainer = (YangContainer) yangNode.getChild();
+        assertThat(yangContainer.getName(), is("food"));
+
+        YangChoice yangChoice = (YangChoice) yangContainer.getChild();
+        assertThat(yangChoice.getName(), is("snack"));
+
+        YangCase yangCase = (YangCase) yangChoice.getChild();
+        assertThat(yangCase.getName(), is("sports-arena"));
+
+        YangContainer yangContainer1 = (YangContainer) yangCase.getChild();
+        assertThat(yangContainer1.getName(), is("sports-arena"));
+    }
+
+    /**
+     * Checks short case listener with list.
+     */
+    @Test
+    public void processShortCaseListenerWithList() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ShortCaseListenerWithList.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangContainer yangContainer = (YangContainer) yangNode.getChild();
+        assertThat(yangContainer.getName(), is("food"));
+
+        YangChoice yangChoice = (YangChoice) yangContainer.getChild();
+        assertThat(yangChoice.getName(), is("snack"));
+
+        YangCase yangCase = (YangCase) yangChoice.getChild();
+        assertThat(yangCase.getName(), is("sports-arena"));
+
+        YangList yangList = (YangList) yangCase.getChild();
+        assertThat(yangList.getName(), is("sports-arena"));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/StatusListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/StatusListenerTest.java
new file mode 100644
index 0000000..57a0b2c
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/StatusListenerTest.java
@@ -0,0 +1,276 @@
+/*
+ * 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.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.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangStatusType;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for status listener.
+ */
+public class StatusListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks valid status statement.
+     */
+    @Test
+    public void processStatusStatementCurrent() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/StatusStatementCurrent.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // Check whether the status is set correctly.
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getStatus(), is(YangStatusType.CURRENT));
+    }
+
+    /**
+     * Checks valid status statement.
+     */
+    @Test
+    public void processStatusStatementDeprecated() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/StatusStatementDeprecated.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // Check whether the status is set correctly.
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getStatus(), is(YangStatusType.DEPRECATED));
+    }
+
+    /**
+     * Checks valid status statement.
+     */
+    @Test
+    public void processStatusStatementObsolete() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/StatusStatementObsolete.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // Check whether the status is set correctly.
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getStatus(), is(YangStatusType.OBSOLETE));
+    }
+
+    /**
+     * Checks whether exception is thrown for invalid status statement.
+     */
+    @Test
+    public void processStatusWithoutStatementEnd() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("missing ';' at '}'");
+        YangNode node = manager.getDataModel("src/test/resources/StatusWithoutStatementEnd.yang");
+    }
+
+    /**
+     * Checks whether exception is thrown for invalid status statement.
+     */
+    @Test
+    public void processStatusInvalidValue() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : status invalid is not valid.");
+        YangNode node = manager.getDataModel("src/test/resources/StatusInvalidValue.yang");
+    }
+
+    /**
+     * Checks status statement as sub-statement of container.
+     */
+    @Test
+    public void processContainerSubStatementStatus() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ContainerSubStatementStatus.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether status is set correctly.
+        YangContainer container = (YangContainer) yangNode.getChild();
+        assertThat(container.getName(), is("valid"));
+        assertThat(container.isConfig(), is(true));
+        assertThat(container.getStatus(), is(YangStatusType.OBSOLETE));
+
+        // Check whether leaf properties as set correctly.
+        ListIterator<YangLeaf> leafIterator = container.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
+        assertThat(leafInfo.getUnits(), is("\"seconds\""));
+        assertThat(leafInfo.getDescription(), is("\"Interval before a route is declared invalid\""));
+        assertThat(leafInfo.isMandatory(), is(true));
+        assertThat(leafInfo.getStatus(), is(YangStatusType.CURRENT));
+        assertThat(leafInfo.getReference(), is("\"RFC 6020\""));
+    }
+
+    /**
+     * Checks status statement as sub-statement of list.
+     */
+    @Test
+    public void processListSubStatementStatus() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ListSubStatementStatus.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module and status is set.
+        YangList yangList = (YangList) yangNode.getChild();
+        assertThat(yangList.getName(), is("valid"));
+        assertThat(yangList.isConfig(), is(true));
+        assertThat(yangList.getStatus(), is(YangStatusType.CURRENT));
+
+        // Check whether leaf properties as set correctly.
+        ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
+        assertThat(leafInfo.getUnits(), is("\"seconds\""));
+        assertThat(leafInfo.getDescription(), is("\"Interval before a route is declared invalid\""));
+        assertThat(leafInfo.isMandatory(), is(true));
+        assertThat(leafInfo.getStatus(), is(YangStatusType.CURRENT));
+        assertThat(leafInfo.getReference(), is("\"RFC 6020\""));
+    }
+
+    /**
+     * Checks valid status statement as sub-statement of leaf-list.
+     */
+    @Test
+    public void processLeafListSubStatementStatus() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/LeafListSubStatementStatus.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        // Check whether status is set correctly.
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.isConfig(), is(true));
+        assertThat(leafListInfo.getStatus(), is(YangStatusType.CURRENT));
+    }
+
+    /**
+     * Checks default value of status statement.
+     */
+    @Test
+    public void processStatusDefaultValue() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/StatusDefaultValue.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        // Check whether status is set correctly.
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.isConfig(), is(true));
+        assertThat(leafListInfo.getStatus(), is(YangStatusType.CURRENT));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/SubModuleListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/SubModuleListenerTest.java
new file mode 100644
index 0000000..7adf00f
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/SubModuleListenerTest.java
@@ -0,0 +1,131 @@
+/*
+ * 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.Test;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangSubModule;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test cases for testing submodule listener functionality.
+ */
+public class SubModuleListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks if the sub module listeners updates the data model tree.
+     */
+    @Test
+    public void processSubModuleValidEntry() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/SubModuleValidEntry.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangSubModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.SUB_MODULE_NODE));
+
+        YangSubModule yangNode = (YangSubModule) node;
+        // Check whether the module name is set correctly.
+        assertThat(yangNode.getName(), is("Test"));
+        // Checks for the version value in data model tree.
+        assertThat(yangNode.getVersion(), is((byte) 1));
+        // Checks identifier of belongsto in data model tree.
+        assertThat(yangNode.getBelongsTo().getBelongsToModuleName(), is("ONOS"));
+        // Checks for the version value in data model tree.
+        assertThat(yangNode.getBelongsTo().getPrefix(), is("On1"));
+    }
+
+    /**
+     * Checks if the yang version and belongs to can come in any order in sub
+     * module.
+     */
+    @Test
+    public void processSubModuleOrder() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/SubModuleOrder.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangSubModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.SUB_MODULE_NODE));
+
+        YangSubModule yangNode = (YangSubModule) node;
+        // Check whether the module name is set correctly.
+        assertThat(yangNode.getName(), is("Test"));
+        // Checks for the version value in data model tree.
+        assertThat(yangNode.getVersion(), is((byte) 1));
+        // Checks identifier of belongsto in data model tree.
+        assertThat(yangNode.getBelongsTo().getBelongsToModuleName(), is("ONOS"));
+        // Checks for the version value in data model tree.
+        assertThat(yangNode.getBelongsTo().getPrefix(), is("On1"));
+    }
+
+    /**
+     * Checks if yang version is optional.
+     */
+    @Test
+    public void processSubModuleWithoutVersion() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/SubModuleWithoutVersion.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangSubModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.SUB_MODULE_NODE));
+
+        YangSubModule yangNode = (YangSubModule) node;
+        // Check whether the module name is set correctly.
+        assertThat(yangNode.getName(), is("Test"));
+        // Checks identifier of belongsto in data model tree.
+        assertThat(yangNode.getBelongsTo().getBelongsToModuleName(), is("ONOS"));
+        // Checks for the version value in data model tree.
+        assertThat(yangNode.getBelongsTo().getPrefix(), is("On1"));
+        //Checks the revision with current date is created for empty revision statement.
+        assertThat(true, is(node.getRevision() == null));
+    }
+
+    /**
+     * Checks if sub module name is correct.
+     */
+    @Test(expected = ParserException.class)
+    public void processSubModuleInvalidName() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/SubModuleInvalidName.yang");
+    }
+
+    /**
+     * Checks if sub module has invalid modules construct eg namespace.
+     */
+    @Test(expected = ParserException.class)
+    public void processSubModuleWithNamespace() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/SubModuleWithNamespace.yang");
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/TypeListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/TypeListenerTest.java
new file mode 100644
index 0000000..e95bf50
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/TypeListenerTest.java
@@ -0,0 +1,175 @@
+/*
+ * 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.hamcrest.core.Is;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+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.YangLeafRef;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangTypeDef;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test case for type listener.
+ */
+public class TypeListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks derived statement without contraints.
+     */
+    @Test
+    public void processDerivedTypeStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/DerivedTypeStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), Is.is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("hello"));
+        assertThat(leafInfo.getDataType().getDataType(), Is.is(YangDataTypes.DERIVED));
+    }
+
+    /**
+     * Checks valid yang data type.
+     */
+    @Test
+    public void processIntegerTypeStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/IntegerTypeStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
+    }
+
+    /**
+     * Checks type for leaf-list.
+     */
+    @Test
+    public void processLeafListSubStatementType() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/LeafListSubStatementType.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.getDataType().getDataTypeName(), is("uint16"));
+        assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
+    }
+
+    /**
+     * Checks for type instance-identifier.
+     */
+    @Test
+    public void processInstanceIdentifierType() throws IOException, ParserException {
+
+        YangNode node = manager
+                .getDataModel("src/test/resources/InstanceIdentifierListener.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+        YangContainer container = (YangContainer) yangNode.getChild();
+        ListIterator<YangLeaf> leafIterator = container.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("instance-identifier"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.INSTANCE_IDENTIFIER));
+    }
+
+    /**
+     * Checks for leaf ref path concatenation.
+     */
+    @Test
+    public void processLeafRefPathConcatenation() throws IOException, ParserException {
+
+        YangNode node = manager
+                .getDataModel("src/test/resources/leafRefPathConcatenation.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("test"));
+
+        YangTypeDef typeDef = (YangTypeDef) yangNode.getChild();
+        assertThat(typeDef.getName(), is("isis-instance-state-ref"));
+        assertThat(typeDef.getTypeDefBaseType().getDataType(), is(YangDataTypes.LEAFREF));
+        YangLeafRef leafRef = ((YangLeafRef) typeDef.getTypeDefBaseType().getDataTypeExtendedInfo());
+        assertThat(leafRef.getPath(), is("/isis-prefix-ipv4-std/default-metric"));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/UnionListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/UnionListenerTest.java
new file mode 100644
index 0000000..545624a
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/UnionListenerTest.java
@@ -0,0 +1,150 @@
+/*
+ * 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.Test;
+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.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangType;
+import org.onosproject.yang.compiler.datamodel.YangUnion;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+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 java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for testing union listener.
+ */
+public class UnionListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks union when type is in leaf.
+     */
+    @Test
+    public void processUnionWhenTypeInLeaf() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/UnionWhenTypeInLeaf.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangList yangList = (YangList) yangNode.getChild();
+        assertThat(yangList.getName(), is("valid"));
+
+        ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UNION));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("union"));
+
+        YangUnion yangUnion = (YangUnion) leafInfo.getDataType().getDataTypeExtendedInfo();
+
+        List<YangType<?>> typeList = yangUnion.getTypeList();
+        ListIterator<YangType<?>> typeListIterator = typeList.listIterator();
+        YangType<?> yangType = typeListIterator.next();
+
+        assertThat(yangType.getDataTypeName(), is("int32"));
+        assertThat(yangType.getDataType(), is(YangDataTypes.INT32));
+
+        YangType<?> yangTypeEnum = typeListIterator.next();
+
+        assertThat(yangTypeEnum.getDataTypeName(), is("enumeration"));
+        assertThat(yangTypeEnum.getDataType(), is(YangDataTypes.ENUMERATION));
+    }
+
+    /**
+     * Checks union when type is in leaflist.
+     */
+    @Test
+    public void processUnionWhenTypeInLeafList() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/UnionWhenTypeInLeafList.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangList yangList = (YangList) yangNode.getChild();
+        assertThat(yangList.getName(), is("valid"));
+
+        ListIterator<YangLeafList> leafListIterator = yangList.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+
+        assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.UNION));
+        assertThat(leafListInfo.getDataType().getDataTypeName(), is("union"));
+
+        YangUnion yangUnion = (YangUnion) leafListInfo.getDataType().getDataTypeExtendedInfo();
+
+        List<YangType<?>> typeList = yangUnion.getTypeList();
+        ListIterator<YangType<?>> typeListIterator = typeList.listIterator();
+        YangType<?> yangType = typeListIterator.next();
+
+        assertThat(yangType.getDataTypeName(), is("int32"));
+        assertThat(yangType.getDataType(), is(YangDataTypes.INT32));
+
+        YangType<?> yangTypeEnum = typeListIterator.next();
+
+        assertThat(yangTypeEnum.getDataTypeName(), is("enumeration"));
+        assertThat(yangTypeEnum.getDataType(), is(YangDataTypes.ENUMERATION));
+    }
+
+    /**
+     * Checks union with empty type.
+     */
+    @Test (expected = ParserException.class)
+    public void processUnionWithEmptyType() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/UnionWithEmptyType.yang");
+    }
+
+    /**
+     * Checks whether type union has atleast one type statement.
+     */
+    @Test (expected = ParserException.class)
+    public void processUnionWithoutChild() throws IOException, ParserException {
+        manager.getDataModel("src/test/resources/UnionWithoutChild.yang");
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/UniqueListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/UniqueListenerTest.java
new file mode 100644
index 0000000..ababd08
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/UniqueListenerTest.java
@@ -0,0 +1,96 @@
+/*
+ * 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.YangList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for unique listener.
+ */
+public class UniqueListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks unique statement as sub-statement of list.
+     */
+    @Test
+    public void processListSubStatementUnique() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ListSubStatementUnique.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module
+        YangList yangList = (YangList) yangNode.getChild();
+        assertThat(yangList.getName(), is("valid"));
+        assertThat(yangList.getUniqueList().listIterator().next(), is("invalid-interval"));
+    }
+
+    /**
+     * Check multiple unique values.
+     */
+    @Test
+    public void processMultipleUniqueValues() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/MultipleUniqueValues.yang");
+
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        // Check whether the list is child of module
+        YangList yangList = (YangList) yangNode.getChild();
+        assertThat(yangList.getName(), is("valid"));
+        ListIterator<String> listIterator;
+        String list;
+        listIterator = yangList.getUniqueList().listIterator();
+        list = listIterator.next();
+        assertThat(list, is("ospf"));
+        list = listIterator.next();
+        assertThat(list, is("isis"));
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/UnitsListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/UnitsListenerTest.java
new file mode 100644
index 0000000..41e6660
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/UnitsListenerTest.java
@@ -0,0 +1,177 @@
+/*
+ * 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.hamcrest.core.Is;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangLeafList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangStatusType;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.nullValue;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for units listener.
+ */
+public class UnitsListenerTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks valid units statement.
+     */
+    @Test
+    public void processUnitsStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/UnitsStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat(node instanceof YangModule, is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // Check whether units value is set correctly.
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getUnits(), is("\"seconds\""));
+    }
+
+    /**
+     * Checks invalid units statement(without statement end).
+     */
+    @Test
+    public void processUnitsWithoutStatementEnd() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("mismatched input '}' expecting {';', '+'}");
+        YangNode node = manager.getDataModel("src/test/resources/UnitsWithoutStatementEnd.yang");
+    }
+
+    /**
+     * Checks order of units statement in leaf.
+     */
+    @Test
+    public void processUnitsStatementOrder() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/UnitsStatementOrder.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat(node instanceof YangModule, is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        // Check whether leaf properties is set correctly.
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
+        assertThat(leafInfo.getUnits(), is("\"seconds\""));
+        assertThat(leafInfo.getDescription(), is("\"Interval before a route is declared invalid\""));
+        assertThat(leafInfo.isConfig(), is(true));
+        assertThat(leafInfo.isMandatory(), is(true));
+        assertThat(leafInfo.getStatus(), Is.is(YangStatusType.CURRENT));
+        assertThat(leafInfo.getReference(), is("\"RFC 6020\""));
+    }
+
+    /**
+     * Checks the default value of unit statement.
+     */
+    @Test
+    public void processUnitsDefaultValue() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/UnitsDefaultValue.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat(node instanceof YangModule, is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("invalid-interval"));
+        assertThat(leafInfo.getUnits(), is(nullValue()));
+    }
+
+    /**
+     * Checks invalid occurance of units statement as sub-statement of leaf.
+     */
+    @Test
+    public void processUnitsStatementCardinality() throws IOException, ParserException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error: \"units\" is defined more than once in \"leaf invalid-interval\".");
+        YangNode node = manager.getDataModel("src/test/resources/UnitsStatementCardinality.yang");
+    }
+
+    /**
+     * Checks valid units statement as sub-statement of leaf-list.
+     */
+    @Test
+    public void processLeafListSubStatementUnits() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/LeafListSubStatementUnits.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat(node instanceof YangModule, is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
+        YangLeafList leafListInfo = leafListIterator.next();
+
+        // Check whether units value is set correctly.
+        assertThat(leafListInfo.getName(), is("invalid-interval"));
+        assertThat(leafListInfo.getUnits(), is("\"seconds\""));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/UsesListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/UsesListenerTest.java
new file mode 100644
index 0000000..01412b2
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/UsesListenerTest.java
@@ -0,0 +1,133 @@
+/*
+ * 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.Test;
+import org.onosproject.yang.compiler.datamodel.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangGrouping;
+import org.onosproject.yang.compiler.datamodel.YangList;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.YangStatusType;
+import org.onosproject.yang.compiler.datamodel.YangUses;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for testing uses listener.
+ */
+public class UsesListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks uses statement inside module.
+     */
+    @Test
+    public void processUsesInModule() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/UsesInModule.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangGrouping yangGrouping = (YangGrouping) yangNode.getChild();
+        assertThat(yangGrouping.getName(), is("endpoint"));
+
+        YangUses yangUses = (YangUses) yangGrouping.getNextSibling();
+        assertThat(yangUses.getName(), is("endpoint"));
+    }
+
+    /**
+     * Checks uses statement inside container.
+     */
+    @Test
+    public void processUsesInContainer() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/UsesInContainer.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangGrouping yangGrouping = (YangGrouping) yangNode.getChild();
+        assertThat(yangGrouping.getName(), is("endpoint"));
+
+        YangContainer yangContainer = (YangContainer) yangGrouping.getNextSibling();
+        assertThat(yangContainer.getName(), is("valid"));
+
+        YangUses yangUses = (YangUses) yangContainer.getChild();
+        assertThat(yangUses.getName(), is("endpoint"));
+
+        // Check attributes associated with uses.
+        assertThat(yangUses.getStatus(), is(YangStatusType.CURRENT));
+        assertThat(yangUses.getReference(), is("\"RFC 6020\""));
+        assertThat(yangUses.getDescription(), is("\"grouping under test\""));
+    }
+
+    /**
+     * Checks uses statement inside list.
+     */
+    @Test
+    public void processUsesInList() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/UsesInList.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangGrouping yangGrouping = (YangGrouping) yangNode.getChild();
+        assertThat(yangGrouping.getName(), is("endpoint"));
+
+        YangList yangList = (YangList) yangGrouping.getNextSibling();
+        assertThat(yangList.getName(), is("valid"));
+
+        YangUses yangUses = (YangUses) yangList.getChild();
+        assertThat(yangUses.getName(), is("endpoint"));
+
+        // Check attributes associated with uses.
+        assertThat(yangUses.getStatus(), is(YangStatusType.CURRENT));
+        assertThat(yangUses.getReference(), is("\"RFC 6020\""));
+        assertThat(yangUses.getDescription(), is("\"grouping under test\""));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ValueListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ValueListenerTest.java
new file mode 100644
index 0000000..4d14406
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/ValueListenerTest.java
@@ -0,0 +1,218 @@
+/*
+ * 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.hamcrest.core.Is;
+import org.junit.Test;
+import org.onosproject.yang.compiler.datamodel.YangEnum;
+import org.onosproject.yang.compiler.datamodel.YangEnumeration;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangModule;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangNodeType;
+import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+import java.util.ListIterator;
+import java.util.Set;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for value listener.
+ */
+public class ValueListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks explicitly configured value.
+     */
+    @Test
+    public void processValueStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ValueStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), Is.is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("speed"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("enumeration"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.ENUMERATION));
+        assertThat(((YangEnumeration) leafInfo.getDataType().getDataTypeExtendedInfo()).getName(),
+                is("speed_enum"));
+
+        Set<YangEnum> enumSet = ((YangEnumeration) leafInfo.getDataType().getDataTypeExtendedInfo()).getEnumSet();
+        for (YangEnum tmp : enumSet) {
+            if (tmp.getNamedValue().equals("10m")) {
+                assertThat(tmp.getValue(), is(10));
+            } else if (tmp.getNamedValue().equals("100m")) {
+                assertThat(tmp.getValue(), is(100));
+            } else if (tmp.getNamedValue().equals("auto")) {
+                assertThat(tmp.getValue(), is(1000));
+            }
+        }
+    }
+
+    /**
+     * Checks explicitly configured negative value.
+     */
+    @Test
+    public void processValueStatementWithNegativeValue() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ValueStatementWithNegativeValue.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("speed"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("enumeration"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.ENUMERATION));
+        assertThat(((YangEnumeration) leafInfo.getDataType().getDataTypeExtendedInfo()).getName(),
+                is("speed_enum"));
+
+        Set<YangEnum> enumSet = ((YangEnumeration) leafInfo.getDataType().getDataTypeExtendedInfo()).getEnumSet();
+        for (YangEnum tmp : enumSet) {
+            if (tmp.getNamedValue().equals("10m")) {
+                assertThat(tmp.getValue(), is(-2));
+            } else if (tmp.getNamedValue().equals("100m")) {
+                assertThat(tmp.getValue(), is(-1));
+            } else if (tmp.getNamedValue().equals("auto")) {
+                assertThat(tmp.getValue(), is(0));
+            }
+        }
+    }
+
+    /**
+     * Checks explicitly configured value with double quotes.
+     */
+    @Test
+    public void processValueStatementWithQuotes() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ValueStatementWithQuotes.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("speed"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("enumeration"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.ENUMERATION));
+        assertThat(((YangEnumeration) leafInfo.getDataType().getDataTypeExtendedInfo()).getName(),
+                is("speed_enum"));
+
+        Set<YangEnum> enumSet = ((YangEnumeration) leafInfo.getDataType().getDataTypeExtendedInfo()).getEnumSet();
+        for (YangEnum tmp : enumSet) {
+            if (tmp.getNamedValue().equals("10m")) {
+                assertThat(tmp.getValue(), is(10));
+            } else if (tmp.getNamedValue().equals("100m")) {
+                assertThat(tmp.getValue(), is(100));
+            } else if (tmp.getNamedValue().equals("auto")) {
+                assertThat(tmp.getValue(), is(1000));
+            }
+        }
+    }
+
+    /**
+     * Checks explicit value and auto generated value.
+     */
+    @Test
+    public void processValueAndAutoStatement() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ValueAndAutoStatement.yang");
+
+        // Check whether the data model tree returned is of type module.
+        assertThat((node instanceof YangModule), is(true));
+
+        // Check whether the node type is set properly to module.
+        assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
+
+        // Check whether the module name is set correctly.
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("speed"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("enumeration"));
+        assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.ENUMERATION));
+        assertThat(((YangEnumeration) leafInfo.getDataType().getDataTypeExtendedInfo()).getName(),
+                is("speed_enum"));
+
+        Set<YangEnum> enumSet = ((YangEnumeration) leafInfo.getDataType().getDataTypeExtendedInfo()).getEnumSet();
+        for (YangEnum tmp : enumSet) {
+            if (tmp.getNamedValue().equals("10m")) {
+                assertThat(tmp.getValue(), is(10));
+            } else if (tmp.getNamedValue().equals("100m")) {
+                assertThat(tmp.getValue(), is(11));
+            } else if (tmp.getNamedValue().equals("auto")) {
+                assertThat(tmp.getValue(), is(1000));
+            }
+        }
+    }
+
+    /**
+     * Checks explicit value should not be repeated.
+     */
+    @Test(expected = ParserException.class)
+    public void processValueDuplication() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ValueDuplication.yang");
+    }
+
+    /**
+     * Checks explicit or auto generated value should not be repeated.
+     */
+    @Test(expected = ParserException.class)
+    public void processValueExplicitAndAutoDuplication() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ValueExplicitAndAutoDuplication.yang");
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/VersionListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/VersionListenerTest.java
new file mode 100644
index 0000000..219201a
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/VersionListenerTest.java
@@ -0,0 +1,111 @@
+/*
+ * 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.Test;
+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 static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test cases for testing version listener functionality.
+ */
+public class VersionListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks if value of version is correct.
+     */
+    @Test(expected = ParserException.class)
+    public void processVersionInvalidValue() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/VersionInvalidValue.yang");
+    }
+
+    /**
+     * Checks if version listener updates the data model tree.
+     */
+    @Test
+    public void processVersionValidEntry() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/VersionValidEntry.yang");
+
+        // Checks for the version value in data model tree.
+        assertThat(((YangModule) node).getVersion(), is((byte) 1));
+    }
+
+    /**
+     * Checks version in double quotes.
+     */
+    @Test
+    public void processValidVersionWithDoubleQuotes() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/ValidVersionWithDoubleQuotes.yang");
+
+        // Checks for the version value in data model tree.
+        assertThat(((YangModule) node).getVersion(), is((byte) 1));
+    }
+
+    /**
+     * Checks if version which is optional paramater is not present.
+     */
+    @Test
+    public void processVersionNotPresent() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/VersionNotPresent.yang");
+
+        // Checks for the version value in data model tree.
+        assertThat(((YangModule) node).getVersion(), is((byte) 1));
+    }
+
+    /**
+     * Checks that version should be present only once.
+     */
+    @Test(expected = ParserException.class)
+    public void processVersionDualEntry() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/VersionDualEntry.yang");
+    }
+
+    /**
+     * Checks if version can appear in any order in module header.
+     */
+    @Test
+    public void processVersionOrder() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/VersionOrder.yang");
+
+        // Checks for the version value in data model tree.
+        assertThat(((YangModule) node).getVersion(), is((byte) 1));
+    }
+
+    /**
+     * Checks if sytax of version entry is not correct.
+     */
+    @Test(expected = ParserException.class)
+    public void processVersionInvalidSyntax() throws IOException, ParserException {
+
+        YangNode node = manager.getDataModel("src/test/resources/VersionInvalidSyntax.yang");
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/WhenListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/WhenListenerTest.java
new file mode 100644
index 0000000..c673b1a
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/listeners/WhenListenerTest.java
@@ -0,0 +1,76 @@
+/*
+ * 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.Test;
+import org.onosproject.yang.compiler.datamodel.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
+import org.onosproject.yang.compiler.datamodel.YangList;
+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.ListIterator;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test cases for testing when listener functionality.
+ */
+public class WhenListenerTest {
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks if when listener updates the data model.
+     */
+    @Test
+    public void processContainerSubStatementWhen() throws IOException, ParserException {
+        YangNode node = manager.getDataModel("src/test/resources/ContainerSubStatementWhen.yang");
+
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        YangList yangList = (YangList) yangNode.getChild();
+        String expectedConstraint = "../switching-capability = 'TDM'";
+        assertThat(yangList.getName(), is("interface-switching-capability"));
+        assertThat(yangList.getWhen().getCondition(), is(expectedConstraint));
+
+        YangContainer container = (YangContainer) yangList.getNextSibling();
+        assertThat(container.getName(), is("time-division-multiplex-capable"));
+        assertThat(container.getWhen().getCondition(), is(expectedConstraint));
+    }
+
+    /**
+     * Checks if when listener updates the data model.
+     */
+    @Test
+    public void processLeafSubStatementWhen() throws IOException, ParserException {
+        YangNode node = manager.getDataModel("src/test/resources/LeafSubStatementWhen.yang");
+
+        YangModule yangNode = (YangModule) node;
+        assertThat(yangNode.getName(), is("Test"));
+
+        ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getWhen().getCondition(), is("ifType != 'ethernet'"));
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerErrorMessageConstructionTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerErrorMessageConstructionTest.java
new file mode 100644
index 0000000..1301c8b
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerErrorMessageConstructionTest.java
@@ -0,0 +1,92 @@
+/*
+ * 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.parserutils;
+
+import org.junit.Test;
+import org.onosproject.yang.compiler.datamodel.utils.YangConstructType;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test case for testing listener error message construction util.
+ */
+public class ListenerErrorMessageConstructionTest {
+
+    /**
+     * Checks for error message construction with parsable data type name.
+     */
+    @Test
+    public void checkErrorMsgConstructionWithName() {
+
+        // Create an test error message
+        String testErrorMessage = ListenerErrorMessageConstruction.constructListenerErrorMessage(ListenerErrorType.INVALID_HOLDER, YangConstructType.CONTACT_DATA, "Test Instance", ListenerErrorLocation.ENTRY);
+
+        // Check message.
+        assertThat(testErrorMessage, is("Internal parser error detected: Invalid holder for contact "
+                + "\"Test Instance\" before processing."));
+    }
+
+    /**
+     * Checks for error message construction without parsable data type name.
+     */
+    @Test
+    public void checkErrorMsgConstructionWithoutName() {
+
+        // Create an test error message
+        String testErrorMessage = ListenerErrorMessageConstruction.constructListenerErrorMessage(ListenerErrorType.INVALID_HOLDER, YangConstructType.CONTACT_DATA, "Test Instance", ListenerErrorLocation.ENTRY);
+
+        // Check message.
+        assertThat(testErrorMessage,
+                   is("Internal parser error detected: Invalid holder for contact \"Test Instance\""
+                           + " before processing."));
+    }
+
+    /**
+     * Checks for extended error message construction with parsable data type
+     * name.
+     */
+    @Test
+    public void checkExtendedErrorMsgConstructionWithName() {
+
+        // Create an test error message
+        String testErrorMessage = ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage(ListenerErrorType.INVALID_HOLDER, YangConstructType.CONTACT_DATA,
+                                                                                                         "Test Instance", ListenerErrorLocation.ENTRY,
+                                                                                                         "Extended Information");
+
+        // Check message.
+        assertThat(testErrorMessage,
+                   is("Internal parser error detected: Invalid holder for contact \"Test Instance\""
+                           + " before processing.\n" + "Error Information: Extended Information"));
+    }
+
+    /**
+     * Checks for extended error message construction without parsable data type
+     * name.
+     */
+    @Test
+    public void checkExtendedErrorMsgConstructionWithoutName() {
+
+        // Create an test error message
+        String testErrorMessage = ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage(ListenerErrorType.INVALID_HOLDER, YangConstructType.CONTACT_DATA, "", ListenerErrorLocation.ENTRY,
+                                                                                                         "Extended Information");
+
+        // Check message.
+        assertThat(testErrorMessage, is("Internal parser error detected: Invalid holder for contact"
+                + " before processing.\n" + "Error Information: Extended Information"));
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerUtilTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerUtilTest.java
new file mode 100644
index 0000000..b58cb33
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerUtilTest.java
@@ -0,0 +1,47 @@
+/*
+ * 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.parserutils;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.IOException;
+
+/**
+ * Test case for testing listener util.
+ */
+public class ListenerUtilTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private final YangUtilsParserManager manager = new YangUtilsParserManager();
+
+    /**
+     * Checks whether exception is thrown when identifier starts with xml.
+     */
+    @Test
+    public void validateIdentifierStartsWithXml() throws IOException {
+        thrown.expect(ParserException.class);
+        thrown.expectMessage("YANG file error : module identifier xMlTest must not start" +
+                " with (('X'|'x') ('M'|'m') ('L'|'l'))");
+        manager.getDataModel("src/test/resources/InValidIdentifierXML.yang");
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerValidationTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerValidationTest.java
new file mode 100644
index 0000000..6ed3d3b
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/parserutils/ListenerValidationTest.java
@@ -0,0 +1,106 @@
+/*
+ * 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.parserutils;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.onosproject.yang.compiler.datamodel.YangRevision;
+import org.onosproject.yang.compiler.datamodel.utils.YangConstructType;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
+
+/**
+ * Test case for testing listener validation util.
+ */
+public class ListenerValidationTest {
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    /**
+     * Checks for exception in case parsable stack is empty while validating for
+     * not empty scenario.
+     */
+    @Test
+    public void validateStackIsNotEmptyForEmptyStack() {
+
+        String expectedError = ListenerErrorMessageConstruction.constructListenerErrorMessage(ListenerErrorType.MISSING_HOLDER, YangConstructType.YANGBASE_DATA, "", ListenerErrorLocation.EXIT);
+
+        // Get the exception occurred during parsing.
+        thrown.expect(ParserException.class);
+        thrown.expectMessage(expectedError);
+
+        // Create test walker and assign test error to it.
+        TreeWalkListener testWalker = new TreeWalkListener();
+
+        ListenerValidation.checkStackIsNotEmpty(testWalker, ListenerErrorType.MISSING_HOLDER, YangConstructType.YANGBASE_DATA, "", ListenerErrorLocation.EXIT);
+    }
+
+    /**
+     * Checks if there is no exception in case parsable stack is not empty while
+     * validating for not empty scenario.
+     */
+    @Test
+    public void validateStackIsNotEmptyForNonEmptyStack() {
+
+        // Create test walker and assign test error to it.
+        TreeWalkListener testWalker = new TreeWalkListener();
+
+        // Create a temporary node of parsable.
+        YangRevision tmpNode = new YangRevision();
+        testWalker.getParsedDataStack().push(tmpNode);
+
+        ListenerValidation.checkStackIsNotEmpty(testWalker, ListenerErrorType.MISSING_HOLDER, YangConstructType.YANGBASE_DATA, "", ListenerErrorLocation.EXIT);
+    }
+
+    /**
+     * Checks for exception in case parsable stack is not empty while validating
+     * for empty scenario.
+     */
+    @Test
+    public void validateStackIsEmptyForNonEmptyStack() {
+
+        String expectedError = ListenerErrorMessageConstruction.constructListenerErrorMessage(ListenerErrorType.MISSING_HOLDER, YangConstructType.YANGBASE_DATA, "", ListenerErrorLocation.EXIT);
+
+        // Get the exception occurred during parsing.
+        thrown.expect(ParserException.class);
+        thrown.expectMessage(expectedError);
+
+        // Create test walker and assign test error to it.
+        TreeWalkListener testWalker = new TreeWalkListener();
+
+        // Create a temporary node of parsable.
+        YangRevision tmpNode = new YangRevision();
+        testWalker.getParsedDataStack().push(tmpNode);
+
+        ListenerValidation.checkStackIsEmpty(testWalker, ListenerErrorType.MISSING_HOLDER, YangConstructType.YANGBASE_DATA, "", ListenerErrorLocation.EXIT);
+    }
+
+    /**
+     * Checks if there is no exception in case parsable stack is empty while
+     * validating for empty scenario.
+     */
+    @Test
+    public void validateStackIsEmptyForEmptyStack() {
+
+        // Create test walker and assign test error to it.
+        TreeWalkListener testWalker = new TreeWalkListener();
+
+        ListenerValidation.checkStackIsEmpty(testWalker, ListenerErrorType.MISSING_HOLDER, YangConstructType.YANGBASE_DATA, "", ListenerErrorLocation.EXIT);
+    }
+}
diff --git a/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/parserutils/ParseTreeErrorListenerTest.java b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/parserutils/ParseTreeErrorListenerTest.java
new file mode 100644
index 0000000..da0c399
--- /dev/null
+++ b/compiler/base/parser/src/test/java/org/onosproject/yang/compiler/parser/impl/parserutils/ParseTreeErrorListenerTest.java
@@ -0,0 +1,100 @@
+/*
+ * 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.parserutils;
+
+import org.antlr.v4.runtime.ANTLRFileStream;
+import org.antlr.v4.runtime.ANTLRInputStream;
+import org.antlr.v4.runtime.CommonTokenStream;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangLexer;
+import org.onosproject.yang.compiler.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.CustomExceptionMatcher;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.IOException;
+
+/**
+ * Test case for testing parse tree error listener.
+ */
+public class ParseTreeErrorListenerTest {
+
+    YangUtilsParserManager manager = new YangUtilsParserManager();
+    File file;
+    BufferedWriter out;
+
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    /**
+     * Checks that no exception is generated for YANG file with valid syntax.
+     */
+    @Test
+    public void checkValidYangFileForNoSyntaxError() throws IOException {
+
+        ANTLRInputStream input = new ANTLRFileStream("src/test/resources/YangFileWithoutSyntaxError.yang");
+
+        // Create a lexer that feeds off of input char stream.
+        GeneratedYangLexer lexer = new GeneratedYangLexer(input);
+        // Create a buffer of tokens pulled from the lexer.
+        CommonTokenStream tokens = new CommonTokenStream(lexer);
+        // Create a parser that feeds off the tokens buffer.
+        GeneratedYangParser parser = new GeneratedYangParser(tokens);
+        // Remove console error listener.
+        parser.removeErrorListeners();
+        // Create instance of customized error listener.
+        ParseTreeErrorListener parseTreeErrorListener = new ParseTreeErrorListener();
+        // Add customized error listener to catch errors during parsing.
+        parser.addErrorListener(parseTreeErrorListener);
+        // Begin parsing YANG file and generate parse tree.
+        ParseTree tree = parser.yangfile();
+    }
+
+    /**
+     * Checks that exception is generated for YANG file with invalid syntax.
+     */
+    @Test
+    public void checkInvalidYangFileForSyntaxError() throws IOException {
+
+        // Get the exception occurred during parsing.
+        thrown.expect(ParserException.class);
+        thrown.expect(CustomExceptionMatcher.errorLocation(3, 0));
+        thrown.expectMessage("no viable alternative at input 'yang-version 1\\nnamespace'");
+
+        ANTLRInputStream input = new ANTLRFileStream("src/test/resources/YangFileWithSyntaxError.yang");
+
+        // Create a lexer that feeds off of input char stream.
+        GeneratedYangLexer lexer = new GeneratedYangLexer(input);
+        // Create a buffer of tokens pulled from the lexer.
+        CommonTokenStream tokens = new CommonTokenStream(lexer);
+        // Create a parser that feeds off the tokens buffer.
+        GeneratedYangParser parser = new GeneratedYangParser(tokens);
+        // Remove console error listener.
+        parser.removeErrorListeners();
+        // Create instance of customized error listener.
+        ParseTreeErrorListener parseTreeErrorListener = new ParseTreeErrorListener();
+        // Add customized error listener to catch errors during parsing.
+        parser.addErrorListener(parseTreeErrorListener);
+        // Begin parsing YANG file and generate parse tree.
+        ParseTree tree = parser.yangfile();
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/AnyxmlStatement.yang b/compiler/base/parser/src/test/resources/AnyxmlStatement.yang
new file mode 100644
index 0000000..4b1e421
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/AnyxmlStatement.yang
@@ -0,0 +1,16 @@
+module event {
+
+    namespace "http://example.com/event";
+    prefix "ev";
+
+    notification event {
+        leaf event-class {
+            type string;
+        }
+        anyxml reporting-entity;
+        leaf severity {
+            type string;
+        }
+    }
+}
+
diff --git a/compiler/base/parser/src/test/resources/BelongsToDualPrefix.yang b/compiler/base/parser/src/test/resources/BelongsToDualPrefix.yang
new file mode 100644
index 0000000..37973da
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/BelongsToDualPrefix.yang
@@ -0,0 +1,8 @@
+submodule Test {
+yang-version 1;
+belongs-to ONOS {
+prefix On1;
+prefix On2;
+}
+}
+
diff --git a/compiler/base/parser/src/test/resources/BelongsToWithPrefix.yang b/compiler/base/parser/src/test/resources/BelongsToWithPrefix.yang
new file mode 100644
index 0000000..75a13ca
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/BelongsToWithPrefix.yang
@@ -0,0 +1,6 @@
+submodule Test {
+yang-version 1;
+belongs-to ONOS {
+prefix On1;
+}
+}
diff --git a/compiler/base/parser/src/test/resources/BelongsToWithoutPrefix.yang b/compiler/base/parser/src/test/resources/BelongsToWithoutPrefix.yang
new file mode 100644
index 0000000..eaf9885
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/BelongsToWithoutPrefix.yang
@@ -0,0 +1,6 @@
+submodule Test {
+yang-version 1;
+belongs-to ONOS {
+}
+}
+
diff --git a/compiler/base/parser/src/test/resources/BitTypeStatement.yang b/compiler/base/parser/src/test/resources/BitTypeStatement.yang
new file mode 100644
index 0000000..9d13495
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/BitTypeStatement.yang
@@ -0,0 +1,12 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+     leaf mybits {
+         type bits {
+             bit disable-nagle;
+             bit auto-sense-speed;
+             bit Ten-Mb-only;
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/BitTypedefReferredLeafStatement.yang b/compiler/base/parser/src/test/resources/BitTypedefReferredLeafStatement.yang
new file mode 100644
index 0000000..cda6381
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/BitTypedefReferredLeafStatement.yang
@@ -0,0 +1,22 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    typedef topBits { 
+        type bits {
+             bit disable-nagle {
+                 position 0;
+             }
+             bit auto-sense-speed {
+                 position 1;
+             }
+             bit Mb-only {
+                 position 2;
+             }
+         }
+    }
+
+    leaf myBits {
+        type topBits;
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/BitTypedefStatement.yang b/compiler/base/parser/src/test/resources/BitTypedefStatement.yang
new file mode 100644
index 0000000..d3dc26a
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/BitTypedefStatement.yang
@@ -0,0 +1,18 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    typedef type15 { 
+        type bits {
+             bit disable-nagle {
+                 position 0;
+             }
+             bit auto-sense-speed {
+                 position 1;
+             }
+             bit Mb-only {
+                 position 2;
+             }
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/BitUnionStatement.yang b/compiler/base/parser/src/test/resources/BitUnionStatement.yang
new file mode 100644
index 0000000..dd62eae
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/BitUnionStatement.yang
@@ -0,0 +1,20 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf type15 { 
+        type union {
+            type bits {
+                bit disable-nagle {
+                    position 0;
+                }
+                bit auto-sense-speed {
+                    position 1;
+                }
+                bit Mb-only {
+                    position 2;
+                }
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/BitWithDuplicateName.yang b/compiler/base/parser/src/test/resources/BitWithDuplicateName.yang
new file mode 100644
index 0000000..ed5cc32
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/BitWithDuplicateName.yang
@@ -0,0 +1,12 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+     leaf mybits {
+         type bits {
+             bit disable-nagle;
+             bit disable-nagle;
+             bit Ten-Mb-only;
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/CaseChoiceHierarchy.yang b/compiler/base/parser/src/test/resources/CaseChoiceHierarchy.yang
new file mode 100644
index 0000000..28d110e
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/CaseChoiceHierarchy.yang
@@ -0,0 +1,23 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container food {
+        choice snack {
+            case sports-arena {
+                leaf pretzel {
+                    type empty;
+                }
+            }
+            case late-night {
+                choice dinner {
+                    case late-night {
+                        leaf beer {
+                            type empty;
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/CaseStatement.yang b/compiler/base/parser/src/test/resources/CaseStatement.yang
new file mode 100644
index 0000000..bb3f6c9
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/CaseStatement.yang
@@ -0,0 +1,26 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+     container food {
+       choice snack {
+           case sports-arena {
+               leaf pretzel {
+                   type empty;
+               }
+               leaf beer {
+                   type empty;
+               }
+           }
+           case late-night {
+               leaf chocolate {
+                   type enumeration {
+                       enum dark;
+                       enum milk;
+                       enum first-available;
+                   }
+               }
+           }
+       }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/CaseStatementSameEntryDifferentChoice.yang b/compiler/base/parser/src/test/resources/CaseStatementSameEntryDifferentChoice.yang
new file mode 100644
index 0000000..b42cdf9
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/CaseStatementSameEntryDifferentChoice.yang
@@ -0,0 +1,28 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+     container food {
+       choice snack {
+           case sports-arena {
+               leaf pretzel {
+                   type empty;
+               }
+               leaf beer {
+                   type empty;
+               }
+           }
+       }
+       choice lunch {
+           case sports-arena {
+               leaf chocolate {
+                   type enumeration {
+                       enum dark;
+                       enum milk;
+                       enum first-available;
+                   }
+               }
+           }
+       }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/CaseSubStatementOfAugment.yang b/compiler/base/parser/src/test/resources/CaseSubStatementOfAugment.yang
new file mode 100644
index 0000000..7123f91
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/CaseSubStatementOfAugment.yang
@@ -0,0 +1,58 @@
+module event {
+
+    namespace "http://example.com/event";
+    prefix "ev";
+
+    augment /snmp:snmp/snmp:engine/snmp:listen/snmp:transport {
+    if-feature tlstm;
+    case tls {
+      container tls {
+        description
+          "A list of IPv4 and IPv6 addresses and ports to which the
+           engine listens for SNMP messages over TLS.";
+        leaf ip {
+          type inet:ip-address;
+          mandatory true;
+          description
+            "The IPv4 or IPv6 address on which the engine listens
+             for SNMP messages over TLS.";
+        }
+        leaf port {
+          type inet:port-number;
+          description
+            "The TCP port on which the engine listens for SNMP
+             messages over TLS.
+             If the port is not configured, an engine that
+             acts as a Command Responder uses port 10161, and
+             an engine that acts as a Notification Receiver
+             uses port 10162.";
+        }
+      }
+    }
+    case dtls {
+      container dtls1 {
+        description
+          "A list of IPv4 and IPv6 addresses and ports to which the
+           engine listens for SNMP messages over DTLS.";
+        leaf ip {
+          type inet:ip-address;
+          mandatory true;
+          description
+            "The IPv4 or IPv6 address on which the engine listens
+             for SNMP messages over DTLS.";
+        }
+        leaf port {
+          type inet:port-number;
+          description
+            "The UDP port on which the engine listens for SNMP
+             messages over DTLS.
+             If the port is not configured, an engine that
+             acts as a Command Responder uses port 10161, and
+             an engine that acts as a Notification Receiver
+             uses port 10162.";
+        }
+      }
+    }
+  }
+}
+
diff --git a/compiler/base/parser/src/test/resources/ChoiceStatementDuplicateEntry.yang b/compiler/base/parser/src/test/resources/ChoiceStatementDuplicateEntry.yang
new file mode 100644
index 0000000..d2a6371
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ChoiceStatementDuplicateEntry.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+     container food {
+       choice snack;
+       choice lunch;
+       choice snack;
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ChoiceStatementSameEntryDifferentContainer.yang b/compiler/base/parser/src/test/resources/ChoiceStatementSameEntryDifferentContainer.yang
new file mode 100644
index 0000000..39ba626
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ChoiceStatementSameEntryDifferentContainer.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+     container food1 {
+       choice snack;
+       choice lunch;
+    }
+     container food2 {
+       choice snack;
+       choice lunch;
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ChoiceStatementWithStmtend.yang b/compiler/base/parser/src/test/resources/ChoiceStatementWithStmtend.yang
new file mode 100644
index 0000000..4b85f59
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ChoiceStatementWithStmtend.yang
@@ -0,0 +1,8 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+     container food {
+       choice snack;
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ChoiceStatementWithoutBody.yang b/compiler/base/parser/src/test/resources/ChoiceStatementWithoutBody.yang
new file mode 100644
index 0000000..2de7787
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ChoiceStatementWithoutBody.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+     container food {
+       choice snack {
+       }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ChoiceSubStatementDefault.yang b/compiler/base/parser/src/test/resources/ChoiceSubStatementDefault.yang
new file mode 100644
index 0000000..b9fd60d
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ChoiceSubStatementDefault.yang
@@ -0,0 +1,23 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container food {
+       choice snack {
+           case sports-arena {
+               leaf pretzel {
+                   type string;
+               }
+               leaf beer {
+                   type string;
+               }
+           }
+           case late-night {
+               leaf chocolate {
+                   type string;
+               }
+           }
+           default "hello";
+       }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ConfigDefaultValue.yang b/compiler/base/parser/src/test/resources/ConfigDefaultValue.yang
new file mode 100644
index 0000000..7e19946
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ConfigDefaultValue.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container valid {
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            description "Interval before a route is declared invalid";
+            mandatory true;
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ConfigEmptyValue.yang b/compiler/base/parser/src/test/resources/ConfigEmptyValue.yang
new file mode 100644
index 0000000..0d62956
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ConfigEmptyValue.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        config ;
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ConfigFalse.yang b/compiler/base/parser/src/test/resources/ConfigFalse.yang
new file mode 100644
index 0000000..79dc5ac
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ConfigFalse.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config false;
+        mandatory true;
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ConfigFalseNoKey.yang b/compiler/base/parser/src/test/resources/ConfigFalseNoKey.yang
new file mode 100644
index 0000000..66f141e
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ConfigFalseNoKey.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        config false;
+        leaf invalid-interval {
+            type "string";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ConfigFalseParentContainerChildLeaf.yang b/compiler/base/parser/src/test/resources/ConfigFalseParentContainerChildLeaf.yang
new file mode 100644
index 0000000..ecc0806
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ConfigFalseParentContainerChildLeaf.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container valid {
+        config false;
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            config true;
+            reference "RFC 6020";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ConfigFalseParentContainerChildLeafList.yang b/compiler/base/parser/src/test/resources/ConfigFalseParentContainerChildLeafList.yang
new file mode 100644
index 0000000..e3c7836
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ConfigFalseParentContainerChildLeafList.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container valid {
+        config false;
+        leaf-list invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            config true;
+            reference "RFC 6020";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ConfigFalseParentContainerChildList.yang b/compiler/base/parser/src/test/resources/ConfigFalseParentContainerChildList.yang
new file mode 100644
index 0000000..ffc6f60
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ConfigFalseParentContainerChildList.yang
@@ -0,0 +1,18 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container valid {
+        config false;
+        list valid {
+            key "invalid-interval";
+            config true;
+            leaf invalid-interval {
+                type "uint16";
+                units "seconds";
+                status current;
+                reference "RFC 6020";
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ConfigFalseParentListChildContainer.yang b/compiler/base/parser/src/test/resources/ConfigFalseParentListChildContainer.yang
new file mode 100644
index 0000000..3158dd4
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ConfigFalseParentListChildContainer.yang
@@ -0,0 +1,24 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        config false;
+        key "invalid-interval";
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+        container valid {
+            config true;
+            leaf invalid-interval {
+                type "uint16";
+                units "seconds";
+                status current;
+                reference "RFC 6020";
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ConfigFalseParentListChildLeaf.yang b/compiler/base/parser/src/test/resources/ConfigFalseParentListChildLeaf.yang
new file mode 100644
index 0000000..65171dd
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ConfigFalseParentListChildLeaf.yang
@@ -0,0 +1,16 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid-interval";
+        config false;
+        leaf invalid-interval {
+            type "uint16";
+            config true;
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ConfigFalseParentListChildLeafList.yang b/compiler/base/parser/src/test/resources/ConfigFalseParentListChildLeafList.yang
new file mode 100644
index 0000000..33132cd
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ConfigFalseParentListChildLeafList.yang
@@ -0,0 +1,16 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid-interval";
+        config false;
+        leaf-list invalid-interval {
+            type "uint16";
+            config true;
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ConfigFalseValidKeyValidLeaf.yang b/compiler/base/parser/src/test/resources/ConfigFalseValidKeyValidLeaf.yang
new file mode 100644
index 0000000..368a4b5
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ConfigFalseValidKeyValidLeaf.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid-interval";
+        config false;
+        leaf invalid-interval {
+            type "string";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ConfigInvalidValue.yang b/compiler/base/parser/src/test/resources/ConfigInvalidValue.yang
new file mode 100644
index 0000000..b2e7659
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ConfigInvalidValue.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        config invalid;
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ConfigTrue.yang b/compiler/base/parser/src/test/resources/ConfigTrue.yang
new file mode 100644
index 0000000..70349a0
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ConfigTrue.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config true;
+        mandatory true;
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ConfigTrueNoKey.yang b/compiler/base/parser/src/test/resources/ConfigTrueNoKey.yang
new file mode 100644
index 0000000..7a0a538
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ConfigTrueNoKey.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        config true;
+        leaf invalid-interval {
+            type "string";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ConfigTrueNoleafNoLeafList.yang b/compiler/base/parser/src/test/resources/ConfigTrueNoleafNoLeafList.yang
new file mode 100644
index 0000000..c553e60
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ConfigTrueNoleafNoLeafList.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        config true;
+        container container1 {
+           leaf leaf1 {
+              type "string";
+           }
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ConfigTrueValidKeyValidLeaf.yang b/compiler/base/parser/src/test/resources/ConfigTrueValidKeyValidLeaf.yang
new file mode 100644
index 0000000..fe8efe3
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ConfigTrueValidKeyValidLeaf.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid-interval";
+        leaf invalid-interval {
+            type "string";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ConfigTrueValidKeyValidLeafList.yang b/compiler/base/parser/src/test/resources/ConfigTrueValidKeyValidLeafList.yang
new file mode 100644
index 0000000..4196be4
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ConfigTrueValidKeyValidLeafList.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid-interval";
+        leaf-list invalid-interval {
+            type "string";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ConfigWithoutStatementEnd.yang b/compiler/base/parser/src/test/resources/ConfigWithoutStatementEnd.yang
new file mode 100644
index 0000000..0ae02af
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ConfigWithoutStatementEnd.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        config false
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ContactDualEntryTest.yang b/compiler/base/parser/src/test/resources/ContactDualEntryTest.yang
new file mode 100644
index 0000000..2dca10e
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContactDualEntryTest.yang
@@ -0,0 +1,9 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+organization "IETF SPRING Working Group";
+contact "WG List";
+contact "Invalid";
+}
+
diff --git a/compiler/base/parser/src/test/resources/ContactIncorrectOrder.yang b/compiler/base/parser/src/test/resources/ContactIncorrectOrder.yang
new file mode 100644
index 0000000..237d003
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContactIncorrectOrder.yang
@@ -0,0 +1,7 @@
+module Test {
+yang-version 1;
+contact "Test";
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+organization "IETF SPRING Working Group";
+}
diff --git a/compiler/base/parser/src/test/resources/ContactValidEntry.yang b/compiler/base/parser/src/test/resources/ContactValidEntry.yang
new file mode 100644
index 0000000..f88e147
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContactValidEntry.yang
@@ -0,0 +1,9 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+organization "IETF SPRING Working Group";
+contact "WG List:  <mailto:spring@ietf.org>
+Editor:    Stephane Litkowski
+           <mailto:stephane.litkowski@orange.com>";
+}
diff --git a/compiler/base/parser/src/test/resources/ContactWithEmptyString.yang b/compiler/base/parser/src/test/resources/ContactWithEmptyString.yang
new file mode 100644
index 0000000..34c6008
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContactWithEmptyString.yang
@@ -0,0 +1,7 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+organization "IETF SPRING Working Group";
+contact;
+}
diff --git a/compiler/base/parser/src/test/resources/ContactWithoutQuotes.yang b/compiler/base/parser/src/test/resources/ContactWithoutQuotes.yang
new file mode 100644
index 0000000..20ab72b
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContactWithoutQuotes.yang
@@ -0,0 +1,8 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+organization "IETF SPRING Working Group";
+contact WG;
+}
+
diff --git a/compiler/base/parser/src/test/resources/ContainerDuplicateContainer.yang b/compiler/base/parser/src/test/resources/ContainerDuplicateContainer.yang
new file mode 100644
index 0000000..4928463
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContainerDuplicateContainer.yang
@@ -0,0 +1,23 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container ospf {
+        container valid {
+            leaf invalid-interval {
+                type "uint16";
+                units "seconds";
+                status current;
+                reference "RFC 6020";
+            }
+        }
+        container valid {
+            leaf invalid-interval {
+                type "uint16";
+                units "seconds";
+                status current;
+                reference "RFC 6020";
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ContainerInvalidIdentifier.yang b/compiler/base/parser/src/test/resources/ContainerInvalidIdentifier.yang
new file mode 100644
index 0000000..eee1acd
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContainerInvalidIdentifier.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container 1valid {
+        reference "RFC 6020";
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ContainerRootNode.yang b/compiler/base/parser/src/test/resources/ContainerRootNode.yang
new file mode 100644
index 0000000..441d717
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContainerRootNode.yang
@@ -0,0 +1,9 @@
+container valid {
+    reference "RFC 6020";
+    leaf invalid-interval {
+        type "uint16";
+        units "seconds";
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ContainerSubStatementCardinality.yang b/compiler/base/parser/src/test/resources/ContainerSubStatementCardinality.yang
new file mode 100644
index 0000000..731e389
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContainerSubStatementCardinality.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container valid {
+        reference "RFC 6020";
+        reference "RFC 6020";
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ContainerSubStatementConfig.yang b/compiler/base/parser/src/test/resources/ContainerSubStatementConfig.yang
new file mode 100644
index 0000000..736dcbc
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContainerSubStatementConfig.yang
@@ -0,0 +1,16 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container valid {
+        config true;
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            description "Interval before a route is declared invalid";
+            mandatory true;
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ContainerSubStatementContainer.yang b/compiler/base/parser/src/test/resources/ContainerSubStatementContainer.yang
new file mode 100644
index 0000000..1f9f810
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContainerSubStatementContainer.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container ospf {
+        container valid {
+            leaf invalid-interval {
+                type "uint16";
+                units "seconds";
+                status current;
+                reference "RFC 6020";
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ContainerSubStatementDescription.yang b/compiler/base/parser/src/test/resources/ContainerSubStatementDescription.yang
new file mode 100644
index 0000000..dc75d00
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContainerSubStatementDescription.yang
@@ -0,0 +1,18 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container valid {
+        description "container description";
+        config true;
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            description "Interval before a route is declared invalid";
+            mandatory true;
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
+
diff --git a/compiler/base/parser/src/test/resources/ContainerSubStatementErrorAppTag.yang b/compiler/base/parser/src/test/resources/ContainerSubStatementErrorAppTag.yang
new file mode 100644
index 0000000..644b890
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContainerSubStatementErrorAppTag.yang
@@ -0,0 +1,25 @@
+module ErrorAppTag {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container interface {
+        leaf ifType {
+            type enumeration {
+                enum ethernet;
+                enum atm;
+            }
+        }
+        leaf ifMTU {
+            type uint32;
+        }
+        must "ifType != 'ethernet' or " +
+             "(ifType = 'ethernet' and ifMTU = 1500)" {
+            description "An ethernet MTU must be 1500";
+            error-app-tag "An ethernet MTU must be 1500";
+        }
+        must "ifType != 'atm' or " +
+             "(ifType = 'atm' and ifMTU <= 17966 and ifMTU >= 64)" {
+            description "An atm MTU must be  64 .. 17966";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ContainerSubStatementErrorDefaultAppTag.yang b/compiler/base/parser/src/test/resources/ContainerSubStatementErrorDefaultAppTag.yang
new file mode 100644
index 0000000..c265ea2
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContainerSubStatementErrorDefaultAppTag.yang
@@ -0,0 +1,24 @@
+module ErrorAppTag {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container interface {
+        leaf ifType {
+            type enumeration {
+                enum ethernet;
+                enum atm;
+            }
+        }
+        leaf ifMTU {
+            type uint32;
+        }
+        must "ifType != 'ethernet' or " +
+             "(ifType = 'ethernet' and ifMTU = 1500)" {
+            description "An ethernet MTU must be 1500";
+        }
+        must "ifType != 'atm' or " +
+             "(ifType = 'atm' and ifMTU <= 17966 and ifMTU >= 64)" {
+            description "An atm MTU must be  64 .. 17966";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ContainerSubStatementErrorMessage.yang b/compiler/base/parser/src/test/resources/ContainerSubStatementErrorMessage.yang
new file mode 100644
index 0000000..4726d0c
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContainerSubStatementErrorMessage.yang
@@ -0,0 +1,25 @@
+module ErrorMessage {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container interface {
+        leaf ifType {
+            type enumeration {
+                enum ethernet;
+                enum atm;
+            }
+        }
+        leaf ifMTU {
+            type uint32;
+        }
+        must "ifType != 'ethernet' or " +
+             "(ifType = 'ethernet' and ifMTU = 1500)" {
+            description "An ethernet MTU must be 1500";
+            error-message "An ethernet MTU must be 1500";
+        }
+        must "ifType != 'atm' or " +
+             "(ifType = 'atm' and ifMTU <= 17966 and ifMTU >= 64)" {
+            description "An atm MTU must be  64 .. 17966";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ContainerSubStatementLeaf.yang b/compiler/base/parser/src/test/resources/ContainerSubStatementLeaf.yang
new file mode 100644
index 0000000..c9a64e3
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContainerSubStatementLeaf.yang
@@ -0,0 +1,17 @@
+
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container valid {
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            description "Interval before a route is declared invalid";
+            config true;
+            mandatory true;
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ContainerSubStatementLeafList.yang b/compiler/base/parser/src/test/resources/ContainerSubStatementLeafList.yang
new file mode 100644
index 0000000..a1877b6
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContainerSubStatementLeafList.yang
@@ -0,0 +1,17 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container valid {
+        leaf-list invalid-interval {
+            type "uint16";
+            units "seconds";
+            description "Interval before a route is declared invalid";
+            config true;
+            min-elements 1;
+            max-elements unbounded;
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ContainerSubStatementList.yang b/compiler/base/parser/src/test/resources/ContainerSubStatementList.yang
new file mode 100644
index 0000000..19810c7
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContainerSubStatementList.yang
@@ -0,0 +1,16 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container ospf {
+        list valid {
+            key "invalid-interval";
+            leaf invalid-interval {
+                type "uint16";
+                units "seconds";
+                status current;
+                reference "RFC 6020";
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ContainerSubStatementMust.yang b/compiler/base/parser/src/test/resources/ContainerSubStatementMust.yang
new file mode 100644
index 0000000..c089850
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContainerSubStatementMust.yang
@@ -0,0 +1,24 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container interface {
+        leaf ifType {
+            type enumeration {
+                enum ethernet;
+                enum atm;
+            }
+        }
+        leaf ifMTU {
+            type uint32;
+        }
+        must "ifType != 'ethernet' or " +
+             "(ifType = 'ethernet' and ifMTU = 1500)" {
+            description "An ethernet MTU must be 1500";
+        }
+        must "ifType != 'atm' or " +
+             "(ifType = 'atm' and ifMTU <= 17966 and ifMTU >= 64)" {
+            description "An atm MTU must be  64 .. 17966";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ContainerSubStatementPresence.yang b/compiler/base/parser/src/test/resources/ContainerSubStatementPresence.yang
new file mode 100644
index 0000000..d3a30dc
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContainerSubStatementPresence.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container valid {
+        presence "invalid";
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ContainerSubStatementReference.yang b/compiler/base/parser/src/test/resources/ContainerSubStatementReference.yang
new file mode 100644
index 0000000..33f37fd
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContainerSubStatementReference.yang
@@ -0,0 +1,17 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container valid {
+        reference "container reference";
+        config true;
+        leaf invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        mandatory true;
+        status current;
+        reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ContainerSubStatementStatus.yang b/compiler/base/parser/src/test/resources/ContainerSubStatementStatus.yang
new file mode 100644
index 0000000..fdf907d
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContainerSubStatementStatus.yang
@@ -0,0 +1,17 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container valid {
+        config true;
+        status obsolete;
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            description "Interval before a route is declared invalid";
+            mandatory true;
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ContainerSubStatementWhen.yang b/compiler/base/parser/src/test/resources/ContainerSubStatementWhen.yang
new file mode 100644
index 0000000..c25b499
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContainerSubStatementWhen.yang
@@ -0,0 +1,37 @@
+module Test {
+    yang-version 1;
+    namespace "http://huawei.com";
+    prefix Ant;
+    list interface-switching-capability {
+         when "../switching-capability = 'TDM'" {
+                 description "Valid only for TDM";
+         }
+         key "switching-capability";
+         description
+           "List of Interface Switching Capabilities Descriptors (ISCD)
+            for this link.";
+         reference
+           "RFC3471: Generalized Multi-Protocol Label Switching (GMPLS)
+            Signaling Functional Description.
+            RFC4203: OSPF Extensions in Support of Generalized
+            Multi-Protocol Label Switching (GMPLS).";
+         leaf switching-capability {
+           type string;
+           description
+             "Switching Capability for this interface.";
+         }
+     }
+     container time-division-multiplex-capable {
+         when "../switching-capability = 'TDM'" {
+             description "Valid only for TDM";
+         }
+         description
+             "Interface has time-division multiplex capabilities.";
+
+         leaf minimum-lsp-bandwidth {
+             type decimal64 {
+                fraction-digits 4;
+             } 
+         }
+     }
+}
diff --git a/compiler/base/parser/src/test/resources/ContainerSubStatements.yang b/compiler/base/parser/src/test/resources/ContainerSubStatements.yang
new file mode 100644
index 0000000..2611f97
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContainerSubStatements.yang
@@ -0,0 +1,18 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container ospf {
+        presence "ospf logs";
+        config true;
+        description "container description";
+        status current;
+        reference "container reference";
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ContainerWithDuplicateLeaf.yang b/compiler/base/parser/src/test/resources/ContainerWithDuplicateLeaf.yang
new file mode 100644
index 0000000..3adaccd
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ContainerWithDuplicateLeaf.yang
@@ -0,0 +1,34 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container valid {
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            description "Interval before a route is declared invalid";
+            config true;
+            mandatory true;
+            status current;
+            reference "RFC 6020";
+        }
+        leaf valid-interval {
+            type "uint16";
+            units "seconds";
+            description "Interval before a route is declared invalid";
+            config true;
+            mandatory true;
+            status current;
+            reference "RFC 6020";
+        }
+        leaf valid-interval {
+            type "uint16";
+            units "seconds";
+            description "Interval before a route is declared invalid";
+            config true;
+            mandatory true;
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/DerivedTypeStatement.yang b/compiler/base/parser/src/test/resources/DerivedTypeStatement.yang
new file mode 100644
index 0000000..afbfd1d
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/DerivedTypeStatement.yang
@@ -0,0 +1,11 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    import ietf-yang-types {
+             prefix "P";
+         }
+    leaf invalid-interval {
+        type P:hello;
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/DescriptionEmptyStatement.yang b/compiler/base/parser/src/test/resources/DescriptionEmptyStatement.yang
new file mode 100644
index 0000000..f6c1c3d
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/DescriptionEmptyStatement.yang
@@ -0,0 +1,6 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    description "";
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/DescriptionStringConcat.yang b/compiler/base/parser/src/test/resources/DescriptionStringConcat.yang
new file mode 100644
index 0000000..8bf0519
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/DescriptionStringConcat.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        description "Interval before a " + "route is declared invalid";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/DescriptionValidStatement.yang b/compiler/base/parser/src/test/resources/DescriptionValidStatement.yang
new file mode 100644
index 0000000..70349a0
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/DescriptionValidStatement.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config true;
+        mandatory true;
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/DescriptionWithoutStatementEnd.yang b/compiler/base/parser/src/test/resources/DescriptionWithoutStatementEnd.yang
new file mode 100644
index 0000000..ebd8c24
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/DescriptionWithoutStatementEnd.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+      type "uint16";
+      description "Interval before a " + "route is declared invalid"
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/DuplicateCaseInChoice.yang b/compiler/base/parser/src/test/resources/DuplicateCaseInChoice.yang
new file mode 100644
index 0000000..a7b6b50
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/DuplicateCaseInChoice.yang
@@ -0,0 +1,26 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+     container food {
+       choice snack {
+           case sports-arena {
+               leaf pretzel {
+                   type empty;
+               }
+               leaf beer {
+                   type empty;
+               }
+           }
+           case sports-arena {
+               leaf chocolate {
+                   type enumeration {
+                       enum dark;
+                       enum milk;
+                       enum first-available;
+                   }
+               }
+           }
+       }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/DuplicateContainerAndList.yang b/compiler/base/parser/src/test/resources/DuplicateContainerAndList.yang
new file mode 100644
index 0000000..74c7721
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/DuplicateContainerAndList.yang
@@ -0,0 +1,29 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container ospf {
+        container valid {
+            leaf invalid-interval {
+                type "uint16";
+                units "seconds";
+                status current;
+                reference "RFC 6020";
+            }
+        }
+        list valid {
+            key "process-id";
+            container interface {
+                leaf invalid-interval {
+                    type "uint16";
+                    units "seconds";
+                    status current;
+                    reference "RFC 6020";
+                }
+            }
+            leaf process-id {
+                type "string";
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/DuplicateGroupingInContainer.yang b/compiler/base/parser/src/test/resources/DuplicateGroupingInContainer.yang
new file mode 100644
index 0000000..f130797
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/DuplicateGroupingInContainer.yang
@@ -0,0 +1,23 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container valid {
+        grouping endpoint {
+            leaf address {
+                type ip-address;
+            }
+            leaf port {
+                type port-number;
+            }
+        }
+        grouping endpoint {
+            leaf address {
+                type ip-address;
+            }
+            leaf port {
+                type port-number;
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/DuplicateGroupingInList.yang b/compiler/base/parser/src/test/resources/DuplicateGroupingInList.yang
new file mode 100644
index 0000000..a9d1b3b
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/DuplicateGroupingInList.yang
@@ -0,0 +1,36 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    import ietf-yang-types {
+             prefix "P";
+         }
+    list valid {
+        key address;
+        grouping endpoint {
+            description "grouping under test";
+            status current;
+            reference "RFC 6020";
+            leaf address {
+                type ip-address;
+            }
+            leaf port {
+                type port-number;
+            }
+        }
+        leaf address {
+            type ip;
+        }
+        grouping endpoint {
+            description "grouping under test";
+            status current;
+            reference "RFC 6020";
+            leaf address {
+                type ip-address;
+            }
+            leaf port {
+                type port-number;
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/DuplicateGroupingInModule.yang b/compiler/base/parser/src/test/resources/DuplicateGroupingInModule.yang
new file mode 100644
index 0000000..ec01781
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/DuplicateGroupingInModule.yang
@@ -0,0 +1,24 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    import ietf-yang-types {
+             prefix "P";
+         }
+    grouping endpoint {
+        leaf address {
+            type P:ip-address;
+        }
+        leaf port {
+            type P:port-number;
+        }
+    }
+    grouping endpoint {
+        leaf address {
+            type P:pip-address;
+        }
+        leaf port {
+            type P:port-number;
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/DuplicateLeafInChoice.yang b/compiler/base/parser/src/test/resources/DuplicateLeafInChoice.yang
new file mode 100644
index 0000000..f951c7f
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/DuplicateLeafInChoice.yang
@@ -0,0 +1,21 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+     container food {
+       choice snack {
+           case sports-arena {
+               leaf pretzel {
+                   type empty;
+               }
+               leaf beer {
+                   type empty;
+               }
+           }
+           case late-night {
+               leaf pretzel {
+                   type empty;
+               }
+           }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/DuplicateLeafInHierarchy.yang b/compiler/base/parser/src/test/resources/DuplicateLeafInHierarchy.yang
new file mode 100644
index 0000000..e23f04c
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/DuplicateLeafInHierarchy.yang
@@ -0,0 +1,23 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container food {
+        choice snack {
+            case sports-arena {
+                leaf pretzel {
+                    type empty;
+                }
+            }
+            case late-night {
+                choice lunch {
+                    case late {
+                        leaf pretzel {
+                            type empty;
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/EnumBoundaryValue.yang b/compiler/base/parser/src/test/resources/EnumBoundaryValue.yang
new file mode 100644
index 0000000..ac87ef0
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/EnumBoundaryValue.yang
@@ -0,0 +1,16 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf ifType {
+        type enumeration {
+             enum "unbounded";
+             enum ZERO;
+             enum two;
+             enum four;
+             enum seven {
+                 value 21474836472147483647;
+             }
+         }
+     }
+}
diff --git a/compiler/base/parser/src/test/resources/EnumMaxNextValue.yang b/compiler/base/parser/src/test/resources/EnumMaxNextValue.yang
new file mode 100644
index 0000000..4e4a373
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/EnumMaxNextValue.yang
@@ -0,0 +1,18 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf ifType {
+        type enumeration {
+             enum "unbounded";
+             enum ZERO;
+             enum two;
+             enum four;
+             enum seven {
+                 value 2147483647;
+             }
+             enum five;    
+            
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/EnumSorted.yang b/compiler/base/parser/src/test/resources/EnumSorted.yang
new file mode 100644
index 0000000..3760e83
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/EnumSorted.yang
@@ -0,0 +1,18 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf ifType {
+        type enumeration {
+             enum four{
+                 value 7;
+             }
+             enum seven {
+                 value 2147483647;
+             }
+             enum five {
+                 value 5;
+             }       
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/EnumTypeStatement.yang b/compiler/base/parser/src/test/resources/EnumTypeStatement.yang
new file mode 100644
index 0000000..1d64805
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/EnumTypeStatement.yang
@@ -0,0 +1,12 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf speed {
+        type enumeration {
+          enum 10m;
+          enum 100m;
+          enum auto;
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/EnumWithDuplicateName.yang b/compiler/base/parser/src/test/resources/EnumWithDuplicateName.yang
new file mode 100644
index 0000000..47c3a85
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/EnumWithDuplicateName.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf speed {
+        type enumeration {
+            enum 10m;
+            enum 100m;
+            enum 10m {
+                value 11;
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/GroupingAttributes.yang b/compiler/base/parser/src/test/resources/GroupingAttributes.yang
new file mode 100644
index 0000000..f04641f
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/GroupingAttributes.yang
@@ -0,0 +1,25 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    import ietf-yang-types {
+             prefix "P";
+         }
+    list valid {
+        key address;
+        leaf address {
+            type P:ip;
+        }
+        grouping endpoint {
+            description "grouping under test";
+            status current;
+            reference "RFC 6020";
+            leaf address {
+                type P:ip-address;
+            }
+            leaf port {
+                type P:port-number;
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/GroupingInContainer.yang b/compiler/base/parser/src/test/resources/GroupingInContainer.yang
new file mode 100644
index 0000000..dfa8259
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/GroupingInContainer.yang
@@ -0,0 +1,18 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    import ietf-yang-types {
+             prefix "P";
+         }
+    container valid {
+        grouping endpoint {
+            leaf address {
+                type P:ip-address;
+            }
+            leaf port {
+                type P:port-number;
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/GroupingInList.yang b/compiler/base/parser/src/test/resources/GroupingInList.yang
new file mode 100644
index 0000000..c5966fc
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/GroupingInList.yang
@@ -0,0 +1,22 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    import ietf-yang-types {
+             prefix "P";
+         }
+    list valid {
+        key address;
+        leaf address {
+            type P:ip;
+        }
+        grouping endpoint {
+            leaf address {
+                type P:ip-address;
+            }
+            leaf port {
+                type P:port-number;
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/GroupingInModule.yang b/compiler/base/parser/src/test/resources/GroupingInModule.yang
new file mode 100644
index 0000000..77fef1f
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/GroupingInModule.yang
@@ -0,0 +1,16 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    import ietf-yang-types {
+             prefix "P";
+         }
+    grouping endpoint {
+        leaf address {
+            type P:ip-address;
+        }
+        leaf port {
+            type P:port-number;
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/IdentityInModule.yang b/compiler/base/parser/src/test/resources/IdentityInModule.yang
new file mode 100644
index 0000000..5688615
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/IdentityInModule.yang
@@ -0,0 +1,14 @@
+module IdentityInModule{
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix IdentityInModule;
+
+    identity tunnel-type {
+        description
+           "Base identity from which specific tunnel types are derived.";
+    }
+
+    identity ref-address-family {
+        reference "http://www.iana.org/assignments/address-family-numbers/address-family-numbers.xhtml#address-family-numbers-2";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/IdentityIntraFile.yang b/compiler/base/parser/src/test/resources/IdentityIntraFile.yang
new file mode 100644
index 0000000..c61fcfb
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/IdentityIntraFile.yang
@@ -0,0 +1,23 @@
+module IdentityIntraFile {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix IdentityIntraFile;
+
+    import "IdentityInModule" {
+        prefix "IdentityInModule";
+    }
+
+    identity ipv4-address-family {
+        base IdentityInModule:ref-address-family;
+    }
+
+    identity ipv6-address-family {
+        base IdentityInModule:ref-address-family;
+    }
+
+    leaf tunnel {
+        type identityref {
+            base IdentityInModule:ref-address-family;
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/IdentityListener.yang b/compiler/base/parser/src/test/resources/IdentityListener.yang
new file mode 100644
index 0000000..a7ef4d2
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/IdentityListener.yang
@@ -0,0 +1,39 @@
+module IdentityListener{
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix IdentityListener;
+
+    identity tunnel {
+        description
+           "Base identity from which specific tunnel types are derived.";
+    }
+
+    identity tunnel-type {
+        description
+           "Base identity from which specific tunnel types are derived.";
+    }
+
+    identity ref-address-family {
+        reference "http://www.iana.org/assignments/address-family-numbers/address-family-numbers.xhtml#address-family-numbers-2";
+    }
+
+    identity ipv4-address-family {
+        base ref-address-family;
+    }
+
+    identity ipv6-address-family {
+        base ref-address-family;
+    }
+
+    leaf tunnel {
+        type identityref {
+            base ref-address-family;
+        }
+    }
+
+    leaf-list network-ref {
+        type identityref {
+            base ref-address-family;
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/IdentityTypedef.yang b/compiler/base/parser/src/test/resources/IdentityTypedef.yang
new file mode 100644
index 0000000..6e8f603
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/IdentityTypedef.yang
@@ -0,0 +1,20 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    identity tunnel {
+        description
+           "Base identity from which specific tunnel types are derived.";
+    }
+
+    leaf tunnel-value {
+        type type15;
+    }
+
+    typedef type15 {
+        type identityref {
+             base tunnel;
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/IdentityTypedefUnresolved.yang b/compiler/base/parser/src/test/resources/IdentityTypedefUnresolved.yang
new file mode 100644
index 0000000..d837fd1
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/IdentityTypedefUnresolved.yang
@@ -0,0 +1,16 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    identity tunnel {
+        description
+           "Base identity from which specific tunnel types are derived.";
+    }
+
+    typedef type15 {
+        type identityref {
+             base tunnel;
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ImportInvalidOrder.yang b/compiler/base/parser/src/test/resources/ImportInvalidOrder.yang
new file mode 100644
index 0000000..6bfc685
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ImportInvalidOrder.yang
@@ -0,0 +1,10 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+import ietf {
+revision-date 2015-02-03;
+prefix On1;
+}
+contact "Test";
+}
diff --git a/compiler/base/parser/src/test/resources/ImportMultipleInstance.yang b/compiler/base/parser/src/test/resources/ImportMultipleInstance.yang
new file mode 100644
index 0000000..175f2ff
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ImportMultipleInstance.yang
@@ -0,0 +1,14 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+import itut {
+prefix On3;
+revision-date 2016-02-03;
+}
+contact "Test";
+}
diff --git a/compiler/base/parser/src/test/resources/ImportValidEntry.yang b/compiler/base/parser/src/test/resources/ImportValidEntry.yang
new file mode 100644
index 0000000..b725d39
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ImportValidEntry.yang
@@ -0,0 +1,10 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+contact "Test";
+}
diff --git a/compiler/base/parser/src/test/resources/ImportWithDualPrefix.yang b/compiler/base/parser/src/test/resources/ImportWithDualPrefix.yang
new file mode 100644
index 0000000..8b40bb0
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ImportWithDualPrefix.yang
@@ -0,0 +1,11 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+import ietf {
+prefix On1;
+prefix On2;
+revision-date 2015-02-03;
+}
+contact "Test";
+}
diff --git a/compiler/base/parser/src/test/resources/ImportWithoutPrefix.yang b/compiler/base/parser/src/test/resources/ImportWithoutPrefix.yang
new file mode 100644
index 0000000..ee68e59
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ImportWithoutPrefix.yang
@@ -0,0 +1,9 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+import ietf {
+revision-date 2015-02-03;
+}
+contact "Test";
+}
diff --git a/compiler/base/parser/src/test/resources/ImportWithoutRevision.yang b/compiler/base/parser/src/test/resources/ImportWithoutRevision.yang
new file mode 100644
index 0000000..af47b7a
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ImportWithoutRevision.yang
@@ -0,0 +1,9 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+import ietf {
+prefix On2;
+}
+contact "Test";
+}
diff --git a/compiler/base/parser/src/test/resources/InValidIdentifierXML.yang b/compiler/base/parser/src/test/resources/InValidIdentifierXML.yang
new file mode 100644
index 0000000..c6a5a42
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/InValidIdentifierXML.yang
@@ -0,0 +1,5 @@
+module xMlTest {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+}
diff --git a/compiler/base/parser/src/test/resources/IncludeImportAnyOrder.yang b/compiler/base/parser/src/test/resources/IncludeImportAnyOrder.yang
new file mode 100644
index 0000000..05339a6
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/IncludeImportAnyOrder.yang
@@ -0,0 +1,16 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+include itut {
+revision-date 2016-02-03;
+}
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+}
diff --git a/compiler/base/parser/src/test/resources/IncludeInvalidDateSyntax.yang b/compiler/base/parser/src/test/resources/IncludeInvalidDateSyntax.yang
new file mode 100644
index 0000000..3716209
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/IncludeInvalidDateSyntax.yang
@@ -0,0 +1,16 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include itut {
+revision-date 16-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+}
diff --git a/compiler/base/parser/src/test/resources/IncludeInvalidSyntax.yang b/compiler/base/parser/src/test/resources/IncludeInvalidSyntax.yang
new file mode 100644
index 0000000..91ae17b
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/IncludeInvalidSyntax.yang
@@ -0,0 +1,16 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include itut; {
+revision-date 2016-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+}
diff --git a/compiler/base/parser/src/test/resources/IncludeMultiInstance.yang b/compiler/base/parser/src/test/resources/IncludeMultiInstance.yang
new file mode 100644
index 0000000..81a527a
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/IncludeMultiInstance.yang
@@ -0,0 +1,16 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include itut {
+revision-date 2016-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+}
diff --git a/compiler/base/parser/src/test/resources/IncludeWithDate.yang b/compiler/base/parser/src/test/resources/IncludeWithDate.yang
new file mode 100644
index 0000000..9701a2d
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/IncludeWithDate.yang
@@ -0,0 +1,13 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include itut {
+revision-date 2016-02-03;
+}
+contact "Test";
+}
diff --git a/compiler/base/parser/src/test/resources/IncludeWithEmptyBody.yang b/compiler/base/parser/src/test/resources/IncludeWithEmptyBody.yang
new file mode 100644
index 0000000..471fdb3
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/IncludeWithEmptyBody.yang
@@ -0,0 +1,12 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include itut {
+}
+contact "Test";
+}
diff --git a/compiler/base/parser/src/test/resources/IncludeWithStmtend.yang b/compiler/base/parser/src/test/resources/IncludeWithStmtend.yang
new file mode 100644
index 0000000..e40813b
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/IncludeWithStmtend.yang
@@ -0,0 +1,11 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include itut;
+contact "Test";
+}
diff --git a/compiler/base/parser/src/test/resources/InputStatementWithDataDefinition.yang b/compiler/base/parser/src/test/resources/InputStatementWithDataDefinition.yang
new file mode 100644
index 0000000..0adf3d3
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/InputStatementWithDataDefinition.yang
@@ -0,0 +1,28 @@
+module rock {
+    namespace "http://example.net/rock";
+    prefix "rock";
+
+    rpc activate-software-image {
+        description "description";
+        input {
+            leaf image-name {
+                type string;
+            }
+            list ospf {
+                key "invalid-interval";
+                config true;
+                max-elements 10;
+                min-elements 3;
+                leaf invalid-interval {
+                    type uint16;
+                }
+            }
+            container isis {
+               config true;
+               leaf invalid-interval {
+                   type uint16;
+               }
+           }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/InputStatementWithTypedef.yang b/compiler/base/parser/src/test/resources/InputStatementWithTypedef.yang
new file mode 100644
index 0000000..25ca73d
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/InputStatementWithTypedef.yang
@@ -0,0 +1,17 @@
+module rock {
+    namespace "http://example.net/rock";
+    prefix "rock";
+
+    rpc activate-software-image {
+        description "description";
+        input {
+            leaf image-name {
+                type string;
+            }
+            typedef my-type {
+                status deprecated;
+                type int32;
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/InstanceIdentifierListener.yang b/compiler/base/parser/src/test/resources/InstanceIdentifierListener.yang
new file mode 100644
index 0000000..0bbe2f1
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/InstanceIdentifierListener.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container currentcheck {
+        leaf invalid-interval {
+            type instance-identifier;
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/IntegerTypeStatement.yang b/compiler/base/parser/src/test/resources/IntegerTypeStatement.yang
new file mode 100644
index 0000000..ca2be38
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/IntegerTypeStatement.yang
@@ -0,0 +1,8 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/InvalidLeafIdentifier.yang b/compiler/base/parser/src/test/resources/InvalidLeafIdentifier.yang
new file mode 100644
index 0000000..6faf092
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/InvalidLeafIdentifier.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid-interval";
+        leaf invalid {
+            type "string";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/InvalidPatternSubStatements.yang b/compiler/base/parser/src/test/resources/InvalidPatternSubStatements.yang
new file mode 100644
index 0000000..76ff75e
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/InvalidPatternSubStatements.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type string {
+            pattern "[a-zA-Z]\" {
+                description "pattern description";
+                reference "pattern reference";
+            }
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/KeyLeafTypeEmpty.yang b/compiler/base/parser/src/test/resources/KeyLeafTypeEmpty.yang
new file mode 100644
index 0000000..859520c
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/KeyLeafTypeEmpty.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid-interval";
+        leaf invalid-interval {
+            type "empty";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/KeyWithUsesInList.yang b/compiler/base/parser/src/test/resources/KeyWithUsesInList.yang
new file mode 100644
index 0000000..d076d0a
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/KeyWithUsesInList.yang
@@ -0,0 +1,23 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    grouping network {
+        leaf invalid-interval {
+            type "string";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+    list valid {
+        key "invalid-interval";
+        leaf invalid {
+            type "string";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+        uses "network";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/KeyWithoutStatementEnd.yang b/compiler/base/parser/src/test/resources/KeyWithoutStatementEnd.yang
new file mode 100644
index 0000000..f56101a
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/KeyWithoutStatementEnd.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid"
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/LeafConfigInvalidCardinality.yang b/compiler/base/parser/src/test/resources/LeafConfigInvalidCardinality.yang
new file mode 100644
index 0000000..d403a56
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LeafConfigInvalidCardinality.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+       type "uint16";
+       units "seconds";
+       description "Interval before a route is declared invalid";
+       config true;
+       config false;
+       mandatory true;
+       status current;
+       reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/LeafInvalidIdentifier.yang b/compiler/base/parser/src/test/resources/LeafInvalidIdentifier.yang
new file mode 100644
index 0000000..dbfff13
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LeafInvalidIdentifier.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf 1invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config true;
+        mandatory true;
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/LeafListConfigInvalidCardinality.yang b/compiler/base/parser/src/test/resources/LeafListConfigInvalidCardinality.yang
new file mode 100644
index 0000000..361a852
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LeafListConfigInvalidCardinality.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config true;
+        config false;
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/LeafListInvalidIdentifier.yang b/compiler/base/parser/src/test/resources/LeafListInvalidIdentifier.yang
new file mode 100644
index 0000000..77c24d2
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LeafListInvalidIdentifier.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list 1invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config true;
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/LeafListInvalidStatement.yang b/compiler/base/parser/src/test/resources/LeafListInvalidStatement.yang
new file mode 100644
index 0000000..13e4b5f
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LeafListInvalidStatement.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaflist invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config true;
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/LeafListSubStatementConfig.yang b/compiler/base/parser/src/test/resources/LeafListSubStatementConfig.yang
new file mode 100644
index 0000000..293e4a5
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LeafListSubStatementConfig.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config true;
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/LeafListSubStatementDescription.yang b/compiler/base/parser/src/test/resources/LeafListSubStatementDescription.yang
new file mode 100644
index 0000000..293e4a5
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LeafListSubStatementDescription.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config true;
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/LeafListSubStatementMaxElements.yang b/compiler/base/parser/src/test/resources/LeafListSubStatementMaxElements.yang
new file mode 100644
index 0000000..5ab2d0f
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LeafListSubStatementMaxElements.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type "uint16";
+        max-elements 3;
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/LeafListSubStatementMinElements.yang b/compiler/base/parser/src/test/resources/LeafListSubStatementMinElements.yang
new file mode 100644
index 0000000..fd71281
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LeafListSubStatementMinElements.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type "uint16";
+        min-elements 3;
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/LeafListSubStatementReference.yang b/compiler/base/parser/src/test/resources/LeafListSubStatementReference.yang
new file mode 100644
index 0000000..293e4a5
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LeafListSubStatementReference.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config true;
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/LeafListSubStatementStatus.yang b/compiler/base/parser/src/test/resources/LeafListSubStatementStatus.yang
new file mode 100644
index 0000000..293e4a5
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LeafListSubStatementStatus.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config true;
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/LeafListSubStatementType.yang b/compiler/base/parser/src/test/resources/LeafListSubStatementType.yang
new file mode 100644
index 0000000..0e5ab56
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LeafListSubStatementType.yang
@@ -0,0 +1,8 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type "uint16";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/LeafListSubStatementUnits.yang b/compiler/base/parser/src/test/resources/LeafListSubStatementUnits.yang
new file mode 100644
index 0000000..293e4a5
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LeafListSubStatementUnits.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config true;
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/LeafListSubStatements.yang b/compiler/base/parser/src/test/resources/LeafListSubStatements.yang
new file mode 100644
index 0000000..29dfdb2
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LeafListSubStatements.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type "uint16";
+        units "seconds";
+        max-elements 3;
+        description "Interval before a route is declared invalid";
+        config true;
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/LeafListUnitsInvalidCardinality.yang b/compiler/base/parser/src/test/resources/LeafListUnitsInvalidCardinality.yang
new file mode 100644
index 0000000..996e49e
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LeafListUnitsInvalidCardinality.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type "uint16";
+        units "seconds";
+        units "minutes";
+        description "Interval before a route is declared invalid";
+        config true;
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/LeafListWithoutLeftBrace.yang b/compiler/base/parser/src/test/resources/LeafListWithoutLeftBrace.yang
new file mode 100644
index 0000000..1196422
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LeafListWithoutLeftBrace.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval 
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config true;
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/LeafMandatoryInvalidCardinality.yang b/compiler/base/parser/src/test/resources/LeafMandatoryInvalidCardinality.yang
new file mode 100644
index 0000000..c275dd7
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LeafMandatoryInvalidCardinality.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config true;
+        mandatory true;
+        mandatory false;
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/LeafSubStatementDefault.yang b/compiler/base/parser/src/test/resources/LeafSubStatementDefault.yang
new file mode 100644
index 0000000..a78131d
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LeafSubStatementDefault.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        units "seconds";
+        default "1";
+        description "Interval before a route is declared invalid";
+        config true;
+        mandatory true;
+        status current;
+        reference "RFC 6020";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/LeafSubStatementMust.yang b/compiler/base/parser/src/test/resources/LeafSubStatementMust.yang
new file mode 100644
index 0000000..6d7e626
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LeafSubStatementMust.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf ifType {
+        type enumeration {
+            enum ethernet;
+            enum atm;
+        }
+        must "ifType != 'ethernet'" {
+            description "ifType is not ethernet";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/LeafSubStatementWhen.yang b/compiler/base/parser/src/test/resources/LeafSubStatementWhen.yang
new file mode 100644
index 0000000..239e0b6
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LeafSubStatementWhen.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf ifType {
+        when "ifType != 'ethernet'" {
+            description "ifType is not ethernet";
+        }
+        type enumeration {
+            enum ethernet;
+            enum atm;
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/LeafSubStatements.yang b/compiler/base/parser/src/test/resources/LeafSubStatements.yang
new file mode 100644
index 0000000..70349a0
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LeafSubStatements.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config true;
+        mandatory true;
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/LeafWithoutLeftBrace.yang b/compiler/base/parser/src/test/resources/LeafWithoutLeftBrace.yang
new file mode 100644
index 0000000..c2aa979
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LeafWithoutLeftBrace.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval 
+    type "uint16";
+    units "seconds";
+    description "Interval before a route is declared invalid";
+    config true;
+    mandatory true;
+    status current;
+    reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/LengthStatementInsideLeafList.yang b/compiler/base/parser/src/test/resources/LengthStatementInsideLeafList.yang
new file mode 100644
index 0000000..06d08db
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LengthStatementInsideLeafList.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type string {
+            length "1..100";
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/LengthStatementInsideTypeDef.yang b/compiler/base/parser/src/test/resources/LengthStatementInsideTypeDef.yang
new file mode 100644
index 0000000..c1195dc
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LengthStatementInsideTypeDef.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    typedef invalid-interval {
+        type string {
+            length "1..100";
+         }
+    }
+    leaf xyz {
+       type invalid-interval {
+           length "2..100";
+       }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/LengthStatementWithSpace.yang b/compiler/base/parser/src/test/resources/LengthStatementWithSpace.yang
new file mode 100644
index 0000000..e8612d1
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LengthStatementWithSpace.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type string {
+            length "                                               0                                                                                      ..                                                                                                                                                                      100                                                                                         ";
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/LengthSubStatements.yang b/compiler/base/parser/src/test/resources/LengthSubStatements.yang
new file mode 100644
index 0000000..f61f979
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LengthSubStatements.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type string {
+            length "0..100" {
+                description "length description";
+                reference "length reference";
+            }
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/LengthWithInvalidIntegerPattern.yang b/compiler/base/parser/src/test/resources/LengthWithInvalidIntegerPattern.yang
new file mode 100644
index 0000000..f5c8a69
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LengthWithInvalidIntegerPattern.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type string {
+            length "a..z";
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/LengthWithInvalidInterval.yang b/compiler/base/parser/src/test/resources/LengthWithInvalidInterval.yang
new file mode 100644
index 0000000..7b4ae18
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LengthWithInvalidInterval.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type string {
+            length "0..18446744073709551617";
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/LengthWithInvalidType.yang b/compiler/base/parser/src/test/resources/LengthWithInvalidType.yang
new file mode 100644
index 0000000..74b183c
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LengthWithInvalidType.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type int8 {
+            length "1..100";
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/LengthWithMinMax.yang b/compiler/base/parser/src/test/resources/LengthWithMinMax.yang
new file mode 100644
index 0000000..5884266
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LengthWithMinMax.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type string {
+            length "min..max";
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/LengthWithOneInterval.yang b/compiler/base/parser/src/test/resources/LengthWithOneInterval.yang
new file mode 100644
index 0000000..b160f02
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/LengthWithOneInterval.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type string {
+            length "1";
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ListAsRootNode.yang b/compiler/base/parser/src/test/resources/ListAsRootNode.yang
new file mode 100644
index 0000000..289525f
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ListAsRootNode.yang
@@ -0,0 +1,9 @@
+list valid {
+    reference "RFC 6020";
+    leaf invalid-interval {
+        type "uint16";
+        units "seconds";
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ListDuplicateContainer.yang b/compiler/base/parser/src/test/resources/ListDuplicateContainer.yang
new file mode 100644
index 0000000..8c152b2
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ListDuplicateContainer.yang
@@ -0,0 +1,27 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list ospf {
+        key "process-id";
+        container interface {
+            leaf invalid-interval {
+                type "uint16";
+                units "seconds";
+                status current;
+                reference "RFC 6020";
+            }
+        }
+        leaf process-id {
+            type "string";
+        }
+        container interface {
+            leaf invalid-interval {
+                type "uint16";
+                units "seconds";
+                status current;
+                reference "RFC 6020";
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ListInvalidIdentifier.yang b/compiler/base/parser/src/test/resources/ListInvalidIdentifier.yang
new file mode 100644
index 0000000..c5f6a3a
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ListInvalidIdentifier.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list 1valid {
+        key "invalid-interval";
+        reference "RFC 6020";
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ListStatementWithoutChild.yang b/compiler/base/parser/src/test/resources/ListStatementWithoutChild.yang
new file mode 100644
index 0000000..5c006d7
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ListStatementWithoutChild.yang
@@ -0,0 +1,8 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ListSubStatementConfig.yang b/compiler/base/parser/src/test/resources/ListSubStatementConfig.yang
new file mode 100644
index 0000000..55432fb
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ListSubStatementConfig.yang
@@ -0,0 +1,17 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid-interval";
+        config true;
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            description "Interval before a route is declared invalid";
+            mandatory true;
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ListSubStatementContainer.yang b/compiler/base/parser/src/test/resources/ListSubStatementContainer.yang
new file mode 100644
index 0000000..4ce6da4
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ListSubStatementContainer.yang
@@ -0,0 +1,19 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list ospf {
+        key "process-id";
+        container interface {
+            leaf invalid-interval {
+                type "uint16";
+                units "seconds";
+                status current;
+                reference "RFC 6020";
+            }
+        }
+        leaf process-id {
+            type "string";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ListSubStatementDescription.yang b/compiler/base/parser/src/test/resources/ListSubStatementDescription.yang
new file mode 100644
index 0000000..a8df3d7
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ListSubStatementDescription.yang
@@ -0,0 +1,18 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+    key "invalid-interval";
+    description "list description";
+    config true;
+    leaf invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        mandatory true;
+        status current;
+        reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ListSubStatementKey.yang b/compiler/base/parser/src/test/resources/ListSubStatementKey.yang
new file mode 100644
index 0000000..791013d
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ListSubStatementKey.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid-interval";
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ListSubStatementLeaf.yang b/compiler/base/parser/src/test/resources/ListSubStatementLeaf.yang
new file mode 100644
index 0000000..59b92cc
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ListSubStatementLeaf.yang
@@ -0,0 +1,17 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid-interval";
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            description "Interval before a route is declared invalid";
+            config true;
+            mandatory true;
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ListSubStatementLeafList.yang b/compiler/base/parser/src/test/resources/ListSubStatementLeafList.yang
new file mode 100644
index 0000000..672ebdd
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ListSubStatementLeafList.yang
@@ -0,0 +1,20 @@
+
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid";
+        leaf-list invalid-interval {
+            type "uint16";
+            units "seconds";
+            description "Interval before a route is declared invalid";
+            config true;
+            status current;
+            reference "RFC 6020";
+        }
+        leaf invalid {
+            type "uint16";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ListSubStatementList.yang b/compiler/base/parser/src/test/resources/ListSubStatementList.yang
new file mode 100644
index 0000000..2021469
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ListSubStatementList.yang
@@ -0,0 +1,20 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list ospf {
+        key "process-id";
+        list valid {
+            key "invalid-interval";
+            leaf invalid-interval {
+                type "uint16";
+                units "seconds";
+                status current;
+                reference "RFC 6020";
+            }
+        }
+        leaf process-id {
+            type "string";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ListSubStatementMaxElements.yang b/compiler/base/parser/src/test/resources/ListSubStatementMaxElements.yang
new file mode 100644
index 0000000..e74a5a8
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ListSubStatementMaxElements.yang
@@ -0,0 +1,17 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid";
+        max-elements 3;
+        leaf-list invalid-interval {
+            type "uint16";
+            units "seconds";
+            description "Interval before a route is declared invalid";
+        }
+        leaf invalid {
+            type "uint16";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ListSubStatementMinElements.yang b/compiler/base/parser/src/test/resources/ListSubStatementMinElements.yang
new file mode 100644
index 0000000..8454fdd
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ListSubStatementMinElements.yang
@@ -0,0 +1,17 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid";
+        min-elements 3;
+        leaf-list invalid-interval {
+            type "uint16";
+            units "seconds";
+            description "Interval before a route is declared invalid";
+        }
+        leaf invalid {
+            type "uint16";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ListSubStatementReference.yang b/compiler/base/parser/src/test/resources/ListSubStatementReference.yang
new file mode 100644
index 0000000..8adfa04
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ListSubStatementReference.yang
@@ -0,0 +1,18 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid-interval";
+        reference "list reference";
+        config true;
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            description "Interval before a route is declared invalid";
+            mandatory true;
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ListSubStatementStatus.yang b/compiler/base/parser/src/test/resources/ListSubStatementStatus.yang
new file mode 100644
index 0000000..b88ac74
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ListSubStatementStatus.yang
@@ -0,0 +1,18 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid-interval";
+        status current;
+        config true;
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            description "Interval before a route is declared invalid";
+            mandatory true;
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ListSubStatementUnique.yang b/compiler/base/parser/src/test/resources/ListSubStatementUnique.yang
new file mode 100644
index 0000000..b500aa4
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ListSubStatementUnique.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        unique "invalid-interval";
+        key "invalid-interval";
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ListSubStatements.yang b/compiler/base/parser/src/test/resources/ListSubStatements.yang
new file mode 100644
index 0000000..109fc17
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ListSubStatements.yang
@@ -0,0 +1,20 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list ospf {
+        key "invalid-interval";
+        config true;
+        max-elements 10;
+        min-elements 3;
+        description "list description";
+        status current;
+        reference "list reference";
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ListSubStatementsCardinality.yang b/compiler/base/parser/src/test/resources/ListSubStatementsCardinality.yang
new file mode 100644
index 0000000..9c4077c
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ListSubStatementsCardinality.yang
@@ -0,0 +1,16 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid-interval";
+        reference "RFC 6020";
+        reference "RFC 6020";
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ListWithDuplicateLeaf.yang b/compiler/base/parser/src/test/resources/ListWithDuplicateLeaf.yang
new file mode 100644
index 0000000..55a78f6
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ListWithDuplicateLeaf.yang
@@ -0,0 +1,26 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid-interval";
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            description "Interval before a route is declared invalid";
+            config true;
+            mandatory true;
+            status current;
+            reference "RFC 6020";
+        }
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            description "Interval before a route is declared invalid";
+            config true;
+            mandatory true;
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ListWithIdentifierNameEnum.yang b/compiler/base/parser/src/test/resources/ListWithIdentifierNameEnum.yang
new file mode 100644
index 0000000..afa82a4
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ListWithIdentifierNameEnum.yang
@@ -0,0 +1,16 @@
+module Test {
+    yang-version 1;
+    namespace "ydt.enum";
+    prefix "t";
+
+    list enumList {
+        key enum;
+        leaf enum {
+            type enumeration {
+                enum ten { value "10";}
+                enum hundred { value "100";}
+                enum thousand { value "1000"; }
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/MandatoryDefaultValue.yang b/compiler/base/parser/src/test/resources/MandatoryDefaultValue.yang
new file mode 100644
index 0000000..c71d5ea
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/MandatoryDefaultValue.yang
@@ -0,0 +1,8 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/MandatoryEmptyStatement.yang b/compiler/base/parser/src/test/resources/MandatoryEmptyStatement.yang
new file mode 100644
index 0000000..e2af869
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/MandatoryEmptyStatement.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        mandatory ;
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/MandatoryFalse.yang b/compiler/base/parser/src/test/resources/MandatoryFalse.yang
new file mode 100644
index 0000000..3ae4601
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/MandatoryFalse.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        mandatory false;
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/MandatoryTrue.yang b/compiler/base/parser/src/test/resources/MandatoryTrue.yang
new file mode 100644
index 0000000..70349a0
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/MandatoryTrue.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config true;
+        mandatory true;
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/MandatoryWithoutStatementEnd.yang b/compiler/base/parser/src/test/resources/MandatoryWithoutStatementEnd.yang
new file mode 100644
index 0000000..055f556
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/MandatoryWithoutStatementEnd.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+    type "uint16";
+    mandatory false
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/MaxElementsCardinality.yang b/compiler/base/parser/src/test/resources/MaxElementsCardinality.yang
new file mode 100644
index 0000000..bff2fd7
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/MaxElementsCardinality.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type "uint16";
+        units "seconds";
+        max-elements 4;
+        max-elements 6;
+        description "Interval before a route is declared invalid";
+        config true;
+        status current;
+        reference "RFC 6020";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/MaxElementsDefaultValue.yang b/compiler/base/parser/src/test/resources/MaxElementsDefaultValue.yang
new file mode 100644
index 0000000..a591146
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/MaxElementsDefaultValue.yang
@@ -0,0 +1,8 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+       type "uint16";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/MaxElementsMaxValue.yang b/compiler/base/parser/src/test/resources/MaxElementsMaxValue.yang
new file mode 100644
index 0000000..7bdfbb0
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/MaxElementsMaxValue.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type "uint16";
+        max-elements 77777777777777777777777;
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/MaxElementsUnbounded.yang b/compiler/base/parser/src/test/resources/MaxElementsUnbounded.yang
new file mode 100644
index 0000000..afaca4f
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/MaxElementsUnbounded.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+       type "uint16";
+       max-elements unbounded;
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/MaxElementsWithoutStatementEnd.yang b/compiler/base/parser/src/test/resources/MaxElementsWithoutStatementEnd.yang
new file mode 100644
index 0000000..5973dd0
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/MaxElementsWithoutStatementEnd.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+    type "uint16";
+    units "seconds";
+    max-elements 3
+    description "Interval before a route is declared invalid";
+    config true;
+    status current;
+    reference "RFC 6020";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/MinElementsDefaultValue.yang b/compiler/base/parser/src/test/resources/MinElementsDefaultValue.yang
new file mode 100644
index 0000000..a591146
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/MinElementsDefaultValue.yang
@@ -0,0 +1,8 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+       type "uint16";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/MinElementsInvalidCardinality.yang b/compiler/base/parser/src/test/resources/MinElementsInvalidCardinality.yang
new file mode 100644
index 0000000..18f6019
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/MinElementsInvalidCardinality.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type "uint16";
+        units "seconds";
+        min-elements 4;
+        min-elements 6;
+        description "Interval before a route is declared invalid";
+        config true;
+        status current;
+        reference "RFC 6020";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/MinElementsInvalidValue.yang b/compiler/base/parser/src/test/resources/MinElementsInvalidValue.yang
new file mode 100644
index 0000000..a381184
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/MinElementsInvalidValue.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type "uint16";
+        units "seconds";
+        min-elements asd;
+        description "Interval before a route is declared invalid";
+        config true;
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/MinElementsMaxValue.yang b/compiler/base/parser/src/test/resources/MinElementsMaxValue.yang
new file mode 100644
index 0000000..785482b
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/MinElementsMaxValue.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type "uint16";
+        min-elements 77777777777777777777777;
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/MinElementsWithoutStatementEnd.yang b/compiler/base/parser/src/test/resources/MinElementsWithoutStatementEnd.yang
new file mode 100644
index 0000000..699a8b8
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/MinElementsWithoutStatementEnd.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+    type "uint16";
+    units "seconds";
+    min-elements 3
+    description "Interval before a route is declared invalid";
+    config true;
+    status current;
+    reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ModuleDuplicateContainer.yang b/compiler/base/parser/src/test/resources/ModuleDuplicateContainer.yang
new file mode 100644
index 0000000..bc58896
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ModuleDuplicateContainer.yang
@@ -0,0 +1,29 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container valid {
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+    container invalid {
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+    container valid {
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ModuleInvalidIdentifierLength.yang b/compiler/base/parser/src/test/resources/ModuleInvalidIdentifierLength.yang
new file mode 100644
index 0000000..fac16bc
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ModuleInvalidIdentifierLength.yang
@@ -0,0 +1,5 @@
+module Testttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+}
diff --git a/compiler/base/parser/src/test/resources/ModuleSubStatementContainer.yang b/compiler/base/parser/src/test/resources/ModuleSubStatementContainer.yang
new file mode 100644
index 0000000..35a91ad
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ModuleSubStatementContainer.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container valid {
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ModuleSubStatementDescription.yang b/compiler/base/parser/src/test/resources/ModuleSubStatementDescription.yang
new file mode 100644
index 0000000..02643b1
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ModuleSubStatementDescription.yang
@@ -0,0 +1,6 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    description "Interval before a route is declared invalid";
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ModuleSubStatementList.yang b/compiler/base/parser/src/test/resources/ModuleSubStatementList.yang
new file mode 100644
index 0000000..1bb3bf5
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ModuleSubStatementList.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid-interval";
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ModuleSubStatementReference.yang b/compiler/base/parser/src/test/resources/ModuleSubStatementReference.yang
new file mode 100644
index 0000000..20b2fb6
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ModuleSubStatementReference.yang
@@ -0,0 +1,6 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    reference "RFC 6020";
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ModuleValidEntry.yang b/compiler/base/parser/src/test/resources/ModuleValidEntry.yang
new file mode 100644
index 0000000..439ded8
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ModuleValidEntry.yang
@@ -0,0 +1,5 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+}
diff --git a/compiler/base/parser/src/test/resources/ModuleWithDuplicateLeaf.yang b/compiler/base/parser/src/test/resources/ModuleWithDuplicateLeaf.yang
new file mode 100644
index 0000000..2c3ecbc
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ModuleWithDuplicateLeaf.yang
@@ -0,0 +1,32 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config true;
+        mandatory true;
+        status current;
+        reference "RFC 6020";
+    }
+    leaf valid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config true;
+        mandatory true;
+        status current;
+        reference "RFC 6020";
+    }
+    leaf invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config true;
+        mandatory true;
+        status current;
+        reference "RFC 6020";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ModuleWithInvalidIdentifier.yang b/compiler/base/parser/src/test/resources/ModuleWithInvalidIdentifier.yang
new file mode 100644
index 0000000..d89340a
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ModuleWithInvalidIdentifier.yang
@@ -0,0 +1,5 @@
+module Test:Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+}
diff --git a/compiler/base/parser/src/test/resources/MultipleKeyValues.yang b/compiler/base/parser/src/test/resources/MultipleKeyValues.yang
new file mode 100644
index 0000000..a9d25a2
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/MultipleKeyValues.yang
@@ -0,0 +1,20 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "ospf isis";
+        leaf ospf {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+        leaf isis {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/MultiplePatternStatement.yang b/compiler/base/parser/src/test/resources/MultiplePatternStatement.yang
new file mode 100644
index 0000000..7a47bfc
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/MultiplePatternStatement.yang
@@ -0,0 +1,11 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type string {
+            pattern "[a-zA-Z]";
+            pattern "[a-z]";
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/MultipleRevision.yang b/compiler/base/parser/src/test/resources/MultipleRevision.yang
new file mode 100755
index 0000000..4ce440c
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/MultipleRevision.yang
@@ -0,0 +1,26 @@
+module Test {
+    yang-version 1;
+    namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+    prefix test;
+
+     revision 2013-07-15 {
+       description
+        "This revision adds the following new data types:
+         - yang-identifier
+         - hex-string
+         - uuid
+         - dotted-quad";
+       reference
+        "RFC 6991: Common YANG Data Types";
+     }
+     revision 2013-07-14 {
+       description
+        "This revision adds the following new data types:
+         - yang-identifier
+         - hex-string
+         - uuid
+         - dotted-quad";
+       reference
+        "RFC 6991: Common YANG Data Types";
+     }
+}
diff --git a/compiler/base/parser/src/test/resources/MultipleUniqueValues.yang b/compiler/base/parser/src/test/resources/MultipleUniqueValues.yang
new file mode 100644
index 0000000..28f7978
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/MultipleUniqueValues.yang
@@ -0,0 +1,21 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "ospf";
+        unique "ospf isis";
+        leaf ospf {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+        leaf isis {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/NamespaceDualEntry.yang b/compiler/base/parser/src/test/resources/NamespaceDualEntry.yang
new file mode 100644
index 0000000..09c9b54
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/NamespaceDualEntry.yang
@@ -0,0 +1,6 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+namespace urn:ietf:params:xml:ns:yang:ietf-segment-routing;
+prefix On;
+}
diff --git a/compiler/base/parser/src/test/resources/NamespaceInDoubleQuotes.yang b/compiler/base/parser/src/test/resources/NamespaceInDoubleQuotes.yang
new file mode 100644
index 0000000..aec0042
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/NamespaceInDoubleQuotes.yang
@@ -0,0 +1,5 @@
+module Test {
+yang-version 1;
+namespace "urn:ietf:params:xml:ns:yang:ietf-ospf";
+prefix On;
+}
diff --git a/compiler/base/parser/src/test/resources/NamespaceNoEntryTest.yang b/compiler/base/parser/src/test/resources/NamespaceNoEntryTest.yang
new file mode 100644
index 0000000..ac30ae4
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/NamespaceNoEntryTest.yang
@@ -0,0 +1,4 @@
+module Test {
+yang-version 1;
+prefix On;
+}
diff --git a/compiler/base/parser/src/test/resources/NamespaceWithConcatenationTest.yang b/compiler/base/parser/src/test/resources/NamespaceWithConcatenationTest.yang
new file mode 100644
index 0000000..c9ac4b0
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/NamespaceWithConcatenationTest.yang
@@ -0,0 +1,6 @@
+module Test {
+yang-version 1;
+namespace "urn:ietf:params:xml:ns:"
+             + "yang:ietf-segment-routing";
+prefix On;
+}
diff --git a/compiler/base/parser/src/test/resources/NamespaceWithInvalidSpaces.yang b/compiler/base/parser/src/test/resources/NamespaceWithInvalidSpaces.yang
new file mode 100644
index 0000000..f8f91c5
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/NamespaceWithInvalidSpaces.yang
@@ -0,0 +1,5 @@
+module Test {
+yang-version 1;
+namespace "urn:ietf:params:xml :ns:yang:ietf-ospf";
+prefix On;
+}
diff --git a/compiler/base/parser/src/test/resources/NamespaceWithoutQuotes.yang b/compiler/base/parser/src/test/resources/NamespaceWithoutQuotes.yang
new file mode 100644
index 0000000..439ded8
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/NamespaceWithoutQuotes.yang
@@ -0,0 +1,5 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+}
diff --git a/compiler/base/parser/src/test/resources/NoConfigContainerSubStatementContainer.yang b/compiler/base/parser/src/test/resources/NoConfigContainerSubStatementContainer.yang
new file mode 100644
index 0000000..1aded2d
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/NoConfigContainerSubStatementContainer.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container hello {
+        container valid {
+            leaf invalid-interval {
+                type "uint16";
+                units "seconds";
+                status current;
+                reference "RFC 6020";
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/NoConfigContainerSubStatementLeaf.yang b/compiler/base/parser/src/test/resources/NoConfigContainerSubStatementLeaf.yang
new file mode 100644
index 0000000..35a91ad
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/NoConfigContainerSubStatementLeaf.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container valid {
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/NoConfigContainerSubStatementLeafList.yang b/compiler/base/parser/src/test/resources/NoConfigContainerSubStatementLeafList.yang
new file mode 100644
index 0000000..79687c2
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/NoConfigContainerSubStatementLeafList.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container valid {
+        leaf-list invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/NoConfigContainerSubStatementList.yang b/compiler/base/parser/src/test/resources/NoConfigContainerSubStatementList.yang
new file mode 100644
index 0000000..f10c686
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/NoConfigContainerSubStatementList.yang
@@ -0,0 +1,16 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container hello {
+        list valid {
+            key "invalid-interval";
+            leaf invalid-interval {
+                type "uint16";
+                units "seconds";
+                status current;
+                reference "RFC 6020";
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/NoConfigListSubStatementContainer.yang b/compiler/base/parser/src/test/resources/NoConfigListSubStatementContainer.yang
new file mode 100644
index 0000000..19b4291
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/NoConfigListSubStatementContainer.yang
@@ -0,0 +1,22 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list list1 {
+        key "invalid-interval";
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+        container container1 {
+            leaf leaf1 {
+                type "uint16";
+                units "seconds";
+                status current;
+                reference "RFC 6020";
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/NoConfigListSubStatementLeaf.yang b/compiler/base/parser/src/test/resources/NoConfigListSubStatementLeaf.yang
new file mode 100644
index 0000000..1bb3bf5
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/NoConfigListSubStatementLeaf.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid-interval";
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/NoConfigListSubStatementList.yang b/compiler/base/parser/src/test/resources/NoConfigListSubStatementList.yang
new file mode 100644
index 0000000..4de40cb
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/NoConfigListSubStatementList.yang
@@ -0,0 +1,23 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid-interval";
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+        list list1 {
+            key "leaf1";
+            leaf leaf1 {
+                type "uint16";
+                units "seconds";
+                status current;
+                reference "RFC 6020";
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/OrderedByStatement.yang b/compiler/base/parser/src/test/resources/OrderedByStatement.yang
new file mode 100644
index 0000000..f6b4336
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/OrderedByStatement.yang
@@ -0,0 +1,10 @@
+module rock {
+    namespace "http://example.net/rock";
+    prefix "rock";
+    leaf-list cipher  {
+         type string;
+         ordered-by user;
+         description "A list of ciphers";
+    }
+}
+
diff --git a/compiler/base/parser/src/test/resources/OrganizationDualEntry.yang b/compiler/base/parser/src/test/resources/OrganizationDualEntry.yang
new file mode 100644
index 0000000..64bf23d
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/OrganizationDualEntry.yang
@@ -0,0 +1,18 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include itut {
+revision-date 2016-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+organization "IETF SPRING Working Group";
+organization "ITUT SPRING Working Group";
+}
diff --git a/compiler/base/parser/src/test/resources/OrganizationInvalidOrder.yang b/compiler/base/parser/src/test/resources/OrganizationInvalidOrder.yang
new file mode 100644
index 0000000..333f2e5
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/OrganizationInvalidOrder.yang
@@ -0,0 +1,17 @@
+module Test {
+yang-version 1;
+organization "ONOS";
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include itut; {
+revision-date 2016-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+}
diff --git a/compiler/base/parser/src/test/resources/OrganizationMissingValue.yang b/compiler/base/parser/src/test/resources/OrganizationMissingValue.yang
new file mode 100644
index 0000000..e9e3f46
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/OrganizationMissingValue.yang
@@ -0,0 +1,17 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include itut {
+revision-date 2016-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+organization ;
+}
diff --git a/compiler/base/parser/src/test/resources/OrganizationValidEntry.yang b/compiler/base/parser/src/test/resources/OrganizationValidEntry.yang
new file mode 100644
index 0000000..25ae1ec
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/OrganizationValidEntry.yang
@@ -0,0 +1,17 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include itut {
+revision-date 2016-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+organization "IETF SPRING Working Group";
+}
diff --git a/compiler/base/parser/src/test/resources/OutputStatementWithDataDefinition.yang b/compiler/base/parser/src/test/resources/OutputStatementWithDataDefinition.yang
new file mode 100644
index 0000000..527b399
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/OutputStatementWithDataDefinition.yang
@@ -0,0 +1,28 @@
+module rock {
+    namespace "http://example.net/rock";
+    prefix "rock";
+
+    rpc activate-software-image {
+        description "description";
+        output {
+            leaf image-name {
+                type string;
+            }
+            list ospf {
+                key "invalid-interval";
+                config true;
+                max-elements 10;
+                min-elements 3;
+                leaf invalid-interval {
+                    type uint16;
+                }
+            }
+            container isis {
+               config true;
+               leaf invalid-interval {
+                   type uint16;
+               }
+           }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/OutputStatementWithTypedef.yang b/compiler/base/parser/src/test/resources/OutputStatementWithTypedef.yang
new file mode 100644
index 0000000..6027c2d
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/OutputStatementWithTypedef.yang
@@ -0,0 +1,17 @@
+module rock {
+    namespace "http://example.net/rock";
+    prefix "rock";
+
+    rpc activate-software-image {
+        description "description";
+        output {
+            leaf image-name {
+                type string;
+            }
+            typedef my-type {
+                status deprecated;
+                type int32;
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/PatternStatementInsideLeafList.yang b/compiler/base/parser/src/test/resources/PatternStatementInsideLeafList.yang
new file mode 100644
index 0000000..d21c0f6
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/PatternStatementInsideLeafList.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type string {
+            pattern "[a-zA-Z]";
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/PatternStatementInsideTypeDef.yang b/compiler/base/parser/src/test/resources/PatternStatementInsideTypeDef.yang
new file mode 100644
index 0000000..edb625e
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/PatternStatementInsideTypeDef.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    typedef invalid-interval {
+        type string {
+            pattern "[a-zA-Z]";
+         }
+    }
+    leaf xyz {
+       type invalid-interval {
+           pattern "[a-z]";
+       }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/PatternStatementWithPlus.yang b/compiler/base/parser/src/test/resources/PatternStatementWithPlus.yang
new file mode 100644
index 0000000..417e1d1
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/PatternStatementWithPlus.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type string {
+            pattern "-[0-9]+|[0-9]+";
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/PatternSubStatements.yang b/compiler/base/parser/src/test/resources/PatternSubStatements.yang
new file mode 100644
index 0000000..3e792c6
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/PatternSubStatements.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type string {
+            pattern "[a-zA-Z]" {
+                description "pattern description";
+                reference "pattern reference";
+            }
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/PositionDuplication.yang b/compiler/base/parser/src/test/resources/PositionDuplication.yang
new file mode 100644
index 0000000..81eeb16
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/PositionDuplication.yang
@@ -0,0 +1,18 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+     leaf mybits {
+         type bits {
+             bit disable-nagle {
+                 position 0;
+             }
+             bit auto-sense-speed {
+                 position 1;
+             }
+             bit Ten-Mb-only {
+                 position 1;
+             }
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/PositionImplicitAndExplicit.yang b/compiler/base/parser/src/test/resources/PositionImplicitAndExplicit.yang
new file mode 100644
index 0000000..bef9712
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/PositionImplicitAndExplicit.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf mybits {
+        type bits {
+            bit disable-nagle;
+            bit auto-sense-speed {
+                position 1;
+            }
+            bit Ten-Mb-only;
+        }
+    }
+}
+
diff --git a/compiler/base/parser/src/test/resources/PositionImplicitAndExplicitDuplication.yang b/compiler/base/parser/src/test/resources/PositionImplicitAndExplicitDuplication.yang
new file mode 100644
index 0000000..30b81ab
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/PositionImplicitAndExplicitDuplication.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+     leaf mybits {
+         type bits {
+             bit disable-nagle;
+             bit auto-sense-speed {
+                 position 0;
+             }
+             bit Ten-Mb-only;
+             }
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/PositionNegativeValue.yang b/compiler/base/parser/src/test/resources/PositionNegativeValue.yang
new file mode 100644
index 0000000..60330e0
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/PositionNegativeValue.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+     leaf mybits {
+         type bits {
+             bit disable-nagle;
+             bit auto-sense-speed {
+                 position -2;
+             }
+             bit Ten-Mb-only;
+             }
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/PositionStatement.yang b/compiler/base/parser/src/test/resources/PositionStatement.yang
new file mode 100644
index 0000000..afa0a4c
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/PositionStatement.yang
@@ -0,0 +1,18 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf mybits {
+        type bits {
+            bit disable-nagle {
+                position 0;
+            }
+            bit auto-sense-speed {
+                position 1;
+            }
+            bit Ten-Mb-only {
+                position 2;
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/PositionWithDoubleQuotes.yang b/compiler/base/parser/src/test/resources/PositionWithDoubleQuotes.yang
new file mode 100644
index 0000000..0c9d358
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/PositionWithDoubleQuotes.yang
@@ -0,0 +1,18 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+     leaf mybits {
+         type bits {
+             bit disable-nagle {
+                 position "0";
+             }
+             bit auto-sense-speed {
+                 position "1";
+             }
+             bit Ten-Mb-only {
+                 position "2";
+             }
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/PrefixDualEntry.yang b/compiler/base/parser/src/test/resources/PrefixDualEntry.yang
new file mode 100644
index 0000000..e999774
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/PrefixDualEntry.yang
@@ -0,0 +1,18 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+import ietf {
+prefix On2;
+prefix On3;
+revision-date 2015-02-03;
+}
+include itut {
+revision-date 2016-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+organization "ONOS";
+}
diff --git a/compiler/base/parser/src/test/resources/PrefixInvalidValue.yang b/compiler/base/parser/src/test/resources/PrefixInvalidValue.yang
new file mode 100644
index 0000000..40f7617
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/PrefixInvalidValue.yang
@@ -0,0 +1,17 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix -On;
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include itut {
+revision-date 2016-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+organization "ONOS";
+}
diff --git a/compiler/base/parser/src/test/resources/PrefixMissingValue.yang b/compiler/base/parser/src/test/resources/PrefixMissingValue.yang
new file mode 100644
index 0000000..4d92ee1
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/PrefixMissingValue.yang
@@ -0,0 +1,17 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix ;
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include itut {
+revision-date 2016-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+organization "ONOS";
+}
diff --git a/compiler/base/parser/src/test/resources/PrefixOrder.yang b/compiler/base/parser/src/test/resources/PrefixOrder.yang
new file mode 100644
index 0000000..d14e8b1
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/PrefixOrder.yang
@@ -0,0 +1,17 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+prefix test;
+include itut {
+revision-date 2016-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+organization "ONOS";
+}
diff --git a/compiler/base/parser/src/test/resources/PrefixValidEntry.yang b/compiler/base/parser/src/test/resources/PrefixValidEntry.yang
new file mode 100644
index 0000000..826dee4
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/PrefixValidEntry.yang
@@ -0,0 +1,17 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include itut {
+revision-date 2016-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+organization "ONOS";
+}
diff --git a/compiler/base/parser/src/test/resources/PrefixWithDoubleQuotes.yang b/compiler/base/parser/src/test/resources/PrefixWithDoubleQuotes.yang
new file mode 100644
index 0000000..e9590f1
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/PrefixWithDoubleQuotes.yang
@@ -0,0 +1,17 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix "On";
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include itut {
+revision-date 2016-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+organization "ONOS";
+}
diff --git a/compiler/base/parser/src/test/resources/PresenceDefaultValue.yang b/compiler/base/parser/src/test/resources/PresenceDefaultValue.yang
new file mode 100644
index 0000000..6418e20
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/PresenceDefaultValue.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container valid {
+        leaf ospf {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/PresenceWithoutStatementEnd.yang b/compiler/base/parser/src/test/resources/PresenceWithoutStatementEnd.yang
new file mode 100644
index 0000000..1427c5f
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/PresenceWithoutStatementEnd.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container valid {
+        presence "invalid"
+        leaf invalid-interval {
+            type "uint16";
+            units "seconds";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ProcessFileWithExtraBrace.yang b/compiler/base/parser/src/test/resources/ProcessFileWithExtraBrace.yang
new file mode 100644
index 0000000..ca3f0d0
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ProcessFileWithExtraBrace.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+        container food {
+            choice snack {
+                list sports-arena {
+                }
+            }
+        }
+    }
+}
+}
+}
+}
diff --git a/compiler/base/parser/src/test/resources/ProcessFileWithExtraBraceInBetween.yang b/compiler/base/parser/src/test/resources/ProcessFileWithExtraBraceInBetween.yang
new file mode 100644
index 0000000..580d270
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ProcessFileWithExtraBraceInBetween.yang
@@ -0,0 +1,35 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    import ietf-yang-types {
+        prefix "P";
+    }
+    grouping Percentage {
+        leaf hello{
+            type string;
+        }
+        leaf invalid1{
+            type string;
+        }
+        }
+        leaf invalid2{
+            type string;
+        }
+    }
+    container ospf {
+        list valid {
+            key "invalid";
+            leaf invalid{
+                type string;
+            }
+            uses Ant:FirstClass;
+            grouping FirstClass {
+                uses P:PassingClass;
+            }
+        }
+        grouping PassingClass {
+            uses Ant:Percentage;
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ProcessFileWithExtraLeaf.yang b/compiler/base/parser/src/test/resources/ProcessFileWithExtraLeaf.yang
new file mode 100644
index 0000000..5624b7a
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ProcessFileWithExtraLeaf.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container food {
+        choice snack {
+            list sports-arena {
+            }
+        }
+    }
+}
+leaf invalid {
+
diff --git a/compiler/base/parser/src/test/resources/RangeStatementInsideLeafList.yang b/compiler/base/parser/src/test/resources/RangeStatementInsideLeafList.yang
new file mode 100644
index 0000000..9f5808d
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RangeStatementInsideLeafList.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type int32 {
+            range "1..4 | 10..20";
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/RangeStatementWithSpace.yang b/compiler/base/parser/src/test/resources/RangeStatementWithSpace.yang
new file mode 100644
index 0000000..a41d68a
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RangeStatementWithSpace.yang
@@ -0,0 +1,11 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type int32 {
+            range "                          1                        ..                                        4 |                        10               ..                                          20                  ";
+         }
+    }
+}
+
diff --git a/compiler/base/parser/src/test/resources/RangeSubStatements.yang b/compiler/base/parser/src/test/resources/RangeSubStatements.yang
new file mode 100644
index 0000000..4b57bd0
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RangeSubStatements.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type int32 {
+            range "1..4 | 10..20" {
+                description "range description";
+                reference "range reference";
+            }
+         }
+    }
+}
+
diff --git a/compiler/base/parser/src/test/resources/RangeWithInvalidIntegerPattern.yang b/compiler/base/parser/src/test/resources/RangeWithInvalidIntegerPattern.yang
new file mode 100644
index 0000000..60c7992
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RangeWithInvalidIntegerPattern.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type int32 {
+            range "a..z";
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/RangeWithMinMax.yang b/compiler/base/parser/src/test/resources/RangeWithMinMax.yang
new file mode 100644
index 0000000..373d45e
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RangeWithMinMax.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type int32 {
+            range "min..max";
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/RangeWithOneInterval.yang b/compiler/base/parser/src/test/resources/RangeWithOneInterval.yang
new file mode 100644
index 0000000..85d0288
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RangeWithOneInterval.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type int32 {
+            range "1";
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ReferenceEmptyStatement.yang b/compiler/base/parser/src/test/resources/ReferenceEmptyStatement.yang
new file mode 100644
index 0000000..ff3525a
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ReferenceEmptyStatement.yang
@@ -0,0 +1,6 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    reference "";
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ReferenceStatement.yang b/compiler/base/parser/src/test/resources/ReferenceStatement.yang
new file mode 100644
index 0000000..70349a0
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ReferenceStatement.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config true;
+        mandatory true;
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/ReferenceWithoutStatementEnd.yang b/compiler/base/parser/src/test/resources/ReferenceWithoutStatementEnd.yang
new file mode 100644
index 0000000..f2fcf43
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ReferenceWithoutStatementEnd.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        reference "RFC 6020"
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/RequireInstanceDefaultValueForLeafref.yang b/compiler/base/parser/src/test/resources/RequireInstanceDefaultValueForLeafref.yang
new file mode 100644
index 0000000..c4dae28
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RequireInstanceDefaultValueForLeafref.yang
@@ -0,0 +1,31 @@
+module PathListener {
+    namespace "test";
+    prefix test;
+     list interface {
+         key "name";
+         leaf name {
+             type string;
+         }
+         leaf admin-status {
+             type string;
+         }
+         list address {
+             key "ip";
+             leaf ip {
+                 type string;
+             }
+         }
+     }
+     container default-address {
+         leaf ifname {
+             type leafref {
+                 path "../../test:interface/test:name";
+             }
+         }
+         leaf status {
+             type leafref {
+                 path "/test:interface[name = current()/../ifname]/test:admin-status";
+             }
+         }
+     }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/RequireInstanceDefaultValueInInstanceIdentifier.yang b/compiler/base/parser/src/test/resources/RequireInstanceDefaultValueInInstanceIdentifier.yang
new file mode 100644
index 0000000..e3e15bf
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RequireInstanceDefaultValueInInstanceIdentifier.yang
@@ -0,0 +1,7 @@
+module PathListener {
+    namespace "test";
+    prefix test;
+    leaf admin-status {
+        type instance-identifier;
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/RequireInstanceFalse.yang b/compiler/base/parser/src/test/resources/RequireInstanceFalse.yang
new file mode 100644
index 0000000..0a2ba4f
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RequireInstanceFalse.yang
@@ -0,0 +1,9 @@
+module PathListener {
+    namespace "test";
+    prefix test;
+    leaf admin-status {
+        type instance-identifier {
+            require-instance "false";
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/RequireInstanceTrue.yang b/compiler/base/parser/src/test/resources/RequireInstanceTrue.yang
new file mode 100644
index 0000000..cace8c5
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RequireInstanceTrue.yang
@@ -0,0 +1,32 @@
+module PathListener {
+    namespace "test";
+    prefix test;
+     list interface {
+         key "name";
+         leaf name {
+             type string;
+         }
+         leaf admin-status {
+             type string;
+         }
+         list address {
+             key "ip";
+             leaf ip {
+                 type string;
+             }
+         }
+     }
+     container default-address {
+         leaf ifname {
+             type leafref {
+                 path "../../test:interface/test:name";
+                 require-instance true;
+             }
+         }
+         leaf status {
+             type leafref {
+                 path "/test:interface[name = current()/../ifname]/test:admin-status";
+             }
+         }
+     }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/RevisionAbsence.yang b/compiler/base/parser/src/test/resources/RevisionAbsence.yang
new file mode 100644
index 0000000..eb1d1d9
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RevisionAbsence.yang
@@ -0,0 +1,5 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix test;
+}
diff --git a/compiler/base/parser/src/test/resources/RevisionDateInQuotesAtImport.yang b/compiler/base/parser/src/test/resources/RevisionDateInQuotesAtImport.yang
new file mode 100644
index 0000000..5f8bcb8
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RevisionDateInQuotesAtImport.yang
@@ -0,0 +1,17 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix test;
+import ietf {
+prefix On2;
+revision-date "2015-02-03";
+}
+include itut {
+revision-date 2016-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+organization "ONOS";
+}
diff --git a/compiler/base/parser/src/test/resources/RevisionDateInQuotesAtInclude.yang b/compiler/base/parser/src/test/resources/RevisionDateInQuotesAtInclude.yang
new file mode 100644
index 0000000..de405a3
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RevisionDateInQuotesAtInclude.yang
@@ -0,0 +1,17 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix test;
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include itut {
+revision-date "2016-02-03";
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+organization "ONOS";
+}
diff --git a/compiler/base/parser/src/test/resources/RevisionDateInvalid.yang b/compiler/base/parser/src/test/resources/RevisionDateInvalid.yang
new file mode 100644
index 0000000..c219d11
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RevisionDateInvalid.yang
@@ -0,0 +1,17 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix test;
+import ietf {
+prefix On2;
+revision-date 2015-02-30;
+}
+include itut {
+revision-date 2016-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+organization "ONOS";
+}
diff --git a/compiler/base/parser/src/test/resources/RevisionDateInvalidFormat.yang b/compiler/base/parser/src/test/resources/RevisionDateInvalidFormat.yang
new file mode 100644
index 0000000..8a6c717
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RevisionDateInvalidFormat.yang
@@ -0,0 +1,17 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix test;
+import ietf {
+prefix On2;
+revision-date 15-02-03;
+}
+include itut {
+revision-date 2016-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+organization "ONOS";
+}
diff --git a/compiler/base/parser/src/test/resources/RevisionDateInvalidSyntaxAtImport.yang b/compiler/base/parser/src/test/resources/RevisionDateInvalidSyntaxAtImport.yang
new file mode 100644
index 0000000..df726bf
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RevisionDateInvalidSyntaxAtImport.yang
@@ -0,0 +1,17 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix test;
+import ietf {
+prefix On2;
+revision-date 2015/02/03;
+}
+include itut {
+revision-date 2016-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+organization "ONOS";
+}
diff --git a/compiler/base/parser/src/test/resources/RevisionDateInvalidSyntaxAtInclude.yang b/compiler/base/parser/src/test/resources/RevisionDateInvalidSyntaxAtInclude.yang
new file mode 100644
index 0000000..ea5631e
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RevisionDateInvalidSyntaxAtInclude.yang
@@ -0,0 +1,17 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix test;
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include itut {
+revision-date 2016/02/03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+organization "ONOS";
+}
diff --git a/compiler/base/parser/src/test/resources/RevisionDateValidEntry.yang b/compiler/base/parser/src/test/resources/RevisionDateValidEntry.yang
new file mode 100644
index 0000000..dbf4d3a
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RevisionDateValidEntry.yang
@@ -0,0 +1,17 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix test;
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include itut {
+revision-date 2016-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+organization "ONOS";
+}
diff --git a/compiler/base/parser/src/test/resources/RevisionInValidOrder.yang b/compiler/base/parser/src/test/resources/RevisionInValidOrder.yang
new file mode 100644
index 0000000..c60d434
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RevisionInValidOrder.yang
@@ -0,0 +1,9 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix test;
+revision 2016-02-03;
+include itut {
+revision-date 2016-02-03;
+}
+}
diff --git a/compiler/base/parser/src/test/resources/RevisionInValidSyntax.yang b/compiler/base/parser/src/test/resources/RevisionInValidSyntax.yang
new file mode 100644
index 0000000..1795b3e
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RevisionInValidSyntax.yang
@@ -0,0 +1,8 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix test;
+contact "Test";
+organization "ONOS";
+revision;
+}
diff --git a/compiler/base/parser/src/test/resources/RevisionNoOptionalParameter.yang b/compiler/base/parser/src/test/resources/RevisionNoOptionalParameter.yang
new file mode 100644
index 0000000..664204e
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RevisionNoOptionalParameter.yang
@@ -0,0 +1,8 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix test;
+contact "Test";
+organization "ONOS";
+revision 2016-02-03;
+}
diff --git a/compiler/base/parser/src/test/resources/RevisionSubStatementReference.yang b/compiler/base/parser/src/test/resources/RevisionSubStatementReference.yang
new file mode 100644
index 0000000..d1ada14
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RevisionSubStatementReference.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    description "module description";
+    revision 2007-06-09 {
+        reference "revision reference";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/RevisionSubStatementRevision.yang b/compiler/base/parser/src/test/resources/RevisionSubStatementRevision.yang
new file mode 100644
index 0000000..3d1daa2
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/RevisionSubStatementRevision.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    description "module description";
+    revision 2007-06-09 {
+        description "revision description";
+    }
+}
+
diff --git a/compiler/base/parser/src/test/resources/ShortCaseListenerWithContainer.yang b/compiler/base/parser/src/test/resources/ShortCaseListenerWithContainer.yang
new file mode 100644
index 0000000..3322a66
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ShortCaseListenerWithContainer.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container food {
+        choice snack {
+            container sports-arena {
+                leaf pretzel {
+                    type empty;
+                }
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ShortCaseListenerWithList.yang b/compiler/base/parser/src/test/resources/ShortCaseListenerWithList.yang
new file mode 100644
index 0000000..6eeec79
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ShortCaseListenerWithList.yang
@@ -0,0 +1,16 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container food {
+        choice snack {
+            list sports-arena {
+                key "pretzel";
+                leaf pretzel {
+                    type int32;
+                }
+            }
+        }
+    }
+}
+
diff --git a/compiler/base/parser/src/test/resources/StatusDefaultValue.yang b/compiler/base/parser/src/test/resources/StatusDefaultValue.yang
new file mode 100644
index 0000000..0cc9e36
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/StatusDefaultValue.yang
@@ -0,0 +1,12 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config true;
+        reference "RFC 6020";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/StatusInvalidValue.yang b/compiler/base/parser/src/test/resources/StatusInvalidValue.yang
new file mode 100644
index 0000000..253b785
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/StatusInvalidValue.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+        leaf invalid-interval {
+        type "uint16";
+        status invalid;
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/StatusStatementCurrent.yang b/compiler/base/parser/src/test/resources/StatusStatementCurrent.yang
new file mode 100644
index 0000000..dd9a36d
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/StatusStatementCurrent.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config true;
+        mandatory true;
+        status current;
+        reference "RFC 6020";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/StatusStatementDeprecated.yang b/compiler/base/parser/src/test/resources/StatusStatementDeprecated.yang
new file mode 100644
index 0000000..9a257b1
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/StatusStatementDeprecated.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        status deprecated;
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/StatusStatementObsolete.yang b/compiler/base/parser/src/test/resources/StatusStatementObsolete.yang
new file mode 100644
index 0000000..19325ed
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/StatusStatementObsolete.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        status obsolete;
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/StatusWithoutStatementEnd.yang b/compiler/base/parser/src/test/resources/StatusWithoutStatementEnd.yang
new file mode 100644
index 0000000..27a8cfa
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/StatusWithoutStatementEnd.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        status current
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/SubModuleInvalidName.yang b/compiler/base/parser/src/test/resources/SubModuleInvalidName.yang
new file mode 100644
index 0000000..7da9397
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/SubModuleInvalidName.yang
@@ -0,0 +1,18 @@
+submodule Test:Test {
+belongs-to ONOS {
+prefix On1;
+}
+yang-version 1;
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include itut {
+revision-date 2016-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+organization "ONOS";
+}
diff --git a/compiler/base/parser/src/test/resources/SubModuleOrder.yang b/compiler/base/parser/src/test/resources/SubModuleOrder.yang
new file mode 100644
index 0000000..9779bbb
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/SubModuleOrder.yang
@@ -0,0 +1,18 @@
+submodule Test {
+belongs-to ONOS {
+prefix On1;
+}
+yang-version 1;
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include itut {
+revision-date 2016-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+organization "ONOS";
+}
diff --git a/compiler/base/parser/src/test/resources/SubModuleValidEntry.yang b/compiler/base/parser/src/test/resources/SubModuleValidEntry.yang
new file mode 100644
index 0000000..00ecdca
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/SubModuleValidEntry.yang
@@ -0,0 +1,18 @@
+submodule Test {
+yang-version 1;
+belongs-to ONOS {
+prefix On1;
+}
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include itut {
+revision-date 2016-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+organization "ONOS";
+}
diff --git a/compiler/base/parser/src/test/resources/SubModuleWithNamespace.yang b/compiler/base/parser/src/test/resources/SubModuleWithNamespace.yang
new file mode 100644
index 0000000..d7a38f7
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/SubModuleWithNamespace.yang
@@ -0,0 +1,19 @@
+submodule Test {
+belongs-to ONOS {
+prefix On1;
+}
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include itut {
+revision-date 2016-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+organization "ONOS";
+}
diff --git a/compiler/base/parser/src/test/resources/SubModuleWithoutBelongsTo.yang b/compiler/base/parser/src/test/resources/SubModuleWithoutBelongsTo.yang
new file mode 100644
index 0000000..4a25209
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/SubModuleWithoutBelongsTo.yang
@@ -0,0 +1,3 @@
+submodule Test {
+yang-version 1;
+}
diff --git a/compiler/base/parser/src/test/resources/SubModuleWithoutVersion.yang b/compiler/base/parser/src/test/resources/SubModuleWithoutVersion.yang
new file mode 100644
index 0000000..f44df8b
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/SubModuleWithoutVersion.yang
@@ -0,0 +1,17 @@
+submodule Test {
+belongs-to ONOS {
+prefix On1;
+}
+import ietf {
+prefix On2;
+revision-date 2015-02-03;
+}
+include itut {
+revision-date 2016-02-03;
+}
+include sdn {
+revision-date 2014-02-03;
+}
+contact "Test";
+organization "ONOS";
+}
diff --git a/compiler/base/parser/src/test/resources/UnionWhenTypeInLeaf.yang b/compiler/base/parser/src/test/resources/UnionWhenTypeInLeaf.yang
new file mode 100644
index 0000000..65c0369
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/UnionWhenTypeInLeaf.yang
@@ -0,0 +1,16 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid-interval";
+        leaf invalid-interval {
+            type union {
+                type int32;
+                type enumeration {
+                    enum "unbounded";
+                }
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/UnionWhenTypeInLeafList.yang b/compiler/base/parser/src/test/resources/UnionWhenTypeInLeafList.yang
new file mode 100644
index 0000000..f335960
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/UnionWhenTypeInLeafList.yang
@@ -0,0 +1,19 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid";
+        leaf-list invalid-interval {
+            type union {
+            type int32;
+            type enumeration {
+                    enum "unbounded";
+                }
+            }
+        }
+        leaf invalid {
+            type string;
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/UnionWithEmptyType.yang b/compiler/base/parser/src/test/resources/UnionWithEmptyType.yang
new file mode 100644
index 0000000..81e8795
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/UnionWithEmptyType.yang
@@ -0,0 +1,16 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid-interval";
+        leaf invalid-interval {
+            type union {
+                type empty;
+                type enumeration {
+                    enum "unbounded";
+                }
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/UnionWithoutChild.yang b/compiler/base/parser/src/test/resources/UnionWithoutChild.yang
new file mode 100644
index 0000000..14d3329
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/UnionWithoutChild.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    list valid {
+        key "invalid-interval";
+        leaf invalid-interval {
+            type union {
+               type "union";
+            }
+        }
+    }
+}
+
diff --git a/compiler/base/parser/src/test/resources/UnitsDefaultValue.yang b/compiler/base/parser/src/test/resources/UnitsDefaultValue.yang
new file mode 100644
index 0000000..c71d5ea
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/UnitsDefaultValue.yang
@@ -0,0 +1,8 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/UnitsStatement.yang b/compiler/base/parser/src/test/resources/UnitsStatement.yang
new file mode 100644
index 0000000..70349a0
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/UnitsStatement.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        units "seconds";
+        description "Interval before a route is declared invalid";
+        config true;
+        mandatory true;
+        status current;
+        reference "RFC 6020";
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/UnitsStatementCardinality.yang b/compiler/base/parser/src/test/resources/UnitsStatementCardinality.yang
new file mode 100644
index 0000000..50a2ba0
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/UnitsStatementCardinality.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        units "seconds";
+        units "minutes";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/UnitsStatementOrder.yang b/compiler/base/parser/src/test/resources/UnitsStatementOrder.yang
new file mode 100644
index 0000000..e41e201
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/UnitsStatementOrder.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        units "seconds";
+        type "uint16";
+        description "Interval before a route is declared invalid";
+        config true;
+        mandatory true;
+        status current;
+        reference "RFC 6020";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/UnitsWithoutStatementEnd.yang b/compiler/base/parser/src/test/resources/UnitsWithoutStatementEnd.yang
new file mode 100644
index 0000000..889d7b7
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/UnitsWithoutStatementEnd.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        units "seconds"
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/UnsupportedYangConstructSubStatementMust.yang b/compiler/base/parser/src/test/resources/UnsupportedYangConstructSubStatementMust.yang
new file mode 100644
index 0000000..1529cfd
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/UnsupportedYangConstructSubStatementMust.yang
@@ -0,0 +1,17 @@
+module Test {
+    yang-version 1;
+    namespace "http://huawei.com";
+    prefix Ant;
+    list link-scope-lsa {
+        key "lsa-id adv-router";
+        description "List of OSPF link scope LSAs";
+        uses lsa {
+            refine "version/ospfv2/ospfv2" {
+                must "../../../../../../../../../../../"
+                   + "rt:type = 'ospf:ospfv2'" {
+                  description "OSPFv2 LSA.";
+                }
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/UsesInContainer.yang b/compiler/base/parser/src/test/resources/UsesInContainer.yang
new file mode 100644
index 0000000..df52fd6
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/UsesInContainer.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    grouping endpoint {
+    }
+    container valid {
+        uses endpoint {
+            description "grouping under test";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/UsesInList.yang b/compiler/base/parser/src/test/resources/UsesInList.yang
new file mode 100644
index 0000000..6ac7795
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/UsesInList.yang
@@ -0,0 +1,21 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    import ietf-yang-types {
+             prefix "P";
+         }    
+    grouping endpoint {
+    }
+    list valid {
+        key address;
+        leaf address {
+            type P:ip;
+        }
+        uses endpoint {
+            description "grouping under test";
+            status current;
+            reference "RFC 6020";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/UsesInModule.yang b/compiler/base/parser/src/test/resources/UsesInModule.yang
new file mode 100644
index 0000000..02b9f09
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/UsesInModule.yang
@@ -0,0 +1,8 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    grouping endpoint {
+    }
+    uses endpoint;
+}
diff --git a/compiler/base/parser/src/test/resources/ValidAugmentStatement.yang b/compiler/base/parser/src/test/resources/ValidAugmentStatement.yang
new file mode 100644
index 0000000..f6c247e
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ValidAugmentStatement.yang
@@ -0,0 +1,17 @@
+module Test {
+    yang-version 1;
+    namespace http://example.com/schema/ds0;
+    prefix On;
+
+    import interface-module {
+        prefix "if";
+    }
+    import ietf-yang-types {
+             prefix "P";
+         }
+    augment "/if:interfaces/if:ifEntry" {
+        leaf ds0ChannelNumber {
+            type P:ChannelNumber;
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ValidBinaryLengthStatement.yang b/compiler/base/parser/src/test/resources/ValidBinaryLengthStatement.yang
new file mode 100644
index 0000000..7182eb3
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ValidBinaryLengthStatement.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf message {
+        type binary {
+            length "4";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ValidExtensionStatement.yang b/compiler/base/parser/src/test/resources/ValidExtensionStatement.yang
new file mode 100644
index 0000000..ca134fa
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ValidExtensionStatement.yang
@@ -0,0 +1,36 @@
+module ietf-yang-compiler-annotation {
+
+   namespace "urn:ietf:params:xml:ns:yang:ietf-yang-compiler-annotation";
+
+   prefix "ca";
+
+   organization
+     "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
+
+   contact
+     "WG Web:   <http://tools.ietf.org/wg/netmod/>
+      WG List:  <mailto:netmod@ietf.org>";
+
+   description
+     "This YANG module defines an extension statement that allows for
+      defining compiler annotations.
+
+      The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
+      NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and
+      'OPTIONAL' in the module text are to be interpreted as described
+      in RFC 2119 (http://tools.ietf.org/html/rfc2119).";
+
+     revision 2016-07-08 {
+     description
+       "Initial revision.";
+     reference
+       "draft-agv-netmod-yang-compiler-metadata:
+        Defining and Using compiler annotations with YANG";
+     }
+
+     extension compiler-annotation {
+        argument target;
+        description "This extension allows for defining compiler annotations";
+      } // compiler-annotation
+   } //module agv-yang-compiler-annotation
+
diff --git a/compiler/base/parser/src/test/resources/ValidLengthStatement.yang b/compiler/base/parser/src/test/resources/ValidLengthStatement.yang
new file mode 100644
index 0000000..57cb809
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ValidLengthStatement.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type string {
+            length "0..100";
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ValidLengthStatementInsideBinary.yang b/compiler/base/parser/src/test/resources/ValidLengthStatementInsideBinary.yang
new file mode 100644
index 0000000..7182eb3
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ValidLengthStatementInsideBinary.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf message {
+        type binary {
+            length "4";
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ValidNotificationStatement.yang b/compiler/base/parser/src/test/resources/ValidNotificationStatement.yang
new file mode 100644
index 0000000..1e0f144
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ValidNotificationStatement.yang
@@ -0,0 +1,26 @@
+module rock {
+    namespace "http://example.net/rock";
+    prefix "rock";
+
+    import ietf-yang-types {
+             prefix "P";
+         }
+    notification link-failure {
+        description "A link failure has been detected";
+        status deprecated;
+        reference "reference";
+        typedef my-type {
+           status deprecated;
+           type int32;
+        }
+        leaf if-name {
+           type string;
+        }
+        leaf if-admin-status {
+           type P:admin-status;
+        }
+        leaf if-oper-status {
+           type P:oper-status;
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ValidPatternStatement.yang b/compiler/base/parser/src/test/resources/ValidPatternStatement.yang
new file mode 100644
index 0000000..0c93e9d
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ValidPatternStatement.yang
@@ -0,0 +1,30 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type string {
+            pattern "[a-zA-Z]";
+         }
+    }
+    leaf ipv4-address {
+         type string {
+           pattern
+          '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\p{N}\p{L}]+)?';
+         }
+      description
+        "The ipv4-address type represents an IPv4 address in
+       dotted-quad notation.  The IPv4 address may include a zone
+       index, separated by a % sign.
+
+       The zone index is used to disambiguate identical address
+       values.  For link-local addresses, the zone index will
+       typically be the interface index number or the name of an
+       interface.  If the zone index is not present, the default
+       zone of the device will be used.
+
+       The canonical format for the zone index is the numerical
+       format";
+    }
+
+}
diff --git a/compiler/base/parser/src/test/resources/ValidRangeStatement.yang b/compiler/base/parser/src/test/resources/ValidRangeStatement.yang
new file mode 100644
index 0000000..4243040
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ValidRangeStatement.yang
@@ -0,0 +1,11 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type int32 {
+            range "1..4 | 10..20";
+         }
+    }
+}
+
diff --git a/compiler/base/parser/src/test/resources/ValidRpcStatement.yang b/compiler/base/parser/src/test/resources/ValidRpcStatement.yang
new file mode 100644
index 0000000..f188227
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ValidRpcStatement.yang
@@ -0,0 +1,24 @@
+module rock {
+    namespace "http://example.net/rock";
+    prefix "rock";
+
+    rpc rock-the-house {
+        description "description";
+        status current;
+        reference "reference";
+        typedef my-type {
+           status deprecated;
+           type int32;
+        }
+        input {
+            leaf zip-code {
+                type string;
+            }
+        }
+        output {
+             leaf status {
+                 type string;
+             }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ValidSameGroupingEntryInModuleAndContainer.yang b/compiler/base/parser/src/test/resources/ValidSameGroupingEntryInModuleAndContainer.yang
new file mode 100644
index 0000000..2580cdd
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ValidSameGroupingEntryInModuleAndContainer.yang
@@ -0,0 +1,23 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    grouping endpoint {
+        leaf address {
+            type ip-address;
+        }
+    leaf port {
+        type port-number;
+        }
+    }
+    container valid {
+        grouping endpoint {
+            leaf address {
+                type ip-address;
+            }
+            leaf port {
+                type port-number;
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ValidVersionWithDoubleQuotes.yang b/compiler/base/parser/src/test/resources/ValidVersionWithDoubleQuotes.yang
new file mode 100644
index 0000000..a2c718a
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ValidVersionWithDoubleQuotes.yang
@@ -0,0 +1,5 @@
+module Test {
+yang-version "1";
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+}
diff --git a/compiler/base/parser/src/test/resources/ValueAndAutoStatement.yang b/compiler/base/parser/src/test/resources/ValueAndAutoStatement.yang
new file mode 100644
index 0000000..89ba403
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ValueAndAutoStatement.yang
@@ -0,0 +1,16 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf speed {
+        type enumeration {
+            enum 10m {
+                value 10;
+            }
+            enum 100m;
+            enum auto {
+                value 1000;
+            }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ValueDuplication.yang b/compiler/base/parser/src/test/resources/ValueDuplication.yang
new file mode 100644
index 0000000..339a737
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ValueDuplication.yang
@@ -0,0 +1,18 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf speed {
+        type enumeration {
+          enum 10m {
+	     value 10;
+          }
+          enum 100m {
+	     value 100;
+          }
+          enum auto {
+	     value 10;
+          }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ValueExplicitAndAutoDuplication.yang b/compiler/base/parser/src/test/resources/ValueExplicitAndAutoDuplication.yang
new file mode 100644
index 0000000..3e58155
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ValueExplicitAndAutoDuplication.yang
@@ -0,0 +1,16 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf speed {
+        type enumeration {
+          enum 10m {
+	     value 10;
+          }
+          enum 100m;
+          enum auto {
+	     value 11;
+          }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ValueStatement.yang b/compiler/base/parser/src/test/resources/ValueStatement.yang
new file mode 100644
index 0000000..f461359
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ValueStatement.yang
@@ -0,0 +1,18 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf speed {
+        type enumeration {
+          enum 10m {
+	     value 10;
+          }
+          enum 100m {
+	     value 100;
+          }
+          enum auto {
+	     value 1000;
+          }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ValueStatementWithNegativeValue.yang b/compiler/base/parser/src/test/resources/ValueStatementWithNegativeValue.yang
new file mode 100644
index 0000000..a3f236b
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ValueStatementWithNegativeValue.yang
@@ -0,0 +1,18 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf speed {
+        type enumeration {
+          enum 10m {
+	     value -2;
+          }
+          enum 100m {
+	     value "-1";
+          }
+          enum auto {
+	     value 0;
+          }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/ValueStatementWithQuotes.yang b/compiler/base/parser/src/test/resources/ValueStatementWithQuotes.yang
new file mode 100644
index 0000000..e166ca4
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/ValueStatementWithQuotes.yang
@@ -0,0 +1,18 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf speed {
+        type enumeration {
+          enum 10m {
+	     value "10";
+          }
+          enum 100m {
+	     value "100";
+          }
+          enum auto {
+	     value "1000";
+          }
+        }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/VersionDualEntry.yang b/compiler/base/parser/src/test/resources/VersionDualEntry.yang
new file mode 100644
index 0000000..f8eaddd
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/VersionDualEntry.yang
@@ -0,0 +1,6 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+yang-version 1;
+}
diff --git a/compiler/base/parser/src/test/resources/VersionInvalidSyntax.yang b/compiler/base/parser/src/test/resources/VersionInvalidSyntax.yang
new file mode 100644
index 0000000..26cb0b2
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/VersionInvalidSyntax.yang
@@ -0,0 +1,5 @@
+module Test {
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+yang-version ;
+}
diff --git a/compiler/base/parser/src/test/resources/VersionInvalidValue.yang b/compiler/base/parser/src/test/resources/VersionInvalidValue.yang
new file mode 100644
index 0000000..e8e6107
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/VersionInvalidValue.yang
@@ -0,0 +1,5 @@
+module Test {
+yang-version 2;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+}
diff --git a/compiler/base/parser/src/test/resources/VersionNotPresent.yang b/compiler/base/parser/src/test/resources/VersionNotPresent.yang
new file mode 100644
index 0000000..eed9953
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/VersionNotPresent.yang
@@ -0,0 +1,4 @@
+module Test {
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+}
diff --git a/compiler/base/parser/src/test/resources/VersionOrder.yang b/compiler/base/parser/src/test/resources/VersionOrder.yang
new file mode 100644
index 0000000..92463e9
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/VersionOrder.yang
@@ -0,0 +1,5 @@
+module Test {
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+yang-version 1;
+}
diff --git a/compiler/base/parser/src/test/resources/VersionValidEntry.yang b/compiler/base/parser/src/test/resources/VersionValidEntry.yang
new file mode 100644
index 0000000..439ded8
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/VersionValidEntry.yang
@@ -0,0 +1,5 @@
+module Test {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+}
diff --git a/compiler/base/parser/src/test/resources/YangFileWithSyntaxError.yang b/compiler/base/parser/src/test/resources/YangFileWithSyntaxError.yang
new file mode 100644
index 0000000..413a181
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/YangFileWithSyntaxError.yang
@@ -0,0 +1,6 @@
+module Antlrtest {
+yang-version 1
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix Ant;
+}
+
diff --git a/compiler/base/parser/src/test/resources/YangFileWithoutSyntaxError.yang b/compiler/base/parser/src/test/resources/YangFileWithoutSyntaxError.yang
new file mode 100644
index 0000000..4f4839f
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/YangFileWithoutSyntaxError.yang
@@ -0,0 +1,6 @@
+module Antlrtest {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix Ant;
+}
+
diff --git a/compiler/base/parser/src/test/resources/decimal64/Decimal64MultiTypedefMultiInvalidRangeStatement.yang b/compiler/base/parser/src/test/resources/decimal64/Decimal64MultiTypedefMultiInvalidRangeStatement.yang
new file mode 100644
index 0000000..966b387
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/decimal64/Decimal64MultiTypedefMultiInvalidRangeStatement.yang
@@ -0,0 +1,22 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    typedef topDecimal {
+         type decimal64 {
+            fraction-digits 4;
+            range 4..11;
+         }
+    }
+
+    typedef midDecimal {
+         type topDecimal;
+    }
+
+    leaf lowerDecimal {
+         type midDecimal {
+            range 1..12;
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/decimal64/Decimal64MultiTypedefMultiRangeStatement.yang b/compiler/base/parser/src/test/resources/decimal64/Decimal64MultiTypedefMultiRangeStatement.yang
new file mode 100644
index 0000000..76f215a
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/decimal64/Decimal64MultiTypedefMultiRangeStatement.yang
@@ -0,0 +1,22 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    typedef topDecimal {
+         type decimal64 {
+            fraction-digits 4;
+            range 1..12;
+         }
+    }
+
+    typedef midDecimal {
+         type topDecimal;
+    }
+
+    leaf lowerDecimal {
+         type midDecimal {
+            range 4..11;
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/decimal64/Decimal64MultiTypedefRangeInLeafStatement.yang b/compiler/base/parser/src/test/resources/decimal64/Decimal64MultiTypedefRangeInLeafStatement.yang
new file mode 100644
index 0000000..eea48f4
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/decimal64/Decimal64MultiTypedefRangeInLeafStatement.yang
@@ -0,0 +1,21 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    typedef topDecimal {
+         type decimal64 {
+            fraction-digits 4;
+         }
+    }
+
+    typedef midDecimal {
+         type topDecimal;
+    }
+
+    leaf lowerDecimal {
+         type midDecimal {
+            range 1..12;
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/decimal64/Decimal64MultiTypedefRangeStatement.yang b/compiler/base/parser/src/test/resources/decimal64/Decimal64MultiTypedefRangeStatement.yang
new file mode 100644
index 0000000..b4c0a36
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/decimal64/Decimal64MultiTypedefRangeStatement.yang
@@ -0,0 +1,20 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    typedef topDecimal {
+         type decimal64 {
+            fraction-digits 4; 
+            range 1..12;
+         }
+    }
+
+    typedef midDecimal {
+         type topDecimal;
+    }
+
+    leaf lowerDecimal {
+         type midDecimal;
+    } 
+}
diff --git a/compiler/base/parser/src/test/resources/decimal64/Decimal64MultiTypedefStatement.yang b/compiler/base/parser/src/test/resources/decimal64/Decimal64MultiTypedefStatement.yang
new file mode 100644
index 0000000..8682aac
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/decimal64/Decimal64MultiTypedefStatement.yang
@@ -0,0 +1,19 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    typedef topDecimal {
+         type decimal64 {
+            fraction-digits 4; 
+         }
+    }
+
+    typedef midDecimal {
+         type topDecimal;
+    }
+
+    leaf lowerDecimal {
+         type midDecimal;
+    } 
+}
diff --git a/compiler/base/parser/src/test/resources/decimal64/Decimal64MultiTypedefWithMaxRange.yang b/compiler/base/parser/src/test/resources/decimal64/Decimal64MultiTypedefWithMaxRange.yang
new file mode 100644
index 0000000..405d08c
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/decimal64/Decimal64MultiTypedefWithMaxRange.yang
@@ -0,0 +1,22 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    typedef topDecimal {
+         type decimal64 {
+            fraction-digits 4;
+            range 1..12;
+         }
+    }
+
+    typedef midDecimal {
+         type topDecimal;
+    }
+
+    leaf lowerDecimal {
+         type midDecimal {
+            range 4..max;
+         }
+    } 
+}
diff --git a/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeInvalidMaxValueFraction.yang b/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeInvalidMaxValueFraction.yang
new file mode 100644
index 0000000..68bd8df
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeInvalidMaxValueFraction.yang
@@ -0,0 +1,11 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    leaf invalidDecimal1 {
+         type decimal64 {
+            fraction-digits 19; 
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeInvalidMinValueFraction1.yang b/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeInvalidMinValueFraction1.yang
new file mode 100644
index 0000000..3d7445a
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeInvalidMinValueFraction1.yang
@@ -0,0 +1,11 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    leaf invalidDecimal2 {
+         type decimal64 {
+            fraction-digits 0; 
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeInvalidMinValueFraction2.yang b/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeInvalidMinValueFraction2.yang
new file mode 100644
index 0000000..4e17bbe
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeInvalidMinValueFraction2.yang
@@ -0,0 +1,11 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    leaf invalidDecimal3 {
+         type decimal64 {
+            fraction-digits -1; 
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeInvalidRangeStmnt.yang b/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeInvalidRangeStmnt.yang
new file mode 100644
index 0000000..2ac3d94
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeInvalidRangeStmnt.yang
@@ -0,0 +1,11 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf validDecimal {
+         type decimal64 {
+            fraction-digits 18; 
+            range "1 .. 20.14";
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeStatement.yang b/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeStatement.yang
new file mode 100644
index 0000000..9824c12
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeStatement.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf validDecimal {
+         type decimal64 {
+            fraction-digits 2; 
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeValidation.yang b/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeValidation.yang
new file mode 100644
index 0000000..06bf5b7
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeValidation.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf validDecimal {
+         type decimal64 {
+            fraction-digits 18; 
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeWithMultiValueRangeStmnt.yang b/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeWithMultiValueRangeStmnt.yang
new file mode 100644
index 0000000..f657134
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeWithMultiValueRangeStmnt.yang
@@ -0,0 +1,11 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf validDecimal {
+         type decimal64 {
+            fraction-digits 18; 
+            range "-9.22..7.22 | 8 | 9..max";
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeWithRangeStatement.yang b/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeWithRangeStatement.yang
new file mode 100644
index 0000000..f184927
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeWithRangeStatement.yang
@@ -0,0 +1,11 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf validDecimal {
+         type decimal64 {
+            fraction-digits 8; 
+            range "-92233720368.54775808 .. 92233720368.54775807";
+         }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeWithoutFraction.yang b/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeWithoutFraction.yang
new file mode 100644
index 0000000..e7b8beb
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/decimal64/Decimal64TypeWithoutFraction.yang
@@ -0,0 +1,8 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf validDecimal {
+         type decimal64;
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/decimal64/Decimal64TypedefStatement.yang b/compiler/base/parser/src/test/resources/decimal64/Decimal64TypedefStatement.yang
new file mode 100644
index 0000000..66addd2
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/decimal64/Decimal64TypedefStatement.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    typedef validDecimal {
+         type decimal64 {
+            fraction-digits 4; 
+         }
+    }
+
+    leaf setFourDecimal {
+         type validDecimal;
+    } 
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultCaseInChoiceSubStatement.yang b/compiler/base/parser/src/test/resources/default/DefaultCaseInChoiceSubStatement.yang
new file mode 100644
index 0000000..72b597b
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultCaseInChoiceSubStatement.yang
@@ -0,0 +1,23 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container food {
+       choice snack {
+           case sports-arena {
+               leaf pretzel {
+                   type string;
+               }
+               leaf beer {
+                   type string;
+               }
+           }
+           case late-night {
+               leaf chocolate {
+                   type string;
+               }
+           }
+           default "sports-arena";
+       }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultInvalidValueBinaryInLeaf.yang b/compiler/base/parser/src/test/resources/default/DefaultInvalidValueBinaryInLeaf.yang
new file mode 100644
index 0000000..aab417b
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultInvalidValueBinaryInLeaf.yang
@@ -0,0 +1,12 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    leaf message {
+        type binary {
+            length "8";
+        }
+        default "000";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultInvalidValueBitsInLeaf.yang b/compiler/base/parser/src/test/resources/default/DefaultInvalidValueBitsInLeaf.yang
new file mode 100644
index 0000000..2e84cf3
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultInvalidValueBitsInLeaf.yang
@@ -0,0 +1,20 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+     leaf mybits {
+         type bits {
+             bit disable-nagle {
+                 position 0;
+             }
+             bit auto-sense-speed {
+                 position 1;
+             }
+             bit Mb-only {
+                 position 2;
+             }
+         }
+         default "xyz";
+     }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultInvalidValueBooleanInLeaf.yang b/compiler/base/parser/src/test/resources/default/DefaultInvalidValueBooleanInLeaf.yang
new file mode 100644
index 0000000..1d98df9
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultInvalidValueBooleanInLeaf.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    leaf myboolean {
+        type boolean;
+        default "yes";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultInvalidValueDecimal64InLeaf.yang b/compiler/base/parser/src/test/resources/default/DefaultInvalidValueDecimal64InLeaf.yang
new file mode 100644
index 0000000..305235f
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultInvalidValueDecimal64InLeaf.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    leaf mydecimal {
+        type decimal64 {
+           fraction-digits 4;
+           range 4..6;
+        } 
+        default "x";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultInvalidValueEnumerationInLeaf.yang b/compiler/base/parser/src/test/resources/default/DefaultInvalidValueEnumerationInLeaf.yang
new file mode 100644
index 0000000..643dac3
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultInvalidValueEnumerationInLeaf.yang
@@ -0,0 +1,16 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+     leaf myenum {
+         type enumeration {
+             enum zero;
+             enum one;
+             enum seven {
+                 value 7;
+             }
+         }
+         default "xyz";
+     }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultInvalidValueInChoiceSubStmt.yang b/compiler/base/parser/src/test/resources/default/DefaultInvalidValueInChoiceSubStmt.yang
new file mode 100644
index 0000000..b9fd60d
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultInvalidValueInChoiceSubStmt.yang
@@ -0,0 +1,23 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container food {
+       choice snack {
+           case sports-arena {
+               leaf pretzel {
+                   type string;
+               }
+               leaf beer {
+                   type string;
+               }
+           }
+           case late-night {
+               leaf chocolate {
+                   type string;
+               }
+           }
+           default "hello";
+       }
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultInvalidValueInLeafSubStatement.yang b/compiler/base/parser/src/test/resources/default/DefaultInvalidValueInLeafSubStatement.yang
new file mode 100644
index 0000000..9b20fa2
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultInvalidValueInLeafSubStatement.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        units "seconds";
+        default "x";
+        description "Interval before a route is declared invalid";
+        config true;
+        mandatory true;
+        status current;
+        reference "RFC 6020";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultInvalidValueInTypeDef.yang b/compiler/base/parser/src/test/resources/default/DefaultInvalidValueInTypeDef.yang
new file mode 100644
index 0000000..35f8554
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultInvalidValueInTypeDef.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    typedef topInt {
+       type int64;
+       default "x";
+    }
+
+    leaf myValue {
+        type topInt;
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultInvalidValueStringInLeaf.yang b/compiler/base/parser/src/test/resources/default/DefaultInvalidValueStringInLeaf.yang
new file mode 100644
index 0000000..28d3d22
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultInvalidValueStringInLeaf.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    leaf MyString {
+       type string {
+          length "0..4";
+          pattern "[0-9a-fA-F]*";
+       }
+       default "2bB2bB";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultInvalidValueUnionInLeaf.yang b/compiler/base/parser/src/test/resources/default/DefaultInvalidValueUnionInLeaf.yang
new file mode 100644
index 0000000..2bbb698
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultInvalidValueUnionInLeaf.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    leaf message {
+        type union {
+            type int32;
+            type enumeration {
+                enum "unbounded";
+            }
+        }
+        default "xyz";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultInvalidValueWithRangeInTypedef.yang b/compiler/base/parser/src/test/resources/default/DefaultInvalidValueWithRangeInTypedef.yang
new file mode 100644
index 0000000..c4ca002
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultInvalidValueWithRangeInTypedef.yang
@@ -0,0 +1,11 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    typedef hello {
+        type int32 {
+            range "1..4 | 10..20";
+        }
+        default "0";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultValueBinaryInLeaf.yang b/compiler/base/parser/src/test/resources/default/DefaultValueBinaryInLeaf.yang
new file mode 100644
index 0000000..fa6fb05
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultValueBinaryInLeaf.yang
@@ -0,0 +1,12 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    leaf message {
+        type binary {
+            length "8";
+        }
+        default "10010010";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultValueBitsInLeaf.yang b/compiler/base/parser/src/test/resources/default/DefaultValueBitsInLeaf.yang
new file mode 100644
index 0000000..574df85
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultValueBitsInLeaf.yang
@@ -0,0 +1,20 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+     leaf mybits {
+         type bits {
+             bit disable-nagle {
+                 position 0;
+             }
+             bit auto-sense-speed {
+                 position 1;
+             }
+             bit Mb-only {
+                 position 2;
+             }
+         }
+         default "auto-sense-speed";
+     }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultValueBooleanInLeaf.yang b/compiler/base/parser/src/test/resources/default/DefaultValueBooleanInLeaf.yang
new file mode 100644
index 0000000..bb126ff
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultValueBooleanInLeaf.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    leaf myboolean {
+        type boolean;
+        default "true";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultValueDecimal64InLeaf.yang b/compiler/base/parser/src/test/resources/default/DefaultValueDecimal64InLeaf.yang
new file mode 100644
index 0000000..18e566d
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultValueDecimal64InLeaf.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    leaf mydecimal {
+        type decimal64 {
+           fraction-digits 4;
+           range 4..6;
+        } 
+        default "5";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultValueDerivedInTypedef.yang b/compiler/base/parser/src/test/resources/default/DefaultValueDerivedInTypedef.yang
new file mode 100644
index 0000000..b787b18
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultValueDerivedInTypedef.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    typedef topInt {
+       type int64;
+       default "10";
+    }
+
+    leaf myValue {
+        type topInt;
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultValueEmptyInLeaf.yang b/compiler/base/parser/src/test/resources/default/DefaultValueEmptyInLeaf.yang
new file mode 100644
index 0000000..8c8bbea
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultValueEmptyInLeaf.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    leaf enable-qos {
+        type empty;
+        default "something";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultValueEnumerationInLeaf.yang b/compiler/base/parser/src/test/resources/default/DefaultValueEnumerationInLeaf.yang
new file mode 100644
index 0000000..2545976
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultValueEnumerationInLeaf.yang
@@ -0,0 +1,16 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+     leaf myenum {
+         type enumeration {
+             enum zero;
+             enum one;
+             enum seven {
+                 value 7;
+             }
+         }
+         default "one";
+     }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultValueInLeafSubStatement.yang b/compiler/base/parser/src/test/resources/default/DefaultValueInLeafSubStatement.yang
new file mode 100644
index 0000000..a78131d
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultValueInLeafSubStatement.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type "uint16";
+        units "seconds";
+        default "1";
+        description "Interval before a route is declared invalid";
+        config true;
+        mandatory true;
+        status current;
+        reference "RFC 6020";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultValueInMultiTypeDef.yang b/compiler/base/parser/src/test/resources/default/DefaultValueInMultiTypeDef.yang
new file mode 100644
index 0000000..d25b7c2
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultValueInMultiTypeDef.yang
@@ -0,0 +1,18 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    typedef topInt {
+       type int64;
+       default "10";
+    }
+
+    typedef midInt {
+       type topInt;
+    }
+
+    leaf lowInt {
+        type midInt;
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultValueInTypeDef.yang b/compiler/base/parser/src/test/resources/default/DefaultValueInTypeDef.yang
new file mode 100644
index 0000000..b787b18
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultValueInTypeDef.yang
@@ -0,0 +1,14 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    typedef topInt {
+       type int64;
+       default "10";
+    }
+
+    leaf myValue {
+        type topInt;
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultValueStringInLeaf.yang b/compiler/base/parser/src/test/resources/default/DefaultValueStringInLeaf.yang
new file mode 100644
index 0000000..1bdb1e8
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultValueStringInLeaf.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    leaf MyString {
+       type string {
+          length "0..4";
+          pattern "[0-9a-fA-F]*";
+       }
+       default "2bB";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/default/DefaultValueUnionInLeaf.yang b/compiler/base/parser/src/test/resources/default/DefaultValueUnionInLeaf.yang
new file mode 100644
index 0000000..e2b39c9
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/default/DefaultValueUnionInLeaf.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+
+    leaf message {
+        type union {
+            type int32;
+            type enumeration {
+                enum "unbounded";
+            }
+        }
+        default "unbounded";
+    }
+}
diff --git a/compiler/base/parser/src/test/resources/leafRefPathConcatenation.yang b/compiler/base/parser/src/test/resources/leafRefPathConcatenation.yang
new file mode 100644
index 0000000..a9b688e
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/leafRefPathConcatenation.yang
@@ -0,0 +1,20 @@
+module test {
+    namespace "urn:ietf:params:xml:ns:yang:ietf-isis";
+    prefix isis;
+    typedef isis-instance-state-ref {
+        type leafref {
+            path "/isis-prefix-ipv4-std/"
+            +"default-metric";
+        }
+    }
+    container isis-route-content {
+        leaf metric {
+            type isis-instance-state-ref ;
+        }
+    }
+    container isis-prefix-ipv4-std {
+        leaf default-metric {
+            type string;
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/base/parser/src/test/resources/processTypeDef.yang b/compiler/base/parser/src/test/resources/processTypeDef.yang
new file mode 100644
index 0000000..2875752
--- /dev/null
+++ b/compiler/base/parser/src/test/resources/processTypeDef.yang
@@ -0,0 +1,11 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    typedef hello {
+        type String;
+    }
+    leaf invalid-interval {
+        type hello;
+    }
+}