Ejemplo n.º 1
0
    public static void ConvertRoslynToCCI(
      IMetadataHost host,
      Microsoft.CodeAnalysis.CSharp.SyntaxTree tree,
      Microsoft.CodeAnalysis.CSharp.Semantics.SemanticModel semanticModel,
      out IModule module,
      out ISourceLocationProvider sourceLocationProvider) {

      sourceLocationProvider = new SourceLocationProvider();

      var transformer = new NodeVisitor(host, semanticModel, sourceLocationProvider);
      var assembly = (Module)transformer.Visit(tree.GetRoot());
      assembly.Location = Path.GetFullPath(tree.FilePath);
      module = assembly;
    }