mercredi 13 janvier 2016

Function Calls in Reflection.Emit

I am currently making a programming language in C#. I am stumped on how to perform function calls in a dynamic way. I am now sure how I would call a user-defined function. I understand that to output "hello world" something like this is needed:

ilg.Emit(OpCodes.Ldstr, "Hello, World!");
ilg.Emit(OpCodes.Call, typeof(Console).GetMethod("WriteLine",
            new Type[] {typeof(string)} ));

But what do I do if there's a user-defined function?

What's the best (or any) way to do this?





Aucun commentaire:

Enregistrer un commentaire