Reko.Core.ImportResolver.ResolveProcedure C# (CSharp) Méthode

ResolveProcedure() public méthode

public ResolveProcedure ( string moduleName, int ordinal, IPlatform platform ) : Reko.Core.ExternalProcedure
moduleName string
ordinal int
platform IPlatform
Résultat Reko.Core.ExternalProcedure
        public ExternalProcedure ResolveProcedure(string moduleName, int ordinal, IPlatform platform)
        {
            foreach (var program in project.Programs)
            {
                ModuleDescriptor mod;
                if (!program.EnvironmentMetadata.Modules.TryGetValue(moduleName, out mod))
                    continue;

                SystemService svc;
                if (mod.ServicesByVector.TryGetValue(ordinal, out svc))
                {
                    return new ExternalProcedure(svc.Name, svc.Signature, svc.Characteristics);
                }
            }

            return platform.LookupProcedureByOrdinal(moduleName, ordinal);
        }

Same methods

ImportResolver::ResolveProcedure ( string moduleName, string importName, IPlatform platform ) : Reko.Core.ExternalProcedure

Usage Example

Exemple #1
0
        public void Impres_ProcedureByName()
        {
            var proj = new Project
            {
                MetadataFiles =
                {
                    new MetadataFile
                    {
                         ModuleName = "foo",
                         TypeLibrary = new TypeLibrary
                         {
                              ServicesByName =
                              {
                                  {
                                      "bar@4",
                                      new SystemService
                                      {
                                          Name = "bar", Signature= new ProcedureSignature()
                                      }
                                  }
                              }
                         }
                    }
                }
            };

            var impres = new ImportResolver(proj);
            var ep = impres.ResolveProcedure("foo", "bar@4", new DefaultPlatform(services, arch));
            Assert.AreEqual("bar", ep.Name);
        }
All Usage Examples Of Reko.Core.ImportResolver::ResolveProcedure