Пример #1
0
 private static void GenerateBareMethodClassFile(NameSpaceHierarchyBareFunction bareFunction,NameSpaceHierarchyNode parent,string parentalPath)
 {
     var res = GenerateClassHeader(bareFunction,parent);
       res.AddRange(GenerateMethodImplementation(bareFunction));
       res.AddRange(GenerateClosingFile());
       var fileName = parentalPath + bareFunction.name + ".cs";
       File.WriteAllLines(fileName,res);
 }
Пример #2
0
        private static void GenerateBareMethodClassFile(NameSpaceHierarchyBareFunction bareFunction, NameSpaceHierarchyNode parent, string parentalPath)
        {
            var res = GenerateClassHeader(bareFunction, parent);

            res.AddRange(GenerateMethodImplementation(bareFunction));
            res.AddRange(GenerateClosingFile());
            var fileName = parentalPath + bareFunction.name + ".cs";

            File.WriteAllLines(fileName, res);
        }
 private static NameSpaceHierarchyNode GetPropertyHierarchy()
 {
     var getCall = new NameSpaceHierarchyBareFunction { BareCSharpCode = "R = P0.GetProperty(P1)", InputTypes = new List<NameSpaceFunctionType> { refType, iidType }, name = "Get", returnType = iidType};
       var setCall = new NameSpaceHierarchyBareFunction { BareCSharpCode = "P0.SetProperty(P1,P2)", InputTypes = new List<NameSpaceFunctionType> { refType, iidType, iidType }, name = "Set", returnType = voidType };
       var removeCall = new NameSpaceHierarchyBareFunction { BareCSharpCode = "P0.RemoveProperty(P1)", InputTypes = new List<NameSpaceFunctionType> { refType, iidType}, name = "Remove", returnType = voidType };
       var getPropertiesCall = new NameSpaceHierarchyBareFunction { BareCSharpCode = "R = P0.GetProperties().ToList()", InputTypes = new List<NameSpaceFunctionType> { refType}, name = "GetProperties", returnType = listType};
       var containsPropertyCall = new NameSpaceHierarchyBareFunction { BareCSharpCode = "R = P0.ContainsProperty(P1)", InputTypes = new List<NameSpaceFunctionType> { refType,iidType}, name = "ContainsProperty", returnType = boolType};
       var propertyRoot = new NameSpaceHierarchyNode { Name = "Property", Elements = new List<NameSpaceHierarchyBareFunction>() { getCall, setCall, removeCall, getPropertiesCall, containsPropertyCall}, Children = emptyChildren};
       return propertyRoot;
 }
 private static NameSpaceHierarchyNode GetIntHierarchy()
 {
     var sumFunction = new NameSpaceHierarchyBareFunction { BareCSharpCode = "R = P0 + P1;", InputTypes = new List<NameSpaceFunctionType> { intType, intType }, name = "+", returnType = intType };
       var minFunction = new NameSpaceHierarchyBareFunction { BareCSharpCode = "R = P0 - P1;", InputTypes = new List<NameSpaceFunctionType> { intType, intType }, name = "-", returnType = intType };
       var multFunction = new NameSpaceHierarchyBareFunction { BareCSharpCode = "R = P0 * P1;", InputTypes = new List<NameSpaceFunctionType> { intType, intType }, name = "*", returnType = intType };
       var divFunction = new NameSpaceHierarchyBareFunction { BareCSharpCode = "R = P0 / P1;", InputTypes = new List<NameSpaceFunctionType> { intType, intType }, name = "/", returnType = intType };
       var intmax = new NameSpaceHierarchyBareFunction { BareCSharpCode = "R = Math.Max(P0, P1)", InputTypes = new List<NameSpaceFunctionType> { intType, intType }, name = "Max", returnType = intType };
       var intmin = new NameSpaceHierarchyBareFunction { BareCSharpCode = "R = Math.Min(P0, P1)", InputTypes = new List<NameSpaceFunctionType> { intType, intType }, name = "Min", returnType = intType };
       var intRoot = new NameSpaceHierarchyNode { Name = "Int", Elements = new List<NameSpaceHierarchyBareFunction>() { sumFunction, minFunction, multFunction, divFunction, intmax, intmin }, Children = emptyChildren };
       return intRoot;
 }
Пример #5
0
 private static List <string> GenerateMethodImplementation(NameSpaceHierarchyBareFunction bareFunction)
 {
     throw new NotImplementedException();
 }
Пример #6
0
 private static List <string> GenerateClassHeader(NameSpaceHierarchyBareFunction bareFunction, NameSpaceHierarchyNode parent)
 {
     throw new NotImplementedException();
 }
Пример #7
0
 private static List<string> GenerateMethodImplementation(NameSpaceHierarchyBareFunction bareFunction)
 {
     throw new NotImplementedException();
 }
Пример #8
0
 private static List<string> GenerateClassHeader(NameSpaceHierarchyBareFunction bareFunction, NameSpaceHierarchyNode parent)
 {
     throw new NotImplementedException();
 }
 private static NameSpaceHierarchyNode GetExecutionHierarchy()
 {
     var ifcall = new NameSpaceHierarchyBareFunction { BareCSharpCode = "if(P0) then {R = P1;} else {R = P2;}", InputTypes = new List<NameSpaceFunctionType> { boolType, iidType, iidType }, name = "if", returnType = iidType };
       var executionRoot = new NameSpaceHierarchyNode { Name = "Execution", Children = emptyChildren, Elements = new List<NameSpaceHierarchyBareFunction>() { ifcall} };
       return executionRoot;
 }