[YANGTOOLS-655] Error parsing enums with unknown substatements inside its values Created: 29/Aug/16  Updated: 10/Apr/22  Resolved: 05/Mar/17

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

Type: Bug
Reporter: Patrick Thiago Bard Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Text File yang-tools-debugging-unknown-statements.txt    
External issue ID: 6561

 Description   

Please consider the following YANG excerpt:

grouping gigabit-eth-mdix {
leaf mdix {

tailf:info "Configure MDIX mode";
mandatory true;
tailf:cli-suppress-no;

type enumeration {
enum normal

{ tailf:info "Set interface MDIX to Normal mode"; }

enum xover

{ tailf:info "Set interface MDIX to X-Over mode"; }

enum auto

{ tailf:info "Set interface MDIX to Automatic Detection mode"; }

}
}
}

When debugging what was being parsed, I encountered this problem:

All "tailf" statements (which are considered Unknown Statements) were at at the Leaf level. Although each enum value have a property for unknown statements aswell, they are all empty as you can see in the attached file.

I would expect that for this example, only

tailf:info "Configure MDIX mode";
tailf:cli-suppress-no;

should be considered unknown statements of "leaf mdix". The rest, should be inside the collection of unkown statements of its repective enum value IMO.



 Comments   
Comment by Patrick Thiago Bard [ 29/Aug/16 ]

Attachment yang-tools-debugging-unknown-statements.txt has been added with description: debugging unknown statements

Comment by Igor Foltin [ 31/Aug/16 ]

Hello Patrick,

I did some testing and this issue only appears in the old yang parser, which was removed in boron.
Try using the new yang parser (that was introduced in beryllium release).
Here is a documentation which explains how to use the new parser (see section "Working with YANG Model"):

https://github.com/opendaylight/yangtools/blob/master/docs/src/main/asciidoc/developer/introduction.adoc

Comment by Patrick Thiago Bard [ 06/Sep/16 ]

Strange, because in our project we are using the following maven dependency

<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-parser-impl</artifactId>
<version>0.8.3-Beryllium-SR3</version>
</dependency>

Comment by Igor Foltin [ 06/Sep/16 ]

Well, the old yang parser is still there in the beryllium release, it was removed later in the boron release. So could you please try using the new one according to the instructions I posted here earlier.

Comment by Robert Varga [ 05/Mar/17 ]

Old vs. new parser is a matter of instantiation, CrossSourceStatementReactor is the entrypoint to the new one.

Since this affects desupported codebase with a replacement, closing as WONTFIX.

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