/// <summary> /// Generates the instructions of given method. /// </summary> /// <param name="method">The method.</param> /// <param name="info">The method information.</param> /// <param name="emitter">The emitter where instructions will be generated.</param> /// <param name="services">The services from <see cref="MEFEditor.TypeSystem"/>.</param> public static void GenerateInstructions(CILMethod method, TypeMethodInfo info, EmitterBase emitter, TypeServices services) { Console.WriteLine(method.ToString()); var compiler = new Compiler(method, info, emitter, services); compiler.generateInstructions(); //Console.WriteLine(emitter.GetEmittedInstructions().Code); }
/// <summary> /// Initializes a new instance of the <see cref="Compiler"/> class. /// </summary> /// <param name="method">The method.</param> /// <param name="methodInfo">The method information.</param> /// <param name="emitter">The emitter.</param> /// <param name="services">The services.</param> private Compiler(CILMethod method, TypeMethodInfo methodInfo, EmitterBase emitter, TypeServices services) { _method = method; _methodInfo = methodInfo; E = emitter; }