-
Notifications
You must be signed in to change notification settings - Fork 1
/
EntryPoint.cs
40 lines (30 loc) · 1.55 KB
/
EntryPoint.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System.Collections.ObjectModel;
using Bootstrap.Backends.CSharp.Adapter;
namespace Microsoft.Dafny.Compilers.SelfHosting.CSharp;
internal class SelfHostingCSharpCompiler : Plugins.Compiler {
private readonly CompilerAdapter compiler = new ();
public override IReadOnlySet<string> SupportedExtensions => new HashSet<string> { ".cs", ".dll" };
public override string TargetLanguage => "C#";
public override string TargetExtension => "cs";
public override string PublicIdProtect(string name) {
return new CsharpCompiler().PublicIdProtect(name);
}
public override bool TextualTargetIsExecutable => false;
public override bool SupportsInMemoryCompilation => false;
public override void Compile(Program dafnyProgram, ConcreteSyntaxTree output) {
compiler.Compile(dafnyProgram, output);
}
public override void EmitCallToMain(Method mainMethod, string baseName, ConcreteSyntaxTree output) {
compiler.EmitCallToMain(mainMethod, baseName, output);
}
public override bool CompileTargetProgram(string dafnyProgramName, string targetProgramText, string callToMain,
string pathsFilename, ReadOnlyCollection<string> otherFileNames, bool runAfterCompile, TextWriter outputWriter,
out object compilationResult) {
throw new NotImplementedException();
}
public override bool RunTargetProgram(string dafnyProgramName, string targetProgramText, string callToMain,
string pathsFilename, ReadOnlyCollection<string> otherFileNames, object compilationResult,
TextWriter outputWriter) {
throw new NotImplementedException();
}
}