[YANGTOOLS-81] Parser Error with an Extension containing Optional Block of Substatements Created: 30/Jan/14  Updated: 10/Apr/22  Due: 13/Mar/14  Resolved: 09/Apr/14

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

Type: Bug
Reporter: Damian ONeill Assignee: Martin Vitez
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Mac OS
Platform: Macintosh


Attachments: Zip Archive tailf.zip    
Issue Links:
Blocks
blocks YANGTOOLS-108 Milestone : Bugfixing for Helium Resolved
External issue ID: 394
Priority: Low

 Description   

The following container definition which includes an extension with sub-statements is failing to parse.

container logrecords {
tailf:info "Shows logrecords information";
tailf:action show {

tailf:info "Shows the log records";
tailf:actionpoint logging-logrecord-show;

input {
leaf from

{ type yang:date-and-time; default 2000-01-01T00:00:00-00:00; description "Shows the log records from the given time"; }

leaf to

{ type yang:date-and-time; default 2099-01-01T00:00:00-00:00; description "Shows the log records up to the given time"; }

}
output {
leaf data

{ tailf:cli-drop-node-name; type string; description "Shows the log records according to the given input"; }

}
}
}

The problem is reported as follows:

[ERROR] yang-to-sources: Unable to parse yang files from /private/tmp/r/myartifactId/src/main/yang
org.opendaylight.yangtools.yang.parser.util.YangParseException:
Error in module 'atlas-logging' at line 241: missing '}' at 'tailf:actionpoint'
Error in module 'atlas-logging' at line 243: extraneous input 'input' expecting

{'}', 'when', 'uses', 'typedef', 'status', 'reference', 'presence', 'must', 'list', 'leaf-list', 'leaf', 'if-feature', 'grouping', 'description', 'container', 'config', 'choice', 'anyxml', IDENTIFIER}
Error in module 'atlas-logging' at line 255: extraneous input 'output' expecting {'}

', 'uses', 'typedef', 'status', 'reference', 'list', 'leaf-list', 'leaf', 'grouping', 'description', 'container', 'choice', 'anyxml', IDENTIFIER}



 Comments   
Comment by Jozef Gloncak [ 24/Feb/14 ]

please provide also details of module referenced through prefix "tailf" to see how extensions are defined.

Comment by Jozef Gloncak [ 05/Mar/14 ]

As I just found out Martin Vitez is dealing with this issue. He already prepared some fix:
https://git.opendaylight.org/gerrit/#/c/5097/

Comment by Damian ONeill [ 05/Mar/14 ]

Sorry for the delay guys.

Comment by Damian ONeill [ 05/Mar/14 ]

Attachment tailf.zip has been added with description: tail yang

Comment by Martin Vitez [ 12/Mar/14 ]

Proposed patch

https://git.opendaylight.org/gerrit/#/c/5097/

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