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 | |
Vidyashree Rama | bcd7fba | 2016-03-09 20:41:44 +0530 | [diff] [blame] | 43 | moduleStatement : MODULE_KEYWORD identifier LEFT_CURLY_BRACE moduleBody RIGHT_CURLY_BRACE; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 44 | |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 45 | moduleBody : moduleHeaderStatement linkageStatements metaStatements revisionStatements bodyStatements; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 46 | |
| 47 | /** |
| 48 | * module-header-stmts = ;; these stmts can appear in any order |
| 49 | * [yang-version-stmt stmtsep] |
| 50 | * namespace-stmt stmtsep |
| 51 | * prefix-stmt stmtsep |
| 52 | */ |
| 53 | |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 54 | moduleHeaderStatement : yangVersionStatement? namespaceStatement prefixStatement |
| 55 | | yangVersionStatement? prefixStatement namespaceStatement |
| 56 | | namespaceStatement yangVersionStatement? prefixStatement |
| 57 | | namespaceStatement prefixStatement yangVersionStatement? |
| 58 | | prefixStatement namespaceStatement yangVersionStatement? |
| 59 | | prefixStatement yangVersionStatement? namespaceStatement |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 60 | ; |
| 61 | |
| 62 | /** |
| 63 | * linkage-stmts = ;; these stmts can appear in any order |
| 64 | * *(import-stmt stmtsep) |
| 65 | * *(include-stmt stmtsep) |
| 66 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 67 | linkageStatements : (importStatement |
| 68 | | includeStatement)*; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 69 | |
| 70 | /** |
| 71 | * meta-stmts = ;; these stmts can appear in any order |
| 72 | * [organization-stmt stmtsep] |
| 73 | * [contact-stmt stmtsep] |
| 74 | * [description-stmt stmtsep] |
| 75 | * [reference-stmt stmtsep] |
| 76 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 77 | metaStatements : organizationStatement? contactStatement? descriptionStatement? referenceStatement? |
| 78 | | organizationStatement? contactStatement? referenceStatement? descriptionStatement? |
| 79 | | organizationStatement? descriptionStatement? contactStatement? referenceStatement? |
| 80 | | organizationStatement? descriptionStatement? referenceStatement? contactStatement? |
| 81 | | organizationStatement? referenceStatement? contactStatement? descriptionStatement? |
| 82 | | organizationStatement? referenceStatement? descriptionStatement? contactStatement? |
| 83 | | contactStatement? organizationStatement? descriptionStatement? referenceStatement? |
| 84 | | contactStatement? organizationStatement? referenceStatement? descriptionStatement? |
| 85 | | contactStatement? referenceStatement? organizationStatement? descriptionStatement? |
| 86 | | contactStatement? referenceStatement? descriptionStatement? organizationStatement? |
| 87 | | contactStatement? descriptionStatement? referenceStatement? organizationStatement? |
| 88 | | contactStatement? descriptionStatement? organizationStatement? referenceStatement? |
| 89 | | referenceStatement? contactStatement? organizationStatement? descriptionStatement? |
| 90 | | referenceStatement? contactStatement? descriptionStatement? organizationStatement? |
| 91 | | referenceStatement? organizationStatement? contactStatement? descriptionStatement? |
| 92 | | referenceStatement? organizationStatement? descriptionStatement? contactStatement? |
| 93 | | referenceStatement? descriptionStatement? organizationStatement? contactStatement? |
| 94 | | referenceStatement? descriptionStatement? contactStatement? organizationStatement? |
| 95 | | descriptionStatement? referenceStatement? contactStatement? organizationStatement? |
| 96 | | descriptionStatement? referenceStatement? organizationStatement? contactStatement? |
| 97 | | descriptionStatement? contactStatement? referenceStatement? organizationStatement? |
| 98 | | descriptionStatement? contactStatement? organizationStatement? referenceStatement? |
| 99 | | descriptionStatement? organizationStatement? contactStatement? referenceStatement? |
| 100 | | descriptionStatement? organizationStatement? referenceStatement? contactStatement? |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 101 | ; |
| 102 | |
| 103 | // revision-stmts = *(revision-stmt stmtsep) |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 104 | revisionStatements : revisionStatement*; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 105 | |
| 106 | /** |
| 107 | * body-stmts = *((extension-stmt / |
| 108 | * feature-stmt / |
| 109 | * identity-stmt / |
| 110 | * typedef-stmt / |
| 111 | * grouping-stmt / |
| 112 | * data-def-stmt / |
| 113 | * augment-stmt / |
| 114 | * rpc-stmt / |
| 115 | * notification-stmt / |
| 116 | * deviation-stmt) stmtsep) |
| 117 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 118 | bodyStatements : (extensionStatement |
| 119 | | featureStatement |
| 120 | | identityStatement |
| 121 | | typedefStatement |
| 122 | | groupingStatement |
| 123 | | dataDefStatement |
| 124 | | augmentStatement |
| 125 | | rpcStatement |
| 126 | | notificationStatement |
| 127 | | deviationStatement)* |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 128 | ; |
| 129 | |
| 130 | /** |
| 131 | * yang-version-stmt = yang-version-keyword sep yang-version-arg-str |
| 132 | * optsep stmtend |
| 133 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 134 | yangVersionStatement : YANG_VERSION_KEYWORD version STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 135 | |
| 136 | |
| 137 | /** |
| 138 | * namespace-stmt = namespace-keyword sep uri-str optsep stmtend |
| 139 | * For namespace validation TODO in Listener |
| 140 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 141 | namespaceStatement : NAMESPACE_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 142 | |
| 143 | /** |
| 144 | * prefix-stmt = prefix-keyword sep prefix-arg-str |
| 145 | * optsep stmtend |
| 146 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 147 | prefixStatement : PREFIX_KEYWORD identifier STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 148 | |
| 149 | /** |
| 150 | * import-stmt = import-keyword sep identifier-arg-str optsep |
| 151 | * "{" stmtsep |
| 152 | * prefix-stmt stmtsep |
| 153 | * [revision-date-stmt stmtsep] |
| 154 | * "}" |
| 155 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 156 | importStatement : IMPORT_KEYWORD identifier LEFT_CURLY_BRACE importStatementBody RIGHT_CURLY_BRACE; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 157 | |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 158 | importStatementBody : prefixStatement revisionDateStatement?; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 159 | |
| 160 | // revision-date-stmt = revision-date-keyword sep revision-date stmtend |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 161 | revisionDateStatement : REVISION_DATE_KEYWORD dateArgumentString STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 162 | |
| 163 | /** |
| 164 | * include-stmt = include-keyword sep identifier-arg-str optsep |
| 165 | * (";" / |
| 166 | * "{" stmtsep |
| 167 | * [revision-date-stmt stmtsep] |
| 168 | * "}") |
| 169 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 170 | includeStatement : INCLUDE_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE revisionDateStatement? RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 171 | |
| 172 | /** |
| 173 | * organization-stmt = organization-keyword sep string |
| 174 | * optsep stmtend |
| 175 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 176 | organizationStatement : ORGANIZATION_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 177 | |
| 178 | // contact-stmt = contact-keyword sep string optsep stmtend |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 179 | contactStatement : CONTACT_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 180 | |
| 181 | // description-stmt = description-keyword sep string optsep stmtend |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 182 | descriptionStatement : DESCRIPTION_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 183 | |
| 184 | // reference-stmt = reference-keyword sep string optsep stmtend |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 185 | referenceStatement : REFERENCE_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 186 | |
| 187 | /** |
| 188 | * revision-stmt = revision-keyword sep revision-date optsep |
| 189 | * (";" / |
| 190 | * "{" stmtsep |
| 191 | * [description-stmt stmtsep] |
| 192 | * [reference-stmt stmtsep] |
| 193 | * "}") |
| 194 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 195 | revisionStatement : REVISION_KEYWORD dateArgumentString (STMTEND | LEFT_CURLY_BRACE revisionStatementBody RIGHT_CURLY_BRACE); |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 196 | revisionStatementBody : descriptionStatement? referenceStatement?; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 197 | |
| 198 | /** |
| 199 | * submodule-stmt = optsep submodule-keyword sep identifier-arg-str |
| 200 | * optsep |
| 201 | * "{" stmtsep |
| 202 | * submodule-header-stmts |
| 203 | * linkage-stmts |
| 204 | * meta-stmts |
| 205 | * revision-stmts |
| 206 | * body-stmts |
| 207 | * "}" optsep |
| 208 | */ |
Vidyashree Rama | bcd7fba | 2016-03-09 20:41:44 +0530 | [diff] [blame] | 209 | subModuleStatement : SUBMODULE_KEYWORD identifier LEFT_CURLY_BRACE submoduleBody RIGHT_CURLY_BRACE; |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 210 | submoduleBody : submoduleHeaderStatement linkageStatements metaStatements revisionStatements bodyStatements; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 211 | |
| 212 | /** submodule-header-stmts = |
| 213 | * ;; these stmts can appear in any order |
| 214 | * [yang-version-stmt stmtsep] |
| 215 | * belongs-to-stmt stmtsep |
| 216 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 217 | submoduleHeaderStatement : yangVersionStatement? belongstoStatement |
| 218 | | belongstoStatement yangVersionStatement? |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 219 | ; |
| 220 | |
| 221 | /** |
| 222 | * belongs-to-stmt = belongs-to-keyword sep identifier-arg-str |
| 223 | * optsep |
| 224 | * "{" stmtsep |
| 225 | * prefix-stmt stmtsep |
| 226 | * "}" |
| 227 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 228 | belongstoStatement : BELONGS_TO_KEYWORD identifier LEFT_CURLY_BRACE belongstoStatementBody RIGHT_CURLY_BRACE; |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 229 | belongstoStatementBody : prefixStatement; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 230 | |
| 231 | /** |
| 232 | * extension-stmt = extension-keyword sep identifier-arg-str optsep |
| 233 | * (";" / |
| 234 | * "{" stmtsep |
| 235 | * ;; these stmts can appear in any order |
| 236 | * [argument-stmt stmtsep] |
| 237 | * [status-stmt stmtsep] |
| 238 | * [description-stmt stmtsep] |
| 239 | * [reference-stmt stmtsep] |
| 240 | * "}") |
| 241 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 242 | extensionStatement : EXTENSION_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE extensionBody RIGHT_CURLY_BRACE); |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 243 | extensionBody : argumentStatement? statusStatement? descriptionStatement? referenceStatement? |
| 244 | | argumentStatement? statusStatement? referenceStatement? descriptionStatement? |
| 245 | | argumentStatement? descriptionStatement? statusStatement? referenceStatement? |
| 246 | | argumentStatement? descriptionStatement? referenceStatement? statusStatement? |
| 247 | | argumentStatement? referenceStatement? descriptionStatement? statusStatement? |
| 248 | | argumentStatement? referenceStatement? statusStatement? descriptionStatement? |
| 249 | | statusStatement? referenceStatement? argumentStatement? descriptionStatement? |
| 250 | | statusStatement? referenceStatement? descriptionStatement? argumentStatement? |
| 251 | | statusStatement? descriptionStatement? referenceStatement? argumentStatement? |
| 252 | | statusStatement? descriptionStatement? argumentStatement? referenceStatement? |
| 253 | | statusStatement? argumentStatement? referenceStatement? descriptionStatement? |
| 254 | | statusStatement? argumentStatement? descriptionStatement? referenceStatement? |
| 255 | | descriptionStatement? argumentStatement? statusStatement? referenceStatement? |
| 256 | | descriptionStatement? argumentStatement? referenceStatement? statusStatement? |
| 257 | | descriptionStatement? statusStatement? argumentStatement? referenceStatement? |
| 258 | | descriptionStatement? statusStatement? referenceStatement? argumentStatement? |
| 259 | | descriptionStatement? referenceStatement? statusStatement? argumentStatement? |
| 260 | | descriptionStatement? referenceStatement? argumentStatement? statusStatement? |
| 261 | | referenceStatement? descriptionStatement? argumentStatement? statusStatement? |
| 262 | | referenceStatement? descriptionStatement? statusStatement? argumentStatement? |
| 263 | | referenceStatement? statusStatement? argumentStatement? descriptionStatement? |
| 264 | | referenceStatement? statusStatement? descriptionStatement? argumentStatement? |
| 265 | | referenceStatement? argumentStatement? descriptionStatement? statusStatement? |
| 266 | | referenceStatement? argumentStatement? statusStatement? descriptionStatement? |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 267 | ; |
| 268 | |
| 269 | /** |
| 270 | * argument-stmt = argument-keyword sep identifier-arg-str optsep |
| 271 | * (";" / |
| 272 | * "{" stmtsep |
| 273 | * [yin-element-stmt stmtsep] |
| 274 | * "}") |
| 275 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 276 | argumentStatement : ARGUMENT_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE argumentBody RIGHT_CURLY_BRACE); |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 277 | argumentBody : yinElementStatement?; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 278 | |
| 279 | /** |
| 280 | * yin-element-stmt = yin-element-keyword sep yin-element-arg-str |
| 281 | * stmtend |
| 282 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 283 | yinElementStatement : YIN_ELEMENT_KEYWORD (TRUE_KEYWORD | FALSE_KEYWORD) STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 284 | |
| 285 | /** |
| 286 | * identity-stmt = identity-keyword sep identifier-arg-str optsep |
| 287 | * (";" / |
| 288 | * "{" stmtsep |
| 289 | * ;; these stmts can appear in any order |
| 290 | * [base-stmt stmtsep] |
| 291 | * [status-stmt stmtsep] |
| 292 | * [description-stmt stmtsep] |
| 293 | * [reference-stmt stmtsep] |
| 294 | * "}") |
| 295 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 296 | identityStatement : IDENTITY_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE identityBody RIGHT_CURLY_BRACE); |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 297 | identityBody : baseStatement? statusStatement? descriptionStatement? referenceStatement? |
| 298 | | baseStatement? statusStatement? referenceStatement? descriptionStatement? |
| 299 | | baseStatement? descriptionStatement? statusStatement? referenceStatement? |
| 300 | | baseStatement? descriptionStatement? referenceStatement? statusStatement? |
| 301 | | baseStatement? referenceStatement? descriptionStatement? statusStatement? |
| 302 | | baseStatement? referenceStatement? statusStatement? descriptionStatement? |
| 303 | | referenceStatement? baseStatement? statusStatement? descriptionStatement? |
| 304 | | referenceStatement? baseStatement? descriptionStatement? statusStatement? |
| 305 | | referenceStatement? statusStatement? baseStatement? descriptionStatement? |
| 306 | | referenceStatement? statusStatement? descriptionStatement? baseStatement? |
| 307 | | referenceStatement? descriptionStatement? statusStatement? baseStatement? |
| 308 | | referenceStatement? descriptionStatement? baseStatement? statusStatement? |
| 309 | | descriptionStatement? referenceStatement? statusStatement? baseStatement? |
| 310 | | descriptionStatement? referenceStatement? statusStatement? baseStatement? |
| 311 | | descriptionStatement? referenceStatement? baseStatement? statusStatement? |
| 312 | | descriptionStatement? statusStatement? baseStatement? referenceStatement? |
| 313 | | descriptionStatement? statusStatement? referenceStatement? baseStatement? |
| 314 | | descriptionStatement? baseStatement? referenceStatement? statusStatement? |
| 315 | | descriptionStatement? baseStatement? statusStatement? referenceStatement? |
| 316 | | statusStatement? baseStatement? descriptionStatement? referenceStatement? |
| 317 | | statusStatement? baseStatement? referenceStatement? descriptionStatement? |
| 318 | | statusStatement? descriptionStatement? baseStatement? referenceStatement? |
| 319 | | statusStatement? descriptionStatement? referenceStatement? baseStatement? |
| 320 | | statusStatement? referenceStatement? descriptionStatement? baseStatement? |
| 321 | | statusStatement? referenceStatement? baseStatement? descriptionStatement? |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 322 | ; |
| 323 | |
| 324 | /** |
| 325 | * base-stmt = base-keyword sep identifier-ref-arg-str |
| 326 | * optsep stmtend* |
| 327 | * identifier-ref-arg = [prefix ":"] identifier |
| 328 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 329 | baseStatement : BASE_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 330 | |
| 331 | /** |
| 332 | * feature-stmt = feature-keyword sep identifier-arg-str optsep |
| 333 | * (";" / |
| 334 | * "{" stmtsep |
| 335 | * ;; these stmts can appear in any order |
| 336 | * *(if-feature-stmt stmtsep) |
| 337 | * [status-stmt stmtsep] |
| 338 | * [description-stmt stmtsep] |
| 339 | * [reference-stmt stmtsep] |
| 340 | * "}") |
| 341 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 342 | featureStatement : FEATURE_KEYWORD string (STMTEND | LEFT_CURLY_BRACE featureBody RIGHT_CURLY_BRACE); |
| 343 | featureBody : ifFeatureStatement* statusStatement? descriptionStatement? referenceStatement? |
| 344 | | ifFeatureStatement* statusStatement? referenceStatement? descriptionStatement? |
| 345 | | ifFeatureStatement* descriptionStatement? statusStatement? referenceStatement? |
| 346 | | ifFeatureStatement* descriptionStatement? referenceStatement? statusStatement? |
| 347 | | ifFeatureStatement* referenceStatement? statusStatement? descriptionStatement? |
| 348 | | ifFeatureStatement* referenceStatement? descriptionStatement? statusStatement? |
| 349 | | statusStatement? ifFeatureStatement* descriptionStatement? referenceStatement? |
| 350 | | statusStatement? ifFeatureStatement* referenceStatement? descriptionStatement? |
| 351 | | statusStatement? descriptionStatement? ifFeatureStatement* referenceStatement? |
| 352 | | statusStatement? descriptionStatement? referenceStatement? ifFeatureStatement* |
| 353 | | statusStatement? referenceStatement? ifFeatureStatement* descriptionStatement? |
| 354 | | statusStatement? referenceStatement? descriptionStatement? ifFeatureStatement* |
| 355 | | descriptionStatement? ifFeatureStatement* statusStatement? referenceStatement? |
| 356 | | descriptionStatement? ifFeatureStatement* referenceStatement? statusStatement? |
| 357 | | descriptionStatement? statusStatement? ifFeatureStatement* referenceStatement? |
| 358 | | descriptionStatement? statusStatement? referenceStatement? ifFeatureStatement* |
| 359 | | descriptionStatement? referenceStatement* statusStatement? ifFeatureStatement* |
| 360 | | descriptionStatement? referenceStatement* ifFeatureStatement? statusStatement? |
| 361 | | referenceStatement? ifFeatureStatement* statusStatement? descriptionStatement? |
| 362 | | referenceStatement? ifFeatureStatement* descriptionStatement? statusStatement? |
| 363 | | referenceStatement? descriptionStatement? statusStatement? ifFeatureStatement* |
| 364 | | referenceStatement? descriptionStatement? ifFeatureStatement* statusStatement? |
| 365 | | referenceStatement? statusStatement? descriptionStatement? ifFeatureStatement* |
| 366 | | referenceStatement? statusStatement? ifFeatureStatement* descriptionStatement? |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 367 | ; |
| 368 | |
| 369 | /** |
| 370 | * data-def-stmt = container-stmt / |
| 371 | * leaf-stmt / |
| 372 | * leaf-list-stmt / |
| 373 | * list-stmt / |
| 374 | * choice-stmt / |
| 375 | * anyxml-stmt / |
| 376 | * uses-stmt |
| 377 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 378 | dataDefStatement : containerStatement |
| 379 | | leafStatement |
| 380 | | leafListStatement |
| 381 | | listStatement |
| 382 | | choiceStatement |
| 383 | | usesStatement; |
Vidyashree Rama | da62150 | 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 | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 389 | ifFeatureStatement : IF_FEATURE_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 390 | |
| 391 | /** |
| 392 | * units-stmt = units-keyword sep string optsep stmtend |
| 393 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 394 | unitsStatement : UNITS_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 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 | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 409 | typedefStatement : TYPEDEF_KEYWORD identifier LEFT_CURLY_BRACE |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 410 | (typeStatement | unitsStatement | defaultStatement | statusStatement | descriptionStatement | referenceStatement)* |
Vidyashree Rama | da62150 | 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 | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 420 | typeStatement : TYPE_KEYWORD string (STMTEND | LEFT_CURLY_BRACE typeBodyStatements RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 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 | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 434 | typeBodyStatements : numericalRestrictions | stringRestrictions | enumSpecification |
| 435 | | leafrefSpecification | identityrefSpecification | instanceIdentifierSpecification |
| 436 | | bitsSpecification | unionSpecification; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 437 | |
| 438 | /** |
| 439 | * numerical-restrictions = range-stmt stmtsep |
| 440 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 441 | numericalRestrictions : rangeStatement; |
Vidyashree Rama | da62150 | 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 | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 454 | rangeStatement : RANGE_KEYWORD range (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 455 | |
Gaurav Agrawal | 4f8ad17 | 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 | da62150 | 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 | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 487 | stringRestrictions : ((lengthStatement)? (patternStatement)*) | ((patternStatement)* (lengthStatement)?); |
Vidyashree Rama | da62150 | 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 | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 500 | lengthStatement : LENGTH_KEYWORD length |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 501 | (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 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 | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 514 | patternStatement : PATTERN_KEYWORD string (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 515 | |
| 516 | /** |
| 517 | * default-stmt = default-keyword sep string stmtend |
| 518 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 519 | defaultStatement : DEFAULT_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 520 | |
| 521 | /** |
| 522 | * enum-specification = 1*(enum-stmt stmtsep) |
| 523 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 524 | enumSpecification : enumStatement+; |
Vidyashree Rama | da62150 | 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 | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 537 | enumStatement : ENUM_KEYWORD string (STMTEND | LEFT_CURLY_BRACE enumStatementBody RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 538 | |
Gaurav Agrawal | 4f8ad17 | 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 | da62150 | 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 | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 571 | leafrefSpecification : (pathStatement (requireInstanceStatement)?) | ((requireInstanceStatement)? pathStatement); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 572 | |
| 573 | /** |
| 574 | * path-stmt = path-keyword sep path-arg-str stmtend |
| 575 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 576 | pathStatement : PATH_KEYWORD path STMTEND; |
Vidyashree Rama | da62150 | 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 | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 585 | requireInstanceStatement : REQUIRE_INSTANCE_KEYWORD (TRUE_KEYWORD | FALSE_KEYWORD) STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 586 | |
| 587 | /** |
| 588 | * instance-identifier-specification = |
| 589 | * [require-instance-stmt stmtsep] |
| 590 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 591 | instanceIdentifierSpecification : requireInstanceStatement?; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 592 | |
| 593 | /** |
| 594 | * identityref-specification = |
| 595 | * base-stmt stmtsep |
| 596 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 597 | identityrefSpecification : baseStatement; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 598 | |
| 599 | /** |
| 600 | * union-specification = 1*(type-stmt stmtsep) |
| 601 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 602 | unionSpecification : typeStatement+; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 603 | |
| 604 | /** |
| 605 | * bits-specification = 1*(bit-stmt stmtsep) |
| 606 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 607 | bitsSpecification : bitStatement+; |
Vidyashree Rama | da62150 | 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 | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 621 | bitStatement : BIT_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE bitBodyStatement RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 622 | |
Gaurav Agrawal | 4f8ad17 | 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 | da62150 | 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 | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 656 | positionStatement : POSITION_KEYWORD position STMTEND; |
Vidyashree Rama | da62150 | 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 | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 666 | statusStatement : STATUS_KEYWORD status STMTEND; |
Vidyashree Rama | da62150 | 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 | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 675 | configStatement : CONFIG_KEYWORD config STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 676 | |
| 677 | /** |
| 678 | * mandatory-stmt = mandatory-keyword sep |
| 679 | * mandatory-arg-str stmtend |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 680 | * |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 681 | * mandatory-arg-str = < a string that matches the rule |
| 682 | * mandatory-arg > |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 683 | * |
| 684 | * mandatory-arg = true-keyword / false-keyword |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 685 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 686 | mandatoryStatement : MANDATORY_KEYWORD mandatory STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 687 | |
| 688 | /** |
| 689 | * presence-stmt = presence-keyword sep string stmtend |
| 690 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 691 | presenceStatement : PRESENCE_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 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 | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 696 | * |
Vidyashree Rama | da62150 | 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 | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 699 | * |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 700 | * ordered-by-arg = user-keyword / system-keyword |
| 701 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 702 | orderedByStatement : ORDERED_BY_KEYWORD orderedBy STMTEND; |
Vidyashree Rama | da62150 | 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 | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 715 | mustStatement : MUST_KEYWORD string (STMTEND | LEFT_CURLY_BRACE commonStatements RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 716 | |
| 717 | /** |
| 718 | * error-message-stmt = error-message-keyword sep string stmtend |
| 719 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 720 | errorMessageStatement : ERROR_MESSAGE_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 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 | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 725 | errorAppTagStatement : ERROR_APP_TAG_KEYWORD string STMTEND; |
Vidyashree Rama | da62150 | 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 | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 734 | minElementsStatement : MIN_ELEMENTS_KEYWORD minValue STMTEND; |
Vidyashree Rama | da62150 | 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 | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 741 | * max-value-arg = unbounded-keyword / |
| 742 | * positive-integer-value |
| 743 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 744 | maxElementsStatement : MAX_ELEMENTS_KEYWORD maxValue STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 745 | |
| 746 | /** |
| 747 | * value-stmt = value-keyword sep integer-value stmtend |
| 748 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 749 | valueStatement : VALUE_KEYWORD ((MINUS INTEGER) | INTEGER) STMTEND; |
Vidyashree Rama | da62150 | 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 | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 765 | groupingStatement : GROUPING_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 766 | (statusStatement | descriptionStatement | referenceStatement | typedefStatement | groupingStatement |
| 767 | | dataDefStatement)* RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 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 | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 788 | containerStatement : CONTAINER_KEYWORD identifier |
Gaurav Agrawal | 4f8ad17 | 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 | da62150 | 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 | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 811 | leafStatement : LEAF_KEYWORD identifier LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | typeStatement | unitsStatement |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 812 | | mustStatement | defaultStatement | configStatement | mandatoryStatement | statusStatement | descriptionStatement |
| 813 | | referenceStatement)* RIGHT_CURLY_BRACE; |
Vidyashree Rama | da62150 | 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 | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 834 | leafListStatement : LEAF_LIST_KEYWORD identifier LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | typeStatement |
Gaurav Agrawal | 4f8ad17 | 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 | da62150 | 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 | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 860 | listStatement : LIST_KEYWORD identifier LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | mustStatement | keyStatement |
Gaurav Agrawal | 4f8ad17 | 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 | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 863 | |
| 864 | /** |
| 865 | * key-stmt = key-keyword sep key-arg-str stmtend |
| 866 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 867 | keyStatement : KEY_KEYWORD key STMTEND; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 868 | |
| 869 | /** |
| 870 | * unique-stmt = unique-keyword sep unique-arg-str stmtend |
| 871 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 872 | uniqueStatement: UNIQUE_KEYWORD unique STMTEND; |
Vidyashree Rama | da62150 | 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 | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 891 | choiceStatement : CHOICE_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | defaultStatement |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 892 | | configStatement | mandatoryStatement | statusStatement | descriptionStatement | referenceStatement | shortCaseStatement |
| 893 | | caseStatement)* RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 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 | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 902 | shortCaseStatement : containerStatement | leafStatement | leafListStatement | listStatement; |
Vidyashree Rama | da62150 | 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 | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 918 | caseStatement : CASE_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | statusStatement |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 919 | | descriptionStatement | referenceStatement | dataDefStatement)* RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 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 | 4f8ad17 | 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 | da62150 | 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 | 8a6b128 | 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 | da62150 | 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 | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 966 | refineContainerStatements : (mustStatement | presenceStatement | configStatement | descriptionStatement | referenceStatement)* ; |
Vidyashree Rama | da62150 | 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 | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 978 | refineLeafStatements : (mustStatement | defaultStatement | configStatement | mandatoryStatement | descriptionStatement | referenceStatement)*; |
Vidyashree Rama | da62150 | 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 | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 991 | refineLeafListStatements : (mustStatement | configStatement | minElementsStatement | maxElementsStatement | descriptionStatement |
| 992 | | referenceStatement)*; |
Vidyashree Rama | da62150 | 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 | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1004 | refineListStatements : (mustStatement | configStatement | minElementsStatement | maxElementsStatement | descriptionStatement |
| 1005 | | referenceStatement)*; |
Vidyashree Rama | da62150 | 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 | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1016 | refineChoiceStatements : (defaultStatement | configStatement | mandatoryStatement | descriptionStatement | referenceStatement)*; |
Vidyashree Rama | da62150 | 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 | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1024 | refineCaseStatements : (descriptionStatement | referenceStatement)? | (referenceStatement | descriptionStatement)?; |
Vidyashree Rama | da62150 | 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 | 8a6b128 | 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 | da62150 | 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 | 25bf4d0 | 2016-03-29 14:37:02 +0530 | [diff] [blame] | 1058 | augmentStatement : AUGMENT_KEYWORD augment LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | statusStatement |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1059 | | descriptionStatement | referenceStatement | dataDefStatement | caseStatement)* RIGHT_CURLY_BRACE; |
Vidyashree Rama | da62150 | 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 | 4f8ad17 | 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 | da62150 | 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 | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1088 | */ |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 1089 | rpcStatement : RPC_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (ifFeatureStatement | statusStatement | descriptionStatement |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1090 | | referenceStatement | typedefStatement | groupingStatement | inputStatement | outputStatement)* RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 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 | */ |
Vidyashree Rama | 6a72b79 | 2016-03-29 12:00:42 +0530 | [diff] [blame] | 1101 | inputStatement : INPUT_KEYWORD LEFT_CURLY_BRACE inputStatementBody RIGHT_CURLY_BRACE; |
| 1102 | |
| 1103 | inputStatementBody : typedefStatement* dataDefStatement+ |
| 1104 | | dataDefStatement+ typedefStatement* |
| 1105 | | groupingStatement* dataDefStatement+ |
| 1106 | | dataDefStatement+ groupingStatement*; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1107 | |
| 1108 | /** |
| 1109 | * output-stmt = output-keyword optsep |
| 1110 | * "{" stmtsep |
| 1111 | * ;; these stmts can appear in any order |
| 1112 | * *((typedef-stmt / |
| 1113 | * grouping-stmt) stmtsep) |
| 1114 | * 1*(data-def-stmt stmtsep) |
| 1115 | * "}" |
| 1116 | */ |
Vidyashree Rama | 6a72b79 | 2016-03-29 12:00:42 +0530 | [diff] [blame] | 1117 | outputStatement : OUTPUT_KEYWORD LEFT_CURLY_BRACE outputStatementBody RIGHT_CURLY_BRACE; |
| 1118 | |
| 1119 | outputStatementBody : typedefStatement* dataDefStatement+ |
| 1120 | | dataDefStatement+ typedefStatement* |
| 1121 | | groupingStatement* dataDefStatement+ |
| 1122 | | dataDefStatement+ groupingStatement*; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1123 | |
| 1124 | /** |
| 1125 | * notification-stmt = notification-keyword sep |
| 1126 | * identifier-arg-str optsep |
| 1127 | * (";" / |
| 1128 | * "{" stmtsep |
| 1129 | * ;; these stmts can appear in any order |
| 1130 | * *(if-feature-stmt stmtsep) |
| 1131 | * [status-stmt stmtsep] |
| 1132 | * [description-stmt stmtsep] |
| 1133 | * [reference-stmt stmtsep] |
| 1134 | * *((typedef-stmt / |
| 1135 | * grouping-stmt) stmtsep) |
| 1136 | * *(data-def-stmt stmtsep) |
| 1137 | * "}") |
| 1138 | * TODO : 0..1 occurance to be checked in listener |
| 1139 | */ |
Vidyashree Rama | 506cbe1 | 2016-03-28 11:59:27 +0530 | [diff] [blame] | 1140 | notificationStatement : NOTIFICATION_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (ifFeatureStatement |
| 1141 | | statusStatement | descriptionStatement | referenceStatement | typedefStatement |
| 1142 | | groupingStatement | dataDefStatement)* RIGHT_CURLY_BRACE); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1143 | |
| 1144 | /** |
| 1145 | * deviation-stmt = deviation-keyword sep |
| 1146 | * deviation-arg-str optsep |
| 1147 | * "{" stmtsep |
| 1148 | * ;; these stmts can appear in any order |
| 1149 | * [description-stmt stmtsep] |
| 1150 | * [reference-stmt stmtsep] |
| 1151 | * (deviate-not-supported-stmt / |
| 1152 | * 1*(deviate-add-stmt / |
| 1153 | * deviate-replace-stmt / |
| 1154 | * deviate-delete-stmt)) |
| 1155 | * "}" |
| 1156 | * TODO : 0..1 occurance to be checked in listener |
| 1157 | */ |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 1158 | deviationStatement: DEVIATION_KEYWORD deviation LEFT_CURLY_BRACE (descriptionStatement | referenceStatement |
| 1159 | | deviateNotSupportedStatement | deviateAddStatement | deviateReplaceStatement |
| 1160 | | deviateDeleteStatement)* RIGHT_CURLY_BRACE; |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1161 | |
| 1162 | /** |
| 1163 | * deviate-not-supported-stmt = |
| 1164 | * deviate-keyword sep |
| 1165 | * not-supported-keyword optsep |
| 1166 | * (";" / |
| 1167 | * "{" stmtsep |
| 1168 | * "}") |
| 1169 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1170 | 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] | 1171 | |
| 1172 | /** |
| 1173 | * deviate-add-stmt = deviate-keyword sep add-keyword optsep |
| 1174 | * (";" / |
| 1175 | * "{" stmtsep |
| 1176 | * [units-stmt stmtsep] |
| 1177 | * *(must-stmt stmtsep) |
| 1178 | * *(unique-stmt stmtsep) |
| 1179 | * [default-stmt stmtsep] |
| 1180 | * [config-stmt stmtsep] |
| 1181 | * [mandatory-stmt stmtsep] |
| 1182 | * [min-elements-stmt stmtsep] |
| 1183 | * [max-elements-stmt stmtsep] |
| 1184 | * "}") |
| 1185 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1186 | deviateAddStatement: DEVIATE_KEYWORD ADD_KEYWORD (STMTEND | (LEFT_CURLY_BRACE unitsStatement? mustStatement* uniqueStatement* |
| 1187 | defaultStatement? configStatement? mandatoryStatement? minElementsStatement? maxElementsStatement? |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1188 | RIGHT_CURLY_BRACE)); |
| 1189 | |
| 1190 | /** |
| 1191 | * deviate-delete-stmt = deviate-keyword sep delete-keyword optsep |
| 1192 | * (";" / |
| 1193 | * "{" stmtsep |
| 1194 | * [units-stmt stmtsep] |
| 1195 | * *(must-stmt stmtsep) |
| 1196 | * *(unique-stmt stmtsep) |
| 1197 | * [default-stmt stmtsep] |
| 1198 | * "}") |
| 1199 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1200 | deviateDeleteStatement: DEVIATE_KEYWORD DELETE_KEYWORD (STMTEND |
| 1201 | | (LEFT_CURLY_BRACE unitsStatement? mustStatement* uniqueStatement* defaultStatement? RIGHT_CURLY_BRACE)); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1202 | |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1203 | /** |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1204 | * deviate-replace-stmt = deviate-keyword sep replace-keyword optsep |
| 1205 | * (";" / |
| 1206 | * "{" stmtsep |
| 1207 | * [type-stmt stmtsep] |
| 1208 | * [units-stmt stmtsep] |
| 1209 | * [default-stmt stmtsep] |
| 1210 | * [config-stmt stmtsep] |
| 1211 | * [mandatory-stmt stmtsep] |
| 1212 | * [min-elements-stmt stmtsep] |
| 1213 | * [max-elements-stmt stmtsep] |
| 1214 | * "}") |
| 1215 | */ |
Gaurav Agrawal | 4f8ad17 | 2016-02-12 16:17:32 +0530 | [diff] [blame] | 1216 | deviateReplaceStatement: DEVIATE_KEYWORD REPLACE_KEYWORD (STMTEND | (LEFT_CURLY_BRACE typeStatement? unitsStatement? |
| 1217 | defaultStatement? configStatement? mandatoryStatement? minElementsStatement? |
| 1218 | maxElementsStatement? RIGHT_CURLY_BRACE)); |
Vidyashree Rama | da62150 | 2016-02-05 22:32:34 +0530 | [diff] [blame] | 1219 | |
Gaurav Agrawal | b5a1c13 | 2016-02-21 02:56:46 +0530 | [diff] [blame] | 1220 | string : STRING (PLUS STRING)* |
| 1221 | | IDENTIFIER |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 1222 | | INTEGER |
| 1223 | | yangConstruct; |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 1224 | |
| 1225 | identifier : STRING (PLUS STRING)* |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 1226 | | IDENTIFIER |
| 1227 | | yangConstruct; |
Vidyashree Rama | 468f828 | 2016-03-04 19:08:35 +0530 | [diff] [blame] | 1228 | |
| 1229 | dateArgumentString : DATE_ARG |
| 1230 | | STRING (PLUS STRING)*; |
Vidyashree Rama | 8a6b128 | 2016-03-15 10:18:25 +0530 | [diff] [blame] | 1231 | |
| 1232 | version : string; |
| 1233 | |
| 1234 | range : string; |
| 1235 | |
| 1236 | length : string; |
| 1237 | |
| 1238 | path : string; |
| 1239 | |
| 1240 | position : string; |
| 1241 | |
| 1242 | status : string; |
| 1243 | |
| 1244 | config : string; |
| 1245 | |
| 1246 | mandatory : string; |
| 1247 | |
| 1248 | orderedBy : string; |
| 1249 | |
| 1250 | minValue : string; |
| 1251 | |
| 1252 | maxValue : string; |
| 1253 | |
| 1254 | key : string; |
| 1255 | |
| 1256 | unique : string; |
| 1257 | |
| 1258 | refine : string; |
| 1259 | |
| 1260 | augment : string; |
| 1261 | |
| 1262 | deviation : string; |
| 1263 | |
| 1264 | yangConstruct : ANYXML_KEYWORD | ARGUMENT_KEYWORD | AUGMENT_KEYWORD | BASE_KEYWORD | BELONGS_TO_KEYWORD |
| 1265 | | BIT_KEYWORD | CASE_KEYWORD | CHOICE_KEYWORD | CONFIG_KEYWORD | CONTACT_KEYWORD | CONTAINER_KEYWORD |
| 1266 | | DEFAULT_KEYWORD | DESCRIPTION_KEYWORD | ENUM_KEYWORD ERROR_APP_TAG_KEYWORD | ERROR_MESSAGE_KEYWORD |
| 1267 | | EXTENSION_KEYWORD | DEVIATION_KEYWORD | DEVIATE_KEYWORD | FEATURE_KEYWORD |
| 1268 | | FRACTION_DIGITS_KEYWORD | GROUPING_KEYWORD | IDENTITY_KEYWORD | IF_FEATURE_KEYWORD |
| 1269 | | IMPORT_KEYWORD | INCLUDE_KEYWORD | INPUT_KEYWORD | KEY_KEYWORD | LEAF_KEYWORD | LEAF_LIST_KEYWORD |
| 1270 | | LENGTH_KEYWORD | LIST_KEYWORD | MANDATORY_KEYWORD | MAX_ELEMENTS_KEYWORD | MIN_ELEMENTS_KEYWORD |
| 1271 | | MODULE_KEYWORD | MUST_KEYWORD | NAMESPACE_KEYWORD | NOTIFICATION_KEYWORD | ORDERED_BY_KEYWORD |
| 1272 | | ORGANIZATION_KEYWORD | OUTPUT_KEYWORD | PATH_KEYWORD | PATTERN_KEYWORD |POSITION_KEYWORD |
| 1273 | | PREFIX_KEYWORD | PRESENCE_KEYWORD | RANGE_KEYWORD | REFERENCE_KEYWORD | REFINE_KEYWORD |
| 1274 | | REQUIRE_INSTANCE_KEYWORD | REVISION_KEYWORD | REVISION_DATE_KEYWORD | RPC_KEYWORD |
| 1275 | | STATUS_KEYWORD | SUBMODULE_KEYWORD | TYPE_KEYWORD | TYPEDEF_KEYWORD | UNIQUE_KEYWORD |
| 1276 | | UNITS_KEYWORD | USES_KEYWORD | VALUE_KEYWORD | WHEN_KEYWORD | YANG_VERSION_KEYWORD |
| 1277 | | YIN_ELEMENT_KEYWORD | ADD_KEYWORD | CURRENT_KEYWORD | DELETE_KEYWORD | DEPRECATED_KEYWORD |
| 1278 | | FALSE_KEYWORD | MAX_KEYWORD | MIN_KEYWORD | NOT_SUPPORTED_KEYWORD | OBSOLETE_KEYWORD |
| 1279 | | REPLACE_KEYWORD | SYSTEM_KEYWORD | TRUE_KEYWORD | UNBOUNDED_KEYWORD | USER_KEYWORD; |