private static void GenerateClassImplementation(ProjectConfig config, string className, string classCode) { Transpilers.AbstractTranspiler transpiler = LanguageUtil.GetTranspiler(config.Language); classCode = transpiler.WrapCodeForClasses(config, classCode); string fileExtension = LanguageUtil.GetFileExtension(config.Language); string path = System.IO.Path.Combine(config.OutputDirStructs, className + fileExtension); System.IO.File.WriteAllText(path, classCode); }
private static void GenerateStructBundleImplementation(ProjectConfig config, string[] structOrder, Dictionary <string, string> structCodeByName) { Transpilers.AbstractTranspiler transpiler = LanguageUtil.GetTranspiler(config.Language); List <string> finalCode = new List <string>(); foreach (string structName in structOrder) { finalCode.Add(transpiler.WrapCodeForStructs(config, structCodeByName[structName])); } finalCode.Insert(0, "<?php"); finalCode.Add("?>"); System.IO.File.WriteAllText(config.OutputDirStructs, string.Join(transpiler.NewLine, finalCode)); }
private static void GenerateFunctionImplementation(ProjectConfig config, string funcCode) { Transpilers.AbstractTranspiler transpiler = LanguageUtil.GetTranspiler(config.Language); funcCode = transpiler.WrapCodeForFunctions(config, funcCode); System.IO.File.WriteAllText(config.OutputFileFunctions, funcCode); }