Ejemplo n.º 1
0
        public override ExternalProcedure ResolveImportedProcedure(
            IImportResolver resolver,
            Platform platform,
            AddressContext ctx)
        {
            var ep = resolver.ResolveProcedure(ModuleName, ImportName, platform);

            if (ep != null)
            {
                return(ep);
            }
            // Can we guess at the signature?
            var sig = platform.SignatureFromName(ImportName);

            if (sig != null)
            {
                ep = new ExternalProcedure(ImportName, sig);   //$BUGBUG: mangled name!
            }
            else
            {
                ctx.Warn("Unable to resolve imported reference {0}.", this);
                return(new ExternalProcedure(this.ToString(), null));
            }
            return(ep);
        }
Ejemplo n.º 2
0
 public override Expression ResolveImport(
     IDynamicLinker resolver,
     IPlatform platform,
     AddressContext ctx)
 {
     return(resolver.ResolveImport(ModuleName, ImportName, platform));
 }
Ejemplo n.º 3
0
 public override Identifier ResolveImportedGlobal(
     IImportResolver resolver,
     IPlatform platform,
     AddressContext ctx)
 {
     var global = resolver.ResolveGlobal(ModuleName, ImportName, platform);
     return global;
 }
Ejemplo n.º 4
0
 public override ExternalProcedure ResolveImportedProcedure(
     IImportResolver resolver, 
     IPlatform platform, 
     AddressContext ctx)
 {
     var ep = resolver.ResolveProcedure(ModuleName, ImportName, platform);
     if (ep != null)
         return ep;
     // Can we guess at the signature?
     ep = platform.SignatureFromName(ImportName);
     if (ep != null)
         return ep;
     
     ctx.Warn("Unable to resolve imported reference {0}.", this);
     return new ExternalProcedure(this.ToString(), null);
 }
Ejemplo n.º 5
0
        public override ExternalProcedure ResolveImportedProcedure(
            IDynamicLinker resolver,
            IPlatform platform,
            AddressContext ctx)
        {
            var ep = resolver.ResolveProcedure(ModuleName, ImportName, platform);

            if (ep != null)
            {
                if (!ep.Signature.ParametersValid)
                {
                    ctx.Warn("Unable to guess parameters of {0}.", this);
                }
                return(ep);
            }
            ctx.Warn("Unable to resolve imported reference {0}.", this);
            return(new ExternalProcedure(this.ToString(), new FunctionType()));
        }
Ejemplo n.º 6
0
        public override Expression ResolveImport(
            IImportResolver resolver,
            IPlatform platform,
            AddressContext ctx)
        {
            var global = resolver.ResolveImport(ModuleName, ImportName, platform);

            if (global != null)
            {
                return(global);
            }
            var t = platform.DataTypeFromImportName(ImportName);

            //$REVIEW: the way imported symbols are resolved as
            // globals or functions needs a revisit.
            if (t != null && !(t.Item2 is FunctionType))
            {
                return(new Identifier(t.Item1, t.Item2, new MemoryStorage()));
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 7
0
 public abstract ExternalProcedure ResolveImportedProcedure(IImportResolver importResolver, IPlatform platform, AddressContext ctx);
Ejemplo n.º 8
0
 public abstract Identifier ResolveImportedGlobal(IImportResolver importResolver, IPlatform platform, AddressContext ctx);
Ejemplo n.º 9
0
 public override ExternalProcedure ResolveImportedProcedure(IImportResolver resolver, IPlatform platform, AddressContext ctx)
 {
     var ep = resolver.ResolveProcedure(ModuleName, Ordinal, platform);
     if (ep != null)
         return ep;
     ctx.Warn("Unable to resolve imported reference {0}.", this);
     return new ExternalProcedure(this.ToString(), null);
 }
Ejemplo n.º 10
0
 public override Identifier ResolveImportedGlobal(IImportResolver importResolver, IPlatform platform, AddressContext ctx)
 {
     ctx.Warn("Ordinal global imports not supported. Please report this message to the Reko maintainers (https://github.com/uxmal/reko).");
     return null;
 }
Ejemplo n.º 11
0
 public abstract ExternalProcedure ResolveImportedProcedure(IDynamicLinker dynamicLinker, IPlatform platform, AddressContext ctx);
Ejemplo n.º 12
0
 public abstract Expression ResolveImport(IDynamicLinker dynamicLinker, IPlatform platform, AddressContext ctx);
Ejemplo n.º 13
0
 public abstract Identifier ResolveImportedGlobal(IImportResolver importResolver, IPlatform platform, AddressContext ctx);
Ejemplo n.º 14
0
        public override Expression ResolveImport(IDynamicLinker dynamicLinker, IPlatform platform, AddressContext ctx)
        {
            var imp = dynamicLinker.ResolveImport(ModuleName, Ordinal, platform);

            if (imp != null)
            {
                return(imp);
            }
            ctx.Warn("Unable to resolve imported reference {0}.", this);
            return(null);
        }
Ejemplo n.º 15
0
 public abstract ExternalProcedure ResolveImportedProcedure(IImportResolver importResolver, IPlatform platform, AddressContext ctx);
Ejemplo n.º 16
0
 public abstract Expression ResolveImport(IImportResolver importResolver, IPlatform platform, AddressContext ctx);
Ejemplo n.º 17
0
        public override ExternalProcedure ResolveImportedProcedure(IDynamicLinker resolver, IPlatform platform, AddressContext ctx)
        {
            var ep = resolver.ResolveProcedure(ModuleName, Ordinal, platform);

            if (ep != null)
            {
                return(ep);
            }
            ctx.Warn("Unable to resolve imported reference {0}.", this);
            return(new ExternalProcedure(this.ToString(), new FunctionType()));
        }
Ejemplo n.º 18
0
        public override Identifier ResolveImportedGlobal(IImportResolver importResolver, IPlatform platform, AddressContext ctx)
        {
            ctx.Warn("Ordinal global imports not supported. Please report this message to the Reko maintainers (https://github.com/uxmal/reko).");
            var id = importResolver.ResolveGlobal(ModuleName, Ordinal, platform);

            return(null);
        }