[ONOS-4350] Inter Jar dependency implementation and code restructuring.

Change-Id: Iacac75e4187aed93ce1754c170a9c19707e5b8c3
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/TreeWalkListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/TreeWalkListener.java
new file mode 100644
index 0000000..194d32f
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/TreeWalkListener.java
@@ -0,0 +1,1423 @@
+/*
+ * 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.yangutils.parser.impl;
+
+import java.util.Stack;
+
+import org.antlr.v4.runtime.ParserRuleContext;
+import org.antlr.v4.runtime.tree.ErrorNode;
+import org.antlr.v4.runtime.tree.TerminalNode;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.datamodel.utils.YangConstructType;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangListener;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.impl.listeners.AugmentListener;
+import org.onosproject.yangutils.parser.impl.listeners.BaseFileListener;
+import org.onosproject.yangutils.parser.impl.listeners.BelongsToListener;
+import org.onosproject.yangutils.parser.impl.listeners.BitListener;
+import org.onosproject.yangutils.parser.impl.listeners.BitsListener;
+import org.onosproject.yangutils.parser.impl.listeners.CaseListener;
+import org.onosproject.yangutils.parser.impl.listeners.ChoiceListener;
+import org.onosproject.yangutils.parser.impl.listeners.ConfigListener;
+import org.onosproject.yangutils.parser.impl.listeners.ContactListener;
+import org.onosproject.yangutils.parser.impl.listeners.ContainerListener;
+import org.onosproject.yangutils.parser.impl.listeners.DefaultListener;
+import org.onosproject.yangutils.parser.impl.listeners.DescriptionListener;
+import org.onosproject.yangutils.parser.impl.listeners.EnumListener;
+import org.onosproject.yangutils.parser.impl.listeners.EnumerationListener;
+import org.onosproject.yangutils.parser.impl.listeners.GroupingListener;
+import org.onosproject.yangutils.parser.impl.listeners.ImportListener;
+import org.onosproject.yangutils.parser.impl.listeners.IncludeListener;
+import org.onosproject.yangutils.parser.impl.listeners.InputListener;
+import org.onosproject.yangutils.parser.impl.listeners.KeyListener;
+import org.onosproject.yangutils.parser.impl.listeners.LeafListListener;
+import org.onosproject.yangutils.parser.impl.listeners.LeafListener;
+import org.onosproject.yangutils.parser.impl.listeners.LengthRestrictionListener;
+import org.onosproject.yangutils.parser.impl.listeners.ListListener;
+import org.onosproject.yangutils.parser.impl.listeners.MandatoryListener;
+import org.onosproject.yangutils.parser.impl.listeners.MaxElementsListener;
+import org.onosproject.yangutils.parser.impl.listeners.MinElementsListener;
+import org.onosproject.yangutils.parser.impl.listeners.ModuleListener;
+import org.onosproject.yangutils.parser.impl.listeners.NotificationListener;
+import org.onosproject.yangutils.parser.impl.listeners.NamespaceListener;
+import org.onosproject.yangutils.parser.impl.listeners.OrganizationListener;
+import org.onosproject.yangutils.parser.impl.listeners.OutputListener;
+import org.onosproject.yangutils.parser.impl.listeners.PatternRestrictionListener;
+import org.onosproject.yangutils.parser.impl.listeners.PositionListener;
+import org.onosproject.yangutils.parser.impl.listeners.PrefixListener;
+import org.onosproject.yangutils.parser.impl.listeners.PresenceListener;
+import org.onosproject.yangutils.parser.impl.listeners.RangeRestrictionListener;
+import org.onosproject.yangutils.parser.impl.listeners.ReferenceListener;
+import org.onosproject.yangutils.parser.impl.listeners.RevisionDateListener;
+import org.onosproject.yangutils.parser.impl.listeners.RevisionListener;
+import org.onosproject.yangutils.parser.impl.listeners.RpcListener;
+import org.onosproject.yangutils.parser.impl.listeners.ShortCaseListener;
+import org.onosproject.yangutils.parser.impl.listeners.StatusListener;
+import org.onosproject.yangutils.parser.impl.listeners.SubModuleListener;
+import org.onosproject.yangutils.parser.impl.listeners.TypeDefListener;
+import org.onosproject.yangutils.parser.impl.listeners.TypeListener;
+import org.onosproject.yangutils.parser.impl.listeners.UnionListener;
+import org.onosproject.yangutils.parser.impl.listeners.UnitsListener;
+import org.onosproject.yangutils.parser.impl.listeners.UsesListener;
+import org.onosproject.yangutils.parser.impl.listeners.ValueListener;
+import org.onosproject.yangutils.parser.impl.listeners.VersionListener;
+
+import static org.onosproject.yangutils.utils.UtilConstants.UNSUPPORTED_YANG_CONSTRUCT;
+import static org.onosproject.yangutils.utils.UtilConstants.CURRENTLY_UNSUPPORTED;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.handleUnsupportedYangConstruct;
+
+/**
+ * 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;
+
+    /**
+     * Returns stack of parsable data.
+     *
+     * @return stack of parsable data
+     */
+    public Stack<Parsable> getParsedDataStack() {
+        return parsedDataStack;
+    }
+
+    /**
+     * Returns root node.
+     *
+     * @return rootNode of data model tree
+     */
+    public YangNode getRootNode() {
+        return rootNode;
+    }
+
+    /**
+     * Set parsed data stack.
+     *
+     * @param parsedDataStack stack of parsable data objects
+     */
+    public void setParsedDataStack(Stack<Parsable> parsedDataStack) {
+        this.parsedDataStack = parsedDataStack;
+    }
+
+    /**
+     * Set root node.
+     *
+     * @param rootNode root node of data model tree
+     */
+    public void setRootNode(YangNode rootNode) {
+        this.rootNode = rootNode;
+    }
+
+    @Override
+    public void enterYangfile(GeneratedYangParser.YangfileContext ctx) {
+        BaseFileListener.processYangFileEntry(this, ctx);
+    }
+
+    @Override
+    public void exitYangfile(GeneratedYangParser.YangfileContext ctx) {
+        BaseFileListener.processYangFileExit(this, ctx);
+    }
+
+    @Override
+    public void enterModuleStatement(GeneratedYangParser.ModuleStatementContext ctx) {
+        ModuleListener.processModuleEntry(this, ctx);
+    }
+
+    @Override
+    public void exitModuleStatement(GeneratedYangParser.ModuleStatementContext ctx) {
+        ModuleListener.processModuleExit(this, ctx);
+    }
+
+    @Override
+    public void enterModuleBody(GeneratedYangParser.ModuleBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitModuleBody(GeneratedYangParser.ModuleBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterModuleHeaderStatement(GeneratedYangParser.ModuleHeaderStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitModuleHeaderStatement(GeneratedYangParser.ModuleHeaderStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterLinkageStatements(GeneratedYangParser.LinkageStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitLinkageStatements(GeneratedYangParser.LinkageStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterMetaStatements(GeneratedYangParser.MetaStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitMetaStatements(GeneratedYangParser.MetaStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRevisionStatements(GeneratedYangParser.RevisionStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRevisionStatements(GeneratedYangParser.RevisionStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterBodyStatements(GeneratedYangParser.BodyStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitBodyStatements(GeneratedYangParser.BodyStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterYangVersionStatement(GeneratedYangParser.YangVersionStatementContext ctx) {
+        VersionListener.processVersionEntry(this, ctx);
+    }
+
+    @Override
+    public void exitYangVersionStatement(GeneratedYangParser.YangVersionStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterNamespaceStatement(GeneratedYangParser.NamespaceStatementContext ctx) {
+        NamespaceListener.processNamespaceEntry(this, ctx);
+    }
+
+    @Override
+    public void exitNamespaceStatement(GeneratedYangParser.NamespaceStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterPrefixStatement(GeneratedYangParser.PrefixStatementContext ctx) {
+        PrefixListener.processPrefixEntry(this, ctx);
+    }
+
+    @Override
+    public void exitPrefixStatement(GeneratedYangParser.PrefixStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterImportStatement(GeneratedYangParser.ImportStatementContext ctx) {
+        ImportListener.processImportEntry(this, ctx);
+    }
+
+    @Override
+    public void exitImportStatement(GeneratedYangParser.ImportStatementContext ctx) {
+        ImportListener.processImportExit(this, ctx);
+    }
+
+    @Override
+    public void enterImportStatementBody(GeneratedYangParser.ImportStatementBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitImportStatementBody(GeneratedYangParser.ImportStatementBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRevisionDateStatement(GeneratedYangParser.RevisionDateStatementContext ctx) {
+        RevisionDateListener.processRevisionDateEntry(this, ctx);
+    }
+
+    @Override
+    public void exitRevisionDateStatement(GeneratedYangParser.RevisionDateStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterIncludeStatement(GeneratedYangParser.IncludeStatementContext ctx) {
+        IncludeListener.processIncludeEntry(this, ctx);
+    }
+
+    @Override
+    public void exitIncludeStatement(GeneratedYangParser.IncludeStatementContext ctx) {
+        IncludeListener.processIncludeExit(this, ctx);
+    }
+
+    @Override
+    public void enterOrganizationStatement(GeneratedYangParser.OrganizationStatementContext ctx) {
+        OrganizationListener.processOrganizationEntry(this, ctx);
+    }
+
+    @Override
+    public void exitOrganizationStatement(GeneratedYangParser.OrganizationStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterContactStatement(GeneratedYangParser.ContactStatementContext ctx) {
+        ContactListener.processContactEntry(this, ctx);
+    }
+
+    @Override
+    public void exitContactStatement(GeneratedYangParser.ContactStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterDescriptionStatement(GeneratedYangParser.DescriptionStatementContext ctx) {
+        DescriptionListener.processDescriptionEntry(this, ctx);
+    }
+
+    @Override
+    public void exitDescriptionStatement(GeneratedYangParser.DescriptionStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterReferenceStatement(GeneratedYangParser.ReferenceStatementContext ctx) {
+        ReferenceListener.processReferenceEntry(this, ctx);
+    }
+
+    @Override
+    public void exitReferenceStatement(GeneratedYangParser.ReferenceStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRevisionStatement(GeneratedYangParser.RevisionStatementContext ctx) {
+        RevisionListener.processRevisionEntry(this, ctx);
+    }
+
+    @Override
+    public void exitRevisionStatement(GeneratedYangParser.RevisionStatementContext ctx) {
+        RevisionListener.processRevisionExit(this, ctx);
+    }
+
+    @Override
+    public void enterRevisionStatementBody(GeneratedYangParser.RevisionStatementBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRevisionStatementBody(GeneratedYangParser.RevisionStatementBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterSubModuleStatement(GeneratedYangParser.SubModuleStatementContext ctx) {
+        SubModuleListener.processSubModuleEntry(this, ctx);
+    }
+
+    @Override
+    public void exitSubModuleStatement(GeneratedYangParser.SubModuleStatementContext ctx) {
+        SubModuleListener.processSubModuleExit(this, ctx);
+    }
+
+    @Override
+    public void enterSubmoduleBody(GeneratedYangParser.SubmoduleBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitSubmoduleBody(GeneratedYangParser.SubmoduleBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterSubmoduleHeaderStatement(GeneratedYangParser.SubmoduleHeaderStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitSubmoduleHeaderStatement(GeneratedYangParser.SubmoduleHeaderStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterBelongstoStatement(GeneratedYangParser.BelongstoStatementContext ctx) {
+        BelongsToListener.processBelongsToEntry(this, ctx);
+    }
+
+    @Override
+    public void exitBelongstoStatement(GeneratedYangParser.BelongstoStatementContext ctx) {
+        BelongsToListener.processBelongsToExit(this, ctx);
+    }
+
+    @Override
+    public void enterBelongstoStatementBody(GeneratedYangParser.BelongstoStatementBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitBelongstoStatementBody(GeneratedYangParser.BelongstoStatementBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterExtensionStatement(GeneratedYangParser.ExtensionStatementContext ctx) {
+        handleUnsupportedYangConstruct(YangConstructType.EXTENSION_DATA, ctx, UNSUPPORTED_YANG_CONSTRUCT);
+    }
+
+    @Override
+    public void exitExtensionStatement(GeneratedYangParser.ExtensionStatementContext ctx) {
+        // do nothing
+    }
+
+    @Override
+    public void enterExtensionBody(GeneratedYangParser.ExtensionBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitExtensionBody(GeneratedYangParser.ExtensionBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterArgumentStatement(GeneratedYangParser.ArgumentStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitArgumentStatement(GeneratedYangParser.ArgumentStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterArgumentBody(GeneratedYangParser.ArgumentBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitArgumentBody(GeneratedYangParser.ArgumentBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterYinElementStatement(GeneratedYangParser.YinElementStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitYinElementStatement(GeneratedYangParser.YinElementStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterIdentityStatement(GeneratedYangParser.IdentityStatementContext ctx) {
+        handleUnsupportedYangConstruct(YangConstructType.IDENTITY_DATA, ctx, CURRENTLY_UNSUPPORTED);
+    }
+
+    @Override
+    public void exitIdentityStatement(GeneratedYangParser.IdentityStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterIdentityBody(GeneratedYangParser.IdentityBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitIdentityBody(GeneratedYangParser.IdentityBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterBaseStatement(GeneratedYangParser.BaseStatementContext ctx) {
+        handleUnsupportedYangConstruct(YangConstructType.BASE_DATA, ctx, CURRENTLY_UNSUPPORTED);
+    }
+
+    @Override
+    public void exitBaseStatement(GeneratedYangParser.BaseStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterFeatureStatement(GeneratedYangParser.FeatureStatementContext ctx) {
+        handleUnsupportedYangConstruct(YangConstructType.FEATURE_DATA, ctx, CURRENTLY_UNSUPPORTED);
+    }
+
+    @Override
+    public void exitFeatureStatement(GeneratedYangParser.FeatureStatementContext ctx) {
+        //TODO: to be implemented
+    }
+
+    @Override
+    public void enterFeatureBody(GeneratedYangParser.FeatureBodyContext ctx) {
+        //TODO : to be implemented
+    }
+
+    @Override
+    public void exitFeatureBody(GeneratedYangParser.FeatureBodyContext ctx) {
+        //TODO : to be implemented
+    }
+
+    @Override
+    public void enterDataDefStatement(GeneratedYangParser.DataDefStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitDataDefStatement(GeneratedYangParser.DataDefStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterIfFeatureStatement(GeneratedYangParser.IfFeatureStatementContext ctx) {
+        // TODO: to be implemented
+    }
+
+    @Override
+    public void exitIfFeatureStatement(GeneratedYangParser.IfFeatureStatementContext ctx) {
+        // TODO: to be implemented
+    }
+
+    @Override
+    public void enterUnitsStatement(GeneratedYangParser.UnitsStatementContext ctx) {
+        UnitsListener.processUnitsEntry(this, ctx);
+    }
+
+    @Override
+    public void exitUnitsStatement(GeneratedYangParser.UnitsStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterTypedefStatement(GeneratedYangParser.TypedefStatementContext ctx) {
+        TypeDefListener.processTypeDefEntry(this, ctx);
+    }
+
+    @Override
+    public void exitTypedefStatement(GeneratedYangParser.TypedefStatementContext ctx) {
+        TypeDefListener.processTypeDefExit(this, ctx);
+    }
+
+    @Override
+    public void enterTypeStatement(GeneratedYangParser.TypeStatementContext ctx) {
+        TypeListener.processTypeEntry(this, ctx);
+    }
+
+    @Override
+    public void exitTypeStatement(GeneratedYangParser.TypeStatementContext ctx) {
+        TypeListener.processTypeExit(this, ctx);
+    }
+
+    @Override
+    public void enterTypeBodyStatements(GeneratedYangParser.TypeBodyStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitTypeBodyStatements(GeneratedYangParser.TypeBodyStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterDecimal64Specification(GeneratedYangParser.Decimal64SpecificationContext ctx) {
+        // TODO: implement the method.
+    }
+
+    @Override
+    public void exitDecimal64Specification(GeneratedYangParser.Decimal64SpecificationContext ctx) {
+        // TODO: implement the method.
+    }
+
+    @Override
+    public void enterNumericalRestrictions(GeneratedYangParser.NumericalRestrictionsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitNumericalRestrictions(GeneratedYangParser.NumericalRestrictionsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRangeStatement(GeneratedYangParser.RangeStatementContext ctx) {
+        RangeRestrictionListener.processRangeRestrictionEntry(this, ctx);
+    }
+
+    @Override
+    public void exitRangeStatement(GeneratedYangParser.RangeStatementContext ctx) {
+        RangeRestrictionListener.processRangeRestrictionExit(this, ctx);
+    }
+
+    @Override
+    public void enterCommonStatements(GeneratedYangParser.CommonStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitCommonStatements(GeneratedYangParser.CommonStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterStringRestrictions(GeneratedYangParser.StringRestrictionsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitStringRestrictions(GeneratedYangParser.StringRestrictionsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterLengthStatement(GeneratedYangParser.LengthStatementContext ctx) {
+        LengthRestrictionListener.processLengthRestrictionEntry(this, ctx);
+    }
+
+    @Override
+    public void exitLengthStatement(GeneratedYangParser.LengthStatementContext ctx) {
+        LengthRestrictionListener.processLengthRestrictionExit(this, ctx);
+    }
+
+    @Override
+    public void enterPatternStatement(GeneratedYangParser.PatternStatementContext ctx) {
+        PatternRestrictionListener.processPatternRestrictionEntry(this, ctx);
+    }
+
+    @Override
+    public void exitPatternStatement(GeneratedYangParser.PatternStatementContext ctx) {
+        PatternRestrictionListener.processPatternRestrictionExit(this, ctx);
+    }
+
+    @Override
+    public void enterDefaultStatement(GeneratedYangParser.DefaultStatementContext ctx) {
+        DefaultListener.processDefaultEntry(this, ctx);
+    }
+
+    @Override
+    public void exitDefaultStatement(GeneratedYangParser.DefaultStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterEnumSpecification(GeneratedYangParser.EnumSpecificationContext ctx) {
+        EnumerationListener.processEnumerationEntry(this, ctx);
+    }
+
+    @Override
+    public void exitEnumSpecification(GeneratedYangParser.EnumSpecificationContext ctx) {
+        EnumerationListener.processEnumerationExit(this, ctx);
+    }
+
+    @Override
+    public void enterEnumStatement(GeneratedYangParser.EnumStatementContext ctx) {
+        EnumListener.processEnumEntry(this, ctx);
+    }
+
+    @Override
+    public void exitEnumStatement(GeneratedYangParser.EnumStatementContext ctx) {
+        EnumListener.processEnumExit(this, ctx);
+    }
+
+    @Override
+    public void enterEnumStatementBody(GeneratedYangParser.EnumStatementBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitEnumStatementBody(GeneratedYangParser.EnumStatementBodyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterLeafrefSpecification(GeneratedYangParser.LeafrefSpecificationContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitLeafrefSpecification(GeneratedYangParser.LeafrefSpecificationContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterPathStatement(GeneratedYangParser.PathStatementContext ctx) {
+        handleUnsupportedYangConstruct(YangConstructType.PATH_DATA, ctx, CURRENTLY_UNSUPPORTED);
+    }
+
+    @Override
+    public void exitPathStatement(GeneratedYangParser.PathStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRequireInstanceStatement(GeneratedYangParser.RequireInstanceStatementContext ctx) {
+        handleUnsupportedYangConstruct(YangConstructType.REQUIRE_INSTANCE_DATA, ctx, UNSUPPORTED_YANG_CONSTRUCT);
+    }
+
+    @Override
+    public void exitRequireInstanceStatement(GeneratedYangParser.RequireInstanceStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterInstanceIdentifierSpecification(GeneratedYangParser.InstanceIdentifierSpecificationContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitInstanceIdentifierSpecification(GeneratedYangParser.InstanceIdentifierSpecificationContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterIdentityrefSpecification(GeneratedYangParser.IdentityrefSpecificationContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitIdentityrefSpecification(GeneratedYangParser.IdentityrefSpecificationContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterUnionSpecification(GeneratedYangParser.UnionSpecificationContext ctx) {
+        UnionListener.processUnionEntry(this, ctx);
+    }
+
+    @Override
+    public void exitUnionSpecification(GeneratedYangParser.UnionSpecificationContext ctx) {
+        UnionListener.processUnionExit(this, ctx);
+    }
+
+    @Override
+    public void enterBitsSpecification(GeneratedYangParser.BitsSpecificationContext ctx) {
+        BitsListener.processBitsEntry(this, ctx);
+    }
+
+    @Override
+    public void exitBitsSpecification(GeneratedYangParser.BitsSpecificationContext ctx) {
+        BitsListener.processBitsExit(this, ctx);
+    }
+
+    @Override
+    public void enterBitStatement(GeneratedYangParser.BitStatementContext ctx) {
+        BitListener.processBitEntry(this, ctx);
+    }
+
+    @Override
+    public void exitBitStatement(GeneratedYangParser.BitStatementContext ctx) {
+        BitListener.processBitExit(this, ctx);
+    }
+
+    @Override
+    public void enterBitBodyStatement(GeneratedYangParser.BitBodyStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitBitBodyStatement(GeneratedYangParser.BitBodyStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterPositionStatement(GeneratedYangParser.PositionStatementContext ctx) {
+        PositionListener.processPositionEntry(this, ctx);
+    }
+
+    @Override
+    public void exitPositionStatement(GeneratedYangParser.PositionStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterStatusStatement(GeneratedYangParser.StatusStatementContext ctx) {
+        StatusListener.processStatusEntry(this, ctx);
+    }
+
+    @Override
+    public void exitStatusStatement(GeneratedYangParser.StatusStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterConfigStatement(GeneratedYangParser.ConfigStatementContext ctx) {
+        ConfigListener.processConfigEntry(this, ctx);
+    }
+
+    @Override
+    public void exitConfigStatement(GeneratedYangParser.ConfigStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterMandatoryStatement(GeneratedYangParser.MandatoryStatementContext ctx) {
+        MandatoryListener.processMandatoryEntry(this, ctx);
+    }
+
+    @Override
+    public void exitMandatoryStatement(GeneratedYangParser.MandatoryStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterPresenceStatement(GeneratedYangParser.PresenceStatementContext ctx) {
+        PresenceListener.processPresenceEntry(this, ctx);
+    }
+
+    @Override
+    public void exitPresenceStatement(GeneratedYangParser.PresenceStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterOrderedByStatement(GeneratedYangParser.OrderedByStatementContext ctx) {
+        handleUnsupportedYangConstruct(YangConstructType.ORDERED_BY_DATA, ctx, CURRENTLY_UNSUPPORTED);
+    }
+
+    @Override
+    public void exitOrderedByStatement(GeneratedYangParser.OrderedByStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterMustStatement(GeneratedYangParser.MustStatementContext ctx) {
+        // TODO: to be implemented
+    }
+
+    @Override
+    public void exitMustStatement(GeneratedYangParser.MustStatementContext ctx) {
+        // TODO: to be implemented
+    }
+
+    @Override
+    public void enterErrorMessageStatement(GeneratedYangParser.ErrorMessageStatementContext ctx) {
+        handleUnsupportedYangConstruct(YangConstructType.ERROR_MESSAGE_DATA, ctx, CURRENTLY_UNSUPPORTED);
+    }
+
+    @Override
+    public void exitErrorMessageStatement(GeneratedYangParser.ErrorMessageStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterErrorAppTagStatement(GeneratedYangParser.ErrorAppTagStatementContext ctx) {
+        handleUnsupportedYangConstruct(YangConstructType.ERROR_APP_TAG_DATA, ctx, CURRENTLY_UNSUPPORTED);
+    }
+
+    @Override
+    public void exitErrorAppTagStatement(GeneratedYangParser.ErrorAppTagStatementContext ctx) {
+        //do nothing
+    }
+
+    @Override
+    public void enterMinElementsStatement(GeneratedYangParser.MinElementsStatementContext ctx) {
+        MinElementsListener.processMinElementsEntry(this, ctx);
+    }
+
+    @Override
+    public void exitMinElementsStatement(GeneratedYangParser.MinElementsStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterMaxElementsStatement(GeneratedYangParser.MaxElementsStatementContext ctx) {
+        MaxElementsListener.processMaxElementsEntry(this, ctx);
+    }
+
+    @Override
+    public void exitMaxElementsStatement(GeneratedYangParser.MaxElementsStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterValueStatement(GeneratedYangParser.ValueStatementContext ctx) {
+        ValueListener.processValueEntry(this, ctx);
+    }
+
+    @Override
+    public void exitValueStatement(GeneratedYangParser.ValueStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterGroupingStatement(GeneratedYangParser.GroupingStatementContext ctx) {
+        GroupingListener.processGroupingEntry(this, ctx);
+    }
+
+    @Override
+    public void exitGroupingStatement(GeneratedYangParser.GroupingStatementContext ctx) {
+        GroupingListener.processGroupingExit(this, ctx);
+    }
+
+    @Override
+    public void enterContainerStatement(GeneratedYangParser.ContainerStatementContext ctx) {
+        ContainerListener.processContainerEntry(this, ctx);
+    }
+
+    @Override
+    public void exitContainerStatement(GeneratedYangParser.ContainerStatementContext ctx) {
+        ContainerListener.processContainerExit(this, ctx);
+    }
+
+    @Override
+    public void enterLeafStatement(GeneratedYangParser.LeafStatementContext ctx) {
+        LeafListener.processLeafEntry(this, ctx);
+    }
+
+    @Override
+    public void exitLeafStatement(GeneratedYangParser.LeafStatementContext ctx) {
+        LeafListener.processLeafExit(this, ctx);
+    }
+
+    @Override
+    public void enterLeafListStatement(GeneratedYangParser.LeafListStatementContext ctx) {
+        LeafListListener.processLeafListEntry(this, ctx);
+    }
+
+    @Override
+    public void exitLeafListStatement(GeneratedYangParser.LeafListStatementContext ctx) {
+        LeafListListener.processLeafListExit(this, ctx);
+    }
+
+    @Override
+    public void enterListStatement(GeneratedYangParser.ListStatementContext ctx) {
+        ListListener.processListEntry(this, ctx);
+    }
+
+    @Override
+    public void exitListStatement(GeneratedYangParser.ListStatementContext ctx) {
+        ListListener.processListExit(this, ctx);
+    }
+
+    @Override
+    public void enterKeyStatement(GeneratedYangParser.KeyStatementContext ctx) {
+        KeyListener.processKeyEntry(this, ctx);
+    }
+
+    @Override
+    public void exitKeyStatement(GeneratedYangParser.KeyStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterUniqueStatement(GeneratedYangParser.UniqueStatementContext ctx) {
+        handleUnsupportedYangConstruct(YangConstructType.UNIQUE_DATA, ctx, CURRENTLY_UNSUPPORTED);
+    }
+
+    @Override
+    public void exitUniqueStatement(GeneratedYangParser.UniqueStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterChoiceStatement(GeneratedYangParser.ChoiceStatementContext ctx) {
+        ChoiceListener.processChoiceEntry(this, ctx);
+    }
+
+    @Override
+    public void exitChoiceStatement(GeneratedYangParser.ChoiceStatementContext ctx) {
+        ChoiceListener.processChoiceExit(this, ctx);
+    }
+
+    @Override
+    public void enterShortCaseStatement(GeneratedYangParser.ShortCaseStatementContext ctx) {
+        ShortCaseListener.processShortCaseEntry(this, ctx);
+    }
+
+    @Override
+    public void exitShortCaseStatement(GeneratedYangParser.ShortCaseStatementContext ctx) {
+        ShortCaseListener.processShortCaseExit(this, ctx);
+    }
+
+    @Override
+    public void enterCaseStatement(GeneratedYangParser.CaseStatementContext ctx) {
+        CaseListener.processCaseEntry(this, ctx);
+    }
+
+    @Override
+    public void exitCaseStatement(GeneratedYangParser.CaseStatementContext ctx) {
+        CaseListener.processCaseExit(this, ctx);
+    }
+
+    @Override
+    public void enterAnyxmlStatement(GeneratedYangParser.AnyxmlStatementContext ctx) {
+        handleUnsupportedYangConstruct(YangConstructType.ANYXML_DATA, ctx, UNSUPPORTED_YANG_CONSTRUCT);
+    }
+
+    @Override
+    public void exitAnyxmlStatement(GeneratedYangParser.AnyxmlStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterUsesStatement(GeneratedYangParser.UsesStatementContext ctx) {
+        UsesListener.processUsesEntry(this, ctx);
+    }
+
+    @Override
+    public void exitUsesStatement(GeneratedYangParser.UsesStatementContext ctx) {
+        UsesListener.processUsesExit(this, ctx);
+    }
+
+    @Override
+    public void enterRefineStatement(GeneratedYangParser.RefineStatementContext ctx) {
+        handleUnsupportedYangConstruct(YangConstructType.REFINE_DATA, ctx, UNSUPPORTED_YANG_CONSTRUCT);
+    }
+
+    @Override
+    public void exitRefineStatement(GeneratedYangParser.RefineStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRefineContainerStatements(GeneratedYangParser.RefineContainerStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRefineContainerStatements(GeneratedYangParser.RefineContainerStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRefineLeafStatements(GeneratedYangParser.RefineLeafStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRefineLeafStatements(GeneratedYangParser.RefineLeafStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRefineLeafListStatements(GeneratedYangParser.RefineLeafListStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRefineLeafListStatements(GeneratedYangParser.RefineLeafListStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRefineListStatements(GeneratedYangParser.RefineListStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRefineListStatements(GeneratedYangParser.RefineListStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRefineChoiceStatements(GeneratedYangParser.RefineChoiceStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRefineChoiceStatements(GeneratedYangParser.RefineChoiceStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRefineCaseStatements(GeneratedYangParser.RefineCaseStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRefineCaseStatements(GeneratedYangParser.RefineCaseStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRefineAnyxmlStatements(GeneratedYangParser.RefineAnyxmlStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRefineAnyxmlStatements(GeneratedYangParser.RefineAnyxmlStatementsContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterAugmentStatement(GeneratedYangParser.AugmentStatementContext ctx) {
+        AugmentListener.processAugmentEntry(this, ctx);
+    }
+
+    @Override
+    public void exitAugmentStatement(GeneratedYangParser.AugmentStatementContext ctx) {
+        AugmentListener.processAugmentExit(this, ctx);
+    }
+
+    @Override
+    public void enterWhenStatement(GeneratedYangParser.WhenStatementContext ctx) {
+        // TODO: to be implemented
+    }
+
+    @Override
+    public void exitWhenStatement(GeneratedYangParser.WhenStatementContext ctx) {
+        // TODO: to be implemented
+    }
+
+    @Override
+    public void enterRpcStatement(GeneratedYangParser.RpcStatementContext ctx) {
+        RpcListener.processRpcEntry(this, ctx);
+    }
+
+    @Override
+    public void exitRpcStatement(GeneratedYangParser.RpcStatementContext ctx) {
+        RpcListener.processRpcExit(this, ctx);
+    }
+
+    @Override
+    public void enterInputStatement(GeneratedYangParser.InputStatementContext ctx) {
+        InputListener.processInputEntry(this, ctx);
+    }
+
+    @Override
+    public void exitInputStatement(GeneratedYangParser.InputStatementContext ctx) {
+        InputListener.processInputExit(this, ctx);
+    }
+
+    @Override
+    public void enterOutputStatement(GeneratedYangParser.OutputStatementContext ctx) {
+        OutputListener.processOutputEntry(this, ctx);
+    }
+
+    @Override
+    public void exitOutputStatement(GeneratedYangParser.OutputStatementContext ctx) {
+        OutputListener.processOutputExit(this, ctx);
+    }
+
+    @Override
+    public void enterNotificationStatement(GeneratedYangParser.NotificationStatementContext ctx) {
+        NotificationListener.processNotificationEntry(this, ctx);
+    }
+
+    @Override
+    public void exitNotificationStatement(GeneratedYangParser.NotificationStatementContext ctx) {
+        NotificationListener.processNotificationExit(this, ctx);
+    }
+
+    @Override
+    public void enterDeviationStatement(GeneratedYangParser.DeviationStatementContext ctx) {
+        handleUnsupportedYangConstruct(YangConstructType.DEVIATION_DATA, ctx, UNSUPPORTED_YANG_CONSTRUCT);
+    }
+
+    @Override
+    public void exitDeviationStatement(GeneratedYangParser.DeviationStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterDeviateNotSupportedStatement(GeneratedYangParser.DeviateNotSupportedStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitDeviateNotSupportedStatement(GeneratedYangParser.DeviateNotSupportedStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterDeviateAddStatement(GeneratedYangParser.DeviateAddStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitDeviateAddStatement(GeneratedYangParser.DeviateAddStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterDeviateDeleteStatement(GeneratedYangParser.DeviateDeleteStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitDeviateDeleteStatement(GeneratedYangParser.DeviateDeleteStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterDeviateReplaceStatement(GeneratedYangParser.DeviateReplaceStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitDeviateReplaceStatement(GeneratedYangParser.DeviateReplaceStatementContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterString(GeneratedYangParser.StringContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitString(GeneratedYangParser.StringContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterIdentifier(GeneratedYangParser.IdentifierContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitIdentifier(GeneratedYangParser.IdentifierContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterDateArgumentString(GeneratedYangParser.DateArgumentStringContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitDateArgumentString(GeneratedYangParser.DateArgumentStringContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRange(GeneratedYangParser.RangeContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRange(GeneratedYangParser.RangeContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterLength(GeneratedYangParser.LengthContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitLength(GeneratedYangParser.LengthContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterPath(GeneratedYangParser.PathContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitPath(GeneratedYangParser.PathContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterPosition(GeneratedYangParser.PositionContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitPosition(GeneratedYangParser.PositionContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterStatus(GeneratedYangParser.StatusContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitStatus(GeneratedYangParser.StatusContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterConfig(GeneratedYangParser.ConfigContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitConfig(GeneratedYangParser.ConfigContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterMandatory(GeneratedYangParser.MandatoryContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitMandatory(GeneratedYangParser.MandatoryContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterOrderedBy(GeneratedYangParser.OrderedByContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitOrderedBy(GeneratedYangParser.OrderedByContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterMinValue(GeneratedYangParser.MinValueContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitMinValue(GeneratedYangParser.MinValueContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterMaxValue(GeneratedYangParser.MaxValueContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitMaxValue(GeneratedYangParser.MaxValueContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterKey(GeneratedYangParser.KeyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitKey(GeneratedYangParser.KeyContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterUnique(GeneratedYangParser.UniqueContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitUnique(GeneratedYangParser.UniqueContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterRefine(GeneratedYangParser.RefineContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitRefine(GeneratedYangParser.RefineContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterAugment(GeneratedYangParser.AugmentContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitAugment(GeneratedYangParser.AugmentContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterDeviation(GeneratedYangParser.DeviationContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitDeviation(GeneratedYangParser.DeviationContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterYangConstruct(GeneratedYangParser.YangConstructContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitYangConstruct(GeneratedYangParser.YangConstructContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterVersion(GeneratedYangParser.VersionContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitVersion(GeneratedYangParser.VersionContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterValue(GeneratedYangParser.ValueContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void exitValue(GeneratedYangParser.ValueContext ctx) {
+        // do nothing.
+    }
+
+    @Override
+    public void enterFraction(GeneratedYangParser.FractionContext ctx) {
+        // TODO: implement the method.
+    }
+
+    @Override
+    public void exitFraction(GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/YangUtilsParserManager.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/YangUtilsParserManager.java
new file mode 100644
index 0000000..6a5b1d2
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/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.yangutils.parser.impl;
+
+import java.io.IOException;
+
+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.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.parser.YangUtilsParser;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangLexer;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.parserutils.ParseTreeErrorListener;
+
+/**
+ * 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.");
+        }
+
+        // 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();
+
+        /**
+         * 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();
+    }
+}
\ No newline at end of file
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/AugmentListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/AugmentListener.java
new file mode 100644
index 0000000..b6172ed
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/AugmentListener.java
@@ -0,0 +1,211 @@
+/*
+ * 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.yangutils.parser.impl.listeners;
+
+import java.util.List;
+
+import org.onosproject.yangutils.datamodel.YangAugment;
+import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.YangNodeIdentifier;
+import org.onosproject.yangutils.datamodel.YangSubModule;
+import org.onosproject.yangutils.datamodel.YangUses;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.AUGMENT_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.CASE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.DATA_DEF_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.WHEN_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.AugmentListenerUtil.generateNameForAugmentNode;
+import static org.onosproject.yangutils.parser.impl.parserutils.AugmentListenerUtil.getParentsPrefix;
+import static org.onosproject.yangutils.parser.impl.parserutils.AugmentListenerUtil.parserException;
+import static org.onosproject.yangutils.parser.impl.parserutils.AugmentListenerUtil.validateNodeInTargetPath;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerCollisionDetector.detectCollidingChildUtil;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction
+        .constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction
+        .constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidAbsoluteSchemaNodeId;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateMutuallyExclusiveChilds;
+import static org.onosproject.yangutils.translator.tojava.YangDataModelFactory.getYangAugmentNode;
+
+/*
+ * 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 {
+
+    /**
+     * Creates a new augment listener.
+     */
+    private AugmentListener() {
+    }
+
+    /**
+     * It is called 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 of the grammar rule
+     */
+    public static void processAugmentEntry(TreeWalkListener listener,
+            GeneratedYangParser.AugmentStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, AUGMENT_DATA, ctx.augment().getText(), ENTRY);
+
+        // Validate augment argument string
+        List<YangNodeIdentifier> targetNodes = getValidAbsoluteSchemaNodeId(ctx.augment().getText(),
+                AUGMENT_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, "", AUGMENT_DATA);
+
+        Parsable curData = listener.getParsedDataStack().peek();
+        if (curData instanceof YangModule || curData instanceof YangSubModule || curData instanceof YangUses) {
+            YangNode curNode = (YangNode) curData;
+            YangAugment yangAugment = getYangAugmentNode(JAVA_GENERATION);
+
+            //validateTargetNodePath(targetNodes, curNode, ctx);
+            // TODO: handle in linker.
+
+            yangAugment.setTargetNode(targetNodes);
+            yangAugment.setName(generateNameForAugmentNode(curData, targetNodes, listener));
+
+            try {
+                curNode.addChild(yangAugment);
+            } catch (DataModelException e) {
+                throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                        AUGMENT_DATA, ctx.augment().getText(), ENTRY, e.getMessage()));
+            }
+            listener.getParsedDataStack().push(yangAugment);
+        } else {
+            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, AUGMENT_DATA,
+                    ctx.augment().getText(), ENTRY));
+        }
+
+    }
+
+    /**
+     * It is called when parser exits from grammar rule (augment), 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 processAugmentExit(TreeWalkListener listener,
+            GeneratedYangParser.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 of the grammar rule
+     */
+    private static void validateSubStatementsCardinality(GeneratedYangParser.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());
+        validateMutuallyExclusiveChilds(ctx.dataDefStatement(), DATA_DEF_DATA, ctx.caseStatement(),
+                CASE_DATA, AUGMENT_DATA, ctx.augment().getText());
+    }
+
+    /**
+     * Validates whether the current target node path is correct or not.
+     *
+     * @param targetNodes list of target nodes
+     * @param curNode current Node
+     * @param ctx augment context
+     * @param curNode current YANG node
+     */
+    private static void validateTargetNodePath(List<YangNodeIdentifier> targetNodes, YangNode curNode,
+            GeneratedYangParser.AugmentStatementContext ctx) {
+
+        YangNodeIdentifier moduleId = targetNodes.get(0);
+        if (moduleId.getPrefix() == null) {
+            if (!moduleId.getName().equals(curNode.getName())) {
+                throw parserException(ctx);
+            } else {
+                //validateNodeInTargetPath(curNode, targetNodes, ctx);
+                // TODO: handle in linker.
+            }
+        } else {
+            String parentPrefix = getParentsPrefix(curNode);
+            if (parentPrefix != null) {
+                if (!parentPrefix.equals(moduleId.getPrefix())) {
+                    // TODO: handle in linker.
+                } else {
+                    validateNodeInTargetPath(curNode, targetNodes, ctx);
+                }
+            } else {
+                // TODO: handle in linker.
+            }
+        }
+    }
+}
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BaseFileListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BaseFileListener.java
new file mode 100644
index 0000000..8ba4d02
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BaseFileListener.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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.YangSubModule;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.YANGBASE_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_CHILD;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsEmpty;
+import static org.onosproject.yangutils.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, GeneratedYangParser.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, GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BelongsToListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BelongsToListener.java
new file mode 100644
index 0000000..ab12d46
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BelongsToListener.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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangBelongsTo;
+import org.onosproject.yangutils.datamodel.YangSubModule;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.BELONGS_TO_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yangutils.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,
+                                             GeneratedYangParser.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);
+
+        // 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,
+                                            GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BitListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BitListener.java
new file mode 100644
index 0000000..39084e0
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BitListener.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.yangutils.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.yangutils.datamodel.YangBit;
+import org.onosproject.yangutils.datamodel.YangBits;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.BIT_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_CONTENT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.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);
+        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 (YangBit curBit : yangBits.getBitSet()) {
+                            if (maxPosition <= curBit.getPosition()) {
+                                maxPosition = curBit.getPosition();
+                                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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BitsListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BitsListener.java
new file mode 100644
index 0000000..c53a516
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BitsListener.java
@@ -0,0 +1,161 @@
+/*
+ * 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.yangutils.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.yangutils.datamodel.YangBits;
+import org.onosproject.yangutils.datamodel.YangLeaf;
+import org.onosproject.yangutils.datamodel.YangLeafList;
+import org.onosproject.yangutils.datamodel.YangType;
+import org.onosproject.yangutils.datamodel.YangTypeDef;
+import org.onosproject.yangutils.datamodel.YangUnion;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.BITS_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPE_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.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,
+            GeneratedYangParser.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();
+            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,
+            GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/CaseListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/CaseListener.java
new file mode 100644
index 0000000..5aa1dcd
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/CaseListener.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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangCase;
+import org.onosproject.yangutils.datamodel.YangChoice;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.CASE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.WHEN_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerCollisionDetector.detectCollidingChildUtil;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yangutils.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) {
+            YangCase caseNode = getYangCaseNode(JAVA_GENERATION);
+            caseNode.setName(identifier);
+            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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ChoiceListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ChoiceListener.java
new file mode 100644
index 0000000..61c2df1
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ChoiceListener.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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangAugment;
+import org.onosproject.yangutils.datamodel.YangCase;
+import org.onosproject.yangutils.datamodel.YangChoice;
+import org.onosproject.yangutils.datamodel.YangContainer;
+import org.onosproject.yangutils.datamodel.YangGrouping;
+import org.onosproject.yangutils.datamodel.YangInput;
+import org.onosproject.yangutils.datamodel.YangList;
+import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.YangNotification;
+import org.onosproject.yangutils.datamodel.YangOutput;
+import org.onosproject.yangutils.datamodel.YangSubModule;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.CASE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.CHOICE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.CONFIG_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.DEFAULT_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.MANDATORY_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.SHORT_CASE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.WHEN_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerCollisionDetector.detectCollidingChildUtil;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateMutuallyExclusiveChilds;
+import static org.onosproject.yangutils.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,
+            GeneratedYangParser.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);
+
+            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,
+            GeneratedYangParser.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) {
+            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(GeneratedYangParser.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());
+        validateMutuallyExclusiveChilds(ctx.shortCaseStatement(), SHORT_CASE_DATA, ctx.caseStatement(), CASE_DATA,
+                CHOICE_DATA, ctx.identifier().getText());
+    }
+}
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ConfigListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ConfigListener.java
new file mode 100644
index 0000000..d595cb0
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ConfigListener.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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangContainer;
+import org.onosproject.yangutils.datamodel.YangLeaf;
+import org.onosproject.yangutils.datamodel.YangLeafList;
+import org.onosproject.yangutils.datamodel.YangList;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.CONFIG_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidBooleanValue;
+import static org.onosproject.yangutils.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ContactListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ContactListener.java
new file mode 100644
index 0000000..4cab95d
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangSubModule;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.CONTACT_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.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, GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ContainerListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ContainerListener.java
new file mode 100644
index 0000000..9ed3e76
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ContainerListener.java
@@ -0,0 +1,199 @@
+/*
+ * 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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangAugment;
+import org.onosproject.yangutils.datamodel.YangCase;
+import org.onosproject.yangutils.datamodel.YangContainer;
+import org.onosproject.yangutils.datamodel.YangGrouping;
+import org.onosproject.yangutils.datamodel.YangInput;
+import org.onosproject.yangutils.datamodel.YangList;
+import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.YangNotification;
+import org.onosproject.yangutils.datamodel.YangOutput;
+import org.onosproject.yangutils.datamodel.YangSubModule;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+import org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation;
+
+import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.CONFIG_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.CONTAINER_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.PRESENCE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerCollisionDetector.detectCollidingChildUtil;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction
+        .constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction
+        .constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yangutils.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,
+            GeneratedYangParser.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);
+
+        /*
+         * 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);
+            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,
+            GeneratedYangParser.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) {
+                throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                        CONTAINER_DATA, ctx.identifier().getText(), EXIT, e.getMessage()));
+            }
+            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(GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/DefaultListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/DefaultListener.java
new file mode 100644
index 0000000..e07895f
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/DefaultListener.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.yangutils.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.yangutils.datamodel.YangChoice;
+import org.onosproject.yangutils.datamodel.YangLeaf;
+import org.onosproject.yangutils.datamodel.YangTypeDef;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.DEFAULT_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.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,
+            GeneratedYangParser.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(ctx.string().getText());
+                break;
+            }
+            case LEAF_DATA: {
+                YangLeaf leaf = (YangLeaf) tmpNode;
+                leaf.setDefaultValueInString(ctx.string().getText());
+                break;
+            }
+            case CHOICE_DATA: {
+                YangChoice choice = (YangChoice) tmpNode;
+                choice.setDefaultValueInString(ctx.string().getText());
+                break;
+            }
+            default:
+                throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER,
+                        DEFAULT_DATA, ctx.string().getText(), ENTRY));
+        }
+    }
+}
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/DescriptionListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/DescriptionListener.java
new file mode 100644
index 0000000..c7988a8
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangDesc;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.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,
+            GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumListener.java
new file mode 100644
index 0000000..9cfc5aa
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumListener.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.yangutils.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.yangutils.datamodel.YangEnum;
+import org.onosproject.yangutils.datamodel.YangEnumeration;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.ENUM_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.DUPLICATE_ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.utils.UtilConstants.QUOTES;
+import static org.onosproject.yangutils.utils.UtilConstants.EMPTY_STRING;
+
+/**
+ * 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, GeneratedYangParser.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()));
+        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, GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumerationListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumerationListener.java
new file mode 100644
index 0000000..2db40f3
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumerationListener.java
@@ -0,0 +1,225 @@
+/*
+ * 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.yangutils.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.yangutils.datamodel.YangEnumeration;
+import org.onosproject.yangutils.datamodel.YangLeaf;
+import org.onosproject.yangutils.datamodel.YangLeafList;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.YangType;
+import org.onosproject.yangutils.datamodel.YangTypeDef;
+import org.onosproject.yangutils.datamodel.YangUnion;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.datamodel.utils.YangConstructType;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.ENUMERATION_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPE_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.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,
+            GeneratedYangParser.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);
+            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,
+            GeneratedYangParser.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,
+                        YangConstructType.ENUMERATION_DATA, "", ENTRY, e.getMessage()));
+            }
+        }
+    }
+}
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/GroupingListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/GroupingListener.java
new file mode 100644
index 0000000..5171e2f
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/GroupingListener.java
@@ -0,0 +1,174 @@
+/*
+ * 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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangContainer;
+import org.onosproject.yangutils.datamodel.YangGrouping;
+import org.onosproject.yangutils.datamodel.YangInput;
+import org.onosproject.yangutils.datamodel.YangList;
+import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.YangNotification;
+import org.onosproject.yangutils.datamodel.YangOutput;
+import org.onosproject.yangutils.datamodel.YangRpc;
+import org.onosproject.yangutils.datamodel.YangSubModule;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.GROUPING_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPEDEF_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerCollisionDetector.detectCollidingChildUtil;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateMutuallyExclusiveChilds;
+import static org.onosproject.yangutils.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,
+                                        GeneratedYangParser.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);
+
+        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);
+
+            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,
+                                         GeneratedYangParser.GroupingStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, GROUPING_DATA, ctx.identifier().getText(), EXIT);
+
+        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(GeneratedYangParser.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());
+        validateMutuallyExclusiveChilds(ctx.typedefStatement(), TYPEDEF_DATA, ctx.groupingStatement(), GROUPING_DATA,
+                GROUPING_DATA, ctx.identifier().getText());
+    }
+}
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ImportListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ImportListener.java
new file mode 100644
index 0000000..76a2e30
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ImportListener.java
@@ -0,0 +1,140 @@
+/*
+ * 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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangImport;
+import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangSubModule;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.IMPORT_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yangutils.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, GeneratedYangParser.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);
+
+        // 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, GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/IncludeListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/IncludeListener.java
new file mode 100644
index 0000000..847712f
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/IncludeListener.java
@@ -0,0 +1,139 @@
+/*
+ * 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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangInclude;
+import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangSubModule;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.INCLUDE_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yangutils.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, GeneratedYangParser.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);
+
+        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, GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/InputListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/InputListener.java
new file mode 100644
index 0000000..92e61f8
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/InputListener.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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangInput;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.YangRpc;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.INPUT_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction
+        .constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction
+        .constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.translator.tojava.YangDataModelFactory.getYangInputNode;
+
+/*
+ * 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 {
+
+    private static final String INPUT_KEYWORD = "_input";
+
+    /**
+     * 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,
+            GeneratedYangParser.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(((YangRpc) curData).getName() + INPUT_KEYWORD);
+            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,
+            GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/KeyListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/KeyListener.java
new file mode 100644
index 0000000..889de0a
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/KeyListener.java
@@ -0,0 +1,99 @@
+/*
+ * 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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangList;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.KEY_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.removeQuotesAndHandleConcat;
+import static org.onosproject.yangutils.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,
+            GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LeafListListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LeafListListener.java
new file mode 100644
index 0000000..6d3a97e
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LeafListListener.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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangLeafList;
+import org.onosproject.yangutils.datamodel.YangLeavesHolder;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.CONFIG_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.LEAF_LIST_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.MAX_ELEMENT_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.MIN_ELEMENT_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.UNITS_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerCollisionDetector.detectCollidingChildUtil;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction
+        .constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityEqualsOne;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yangutils.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,
+            GeneratedYangParser.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.setLeafName(identifier);
+
+        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,
+            GeneratedYangParser.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(GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LeafListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LeafListener.java
new file mode 100644
index 0000000..7b5ac34
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LeafListener.java
@@ -0,0 +1,169 @@
+/*
+ * 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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangLeaf;
+import org.onosproject.yangutils.datamodel.YangLeavesHolder;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.CONFIG_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.LEAF_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.MANDATORY_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.UNITS_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerCollisionDetector.detectCollidingChildUtil;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction
+        .constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityEqualsOne;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yangutils.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,
+            GeneratedYangParser.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.setLeafName(identifier);
+
+        Parsable tmpData = listener.getParsedDataStack().peek();
+        YangLeavesHolder leavesHolder;
+
+        if (tmpData instanceof YangLeavesHolder) {
+            leavesHolder = (YangLeavesHolder) tmpData;
+            leavesHolder.addLeaf(leaf);
+            leaf.setContainedIn(leavesHolder);
+        } 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,
+            GeneratedYangParser.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) {
+            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(GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LengthRestrictionListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LengthRestrictionListener.java
new file mode 100644
index 0000000..bf8c6b0
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LengthRestrictionListener.java
@@ -0,0 +1,179 @@
+/*
+ * 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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangDerivedInfo;
+import org.onosproject.yangutils.datamodel.YangRangeRestriction;
+import org.onosproject.yangutils.datamodel.YangStringRestriction;
+import org.onosproject.yangutils.datamodel.YangType;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.datamodel.utils.YangConstructType;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.YangDataTypes.BINARY;
+import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED;
+import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING;
+import static org.onosproject.yangutils.datamodel.utils.RestrictionResolver.processLengthRestriction;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.LENGTH_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPE_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.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 : " +
+                    YangConstructType.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());
+        } 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();
+                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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ListListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ListListener.java
new file mode 100644
index 0000000..d0e7300
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ListListener.java
@@ -0,0 +1,205 @@
+/*
+ * 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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangAugment;
+import org.onosproject.yangutils.datamodel.YangCase;
+import org.onosproject.yangutils.datamodel.YangContainer;
+import org.onosproject.yangutils.datamodel.YangGrouping;
+import org.onosproject.yangutils.datamodel.YangInput;
+import org.onosproject.yangutils.datamodel.YangList;
+import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.YangNotification;
+import org.onosproject.yangutils.datamodel.YangOutput;
+import org.onosproject.yangutils.datamodel.YangSubModule;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+import org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation;
+
+import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.CONFIG_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.DATA_DEF_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.KEY_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.LIST_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.MAX_ELEMENT_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.MIN_ELEMENT_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerCollisionDetector.detectCollidingChildUtil;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityNonZero;
+import static org.onosproject.yangutils.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,
+            GeneratedYangParser.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);
+
+        /*
+         * 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);
+            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,
+            GeneratedYangParser.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();
+            } catch (DataModelException e) {
+                throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                        LIST_DATA, ctx.identifier().getText(), EXIT, e.getMessage()));
+            }
+            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(GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/MandatoryListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/MandatoryListener.java
new file mode 100644
index 0000000..b945f81
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangLeaf;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.MANDATORY_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidBooleanValue;
+import static org.onosproject.yangutils.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,
+                                          GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/MaxElementsListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/MaxElementsListener.java
new file mode 100644
index 0000000..afb6dc3
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/MaxElementsListener.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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangLeafList;
+import org.onosproject.yangutils.datamodel.YangList;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.datamodel.utils.YangConstructType;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.MAX_ELEMENT_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.removeQuotesAndHandleConcat;
+import static org.onosproject.yangutils.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,
+            GeneratedYangParser.MaxElementsStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, MAX_ELEMENT_DATA, "", ENTRY);
+
+        int maxElementsValue = getValidMaxElementValue(ctx);
+
+        Parsable tmpData = listener.getParsedDataStack().peek();
+        switch (tmpData.getYangConstructType()) {
+            case LEAF_LIST_DATA:
+                YangLeafList leafList = (YangLeafList) tmpData;
+                leafList.setMaxElelements(maxElementsValue);
+                break;
+            case LIST_DATA:
+                YangList yangList = (YangList) tmpData;
+                yangList.setMaxElements(maxElementsValue);
+                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(GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/MinElementsListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/MinElementsListener.java
new file mode 100644
index 0000000..7553aa2
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/MinElementsListener.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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangLeafList;
+import org.onosproject.yangutils.datamodel.YangList;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.MIN_ELEMENT_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidNonNegativeIntegerValue;
+import static org.onosproject.yangutils.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,
+                                               GeneratedYangParser.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);
+
+        Parsable tmpData = listener.getParsedDataStack().peek();
+        switch (tmpData.getYangConstructType()) {
+            case LEAF_LIST_DATA:
+                YangLeafList leafList = (YangLeafList) tmpData;
+                leafList.setMinElements(minElementValue);
+                break;
+            case LIST_DATA:
+                YangList yangList = (YangList) tmpData;
+                yangList.setMinElements(minElementValue);
+                break;
+            default:
+                throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, MIN_ELEMENT_DATA,
+                        ctx.minValue().getText(), ENTRY));
+        }
+    }
+}
\ No newline at end of file
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ModuleListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ModuleListener.java
new file mode 100644
index 0000000..ef1af2d
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ModuleListener.java
@@ -0,0 +1,132 @@
+/*
+ * 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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.ResolvableType;
+import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangReferenceResolver;
+import org.onosproject.yangutils.datamodel.YangRevision;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.linker.exceptions.LinkerException;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.MODULE_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.setCurrentDateForRevision;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsEmpty;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.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, GeneratedYangParser.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);
+
+        if (ctx.moduleBody().moduleHeaderStatement().yangVersionStatement() == null) {
+            yangModule.setVersion((byte) 1);
+        }
+
+        if (ctx.moduleBody().revisionStatements().revisionStatement().isEmpty()) {
+            String currentDate = setCurrentDateForRevision();
+            YangRevision currentRevision = new YangRevision();
+            currentRevision.setRevDate(currentDate);
+            yangModule.setRevision(currentRevision);
+        }
+
+        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, GeneratedYangParser.ModuleStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, MODULE_DATA, ctx.identifier().getText(), EXIT);
+
+        if (!(listener.getParsedDataStack().peek() instanceof YangModule)) {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, MODULE_DATA,
+                    ctx.identifier().getText(), EXIT));
+        }
+        try {
+            ((YangReferenceResolver) listener.getParsedDataStack()
+                    .peek()).resolveSelfFileLinking(ResolvableType.YANG_USES);
+            ((YangReferenceResolver) listener.getParsedDataStack()
+                    .peek()).resolveSelfFileLinking(ResolvableType.YANG_DERIVED_DATA_TYPE);
+        } catch (DataModelException e) {
+            LinkerException linkerException = new LinkerException(e.getMessage());
+            linkerException.setLine(e.getLineNumber());
+            linkerException.setCharPosition(e.getCharPositionInLine());
+            throw linkerException;
+        }
+    }
+}
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/NamespaceListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/NamespaceListener.java
new file mode 100644
index 0000000..f32a4ed
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/NamespaceListener.java
@@ -0,0 +1,120 @@
+/*
+ * 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.yangutils.parser.impl.listeners;
+
+import java.net.URI;
+
+import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangNameSpace;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.NAMESPACE_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.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,
+            GeneratedYangParser.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;
+                YangNameSpace uri = new YangNameSpace();
+                uri.setUri(ctx.string().getText());
+                module.setNameSpace(uri);
+                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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/NotificationListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/NotificationListener.java
new file mode 100644
index 0000000..6088ab4
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/NotificationListener.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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.YangNotification;
+import org.onosproject.yangutils.datamodel.YangSubModule;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.GROUPING_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.NOTIFICATION_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPEDEF_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerCollisionDetector.detectCollidingChildUtil;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateMutuallyExclusiveChilds;
+import static org.onosproject.yangutils.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,
+                                       GeneratedYangParser.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 YangModule || curData instanceof YangSubModule) {
+
+            YangNotification notification = getYangNotificationNode(JAVA_GENERATION);
+            notification.setName(identifier);
+            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(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,
+                                      GeneratedYangParser.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(GeneratedYangParser.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());
+        validateMutuallyExclusiveChilds(ctx.typedefStatement(), TYPEDEF_DATA, ctx.groupingStatement(), GROUPING_DATA,
+                NOTIFICATION_DATA, ctx.identifier().getText());
+    }
+}
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/OrganizationListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/OrganizationListener.java
new file mode 100644
index 0000000..20a42c1
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangSubModule;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.ORGANIZATION_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.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,
+                                                GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/OutputListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/OutputListener.java
new file mode 100644
index 0000000..d0ef568
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/OutputListener.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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.YangOutput;
+import org.onosproject.yangutils.datamodel.YangRpc;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.OUTPUT_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction
+        .constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction
+        .constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.translator.tojava.YangDataModelFactory.getYangOutputNode;
+
+/*
+ * 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 {
+
+    private static final String OUTPUT_KEYWORD = "_output";
+
+    /**
+     * 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,
+            GeneratedYangParser.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(((YangRpc) curData).getName() + OUTPUT_KEYWORD);
+            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,
+            GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/PatternRestrictionListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/PatternRestrictionListener.java
new file mode 100644
index 0000000..26ff6d1
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/PatternRestrictionListener.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.yangutils.parser.impl.listeners;
+
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+import org.onosproject.yangutils.datamodel.YangDataTypes;
+import org.onosproject.yangutils.datamodel.YangDerivedInfo;
+import org.onosproject.yangutils.datamodel.YangPatternRestriction;
+import org.onosproject.yangutils.datamodel.YangStringRestriction;
+import org.onosproject.yangutils.datamodel.YangType;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.datamodel.utils.YangConstructType;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.PATTERN_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPE_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.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,
+                                                      GeneratedYangParser.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,
+                                              GeneratedYangParser.PatternStatementContext ctx) {
+
+        if (type.getDataType() != YangDataTypes.STRING && type.getDataType() != YangDataTypes.DERIVED) {
+
+            ParserException parserException = new ParserException("YANG file error : " +
+                    YangConstructType.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();
+                type.setDataTypeExtendedInfo(stringRestriction);
+                stringRestriction.addPattern(patternArgument);
+            } else {
+                stringRestriction.addPattern(patternArgument);
+            }
+            listener.getParsedDataStack().push(stringRestriction);
+        } else {
+            YangPatternRestriction patternRestriction = (YangPatternRestriction) ((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,
+                                                    GeneratedYangParser.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(GeneratedYangParser.PatternStatementContext ctx) {
+        String userInputPattern = ctx.string().getText().replace("\"", EMPTY_STRING);
+        try {
+            Pattern.compile(userInputPattern);
+        } catch (PatternSyntaxException exception) {
+            ParserException parserException = new ParserException("YANG file error : " +
+                    YangConstructType.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 userInputPattern;
+    }
+}
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/PositionListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/PositionListener.java
new file mode 100644
index 0000000..4ae66bb
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/PositionListener.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.yangutils.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.yangutils.datamodel.YangBit;
+import org.onosproject.yangutils.datamodel.YangBits;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.POSITION_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidNonNegativeIntegerValue;
+import static org.onosproject.yangutils.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,
+            GeneratedYangParser.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,
+            GeneratedYangParser.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;
+                for (YangBit curBit : yangBits.getBitSet()) {
+                    if (positionValue == curBit.getPosition()) {
+                        listener.getParsedDataStack().push(bitNode);
+                        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;
+                    }
+                }
+                listener.getParsedDataStack().push(bitNode);
+                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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/PrefixListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/PrefixListener.java
new file mode 100644
index 0000000..b75f77c
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/PrefixListener.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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangBelongsTo;
+import org.onosproject.yangutils.datamodel.YangImport;
+import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.PREFIX_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yangutils.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, GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/PresenceListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/PresenceListener.java
new file mode 100644
index 0000000..ef744d5
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/PresenceListener.java
@@ -0,0 +1,78 @@
+/*
+ * 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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangContainer;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.CONTAINER_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.PRESENCE_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.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,
+                                             GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RangeRestrictionListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RangeRestrictionListener.java
new file mode 100644
index 0000000..d7094ed
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RangeRestrictionListener.java
@@ -0,0 +1,164 @@
+/*
+ * 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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangDerivedInfo;
+import org.onosproject.yangutils.datamodel.YangRangeRestriction;
+import org.onosproject.yangutils.datamodel.YangType;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED;
+import static org.onosproject.yangutils.datamodel.utils.RestrictionResolver.isOfRangeRestrictedType;
+import static org.onosproject.yangutils.datamodel.utils.RestrictionResolver.processRangeRestriction;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.RANGE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPE_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.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,
+                                                    GeneratedYangParser.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,
+                                            GeneratedYangParser.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()))) {
+            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 {
+            rangeRestriction = processRangeRestriction(null, ctx.getStart().getLine(),
+                    ctx.getStart().getCharPositionInLine(), false, ctx.range().getText(), type.getDataType());
+        } catch (DataModelException e) {
+            ParserException parserException = new ParserException(e.getMessage());
+            parserException.setCharPosition(e.getCharPositionInLine());
+            parserException.setLine(e.getLineNumber());
+            throw parserException;
+        }
+
+        if (rangeRestriction != null) {
+            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,
+                                                   GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ReferenceListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ReferenceListener.java
new file mode 100644
index 0000000..02cdf62
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangReference;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.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,
+                                             GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RevisionDateListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RevisionDateListener.java
new file mode 100644
index 0000000..bb701a6
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RevisionDateListener.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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangImport;
+import org.onosproject.yangutils.datamodel.YangInclude;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.REVISION_DATE_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.isDateValid;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.removeQuotesAndHandleConcat;
+import static org.onosproject.yangutils.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,
+            GeneratedYangParser.RevisionDateStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, REVISION_DATE_DATA, ctx.dateArgumentString().getText(),
+                ENTRY);
+
+        String date = removeQuotesAndHandleConcat(ctx.dateArgumentString().getText());
+        if (!isDateValid(date)) {
+            ParserException parserException = new ParserException("YANG file error: Input date is not correct");
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+
+        // 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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RevisionListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RevisionListener.java
new file mode 100644
index 0000000..36d028a
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RevisionListener.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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangRevision;
+import org.onosproject.yangutils.datamodel.YangSubModule;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.REVISION_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.isDateValid;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.removeQuotesAndHandleConcat;
+import static org.onosproject.yangutils.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,
+                                            GeneratedYangParser.RevisionStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, REVISION_DATA, ctx.dateArgumentString().getText(), ENTRY);
+
+        // Validate for reverse chronological order of revision & for revision
+        // value.
+        if (!validateRevision(listener, ctx)) {
+            return;
+            // TODO to be implemented.
+        }
+
+        String date = removeQuotesAndHandleConcat(ctx.dateArgumentString().getText());
+        if (!isDateValid(date)) {
+            ParserException parserException = new ParserException("YANG file error: Input date is not correct");
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+
+        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, GeneratedYangParser.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;
+                    module.setRevision((YangRevision) tmpRevisionNode);
+                    break;
+                }
+                case SUB_MODULE_DATA: {
+                    YangSubModule subModule = (YangSubModule) tmpNode;
+                    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,
+                                            GeneratedYangParser.RevisionStatementContext ctx) {
+        // TODO to be implemented
+        return true;
+    }
+}
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RpcListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RpcListener.java
new file mode 100644
index 0000000..afb78a3
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RpcListener.java
@@ -0,0 +1,164 @@
+/*
+ * 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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.YangRpc;
+import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangSubModule;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.GROUPING_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.INPUT_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.OUTPUT_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.RPC_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPEDEF_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerCollisionDetector.detectCollidingChildUtil;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.*;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateMutuallyExclusiveChilds;
+import static org.onosproject.yangutils.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,
+                                             GeneratedYangParser.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.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,
+                                            GeneratedYangParser.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(GeneratedYangParser.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());
+        validateMutuallyExclusiveChilds(ctx.typedefStatement(), TYPEDEF_DATA, ctx.groupingStatement(), GROUPING_DATA,
+                RPC_DATA, ctx.identifier().getText());
+    }
+
+}
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ShortCaseListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ShortCaseListener.java
new file mode 100644
index 0000000..612fe3b
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ShortCaseListener.java
@@ -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.
+ */
+
+package org.onosproject.yangutils.parser.impl.listeners;
+
+import org.antlr.v4.runtime.ParserRuleContext;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.onosproject.yangutils.datamodel.YangCase;
+import org.onosproject.yangutils.datamodel.YangChoice;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.CASE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.SHORT_CASE_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerCollisionDetector.detectCollidingChildUtil;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_CHILD;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.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,
+            GeneratedYangParser.ShortCaseStatementContext ctx) {
+
+        ParseTree errorConstructContext;
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, MISSING_HOLDER, SHORT_CASE_DATA, "", ENTRY);
+
+        YangCase caseNode = getYangCaseNode(JAVA_GENERATION);
+
+        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 {
+            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,
+            GeneratedYangParser.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 {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, SHORT_CASE_DATA,
+                    "", EXIT));
+        }
+    }
+}
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/StatusListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/StatusListener.java
new file mode 100644
index 0000000..81d6b61
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/StatusListener.java
@@ -0,0 +1,127 @@
+/*
+ * 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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangStatus;
+import org.onosproject.yangutils.datamodel.YangStatusType;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.datamodel.utils.YangConstructType;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.removeQuotesAndHandleConcat;
+import static org.onosproject.yangutils.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 : " +
+                        YangConstructType.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListener.java
new file mode 100644
index 0000000..639906a
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListener.java
@@ -0,0 +1,137 @@
+/*
+ * 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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.ResolvableType;
+import org.onosproject.yangutils.datamodel.YangReferenceResolver;
+import org.onosproject.yangutils.datamodel.YangRevision;
+import org.onosproject.yangutils.datamodel.YangSubModule;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.linker.exceptions.LinkerException;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.SUB_MODULE_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.setCurrentDateForRevision;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsEmpty;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.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);
+
+        if (ctx.submoduleBody().submoduleHeaderStatement().yangVersionStatement() == null) {
+            yangSubModule.setVersion((byte) 1);
+        }
+
+        if (ctx.submoduleBody().revisionStatements().revisionStatement().isEmpty()) {
+            String currentDate = setCurrentDateForRevision();
+            YangRevision currentRevision = new YangRevision();
+            currentRevision.setRevDate(currentDate);
+            yangSubModule.setRevision(currentRevision);
+        }
+
+        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);
+
+        if (!(listener.getParsedDataStack().peek() instanceof YangSubModule)) {
+            throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, SUB_MODULE_DATA,
+                    ctx.identifier().getText(), EXIT));
+        }
+        try {
+            ((YangReferenceResolver) listener.getParsedDataStack().peek())
+                    .resolveSelfFileLinking(ResolvableType.YANG_USES);
+            ((YangReferenceResolver) listener.getParsedDataStack().peek())
+                    .resolveSelfFileLinking(ResolvableType.YANG_DERIVED_DATA_TYPE);
+        } catch (DataModelException e) {
+            LinkerException linkerException = new LinkerException(e.getMessage());
+            linkerException.setLine(e.getLineNumber());
+            linkerException.setCharPosition(e.getCharPositionInLine());
+            throw linkerException;
+        }
+    }
+}
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeDefListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeDefListener.java
new file mode 100644
index 0000000..4a629ba
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeDefListener.java
@@ -0,0 +1,197 @@
+/*
+ * 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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangContainer;
+import org.onosproject.yangutils.datamodel.YangGrouping;
+import org.onosproject.yangutils.datamodel.YangInput;
+import org.onosproject.yangutils.datamodel.YangList;
+import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.YangNotification;
+import org.onosproject.yangutils.datamodel.YangOutput;
+import org.onosproject.yangutils.datamodel.YangRpc;
+import org.onosproject.yangutils.datamodel.YangSubModule;
+import org.onosproject.yangutils.datamodel.YangTypeDef;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.DEFAULT_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPEDEF_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.UNITS_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerCollisionDetector.detectCollidingChildUtil;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_CONTENT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityEqualsOne;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yangutils.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,
+            GeneratedYangParser.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);
+
+        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,
+            GeneratedYangParser.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(GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java
new file mode 100644
index 0000000..ea14df2
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java
@@ -0,0 +1,268 @@
+/*
+ * 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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangDataTypes;
+import org.onosproject.yangutils.datamodel.YangDerivedInfo;
+import org.onosproject.yangutils.datamodel.YangLeaf;
+import org.onosproject.yangutils.datamodel.YangLeafList;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.YangNodeIdentifier;
+import org.onosproject.yangutils.datamodel.YangType;
+import org.onosproject.yangutils.datamodel.YangTypeDef;
+import org.onosproject.yangutils.datamodel.YangUnion;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.linker.impl.YangResolutionInfoImpl;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.addResolutionInfo;
+import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.UNRESOLVED;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPE_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidNodeIdentifier;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.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,
+                                        GeneratedYangParser.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 = YangDataTypes.getType(ctx.string().getText());
+
+        // Create YANG type object and fill the values.
+        YangType<?> type = getYangType(JAVA_GENERATION);
+        type.setNodeIdentifier(nodeIdentifier);
+        type.setDataType(yangDataTypes);
+
+        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 == 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<>();
+                    ((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 == 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<>();
+                    ((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 == YangDataTypes.DERIVED) {
+
+                    // Create empty derived info and attach it to type extended info.
+                    YangDerivedInfo<?> yangDerivedInfo = new YangDerivedInfo<>();
+                    ((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 == YangDataTypes.DERIVED) {
+                    // Create empty derived info and attach it to type extended info.
+                    YangDerivedInfo<?> yangDerivedInfo = new YangDerivedInfo<>();
+                    ((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);
+    }
+
+    /**
+     * 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,
+                                       GeneratedYangParser.TypeStatementContext ctx) {
+
+        // Check for stack to be non empty.
+        checkStackIsNotEmpty(listener, 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,
+                                            GeneratedYangParser.TypeStatementContext ctx) {
+        try {
+            addResolutionInfo(resolutionInfo);
+        } catch (DataModelException e) {
+            throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
+                    TYPE_DATA, ctx.string().getText(), ENTRY, e.getMessage()));
+        }
+    }
+}
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/UnionListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/UnionListener.java
new file mode 100644
index 0000000..32eb4d9
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/UnionListener.java
@@ -0,0 +1,220 @@
+/*
+ * 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.yangutils.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.yangutils.datamodel.YangLeaf;
+import org.onosproject.yangutils.datamodel.YangLeafList;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.YangType;
+import org.onosproject.yangutils.datamodel.YangTypeDef;
+import org.onosproject.yangutils.datamodel.YangUnion;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.UNION_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.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,
+                                         GeneratedYangParser.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();
+
+            // 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,
+                                       GeneratedYangParser.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(UNHANDLED_PARSED_DATA,
+                        UNION_DATA, "", ENTRY, e.getMessage()));
+            }
+        }
+    }
+}
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/UnitsListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/UnitsListener.java
new file mode 100644
index 0000000..e7acccf
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/UnitsListener.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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangLeaf;
+import org.onosproject.yangutils.datamodel.YangLeafList;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.UNITS_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.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,
+                                           GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/UsesListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/UsesListener.java
new file mode 100644
index 0000000..2240c16
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/UsesListener.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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangAugment;
+import org.onosproject.yangutils.datamodel.YangCase;
+import org.onosproject.yangutils.datamodel.YangContainer;
+import org.onosproject.yangutils.datamodel.YangGrouping;
+import org.onosproject.yangutils.datamodel.YangInput;
+import org.onosproject.yangutils.datamodel.YangList;
+import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.YangNodeIdentifier;
+import org.onosproject.yangutils.datamodel.YangNotification;
+import org.onosproject.yangutils.datamodel.YangOutput;
+import org.onosproject.yangutils.datamodel.YangSubModule;
+import org.onosproject.yangutils.datamodel.YangUses;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.linker.impl.YangResolutionInfoImpl;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.addResolutionInfo;
+import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.REFERENCE_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.STATUS_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.USES_DATA;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.WHEN_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerCollisionDetector.detectCollidingChildUtil;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidNodeIdentifier;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
+import static org.onosproject.yangutils.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, GeneratedYangParser.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);
+            YangNodeIdentifier nodeIdentifier = getValidNodeIdentifier(ctx.string().getText(), USES_DATA, ctx);
+            usesNode.setNodeIdentifier(nodeIdentifier);
+            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,
+                                       GeneratedYangParser.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(GeneratedYangParser.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,
+                                            GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ValueListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ValueListener.java
new file mode 100644
index 0000000..39efa6b
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/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.yangutils.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.yangutils.datamodel.YangEnum;
+import org.onosproject.yangutils.datamodel.YangEnumeration;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.VALUE_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIntegerValue;
+
+/**
+ * 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, GeneratedYangParser.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, GeneratedYangParser.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/VersionListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/VersionListener.java
new file mode 100644
index 0000000..80caaa2
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/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.yangutils.parser.impl.listeners;
+
+import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangSubModule;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidVersion;
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.VERSION_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
+import static org.onosproject.yangutils.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/package-info.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/listeners/package-info.java
new file mode 100644
index 0000000..240cd55
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/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.yangutils.parser.impl.listeners;
\ No newline at end of file
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/package-info.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/package-info.java
new file mode 100644
index 0000000..d935f7b
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/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.yangutils.parser.impl;
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/AugmentListenerUtil.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/AugmentListenerUtil.java
new file mode 100644
index 0000000..1b2009e
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/AugmentListenerUtil.java
@@ -0,0 +1,309 @@
+/*
+ * 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.yangutils.parser.impl.parserutils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.onosproject.yangutils.datamodel.CollisionDetector;
+import org.onosproject.yangutils.datamodel.YangModule;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.YangNodeIdentifier;
+import org.onosproject.yangutils.datamodel.YangSubModule;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.AUGMENT_DATA;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase;
+
+/**
+ * Represents a utility which provides listener utilities augment node.
+ */
+public final class AugmentListenerUtil {
+
+    /**
+     * Prefix to be added to generated java file for augment node.
+     */
+    private static final String AUGMENTED = "Augmented";
+
+    /**
+     * The number of time augment has updated the same target node in same module/submodule.
+     */
+    private static int occurrenceCount = 1;
+
+    /**
+     * List of names for augment's generated java file.
+     */
+    private static List<String> augmentJavaFileNameList = new ArrayList<>();
+
+    private static final int ONE = 1;
+    private static final int TWO = 2;
+    private static final int ZERO = 0;
+
+    /**
+     * Creates an instance of augment java file name generator utility.
+     */
+    private AugmentListenerUtil() {
+    }
+
+    /**
+     * Sets the augment java file name list.
+     *
+     * @param nameList name list
+     */
+    private static void setAugmentJavaFileNameList(List<String> nameList) {
+        augmentJavaFileNameList = nameList;
+    }
+
+    /**
+     * Returns augment java file name list.
+     *
+     * @return augment java file name list
+     */
+    public static List<String> getAugmentJavaFileNameList() {
+        return augmentJavaFileNameList;
+    }
+
+    /**
+     * Sets occurrence count.
+     *
+     * @param occurrence occurrence count
+     */
+    private static void setOccurrenceCount(int occurrence) {
+        occurrenceCount = occurrence;
+    }
+
+    /**
+     * Returns occurrence count.
+     *
+     * @return occurrence count
+     */
+    private static int getOccurrenceCount() {
+        return occurrenceCount;
+    }
+
+    /**
+     * Generates name for augment node also detects collision for java file generation of augment node when
+     * augment is updating the same target node in same parent multiple times.
+     *
+     * @param curData parsable data
+     * @param targetNodes list of target nodes
+     * @param listener tree walk listener
+     * @return name for augment node
+     */
+    public static String generateNameForAugmentNode(Parsable curData, List<YangNodeIdentifier> targetNodes,
+            TreeWalkListener listener) {
+
+        String curPrefix = getParentsPrefix((YangNode) curData);
+        YangNodeIdentifier nodeId = targetNodes.get(targetNodes.size() - 1);
+        boolean isPrefix = isPrefixPresent(nodeId, curPrefix);
+        String generateName = createValidNameForAugment(nodeId, isPrefix);
+
+        if (listener.getParsedDataStack().peek() instanceof CollisionDetector) {
+            try {
+                ((CollisionDetector) listener.getParsedDataStack().peek()).detectCollidingChild(generateName,
+                        AUGMENT_DATA);
+            } catch (DataModelException e) {
+                return updateNameWhenHasMultipleOuccrrence(nodeId, isPrefix);
+            }
+        }
+
+        clearOccurrenceCount();
+        return generateName;
+    }
+
+    /**
+     * Creates a name identifier for augment.
+     *
+     * @param nodeId node identifier
+     * @param isPrefix if prefix is present or it is not equals to parent's prefix
+     * @return valid name for augment
+     */
+    public static String createValidNameForAugment(YangNodeIdentifier nodeId, boolean isPrefix) {
+        getAugmentJavaFileNameList().add(createName(nodeId, isPrefix));
+        setAugmentJavaFileNameList(getAugmentJavaFileNameList());
+        return getAugmentJavaFileNameList().get(getAugmentJavaFileNameList().size() - 1);
+    }
+
+    /**
+     * Creates name for the current augment file.
+     *
+     * @param nodeId node identifier
+     * @param isPrefix if prefix is present or it is not equals to parent's prefix
+     */
+    private static String createName(YangNodeIdentifier nodeId, boolean isPrefix) {
+        if (isPrefix) {
+            return AUGMENTED + getCapitalCase(nodeId.getPrefix()) + getCapitalCase(nodeId.getName());
+        } else {
+            return AUGMENTED + getCapitalCase(nodeId.getName());
+        }
+    }
+
+    /**
+     * Updates occurrence count of augment.
+     */
+    private static void updateOccurenceCount() {
+        int count = getOccurrenceCount();
+        count++;
+        setOccurrenceCount(count);
+    }
+
+    /**
+     * Updates the list of name when augment has occurred multiple times to update the same target node
+     * and returns a valid name for augment node's generated java file.
+     *
+     * @param nodeId YANG node identifier
+     * @param isPrefix true if a prefix is present and it is not equals to parents prefix
+     * @return valid name for augment node
+     */
+    public static String updateNameWhenHasMultipleOuccrrence(YangNodeIdentifier nodeId, boolean isPrefix) {
+        String name = "";
+        updateOccurenceCount();
+
+        if (getOccurrenceCount() == TWO) {
+            String previousAugmentsName = getAugmentJavaFileNameList().get(getAugmentJavaFileNameList().size() - ONE);
+            getAugmentJavaFileNameList().remove(ZERO);
+            getAugmentJavaFileNameList().add(previousAugmentsName + ONE);
+            //TODO: update when already contains the name.
+            name = createName(nodeId, isPrefix) + TWO;
+        } else {
+            name = createName(nodeId, isPrefix) + getOccurrenceCount();
+        }
+        getAugmentJavaFileNameList().add(name);
+        return name;
+    }
+
+    /**
+     * Resets occurrence count to one.
+     */
+    public static void clearOccurrenceCount() {
+        setOccurrenceCount(ONE);
+    }
+
+    /**
+     * Returns true if a prefix is present and it is not equals to parents prefix.
+     *
+     * @param nodeId YANG node identifier
+     * @param parentsPrefix parent's prefix
+     * @return true if a prefix is present and it is not equals to parents prefix
+     */
+    private static boolean isPrefixPresent(YangNodeIdentifier nodeId, String parentsPrefix) {
+        return nodeId.getPrefix() != null && nodeId.getPrefix() != parentsPrefix;
+    }
+
+    /**
+     * Validates whether current node in target path is valid or not.
+     *
+     * @param curNode current YANG node
+     * @param targetNodes list of target nodes
+     * @param ctx augment statement context
+     */
+    public static void validateNodeInTargetPath(YangNode curNode, List<YangNodeIdentifier> targetNodes,
+            GeneratedYangParser.AugmentStatementContext ctx) {
+
+        curNode = curNode.getChild();
+        YangNode tempNode = validateCurrentTargetNode(targetNodes, curNode);
+        if (tempNode != null) {
+            switch (tempNode.getNodeType()) {
+                case CONTAINER_NODE:
+                    break;
+                case LIST_NODE:
+                    break;
+                case CHOICE_NODE:
+                    break;
+                case CASE_NODE:
+                    break;
+                case INPUT_NODE:
+                    break;
+                case OUTPUT_NODE:
+                    break;
+                case NOTIFICATION_NODE:
+                    break;
+                default:
+                    throw parserException(ctx);
+            }
+        } else {
+            throw parserException(ctx);
+        }
+    }
+
+    /**
+     * Validates whether nodes in target node list are valid or not.
+     *
+     * @param targetNodes target node
+     * @param curNode YANG node
+     * @return true or false
+     */
+    private static YangNode validateCurrentTargetNode(List<YangNodeIdentifier> targetNodes, YangNode curNode) {
+        YangNode tempNode = null;
+        while (curNode != null) {
+            tempNode = curNode;
+            for (int i = 1; i < targetNodes.size(); i++) {
+                if (curNode.getName().equals(targetNodes.get(i).getName())) {
+                    if (curNode.getChild() != null && targetNodes.size() - 1 != i) {
+                        curNode = curNode.getChild();
+                    } else if (curNode.getChild() != null && targetNodes.size() - 1 == i) {
+                        return curNode;
+                    } else if (curNode.getChild() == null && targetNodes.size() - 1 == i) {
+                        return curNode;
+                    } else {
+                        break;
+                    }
+                } else {
+                    curNode = tempNode;
+                    break;
+                }
+            }
+            curNode = curNode.getNextSibling();
+        }
+        return null;
+    }
+
+    /**
+     * Builds parser exception.
+     *
+     * @param ctx augment statement context
+     * @return parser exception
+     */
+    public static ParserException parserException(GeneratedYangParser.AugmentStatementContext ctx) {
+        int line = ctx.getStart().getLine();
+        int charPositionInLine = ctx.getStart().getCharPositionInLine();
+        ParserException exception = new ParserException("invalid target node path.");
+        exception.setLine(line);
+        exception.setCharPosition(charPositionInLine);
+        return exception;
+    }
+
+    /**
+     * Returns parent nodes prefix.
+     *
+     * @param curNode current YANG node
+     * @return parent nodes prefix
+     */
+    public static String getParentsPrefix(YangNode curNode) {
+        String curPrefix = null;
+        if (curNode instanceof YangModule) {
+            curPrefix = ((YangModule) curNode).getPrefix();
+        } else if (curNode instanceof YangSubModule) {
+            curPrefix = ((YangSubModule) curNode).getPrefix();
+        }
+        return curPrefix;
+    }
+}
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerCollisionDetector.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerCollisionDetector.java
new file mode 100644
index 0000000..632f50d
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerCollisionDetector.java
@@ -0,0 +1,73 @@
+/*
+ * 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.yangutils.parser.impl.parserutils;
+
+import org.onosproject.yangutils.datamodel.CollisionDetector;
+import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.datamodel.utils.YangConstructType;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.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 {
+
+        if (listener.getParsedDataStack().peek() instanceof CollisionDetector) {
+            try {
+                ((CollisionDetector) listener.getParsedDataStack().peek()).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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerErrorLocation.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerErrorLocation.java
new file mode 100644
index 0000000..c1c2888
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/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.yangutils.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerErrorMessageConstruction.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerErrorMessageConstruction.java
new file mode 100644
index 0000000..15b2170
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/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.yangutils.parser.impl.parserutils;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.getYangConstructType;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.getErrorLocationMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.getErrorType;
+
+import org.onosproject.yangutils.datamodel.utils.YangConstructType;
+
+/**
+ * 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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerErrorType.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerErrorType.java
new file mode 100644
index 0000000..f1cb284
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/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.yangutils.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerUtil.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerUtil.java
new file mode 100644
index 0000000..d05c8d0
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerUtil.java
@@ -0,0 +1,376 @@
+/*
+ * 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.yangutils.parser.impl.parserutils;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.regex.Pattern;
+
+import org.antlr.v4.runtime.ParserRuleContext;
+import org.onosproject.yangutils.datamodel.YangNodeIdentifier;
+import org.onosproject.yangutils.datamodel.utils.YangConstructType;
+import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+
+import static org.onosproject.yangutils.utils.UtilConstants.ADD;
+import static org.onosproject.yangutils.utils.UtilConstants.SPACE;
+import static org.onosproject.yangutils.utils.UtilConstants.SLASH;
+import static org.onosproject.yangutils.utils.UtilConstants.COLON;
+import static org.onosproject.yangutils.utils.UtilConstants.CARET;
+import static org.onosproject.yangutils.utils.UtilConstants.CURRENTLY_UNSUPPORTED;
+import static org.onosproject.yangutils.utils.UtilConstants.QUOTES;
+import static org.onosproject.yangutils.utils.UtilConstants.HYPHEN;
+import static org.onosproject.yangutils.utils.UtilConstants.EMPTY_STRING;
+import static org.onosproject.yangutils.utils.UtilConstants.TRUE;
+import static org.onosproject.yangutils.utils.UtilConstants.FALSE;
+import static org.onosproject.yangutils.utils.UtilConstants.YANG_FILE_ERROR;
+import static org.onosproject.yangutils.utils.UtilConstants.IDENTITYREF;
+import static org.onosproject.yangutils.utils.UtilConstants.LEAFREF;
+import static org.onosproject.yangutils.utils.UtilConstants.INSTANCE_IDENTIFIER;
+
+/**
+ * Represents an utility for listener.
+ */
+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 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";
+
+    /**
+     * Creates a new listener util.
+     */
+    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 : " +
+                    YangConstructType.getYangConstructType(yangConstruct) + " name " + identifierString + " is " +
+                    "greater than 64 characters.");
+        } else if (!IDENTIFIER_PATTERN.matcher(identifierString).matches()) {
+            parserException = new ParserException("YANG file error : " +
+                    YangConstructType.getYangConstructType(yangConstruct) + " name " + identifierString + " is not " +
+                    "valid.");
+        } else if (identifierString.toLowerCase().startsWith(XML)) {
+            parserException = new ParserException("YANG file error : " +
+                    YangConstructType.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(GeneratedYangParser.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 : " +
+                    YangConstructType.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 : " +
+                    YangConstructType.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 : " +
+                    YangConstructType.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 : " +
+                    YangConstructType.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 : " +
+                    YangConstructType.getYangConstructType(yangConstruct) + " value " + value + " is not " +
+                    "valid.");
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+    }
+
+    /**
+     * Sets current date and makes it in usable format for revision.
+     *
+     * @return usable current date format for revision
+     */
+    public static String setCurrentDateForRevision() {
+
+        Calendar date = Calendar.getInstance();
+        SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
+        String dateForRevision = dateFormat.format(date.getTime()).replaceAll(SLASH, HYPHEN).replaceAll(SPACE,
+                EMPTY_STRING);
+        return dateForRevision;
+    }
+
+    /**
+     * 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();
+            checkForUnsupportedTypes(tmpData[0], yangConstruct, ctx);
+            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 : " +
+                    YangConstructType.getYangConstructType(yangConstruct) + " name " + nodeIdentifierString +
+                    " is not valid.");
+            parserException.setLine(ctx.getStart().getLine());
+            parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+            throw parserException;
+        }
+    }
+
+    /**
+     * Checks whether the type is an unsupported type.
+     *
+     * @param typeName name of the type
+     * @param yangConstruct yang construct to check if it is type
+     * @param ctx yang construct's context to get the line number and character position
+     */
+    private static void checkForUnsupportedTypes(String typeName,
+            YangConstructType yangConstruct, ParserRuleContext ctx) {
+
+        if (yangConstruct == YangConstructType.TYPE_DATA) {
+            if (typeName.equalsIgnoreCase(LEAFREF)) {
+                handleUnsupportedYangConstruct(YangConstructType.LEAFREF_DATA,
+                        ctx, CURRENTLY_UNSUPPORTED);
+            } else if (typeName.equalsIgnoreCase(IDENTITYREF)) {
+                handleUnsupportedYangConstruct(YangConstructType.IDENTITYREF_DATA,
+                        ctx, CURRENTLY_UNSUPPORTED);
+            } else if (typeName.equalsIgnoreCase(INSTANCE_IDENTIFIER)) {
+                handleUnsupportedYangConstruct(YangConstructType.INSTANCE_IDENTIFIER_DATA,
+                        ctx, CURRENTLY_UNSUPPORTED);
+            }
+        }
+    }
+
+    /**
+     * Checks and return valid absolute schema node id.
+     *
+     * @param argumentString string from yang file
+     * @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<YangNodeIdentifier> getValidAbsoluteSchemaNodeId(String argumentString,
+            YangConstructType yangConstructType, ParserRuleContext ctx) {
+
+        List<YangNodeIdentifier> targetNodes = new LinkedList<>();
+        YangNodeIdentifier yangNodeIdentifier;
+        String tmpSchemaNodeId = removeQuotesAndHandleConcat(argumentString);
+
+        // absolute-schema-nodeid = 1*("/" node-identifier)
+        if (!tmpSchemaNodeId.startsWith(SLASH)) {
+            ParserException parserException = new ParserException("YANG file error : " +
+                    YangConstructType.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);
+            targetNodes.add(yangNodeIdentifier);
+        }
+        return targetNodes;
+    }
+
+    /**
+     * Throws parser exception for unsupported YANG constructs.
+     *
+     * @param yangConstructType yang construct for creating error message
+     * @param ctx yang construct's context to get the line number and character position
+     * @param errorInfo error information
+     */
+    public static void handleUnsupportedYangConstruct(YangConstructType yangConstructType,
+        ParserRuleContext ctx, String errorInfo) {
+        ParserException parserException = new ParserException(YANG_FILE_ERROR
+                + QUOTES + YangConstructType.getYangConstructType(yangConstructType) + QUOTES
+                + errorInfo);
+        parserException.setLine(ctx.getStart().getLine());
+        parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
+        throw parserException;
+    }
+}
\ No newline at end of file
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerValidation.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerValidation.java
new file mode 100644
index 0000000..f5e98d0
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerValidation.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.yangutils.parser.impl.parserutils;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.antlr.v4.runtime.ParserRuleContext;
+import org.onosproject.yangutils.datamodel.YangContainer;
+import org.onosproject.yangutils.datamodel.YangList;
+import org.onosproject.yangutils.datamodel.YangNode;
+import org.onosproject.yangutils.datamodel.utils.Parsable;
+import org.onosproject.yangutils.datamodel.utils.YangConstructType;
+import org.onosproject.yangutils.parser.exceptions.ParserException;
+import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
+import static org.onosproject.yangutils.datamodel.utils.YangConstructType.getYangConstructType;
+import static org.onosproject.yangutils.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) {
+
+        YangNode parentNode;
+        Parsable curData = listener.getParsedDataStack().peek();
+        if (curData instanceof YangNode) {
+            parentNode = ((YangNode) curData).getParent();
+            if (parentNode instanceof YangContainer) {
+                return ((YangContainer) parentNode).isConfig();
+            } else if (parentNode instanceof YangList) {
+                return ((YangList) parentNode).isConfig();
+            }
+        }
+        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
+     * @throws ParserException exception if cardinality check fails
+     */
+    public static void validateMutuallyExclusiveChilds(List<?> child1Context, YangConstructType yangChild1Construct,
+            List<?> child2Context, YangConstructType yangChild2Construct,
+            YangConstructType yangParentConstruct, String parentName)
+            throws ParserException {
+
+        if (!child1Context.isEmpty() && !child2Context.isEmpty()) {
+            ParserException parserException = new ParserException("YANG file error: \""
+                    + getYangConstructType(yangChild1Construct) + "\" & \"" + getYangConstructType(yangChild2Construct)
+                    + "\" should be mutually exclusive in \"" + getYangConstructType(yangParentConstruct) + " "
+                    + parentName + "\".");
+
+            parserException.setLine(((ParserRuleContext) child2Context).getStart().getLine());
+            parserException.setCharPosition(((ParserRuleContext) child2Context).getStart().getCharPositionInLine());
+            throw parserException;
+        }
+    }
+}
diff --git a/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ParseTreeErrorListener.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ParseTreeErrorListener.java
new file mode 100644
index 0000000..af81d6f
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/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.yangutils.parser.impl.parserutils;
+
+import org.antlr.v4.runtime.BaseErrorListener;
+import org.antlr.v4.runtime.RecognitionException;
+import org.antlr.v4.runtime.Recognizer;
+import org.onosproject.yangutils.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/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/package-info.java b/plugin/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/package-info.java
new file mode 100644
index 0000000..9eafb00
--- /dev/null
+++ b/plugin/src/main/java/org/onosproject/yangutils/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.yangutils.parser.impl.parserutils;
\ No newline at end of file