[YANGTOOLS-267] Yangtools parser fails when an extension is used in module header Created: 15/Aug/14  Updated: 10/Apr/22  Resolved: 09/Feb/15

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Maros Marsalek Assignee: Peter Kajsa
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 1559

 Description   

Using any extension(unknown node) somewhere among module-header statements or linkage statements makes the parser fail.



 Comments   
Comment by Lukas Sedlak [ 18/Aug/14 ]

Fixed in https://git.opendaylight.org/gerrit/#/c/10019/

Comment by Peter Kajsa [ 19/Nov/14 ]

This issue occurs also in submodule_stmt, but it was not fixed.

RFC6020 ABNF YANG grammar says:

submodule-stmt = optsep submodule-keyword sep identifier-arg-str
optsep
"

{" stmtsep submodule-header-stmts linkage-stmts meta-stmts revision-stmts body-stmts "}

" optsep

stmtsep = *(WSP / line-break / unknown-statement)

Our YANG.g4 grammar says:

submodule_stmt : SUBMODULE_KEYWORD string LEFT_BRACE submodule_header_stmts linkage_stmts meta_stmts revision_stmts body_stmts RIGHT_BRACE;

So, stmtsep? should be added also into submodule_stmt like in other statments,
please see:
https://git.opendaylight.org/gerrit/#/c/10019/1/yang/yang-parser-impl/src/main/antlr/YangParser.g4

Comment by Peter Kajsa [ 01/Dec/14 ]

Patch set https://git.opendaylight.org/gerrit/#/c/13249/1

Generated at Wed Feb 07 20:52:44 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.