Example #1
0
        /// <summary>
        /// Execute to gather information about the program
        /// Data is stored in ProtoCore.CompileAndExecutePass.ProgramData
        /// </summary>
        /// <param name="filename"></param>
        /// <param name="programData"></param>
        /// <returns></returns>
        private bool CompileAndExecutePass(string filename, out ProtoCore.CompileAndExecutePass.ProgramData programData)
        {
            ProtoCore.Options options = new ProtoCore.Options();
            ProtoCore.Core    core    = new ProtoCore.Core(options);
            options.ExecutionMode = ProtoCore.ExecutionMode.Serial;
            core.Executives.Add(ProtoCore.Language.kAssociative, new ProtoAssociative.Executive(core));
            core.Executives.Add(ProtoCore.Language.kImperative, new ProtoImperative.Executive(core));
            core.Options.DumpByteCode = true;
            core.Options.Verbose      = true;

            ProtoFFI.DLLFFIHandler.Register(ProtoFFI.FFILanguage.CSharp, new ProtoFFI.CSModuleHelper());
            ExecutionMirror mirror = LoadAndExecute(filename, core);

            programData = core.GetProgramData();

            return(mirror == null ? false : true);
        }