예제 #1
0
 public string Accept(TList type, string jsonVarName, string fieldName)
 {
     if (type.Apply(SimpleJsonTypeVisitor.Ins))
     {
         return($"{fieldName} = {jsonVarName}");
     }
     else
     {
         return($"{fieldName} = []\n        for _ele in {jsonVarName}: {type.ElementType.Apply(this, "_ele", "_e")}; {fieldName}.append(_e)");
     }
 }
예제 #2
0
 public string Accept(TList type, string jsonVarName, string fieldName)
 {
     if (type.Apply(SimpleJsonTypeVisitor.Ins))
     {
         return($"{fieldName} = {jsonVarName};");
     }
     else
     {
         return($"{{ {fieldName} = []; for(var _ele of {jsonVarName}) {{ let _e : {type.ElementType.Apply(TsDefineTypeName.Ins)};{type.ElementType.Apply(this, "_ele", "_e")} {fieldName}.push(_e);}}}}");
     }
 }
예제 #3
0
 public string Accept(TList type, string bufName, string fieldName)
 {
     return($"{{int n = System.Math.Min({bufName}.ReadSize(), {bufName}.Size);{fieldName} = new {type.Apply(CsDefineTypeName.Ins)}(n);for(var i = 0 ; i < n ; i++) {{ {type.ElementType.Apply(CsDefineTypeName.Ins)} _e;  {type.ElementType.Apply(this, bufName, "_e")} {fieldName}.Add(_e);}}}}");
 }
 public string Accept(TList type, string bufName, string fieldName)
 {
     return($"{{int n = Math.min({bufName}.readSize(), {bufName}.size());{fieldName} = new {type.Apply(JavaDefineTypeName.Ins)}(n);for(int i = 0 ; i < n ; i++) {{ {type.ElementType.Apply(JavaBoxDefineTypeName.Ins)} _e;  {type.ElementType.Apply(this, bufName, "_e")} {fieldName}.add(_e);}}}}");
 }
예제 #5
0
 public string Accept(TList type, string fieldName, string logType)
 {
     return($"{fieldName} = new {type.Apply(DbCsDefineTypeVisitor.Ins)}(_v => new {logType}(this, _v));");
 }