Skip to content
forked from hirano567/uncs

Unofficial C# Compiler for personal experimentations

License

Notifications You must be signed in to change notification settings

lesterbogran/uncs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

uncs

Unofficial C# Compiler for personal experimentations

A C# compiler for personal experimentations. It is derived from sscli 2.0.
This is extended to use the expression trees of .NET Framework 4.

I rewrote the C# compiler of sscli 2.0 in C# for understanding from a few years ago, and I implemented C# 3.0 extensions. It is published as "Elementary C# Compiler" in CodePlex.
I am implementing the C# 4 extensions to this project now.
When I implemented the expression trees, I was tempted to try to extend the compiler to use the expression trees of .NET Framework 4 and have started this project to implement some experimental extensions.

This compiler can translate several statement lambdas to the expression trees. For example, it can compile the code below: using System; using System.Linq.Expressions;

namespace ExpressionTree
{
    class Program
    {
        static void Main(string[] args)
        {
            Expression<Func<int, int>> et = i =>
            {
                int x = 0;
                for (; i > 0; --i)
                {
                    x += i;
                }
                return x;
            };
            Func<int, int> fn = et.Compile();

            Console.WriteLine("{0}", fn(10));
        }
    }
}

But, its translation is inadequate and its error processing is very poor. I would like to correct these problems and also to fix the bugs. If you have any advices, tell me please.

Besides above, I want to extend enumeration types in several respects.

This project is developed on .NET Framework 4.6.1 with Visual Studio 2015 Community.

About

Unofficial C# Compiler for personal experimentations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%