updating grammar for unknown statement

Change-Id: I0ddfb309d25e2725f94345fdeef6016b0b4a992c
diff --git a/compiler/base/parser/src/main/resources/GeneratedYang.g4 b/compiler/base/parser/src/main/resources/GeneratedYang.g4
index b4a20e5..8ef68e0 100644
--- a/compiler/base/parser/src/main/resources/GeneratedYang.g4
+++ b/compiler/base/parser/src/main/resources/GeneratedYang.g4
@@ -36,7 +36,8 @@
      *                       "}" optsep
      */
 
-    moduleStatement : MODULE_KEYWORD identifier LEFT_CURLY_BRACE moduleBody RIGHT_CURLY_BRACE;
+    moduleStatement : MODULE_KEYWORD identifier LEFT_CURLY_BRACE stmtSep
+            moduleBody RIGHT_CURLY_BRACE;
 
     moduleBody : moduleHeaderStatement linkageStatements metaStatements revisionStatements bodyStatements;
 
@@ -47,12 +48,12 @@
      *                        prefix-stmt stmtsep
      */
 
-    moduleHeaderStatement : yangVersionStatement? namespaceStatement prefixStatement
-                            | yangVersionStatement? prefixStatement namespaceStatement
-                            | namespaceStatement yangVersionStatement? prefixStatement
-                            | namespaceStatement prefixStatement yangVersionStatement?
-                            | prefixStatement namespaceStatement yangVersionStatement?
-                            | prefixStatement yangVersionStatement? namespaceStatement
+    moduleHeaderStatement : (yangVersionStatement stmtSep)? namespaceStatement stmtSep prefixStatement stmtSep
+                            | (yangVersionStatement stmtSep)? prefixStatement stmtSep namespaceStatement stmtSep
+                            | namespaceStatement stmtSep (yangVersionStatement stmtSep)? prefixStatement stmtSep
+                            | namespaceStatement stmtSep prefixStatement stmtSep (yangVersionStatement stmtSep)?
+                            | prefixStatement stmtSep namespaceStatement stmtSep (yangVersionStatement stmtSep)?
+                            | prefixStatement stmtSep (yangVersionStatement stmtSep)? namespaceStatement stmtSep
                             ;
 
     /**
@@ -60,8 +61,7 @@
      *                       *(import-stmt stmtsep)
      *                       *(include-stmt stmtsep)
      */
-    linkageStatements : (importStatement
-                  | includeStatement)*;
+    linkageStatements : (importStatement stmtSep | includeStatement stmtSep)*;
 
     /**
      * meta-stmts          = ;; these stmts can appear in any order
@@ -70,34 +70,34 @@
      *                       [description-stmt stmtsep]
      *                       [reference-stmt stmtsep]
      */
-    metaStatements : organizationStatement? contactStatement? descriptionStatement? referenceStatement?
-               | organizationStatement? contactStatement? referenceStatement? descriptionStatement?
-               | organizationStatement? descriptionStatement? contactStatement? referenceStatement?
-               | organizationStatement? descriptionStatement? referenceStatement? contactStatement?
-               | organizationStatement? referenceStatement? contactStatement? descriptionStatement?
-               | organizationStatement? referenceStatement? descriptionStatement? contactStatement?
-               | contactStatement? organizationStatement? descriptionStatement? referenceStatement?
-               | contactStatement? organizationStatement? referenceStatement? descriptionStatement?
-               | contactStatement? referenceStatement? organizationStatement? descriptionStatement?
-               | contactStatement? referenceStatement? descriptionStatement? organizationStatement?
-               | contactStatement? descriptionStatement? referenceStatement? organizationStatement?
-               | contactStatement? descriptionStatement? organizationStatement? referenceStatement?
-               | referenceStatement? contactStatement? organizationStatement? descriptionStatement?
-               | referenceStatement? contactStatement? descriptionStatement? organizationStatement?
-               | referenceStatement? organizationStatement? contactStatement? descriptionStatement?
-               | referenceStatement? organizationStatement? descriptionStatement? contactStatement?
-               | referenceStatement? descriptionStatement? organizationStatement? contactStatement?
-               | referenceStatement? descriptionStatement? contactStatement? organizationStatement?
-               | descriptionStatement? referenceStatement? contactStatement? organizationStatement?
-               | descriptionStatement? referenceStatement? organizationStatement? contactStatement?
-               | descriptionStatement? contactStatement? referenceStatement? organizationStatement?
-               | descriptionStatement? contactStatement? organizationStatement? referenceStatement?
-               | descriptionStatement? organizationStatement? contactStatement? referenceStatement?
-               | descriptionStatement? organizationStatement? referenceStatement? contactStatement?
+    metaStatements : (organizationStatement stmtSep)? (contactStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)?
+               | (organizationStatement stmtSep)? (contactStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)?
+               | (organizationStatement stmtSep)? (descriptionStatement stmtSep)? (contactStatement stmtSep)? (referenceStatement stmtSep)?
+               | (organizationStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (contactStatement stmtSep)?
+               | (organizationStatement stmtSep)? (referenceStatement stmtSep)? (contactStatement stmtSep)? (descriptionStatement stmtSep)?
+               | (organizationStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (contactStatement stmtSep)?
+               | (contactStatement stmtSep)? (organizationStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)?
+               | (contactStatement stmtSep)? (organizationStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)?
+               | (contactStatement stmtSep)? (referenceStatement stmtSep)? (organizationStatement stmtSep)? (descriptionStatement stmtSep)?
+               | (contactStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (organizationStatement stmtSep)?
+               | (contactStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (organizationStatement stmtSep)?
+               | (contactStatement stmtSep)? (descriptionStatement stmtSep)? (organizationStatement stmtSep)? (referenceStatement stmtSep)?
+               | (referenceStatement stmtSep)? (contactStatement stmtSep)? (organizationStatement stmtSep)? (descriptionStatement stmtSep)?
+               | (referenceStatement stmtSep)? (contactStatement stmtSep)? (descriptionStatement stmtSep)? (organizationStatement stmtSep)?
+               | (referenceStatement stmtSep)? (organizationStatement stmtSep)? (contactStatement stmtSep)? (descriptionStatement stmtSep)?
+               | (referenceStatement stmtSep)? (organizationStatement stmtSep)? (descriptionStatement stmtSep)? (contactStatement stmtSep)?
+               | (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (organizationStatement stmtSep)? (contactStatement stmtSep)?
+               | (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (contactStatement stmtSep)? (organizationStatement stmtSep)?
+               | (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (contactStatement stmtSep)? (organizationStatement stmtSep)?
+               | (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (organizationStatement stmtSep)? (contactStatement stmtSep)?
+               | (descriptionStatement stmtSep)? (contactStatement stmtSep)? (referenceStatement stmtSep)? (organizationStatement stmtSep)?
+               | (descriptionStatement stmtSep)? (contactStatement stmtSep)? (organizationStatement stmtSep)? (referenceStatement stmtSep)?
+               | (descriptionStatement stmtSep)? (organizationStatement stmtSep)? (contactStatement stmtSep)? (referenceStatement stmtSep)?
+               | (descriptionStatement stmtSep)? (organizationStatement stmtSep)? (referenceStatement stmtSep)? (contactStatement stmtSep)?
                ;
 
     // revision-stmts      = *(revision-stmt stmtsep)
-    revisionStatements : revisionStatement*;
+    revisionStatements : (revisionStatement stmtSep)*;
 
     /**
      * body-stmts          = *((extension-stmt /
@@ -111,37 +111,28 @@
      *                          notification-stmt /
      *                          deviation-stmt) stmtsep)
      */
-    bodyStatements : (extensionStatement
-               | featureStatement
-               | identityStatement
-               | typedefStatement
-               | groupingStatement
-               | dataDefStatement
-               | augmentStatement
-               | rpcStatement
-               | notificationStatement
-               | deviationStatement
-               | compilerAnnotationStatement)*
-               ;
+    bodyStatements : ((extensionStatement | featureStatement | identityStatement
+               | typedefStatement | groupingStatement | dataDefStatement
+               | augmentStatement | rpcStatement | notificationStatement
+               | deviationStatement | compilerAnnotationStatement) stmtSep)*;
 
     /**
      * yang-version-stmt   = yang-version-keyword sep yang-version-arg-str
      *                       optsep stmtend
      */
-    yangVersionStatement :   YANG_VERSION_KEYWORD version STMTEND;
-
+    yangVersionStatement :   YANG_VERSION_KEYWORD version stmtEnd;
 
     /**
      * namespace-stmt      = namespace-keyword sep uri-str optsep stmtend
      * For namespace validation TODO in Listener
      */
-    namespaceStatement : NAMESPACE_KEYWORD string STMTEND;
+    namespaceStatement : NAMESPACE_KEYWORD string stmtEnd;
 
     /**
      * prefix-stmt         = prefix-keyword sep prefix-arg-str
      *                       optsep stmtend
      */
-    prefixStatement : PREFIX_KEYWORD identifier STMTEND;
+    prefixStatement : PREFIX_KEYWORD identifier stmtEnd;
 
     /**
      * import-stmt         = import-keyword sep identifier-arg-str optsep
@@ -150,12 +141,13 @@
      *                           [revision-date-stmt stmtsep]
      *                        "}"
      */
-    importStatement : IMPORT_KEYWORD identifier LEFT_CURLY_BRACE importStatementBody RIGHT_CURLY_BRACE;
+    importStatement : IMPORT_KEYWORD identifier LEFT_CURLY_BRACE
+            stmtSep importStatementBody RIGHT_CURLY_BRACE;
 
-    importStatementBody : prefixStatement revisionDateStatement?;
+    importStatementBody : prefixStatement stmtSep (revisionDateStatement stmtSep)?;
 
     // revision-date-stmt = revision-date-keyword sep revision-date stmtend
-    revisionDateStatement : REVISION_DATE_KEYWORD dateArgumentString STMTEND;
+    revisionDateStatement : REVISION_DATE_KEYWORD dateArgumentString stmtEnd;
 
     /**
      * include-stmt        = include-keyword sep identifier-arg-str optsep
@@ -164,22 +156,23 @@
      *                                  [revision-date-stmt stmtsep]
      *                            "}")
      */
-    includeStatement : INCLUDE_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE revisionDateStatement? RIGHT_CURLY_BRACE);
+    includeStatement : INCLUDE_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE
+            stmtSep (revisionDateStatement stmtSep)? RIGHT_CURLY_BRACE);
 
     /**
      * organization-stmt   = organization-keyword sep string
      *                            optsep stmtend
      */
-    organizationStatement : ORGANIZATION_KEYWORD string STMTEND;
+    organizationStatement : ORGANIZATION_KEYWORD string stmtEnd;
 
     // contact-stmt        = contact-keyword sep string optsep stmtend
-    contactStatement : CONTACT_KEYWORD string STMTEND;
+    contactStatement : CONTACT_KEYWORD string stmtEnd;
 
     // description-stmt    = description-keyword sep string optsep stmtend
-    descriptionStatement : DESCRIPTION_KEYWORD string STMTEND;
+    descriptionStatement : DESCRIPTION_KEYWORD string stmtEnd;
 
     // reference-stmt      = reference-keyword sep string optsep stmtend
-    referenceStatement : REFERENCE_KEYWORD string STMTEND;
+    referenceStatement : REFERENCE_KEYWORD string stmtEnd;
 
     /**
      * revision-stmt       = revision-keyword sep revision-date optsep
@@ -189,8 +182,10 @@
      *                                  [reference-stmt stmtsep]
      *                              "}")
      */
-    revisionStatement : REVISION_KEYWORD dateArgumentString (STMTEND | LEFT_CURLY_BRACE revisionStatementBody RIGHT_CURLY_BRACE);
-    revisionStatementBody : descriptionStatement? referenceStatement?;
+    revisionStatement : REVISION_KEYWORD dateArgumentString (STMTEND |
+             LEFT_CURLY_BRACE stmtSep revisionStatementBody RIGHT_CURLY_BRACE);
+    revisionStatementBody : (descriptionStatement stmtSep)?
+             (referenceStatement stmtSep)?;
 
     /**
      * submodule-stmt      = optsep submodule-keyword sep identifier-arg-str
@@ -203,7 +198,8 @@
      *                                 body-stmts
      *                             "}" optsep
      */
-    subModuleStatement : SUBMODULE_KEYWORD identifier LEFT_CURLY_BRACE submoduleBody RIGHT_CURLY_BRACE;
+    subModuleStatement : SUBMODULE_KEYWORD identifier LEFT_CURLY_BRACE
+             stmtSep submoduleBody RIGHT_CURLY_BRACE;
     submoduleBody : submoduleHeaderStatement linkageStatements metaStatements revisionStatements bodyStatements;
 
     /** submodule-header-stmts =
@@ -211,9 +207,8 @@
      *                            [yang-version-stmt stmtsep]
      *                             belongs-to-stmt stmtsep
      */
-    submoduleHeaderStatement : yangVersionStatement? belongstoStatement
-                               | belongstoStatement yangVersionStatement?
-                              ;
+    submoduleHeaderStatement : (yangVersionStatement stmtSep)? belongstoStatement stmtSep
+            | belongstoStatement stmtSep (yangVersionStatement stmtSep)? ;
 
     /**
      * belongs-to-stmt     = belongs-to-keyword sep identifier-arg-str
@@ -222,8 +217,9 @@
      *                           prefix-stmt stmtsep
      *                       "}"
      */
-    belongstoStatement : BELONGS_TO_KEYWORD identifier LEFT_CURLY_BRACE belongstoStatementBody RIGHT_CURLY_BRACE;
-    belongstoStatementBody : prefixStatement;
+    belongstoStatement : BELONGS_TO_KEYWORD identifier LEFT_CURLY_BRACE
+            stmtSep belongstoStatementBody RIGHT_CURLY_BRACE;
+    belongstoStatementBody : prefixStatement stmtSep;
 
     /**
      * extension-stmt      = extension-keyword sep identifier-arg-str optsep
@@ -236,31 +232,32 @@
      *                            [reference-stmt stmtsep]
      *                        "}")
      */
-    extensionStatement : EXTENSION_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE extensionBody RIGHT_CURLY_BRACE);
-    extensionBody : argumentStatement? statusStatement? descriptionStatement? referenceStatement?
-                   | argumentStatement? statusStatement? referenceStatement? descriptionStatement?
-                   | argumentStatement? descriptionStatement? statusStatement? referenceStatement?
-                   | argumentStatement? descriptionStatement? referenceStatement? statusStatement?
-                   | argumentStatement? referenceStatement? descriptionStatement? statusStatement?
-                   | argumentStatement? referenceStatement? statusStatement? descriptionStatement?
-                   | statusStatement? referenceStatement? argumentStatement? descriptionStatement?
-                   | statusStatement? referenceStatement? descriptionStatement? argumentStatement?
-                   | statusStatement? descriptionStatement? referenceStatement? argumentStatement?
-                   | statusStatement? descriptionStatement? argumentStatement? referenceStatement?
-                   | statusStatement? argumentStatement? referenceStatement? descriptionStatement?
-                   | statusStatement? argumentStatement? descriptionStatement? referenceStatement?
-                   | descriptionStatement? argumentStatement? statusStatement? referenceStatement?
-                   | descriptionStatement? argumentStatement? referenceStatement? statusStatement?
-                   | descriptionStatement? statusStatement? argumentStatement? referenceStatement?
-                   | descriptionStatement? statusStatement? referenceStatement? argumentStatement?
-                   | descriptionStatement? referenceStatement? statusStatement? argumentStatement?
-                   | descriptionStatement? referenceStatement? argumentStatement? statusStatement?
-                   | referenceStatement? descriptionStatement? argumentStatement? statusStatement?
-                   | referenceStatement? descriptionStatement? statusStatement? argumentStatement?
-                   | referenceStatement? statusStatement? argumentStatement? descriptionStatement?
-                   | referenceStatement? statusStatement? descriptionStatement? argumentStatement?
-                   | referenceStatement? argumentStatement? descriptionStatement? statusStatement?
-                   | referenceStatement? argumentStatement? statusStatement? descriptionStatement?
+    extensionStatement : EXTENSION_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE
+             stmtSep extensionBody RIGHT_CURLY_BRACE);
+    extensionBody : (argumentStatement stmtSep)? (statusStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)?
+                   | (argumentStatement stmtSep)? (statusStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)?
+                   | (argumentStatement stmtSep)? (descriptionStatement stmtSep)? (statusStatement stmtSep)? (referenceStatement stmtSep)?
+                   | (argumentStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (statusStatement stmtSep)?
+                   | (argumentStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (statusStatement stmtSep)?
+                   | (argumentStatement stmtSep)? (referenceStatement stmtSep)? (statusStatement stmtSep)? (descriptionStatement stmtSep)?
+                   | (statusStatement stmtSep)? (referenceStatement stmtSep)? (argumentStatement stmtSep)? (descriptionStatement stmtSep)?
+                   | (statusStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (argumentStatement stmtSep)?
+                   | (statusStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (argumentStatement stmtSep)?
+                   | (statusStatement stmtSep)? (descriptionStatement stmtSep)? (argumentStatement stmtSep)? (referenceStatement stmtSep)?
+                   | (statusStatement stmtSep)? (argumentStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)?
+                   | (statusStatement stmtSep)? (argumentStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)?
+                   | (descriptionStatement stmtSep)? (argumentStatement stmtSep)? (statusStatement stmtSep)? (referenceStatement stmtSep)?
+                   | (descriptionStatement stmtSep)? (argumentStatement stmtSep)? (referenceStatement stmtSep)? (statusStatement stmtSep)?
+                   | (descriptionStatement stmtSep)? (statusStatement stmtSep)? (argumentStatement stmtSep)? (referenceStatement stmtSep)?
+                   | (descriptionStatement stmtSep)? (statusStatement stmtSep)? (referenceStatement stmtSep)? (argumentStatement stmtSep)?
+                   | (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (statusStatement stmtSep)? (argumentStatement stmtSep)?
+                   | (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (argumentStatement stmtSep)? (statusStatement stmtSep)?
+                   | (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (argumentStatement stmtSep)? (statusStatement stmtSep)?
+                   | (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (statusStatement stmtSep)? (argumentStatement stmtSep)?
+                   | (referenceStatement stmtSep)? (statusStatement stmtSep)? (argumentStatement stmtSep)? (descriptionStatement stmtSep)?
+                   | (referenceStatement stmtSep)? (statusStatement stmtSep)? (descriptionStatement stmtSep)? (argumentStatement stmtSep)?
+                   | (referenceStatement stmtSep)? (argumentStatement stmtSep)? (descriptionStatement stmtSep)? (statusStatement stmtSep)?
+                   | (referenceStatement stmtSep)? (argumentStatement stmtSep)? (statusStatement stmtSep)? (descriptionStatement stmtSep)?
                    ;
 
     /**
@@ -270,14 +267,16 @@
      *                            [yin-element-stmt stmtsep]
      *                        "}")
      */
-    argumentStatement : ARGUMENT_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE argumentBody RIGHT_CURLY_BRACE);
-    argumentBody : yinElementStatement?;
+    argumentStatement : ARGUMENT_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE
+              stmtSep argumentBody RIGHT_CURLY_BRACE);
+    argumentBody : (yinElementStatement stmtSep)?;
 
     /**
      * yin-element-stmt    = yin-element-keyword sep yin-element-arg-str
      *                       stmtend
      */
-    yinElementStatement : YIN_ELEMENT_KEYWORD (TRUE_KEYWORD | FALSE_KEYWORD) STMTEND;
+    yinElementStatement : YIN_ELEMENT_KEYWORD (TRUE_KEYWORD | FALSE_KEYWORD)
+            stmtEnd;
 
     /**
      * identity-stmt       = identity-keyword sep identifier-arg-str optsep
@@ -290,32 +289,32 @@
      *                            [reference-stmt stmtsep]
      *                        "}")
      */
-    identityStatement : IDENTITY_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE identityBody RIGHT_CURLY_BRACE);
-    identityBody : baseStatement? statusStatement? descriptionStatement? referenceStatement?
-                  | baseStatement? statusStatement? referenceStatement? descriptionStatement?
-                  | baseStatement? descriptionStatement? statusStatement? referenceStatement?
-                  | baseStatement? descriptionStatement? referenceStatement? statusStatement?
-                  | baseStatement? referenceStatement? descriptionStatement? statusStatement?
-                  | baseStatement? referenceStatement? statusStatement? descriptionStatement?
-                  | referenceStatement? baseStatement? statusStatement? descriptionStatement?
-                  | referenceStatement? baseStatement? descriptionStatement? statusStatement?
-                  | referenceStatement? statusStatement? baseStatement? descriptionStatement?
-                  | referenceStatement? statusStatement? descriptionStatement? baseStatement?
-                  | referenceStatement? descriptionStatement? statusStatement? baseStatement?
-                  | referenceStatement? descriptionStatement? baseStatement? statusStatement?
-                  | descriptionStatement? referenceStatement? statusStatement? baseStatement?
-                  | descriptionStatement? referenceStatement? statusStatement? baseStatement?
-                  | descriptionStatement? referenceStatement? baseStatement? statusStatement?
-                  | descriptionStatement? statusStatement? baseStatement? referenceStatement?
-                  | descriptionStatement? statusStatement? referenceStatement? baseStatement?
-                  | descriptionStatement? baseStatement? referenceStatement? statusStatement?
-                  | descriptionStatement? baseStatement? statusStatement? referenceStatement?
-                  | statusStatement? baseStatement? descriptionStatement? referenceStatement?
-                  | statusStatement? baseStatement? referenceStatement? descriptionStatement?
-                  | statusStatement? descriptionStatement? baseStatement? referenceStatement?
-                  | statusStatement? descriptionStatement? referenceStatement? baseStatement?
-                  | statusStatement? referenceStatement? descriptionStatement? baseStatement?
-                  | statusStatement? referenceStatement? baseStatement? descriptionStatement?
+    identityStatement : IDENTITY_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE
+             stmtSep identityBody RIGHT_CURLY_BRACE);
+    identityBody : (baseStatement stmtSep)? (statusStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)?
+                  | (baseStatement stmtSep)? (statusStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)?
+                  | (baseStatement stmtSep)? (descriptionStatement stmtSep)? (statusStatement stmtSep)? (referenceStatement stmtSep)?
+                  | (baseStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (statusStatement stmtSep)?
+                  | (baseStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (statusStatement stmtSep)?
+                  | (baseStatement stmtSep)? (referenceStatement stmtSep)? (statusStatement stmtSep)? (descriptionStatement stmtSep)?
+                  | (referenceStatement stmtSep)? (baseStatement stmtSep)? (statusStatement stmtSep)? (descriptionStatement stmtSep)?
+                  | (referenceStatement stmtSep)? (baseStatement stmtSep)? (descriptionStatement stmtSep)? (statusStatement stmtSep)?
+                  | (referenceStatement stmtSep)? (statusStatement stmtSep)? (baseStatement stmtSep)? (descriptionStatement stmtSep)?
+                  | (referenceStatement stmtSep)? (statusStatement stmtSep)? (descriptionStatement stmtSep)? (baseStatement stmtSep)?
+                  | (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (statusStatement stmtSep)? (baseStatement stmtSep)?
+                  | (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (baseStatement stmtSep)? (statusStatement stmtSep)?
+                  | (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (statusStatement stmtSep)? (baseStatement stmtSep)?
+                  | (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (baseStatement stmtSep)? (statusStatement stmtSep)?
+                  | (descriptionStatement stmtSep)? (statusStatement stmtSep)? (baseStatement stmtSep)? (referenceStatement stmtSep)?
+                  | (descriptionStatement stmtSep)? (statusStatement stmtSep)? (referenceStatement stmtSep)? (baseStatement stmtSep)?
+                  | (descriptionStatement stmtSep)? (baseStatement stmtSep)? (referenceStatement stmtSep)? (statusStatement stmtSep)?
+                  | (descriptionStatement stmtSep)? (baseStatement stmtSep)? (statusStatement stmtSep)? (referenceStatement stmtSep)?
+                  | (statusStatement stmtSep)? (baseStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)?
+                  | (statusStatement stmtSep)? (baseStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)?
+                  | (statusStatement stmtSep)? (descriptionStatement stmtSep)? (baseStatement stmtSep)? (referenceStatement stmtSep)?
+                  | (statusStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (baseStatement stmtSep)?
+                  | (statusStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (baseStatement stmtSep)?
+                  | (statusStatement stmtSep)? (referenceStatement stmtSep)? (baseStatement stmtSep)? (descriptionStatement stmtSep)?
                   ;
 
     /**
@@ -323,7 +322,7 @@
      *                          optsep stmtend*
      * identifier-ref-arg  = [prefix ":"] identifier
      */
-    baseStatement : BASE_KEYWORD string STMTEND;
+    baseStatement : BASE_KEYWORD string stmtEnd;
 
     /**
      *  feature-stmt        = feature-keyword sep identifier-arg-str optsep
@@ -336,31 +335,32 @@
      *                             [reference-stmt stmtsep]
      *                         "}")
      */
-    featureStatement : FEATURE_KEYWORD string (STMTEND | LEFT_CURLY_BRACE featureBody RIGHT_CURLY_BRACE);
-    featureBody : ifFeatureStatement* statusStatement? descriptionStatement? referenceStatement?
-                 | ifFeatureStatement* statusStatement? referenceStatement? descriptionStatement?
-                 | ifFeatureStatement* descriptionStatement? statusStatement? referenceStatement?
-                 | ifFeatureStatement* descriptionStatement? referenceStatement? statusStatement?
-                 | ifFeatureStatement* referenceStatement? statusStatement? descriptionStatement?
-                 | ifFeatureStatement* referenceStatement? descriptionStatement? statusStatement?
-                 | statusStatement? ifFeatureStatement* descriptionStatement? referenceStatement?
-                 | statusStatement? ifFeatureStatement* referenceStatement? descriptionStatement?
-                 | statusStatement? descriptionStatement? ifFeatureStatement* referenceStatement?
-                 | statusStatement? descriptionStatement? referenceStatement? ifFeatureStatement*
-                 | statusStatement? referenceStatement? ifFeatureStatement* descriptionStatement?
-                 | statusStatement? referenceStatement? descriptionStatement? ifFeatureStatement*
-                 | descriptionStatement? ifFeatureStatement* statusStatement? referenceStatement?
-                 | descriptionStatement? ifFeatureStatement* referenceStatement? statusStatement?
-                 | descriptionStatement? statusStatement? ifFeatureStatement* referenceStatement?
-                 | descriptionStatement? statusStatement? referenceStatement? ifFeatureStatement*
-                 | descriptionStatement? referenceStatement* statusStatement? ifFeatureStatement*
-                 | descriptionStatement? referenceStatement* ifFeatureStatement? statusStatement?
-                 | referenceStatement? ifFeatureStatement* statusStatement? descriptionStatement?
-                 | referenceStatement? ifFeatureStatement* descriptionStatement? statusStatement?
-                 | referenceStatement? descriptionStatement? statusStatement? ifFeatureStatement*
-                 | referenceStatement? descriptionStatement? ifFeatureStatement* statusStatement?
-                 | referenceStatement? statusStatement? descriptionStatement? ifFeatureStatement*
-                 | referenceStatement? statusStatement? ifFeatureStatement* descriptionStatement?
+    featureStatement : FEATURE_KEYWORD string (STMTEND | LEFT_CURLY_BRACE
+            stmtSep featureBody RIGHT_CURLY_BRACE);
+    featureBody : (ifFeatureStatement stmtSep)* (statusStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)?
+                 | (ifFeatureStatement stmtSep)* (statusStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)?
+                 | (ifFeatureStatement stmtSep)* (descriptionStatement stmtSep)? (statusStatement stmtSep)? (referenceStatement stmtSep)?
+                 | (ifFeatureStatement stmtSep)* (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (statusStatement stmtSep)?
+                 | (ifFeatureStatement stmtSep)* (referenceStatement stmtSep)? (statusStatement stmtSep)? (descriptionStatement stmtSep)?
+                 | (ifFeatureStatement stmtSep)* (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (statusStatement stmtSep)?
+                 | (statusStatement stmtSep)? (ifFeatureStatement stmtSep)* (descriptionStatement stmtSep)? (referenceStatement stmtSep)?
+                 | (statusStatement stmtSep)? (ifFeatureStatement stmtSep)* (referenceStatement stmtSep)? (descriptionStatement stmtSep)?
+                 | (statusStatement stmtSep)? (descriptionStatement stmtSep)? (ifFeatureStatement stmtSep)* (referenceStatement stmtSep)?
+                 | (statusStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (ifFeatureStatement stmtSep)*
+                 | (statusStatement stmtSep)? (referenceStatement stmtSep)? (ifFeatureStatement stmtSep)* (descriptionStatement stmtSep)?
+                 | (statusStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (ifFeatureStatement stmtSep)*
+                 | (descriptionStatement stmtSep)? (ifFeatureStatement stmtSep)* (statusStatement stmtSep)? (referenceStatement stmtSep)?
+                 | (descriptionStatement stmtSep)? (ifFeatureStatement stmtSep)* (referenceStatement stmtSep)? (statusStatement stmtSep)?
+                 | (descriptionStatement stmtSep)? (statusStatement stmtSep)? (ifFeatureStatement stmtSep)* (referenceStatement stmtSep)?
+                 | (descriptionStatement stmtSep)? (statusStatement stmtSep)? (referenceStatement stmtSep)? (ifFeatureStatement stmtSep)*
+                 | (descriptionStatement stmtSep)? (referenceStatement stmtSep)* (statusStatement stmtSep)? (ifFeatureStatement stmtSep)*
+                 | (descriptionStatement stmtSep)? (referenceStatement stmtSep)* (ifFeatureStatement stmtSep)? (statusStatement stmtSep)?
+                 | (referenceStatement stmtSep)? (ifFeatureStatement stmtSep)* (statusStatement stmtSep)? (descriptionStatement stmtSep)?
+                 | (referenceStatement stmtSep)? (ifFeatureStatement stmtSep)* (descriptionStatement stmtSep)? (statusStatement stmtSep)?
+                 | (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (statusStatement stmtSep)? (ifFeatureStatement stmtSep)*
+                 | (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (ifFeatureStatement stmtSep)* (statusStatement stmtSep)?
+                 | (referenceStatement stmtSep)? (statusStatement stmtSep)? (descriptionStatement stmtSep)? (ifFeatureStatement stmtSep)*
+                 | (referenceStatement stmtSep)? (statusStatement stmtSep)? (ifFeatureStatement stmtSep)* (descriptionStatement stmtSep)?
                  ;
 
     /**
@@ -384,12 +384,12 @@
      *  if-feature-stmt     = if-feature-keyword sep identifier-ref-arg-str
      *                        optsep stmtend
      */
-    ifFeatureStatement : IF_FEATURE_KEYWORD string STMTEND;
+    ifFeatureStatement : IF_FEATURE_KEYWORD string stmtEnd;
 
     /**
     *    units-stmt          = units-keyword sep string optsep stmtend
     */
-    unitsStatement : UNITS_KEYWORD string STMTEND;
+    unitsStatement : UNITS_KEYWORD string stmtEnd;
 
     /**
      *   typedef-stmt        = typedef-keyword sep identifier-arg-str optsep
@@ -405,8 +405,10 @@
      * TODO : 0..1 occurance to be validated in listener
      */
     typedefStatement : TYPEDEF_KEYWORD identifier LEFT_CURLY_BRACE
-                   (typeStatement | unitsStatement | defaultStatement | statusStatement | descriptionStatement | referenceStatement)*
-                   RIGHT_CURLY_BRACE;
+             stmtSep ((typeStatement stmtSep) | (unitsStatement stmtSep)
+             | (defaultStatement stmtSep) | (statusStatement stmtSep)
+             | (descriptionStatement stmtSep) | (referenceStatement stmtSep))*
+             RIGHT_CURLY_BRACE;
 
     /**
      *  type-stmt           = type-keyword sep identifier-ref-arg-str optsep
@@ -415,7 +417,8 @@
      *                            type-body-stmts
      *                         "}")
      */
-    typeStatement : TYPE_KEYWORD string (STMTEND | LEFT_CURLY_BRACE typeBodyStatements RIGHT_CURLY_BRACE);
+    typeStatement : TYPE_KEYWORD string (STMTEND | LEFT_CURLY_BRACE
+            stmtSep typeBodyStatements RIGHT_CURLY_BRACE);
 
     /**
      *  type-body-stmts     = numerical-restrictions /
@@ -451,12 +454,12 @@
      *                              "5" / "6" / "7" / "8"])
      *                        / "2" / "3" / "4" / "5" / "6" / "7" / "8" / "9"
      */
-    fractionDigitStatement : FRACTION_DIGITS_KEYWORD fraction STMTEND;
+    fractionDigitStatement : FRACTION_DIGITS_KEYWORD fraction stmtEnd;
 
     /**
      *  numerical-restrictions = range-stmt stmtsep
      */
-    numericalRestrictions : rangeStatement;
+    numericalRestrictions : rangeStatement stmtSep;
 
     /**
      *  range-stmt          = range-keyword sep range-arg-str optsep
@@ -469,32 +472,33 @@
      *                             [reference-stmt stmtsep]
      *                          "}")
      */
-    rangeStatement : RANGE_KEYWORD range (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE);
+    rangeStatement : RANGE_KEYWORD range (STMTEND | LEFT_CURLY_BRACE
+             stmtSep commonStatements RIGHT_CURLY_BRACE);
 
-    commonStatements : errorMessageStatement? errorAppTagStatement? descriptionStatement? referenceStatement?
-                 | errorMessageStatement? errorAppTagStatement? referenceStatement? descriptionStatement?
-                 | errorMessageStatement? descriptionStatement? errorAppTagStatement? referenceStatement?
-                 | errorMessageStatement? descriptionStatement? referenceStatement? errorAppTagStatement?
-                 | errorMessageStatement? referenceStatement? errorAppTagStatement? descriptionStatement?
-                 | errorMessageStatement? referenceStatement? descriptionStatement? errorAppTagStatement?
-                 | errorAppTagStatement? errorMessageStatement? descriptionStatement? referenceStatement?
-                 | errorAppTagStatement? errorMessageStatement? referenceStatement? descriptionStatement?
-                 | errorAppTagStatement? descriptionStatement? descriptionStatement? errorMessageStatement?
-                 | errorAppTagStatement? descriptionStatement? errorMessageStatement? descriptionStatement?
-                 | errorAppTagStatement? referenceStatement? errorMessageStatement? descriptionStatement?
-                 | errorAppTagStatement? referenceStatement? descriptionStatement? errorMessageStatement?
-                 | descriptionStatement? errorMessageStatement? errorAppTagStatement? referenceStatement?
-                 | descriptionStatement? errorMessageStatement? referenceStatement? errorAppTagStatement?
-                 | descriptionStatement? errorAppTagStatement? errorMessageStatement? referenceStatement?
-                 | descriptionStatement? errorAppTagStatement? referenceStatement? errorMessageStatement?
-                 | descriptionStatement? referenceStatement? errorMessageStatement? errorAppTagStatement?
-                 | descriptionStatement? referenceStatement? errorAppTagStatement? errorMessageStatement?
-                 | referenceStatement? errorMessageStatement? descriptionStatement? errorAppTagStatement?
-                 | referenceStatement? errorMessageStatement? errorAppTagStatement? descriptionStatement?
-                 | referenceStatement? errorAppTagStatement? descriptionStatement? errorMessageStatement?
-                 | referenceStatement? errorAppTagStatement? errorMessageStatement? descriptionStatement?
-                 | referenceStatement? descriptionStatement? errorMessageStatement? errorAppTagStatement?
-                 | referenceStatement? descriptionStatement? errorAppTagStatement? errorMessageStatement?
+    commonStatements : (errorMessageStatement stmtSep)? (errorAppTagStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)?
+                 | (errorMessageStatement stmtSep)? (errorAppTagStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)?
+                 | (errorMessageStatement stmtSep)? (descriptionStatement stmtSep)? (errorAppTagStatement stmtSep)? (referenceStatement stmtSep)?
+                 | (errorMessageStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (errorAppTagStatement stmtSep)?
+                 | (errorMessageStatement stmtSep)? (referenceStatement stmtSep)? (errorAppTagStatement stmtSep)? (descriptionStatement stmtSep)?
+                 | (errorMessageStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (errorAppTagStatement stmtSep)?
+                 | (errorAppTagStatement stmtSep)? (errorMessageStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)?
+                 | (errorAppTagStatement stmtSep)? (errorMessageStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)?
+                 | (errorAppTagStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (errorMessageStatement stmtSep)?
+                 | (errorAppTagStatement stmtSep)? (descriptionStatement stmtSep)? (errorMessageStatement stmtSep)? (referenceStatement stmtSep)?
+                 | (errorAppTagStatement stmtSep)? (referenceStatement stmtSep)? (errorMessageStatement stmtSep)? (descriptionStatement stmtSep)?
+                 | (errorAppTagStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (errorMessageStatement stmtSep)?
+                 | (descriptionStatement stmtSep)? (errorMessageStatement stmtSep)? (errorAppTagStatement stmtSep)? (referenceStatement stmtSep)?
+                 | (descriptionStatement stmtSep)? (errorMessageStatement stmtSep)? (referenceStatement stmtSep)? (errorAppTagStatement stmtSep)?
+                 | (descriptionStatement stmtSep)? (errorAppTagStatement stmtSep)? (errorMessageStatement stmtSep)? (referenceStatement stmtSep)?
+                 | (descriptionStatement stmtSep)? (errorAppTagStatement stmtSep)? (referenceStatement stmtSep)? (errorMessageStatement stmtSep)?
+                 | (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (errorMessageStatement stmtSep)? (errorAppTagStatement stmtSep)?
+                 | (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (errorAppTagStatement stmtSep)? (errorMessageStatement stmtSep)?
+                 | (referenceStatement stmtSep)? (errorMessageStatement stmtSep)? (descriptionStatement stmtSep)? (errorAppTagStatement stmtSep)?
+                 | (referenceStatement stmtSep)? (errorMessageStatement stmtSep)? (errorAppTagStatement stmtSep)? (descriptionStatement stmtSep)?
+                 | (referenceStatement stmtSep)? (errorAppTagStatement stmtSep)? (descriptionStatement stmtSep)? (errorMessageStatement stmtSep)?
+                 | (referenceStatement stmtSep)? (errorAppTagStatement stmtSep)? (errorMessageStatement stmtSep)? (descriptionStatement stmtSep)?
+                 | (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (errorMessageStatement stmtSep)? (errorAppTagStatement stmtSep)?
+                 | (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (errorAppTagStatement stmtSep)? (errorMessageStatement stmtSep)?
                  ;
 
     /**
@@ -502,7 +506,8 @@
      *                        [length-stmt stmtsep]
      *                        *(pattern-stmt stmtsep)
      */
-    stringRestrictions : ((lengthStatement)? (patternStatement)*) | ((patternStatement)* (lengthStatement)?);
+    stringRestrictions : ((lengthStatement stmtSep)? (patternStatement stmtSep)*)
+             | ((patternStatement stmtSep)* (lengthStatement stmtSep)?);
 
     /**
      *  length-stmt         = length-keyword sep length-arg-str optsep
@@ -515,8 +520,8 @@
      *                             [reference-stmt stmtsep]
      *                          "}")
      */
-    lengthStatement : LENGTH_KEYWORD length
-                  (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE);
+    lengthStatement : LENGTH_KEYWORD length (STMTEND | LEFT_CURLY_BRACE
+              stmtSep commonStatements RIGHT_CURLY_BRACE);
 
     /**
      *  pattern-stmt        = pattern-keyword sep string optsep
@@ -529,17 +534,18 @@
      *                             [reference-stmt stmtsep]
      *                          "}")
      */
-    patternStatement : PATTERN_KEYWORD string (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE);
+    patternStatement : PATTERN_KEYWORD string (STMTEND | LEFT_CURLY_BRACE
+              stmtSep commonStatements RIGHT_CURLY_BRACE);
 
     /**
      *  default-stmt        = default-keyword sep string stmtend
      */
-    defaultStatement : DEFAULT_KEYWORD string STMTEND;
+    defaultStatement : DEFAULT_KEYWORD string stmtEnd;
 
     /**
      *  enum-specification  = 1*(enum-stmt stmtsep)
      */
-    enumSpecification : enumStatement+;
+    enumSpecification : (enumStatement stmtSep)+;
 
     /**
      *  enum-stmt           = enum-keyword sep string optsep
@@ -552,32 +558,33 @@
      *                             [reference-stmt stmtsep]
      *                          "}")
      */
-    enumStatement : ENUM_KEYWORD string (STMTEND | LEFT_CURLY_BRACE enumStatementBody RIGHT_CURLY_BRACE);
+    enumStatement : ENUM_KEYWORD string (STMTEND | LEFT_CURLY_BRACE
+             stmtSep 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?
+    enumStatementBody : (valueStatement stmtSep)? (statusStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)?
+                   | (valueStatement stmtSep)? (statusStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)?
+                   | (valueStatement stmtSep)? (descriptionStatement stmtSep)? (statusStatement stmtSep)? (referenceStatement stmtSep)?
+                   | (valueStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (statusStatement stmtSep)?
+                   | (valueStatement stmtSep)? (referenceStatement stmtSep)? (statusStatement stmtSep)? (descriptionStatement stmtSep)?
+                   | (valueStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (statusStatement stmtSep)?
+                   | (statusStatement stmtSep)? (valueStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)?
+                   | (statusStatement stmtSep)? (valueStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)?
+                   | (statusStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (valueStatement stmtSep)?
+                   | (statusStatement stmtSep)? (descriptionStatement stmtSep)? (valueStatement stmtSep)? (referenceStatement stmtSep)?
+                   | (statusStatement stmtSep)? (referenceStatement stmtSep)? (valueStatement stmtSep)? (descriptionStatement stmtSep)?
+                   | (statusStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (valueStatement stmtSep)?
+                   | (descriptionStatement stmtSep)? (valueStatement stmtSep)? (statusStatement stmtSep)? (referenceStatement stmtSep)?
+                   | (descriptionStatement stmtSep)? (valueStatement stmtSep)? (referenceStatement stmtSep)? (statusStatement stmtSep)?
+                   | (descriptionStatement stmtSep)? (statusStatement stmtSep)? (valueStatement stmtSep)? (referenceStatement stmtSep)?
+                   | (descriptionStatement stmtSep)? (statusStatement stmtSep)? (referenceStatement stmtSep)? (valueStatement stmtSep)?
+                   | (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (valueStatement stmtSep)? (statusStatement stmtSep)?
+                   | (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (statusStatement stmtSep)? (valueStatement stmtSep)?
+                   | (referenceStatement stmtSep)? (valueStatement stmtSep)? (descriptionStatement stmtSep)? (statusStatement stmtSep)?
+                   | (referenceStatement stmtSep)? (valueStatement stmtSep)? (statusStatement stmtSep)? (descriptionStatement stmtSep)?
+                   | (referenceStatement stmtSep)? (statusStatement stmtSep)? (descriptionStatement stmtSep)? (valueStatement stmtSep)?
+                   | (referenceStatement stmtSep)? (statusStatement stmtSep)? (valueStatement stmtSep)? (descriptionStatement stmtSep)?
+                   | (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (valueStatement stmtSep)? (statusStatement stmtSep)?
+                   | (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (statusStatement stmtSep)? (valueStatement stmtSep)?
                    ;
 
     /**
@@ -586,12 +593,13 @@
      *                        path-stmt stmtsep
      *                        [require-instance-stmt stmtsep]
      */
-    leafrefSpecification : (pathStatement (requireInstanceStatement)?) | ((requireInstanceStatement)? pathStatement);
+    leafrefSpecification : (pathStatement stmtSep (requireInstanceStatement stmtSep)?)
+             | ((requireInstanceStatement stmtSep)? pathStatement stmtSep);
 
     /**
      *  path-stmt           = path-keyword sep path-arg-str stmtend
      */
-    pathStatement : PATH_KEYWORD path STMTEND;
+    pathStatement : PATH_KEYWORD path stmtEnd;
 
     /**
      *  require-instance-stmt = require-instance-keyword sep
@@ -600,29 +608,29 @@
      *                             require-instance-arg >
      *  require-instance-arg = true-keyword / false-keyword
      */
-    requireInstanceStatement : REQUIRE_INSTANCE_KEYWORD requireInstance STMTEND;
+    requireInstanceStatement : REQUIRE_INSTANCE_KEYWORD requireInstance stmtEnd;
 
     /**
      *  instance-identifier-specification =
      *                        [require-instance-stmt stmtsep]
      */
-    instanceIdentifierSpecification : requireInstanceStatement?;
+    instanceIdentifierSpecification : (requireInstanceStatement stmtSep)?;
 
     /**
      * identityref-specification =
      *                        base-stmt stmtsep
      */
-    identityrefSpecification : baseStatement;
+    identityrefSpecification : baseStatement stmtSep;
 
     /**
      *  union-specification = 1*(type-stmt stmtsep)
      */
-    unionSpecification : typeStatement+;
+    unionSpecification : (typeStatement stmtSep)+;
 
     /**
      *  bits-specification  = 1*(bit-stmt stmtsep)
      */
-    bitsSpecification : bitStatement+;
+    bitsSpecification : (bitStatement stmtSep)+;
 
     /**
      * bit-stmt            = bit-keyword sep identifier-arg-str optsep
@@ -636,32 +644,33 @@
      *                          "}"
      *                        "}")
      */
-    bitStatement : BIT_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE bitBodyStatement RIGHT_CURLY_BRACE);
+    bitStatement : BIT_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE
+             stmtSep 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?
+    bitBodyStatement : (positionStatement stmtSep)? (statusStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)?
+                  | (positionStatement stmtSep)? (statusStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)?
+                  | (positionStatement stmtSep)? (descriptionStatement stmtSep)? (statusStatement stmtSep)? (referenceStatement stmtSep)?
+                  | (positionStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (statusStatement stmtSep)?
+                  | (positionStatement stmtSep)? (referenceStatement stmtSep)? (statusStatement stmtSep)? (descriptionStatement stmtSep)?
+                  | (positionStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (statusStatement stmtSep)?
+                  | (statusStatement stmtSep)? (positionStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)?
+                  | (statusStatement stmtSep)? (positionStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)?
+                  | (statusStatement stmtSep)? (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (positionStatement stmtSep)?
+                  | (statusStatement stmtSep)? (descriptionStatement stmtSep)? (positionStatement stmtSep)? (referenceStatement stmtSep)?
+                  | (statusStatement stmtSep)? (referenceStatement stmtSep)? (positionStatement stmtSep)? (descriptionStatement stmtSep)?
+                  | (statusStatement stmtSep)? (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (positionStatement stmtSep)?
+                  | (descriptionStatement stmtSep)? (positionStatement stmtSep)? (statusStatement stmtSep)? (referenceStatement stmtSep)?
+                  | (descriptionStatement stmtSep)? (positionStatement stmtSep)? (referenceStatement stmtSep)? (statusStatement stmtSep)?
+                  | (descriptionStatement stmtSep)? (statusStatement stmtSep)? (positionStatement stmtSep)? (referenceStatement stmtSep)?
+                  | (descriptionStatement stmtSep)? (statusStatement stmtSep)? (referenceStatement stmtSep)? (positionStatement stmtSep)?
+                  | (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (positionStatement stmtSep)? (statusStatement stmtSep)?
+                  | (descriptionStatement stmtSep)? (referenceStatement stmtSep)? (statusStatement stmtSep)? (positionStatement stmtSep)?
+                  | (referenceStatement stmtSep)? (positionStatement stmtSep)? (descriptionStatement stmtSep)? (statusStatement stmtSep)?
+                  | (referenceStatement stmtSep)? (positionStatement stmtSep)? (statusStatement stmtSep)? (descriptionStatement stmtSep)?
+                  | (referenceStatement stmtSep)? (statusStatement stmtSep)? (descriptionStatement stmtSep)? (positionStatement stmtSep)?
+                  | (referenceStatement stmtSep)? (statusStatement stmtSep)? (positionStatement stmtSep)? (descriptionStatement stmtSep)?
+                  | (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (positionStatement stmtSep)? (statusStatement stmtSep)?
+                  | (referenceStatement stmtSep)? (descriptionStatement stmtSep)? (statusStatement stmtSep)? (positionStatement stmtSep)?
                   ;
 
     /**
@@ -671,7 +680,7 @@
      *                              position-value-arg >
      *  position-value-arg  = non-negative-integer-value
      */
-    positionStatement : POSITION_KEYWORD position STMTEND;
+    positionStatement : POSITION_KEYWORD position stmtEnd;
 
     /**
      *  status-stmt         = status-keyword sep status-arg-str stmtend
@@ -681,7 +690,7 @@
      *                        obsolete-keyword /
      *                        deprecated-keyword
      */
-    statusStatement : STATUS_KEYWORD status STMTEND;
+    statusStatement : STATUS_KEYWORD status stmtEnd;
 
     /**
      *  config-stmt         = config-keyword sep
@@ -701,12 +710,12 @@
      *
      *  mandatory-arg       = true-keyword / false-keyword
      */
-    mandatoryStatement : MANDATORY_KEYWORD mandatory STMTEND;
+    mandatoryStatement : MANDATORY_KEYWORD mandatory stmtEnd;
 
     /**
      *  presence-stmt       = presence-keyword sep string stmtend
      */
-    presenceStatement : PRESENCE_KEYWORD string STMTEND;
+    presenceStatement : PRESENCE_KEYWORD string stmtEnd;
 
     /**
      *  ordered-by-stmt     = ordered-by-keyword sep
@@ -717,7 +726,7 @@
      *
      *  ordered-by-arg      = user-keyword / system-keyword
      */
-    orderedByStatement : ORDERED_BY_KEYWORD orderedBy STMTEND;
+    orderedByStatement : ORDERED_BY_KEYWORD orderedBy stmtEnd;
 
     /**
      *  must-stmt           = must-keyword sep string optsep
@@ -730,17 +739,18 @@
      *                             [reference-stmt stmtsep]
      *                          "}")
      */
-    mustStatement : MUST_KEYWORD string (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE);
+    mustStatement : MUST_KEYWORD string (STMTEND | LEFT_CURLY_BRACE
+             stmtSep commonStatements RIGHT_CURLY_BRACE);
 
     /**
      *   error-message-stmt  = error-message-keyword sep string stmtend
      */
-    errorMessageStatement : ERROR_MESSAGE_KEYWORD string STMTEND;
+    errorMessageStatement : ERROR_MESSAGE_KEYWORD string stmtEnd;
 
     /**
      *  error-app-tag-stmt  = error-app-tag-keyword sep string stmtend
      */
-    errorAppTagStatement : ERROR_APP_TAG_KEYWORD string STMTEND;
+    errorAppTagStatement : ERROR_APP_TAG_KEYWORD string stmtEnd;
 
     /**
      *  min-elements-stmt   = min-elements-keyword sep
@@ -749,7 +759,7 @@
      *                          min-value-arg >
      *  min-value-arg       = non-negative-integer-value
      */
-    minElementsStatement : MIN_ELEMENTS_KEYWORD minValue STMTEND;
+    minElementsStatement : MIN_ELEMENTS_KEYWORD minValue stmtEnd;
 
     /**
      *  max-elements-stmt   = max-elements-keyword sep
@@ -759,12 +769,12 @@
      *  max-value-arg       = unbounded-keyword /
      *                        positive-integer-value
      */
-    maxElementsStatement :  MAX_ELEMENTS_KEYWORD maxValue STMTEND;
+    maxElementsStatement :  MAX_ELEMENTS_KEYWORD maxValue stmtEnd;
 
     /**
      *  value-stmt          = value-keyword sep integer-value stmtend
      */
-    valueStatement : VALUE_KEYWORD value STMTEND;
+    valueStatement : VALUE_KEYWORD value stmtEnd;
 
     /**
      *   grouping-stmt       = grouping-keyword sep identifier-arg-str optsep
@@ -778,11 +788,11 @@
      *                                grouping-stmt) stmtsep)
      *                             *(data-def-stmt stmtsep)
      *                         "}")
-     * TODO : 0..1 occurance to be checked in listener
      */
     groupingStatement : GROUPING_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE
-                      (statusStatement | descriptionStatement | referenceStatement | typedefStatement | groupingStatement
-                       | dataDefStatement)* RIGHT_CURLY_BRACE);
+            stmtSep ((statusStatement | descriptionStatement
+            | referenceStatement | typedefStatement | groupingStatement
+            | dataDefStatement) stmtSep)* RIGHT_CURLY_BRACE);
 
     /**
      *  container-stmt      = container-keyword sep identifier-arg-str optsep
@@ -803,12 +813,14 @@
      *                             [default-deny-write-stmt stmtsep]
      *                             [default-deny-all-stmt stmtsep]
      *                         "}")
-     * TODO : 0..1 occurrence to be checked in listener
      */
-    containerStatement : CONTAINER_KEYWORD identifier
-                     (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | mustStatement | presenceStatement | configStatement
-                     | statusStatement | descriptionStatement | referenceStatement | typedefStatement | groupingStatement
-                     | dataDefStatement | defaultDenyWriteStatement | defaultDenyAllStatement )* RIGHT_CURLY_BRACE);
+    containerStatement : CONTAINER_KEYWORD identifier (STMTEND |
+            LEFT_CURLY_BRACE stmtSep ((whenStatement | ifFeatureStatement
+            | mustStatement | presenceStatement | configStatement
+            | statusStatement | descriptionStatement | referenceStatement
+            | typedefStatement | groupingStatement | dataDefStatement
+            | defaultDenyWriteStatement | defaultDenyAllStatement) stmtSep)*
+            RIGHT_CURLY_BRACE);
 
     /**
      *  leaf-stmt           = leaf-keyword sep identifier-arg-str optsep
@@ -828,11 +840,14 @@
      *                            [default-deny-write-stmt stmtsep]
      *                            [default-deny-all-stmt stmtsep]
      *                         "}"
-     * TODO : 0..1 occurrence to be checked in listener
      */
-    leafStatement : LEAF_KEYWORD identifier LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | typeStatement | unitsStatement
-              | mustStatement | defaultStatement | configStatement | mandatoryStatement | statusStatement  | descriptionStatement
-              | referenceStatement | defaultDenyWriteStatement | defaultDenyAllStatement )* RIGHT_CURLY_BRACE;
+    leafStatement : LEAF_KEYWORD identifier LEFT_CURLY_BRACE stmtSep
+            ((whenStatement | ifFeatureStatement | typeStatement
+            | unitsStatement | mustStatement | defaultStatement
+            | configStatement | mandatoryStatement | statusStatement
+            | descriptionStatement | referenceStatement
+            | defaultDenyWriteStatement | defaultDenyAllStatement) stmtSep)*
+            RIGHT_CURLY_BRACE;
 
     /**
      *  leaf-list-stmt      = leaf-list-keyword sep identifier-arg-str optsep
@@ -853,12 +868,14 @@
      *                            [default-deny-write-stmt stmtsep]
      *                            [default-deny-all-stmt stmtsep]
      *                         "}"
-     * TODO : 0..1 occurance to be checked in listener
      */
-    leafListStatement : LEAF_LIST_KEYWORD identifier LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | typeStatement
-                     | unitsStatement | mustStatement | configStatement | minElementsStatement | maxElementsStatement | orderedByStatement
-                     | statusStatement | descriptionStatement | referenceStatement
-                     | defaultDenyWriteStatement | defaultDenyAllStatement )* RIGHT_CURLY_BRACE;
+    leafListStatement : LEAF_LIST_KEYWORD identifier LEFT_CURLY_BRACE stmtSep
+            ((whenStatement | ifFeatureStatement | typeStatement
+            | unitsStatement | mustStatement | configStatement
+            | minElementsStatement | maxElementsStatement | orderedByStatement
+            | statusStatement | descriptionStatement | referenceStatement
+            | defaultDenyWriteStatement | defaultDenyAllStatement) stmtSep)*
+            RIGHT_CURLY_BRACE;
 
     /**
      *  list-stmt           = list-keyword sep identifier-arg-str optsep
@@ -882,22 +899,24 @@
      *                               grouping-stmt) stmtsep)
      *                            1*(data-def-stmt stmtsep)
      *                         "}"
-     * TODO : 0..1 occurance to be checked in listener
      */
-    listStatement : LIST_KEYWORD identifier LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | mustStatement | keyStatement
-              | uniqueStatement | configStatement | minElementsStatement | maxElementsStatement | orderedByStatement | statusStatement
-              | descriptionStatement | referenceStatement | defaultDenyWriteStatement | defaultDenyAllStatement
-              | typedefStatement | groupingStatement| dataDefStatement)* RIGHT_CURLY_BRACE;
+    listStatement : LIST_KEYWORD identifier LEFT_CURLY_BRACE stmtSep
+            ((whenStatement | ifFeatureStatement | mustStatement | keyStatement
+            | uniqueStatement | configStatement | minElementsStatement
+            | maxElementsStatement | orderedByStatement | statusStatement
+            | descriptionStatement | referenceStatement | defaultDenyWriteStatement
+            | defaultDenyAllStatement | typedefStatement | groupingStatement|
+             dataDefStatement) stmtSep)* RIGHT_CURLY_BRACE;
 
     /**
      *  key-stmt            = key-keyword sep key-arg-str stmtend
      */
-    keyStatement : KEY_KEYWORD key STMTEND;
+    keyStatement : KEY_KEYWORD key stmtEnd;
 
     /**
      *  unique-stmt         = unique-keyword sep unique-arg-str stmtend
      */
-    uniqueStatement: UNIQUE_KEYWORD unique STMTEND;
+    uniqueStatement: UNIQUE_KEYWORD unique stmtEnd;
 
     /**
      *  choice-stmt         = choice-keyword sep identifier-arg-str optsep
@@ -913,12 +932,16 @@
      *                             [description-stmt stmtsep]
      *                             [reference-stmt stmtsep]
      *                             *((short-case-stmt / case-stmt) stmtsep)
+     *                             [default-deny-write-stmt stmtsep]
+     *                             [default-deny-all-stmt stmtsep]
      *                         "}")
-     * TODO : 0..1 occurance to be checked in listener
      */
-    choiceStatement : CHOICE_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | defaultStatement
-                  | configStatement | mandatoryStatement | statusStatement | descriptionStatement | referenceStatement | shortCaseStatement
-                  | caseStatement)* RIGHT_CURLY_BRACE);
+    choiceStatement : CHOICE_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE
+            stmtSep ((whenStatement | ifFeatureStatement | defaultStatement
+            | configStatement | mandatoryStatement | statusStatement
+            | descriptionStatement | referenceStatement | shortCaseStatement
+            | caseStatement | defaultDenyAllStatement
+            | defaultDenyWriteStatement) stmtSep)* RIGHT_CURLY_BRACE);
 
     /**
      *  short-case-stmt     = container-stmt /
@@ -927,7 +950,8 @@
      *                        list-stmt /
      *                        anyxml-stmt
      */
-    shortCaseStatement : containerStatement | leafStatement | leafListStatement | listStatement | anyxmlStatement;
+    shortCaseStatement : containerStatement | leafStatement | leafListStatement
+            | listStatement | anyxmlStatement;
 
     /**
      *  case-stmt           = case-keyword sep identifier-arg-str optsep
@@ -941,10 +965,11 @@
      *                             [reference-stmt stmtsep]
      *                             *(data-def-stmt stmtsep)
      *                         "}")
-     * TODO : 0..1 occurance to be checked in listener
      */
-    caseStatement : CASE_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | statusStatement
-              | descriptionStatement | referenceStatement | dataDefStatement)* RIGHT_CURLY_BRACE);
+    caseStatement : CASE_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE stmtSep
+            ((whenStatement | ifFeatureStatement | statusStatement
+            | descriptionStatement | referenceStatement | dataDefStatement)
+            stmtSep)* RIGHT_CURLY_BRACE);
 
     /**
      *    anyxml-stmt         = anyxml-keyword sep identifier-arg-str optsep
@@ -959,11 +984,16 @@
      *                             [status-stmt stmtsep]
      *                             [description-stmt stmtsep]
      *                             [reference-stmt stmtsep]
+     *                             [default-deny-write-stmt stmtsep]
+     *                             [default-deny-all-stmt stmtsep]
      *                          "}")
      */
-     anyxmlStatement : ANYXML_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement
-                     | mustStatement | configStatement | mandatoryStatement | statusStatement | descriptionStatement
-                     | referenceStatement)* RIGHT_CURLY_BRACE);
+     anyxmlStatement : ANYXML_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE
+             stmtSep ((whenStatement | ifFeatureStatement | mustStatement
+             | configStatement | mandatoryStatement | statusStatement
+             | descriptionStatement | referenceStatement
+             | defaultDenyWriteStatement | defaultDenyAllStatement) stmtSep)*
+             RIGHT_CURLY_BRACE);
 
     /**
      *  uses-stmt           = uses-keyword sep identifier-ref-arg-str optsep
@@ -977,11 +1007,15 @@
      *                             [reference-stmt stmtsep]
      *                             *(refine-stmt stmtsep)
      *                             *(uses-augment-stmt stmtsep)
+     *                             [default-deny-write-stmt stmtsep]
+     *                             [default-deny-all-stmt stmtsep]
      *                         "}")
-     * TODO : 0..1 occurance to be checked in listener
      */
-    usesStatement : USES_KEYWORD string (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | statusStatement
-                | descriptionStatement | referenceStatement | refineStatement | augmentStatement)* RIGHT_CURLY_BRACE);
+    usesStatement : USES_KEYWORD string (STMTEND | LEFT_CURLY_BRACE
+            stmtSep ((whenStatement | ifFeatureStatement | statusStatement
+            | descriptionStatement | referenceStatement | refineStatement
+            | augmentStatement | defaultDenyAllStatement
+            | defaultDenyWriteStatement) stmtSep)* RIGHT_CURLY_BRACE);
 
     /**
      *  refine-stmt         = refine-keyword sep refine-arg-str optsep
@@ -996,9 +1030,11 @@
      *                              refine-anyxml-stmts)
      *                         "}")
      */
-    refineStatement : REFINE_KEYWORD refine (STMTEND  | LEFT_CURLY_BRACE (refineContainerStatements
-                    | refineLeafStatements | refineLeafListStatements | refineListStatements | refineChoiceStatements
-                    | refineCaseStatements | refineAnyxmlStatements) RIGHT_CURLY_BRACE);
+    refineStatement : REFINE_KEYWORD refine (STMTEND  | LEFT_CURLY_BRACE
+            stmtSep (refineContainerStatements | refineLeafStatements
+            | refineLeafListStatements | refineListStatements
+            | refineChoiceStatements | refineCaseStatements
+            | refineAnyxmlStatements) RIGHT_CURLY_BRACE);
 
     /**
      *  refine-container-stmts =
@@ -1010,7 +1046,9 @@
      *                         [reference-stmt stmtsep]
      * TODO : 0..1 occurance to be checked in listener
      */
-    refineContainerStatements : (mustStatement | presenceStatement | configStatement | descriptionStatement | referenceStatement)* ;
+    refineContainerStatements : ((mustStatement | presenceStatement
+            | configStatement | descriptionStatement stmtSep
+            | referenceStatement) stmtSep)* ;
 
     /**
      *   refine-leaf-stmts   = ;; these stmts can appear in any order
@@ -1022,7 +1060,9 @@
      *                        [reference-stmt stmtsep]
      * TODO : 0..1 occurance to be checked in listener
      */
-    refineLeafStatements : (mustStatement | defaultStatement | configStatement | mandatoryStatement | descriptionStatement | referenceStatement)*;
+    refineLeafStatements : ((mustStatement | defaultStatement
+            | configStatement | mandatoryStatement | descriptionStatement
+            | referenceStatement) stmtSep)*;
 
     /**
      *  refine-leaf-list-stmts =
@@ -1035,8 +1075,9 @@
      *                        [reference-stmt stmtsep]
      * TODO : 0..1 occurance to be checked in listener
      */
-    refineLeafListStatements : (mustStatement | configStatement | minElementsStatement | maxElementsStatement | descriptionStatement
-                             | referenceStatement)*;
+    refineLeafListStatements : ((mustStatement | configStatement
+            | minElementsStatement | maxElementsStatement
+            | descriptionStatement | referenceStatement) stmtSep)*;
 
     /**
      *  refine-list-stmts   = ;; these stmts can appear in any order
@@ -1048,8 +1089,9 @@
      *                        [reference-stmt stmtsep]
      * TODO : 0..1 occurance to be checked in listener
      */
-    refineListStatements : (mustStatement | configStatement | minElementsStatement | maxElementsStatement | descriptionStatement
-                        | referenceStatement)*;
+    refineListStatements : ((mustStatement | configStatement
+            | minElementsStatement | maxElementsStatement
+            | descriptionStatement | referenceStatement) stmtSep)*;
 
     /**
      *  refine-choice-stmts = ;; these stmts can appear in any order
@@ -1060,7 +1102,9 @@
      *                        [reference-stmt stmtsep]
      * TODO : 0..1 occurance to be checked in listener
      */
-    refineChoiceStatements : (defaultStatement | configStatement | mandatoryStatement | descriptionStatement | referenceStatement)*;
+    refineChoiceStatements : ((defaultStatement | configStatement
+            | mandatoryStatement | descriptionStatement
+            | referenceStatement) stmtSep)*;
 
     /**
      *  refine-case-stmts   = ;; these stmts can appear in any order
@@ -1068,7 +1112,9 @@
      *                        [reference-stmt stmtsep]
      *
      */
-    refineCaseStatements : (descriptionStatement | referenceStatement)? | (referenceStatement | descriptionStatement)?;
+    refineCaseStatements : ((descriptionStatement stmtSep)
+            | (referenceStatement stmtSep))? | ((referenceStatement stmtSep)
+            | (descriptionStatement stmtSep))?;
 
     /**
      *  refine-anyxml-stmts = ;; these stmts can appear in any order
@@ -1078,8 +1124,9 @@
      *                        [description-stmt stmtsep]
      *                        [reference-stmt stmtsep]
      */
-     refineAnyxmlStatements : (mustStatement | configStatement | mandatoryStatement | descriptionStatement
-                            | referenceStatement)*;
+    refineAnyxmlStatements : ((mustStatement | configStatement
+            | mandatoryStatement | descriptionStatement
+            | referenceStatement) stmtSep)*;
 
     /**
      *  augment-stmt        = augment-keyword sep augment-arg-str optsep
@@ -1093,10 +1140,11 @@
      *                            1*((data-def-stmt stmtsep) /
      *                               (case-stmt stmtsep))
      *                         "}"
-     * TODO : 0..1 occurance to be checked in listener
      */
-    augmentStatement : AUGMENT_KEYWORD augment LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | statusStatement
-                   | descriptionStatement | referenceStatement | dataDefStatement  | caseStatement)* RIGHT_CURLY_BRACE;
+    augmentStatement : AUGMENT_KEYWORD augment LEFT_CURLY_BRACE stmtSep
+            ((whenStatement | ifFeatureStatement | statusStatement
+            | descriptionStatement | referenceStatement
+            | dataDefStatement  | caseStatement) stmtSep)* RIGHT_CURLY_BRACE;
 
     /**
      *  when-stmt           = when-keyword sep string optsep
@@ -1108,8 +1156,10 @@
      *                          "}")
      *
      */
-    whenStatement : WHEN_KEYWORD string (STMTEND | LEFT_CURLY_BRACE ((descriptionStatement? referenceStatement?)
-                       | (referenceStatement? descriptionStatement?)) RIGHT_CURLY_BRACE);
+    whenStatement : WHEN_KEYWORD string (STMTEND | LEFT_CURLY_BRACE stmtSep
+            ((descriptionStatement stmtSep)? (referenceStatement stmtSep)?
+            | (referenceStatement stmtSep)? (descriptionStatement stmtSep)?)
+            RIGHT_CURLY_BRACE);
 
     /**
      *  rpc-stmt            = rpc-keyword sep identifier-arg-str optsep
@@ -1127,9 +1177,11 @@
      *                             [default-deny-all-stmt stmtsep]
      *                         "}")
      */
-    rpcStatement : RPC_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (ifFeatureStatement | statusStatement | descriptionStatement
-                | referenceStatement | typedefStatement | groupingStatement | inputStatement | outputStatement
-                | defaultDenyAllStatement)* RIGHT_CURLY_BRACE);
+    rpcStatement : RPC_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE stmtSep
+            ((ifFeatureStatement | statusStatement | descriptionStatement
+            | referenceStatement | typedefStatement | groupingStatement
+            | inputStatement | outputStatement | defaultDenyAllStatement)
+            stmtSep)* RIGHT_CURLY_BRACE);
 
     /**
      * input-stmt          = input-keyword optsep
@@ -1140,7 +1192,8 @@
      *                           1*(data-def-stmt stmtsep)
      *                         "}"
      */
-    inputStatement : INPUT_KEYWORD LEFT_CURLY_BRACE (typedefStatement | groupingStatement | dataDefStatement)* RIGHT_CURLY_BRACE;
+    inputStatement : INPUT_KEYWORD LEFT_CURLY_BRACE stmtSep ((typedefStatement
+            | groupingStatement | dataDefStatement) stmtSep)* RIGHT_CURLY_BRACE;
 
     /**
      *  output-stmt         = output-keyword optsep
@@ -1151,7 +1204,8 @@
      *                            1*(data-def-stmt stmtsep)
      *                        "}"
      */
-    outputStatement : OUTPUT_KEYWORD LEFT_CURLY_BRACE (typedefStatement | groupingStatement | dataDefStatement)* RIGHT_CURLY_BRACE;
+    outputStatement : OUTPUT_KEYWORD LEFT_CURLY_BRACE stmtSep ((typedefStatement
+            | groupingStatement | dataDefStatement) stmtSep)* RIGHT_CURLY_BRACE;
 
     /**
      *  notification-stmt   = notification-keyword sep
@@ -1168,12 +1222,12 @@
      *                                grouping-stmt) stmtsep)
      *                             *(data-def-stmt stmtsep)
      *                         "}")
-     * TODO : 0..1 occurance to be checked in listener
      */
-     notificationStatement : NOTIFICATION_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (ifFeatureStatement
-                           | statusStatement | descriptionStatement | referenceStatement
-                           | typedefStatement | defaultDenyAllStatement
-                           | groupingStatement | dataDefStatement)* RIGHT_CURLY_BRACE);
+    notificationStatement : NOTIFICATION_KEYWORD identifier (STMTEND | stmtSep
+            LEFT_CURLY_BRACE ((ifFeatureStatement | statusStatement
+            | descriptionStatement | referenceStatement | typedefStatement
+            | defaultDenyAllStatement | groupingStatement | dataDefStatement)
+            stmtSep)* RIGHT_CURLY_BRACE);
 
     /**
      *  deviation-stmt      = deviation-keyword sep
@@ -1187,11 +1241,11 @@
      *                                 deviate-replace-stmt /
      *                                 deviate-delete-stmt))
      *                        "}"
-     * TODO : 0..1 occurance to be checked in listener
      */
-    deviationStatement: DEVIATION_KEYWORD deviation LEFT_CURLY_BRACE (descriptionStatement | referenceStatement
-                      | deviateNotSupportedStatement | deviateAddStatement | deviateReplaceStatement
-                      | deviateDeleteStatement)* RIGHT_CURLY_BRACE;
+    deviationStatement: DEVIATION_KEYWORD deviation LEFT_CURLY_BRACE stmtSep
+            ((descriptionStatement stmtSep) | (referenceStatement stmtSep)
+            | deviateNotSupportedStatement | deviateAddStatement | deviateReplaceStatement
+            | deviateDeleteStatement)* RIGHT_CURLY_BRACE;
 
     /**
      * deviate-not-supported-stmt =
@@ -1201,7 +1255,8 @@
      *                        "{" stmtsep
      *                        "}")
      */
-    deviateNotSupportedStatement: DEVIATE_KEYWORD NOT_SUPPORTED_KEYWORD (STMTEND | LEFT_CURLY_BRACE RIGHT_CURLY_BRACE);
+    deviateNotSupportedStatement: DEVIATE_KEYWORD NOT_SUPPORTED_KEYWORD (STMTEND
+            | LEFT_CURLY_BRACE stmtSep RIGHT_CURLY_BRACE);
 
     /**
      *  deviate-add-stmt    = deviate-keyword sep add-keyword optsep
@@ -1218,11 +1273,10 @@
      *                         "}")
      */
     deviateAddStatement: DEVIATE_KEYWORD ADD_KEYWORD (STMTEND
-                       | LEFT_CURLY_BRACE (unitsStatement | mustStatement
-                         | uniqueStatement| defaultStatement| configStatement
-                         | mandatoryStatement | minElementsStatement
-                         | maxElementsStatement)*
-                       RIGHT_CURLY_BRACE);
+            | LEFT_CURLY_BRACE stmtSep ((unitsStatement | mustStatement
+            | uniqueStatement | defaultStatement | configStatement
+            | mandatoryStatement | minElementsStatement | maxElementsStatement)
+            stmtSep)* RIGHT_CURLY_BRACE);
 
     /**
      *  deviate-delete-stmt = deviate-keyword sep delete-keyword optsep
@@ -1235,8 +1289,8 @@
      *                           "}")
      */
     deviateDeleteStatement: DEVIATE_KEYWORD DELETE_KEYWORD (STMTEND
-                       | LEFT_CURLY_BRACE (unitsStatement | mustStatement |
-                       uniqueStatement | defaultStatement)* RIGHT_CURLY_BRACE);
+            | LEFT_CURLY_BRACE stmtSep ((unitsStatement | mustStatement
+            | uniqueStatement | defaultStatement) stmtSep)* RIGHT_CURLY_BRACE);
 
     /**
      *   deviate-replace-stmt = deviate-keyword sep replace-keyword optsep
@@ -1252,10 +1306,10 @@
      *                          "}")
      */
     deviateReplaceStatement: DEVIATE_KEYWORD REPLACE_KEYWORD (STMTEND
-                           | LEFT_CURLY_BRACE (typeStatement | unitsStatement
-                             | defaultStatement | configStatement
-                             | mandatoryStatement | minElementsStatement
-                             | maxElementsStatement)* RIGHT_CURLY_BRACE);
+            | LEFT_CURLY_BRACE stmtSep ((typeStatement | unitsStatement
+            | defaultStatement | configStatement | mandatoryStatement
+            | minElementsStatement | maxElementsStatement) stmtSep)*
+            RIGHT_CURLY_BRACE);
 
     /**
      *   compiler-annotation-stmt = prefix:compiler-annotation-keyword string
@@ -1265,9 +1319,10 @@
      *                          "}"
      */
     compilerAnnotationStatement : COMPILER_ANNOTATION string LEFT_CURLY_BRACE
-                                       compilerAnnotationBodyStatement RIGHT_CURLY_BRACE;
+            compilerAnnotationBodyStatement RIGHT_CURLY_BRACE;
 
-    compilerAnnotationBodyStatement : appDataStructureStatement? appExtendedStatement? ;
+    compilerAnnotationBodyStatement : (appDataStructureStatement stmtSep)?
+            (appExtendedStatement stmtSep)?;
 
     /**
      *   app-data-structure-stmt = prefix:app-data-structure-keyword string
@@ -1276,8 +1331,9 @@
      *                              [data-structure-key-stmt stmtsep]
      *                          "}")
      */
-    appDataStructureStatement : APP_DATA_STRUCTURE appDataStructure (STMTEND | (LEFT_CURLY_BRACE
-                  dataStructureKeyStatement? RIGHT_CURLY_BRACE));
+    appDataStructureStatement : APP_DATA_STRUCTURE appDataStructure (STMTEND
+            | (LEFT_CURLY_BRACE (dataStructureKeyStatement stmtSep)?
+            RIGHT_CURLY_BRACE));
 
     /**
      *   data-structure-key-stmt = prefix:key-keyword string ";"
@@ -1301,11 +1357,39 @@
      */
     defaultDenyAllStatement : DEFAULT_DENY_ALL STMTEND;
 
+    /**
+     * unknown-statement   = prefix ":" identifier [sep string] optsep
+     *                        (";" / "{" *unknown-statement2 "}")
+     */
+    unknownStatement : unknown string? (STMTEND
+                     | LEFT_CURLY_BRACE unknownStatement2* RIGHT_CURLY_BRACE);
+
+    /**
+     *   unknown-statement2   = [prefix ":"] identifier [sep string] optsep
+     *                          (";" / "{" *unknown-statement2 "}")
+     */
+    unknownStatement2 : unknown2 string? (STMTEND
+                      | LEFT_CURLY_BRACE unknownStatement2* RIGHT_CURLY_BRACE);
+
+    /**
+     *  stmtend             = ";" / "{" *unknown-statement "}"
+     */
+    stmtEnd : STMTEND | LEFT_CURLY_BRACE unknownStatement* RIGHT_CURLY_BRACE;
+
+    stmtSep : unknownStatement*;
+
     string : STRING (PLUS STRING)*
            | IDENTIFIER
            | INTEGER
+           | UNKNOWN_STATEMENT
+           | UNKNOWN_STATEMENT2
            | yangConstruct;
 
+    unknown : UNKNOWN_STATEMENT;
+
+    unknown2 : UNKNOWN_STATEMENT
+             | IDENTIFIER;
+
     identifier : STRING (PLUS STRING)*
                | IDENTIFIER
                | yangConstruct;