code/Kingdom.OrTools.Sat.CodeGeneration.Tests/Services/SatParameterCodeGeneratorServiceFixture.cs
/// <summary>
/// Generates the Code. Returns the CSharp Project <see cref="FileInfo"/> in a test
/// context. Returns the corresponding <see cref="DirectoryInfo"/> where the code
/// landed in a production context.
/// </summary>
/// <returns></returns>
Generates the Code. Returns the CSharp Project  in a test
context. Returns the corresponding  where the code
landed in a production context.
Generates the Code . Returns the CSharp Project in a test context . Returns the corresponding where the code landed in a production context .
internal FileSystemInfo GenerateCode()
        {
            var descriptor = Descriptor;
            var visitor = CodeGenerationVisitor;
            visitor.Visit(descriptor);
            FileSystemInfo resultInfo = new DirectoryInfo(GeneratorOutputDirectory);
            if (!resultInfo.Exists)
            {
                Directory.CreateDirectory(GeneratorOutputDirectory);
                GenerateServiceProjectFile(ref resultInfo);
                foreach (var x in visitor.CompilationUnits)
                {
                    string RenderCompilationUnit() => $"{x.Value.GetText()}";
                    GenerateCode($"{GeneratorOutputDirectory}\\{NewId:N}.cs", RenderCompilationUnit);
                }
            }
            return resultInfo;
        }
internal FileSystemInfo GenerateCode ( ) { var descriptor = Descriptor ; var visitor = CodeGenerationVisitor ; visitor . Visit ( descriptor ) ; FileSystemInfo resultInfo = new DirectoryInfo ( GeneratorOutputDirectory ) ; if ( ! resultInfo . Exists ) { Directory . CreateDirectory ( GeneratorOutputDirectory ) ; GenerateServiceProjectFile ( ref resultInfo ) ; foreach ( var x in visitor . CompilationUnits ) { string RenderCompilationUnit ( ) => $" { x . Value . GetText ( ) } " ; GenerateCode ( $" { GeneratorOutputDirectory } \\ { NewId : } .cs " , RenderCompilationUnit ) ; } } return resultInfo ; }
Generates the Code.
Generates the Code .
// TODO: TBD: CG, so-called, in the compilation verification sense of the term, is based entirely on the CG Visitor. // ReSharper disable once InvertIf // TODO: TBD: Which, here is the key, sort of... // TODO: TBD: I am also wondering if possibly the CGR ought not to expose its CG internals as a dictionary along these lines...
None