[YANGTOOLS-1044] Rework Uses statement ordering Created: 26/Nov/19  Updated: 18/Jan/24

Status: Confirmed
Project: yangtools
Component/s: parser
Affects Version/s: None
Fix Version/s: 14.0.0, 13.0.2

Type: Improvement Priority: Medium
Reporter: Robert Varga Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to YANGTOOLS-1042 ModuleEffectiveStatement fails to ind... Resolved

 Description   

Our current implementation of uses statements relies on a rather ugly hack to ensure statements are resolved in definition order, for example in case of:

container foo {
  uses bar;
  uses baz;
}
         
grouping baz {
  leaf baz {
    type string;
  }
}
         
grouping bar {
  leaf bar {
    type string;
  }
}

As the two uses statements are resolved in reverse order, we end up:

  1. tracking effects of those statements separately
  2. re-inline these effects when 'foo' is built in EffectiveStatementBase

Instead of this complicated tracking, we should be able to express a resolution dependency of 'uses baz' on 'uses bar', such that 'uses baz' is resolved only after 'uses bar' – which will naturally ensure that effectiveStatements are properly ordered.



 Comments   
Comment by Robert Varga [ 26/Nov/19 ]

YANGTOOLS-1042 started refactoring of the ordering logic to limit scope of state mutation.

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