Retain grouping/uses instantiation vectors
[mdsal.git] / binding / mdsal-binding-generator / src / test / resources / mdsal669.yang
1 module mdsal669 {
2   namespace mdsal669;
3   prefix mdsal669;
4
5   grouping bar {
6     container bar {
7       leaf-list bar {
8         type leafref {
9           path ../../foo;
10         }
11       }
12     }
13   }
14
15   container foo {
16     leaf foo {
17       type instance-identifier;
18     }
19
20     uses bar;
21   }
22
23   grouping baz {
24     leaf baz {
25       type leafref {
26         path "../bar";
27       }
28     }
29   }
30
31   container one {
32     leaf bar {
33       type string;
34     }
35     uses baz;
36   }
37
38   container two {
39     leaf bar {
40       type uint16;
41     }
42     uses baz;
43   }
44
45   grouping unused {
46     leaf foo {
47       type leafref {
48         path "../bar";
49       }
50     }
51   }
52
53   // this grouping is used ...
54   grouping foo-as-string {
55     leaf foo {
56       type string;
57     }
58
59     uses bar;
60   }
61
62   // ... but this grouping is not ...
63   grouping unused-bar {
64     container qux {
65       // ... and hence this is not count as an instantiation
66       uses foo-as-string;
67     }
68   }
69
70   // Direct use via augment
71   container target;
72
73   augment /target {
74     leaf foo {
75       type uint32;
76     }
77
78     uses bar;
79   }
80
81   // Multiple use cases for uses/augment: this is the base grouping
82   grouping to-be-augmented {
83     container to-be-augmented;
84   }
85
86   // This grouping is not used
87   grouping unused-augmented {
88     uses to-be-augmented {
89       augment to-be-augmented {
90         leaf foo {
91           type boolean;
92         }
93
94         uses bar;
95       }
96     }
97   }
98
99   // This grouping is used only ...
100   grouping unused-intermediate-augmented {
101     uses to-be-augmented {
102       augment to-be-augmented {
103         leaf foo {
104           type uint64;
105         }
106
107         uses bar;
108       }
109     }
110   }
111
112   // ... by this grouping, which itself is not used
113   grouping unused-intermediate-augmented-user {
114     uses unused-intermediate-augmented;
115   }
116
117   // This grouping is used directly ...
118   grouping used-augmented {
119     uses to-be-augmented {
120       augment to-be-augmented {
121         leaf foo {
122           type uint8;
123         }
124
125         uses bar;
126       }
127     }
128   }
129
130   // ... by this container
131   container used-augmented-user {
132     uses used-augmented;
133   }
134
135   // ... this grouping is used ...
136   grouping used-augmented-indirect {
137     uses to-be-augmented {
138       augment to-be-augmented {
139         leaf foo {
140           type empty;
141         }
142
143         uses bar;
144       }
145     }
146   }
147
148   // ... by another grouping, which itself is used ...
149   grouping used-augmented-indirect-grp {
150     uses used-augmented-indirect;
151   }
152
153   // ... by this container
154   container used-augmented-indirect-user {
155     uses used-augmented-indirect-grp;
156   }
157 }