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