Initial work on compilation to C#

This commit is contained in:
2018-11-13 17:11:20 +01:00
parent b9aac52476
commit bb5d8140e4
6 changed files with 165 additions and 6 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using Upsilon;
using Upsilon.Binder;
using Upsilon.Evaluator;
using UpsilonCompiler;
namespace Yc
{
@@ -34,6 +35,10 @@ namespace Yc
continue;
}
var compiler = new Compiler();
var compiled = compiler.CompileToCSharp(parsed.Bind());
Console.WriteLine(compiled);
/*
var evaluate = parsed.Evaluate();
if (parsed.Diagnostics.Messages.Count > 0)
{
@@ -50,7 +55,7 @@ namespace Yc
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine(evaluate);
Console.ResetColor();
}
}*/
}
}

View File

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
@@ -6,6 +6,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\UpsilonCompiler\UpsilonCompiler.csproj" />
<ProjectReference Include="..\Upsilon\Upsilon.csproj" />
</ItemGroup>