Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | /** |
| 18 | * This is a YANG grammar for parser based on which ANTLR will generate YANG parser. |
| 19 | */ |
| 20 | |
| 21 | grammar GeneratedYang; |
| 22 | import YangLexer; |
| 23 | |
| 24 | @header { |
| 25 | package org.onosproject.yangutils.parser.antlrgencode; |
| 26 | } |
| 27 | |
janani b | dd1314f | 2016-05-19 17:39:50 +0530 | [diff] [blame] | 28 | yangfile : moduleStatement EOF |
| 29 | | subModuleStatement EOF; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 30 | |
| 31 | /** |
| 32 | * module-stmt = optsep module-keyword sep identifier-arg-str |
| 33 | * optsep |
| 34 | * "{" stmtsep |
| 35 | * module-header-stmts |
| 36 | * linkage-stmts |
| 37 | * meta-stmts |
| 38 | * revision-stmts |
| 39 | * body-stmts |
| 40 | * "}" optsep |
| 41 | */ |
| 42 | |
Vidyashree Rama | bcd7fba | 2016-03-09 20:41:44 +0530 | [diff] [blame] | 43 | moduleStatement : MODULE_KEYWORD identifier LEFT_CURLY_BRACE moduleBody RIGHT_CURLY_BRACE; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 44 | |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 45 | moduleBody : moduleHeaderStatement linkageStatements metaStatements revisionStatements bodyStatements; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 46 | |
| 47 | /** |
| 48 | * module-header-stmts = ;; these stmts can appear in any order |
| 49 | * [yang-version-stmt stmtsep] |
| 50 | * namespace-stmt stmtsep |
| 51 | * prefix-stmt stmtsep |
| 52 | */ |
| 53 | |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 54 | moduleHeaderStatement : yangVersionStatement? namespaceStatement prefixStatement |
| 55 | | yangVersionStatement? prefixStatement namespaceStatement |
| 56 | | namespaceStatement yangVersionStatement? prefixStatement |
| 57 | | namespaceStatement prefixStatement yangVersionStatement? |
| 58 | | prefixStatement namespaceStatement yangVersionStatement? |
| 59 | | prefixStatement yangVersionStatement? namespaceStatement |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 60 | ; |
| 61 | |
| 62 | /** |
| 63 | * linkage-stmts = ;; these stmts can appear in any order |
| 64 | * *(import-stmt stmtsep) |
| 65 | * *(include-stmt stmtsep) |
| 66 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 67 | linkageStatements : (importStatement |
| 68 | | includeStatement)*; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 69 | |
| 70 | /** |
| 71 | * meta-stmts = ;; these stmts can appear in any order |
| 72 | * [organization-stmt stmtsep] |
| 73 | * [contact-stmt stmtsep] |
| 74 | * [description-stmt stmtsep] |
| 75 | * [reference-stmt stmtsep] |
| 76 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 77 | metaStatements : organizationStatement? contactStatement? descriptionStatement? referenceStatement? |
| 78 | | organizationStatement? contactStatement? referenceStatement? descriptionStatement? |
| 79 | | organizationStatement? descriptionStatement? contactStatement? referenceStatement? |
| 80 | | organizationStatement? descriptionStatement? referenceStatement? contactStatement? |
| 81 | | organizationStatement? referenceStatement? contactStatement? descriptionStatement? |
| 82 | | organizationStatement? referenceStatement? descriptionStatement? contactStatement? |
| 83 | | contactStatement? organizationStatement? descriptionStatement? referenceStatement? |
| 84 | | contactStatement? organizationStatement? referenceStatement? descriptionStatement? |
| 85 | | contactStatement? referenceStatement? organizationStatement? descriptionStatement? |
| 86 | | contactStatement? referenceStatement? descriptionStatement? organizationStatement? |
| 87 | | contactStatement? descriptionStatement? referenceStatement? organizationStatement? |
| 88 | | contactStatement? descriptionStatement? organizationStatement? referenceStatement? |
| 89 | | referenceStatement? contactStatement? organizationStatement? descriptionStatement? |
| 90 | | referenceStatement? contactStatement? descriptionStatement? organizationStatement? |
| 91 | | referenceStatement? organizationStatement? contactStatement? descriptionStatement? |
| 92 | | referenceStatement? organizationStatement? descriptionStatement? contactStatement? |
| 93 | | referenceStatement? descriptionStatement? organizationStatement? contactStatement? |
| 94 | | referenceStatement? descriptionStatement? contactStatement? organizationStatement? |
| 95 | | descriptionStatement? referenceStatement? contactStatement? organizationStatement? |
| 96 | | descriptionStatement? referenceStatement? organizationStatement? contactStatement? |
| 97 | | descriptionStatement? contactStatement? referenceStatement? organizationStatement? |
| 98 | | descriptionStatement? contactStatement? organizationStatement? referenceStatement? |
| 99 | | descriptionStatement? organizationStatement? contactStatement? referenceStatement? |
| 100 | | descriptionStatement? organizationStatement? referenceStatement? contactStatement? |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 101 | ; |
| 102 | |
| 103 | // revision-stmts = *(revision-stmt stmtsep) |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 104 | revisionStatements : revisionStatement*; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 105 | |
| 106 | /** |
| 107 | * body-stmts = *((extension-stmt / |
| 108 | * feature-stmt / |
| 109 | * identity-stmt / |
| 110 | * typedef-stmt / |
| 111 | * grouping-stmt / |
| 112 | * data-def-stmt / |
| 113 | * augment-stmt / |
| 114 | * rpc-stmt / |
| 115 | * notification-stmt / |
| 116 | * deviation-stmt) stmtsep) |
| 117 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 118 | bodyStatements : (extensionStatement |
| 119 | | featureStatement |
| 120 | | identityStatement |
| 121 | | typedefStatement |
| 122 | | groupingStatement |
| 123 | | dataDefStatement |
| 124 | | augmentStatement |
| 125 | | rpcStatement |
| 126 | | notificationStatement |
| 127 | | deviationStatement)* |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 128 | ; |
| 129 | |
| 130 | /** |
| 131 | * yang-version-stmt = yang-version-keyword sep yang-version-arg-str |
| 132 | * optsep stmtend |
| 133 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 134 | yangVersionStatement : YANG_VERSION_KEYWORD version STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 135 | |
| 136 | |
| 137 | /** |
| 138 | * namespace-stmt = namespace-keyword sep uri-str optsep stmtend |
| 139 | * For namespace validation TODO in Listener |
| 140 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 141 | namespaceStatement : NAMESPACE_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 142 | |
| 143 | /** |
| 144 | * prefix-stmt = prefix-keyword sep prefix-arg-str |
| 145 | * optsep stmtend |
| 146 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 147 | prefixStatement : PREFIX_KEYWORD identifier STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 148 | |
| 149 | /** |
| 150 | * import-stmt = import-keyword sep identifier-arg-str optsep |
| 151 | * "{" stmtsep |
| 152 | * prefix-stmt stmtsep |
| 153 | * [revision-date-stmt stmtsep] |
| 154 | * "}" |
| 155 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 156 | importStatement : IMPORT_KEYWORD identifier LEFT_CURLY_BRACE importStatementBody RIGHT_CURLY_BRACE; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 157 | |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 158 | importStatementBody : prefixStatement revisionDateStatement?; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 159 | |
| 160 | // revision-date-stmt = revision-date-keyword sep revision-date stmtend |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 161 | revisionDateStatement : REVISION_DATE_KEYWORD dateArgumentString STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 162 | |
| 163 | /** |
| 164 | * include-stmt = include-keyword sep identifier-arg-str optsep |
| 165 | * (";" / |
| 166 | * "{" stmtsep |
| 167 | * [revision-date-stmt stmtsep] |
| 168 | * "}") |
| 169 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 170 | includeStatement : INCLUDE_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE revisionDateStatement? RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 171 | |
| 172 | /** |
| 173 | * organization-stmt = organization-keyword sep string |
| 174 | * optsep stmtend |
| 175 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 176 | organizationStatement : ORGANIZATION_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 177 | |
| 178 | // contact-stmt = contact-keyword sep string optsep stmtend |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 179 | contactStatement : CONTACT_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 180 | |
| 181 | // description-stmt = description-keyword sep string optsep stmtend |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 182 | descriptionStatement : DESCRIPTION_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 183 | |
| 184 | // reference-stmt = reference-keyword sep string optsep stmtend |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 185 | referenceStatement : REFERENCE_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 186 | |
| 187 | /** |
| 188 | * revision-stmt = revision-keyword sep revision-date optsep |
| 189 | * (";" / |
| 190 | * "{" stmtsep |
| 191 | * [description-stmt stmtsep] |
| 192 | * [reference-stmt stmtsep] |
| 193 | * "}") |
| 194 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 195 | revisionStatement : REVISION_KEYWORD dateArgumentString (STMTEND | LEFT_CURLY_BRACE revisionStatementBody RIGHT_CURLY_BRACE); |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 196 | revisionStatementBody : descriptionStatement? referenceStatement?; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 197 | |
| 198 | /** |
| 199 | * submodule-stmt = optsep submodule-keyword sep identifier-arg-str |
| 200 | * optsep |
| 201 | * "{" stmtsep |
| 202 | * submodule-header-stmts |
| 203 | * linkage-stmts |
| 204 | * meta-stmts |
| 205 | * revision-stmts |
| 206 | * body-stmts |
| 207 | * "}" optsep |
| 208 | */ |
Vidyashree Rama | bcd7fba | 2016-03-09 20:41:44 +0530 | [diff] [blame] | 209 | subModuleStatement : SUBMODULE_KEYWORD identifier LEFT_CURLY_BRACE submoduleBody RIGHT_CURLY_BRACE; |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 210 | submoduleBody : submoduleHeaderStatement linkageStatements metaStatements revisionStatements bodyStatements; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 211 | |
| 212 | /** submodule-header-stmts = |
| 213 | * ;; these stmts can appear in any order |
| 214 | * [yang-version-stmt stmtsep] |
| 215 | * belongs-to-stmt stmtsep |
| 216 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 217 | submoduleHeaderStatement : yangVersionStatement? belongstoStatement |
| 218 | | belongstoStatement yangVersionStatement? |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 219 | ; |
| 220 | |
| 221 | /** |
| 222 | * belongs-to-stmt = belongs-to-keyword sep identifier-arg-str |
| 223 | * optsep |
| 224 | * "{" stmtsep |
| 225 | * prefix-stmt stmtsep |
| 226 | * "}" |
| 227 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 228 | belongstoStatement : BELONGS_TO_KEYWORD identifier LEFT_CURLY_BRACE belongstoStatementBody RIGHT_CURLY_BRACE; |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 229 | belongstoStatementBody : prefixStatement; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 230 | |
| 231 | /** |
| 232 | * extension-stmt = extension-keyword sep identifier-arg-str optsep |
| 233 | * (";" / |
| 234 | * "{" stmtsep |
| 235 | * ;; these stmts can appear in any order |
| 236 | * [argument-stmt stmtsep] |
| 237 | * [status-stmt stmtsep] |
| 238 | * [description-stmt stmtsep] |
| 239 | * [reference-stmt stmtsep] |
| 240 | * "}") |
| 241 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 242 | extensionStatement : EXTENSION_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE extensionBody RIGHT_CURLY_BRACE); |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 243 | extensionBody : argumentStatement? statusStatement? descriptionStatement? referenceStatement? |
| 244 | | argumentStatement? statusStatement? referenceStatement? descriptionStatement? |
| 245 | | argumentStatement? descriptionStatement? statusStatement? referenceStatement? |
| 246 | | argumentStatement? descriptionStatement? referenceStatement? statusStatement? |
| 247 | | argumentStatement? referenceStatement? descriptionStatement? statusStatement? |
| 248 | | argumentStatement? referenceStatement? statusStatement? descriptionStatement? |
| 249 | | statusStatement? referenceStatement? argumentStatement? descriptionStatement? |
| 250 | | statusStatement? referenceStatement? descriptionStatement? argumentStatement? |
| 251 | | statusStatement? descriptionStatement? referenceStatement? argumentStatement? |
| 252 | | statusStatement? descriptionStatement? argumentStatement? referenceStatement? |
| 253 | | statusStatement? argumentStatement? referenceStatement? descriptionStatement? |
| 254 | | statusStatement? argumentStatement? descriptionStatement? referenceStatement? |
| 255 | | descriptionStatement? argumentStatement? statusStatement? referenceStatement? |
| 256 | | descriptionStatement? argumentStatement? referenceStatement? statusStatement? |
| 257 | | descriptionStatement? statusStatement? argumentStatement? referenceStatement? |
| 258 | | descriptionStatement? statusStatement? referenceStatement? argumentStatement? |
| 259 | | descriptionStatement? referenceStatement? statusStatement? argumentStatement? |
| 260 | | descriptionStatement? referenceStatement? argumentStatement? statusStatement? |
| 261 | | referenceStatement? descriptionStatement? argumentStatement? statusStatement? |
| 262 | | referenceStatement? descriptionStatement? statusStatement? argumentStatement? |
| 263 | | referenceStatement? statusStatement? argumentStatement? descriptionStatement? |
| 264 | | referenceStatement? statusStatement? descriptionStatement? argumentStatement? |
| 265 | | referenceStatement? argumentStatement? descriptionStatement? statusStatement? |
| 266 | | referenceStatement? argumentStatement? statusStatement? descriptionStatement? |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 267 | ; |
| 268 | |
| 269 | /** |
| 270 | * argument-stmt = argument-keyword sep identifier-arg-str optsep |
| 271 | * (";" / |
| 272 | * "{" stmtsep |
| 273 | * [yin-element-stmt stmtsep] |
| 274 | * "}") |
| 275 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 276 | argumentStatement : ARGUMENT_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE argumentBody RIGHT_CURLY_BRACE); |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 277 | argumentBody : yinElementStatement?; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 278 | |
| 279 | /** |
| 280 | * yin-element-stmt = yin-element-keyword sep yin-element-arg-str |
| 281 | * stmtend |
| 282 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 283 | yinElementStatement : YIN_ELEMENT_KEYWORD (TRUE_KEYWORD | FALSE_KEYWORD) STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 284 | |
| 285 | /** |
| 286 | * identity-stmt = identity-keyword sep identifier-arg-str optsep |
| 287 | * (";" / |
| 288 | * "{" stmtsep |
| 289 | * ;; these stmts can appear in any order |
| 290 | * [base-stmt stmtsep] |
| 291 | * [status-stmt stmtsep] |
| 292 | * [description-stmt stmtsep] |
| 293 | * [reference-stmt stmtsep] |
| 294 | * "}") |
| 295 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 296 | identityStatement : IDENTITY_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE identityBody RIGHT_CURLY_BRACE); |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 297 | identityBody : baseStatement? statusStatement? descriptionStatement? referenceStatement? |
| 298 | | baseStatement? statusStatement? referenceStatement? descriptionStatement? |
| 299 | | baseStatement? descriptionStatement? statusStatement? referenceStatement? |
| 300 | | baseStatement? descriptionStatement? referenceStatement? statusStatement? |
| 301 | | baseStatement? referenceStatement? descriptionStatement? statusStatement? |
| 302 | | baseStatement? referenceStatement? statusStatement? descriptionStatement? |
| 303 | | referenceStatement? baseStatement? statusStatement? descriptionStatement? |
| 304 | | referenceStatement? baseStatement? descriptionStatement? statusStatement? |
| 305 | | referenceStatement? statusStatement? baseStatement? descriptionStatement? |
| 306 | | referenceStatement? statusStatement? descriptionStatement? baseStatement? |
| 307 | | referenceStatement? descriptionStatement? statusStatement? baseStatement? |
| 308 | | referenceStatement? descriptionStatement? baseStatement? statusStatement? |
| 309 | | descriptionStatement? referenceStatement? statusStatement? baseStatement? |
| 310 | | descriptionStatement? referenceStatement? statusStatement? baseStatement? |
| 311 | | descriptionStatement? referenceStatement? baseStatement? statusStatement? |
| 312 | | descriptionStatement? statusStatement? baseStatement? referenceStatement? |
| 313 | | descriptionStatement? statusStatement? referenceStatement? baseStatement? |
| 314 | | descriptionStatement? baseStatement? referenceStatement? statusStatement? |
| 315 | | descriptionStatement? baseStatement? statusStatement? referenceStatement? |
| 316 | | statusStatement? baseStatement? descriptionStatement? referenceStatement? |
| 317 | | statusStatement? baseStatement? referenceStatement? descriptionStatement? |
| 318 | | statusStatement? descriptionStatement? baseStatement? referenceStatement? |
| 319 | | statusStatement? descriptionStatement? referenceStatement? baseStatement? |
| 320 | | statusStatement? referenceStatement? descriptionStatement? baseStatement? |
| 321 | | statusStatement? referenceStatement? baseStatement? descriptionStatement? |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 322 | ; |
| 323 | |
| 324 | /** |
| 325 | * base-stmt = base-keyword sep identifier-ref-arg-str |
| 326 | * optsep stmtend* |
| 327 | * identifier-ref-arg = [prefix ":"] identifier |
| 328 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 329 | baseStatement : BASE_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 330 | |
| 331 | /** |
| 332 | * feature-stmt = feature-keyword sep identifier-arg-str optsep |
| 333 | * (";" / |
| 334 | * "{" stmtsep |
| 335 | * ;; these stmts can appear in any order |
| 336 | * *(if-feature-stmt stmtsep) |
| 337 | * [status-stmt stmtsep] |
| 338 | * [description-stmt stmtsep] |
| 339 | * [reference-stmt stmtsep] |
| 340 | * "}") |
| 341 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 342 | featureStatement : FEATURE_KEYWORD string (STMTEND | LEFT_CURLY_BRACE featureBody RIGHT_CURLY_BRACE); |
| 343 | featureBody : ifFeatureStatement* statusStatement? descriptionStatement? referenceStatement? |
| 344 | | ifFeatureStatement* statusStatement? referenceStatement? descriptionStatement? |
| 345 | | ifFeatureStatement* descriptionStatement? statusStatement? referenceStatement? |
| 346 | | ifFeatureStatement* descriptionStatement? referenceStatement? statusStatement? |
| 347 | | ifFeatureStatement* referenceStatement? statusStatement? descriptionStatement? |
| 348 | | ifFeatureStatement* referenceStatement? descriptionStatement? statusStatement? |
| 349 | | statusStatement? ifFeatureStatement* descriptionStatement? referenceStatement? |
| 350 | | statusStatement? ifFeatureStatement* referenceStatement? descriptionStatement? |
| 351 | | statusStatement? descriptionStatement? ifFeatureStatement* referenceStatement? |
| 352 | | statusStatement? descriptionStatement? referenceStatement? ifFeatureStatement* |
| 353 | | statusStatement? referenceStatement? ifFeatureStatement* descriptionStatement? |
| 354 | | statusStatement? referenceStatement? descriptionStatement? ifFeatureStatement* |
| 355 | | descriptionStatement? ifFeatureStatement* statusStatement? referenceStatement? |
| 356 | | descriptionStatement? ifFeatureStatement* referenceStatement? statusStatement? |
| 357 | | descriptionStatement? statusStatement? ifFeatureStatement* referenceStatement? |
| 358 | | descriptionStatement? statusStatement? referenceStatement? ifFeatureStatement* |
| 359 | | descriptionStatement? referenceStatement* statusStatement? ifFeatureStatement* |
| 360 | | descriptionStatement? referenceStatement* ifFeatureStatement? statusStatement? |
| 361 | | referenceStatement? ifFeatureStatement* statusStatement? descriptionStatement? |
| 362 | | referenceStatement? ifFeatureStatement* descriptionStatement? statusStatement? |
| 363 | | referenceStatement? descriptionStatement? statusStatement? ifFeatureStatement* |
| 364 | | referenceStatement? descriptionStatement? ifFeatureStatement* statusStatement? |
| 365 | | referenceStatement? statusStatement? descriptionStatement? ifFeatureStatement* |
| 366 | | referenceStatement? statusStatement? ifFeatureStatement* descriptionStatement? |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 367 | ; |
| 368 | |
| 369 | /** |
| 370 | * data-def-stmt = container-stmt / |
| 371 | * leaf-stmt / |
| 372 | * leaf-list-stmt / |
| 373 | * list-stmt / |
| 374 | * choice-stmt / |
| 375 | * anyxml-stmt / |
| 376 | * uses-stmt |
| 377 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 378 | dataDefStatement : containerStatement |
| 379 | | leafStatement |
| 380 | | leafListStatement |
| 381 | | listStatement |
| 382 | | choiceStatement |
Vidyashree Rama | 1db1556 | 2016-05-17 16:16:15 +0530 | [diff] [blame] | 383 | | anyxmlStatement |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 384 | | usesStatement; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 385 | |
| 386 | /** |
| 387 | * if-feature-stmt = if-feature-keyword sep identifier-ref-arg-str |
| 388 | * optsep stmtend |
| 389 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 390 | ifFeatureStatement : IF_FEATURE_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 391 | |
| 392 | /** |
| 393 | * units-stmt = units-keyword sep string optsep stmtend |
| 394 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 395 | unitsStatement : UNITS_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 396 | |
| 397 | /** |
| 398 | * typedef-stmt = typedef-keyword sep identifier-arg-str optsep |
| 399 | * "{" stmtsep |
| 400 | * ;; these stmts can appear in any order |
| 401 | * type-stmt stmtsep |
| 402 | * [units-stmt stmtsep] |
| 403 | * [default-stmt stmtsep] |
| 404 | * [status-stmt stmtsep] |
| 405 | * [description-stmt stmtsep] |
| 406 | * [reference-stmt stmtsep] |
| 407 | * "}" |
| 408 | * TODO : 0..1 occurance to be validated in listener |
| 409 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 410 | typedefStatement : TYPEDEF_KEYWORD identifier LEFT_CURLY_BRACE |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 411 | (typeStatement | unitsStatement | defaultStatement | statusStatement | descriptionStatement | referenceStatement)* |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 412 | RIGHT_CURLY_BRACE; |
| 413 | |
| 414 | /** |
| 415 | * type-stmt = type-keyword sep identifier-ref-arg-str optsep |
| 416 | * (";" / |
| 417 | * "{" stmtsep |
| 418 | * type-body-stmts |
| 419 | * "}") |
| 420 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 421 | typeStatement : TYPE_KEYWORD string (STMTEND | LEFT_CURLY_BRACE typeBodyStatements RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 422 | |
| 423 | /** |
| 424 | * type-body-stmts = numerical-restrictions / |
| 425 | * decimal64-specification / |
| 426 | * string-restrictions / |
| 427 | * enum-specification / |
| 428 | * leafref-specification / |
| 429 | * identityref-specification / |
| 430 | * instance-identifier-specification / |
| 431 | * bits-specification / |
| 432 | * union-specification |
Vidyashree Rama | 1db1556 | 2016-05-17 16:16:15 +0530 | [diff] [blame] | 433 | * |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 434 | */ |
Vidyashree Rama | 1db1556 | 2016-05-17 16:16:15 +0530 | [diff] [blame] | 435 | typeBodyStatements : numericalRestrictions | decimal64Specification | stringRestrictions | enumSpecification |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 436 | | leafrefSpecification | identityrefSpecification | instanceIdentifierSpecification |
| 437 | | bitsSpecification | unionSpecification; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 438 | |
| 439 | /** |
Vidyashree Rama | 1db1556 | 2016-05-17 16:16:15 +0530 | [diff] [blame] | 440 | * fraction-digits-stmt = fraction-digits-keyword sep |
| 441 | * fraction-digits-arg-str stmtend |
| 442 | * |
| 443 | * fraction-digits-arg-str = < a string that matches the rule |
| 444 | * fraction-digits-arg > |
| 445 | * |
| 446 | * fraction-digits-arg = ("1" ["0" / "1" / "2" / "3" / "4" / |
| 447 | * "5" / "6" / "7" / "8"]) |
| 448 | * / "2" / "3" / "4" / "5" / "6" / "7" / "8" / "9" |
| 449 | */ |
| 450 | decimal64Specification : FRACTION_DIGITS_KEYWORD fraction STMTEND; |
| 451 | |
| 452 | /** |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 453 | * numerical-restrictions = range-stmt stmtsep |
| 454 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 455 | numericalRestrictions : rangeStatement; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 456 | |
| 457 | /** |
| 458 | * range-stmt = range-keyword sep range-arg-str optsep |
| 459 | * (";" / |
| 460 | * "{" stmtsep |
| 461 | * ;; these stmts can appear in any order |
| 462 | * [error-message-stmt stmtsep] |
| 463 | * [error-app-tag-stmt stmtsep] |
| 464 | * [description-stmt stmtsep] |
| 465 | * [reference-stmt stmtsep] |
| 466 | * "}") |
| 467 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 468 | rangeStatement : RANGE_KEYWORD range (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 469 | |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 470 | commonStatements : errorMessageStatement? errorAppTagStatement? descriptionStatement? referenceStatement? |
| 471 | | errorMessageStatement? errorAppTagStatement? referenceStatement? descriptionStatement? |
| 472 | | errorMessageStatement? descriptionStatement? errorAppTagStatement? referenceStatement? |
| 473 | | errorMessageStatement? descriptionStatement? referenceStatement? errorAppTagStatement? |
| 474 | | errorMessageStatement? referenceStatement? errorAppTagStatement? descriptionStatement? |
| 475 | | errorMessageStatement? referenceStatement? descriptionStatement? errorAppTagStatement? |
| 476 | | errorAppTagStatement? errorMessageStatement? descriptionStatement? referenceStatement? |
| 477 | | errorAppTagStatement? errorMessageStatement? referenceStatement? descriptionStatement? |
| 478 | | errorAppTagStatement? descriptionStatement? descriptionStatement? errorMessageStatement? |
| 479 | | errorAppTagStatement? descriptionStatement? errorMessageStatement? descriptionStatement? |
| 480 | | errorAppTagStatement? referenceStatement? errorMessageStatement? descriptionStatement? |
| 481 | | errorAppTagStatement? referenceStatement? descriptionStatement? errorMessageStatement? |
| 482 | | descriptionStatement? errorMessageStatement? errorAppTagStatement? referenceStatement? |
| 483 | | descriptionStatement? errorMessageStatement? referenceStatement? errorAppTagStatement? |
| 484 | | descriptionStatement? errorAppTagStatement? errorMessageStatement? referenceStatement? |
| 485 | | descriptionStatement? errorAppTagStatement? referenceStatement? errorMessageStatement? |
| 486 | | descriptionStatement? referenceStatement? errorMessageStatement? errorAppTagStatement? |
| 487 | | descriptionStatement? referenceStatement? errorAppTagStatement? errorMessageStatement? |
| 488 | | referenceStatement? errorMessageStatement? descriptionStatement? errorAppTagStatement? |
| 489 | | referenceStatement? errorMessageStatement? errorAppTagStatement? descriptionStatement? |
| 490 | | referenceStatement? errorAppTagStatement? descriptionStatement? errorMessageStatement? |
| 491 | | referenceStatement? errorAppTagStatement? errorMessageStatement? descriptionStatement? |
| 492 | | referenceStatement? descriptionStatement? errorMessageStatement? errorAppTagStatement? |
| 493 | | referenceStatement? descriptionStatement? errorAppTagStatement? errorMessageStatement? |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 494 | ; |
| 495 | |
| 496 | /** |
| 497 | * string-restrictions = ;; these stmts can appear in any order |
| 498 | * [length-stmt stmtsep] |
| 499 | * *(pattern-stmt stmtsep) |
| 500 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 501 | stringRestrictions : ((lengthStatement)? (patternStatement)*) | ((patternStatement)* (lengthStatement)?); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 502 | |
| 503 | /** |
| 504 | * length-stmt = length-keyword sep length-arg-str optsep |
| 505 | * (";" / |
| 506 | * "{" stmtsep |
| 507 | * ;; these stmts can appear in any order |
| 508 | * [error-message-stmt stmtsep] |
| 509 | * [error-app-tag-stmt stmtsep] |
| 510 | * [description-stmt stmtsep] |
| 511 | * [reference-stmt stmtsep] |
| 512 | * "}") |
| 513 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 514 | lengthStatement : LENGTH_KEYWORD length |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 515 | (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 516 | |
| 517 | /** |
| 518 | * pattern-stmt = pattern-keyword sep string optsep |
| 519 | * (";" / |
| 520 | * "{" stmtsep |
| 521 | * ;; these stmts can appear in any order |
| 522 | * [error-message-stmt stmtsep] |
| 523 | * [error-app-tag-stmt stmtsep] |
| 524 | * [description-stmt stmtsep] |
| 525 | * [reference-stmt stmtsep] |
| 526 | * "}") |
| 527 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 528 | patternStatement : PATTERN_KEYWORD string (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 529 | |
| 530 | /** |
| 531 | * default-stmt = default-keyword sep string stmtend |
| 532 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 533 | defaultStatement : DEFAULT_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 534 | |
| 535 | /** |
| 536 | * enum-specification = 1*(enum-stmt stmtsep) |
| 537 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 538 | enumSpecification : enumStatement+; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 539 | |
| 540 | /** |
| 541 | * enum-stmt = enum-keyword sep string optsep |
| 542 | * (";" / |
| 543 | * "{" stmtsep |
| 544 | * ;; these stmts can appear in any order |
| 545 | * [value-stmt stmtsep] |
| 546 | * [status-stmt stmtsep] |
| 547 | * [description-stmt stmtsep] |
| 548 | * [reference-stmt stmtsep] |
| 549 | * "}") |
| 550 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 551 | enumStatement : ENUM_KEYWORD string (STMTEND | LEFT_CURLY_BRACE enumStatementBody RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 552 | |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 553 | enumStatementBody : valueStatement? statusStatement? descriptionStatement? referenceStatement? |
| 554 | | valueStatement? statusStatement? referenceStatement? descriptionStatement? |
| 555 | | valueStatement? descriptionStatement? statusStatement? referenceStatement? |
| 556 | | valueStatement? descriptionStatement? referenceStatement? statusStatement? |
| 557 | | valueStatement? referenceStatement? statusStatement? descriptionStatement? |
| 558 | | valueStatement? referenceStatement? descriptionStatement? statusStatement? |
| 559 | | statusStatement? valueStatement? descriptionStatement? referenceStatement? |
| 560 | | statusStatement? valueStatement? referenceStatement? descriptionStatement? |
| 561 | | statusStatement? descriptionStatement? descriptionStatement? valueStatement? |
| 562 | | statusStatement? descriptionStatement? valueStatement? descriptionStatement? |
| 563 | | statusStatement? referenceStatement? valueStatement? descriptionStatement? |
| 564 | | statusStatement? referenceStatement? descriptionStatement? valueStatement? |
| 565 | | descriptionStatement? valueStatement? statusStatement? referenceStatement? |
| 566 | | descriptionStatement? valueStatement? referenceStatement? statusStatement? |
| 567 | | descriptionStatement? statusStatement? valueStatement? referenceStatement? |
| 568 | | descriptionStatement? statusStatement? referenceStatement? valueStatement? |
| 569 | | descriptionStatement? referenceStatement? valueStatement? statusStatement? |
| 570 | | descriptionStatement? referenceStatement? statusStatement? valueStatement? |
| 571 | | referenceStatement? valueStatement? descriptionStatement? statusStatement? |
| 572 | | referenceStatement? valueStatement? statusStatement? descriptionStatement? |
| 573 | | referenceStatement? statusStatement? descriptionStatement? valueStatement? |
| 574 | | referenceStatement? statusStatement? valueStatement? descriptionStatement? |
| 575 | | referenceStatement? descriptionStatement? valueStatement? statusStatement? |
| 576 | | referenceStatement? descriptionStatement? statusStatement? valueStatement? |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 577 | ; |
| 578 | |
| 579 | /** |
| 580 | * leafref-specification = |
| 581 | * ;; these stmts can appear in any order |
| 582 | * path-stmt stmtsep |
| 583 | * [require-instance-stmt stmtsep] |
| 584 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 585 | leafrefSpecification : (pathStatement (requireInstanceStatement)?) | ((requireInstanceStatement)? pathStatement); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 586 | |
| 587 | /** |
| 588 | * path-stmt = path-keyword sep path-arg-str stmtend |
| 589 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 590 | pathStatement : PATH_KEYWORD path STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 591 | |
| 592 | /** |
| 593 | * require-instance-stmt = require-instance-keyword sep |
| 594 | * require-instance-arg-str stmtend |
| 595 | * require-instance-arg-str = < a string that matches the rule |
| 596 | * require-instance-arg > |
| 597 | * require-instance-arg = true-keyword / false-keyword |
| 598 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 599 | requireInstanceStatement : REQUIRE_INSTANCE_KEYWORD (TRUE_KEYWORD | FALSE_KEYWORD) STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 600 | |
| 601 | /** |
| 602 | * instance-identifier-specification = |
| 603 | * [require-instance-stmt stmtsep] |
| 604 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 605 | instanceIdentifierSpecification : requireInstanceStatement?; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 606 | |
| 607 | /** |
| 608 | * identityref-specification = |
| 609 | * base-stmt stmtsep |
| 610 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 611 | identityrefSpecification : baseStatement; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 612 | |
| 613 | /** |
| 614 | * union-specification = 1*(type-stmt stmtsep) |
| 615 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 616 | unionSpecification : typeStatement+; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 617 | |
| 618 | /** |
| 619 | * bits-specification = 1*(bit-stmt stmtsep) |
| 620 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 621 | bitsSpecification : bitStatement+; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 622 | |
| 623 | /** |
| 624 | * bit-stmt = bit-keyword sep identifier-arg-str optsep |
| 625 | * (";" / |
| 626 | * "{" stmtsep |
| 627 | * ;; these stmts can appear in any order |
| 628 | * [position-stmt stmtsep] |
| 629 | * [status-stmt stmtsep] |
| 630 | * [description-stmt stmtsep] |
| 631 | * [reference-stmt stmtsep] |
| 632 | * "}" |
| 633 | * "}") |
| 634 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 635 | bitStatement : BIT_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE bitBodyStatement RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 636 | |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 637 | bitBodyStatement : positionStatement? statusStatement? descriptionStatement? referenceStatement? |
| 638 | | positionStatement? statusStatement? referenceStatement? descriptionStatement? |
| 639 | | positionStatement? descriptionStatement? statusStatement? referenceStatement? |
| 640 | | positionStatement? descriptionStatement? referenceStatement? statusStatement? |
| 641 | | positionStatement? referenceStatement? statusStatement? descriptionStatement? |
| 642 | | positionStatement? referenceStatement? descriptionStatement? statusStatement? |
| 643 | | statusStatement? positionStatement? descriptionStatement? referenceStatement? |
| 644 | | statusStatement? positionStatement? referenceStatement? descriptionStatement? |
| 645 | | statusStatement? descriptionStatement? descriptionStatement? positionStatement? |
| 646 | | statusStatement? descriptionStatement? positionStatement? descriptionStatement? |
| 647 | | statusStatement? referenceStatement? positionStatement? descriptionStatement? |
| 648 | | statusStatement? referenceStatement? descriptionStatement? positionStatement? |
| 649 | | descriptionStatement? positionStatement? statusStatement? referenceStatement? |
| 650 | | descriptionStatement? positionStatement? referenceStatement? statusStatement? |
| 651 | | descriptionStatement? statusStatement? positionStatement? referenceStatement? |
| 652 | | descriptionStatement? statusStatement? referenceStatement? positionStatement? |
| 653 | | descriptionStatement? referenceStatement? positionStatement? statusStatement? |
| 654 | | descriptionStatement? referenceStatement? statusStatement? positionStatement? |
| 655 | | referenceStatement? positionStatement? descriptionStatement? statusStatement? |
| 656 | | referenceStatement? positionStatement? statusStatement? descriptionStatement? |
| 657 | | referenceStatement? statusStatement? descriptionStatement? positionStatement? |
| 658 | | referenceStatement? statusStatement? positionStatement? descriptionStatement? |
| 659 | | referenceStatement? descriptionStatement? positionStatement? statusStatement? |
| 660 | | referenceStatement? descriptionStatement? statusStatement? positionStatement? |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 661 | ; |
| 662 | |
| 663 | /** |
| 664 | * position-stmt = position-keyword sep |
| 665 | * position-value-arg-str stmtend |
| 666 | * position-value-arg-str = < a string that matches the rule |
| 667 | * position-value-arg > |
| 668 | * position-value-arg = non-negative-integer-value |
| 669 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 670 | positionStatement : POSITION_KEYWORD position STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 671 | |
| 672 | /** |
| 673 | * status-stmt = status-keyword sep status-arg-str stmtend |
| 674 | * status-arg-str = < a string that matches the rule |
| 675 | * status-arg > |
| 676 | * status-arg = current-keyword / |
| 677 | * obsolete-keyword / |
| 678 | * deprecated-keyword |
| 679 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 680 | statusStatement : STATUS_KEYWORD status STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 681 | |
| 682 | /** |
| 683 | * config-stmt = config-keyword sep |
| 684 | * config-arg-str stmtend |
| 685 | * config-arg-str = < a string that matches the rule |
| 686 | * config-arg > |
| 687 | * config-arg = true-keyword / false-keyword |
| 688 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 689 | configStatement : CONFIG_KEYWORD config STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 690 | |
| 691 | /** |
| 692 | * mandatory-stmt = mandatory-keyword sep |
| 693 | * mandatory-arg-str stmtend |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 694 | * |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 695 | * mandatory-arg-str = < a string that matches the rule |
| 696 | * mandatory-arg > |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 697 | * |
| 698 | * mandatory-arg = true-keyword / false-keyword |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 699 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 700 | mandatoryStatement : MANDATORY_KEYWORD mandatory STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 701 | |
| 702 | /** |
| 703 | * presence-stmt = presence-keyword sep string stmtend |
| 704 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 705 | presenceStatement : PRESENCE_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 706 | |
| 707 | /** |
| 708 | * ordered-by-stmt = ordered-by-keyword sep |
| 709 | * ordered-by-arg-str stmtend |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 710 | * |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 711 | * ordered-by-arg-str = < a string that matches the rule |
| 712 | * ordered-by-arg > |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 713 | * |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 714 | * ordered-by-arg = user-keyword / system-keyword |
| 715 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 716 | orderedByStatement : ORDERED_BY_KEYWORD orderedBy STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 717 | |
| 718 | /** |
| 719 | * must-stmt = must-keyword sep string optsep |
| 720 | * (";" / |
| 721 | * "{" stmtsep |
| 722 | * ;; these stmts can appear in any order |
| 723 | * [error-message-stmt stmtsep] |
| 724 | * [error-app-tag-stmt stmtsep] |
| 725 | * [description-stmt stmtsep] |
| 726 | * [reference-stmt stmtsep] |
| 727 | * "}") |
| 728 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 729 | mustStatement : MUST_KEYWORD string (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 730 | |
| 731 | /** |
| 732 | * error-message-stmt = error-message-keyword sep string stmtend |
| 733 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 734 | errorMessageStatement : ERROR_MESSAGE_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 735 | |
| 736 | /** |
| 737 | * error-app-tag-stmt = error-app-tag-keyword sep string stmtend |
| 738 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 739 | errorAppTagStatement : ERROR_APP_TAG_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 740 | |
| 741 | /** |
| 742 | * min-elements-stmt = min-elements-keyword sep |
| 743 | * min-value-arg-str stmtend |
| 744 | * min-value-arg-str = < a string that matches the rule |
| 745 | * min-value-arg > |
| 746 | * min-value-arg = non-negative-integer-value |
| 747 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 748 | minElementsStatement : MIN_ELEMENTS_KEYWORD minValue STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 749 | |
| 750 | /** |
| 751 | * max-elements-stmt = max-elements-keyword sep |
| 752 | * max-value-arg-str stmtend |
| 753 | * max-value-arg-str = < a string that matches the rule |
| 754 | * max-value-arg > |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 755 | * max-value-arg = unbounded-keyword / |
| 756 | * positive-integer-value |
| 757 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 758 | maxElementsStatement : MAX_ELEMENTS_KEYWORD maxValue STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 759 | |
| 760 | /** |
| 761 | * value-stmt = value-keyword sep integer-value stmtend |
| 762 | */ |
Vidyashree Rama | 1db1556 | 2016-05-17 16:16:15 +0530 | [diff] [blame] | 763 | valueStatement : VALUE_KEYWORD value STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 764 | |
| 765 | /** |
| 766 | * grouping-stmt = grouping-keyword sep identifier-arg-str optsep |
| 767 | * (";" / |
| 768 | * "{" stmtsep |
| 769 | * ;; these stmts can appear in any order |
| 770 | * [status-stmt stmtsep] |
| 771 | * [description-stmt stmtsep] |
| 772 | * [reference-stmt stmtsep] |
| 773 | * *((typedef-stmt / |
| 774 | * grouping-stmt) stmtsep) |
| 775 | * *(data-def-stmt stmtsep) |
| 776 | * "}") |
| 777 | * TODO : 0..1 occurance to be checked in listener |
| 778 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 779 | groupingStatement : GROUPING_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 780 | (statusStatement | descriptionStatement | referenceStatement | typedefStatement | groupingStatement |
| 781 | | dataDefStatement)* RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 782 | |
| 783 | /** |
| 784 | * container-stmt = container-keyword sep identifier-arg-str optsep |
| 785 | * (";" / |
| 786 | * "{" stmtsep |
| 787 | * ;; these stmts can appear in any order |
| 788 | * [when-stmt stmtsep] |
| 789 | * *(if-feature-stmt stmtsep) |
| 790 | * *(must-stmt stmtsep) |
| 791 | * [presence-stmt stmtsep] |
| 792 | * [config-stmt stmtsep] |
| 793 | * [status-stmt stmtsep] |
| 794 | * [description-stmt stmtsep] |
| 795 | * [reference-stmt stmtsep] |
| 796 | * *((typedef-stmt / |
| 797 | * grouping-stmt) stmtsep) |
| 798 | * *(data-def-stmt stmtsep) |
| 799 | * "}") |
| 800 | * TODO : 0..1 occurance to be checked in listener |
| 801 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 802 | containerStatement : CONTAINER_KEYWORD identifier |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 803 | (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | mustStatement | presenceStatement | configStatement |
| 804 | | statusStatement | descriptionStatement | referenceStatement | typedefStatement | groupingStatement |
| 805 | | dataDefStatement)* RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 806 | |
| 807 | /** |
| 808 | * leaf-stmt = leaf-keyword sep identifier-arg-str optsep |
| 809 | * "{" stmtsep |
| 810 | * ;; these stmts can appear in any order |
| 811 | * [when-stmt stmtsep] |
| 812 | * *(if-feature-stmt stmtsep) |
| 813 | * type-stmt stmtsep |
| 814 | * [units-stmt stmtsep] |
| 815 | * *(must-stmt stmtsep) |
| 816 | * [default-stmt stmtsep] |
| 817 | * [config-stmt stmtsep] |
| 818 | * [mandatory-stmt stmtsep] |
| 819 | * [status-stmt stmtsep] |
| 820 | * [description-stmt stmtsep] |
| 821 | * [reference-stmt stmtsep] |
| 822 | * "}" |
| 823 | * TODO : 0..1 occurance to be checked in listener |
| 824 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 825 | leafStatement : LEAF_KEYWORD identifier LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | typeStatement | unitsStatement |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 826 | | mustStatement | defaultStatement | configStatement | mandatoryStatement | statusStatement | descriptionStatement |
| 827 | | referenceStatement)* RIGHT_CURLY_BRACE; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 828 | |
| 829 | /** |
| 830 | * leaf-list-stmt = leaf-list-keyword sep identifier-arg-str optsep |
| 831 | * "{" stmtsep |
| 832 | * ;; these stmts can appear in any order |
| 833 | * [when-stmt stmtsep] |
| 834 | * *(if-feature-stmt stmtsep) |
| 835 | * type-stmt stmtsep |
| 836 | * [units-stmt stmtsep] |
| 837 | * *(must-stmt stmtsep) |
| 838 | * [config-stmt stmtsep] |
| 839 | * [min-elements-stmt stmtsep] |
| 840 | * [max-elements-stmt stmtsep] |
| 841 | * [ordered-by-stmt stmtsep] |
| 842 | * [status-stmt stmtsep] |
| 843 | * [description-stmt stmtsep] |
| 844 | * [reference-stmt stmtsep] |
| 845 | * "}" |
| 846 | * TODO : 0..1 occurance to be checked in listener |
| 847 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 848 | leafListStatement : LEAF_LIST_KEYWORD identifier LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | typeStatement |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 849 | | unitsStatement | mustStatement | configStatement | minElementsStatement | maxElementsStatement | orderedByStatement |
| 850 | | statusStatement | descriptionStatement | referenceStatement)* RIGHT_CURLY_BRACE; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 851 | |
| 852 | /** |
| 853 | * list-stmt = list-keyword sep identifier-arg-str optsep |
| 854 | * "{" stmtsep |
| 855 | * ;; these stmts can appear in any order |
| 856 | * [when-stmt stmtsep] |
| 857 | * *(if-feature-stmt stmtsep) |
| 858 | * *(must-stmt stmtsep) |
| 859 | * [key-stmt stmtsep] |
| 860 | * *(unique-stmt stmtsep) |
| 861 | * [config-stmt stmtsep] |
| 862 | * [min-elements-stmt stmtsep] |
| 863 | * [max-elements-stmt stmtsep] |
| 864 | * [ordered-by-stmt stmtsep] |
| 865 | * [status-stmt stmtsep] |
| 866 | * [description-stmt stmtsep] |
| 867 | * [reference-stmt stmtsep] |
| 868 | * *((typedef-stmt / |
| 869 | * grouping-stmt) stmtsep) |
| 870 | * 1*(data-def-stmt stmtsep) |
| 871 | * "}" |
| 872 | * TODO : 0..1 occurance to be checked in listener |
| 873 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 874 | listStatement : LIST_KEYWORD identifier LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | mustStatement | keyStatement |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 875 | | uniqueStatement | configStatement | minElementsStatement | maxElementsStatement | orderedByStatement | statusStatement |
| 876 | | descriptionStatement | referenceStatement | typedefStatement | groupingStatement| dataDefStatement)* RIGHT_CURLY_BRACE; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 877 | |
| 878 | /** |
| 879 | * key-stmt = key-keyword sep key-arg-str stmtend |
| 880 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 881 | keyStatement : KEY_KEYWORD key STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 882 | |
| 883 | /** |
| 884 | * unique-stmt = unique-keyword sep unique-arg-str stmtend |
| 885 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 886 | uniqueStatement: UNIQUE_KEYWORD unique STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 887 | |
| 888 | /** |
| 889 | * choice-stmt = choice-keyword sep identifier-arg-str optsep |
| 890 | * (";" / |
| 891 | * "{" stmtsep |
| 892 | * ;; these stmts can appear in any order |
| 893 | * [when-stmt stmtsep] |
| 894 | * *(if-feature-stmt stmtsep) |
| 895 | * [default-stmt stmtsep] |
| 896 | * [config-stmt stmtsep] |
| 897 | * [mandatory-stmt stmtsep] |
| 898 | * [status-stmt stmtsep] |
| 899 | * [description-stmt stmtsep] |
| 900 | * [reference-stmt stmtsep] |
| 901 | * *((short-case-stmt / case-stmt) stmtsep) |
| 902 | * "}") |
| 903 | * TODO : 0..1 occurance to be checked in listener |
| 904 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 905 | choiceStatement : CHOICE_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | defaultStatement |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 906 | | configStatement | mandatoryStatement | statusStatement | descriptionStatement | referenceStatement | shortCaseStatement |
| 907 | | caseStatement)* RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 908 | |
| 909 | /** |
| 910 | * short-case-stmt = container-stmt / |
| 911 | * leaf-stmt / |
| 912 | * leaf-list-stmt / |
| 913 | * list-stmt / |
| 914 | * anyxml-stmt |
| 915 | */ |
Vidyashree Rama | 1db1556 | 2016-05-17 16:16:15 +0530 | [diff] [blame] | 916 | shortCaseStatement : containerStatement | leafStatement | leafListStatement | listStatement | anyxmlStatement; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 917 | |
| 918 | /** |
| 919 | * case-stmt = case-keyword sep identifier-arg-str optsep |
| 920 | * (";" / |
| 921 | * "{" stmtsep |
| 922 | * ;; these stmts can appear in any order |
| 923 | * [when-stmt stmtsep] |
| 924 | * *(if-feature-stmt stmtsep) |
| 925 | * [status-stmt stmtsep] |
| 926 | * [description-stmt stmtsep] |
| 927 | * [reference-stmt stmtsep] |
| 928 | * *(data-def-stmt stmtsep) |
| 929 | * "}") |
| 930 | * TODO : 0..1 occurance to be checked in listener |
| 931 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 932 | caseStatement : CASE_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | statusStatement |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 933 | | descriptionStatement | referenceStatement | dataDefStatement)* RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 934 | |
| 935 | /** |
Vidyashree Rama | 1db1556 | 2016-05-17 16:16:15 +0530 | [diff] [blame] | 936 | * anyxml-stmt = anyxml-keyword sep identifier-arg-str optsep |
| 937 | * (";" / |
| 938 | * "{" stmtsep |
| 939 | * ;; these stmts can appear in any order |
| 940 | * [when-stmt stmtsep] |
| 941 | * *(if-feature-stmt stmtsep) |
| 942 | * *(must-stmt stmtsep) |
| 943 | * [config-stmt stmtsep] |
| 944 | * [mandatory-stmt stmtsep] |
| 945 | * [status-stmt stmtsep] |
| 946 | * [description-stmt stmtsep] |
| 947 | * [reference-stmt stmtsep] |
| 948 | * "}") |
| 949 | */ |
| 950 | anyxmlStatement : ANYXML_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement |
| 951 | | mustStatement | configStatement | mandatoryStatement | statusStatement | descriptionStatement |
| 952 | | referenceStatement)* RIGHT_CURLY_BRACE); |
| 953 | |
| 954 | /** |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 955 | * uses-stmt = uses-keyword sep identifier-ref-arg-str optsep |
| 956 | * (";" / |
| 957 | * "{" stmtsep |
| 958 | * ;; these stmts can appear in any order |
| 959 | * [when-stmt stmtsep] |
| 960 | * *(if-feature-stmt stmtsep) |
| 961 | * [status-stmt stmtsep] |
| 962 | * [description-stmt stmtsep] |
| 963 | * [reference-stmt stmtsep] |
| 964 | * *(refine-stmt stmtsep) |
| 965 | * *(uses-augment-stmt stmtsep) |
| 966 | * "}") |
| 967 | * TODO : 0..1 occurance to be checked in listener |
| 968 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 969 | usesStatement : USES_KEYWORD string (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | statusStatement |
Vidyashree Rama | 1db1556 | 2016-05-17 16:16:15 +0530 | [diff] [blame] | 970 | | descriptionStatement | referenceStatement | refineStatement | augmentStatement)* RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 971 | |
| 972 | /** |
| 973 | * refine-stmt = refine-keyword sep refine-arg-str optsep |
| 974 | * (";" / |
| 975 | * "{" stmtsep |
| 976 | * (refine-container-stmts / |
| 977 | * refine-leaf-stmts / |
| 978 | * refine-leaf-list-stmts / |
| 979 | * refine-list-stmts / |
| 980 | * refine-choice-stmts / |
| 981 | * refine-case-stmts / |
| 982 | * refine-anyxml-stmts) |
| 983 | * "}") |
| 984 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 985 | refineStatement : REFINE_KEYWORD refine (STMTEND | LEFT_CURLY_BRACE (refineContainerStatements |
| 986 | | refineLeafStatements | refineLeafListStatements | refineListStatements | refineChoiceStatements |
Vidyashree Rama | 1db1556 | 2016-05-17 16:16:15 +0530 | [diff] [blame] | 987 | | refineCaseStatements | refineAnyxmlStatements) RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 988 | |
| 989 | /** |
| 990 | * refine-container-stmts = |
| 991 | * ;; these stmts can appear in any order |
| 992 | * *(must-stmt stmtsep) |
| 993 | * [presence-stmt stmtsep] |
| 994 | * [config-stmt stmtsep] |
| 995 | * [description-stmt stmtsep] |
| 996 | * [reference-stmt stmtsep] |
| 997 | * TODO : 0..1 occurance to be checked in listener |
| 998 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 999 | refineContainerStatements : (mustStatement | presenceStatement | configStatement | descriptionStatement | referenceStatement)* ; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1000 | |
| 1001 | /** |
| 1002 | * refine-leaf-stmts = ;; these stmts can appear in any order |
| 1003 | * *(must-stmt stmtsep) |
| 1004 | * [default-stmt stmtsep] |
| 1005 | * [config-stmt stmtsep] |
| 1006 | * [mandatory-stmt stmtsep] |
| 1007 | * [description-stmt stmtsep] |
| 1008 | * [reference-stmt stmtsep] |
| 1009 | * TODO : 0..1 occurance to be checked in listener |
| 1010 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1011 | refineLeafStatements : (mustStatement | defaultStatement | configStatement | mandatoryStatement | descriptionStatement | referenceStatement)*; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1012 | |
| 1013 | /** |
| 1014 | * refine-leaf-list-stmts = |
| 1015 | * ;; these stmts can appear in any order |
| 1016 | * *(must-stmt stmtsep) |
| 1017 | * [config-stmt stmtsep] |
| 1018 | * [min-elements-stmt stmtsep] |
| 1019 | * [max-elements-stmt stmtsep] |
| 1020 | * [description-stmt stmtsep] |
| 1021 | * [reference-stmt stmtsep] |
| 1022 | * TODO : 0..1 occurance to be checked in listener |
| 1023 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1024 | refineLeafListStatements : (mustStatement | configStatement | minElementsStatement | maxElementsStatement | descriptionStatement |
| 1025 | | referenceStatement)*; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1026 | |
| 1027 | /** |
| 1028 | * refine-list-stmts = ;; these stmts can appear in any order |
| 1029 | * *(must-stmt stmtsep) |
| 1030 | * [config-stmt stmtsep] |
| 1031 | * [min-elements-stmt stmtsep] |
| 1032 | * [max-elements-stmt stmtsep] |
| 1033 | * [description-stmt stmtsep] |
| 1034 | * [reference-stmt stmtsep] |
| 1035 | * TODO : 0..1 occurance to be checked in listener |
| 1036 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1037 | refineListStatements : (mustStatement | configStatement | minElementsStatement | maxElementsStatement | descriptionStatement |
| 1038 | | referenceStatement)*; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1039 | |
| 1040 | /** |
| 1041 | * refine-choice-stmts = ;; these stmts can appear in any order |
| 1042 | * [default-stmt stmtsep] |
| 1043 | * [config-stmt stmtsep] |
| 1044 | * [mandatory-stmt stmtsep] |
| 1045 | * [description-stmt stmtsep] |
| 1046 | * [reference-stmt stmtsep] |
| 1047 | * TODO : 0..1 occurance to be checked in listener |
| 1048 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1049 | refineChoiceStatements : (defaultStatement | configStatement | mandatoryStatement | descriptionStatement | referenceStatement)*; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1050 | |
| 1051 | /** |
| 1052 | * refine-case-stmts = ;; these stmts can appear in any order |
| 1053 | * [description-stmt stmtsep] |
| 1054 | * [reference-stmt stmtsep] |
| 1055 | * |
| 1056 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1057 | refineCaseStatements : (descriptionStatement | referenceStatement)? | (referenceStatement | descriptionStatement)?; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1058 | |
| 1059 | /** |
Vidyashree Rama | 1db1556 | 2016-05-17 16:16:15 +0530 | [diff] [blame] | 1060 | * refine-anyxml-stmts = ;; these stmts can appear in any order |
| 1061 | * *(must-stmt stmtsep) |
| 1062 | * [config-stmt stmtsep] |
| 1063 | * [mandatory-stmt stmtsep] |
| 1064 | * [description-stmt stmtsep] |
| 1065 | * [reference-stmt stmtsep] |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1066 | */ |
Vidyashree Rama | 1db1556 | 2016-05-17 16:16:15 +0530 | [diff] [blame] | 1067 | refineAnyxmlStatements : (mustStatement | configStatement | mandatoryStatement | descriptionStatement |
| 1068 | | referenceStatement)*; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1069 | |
| 1070 | /** |
| 1071 | * augment-stmt = augment-keyword sep augment-arg-str optsep |
| 1072 | * "{" stmtsep |
| 1073 | * ;; these stmts can appear in any order |
| 1074 | * [when-stmt stmtsep] |
| 1075 | * *(if-feature-stmt stmtsep) |
| 1076 | * [status-stmt stmtsep] |
| 1077 | * [description-stmt stmtsep] |
| 1078 | * [reference-stmt stmtsep] |
| 1079 | * 1*((data-def-stmt stmtsep) / |
| 1080 | * (case-stmt stmtsep)) |
| 1081 | * "}" |
| 1082 | * TODO : 0..1 occurance to be checked in listener |
| 1083 | */ |
Vidyashree Rama | 25bf4d0 | 2016-03-29 14:37:02 +0530 | [diff] [blame] | 1084 | augmentStatement : AUGMENT_KEYWORD augment LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | statusStatement |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1085 | | descriptionStatement | referenceStatement | dataDefStatement | caseStatement)* RIGHT_CURLY_BRACE; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1086 | |
| 1087 | /** |
| 1088 | * when-stmt = when-keyword sep string optsep |
| 1089 | * (";" / |
| 1090 | * "{" stmtsep |
| 1091 | * ;; these stmts can appear in any order |
| 1092 | * [description-stmt stmtsep] |
| 1093 | * [reference-stmt stmtsep] |
| 1094 | * "}") |
| 1095 | * |
| 1096 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1097 | whenStatement : WHEN_KEYWORD string (STMTEND | LEFT_CURLY_BRACE ((descriptionStatement? referenceStatement?) |
| 1098 | | (referenceStatement? descriptionStatement?)) RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1099 | |
| 1100 | /** |
| 1101 | * rpc-stmt = rpc-keyword sep identifier-arg-str optsep |
| 1102 | * (";" / |
| 1103 | * "{" stmtsep |
| 1104 | * ;; these stmts can appear in any order |
| 1105 | * *(if-feature-stmt stmtsep) |
| 1106 | * [status-stmt stmtsep] |
| 1107 | * [description-stmt stmtsep] |
| 1108 | * [reference-stmt stmtsep] |
| 1109 | * *((typedef-stmt / |
| 1110 | * grouping-stmt) stmtsep) |
| 1111 | * [input-stmt stmtsep] |
| 1112 | * [output-stmt stmtsep] |
| 1113 | * "}") |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1114 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 1115 | rpcStatement : RPC_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (ifFeatureStatement | statusStatement | descriptionStatement |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1116 | | referenceStatement | typedefStatement | groupingStatement | inputStatement | outputStatement)* RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1117 | |
| 1118 | /** |
| 1119 | * input-stmt = input-keyword optsep |
| 1120 | * "{" stmtsep |
| 1121 | * ;; these stmts can appear in any order |
| 1122 | * *((typedef-stmt / |
| 1123 | * grouping-stmt) stmtsep) |
| 1124 | * 1*(data-def-stmt stmtsep) |
| 1125 | * "}" |
| 1126 | */ |
janani b | 4e53f9b | 2016-04-26 18:49:20 +0530 | [diff] [blame] | 1127 | inputStatement : INPUT_KEYWORD LEFT_CURLY_BRACE (typedefStatement | groupingStatement | dataDefStatement)* RIGHT_CURLY_BRACE; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1128 | |
| 1129 | /** |
| 1130 | * output-stmt = output-keyword optsep |
| 1131 | * "{" stmtsep |
| 1132 | * ;; these stmts can appear in any order |
| 1133 | * *((typedef-stmt / |
| 1134 | * grouping-stmt) stmtsep) |
| 1135 | * 1*(data-def-stmt stmtsep) |
| 1136 | * "}" |
| 1137 | */ |
janani b | 4e53f9b | 2016-04-26 18:49:20 +0530 | [diff] [blame] | 1138 | outputStatement : OUTPUT_KEYWORD LEFT_CURLY_BRACE (typedefStatement | groupingStatement | dataDefStatement)* RIGHT_CURLY_BRACE; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1139 | |
| 1140 | /** |
| 1141 | * notification-stmt = notification-keyword sep |
| 1142 | * identifier-arg-str optsep |
| 1143 | * (";" / |
| 1144 | * "{" stmtsep |
| 1145 | * ;; these stmts can appear in any order |
| 1146 | * *(if-feature-stmt stmtsep) |
| 1147 | * [status-stmt stmtsep] |
| 1148 | * [description-stmt stmtsep] |
| 1149 | * [reference-stmt stmtsep] |
| 1150 | * *((typedef-stmt / |
| 1151 | * grouping-stmt) stmtsep) |
| 1152 | * *(data-def-stmt stmtsep) |
| 1153 | * "}") |
| 1154 | * TODO : 0..1 occurance to be checked in listener |
| 1155 | */ |
Vidyashree Rama | 506cbe1 | 2016-03-28 11:59:27 +0530 | [diff] [blame] | 1156 | notificationStatement : NOTIFICATION_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (ifFeatureStatement |
| 1157 | | statusStatement | descriptionStatement | referenceStatement | typedefStatement |
| 1158 | | groupingStatement | dataDefStatement)* RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1159 | |
| 1160 | /** |
| 1161 | * deviation-stmt = deviation-keyword sep |
| 1162 | * deviation-arg-str optsep |
| 1163 | * "{" stmtsep |
| 1164 | * ;; these stmts can appear in any order |
| 1165 | * [description-stmt stmtsep] |
| 1166 | * [reference-stmt stmtsep] |
| 1167 | * (deviate-not-supported-stmt / |
| 1168 | * 1*(deviate-add-stmt / |
| 1169 | * deviate-replace-stmt / |
| 1170 | * deviate-delete-stmt)) |
| 1171 | * "}" |
| 1172 | * TODO : 0..1 occurance to be checked in listener |
| 1173 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 1174 | deviationStatement: DEVIATION_KEYWORD deviation LEFT_CURLY_BRACE (descriptionStatement | referenceStatement |
| 1175 | | deviateNotSupportedStatement | deviateAddStatement | deviateReplaceStatement |
| 1176 | | deviateDeleteStatement)* RIGHT_CURLY_BRACE; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1177 | |
| 1178 | /** |
| 1179 | * deviate-not-supported-stmt = |
| 1180 | * deviate-keyword sep |
| 1181 | * not-supported-keyword optsep |
| 1182 | * (";" / |
| 1183 | * "{" stmtsep |
| 1184 | * "}") |
| 1185 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1186 | deviateNotSupportedStatement: DEVIATE_KEYWORD NOT_SUPPORTED_KEYWORD (STMTEND | LEFT_CURLY_BRACE RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1187 | |
| 1188 | /** |
| 1189 | * deviate-add-stmt = deviate-keyword sep add-keyword optsep |
| 1190 | * (";" / |
| 1191 | * "{" stmtsep |
| 1192 | * [units-stmt stmtsep] |
| 1193 | * *(must-stmt stmtsep) |
| 1194 | * *(unique-stmt stmtsep) |
| 1195 | * [default-stmt stmtsep] |
| 1196 | * [config-stmt stmtsep] |
| 1197 | * [mandatory-stmt stmtsep] |
| 1198 | * [min-elements-stmt stmtsep] |
| 1199 | * [max-elements-stmt stmtsep] |
| 1200 | * "}") |
| 1201 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1202 | deviateAddStatement: DEVIATE_KEYWORD ADD_KEYWORD (STMTEND | (LEFT_CURLY_BRACE unitsStatement? mustStatement* uniqueStatement* |
| 1203 | defaultStatement? configStatement? mandatoryStatement? minElementsStatement? maxElementsStatement? |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1204 | RIGHT_CURLY_BRACE)); |
| 1205 | |
| 1206 | /** |
| 1207 | * deviate-delete-stmt = deviate-keyword sep delete-keyword optsep |
| 1208 | * (";" / |
| 1209 | * "{" stmtsep |
| 1210 | * [units-stmt stmtsep] |
| 1211 | * *(must-stmt stmtsep) |
| 1212 | * *(unique-stmt stmtsep) |
| 1213 | * [default-stmt stmtsep] |
| 1214 | * "}") |
| 1215 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1216 | deviateDeleteStatement: DEVIATE_KEYWORD DELETE_KEYWORD (STMTEND |
| 1217 | | (LEFT_CURLY_BRACE unitsStatement? mustStatement* uniqueStatement* defaultStatement? RIGHT_CURLY_BRACE)); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1218 | |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1219 | /** |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1220 | * deviate-replace-stmt = deviate-keyword sep replace-keyword optsep |
| 1221 | * (";" / |
| 1222 | * "{" stmtsep |
| 1223 | * [type-stmt stmtsep] |
| 1224 | * [units-stmt stmtsep] |
| 1225 | * [default-stmt stmtsep] |
| 1226 | * [config-stmt stmtsep] |
| 1227 | * [mandatory-stmt stmtsep] |
| 1228 | * [min-elements-stmt stmtsep] |
| 1229 | * [max-elements-stmt stmtsep] |
| 1230 | * "}") |
| 1231 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1232 | deviateReplaceStatement: DEVIATE_KEYWORD REPLACE_KEYWORD (STMTEND | (LEFT_CURLY_BRACE typeStatement? unitsStatement? |
| 1233 | defaultStatement? configStatement? mandatoryStatement? minElementsStatement? |
| 1234 | maxElementsStatement? RIGHT_CURLY_BRACE)); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1235 | |
Gaurav Agrawal | b5a1c13 | 2016-02-21 02:56:46 +0530 | [diff] [blame] | 1236 | string : STRING (PLUS STRING)* |
| 1237 | | IDENTIFIER |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 1238 | | INTEGER |
| 1239 | | yangConstruct; |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 1240 | |
| 1241 | identifier : STRING (PLUS STRING)* |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 1242 | | IDENTIFIER |
| 1243 | | yangConstruct; |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 1244 | |
| 1245 | dateArgumentString : DATE_ARG |
| 1246 | | STRING (PLUS STRING)*; |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 1247 | |
| 1248 | version : string; |
| 1249 | |
| 1250 | range : string; |
| 1251 | |
| 1252 | length : string; |
| 1253 | |
| 1254 | path : string; |
| 1255 | |
| 1256 | position : string; |
| 1257 | |
| 1258 | status : string; |
| 1259 | |
| 1260 | config : string; |
| 1261 | |
| 1262 | mandatory : string; |
| 1263 | |
| 1264 | orderedBy : string; |
| 1265 | |
| 1266 | minValue : string; |
| 1267 | |
| 1268 | maxValue : string; |
| 1269 | |
| 1270 | key : string; |
| 1271 | |
| 1272 | unique : string; |
| 1273 | |
| 1274 | refine : string; |
| 1275 | |
| 1276 | augment : string; |
| 1277 | |
| 1278 | deviation : string; |
| 1279 | |
Vidyashree Rama | 1db1556 | 2016-05-17 16:16:15 +0530 | [diff] [blame] | 1280 | value : string; |
| 1281 | |
| 1282 | fraction : string; |
| 1283 | |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 1284 | yangConstruct : ANYXML_KEYWORD | ARGUMENT_KEYWORD | AUGMENT_KEYWORD | BASE_KEYWORD | BELONGS_TO_KEYWORD |
| 1285 | | BIT_KEYWORD | CASE_KEYWORD | CHOICE_KEYWORD | CONFIG_KEYWORD | CONTACT_KEYWORD | CONTAINER_KEYWORD |
| 1286 | | DEFAULT_KEYWORD | DESCRIPTION_KEYWORD | ENUM_KEYWORD ERROR_APP_TAG_KEYWORD | ERROR_MESSAGE_KEYWORD |
| 1287 | | EXTENSION_KEYWORD | DEVIATION_KEYWORD | DEVIATE_KEYWORD | FEATURE_KEYWORD |
| 1288 | | FRACTION_DIGITS_KEYWORD | GROUPING_KEYWORD | IDENTITY_KEYWORD | IF_FEATURE_KEYWORD |
| 1289 | | IMPORT_KEYWORD | INCLUDE_KEYWORD | INPUT_KEYWORD | KEY_KEYWORD | LEAF_KEYWORD | LEAF_LIST_KEYWORD |
| 1290 | | LENGTH_KEYWORD | LIST_KEYWORD | MANDATORY_KEYWORD | MAX_ELEMENTS_KEYWORD | MIN_ELEMENTS_KEYWORD |
| 1291 | | MODULE_KEYWORD | MUST_KEYWORD | NAMESPACE_KEYWORD | NOTIFICATION_KEYWORD | ORDERED_BY_KEYWORD |
| 1292 | | ORGANIZATION_KEYWORD | OUTPUT_KEYWORD | PATH_KEYWORD | PATTERN_KEYWORD |POSITION_KEYWORD |
| 1293 | | PREFIX_KEYWORD | PRESENCE_KEYWORD | RANGE_KEYWORD | REFERENCE_KEYWORD | REFINE_KEYWORD |
| 1294 | | REQUIRE_INSTANCE_KEYWORD | REVISION_KEYWORD | REVISION_DATE_KEYWORD | RPC_KEYWORD |
| 1295 | | STATUS_KEYWORD | SUBMODULE_KEYWORD | TYPE_KEYWORD | TYPEDEF_KEYWORD | UNIQUE_KEYWORD |
| 1296 | | UNITS_KEYWORD | USES_KEYWORD | VALUE_KEYWORD | WHEN_KEYWORD | YANG_VERSION_KEYWORD |
| 1297 | | YIN_ELEMENT_KEYWORD | ADD_KEYWORD | CURRENT_KEYWORD | DELETE_KEYWORD | DEPRECATED_KEYWORD |
| 1298 | | FALSE_KEYWORD | MAX_KEYWORD | MIN_KEYWORD | NOT_SUPPORTED_KEYWORD | OBSOLETE_KEYWORD |
| 1299 | | REPLACE_KEYWORD | SYSTEM_KEYWORD | TRUE_KEYWORD | UNBOUNDED_KEYWORD | USER_KEYWORD; |