Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | 0f7908b | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Vidyashree Rama | 66bc525 | 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 | |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 28 | yangfile : moduleStatement |
| 29 | | subModuleStatement; |
Vidyashree Rama | 66bc525 | 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 | 07021a2 | 2016-03-09 20:41:44 +0530 | [diff] [blame] | 43 | moduleStatement : MODULE_KEYWORD identifier LEFT_CURLY_BRACE moduleBody RIGHT_CURLY_BRACE; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 44 | |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 45 | moduleBody : moduleHeaderStatement linkageStatements metaStatements revisionStatements bodyStatements; |
Vidyashree Rama | 66bc525 | 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 | 607e05e | 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 | 66bc525 | 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 | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 67 | linkageStatements : (importStatement |
| 68 | | includeStatement)*; |
Vidyashree Rama | 66bc525 | 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 | 607e05e | 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 | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 101 | ; |
| 102 | |
| 103 | // revision-stmts = *(revision-stmt stmtsep) |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 104 | revisionStatements : revisionStatement*; |
Vidyashree Rama | 66bc525 | 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 | 607e05e | 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 | 66bc525 | 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 | e68bb19 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 134 | yangVersionStatement : YANG_VERSION_KEYWORD version STMTEND; |
Vidyashree Rama | 66bc525 | 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 | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 141 | namespaceStatement : NAMESPACE_KEYWORD string STMTEND; |
Vidyashree Rama | 66bc525 | 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 | d322132 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 147 | prefixStatement : PREFIX_KEYWORD identifier STMTEND; |
Vidyashree Rama | 66bc525 | 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 | d322132 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 156 | importStatement : IMPORT_KEYWORD identifier LEFT_CURLY_BRACE importStatementBody RIGHT_CURLY_BRACE; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 157 | |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 158 | importStatementBody : prefixStatement revisionDateStatement?; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 159 | |
| 160 | // revision-date-stmt = revision-date-keyword sep revision-date stmtend |
Vidyashree Rama | d322132 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 161 | revisionDateStatement : REVISION_DATE_KEYWORD dateArgumentString STMTEND; |
Vidyashree Rama | 66bc525 | 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 | d322132 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 170 | includeStatement : INCLUDE_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE revisionDateStatement? RIGHT_CURLY_BRACE); |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 171 | |
| 172 | /** |
| 173 | * organization-stmt = organization-keyword sep string |
| 174 | * optsep stmtend |
| 175 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 176 | organizationStatement : ORGANIZATION_KEYWORD string STMTEND; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 177 | |
| 178 | // contact-stmt = contact-keyword sep string optsep stmtend |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 179 | contactStatement : CONTACT_KEYWORD string STMTEND; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 180 | |
| 181 | // description-stmt = description-keyword sep string optsep stmtend |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 182 | descriptionStatement : DESCRIPTION_KEYWORD string STMTEND; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 183 | |
| 184 | // reference-stmt = reference-keyword sep string optsep stmtend |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 185 | referenceStatement : REFERENCE_KEYWORD string STMTEND; |
Vidyashree Rama | 66bc525 | 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 | d322132 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 195 | revisionStatement : REVISION_KEYWORD dateArgumentString (STMTEND | LEFT_CURLY_BRACE revisionStatementBody RIGHT_CURLY_BRACE); |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 196 | revisionStatementBody : descriptionStatement? referenceStatement?; |
Vidyashree Rama | 66bc525 | 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 | 07021a2 | 2016-03-09 20:41:44 +0530 | [diff] [blame] | 209 | subModuleStatement : SUBMODULE_KEYWORD identifier LEFT_CURLY_BRACE submoduleBody RIGHT_CURLY_BRACE; |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 210 | submoduleBody : submoduleHeaderStatement linkageStatements metaStatements revisionStatements bodyStatements; |
Vidyashree Rama | 66bc525 | 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 | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 217 | submoduleHeaderStatement : yangVersionStatement? belongstoStatement |
| 218 | | belongstoStatement yangVersionStatement? |
Vidyashree Rama | 66bc525 | 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 | d322132 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 228 | belongstoStatement : BELONGS_TO_KEYWORD identifier LEFT_CURLY_BRACE belongstoStatementBody RIGHT_CURLY_BRACE; |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 229 | belongstoStatementBody : prefixStatement; |
Vidyashree Rama | 66bc525 | 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 | d322132 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 242 | extensionStatement : EXTENSION_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE extensionBody RIGHT_CURLY_BRACE); |
Gaurav Agrawal | 607e05e | 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 | 66bc525 | 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 | d322132 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 276 | argumentStatement : ARGUMENT_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE argumentBody RIGHT_CURLY_BRACE); |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 277 | argumentBody : yinElementStatement?; |
Vidyashree Rama | 66bc525 | 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 | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 283 | yinElementStatement : YIN_ELEMENT_KEYWORD (TRUE_KEYWORD | FALSE_KEYWORD) STMTEND; |
Vidyashree Rama | 66bc525 | 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 | d322132 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 296 | identityStatement : IDENTITY_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE identityBody RIGHT_CURLY_BRACE); |
Gaurav Agrawal | 607e05e | 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 | 66bc525 | 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 | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 329 | baseStatement : BASE_KEYWORD string STMTEND; |
Vidyashree Rama | 66bc525 | 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 | 607e05e | 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 | 66bc525 | 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 | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 378 | dataDefStatement : containerStatement |
| 379 | | leafStatement |
| 380 | | leafListStatement |
| 381 | | listStatement |
| 382 | | choiceStatement |
| 383 | | usesStatement; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 384 | |
| 385 | /** |
| 386 | * if-feature-stmt = if-feature-keyword sep identifier-ref-arg-str |
| 387 | * optsep stmtend |
| 388 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 389 | ifFeatureStatement : IF_FEATURE_KEYWORD string STMTEND; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 390 | |
| 391 | /** |
| 392 | * units-stmt = units-keyword sep string optsep stmtend |
| 393 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 394 | unitsStatement : UNITS_KEYWORD string STMTEND; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 395 | |
| 396 | /** |
| 397 | * typedef-stmt = typedef-keyword sep identifier-arg-str optsep |
| 398 | * "{" stmtsep |
| 399 | * ;; these stmts can appear in any order |
| 400 | * type-stmt stmtsep |
| 401 | * [units-stmt stmtsep] |
| 402 | * [default-stmt stmtsep] |
| 403 | * [status-stmt stmtsep] |
| 404 | * [description-stmt stmtsep] |
| 405 | * [reference-stmt stmtsep] |
| 406 | * "}" |
| 407 | * TODO : 0..1 occurance to be validated in listener |
| 408 | */ |
Vidyashree Rama | d322132 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 409 | typedefStatement : TYPEDEF_KEYWORD identifier LEFT_CURLY_BRACE |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 410 | (typeStatement | unitsStatement | defaultStatement | statusStatement | descriptionStatement | referenceStatement)* |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 411 | RIGHT_CURLY_BRACE; |
| 412 | |
| 413 | /** |
| 414 | * type-stmt = type-keyword sep identifier-ref-arg-str optsep |
| 415 | * (";" / |
| 416 | * "{" stmtsep |
| 417 | * type-body-stmts |
| 418 | * "}") |
| 419 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 420 | typeStatement : TYPE_KEYWORD string (STMTEND | LEFT_CURLY_BRACE typeBodyStatements RIGHT_CURLY_BRACE); |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 421 | |
| 422 | /** |
| 423 | * type-body-stmts = numerical-restrictions / |
| 424 | * decimal64-specification / |
| 425 | * string-restrictions / |
| 426 | * enum-specification / |
| 427 | * leafref-specification / |
| 428 | * identityref-specification / |
| 429 | * instance-identifier-specification / |
| 430 | * bits-specification / |
| 431 | * union-specification |
| 432 | * TODO : decimal64-specification to be added |
| 433 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 434 | typeBodyStatements : numericalRestrictions | stringRestrictions | enumSpecification |
| 435 | | leafrefSpecification | identityrefSpecification | instanceIdentifierSpecification |
| 436 | | bitsSpecification | unionSpecification; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 437 | |
| 438 | /** |
| 439 | * numerical-restrictions = range-stmt stmtsep |
| 440 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 441 | numericalRestrictions : rangeStatement; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 442 | |
| 443 | /** |
| 444 | * range-stmt = range-keyword sep range-arg-str optsep |
| 445 | * (";" / |
| 446 | * "{" stmtsep |
| 447 | * ;; these stmts can appear in any order |
| 448 | * [error-message-stmt stmtsep] |
| 449 | * [error-app-tag-stmt stmtsep] |
| 450 | * [description-stmt stmtsep] |
| 451 | * [reference-stmt stmtsep] |
| 452 | * "}") |
| 453 | */ |
Vidyashree Rama | e68bb19 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 454 | rangeStatement : RANGE_KEYWORD range (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE); |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 455 | |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 456 | commonStatements : errorMessageStatement? errorAppTagStatement? descriptionStatement? referenceStatement? |
| 457 | | errorMessageStatement? errorAppTagStatement? referenceStatement? descriptionStatement? |
| 458 | | errorMessageStatement? descriptionStatement? errorAppTagStatement? referenceStatement? |
| 459 | | errorMessageStatement? descriptionStatement? referenceStatement? errorAppTagStatement? |
| 460 | | errorMessageStatement? referenceStatement? errorAppTagStatement? descriptionStatement? |
| 461 | | errorMessageStatement? referenceStatement? descriptionStatement? errorAppTagStatement? |
| 462 | | errorAppTagStatement? errorMessageStatement? descriptionStatement? referenceStatement? |
| 463 | | errorAppTagStatement? errorMessageStatement? referenceStatement? descriptionStatement? |
| 464 | | errorAppTagStatement? descriptionStatement? descriptionStatement? errorMessageStatement? |
| 465 | | errorAppTagStatement? descriptionStatement? errorMessageStatement? descriptionStatement? |
| 466 | | errorAppTagStatement? referenceStatement? errorMessageStatement? descriptionStatement? |
| 467 | | errorAppTagStatement? referenceStatement? descriptionStatement? errorMessageStatement? |
| 468 | | descriptionStatement? errorMessageStatement? errorAppTagStatement? referenceStatement? |
| 469 | | descriptionStatement? errorMessageStatement? referenceStatement? errorAppTagStatement? |
| 470 | | descriptionStatement? errorAppTagStatement? errorMessageStatement? referenceStatement? |
| 471 | | descriptionStatement? errorAppTagStatement? referenceStatement? errorMessageStatement? |
| 472 | | descriptionStatement? referenceStatement? errorMessageStatement? errorAppTagStatement? |
| 473 | | descriptionStatement? referenceStatement? errorAppTagStatement? errorMessageStatement? |
| 474 | | referenceStatement? errorMessageStatement? descriptionStatement? errorAppTagStatement? |
| 475 | | referenceStatement? errorMessageStatement? errorAppTagStatement? descriptionStatement? |
| 476 | | referenceStatement? errorAppTagStatement? descriptionStatement? errorMessageStatement? |
| 477 | | referenceStatement? errorAppTagStatement? errorMessageStatement? descriptionStatement? |
| 478 | | referenceStatement? descriptionStatement? errorMessageStatement? errorAppTagStatement? |
| 479 | | referenceStatement? descriptionStatement? errorAppTagStatement? errorMessageStatement? |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 480 | ; |
| 481 | |
| 482 | /** |
| 483 | * string-restrictions = ;; these stmts can appear in any order |
| 484 | * [length-stmt stmtsep] |
| 485 | * *(pattern-stmt stmtsep) |
| 486 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 487 | stringRestrictions : ((lengthStatement)? (patternStatement)*) | ((patternStatement)* (lengthStatement)?); |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 488 | |
| 489 | /** |
| 490 | * length-stmt = length-keyword sep length-arg-str optsep |
| 491 | * (";" / |
| 492 | * "{" stmtsep |
| 493 | * ;; these stmts can appear in any order |
| 494 | * [error-message-stmt stmtsep] |
| 495 | * [error-app-tag-stmt stmtsep] |
| 496 | * [description-stmt stmtsep] |
| 497 | * [reference-stmt stmtsep] |
| 498 | * "}") |
| 499 | */ |
Vidyashree Rama | e68bb19 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 500 | lengthStatement : LENGTH_KEYWORD length |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 501 | (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE); |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 502 | |
| 503 | /** |
| 504 | * pattern-stmt = pattern-keyword sep string 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 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 514 | patternStatement : PATTERN_KEYWORD string (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE); |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 515 | |
| 516 | /** |
| 517 | * default-stmt = default-keyword sep string stmtend |
| 518 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 519 | defaultStatement : DEFAULT_KEYWORD string STMTEND; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 520 | |
| 521 | /** |
| 522 | * enum-specification = 1*(enum-stmt stmtsep) |
| 523 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 524 | enumSpecification : enumStatement+; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 525 | |
| 526 | /** |
| 527 | * enum-stmt = enum-keyword sep string optsep |
| 528 | * (";" / |
| 529 | * "{" stmtsep |
| 530 | * ;; these stmts can appear in any order |
| 531 | * [value-stmt stmtsep] |
| 532 | * [status-stmt stmtsep] |
| 533 | * [description-stmt stmtsep] |
| 534 | * [reference-stmt stmtsep] |
| 535 | * "}") |
| 536 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 537 | enumStatement : ENUM_KEYWORD string (STMTEND | LEFT_CURLY_BRACE enumStatementBody RIGHT_CURLY_BRACE); |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 538 | |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 539 | enumStatementBody : valueStatement? statusStatement? descriptionStatement? referenceStatement? |
| 540 | | valueStatement? statusStatement? referenceStatement? descriptionStatement? |
| 541 | | valueStatement? descriptionStatement? statusStatement? referenceStatement? |
| 542 | | valueStatement? descriptionStatement? referenceStatement? statusStatement? |
| 543 | | valueStatement? referenceStatement? statusStatement? descriptionStatement? |
| 544 | | valueStatement? referenceStatement? descriptionStatement? statusStatement? |
| 545 | | statusStatement? valueStatement? descriptionStatement? referenceStatement? |
| 546 | | statusStatement? valueStatement? referenceStatement? descriptionStatement? |
| 547 | | statusStatement? descriptionStatement? descriptionStatement? valueStatement? |
| 548 | | statusStatement? descriptionStatement? valueStatement? descriptionStatement? |
| 549 | | statusStatement? referenceStatement? valueStatement? descriptionStatement? |
| 550 | | statusStatement? referenceStatement? descriptionStatement? valueStatement? |
| 551 | | descriptionStatement? valueStatement? statusStatement? referenceStatement? |
| 552 | | descriptionStatement? valueStatement? referenceStatement? statusStatement? |
| 553 | | descriptionStatement? statusStatement? valueStatement? referenceStatement? |
| 554 | | descriptionStatement? statusStatement? referenceStatement? valueStatement? |
| 555 | | descriptionStatement? referenceStatement? valueStatement? statusStatement? |
| 556 | | descriptionStatement? referenceStatement? statusStatement? valueStatement? |
| 557 | | referenceStatement? valueStatement? descriptionStatement? statusStatement? |
| 558 | | referenceStatement? valueStatement? statusStatement? descriptionStatement? |
| 559 | | referenceStatement? statusStatement? descriptionStatement? valueStatement? |
| 560 | | referenceStatement? statusStatement? valueStatement? descriptionStatement? |
| 561 | | referenceStatement? descriptionStatement? valueStatement? statusStatement? |
| 562 | | referenceStatement? descriptionStatement? statusStatement? valueStatement? |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 563 | ; |
| 564 | |
| 565 | /** |
| 566 | * leafref-specification = |
| 567 | * ;; these stmts can appear in any order |
| 568 | * path-stmt stmtsep |
| 569 | * [require-instance-stmt stmtsep] |
| 570 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 571 | leafrefSpecification : (pathStatement (requireInstanceStatement)?) | ((requireInstanceStatement)? pathStatement); |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 572 | |
| 573 | /** |
| 574 | * path-stmt = path-keyword sep path-arg-str stmtend |
| 575 | */ |
Vidyashree Rama | e68bb19 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 576 | pathStatement : PATH_KEYWORD path STMTEND; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 577 | |
| 578 | /** |
| 579 | * require-instance-stmt = require-instance-keyword sep |
| 580 | * require-instance-arg-str stmtend |
| 581 | * require-instance-arg-str = < a string that matches the rule |
| 582 | * require-instance-arg > |
| 583 | * require-instance-arg = true-keyword / false-keyword |
| 584 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 585 | requireInstanceStatement : REQUIRE_INSTANCE_KEYWORD (TRUE_KEYWORD | FALSE_KEYWORD) STMTEND; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 586 | |
| 587 | /** |
| 588 | * instance-identifier-specification = |
| 589 | * [require-instance-stmt stmtsep] |
| 590 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 591 | instanceIdentifierSpecification : requireInstanceStatement?; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 592 | |
| 593 | /** |
| 594 | * identityref-specification = |
| 595 | * base-stmt stmtsep |
| 596 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 597 | identityrefSpecification : baseStatement; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 598 | |
| 599 | /** |
| 600 | * union-specification = 1*(type-stmt stmtsep) |
| 601 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 602 | unionSpecification : typeStatement+; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 603 | |
| 604 | /** |
| 605 | * bits-specification = 1*(bit-stmt stmtsep) |
| 606 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 607 | bitsSpecification : bitStatement+; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 608 | |
| 609 | /** |
| 610 | * bit-stmt = bit-keyword sep identifier-arg-str optsep |
| 611 | * (";" / |
| 612 | * "{" stmtsep |
| 613 | * ;; these stmts can appear in any order |
| 614 | * [position-stmt stmtsep] |
| 615 | * [status-stmt stmtsep] |
| 616 | * [description-stmt stmtsep] |
| 617 | * [reference-stmt stmtsep] |
| 618 | * "}" |
| 619 | * "}") |
| 620 | */ |
Vidyashree Rama | d322132 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 621 | bitStatement : BIT_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE bitBodyStatement RIGHT_CURLY_BRACE); |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 622 | |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 623 | bitBodyStatement : positionStatement? statusStatement? descriptionStatement? referenceStatement? |
| 624 | | positionStatement? statusStatement? referenceStatement? descriptionStatement? |
| 625 | | positionStatement? descriptionStatement? statusStatement? referenceStatement? |
| 626 | | positionStatement? descriptionStatement? referenceStatement? statusStatement? |
| 627 | | positionStatement? referenceStatement? statusStatement? descriptionStatement? |
| 628 | | positionStatement? referenceStatement? descriptionStatement? statusStatement? |
| 629 | | statusStatement? positionStatement? descriptionStatement? referenceStatement? |
| 630 | | statusStatement? positionStatement? referenceStatement? descriptionStatement? |
| 631 | | statusStatement? descriptionStatement? descriptionStatement? positionStatement? |
| 632 | | statusStatement? descriptionStatement? positionStatement? descriptionStatement? |
| 633 | | statusStatement? referenceStatement? positionStatement? descriptionStatement? |
| 634 | | statusStatement? referenceStatement? descriptionStatement? positionStatement? |
| 635 | | descriptionStatement? positionStatement? statusStatement? referenceStatement? |
| 636 | | descriptionStatement? positionStatement? referenceStatement? statusStatement? |
| 637 | | descriptionStatement? statusStatement? positionStatement? referenceStatement? |
| 638 | | descriptionStatement? statusStatement? referenceStatement? positionStatement? |
| 639 | | descriptionStatement? referenceStatement? positionStatement? statusStatement? |
| 640 | | descriptionStatement? referenceStatement? statusStatement? positionStatement? |
| 641 | | referenceStatement? positionStatement? descriptionStatement? statusStatement? |
| 642 | | referenceStatement? positionStatement? statusStatement? descriptionStatement? |
| 643 | | referenceStatement? statusStatement? descriptionStatement? positionStatement? |
| 644 | | referenceStatement? statusStatement? positionStatement? descriptionStatement? |
| 645 | | referenceStatement? descriptionStatement? positionStatement? statusStatement? |
| 646 | | referenceStatement? descriptionStatement? statusStatement? positionStatement? |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 647 | ; |
| 648 | |
| 649 | /** |
| 650 | * position-stmt = position-keyword sep |
| 651 | * position-value-arg-str stmtend |
| 652 | * position-value-arg-str = < a string that matches the rule |
| 653 | * position-value-arg > |
| 654 | * position-value-arg = non-negative-integer-value |
| 655 | */ |
Vidyashree Rama | e68bb19 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 656 | positionStatement : POSITION_KEYWORD position STMTEND; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 657 | |
| 658 | /** |
| 659 | * status-stmt = status-keyword sep status-arg-str stmtend |
| 660 | * status-arg-str = < a string that matches the rule |
| 661 | * status-arg > |
| 662 | * status-arg = current-keyword / |
| 663 | * obsolete-keyword / |
| 664 | * deprecated-keyword |
| 665 | */ |
Vidyashree Rama | e68bb19 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 666 | statusStatement : STATUS_KEYWORD status STMTEND; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 667 | |
| 668 | /** |
| 669 | * config-stmt = config-keyword sep |
| 670 | * config-arg-str stmtend |
| 671 | * config-arg-str = < a string that matches the rule |
| 672 | * config-arg > |
| 673 | * config-arg = true-keyword / false-keyword |
| 674 | */ |
Vidyashree Rama | e68bb19 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 675 | configStatement : CONFIG_KEYWORD config STMTEND; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 676 | |
| 677 | /** |
| 678 | * mandatory-stmt = mandatory-keyword sep |
| 679 | * mandatory-arg-str stmtend |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 680 | * |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 681 | * mandatory-arg-str = < a string that matches the rule |
| 682 | * mandatory-arg > |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 683 | * |
| 684 | * mandatory-arg = true-keyword / false-keyword |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 685 | */ |
Vidyashree Rama | e68bb19 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 686 | mandatoryStatement : MANDATORY_KEYWORD mandatory STMTEND; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 687 | |
| 688 | /** |
| 689 | * presence-stmt = presence-keyword sep string stmtend |
| 690 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 691 | presenceStatement : PRESENCE_KEYWORD string STMTEND; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 692 | |
| 693 | /** |
| 694 | * ordered-by-stmt = ordered-by-keyword sep |
| 695 | * ordered-by-arg-str stmtend |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 696 | * |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 697 | * ordered-by-arg-str = < a string that matches the rule |
| 698 | * ordered-by-arg > |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 699 | * |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 700 | * ordered-by-arg = user-keyword / system-keyword |
| 701 | */ |
Vidyashree Rama | e68bb19 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 702 | orderedByStatement : ORDERED_BY_KEYWORD orderedBy STMTEND; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 703 | |
| 704 | /** |
| 705 | * must-stmt = must-keyword sep string optsep |
| 706 | * (";" / |
| 707 | * "{" stmtsep |
| 708 | * ;; these stmts can appear in any order |
| 709 | * [error-message-stmt stmtsep] |
| 710 | * [error-app-tag-stmt stmtsep] |
| 711 | * [description-stmt stmtsep] |
| 712 | * [reference-stmt stmtsep] |
| 713 | * "}") |
| 714 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 715 | mustStatement : MUST_KEYWORD string (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE); |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 716 | |
| 717 | /** |
| 718 | * error-message-stmt = error-message-keyword sep string stmtend |
| 719 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 720 | errorMessageStatement : ERROR_MESSAGE_KEYWORD string STMTEND; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 721 | |
| 722 | /** |
| 723 | * error-app-tag-stmt = error-app-tag-keyword sep string stmtend |
| 724 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 725 | errorAppTagStatement : ERROR_APP_TAG_KEYWORD string STMTEND; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 726 | |
| 727 | /** |
| 728 | * min-elements-stmt = min-elements-keyword sep |
| 729 | * min-value-arg-str stmtend |
| 730 | * min-value-arg-str = < a string that matches the rule |
| 731 | * min-value-arg > |
| 732 | * min-value-arg = non-negative-integer-value |
| 733 | */ |
Vidyashree Rama | e68bb19 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 734 | minElementsStatement : MIN_ELEMENTS_KEYWORD minValue STMTEND; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 735 | |
| 736 | /** |
| 737 | * max-elements-stmt = max-elements-keyword sep |
| 738 | * max-value-arg-str stmtend |
| 739 | * max-value-arg-str = < a string that matches the rule |
| 740 | * max-value-arg > |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 741 | * max-value-arg = unbounded-keyword / |
| 742 | * positive-integer-value |
| 743 | */ |
Vidyashree Rama | e68bb19 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 744 | maxElementsStatement : MAX_ELEMENTS_KEYWORD maxValue STMTEND; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 745 | |
| 746 | /** |
| 747 | * value-stmt = value-keyword sep integer-value stmtend |
| 748 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 749 | valueStatement : VALUE_KEYWORD ((MINUS INTEGER) | INTEGER) STMTEND; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 750 | |
| 751 | /** |
| 752 | * grouping-stmt = grouping-keyword sep identifier-arg-str optsep |
| 753 | * (";" / |
| 754 | * "{" stmtsep |
| 755 | * ;; these stmts can appear in any order |
| 756 | * [status-stmt stmtsep] |
| 757 | * [description-stmt stmtsep] |
| 758 | * [reference-stmt stmtsep] |
| 759 | * *((typedef-stmt / |
| 760 | * grouping-stmt) stmtsep) |
| 761 | * *(data-def-stmt stmtsep) |
| 762 | * "}") |
| 763 | * TODO : 0..1 occurance to be checked in listener |
| 764 | */ |
Vidyashree Rama | d322132 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 765 | groupingStatement : GROUPING_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 766 | (statusStatement | descriptionStatement | referenceStatement | typedefStatement | groupingStatement |
| 767 | | dataDefStatement)* RIGHT_CURLY_BRACE); |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 768 | |
| 769 | /** |
| 770 | * container-stmt = container-keyword sep identifier-arg-str optsep |
| 771 | * (";" / |
| 772 | * "{" stmtsep |
| 773 | * ;; these stmts can appear in any order |
| 774 | * [when-stmt stmtsep] |
| 775 | * *(if-feature-stmt stmtsep) |
| 776 | * *(must-stmt stmtsep) |
| 777 | * [presence-stmt stmtsep] |
| 778 | * [config-stmt stmtsep] |
| 779 | * [status-stmt stmtsep] |
| 780 | * [description-stmt stmtsep] |
| 781 | * [reference-stmt stmtsep] |
| 782 | * *((typedef-stmt / |
| 783 | * grouping-stmt) stmtsep) |
| 784 | * *(data-def-stmt stmtsep) |
| 785 | * "}") |
| 786 | * TODO : 0..1 occurance to be checked in listener |
| 787 | */ |
Vidyashree Rama | d322132 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 788 | containerStatement : CONTAINER_KEYWORD identifier |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 789 | (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | mustStatement | presenceStatement | configStatement |
| 790 | | statusStatement | descriptionStatement | referenceStatement | typedefStatement | groupingStatement |
| 791 | | dataDefStatement)* RIGHT_CURLY_BRACE); |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 792 | |
| 793 | /** |
| 794 | * leaf-stmt = leaf-keyword sep identifier-arg-str optsep |
| 795 | * "{" stmtsep |
| 796 | * ;; these stmts can appear in any order |
| 797 | * [when-stmt stmtsep] |
| 798 | * *(if-feature-stmt stmtsep) |
| 799 | * type-stmt stmtsep |
| 800 | * [units-stmt stmtsep] |
| 801 | * *(must-stmt stmtsep) |
| 802 | * [default-stmt stmtsep] |
| 803 | * [config-stmt stmtsep] |
| 804 | * [mandatory-stmt stmtsep] |
| 805 | * [status-stmt stmtsep] |
| 806 | * [description-stmt stmtsep] |
| 807 | * [reference-stmt stmtsep] |
| 808 | * "}" |
| 809 | * TODO : 0..1 occurance to be checked in listener |
| 810 | */ |
Vidyashree Rama | d322132 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 811 | leafStatement : LEAF_KEYWORD identifier LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | typeStatement | unitsStatement |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 812 | | mustStatement | defaultStatement | configStatement | mandatoryStatement | statusStatement | descriptionStatement |
| 813 | | referenceStatement)* RIGHT_CURLY_BRACE; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 814 | |
| 815 | /** |
| 816 | * leaf-list-stmt = leaf-list-keyword sep identifier-arg-str optsep |
| 817 | * "{" stmtsep |
| 818 | * ;; these stmts can appear in any order |
| 819 | * [when-stmt stmtsep] |
| 820 | * *(if-feature-stmt stmtsep) |
| 821 | * type-stmt stmtsep |
| 822 | * [units-stmt stmtsep] |
| 823 | * *(must-stmt stmtsep) |
| 824 | * [config-stmt stmtsep] |
| 825 | * [min-elements-stmt stmtsep] |
| 826 | * [max-elements-stmt stmtsep] |
| 827 | * [ordered-by-stmt stmtsep] |
| 828 | * [status-stmt stmtsep] |
| 829 | * [description-stmt stmtsep] |
| 830 | * [reference-stmt stmtsep] |
| 831 | * "}" |
| 832 | * TODO : 0..1 occurance to be checked in listener |
| 833 | */ |
Vidyashree Rama | d322132 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 834 | leafListStatement : LEAF_LIST_KEYWORD identifier LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | typeStatement |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 835 | | unitsStatement | mustStatement | configStatement | minElementsStatement | maxElementsStatement | orderedByStatement |
| 836 | | statusStatement | descriptionStatement | referenceStatement)* RIGHT_CURLY_BRACE; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 837 | |
| 838 | /** |
| 839 | * list-stmt = list-keyword sep identifier-arg-str optsep |
| 840 | * "{" stmtsep |
| 841 | * ;; these stmts can appear in any order |
| 842 | * [when-stmt stmtsep] |
| 843 | * *(if-feature-stmt stmtsep) |
| 844 | * *(must-stmt stmtsep) |
| 845 | * [key-stmt stmtsep] |
| 846 | * *(unique-stmt stmtsep) |
| 847 | * [config-stmt stmtsep] |
| 848 | * [min-elements-stmt stmtsep] |
| 849 | * [max-elements-stmt stmtsep] |
| 850 | * [ordered-by-stmt stmtsep] |
| 851 | * [status-stmt stmtsep] |
| 852 | * [description-stmt stmtsep] |
| 853 | * [reference-stmt stmtsep] |
| 854 | * *((typedef-stmt / |
| 855 | * grouping-stmt) stmtsep) |
| 856 | * 1*(data-def-stmt stmtsep) |
| 857 | * "}" |
| 858 | * TODO : 0..1 occurance to be checked in listener |
| 859 | */ |
Vidyashree Rama | d322132 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 860 | listStatement : LIST_KEYWORD identifier LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | mustStatement | keyStatement |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 861 | | uniqueStatement | configStatement | minElementsStatement | maxElementsStatement | orderedByStatement | statusStatement |
| 862 | | descriptionStatement | referenceStatement | typedefStatement | groupingStatement| dataDefStatement)* RIGHT_CURLY_BRACE; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 863 | |
| 864 | /** |
| 865 | * key-stmt = key-keyword sep key-arg-str stmtend |
| 866 | */ |
Vidyashree Rama | e68bb19 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 867 | keyStatement : KEY_KEYWORD key STMTEND; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 868 | |
| 869 | /** |
| 870 | * unique-stmt = unique-keyword sep unique-arg-str stmtend |
| 871 | */ |
Vidyashree Rama | e68bb19 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 872 | uniqueStatement: UNIQUE_KEYWORD unique STMTEND; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 873 | |
| 874 | /** |
| 875 | * choice-stmt = choice-keyword sep identifier-arg-str optsep |
| 876 | * (";" / |
| 877 | * "{" stmtsep |
| 878 | * ;; these stmts can appear in any order |
| 879 | * [when-stmt stmtsep] |
| 880 | * *(if-feature-stmt stmtsep) |
| 881 | * [default-stmt stmtsep] |
| 882 | * [config-stmt stmtsep] |
| 883 | * [mandatory-stmt stmtsep] |
| 884 | * [status-stmt stmtsep] |
| 885 | * [description-stmt stmtsep] |
| 886 | * [reference-stmt stmtsep] |
| 887 | * *((short-case-stmt / case-stmt) stmtsep) |
| 888 | * "}") |
| 889 | * TODO : 0..1 occurance to be checked in listener |
| 890 | */ |
Vidyashree Rama | d322132 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 891 | choiceStatement : CHOICE_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | defaultStatement |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 892 | | configStatement | mandatoryStatement | statusStatement | descriptionStatement | referenceStatement | shortCaseStatement |
| 893 | | caseStatement)* RIGHT_CURLY_BRACE); |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 894 | |
| 895 | /** |
| 896 | * short-case-stmt = container-stmt / |
| 897 | * leaf-stmt / |
| 898 | * leaf-list-stmt / |
| 899 | * list-stmt / |
| 900 | * anyxml-stmt |
| 901 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 902 | shortCaseStatement : containerStatement | leafStatement | leafListStatement | listStatement; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 903 | |
| 904 | /** |
| 905 | * case-stmt = case-keyword sep identifier-arg-str optsep |
| 906 | * (";" / |
| 907 | * "{" stmtsep |
| 908 | * ;; these stmts can appear in any order |
| 909 | * [when-stmt stmtsep] |
| 910 | * *(if-feature-stmt stmtsep) |
| 911 | * [status-stmt stmtsep] |
| 912 | * [description-stmt stmtsep] |
| 913 | * [reference-stmt stmtsep] |
| 914 | * *(data-def-stmt stmtsep) |
| 915 | * "}") |
| 916 | * TODO : 0..1 occurance to be checked in listener |
| 917 | */ |
Vidyashree Rama | d322132 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 918 | caseStatement : CASE_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | statusStatement |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 919 | | descriptionStatement | referenceStatement | dataDefStatement)* RIGHT_CURLY_BRACE); |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 920 | |
| 921 | /** |
| 922 | * uses-stmt = uses-keyword sep identifier-ref-arg-str optsep |
| 923 | * (";" / |
| 924 | * "{" stmtsep |
| 925 | * ;; these stmts can appear in any order |
| 926 | * [when-stmt stmtsep] |
| 927 | * *(if-feature-stmt stmtsep) |
| 928 | * [status-stmt stmtsep] |
| 929 | * [description-stmt stmtsep] |
| 930 | * [reference-stmt stmtsep] |
| 931 | * *(refine-stmt stmtsep) |
| 932 | * *(uses-augment-stmt stmtsep) |
| 933 | * "}") |
| 934 | * TODO : 0..1 occurance to be checked in listener |
| 935 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 936 | usesStatement : USES_KEYWORD string (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | statusStatement |
| 937 | | descriptionStatement | referenceStatement | refineStatement | usesAugmentStatement)* RIGHT_CURLY_BRACE); |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 938 | |
| 939 | /** |
| 940 | * refine-stmt = refine-keyword sep refine-arg-str optsep |
| 941 | * (";" / |
| 942 | * "{" stmtsep |
| 943 | * (refine-container-stmts / |
| 944 | * refine-leaf-stmts / |
| 945 | * refine-leaf-list-stmts / |
| 946 | * refine-list-stmts / |
| 947 | * refine-choice-stmts / |
| 948 | * refine-case-stmts / |
| 949 | * refine-anyxml-stmts) |
| 950 | * "}") |
| 951 | */ |
Vidyashree Rama | e68bb19 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 952 | refineStatement : REFINE_KEYWORD refine (STMTEND | LEFT_CURLY_BRACE (refineContainerStatements |
| 953 | | refineLeafStatements | refineLeafListStatements | refineListStatements | refineChoiceStatements |
| 954 | | refineCaseStatements) RIGHT_CURLY_BRACE); |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 955 | |
| 956 | /** |
| 957 | * refine-container-stmts = |
| 958 | * ;; these stmts can appear in any order |
| 959 | * *(must-stmt stmtsep) |
| 960 | * [presence-stmt stmtsep] |
| 961 | * [config-stmt stmtsep] |
| 962 | * [description-stmt stmtsep] |
| 963 | * [reference-stmt stmtsep] |
| 964 | * TODO : 0..1 occurance to be checked in listener |
| 965 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 966 | refineContainerStatements : (mustStatement | presenceStatement | configStatement | descriptionStatement | referenceStatement)* ; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 967 | |
| 968 | /** |
| 969 | * refine-leaf-stmts = ;; these stmts can appear in any order |
| 970 | * *(must-stmt stmtsep) |
| 971 | * [default-stmt stmtsep] |
| 972 | * [config-stmt stmtsep] |
| 973 | * [mandatory-stmt stmtsep] |
| 974 | * [description-stmt stmtsep] |
| 975 | * [reference-stmt stmtsep] |
| 976 | * TODO : 0..1 occurance to be checked in listener |
| 977 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 978 | refineLeafStatements : (mustStatement | defaultStatement | configStatement | mandatoryStatement | descriptionStatement | referenceStatement)*; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 979 | |
| 980 | /** |
| 981 | * refine-leaf-list-stmts = |
| 982 | * ;; these stmts can appear in any order |
| 983 | * *(must-stmt stmtsep) |
| 984 | * [config-stmt stmtsep] |
| 985 | * [min-elements-stmt stmtsep] |
| 986 | * [max-elements-stmt stmtsep] |
| 987 | * [description-stmt stmtsep] |
| 988 | * [reference-stmt stmtsep] |
| 989 | * TODO : 0..1 occurance to be checked in listener |
| 990 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 991 | refineLeafListStatements : (mustStatement | configStatement | minElementsStatement | maxElementsStatement | descriptionStatement |
| 992 | | referenceStatement)*; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 993 | |
| 994 | /** |
| 995 | * refine-list-stmts = ;; these stmts can appear in any order |
| 996 | * *(must-stmt stmtsep) |
| 997 | * [config-stmt stmtsep] |
| 998 | * [min-elements-stmt stmtsep] |
| 999 | * [max-elements-stmt stmtsep] |
| 1000 | * [description-stmt stmtsep] |
| 1001 | * [reference-stmt stmtsep] |
| 1002 | * TODO : 0..1 occurance to be checked in listener |
| 1003 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1004 | refineListStatements : (mustStatement | configStatement | minElementsStatement | maxElementsStatement | descriptionStatement |
| 1005 | | referenceStatement)*; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1006 | |
| 1007 | /** |
| 1008 | * refine-choice-stmts = ;; these stmts can appear in any order |
| 1009 | * [default-stmt stmtsep] |
| 1010 | * [config-stmt stmtsep] |
| 1011 | * [mandatory-stmt stmtsep] |
| 1012 | * [description-stmt stmtsep] |
| 1013 | * [reference-stmt stmtsep] |
| 1014 | * TODO : 0..1 occurance to be checked in listener |
| 1015 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1016 | refineChoiceStatements : (defaultStatement | configStatement | mandatoryStatement | descriptionStatement | referenceStatement)*; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1017 | |
| 1018 | /** |
| 1019 | * refine-case-stmts = ;; these stmts can appear in any order |
| 1020 | * [description-stmt stmtsep] |
| 1021 | * [reference-stmt stmtsep] |
| 1022 | * |
| 1023 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1024 | refineCaseStatements : (descriptionStatement | referenceStatement)? | (referenceStatement | descriptionStatement)?; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1025 | |
| 1026 | /** |
| 1027 | * uses-augment-stmt = augment-keyword sep uses-augment-arg-str optsep |
| 1028 | * "{" stmtsep |
| 1029 | * ;; these stmts can appear in any order |
| 1030 | * [when-stmt stmtsep] |
| 1031 | * *(if-feature-stmt stmtsep) |
| 1032 | * [status-stmt stmtsep] |
| 1033 | * [description-stmt stmtsep] |
| 1034 | * [reference-stmt stmtsep] |
| 1035 | * 1*((data-def-stmt stmtsep) / |
| 1036 | * (case-stmt stmtsep)) |
| 1037 | * "}" |
| 1038 | * TODO : 0..1 occurance to be checked in listener |
| 1039 | */ |
Vidyashree Rama | e68bb19 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 1040 | usesAugmentStatement : AUGMENT_KEYWORD augment LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement |
| 1041 | | statusStatement | descriptionStatement | referenceStatement | dataDefStatement |
| 1042 | | caseStatement)* RIGHT_CURLY_BRACE; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1043 | |
| 1044 | /** |
| 1045 | * augment-stmt = augment-keyword sep augment-arg-str optsep |
| 1046 | * "{" stmtsep |
| 1047 | * ;; these stmts can appear in any order |
| 1048 | * [when-stmt stmtsep] |
| 1049 | * *(if-feature-stmt stmtsep) |
| 1050 | * [status-stmt stmtsep] |
| 1051 | * [description-stmt stmtsep] |
| 1052 | * [reference-stmt stmtsep] |
| 1053 | * 1*((data-def-stmt stmtsep) / |
| 1054 | * (case-stmt stmtsep)) |
| 1055 | * "}" |
| 1056 | * TODO : 0..1 occurance to be checked in listener |
| 1057 | */ |
Vidyashree Rama | e2bd9ba | 2016-03-29 14:37:02 +0530 | [diff] [blame] | 1058 | augmentStatement : AUGMENT_KEYWORD augment LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | statusStatement |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1059 | | descriptionStatement | referenceStatement | dataDefStatement | caseStatement)* RIGHT_CURLY_BRACE; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1060 | |
| 1061 | /** |
| 1062 | * when-stmt = when-keyword sep string optsep |
| 1063 | * (";" / |
| 1064 | * "{" stmtsep |
| 1065 | * ;; these stmts can appear in any order |
| 1066 | * [description-stmt stmtsep] |
| 1067 | * [reference-stmt stmtsep] |
| 1068 | * "}") |
| 1069 | * |
| 1070 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1071 | whenStatement : WHEN_KEYWORD string (STMTEND | LEFT_CURLY_BRACE ((descriptionStatement? referenceStatement?) |
| 1072 | | (referenceStatement? descriptionStatement?)) RIGHT_CURLY_BRACE); |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1073 | |
| 1074 | /** |
| 1075 | * rpc-stmt = rpc-keyword sep identifier-arg-str optsep |
| 1076 | * (";" / |
| 1077 | * "{" stmtsep |
| 1078 | * ;; these stmts can appear in any order |
| 1079 | * *(if-feature-stmt stmtsep) |
| 1080 | * [status-stmt stmtsep] |
| 1081 | * [description-stmt stmtsep] |
| 1082 | * [reference-stmt stmtsep] |
| 1083 | * *((typedef-stmt / |
| 1084 | * grouping-stmt) stmtsep) |
| 1085 | * [input-stmt stmtsep] |
| 1086 | * [output-stmt stmtsep] |
| 1087 | * "}") |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1088 | */ |
Vidyashree Rama | d322132 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 1089 | rpcStatement : RPC_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (ifFeatureStatement | statusStatement | descriptionStatement |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1090 | | referenceStatement | typedefStatement | groupingStatement | inputStatement | outputStatement)* RIGHT_CURLY_BRACE); |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1091 | |
| 1092 | /** |
| 1093 | * input-stmt = input-keyword optsep |
| 1094 | * "{" stmtsep |
| 1095 | * ;; these stmts can appear in any order |
| 1096 | * *((typedef-stmt / |
| 1097 | * grouping-stmt) stmtsep) |
| 1098 | * 1*(data-def-stmt stmtsep) |
| 1099 | * "}" |
| 1100 | */ |
janani b | 06eca9b | 2016-04-26 18:49:20 +0530 | [diff] [blame] | 1101 | inputStatement : INPUT_KEYWORD LEFT_CURLY_BRACE (typedefStatement | groupingStatement | dataDefStatement)* RIGHT_CURLY_BRACE; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1102 | |
| 1103 | /** |
| 1104 | * output-stmt = output-keyword optsep |
| 1105 | * "{" stmtsep |
| 1106 | * ;; these stmts can appear in any order |
| 1107 | * *((typedef-stmt / |
| 1108 | * grouping-stmt) stmtsep) |
| 1109 | * 1*(data-def-stmt stmtsep) |
| 1110 | * "}" |
| 1111 | */ |
janani b | 06eca9b | 2016-04-26 18:49:20 +0530 | [diff] [blame] | 1112 | outputStatement : OUTPUT_KEYWORD LEFT_CURLY_BRACE (typedefStatement | groupingStatement | dataDefStatement)* RIGHT_CURLY_BRACE; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1113 | |
| 1114 | /** |
| 1115 | * notification-stmt = notification-keyword sep |
| 1116 | * identifier-arg-str optsep |
| 1117 | * (";" / |
| 1118 | * "{" stmtsep |
| 1119 | * ;; these stmts can appear in any order |
| 1120 | * *(if-feature-stmt stmtsep) |
| 1121 | * [status-stmt stmtsep] |
| 1122 | * [description-stmt stmtsep] |
| 1123 | * [reference-stmt stmtsep] |
| 1124 | * *((typedef-stmt / |
| 1125 | * grouping-stmt) stmtsep) |
| 1126 | * *(data-def-stmt stmtsep) |
| 1127 | * "}") |
| 1128 | * TODO : 0..1 occurance to be checked in listener |
| 1129 | */ |
Vidyashree Rama | 620b6e9 | 2016-03-28 11:59:27 +0530 | [diff] [blame] | 1130 | notificationStatement : NOTIFICATION_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (ifFeatureStatement |
| 1131 | | statusStatement | descriptionStatement | referenceStatement | typedefStatement |
| 1132 | | groupingStatement | dataDefStatement)* RIGHT_CURLY_BRACE); |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1133 | |
| 1134 | /** |
| 1135 | * deviation-stmt = deviation-keyword sep |
| 1136 | * deviation-arg-str optsep |
| 1137 | * "{" stmtsep |
| 1138 | * ;; these stmts can appear in any order |
| 1139 | * [description-stmt stmtsep] |
| 1140 | * [reference-stmt stmtsep] |
| 1141 | * (deviate-not-supported-stmt / |
| 1142 | * 1*(deviate-add-stmt / |
| 1143 | * deviate-replace-stmt / |
| 1144 | * deviate-delete-stmt)) |
| 1145 | * "}" |
| 1146 | * TODO : 0..1 occurance to be checked in listener |
| 1147 | */ |
Vidyashree Rama | e68bb19 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 1148 | deviationStatement: DEVIATION_KEYWORD deviation LEFT_CURLY_BRACE (descriptionStatement | referenceStatement |
| 1149 | | deviateNotSupportedStatement | deviateAddStatement | deviateReplaceStatement |
| 1150 | | deviateDeleteStatement)* RIGHT_CURLY_BRACE; |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1151 | |
| 1152 | /** |
| 1153 | * deviate-not-supported-stmt = |
| 1154 | * deviate-keyword sep |
| 1155 | * not-supported-keyword optsep |
| 1156 | * (";" / |
| 1157 | * "{" stmtsep |
| 1158 | * "}") |
| 1159 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1160 | deviateNotSupportedStatement: DEVIATE_KEYWORD NOT_SUPPORTED_KEYWORD (STMTEND | LEFT_CURLY_BRACE RIGHT_CURLY_BRACE); |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1161 | |
| 1162 | /** |
| 1163 | * deviate-add-stmt = deviate-keyword sep add-keyword optsep |
| 1164 | * (";" / |
| 1165 | * "{" stmtsep |
| 1166 | * [units-stmt stmtsep] |
| 1167 | * *(must-stmt stmtsep) |
| 1168 | * *(unique-stmt stmtsep) |
| 1169 | * [default-stmt stmtsep] |
| 1170 | * [config-stmt stmtsep] |
| 1171 | * [mandatory-stmt stmtsep] |
| 1172 | * [min-elements-stmt stmtsep] |
| 1173 | * [max-elements-stmt stmtsep] |
| 1174 | * "}") |
| 1175 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1176 | deviateAddStatement: DEVIATE_KEYWORD ADD_KEYWORD (STMTEND | (LEFT_CURLY_BRACE unitsStatement? mustStatement* uniqueStatement* |
| 1177 | defaultStatement? configStatement? mandatoryStatement? minElementsStatement? maxElementsStatement? |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1178 | RIGHT_CURLY_BRACE)); |
| 1179 | |
| 1180 | /** |
| 1181 | * deviate-delete-stmt = deviate-keyword sep delete-keyword optsep |
| 1182 | * (";" / |
| 1183 | * "{" stmtsep |
| 1184 | * [units-stmt stmtsep] |
| 1185 | * *(must-stmt stmtsep) |
| 1186 | * *(unique-stmt stmtsep) |
| 1187 | * [default-stmt stmtsep] |
| 1188 | * "}") |
| 1189 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1190 | deviateDeleteStatement: DEVIATE_KEYWORD DELETE_KEYWORD (STMTEND |
| 1191 | | (LEFT_CURLY_BRACE unitsStatement? mustStatement* uniqueStatement* defaultStatement? RIGHT_CURLY_BRACE)); |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1192 | |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1193 | /** |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1194 | * deviate-replace-stmt = deviate-keyword sep replace-keyword optsep |
| 1195 | * (";" / |
| 1196 | * "{" stmtsep |
| 1197 | * [type-stmt stmtsep] |
| 1198 | * [units-stmt stmtsep] |
| 1199 | * [default-stmt stmtsep] |
| 1200 | * [config-stmt stmtsep] |
| 1201 | * [mandatory-stmt stmtsep] |
| 1202 | * [min-elements-stmt stmtsep] |
| 1203 | * [max-elements-stmt stmtsep] |
| 1204 | * "}") |
| 1205 | */ |
Gaurav Agrawal | 607e05e | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1206 | deviateReplaceStatement: DEVIATE_KEYWORD REPLACE_KEYWORD (STMTEND | (LEFT_CURLY_BRACE typeStatement? unitsStatement? |
| 1207 | defaultStatement? configStatement? mandatoryStatement? minElementsStatement? |
| 1208 | maxElementsStatement? RIGHT_CURLY_BRACE)); |
Vidyashree Rama | 66bc525 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1209 | |
Gaurav Agrawal | 0520c7c | 2016-02-21 02:56:46 +0530 | [diff] [blame] | 1210 | string : STRING (PLUS STRING)* |
| 1211 | | IDENTIFIER |
Vidyashree Rama | e68bb19 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 1212 | | INTEGER |
| 1213 | | yangConstruct; |
Vidyashree Rama | d322132 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 1214 | |
| 1215 | identifier : STRING (PLUS STRING)* |
Vidyashree Rama | e68bb19 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 1216 | | IDENTIFIER |
| 1217 | | yangConstruct; |
Vidyashree Rama | d322132 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 1218 | |
| 1219 | dateArgumentString : DATE_ARG |
| 1220 | | STRING (PLUS STRING)*; |
Vidyashree Rama | e68bb19 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 1221 | |
| 1222 | version : string; |
| 1223 | |
| 1224 | range : string; |
| 1225 | |
| 1226 | length : string; |
| 1227 | |
| 1228 | path : string; |
| 1229 | |
| 1230 | position : string; |
| 1231 | |
| 1232 | status : string; |
| 1233 | |
| 1234 | config : string; |
| 1235 | |
| 1236 | mandatory : string; |
| 1237 | |
| 1238 | orderedBy : string; |
| 1239 | |
| 1240 | minValue : string; |
| 1241 | |
| 1242 | maxValue : string; |
| 1243 | |
| 1244 | key : string; |
| 1245 | |
| 1246 | unique : string; |
| 1247 | |
| 1248 | refine : string; |
| 1249 | |
| 1250 | augment : string; |
| 1251 | |
| 1252 | deviation : string; |
| 1253 | |
| 1254 | yangConstruct : ANYXML_KEYWORD | ARGUMENT_KEYWORD | AUGMENT_KEYWORD | BASE_KEYWORD | BELONGS_TO_KEYWORD |
| 1255 | | BIT_KEYWORD | CASE_KEYWORD | CHOICE_KEYWORD | CONFIG_KEYWORD | CONTACT_KEYWORD | CONTAINER_KEYWORD |
| 1256 | | DEFAULT_KEYWORD | DESCRIPTION_KEYWORD | ENUM_KEYWORD ERROR_APP_TAG_KEYWORD | ERROR_MESSAGE_KEYWORD |
| 1257 | | EXTENSION_KEYWORD | DEVIATION_KEYWORD | DEVIATE_KEYWORD | FEATURE_KEYWORD |
| 1258 | | FRACTION_DIGITS_KEYWORD | GROUPING_KEYWORD | IDENTITY_KEYWORD | IF_FEATURE_KEYWORD |
| 1259 | | IMPORT_KEYWORD | INCLUDE_KEYWORD | INPUT_KEYWORD | KEY_KEYWORD | LEAF_KEYWORD | LEAF_LIST_KEYWORD |
| 1260 | | LENGTH_KEYWORD | LIST_KEYWORD | MANDATORY_KEYWORD | MAX_ELEMENTS_KEYWORD | MIN_ELEMENTS_KEYWORD |
| 1261 | | MODULE_KEYWORD | MUST_KEYWORD | NAMESPACE_KEYWORD | NOTIFICATION_KEYWORD | ORDERED_BY_KEYWORD |
| 1262 | | ORGANIZATION_KEYWORD | OUTPUT_KEYWORD | PATH_KEYWORD | PATTERN_KEYWORD |POSITION_KEYWORD |
| 1263 | | PREFIX_KEYWORD | PRESENCE_KEYWORD | RANGE_KEYWORD | REFERENCE_KEYWORD | REFINE_KEYWORD |
| 1264 | | REQUIRE_INSTANCE_KEYWORD | REVISION_KEYWORD | REVISION_DATE_KEYWORD | RPC_KEYWORD |
| 1265 | | STATUS_KEYWORD | SUBMODULE_KEYWORD | TYPE_KEYWORD | TYPEDEF_KEYWORD | UNIQUE_KEYWORD |
| 1266 | | UNITS_KEYWORD | USES_KEYWORD | VALUE_KEYWORD | WHEN_KEYWORD | YANG_VERSION_KEYWORD |
| 1267 | | YIN_ELEMENT_KEYWORD | ADD_KEYWORD | CURRENT_KEYWORD | DELETE_KEYWORD | DEPRECATED_KEYWORD |
| 1268 | | FALSE_KEYWORD | MAX_KEYWORD | MIN_KEYWORD | NOT_SUPPORTED_KEYWORD | OBSOLETE_KEYWORD |
| 1269 | | REPLACE_KEYWORD | SYSTEM_KEYWORD | TRUE_KEYWORD | UNBOUNDED_KEYWORD | USER_KEYWORD; |