Commit 69db7ad
Add
* Add code to generate IR (not used).
`buildDirectoryDefinitions` and `findEnumSet` have now been converted to
be callable by `GenerateIR`.
Later PRs will convert ypathgen, Go, and proto generation to use the IR
instead of the Directory map.
* Fix underscore generation
* Simplify IR a bit
* Rename goGenState to GoLangMapper.
This name is exported since it will be accessed by generator.go after
the refactoring is done.
The genFakeRoot parameter is also removed since this property can be
checked through other means, as is done in
https://github.com/openconfig/ygot/tree/ygen-ir-langmapper
* Update IR to Support Go Generation
Various updates to the IR for better supporting Go generation.
* Fix staticcheck
* Convert `GenerateGoCode` to use IR for Code Generation.
* Delete some no-longer used code
* Make newGoLangMapper exported
* Fix comment in ygen/codegen.go
Co-authored-by: Rob Shakir <[email protected]>
* Improve style
* gofmt
* Update comment in ygen/directory.go
Co-authored-by: Rob Shakir <[email protected]>
* Add comments that LangMapper should be idempotent
* Add comment
* Add presence container IR handling (merge conflict)
* Add new Fields to IR to support path API generation
* Remove useless line in ypathgen
* Generate Path API using IR.
* Remove unused code
* Remove YANGNodeDetails.Kind and add clarifying comments
* Remove usage of YANGNodeDetails.Kind
* textual -> text
* rename RootModule -> RootElementModule
* fix name
* Improve doc comments on BelongingModule
* Remove useless line in ypathgen (#656)
* Change name to LeafrefTargetPath
* [backwards-incompatible] Delete enum flags for `proto_generator`
These flags make IR generation more complex (maybe a day or so of work), so I want to remove them now a bit early ahead of v1 release to avoid the throwaway work.
* More accurate enum naming and classification according to namesake type.
Currently for unions it uses the outer-most union for the name and the type classification, but it should rather use the namesake union instead.
* Rename protoGenState to ProtoLangMapper
* Change `IR.Enums` map's key to be a unique key instead of the enum's name.
* Add `MappedType.UnionTypeInfos`
This will be used to store the key to the global enum map in the `IR`.
* Update ygen/genstate.go
Co-authored-by: Rob Shakir <[email protected]>
Co-authored-by: Rob Shakir <[email protected]>MappedType.UnionTypeInfos (#670)1 parent 8e1465d commit 69db7ad
2 files changed
+80
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| |||
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
70 | 83 | | |
71 | 84 | | |
72 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
| |||
75 | 81 | | |
76 | 82 | | |
77 | 83 | | |
78 | | - | |
79 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
80 | 98 | | |
81 | 99 | | |
82 | 100 | | |
| |||
105 | 123 | | |
106 | 124 | | |
107 | 125 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
112 | 154 | | |
113 | 155 | | |
114 | 156 | | |
| |||
342 | 384 | | |
343 | 385 | | |
344 | 386 | | |
345 | | - | |
346 | | - | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
347 | 401 | | |
348 | 402 | | |
349 | 403 | | |
| |||
0 commit comments