public FileGen(string fileName) { _fileName = fileName; _sb = new StringBuilderWithIdent(); _sb.AppendLineA(Constants.Imports); }
private string GetFieldsListInit() { StringBuilderWithIdent sb = new StringBuilderWithIdent { Ident = 1 }; foreach (var field in _fieldsInit) { sb.AppendLineA($"public dynamic {field.Key} = {field.Value};"); } return(sb.ToString()); }
public TypeGen(StringBuilderWithIdent sb) { _sb = sb; _sb.AppendLineA($"public class {Constants.ClassName} : LuaObject"); _sb.AppendLineA("{"); _sb.Ident++; _sb.AppendLineNoIdentA(Constants.Fields); _sb.AppendLineNoIdentA(Constants.FieldsInit); _sb.AppendLineNoIdentA(Constants.ImplicitCtor); _fields = new HashSet <string>(); _fieldsInit = new Dictionary <string, Operand>(); }
private string GetDependencyInit() { var sb = new StringBuilderWithIdent() { Ident = 2 }; foreach (var dependencyInitializer in Env.Instance.GetDependencyInitializers()) { sb.AppendLineA($"this.{dependencyInitializer.Key} = new {dependencyInitializer.Value}();"); } return(sb.ToString()); }
public CodeGen(StringBuilderWithIdent sb) { _sb = sb; _startIdent = sb.Ident; }