(component ComponentDefinition, w LanguageWriter)
| 147 | |
| 148 | |
| 149 | func buildGoEnums(component ComponentDefinition, w LanguageWriter) { |
| 150 | if len(component.Enums) <= 0 { |
| 151 | return |
| 152 | } |
| 153 | NameSpace := component.NameSpace |
| 154 | |
| 155 | w.Writeln("") |
| 156 | w.Writeln("/*************************************************************************************************************************") |
| 157 | w.Writeln(" Declaration of enums") |
| 158 | w.Writeln("**************************************************************************************************************************/") |
| 159 | w.Writeln("") |
| 160 | for i := 0; i < len(component.Enums); i++ { |
| 161 | enum := component.Enums[i] |
| 162 | w.Writeln("type E%s%s int", NameSpace, enum.Name) |
| 163 | |
| 164 | w.Writeln("const (") |
| 165 | |
| 166 | for j := 0; j < len(enum.Options); j++ { |
| 167 | |
| 168 | option := enum.Options[j] |
| 169 | w.Writeln(" e%s_%s = %d", enum.Name, option.Name, option.Value) |
| 170 | } |
| 171 | w.Writeln(")") |
| 172 | w.Writeln("") |
| 173 | } |
| 174 | w.Writeln("") |
| 175 | } |
| 176 | |
| 177 | func buildGoStructs(component ComponentDefinition, w LanguageWriter) (error) { |
| 178 | if len(component.Structs) <= 0 { |
no test coverage detected