public void CodeGen(CodeBuilder builder) { Visibility.CodeGen(builder); switch (ModuleType) { case ModuleTypes.Class: builder.AppendToken("class"); break; case ModuleTypes.Struct: builder.AppendToken("struct"); break; default: throw new ArgumentOutOfRangeException(); } builder.AppendToken(Name); if (Inheritations.Any()) { builder.AppendToken(":"); builder.BeginSeparatedList(","); foreach (var inheritation in Inheritations) { inheritation.CodeGen(builder); builder.EndOfSeparatedListItem(); } builder.EndOfSeparatedList(); } builder.BeginBlock(); foreach (var constant in Constants) { constant.CodeGen(builder); } // Leerzeile nach den Konstanten if (Constants.Any()) { builder.EndOfLineBlock(); } // Konstruktor erzeugen var constructorProperties = Properties.Where(p => p.SetInConstructor).ToList(); if (constructorProperties.Any()) { CodeGenConstructor(builder, constructorProperties); } foreach (var property in Properties) { property.CodeGen(builder); } foreach (var method in Methods) { method.CodeGen(builder); } foreach (string code in StaticCode) { builder.AppendStaticCode(code); } builder.EndBlock(); }