Пример #1
0
        public static ForwardAnalysisSolver <AState, Type, EdgeData> Make <Local, Parameter, Method, Field, Source, Dest, Context>(
            IDecodeMSIL <APC, Local, Parameter, Method, Field, Type, Source, Dest, Context, EdgeData> decoder,
            IAnalysis <APC, AState, IVisitMSIL <APC, Local, Parameter, Method, Field, Type, Source, Dest, AState, AState>, EdgeData> driver,
            ILPrinter <APC> printer
            )
            where Context : IMethodContext <Field, Method>
        {
            Contract.Requires(decoder != null);
            Contract.Requires(driver != null);

            IVisitMSIL <APC, Local, Parameter, Method, Field, Type, Source, Dest, AState, AState> visitor = driver.Visitor();
            var result = new ForwardAnalysisSolver <AState, Type, EdgeData>(
                decoder.Context.MethodContext.CFG,
                delegate(APC pc, AState state) { return(decoder.ForwardDecode <AState, AState, IVisitMSIL <APC, Local, Parameter, Method, Field, Type, Source, Dest, AState, AState> >(pc, visitor, state)); },
                driver.EdgeConversion,
                driver.Join,
                driver.ImmutableVersion,
                driver.MutableVersion,
                driver.Dump,
                delegate(APC pc, AState state) { return(decoder.IsUnreachable(pc) || driver.IsBottom(pc, state)); },
                delegate(APC pc, AState state) { return(driver.IsTop(pc, state)); },
                printer,
                decoder.Display,
                decoder.EdgeData
                );

            result.CachePolicy = driver.CacheStates(result);
            return(result);
        }
Пример #2
0
 public void PrintCodeAt(Label label, string prefix, TextWriter writer)
 {
     this.prefix = prefix;
     ilDecoder.ForwardDecode <TextWriter, Unit, Printer <Label, Local, Parameter, Method, Field, Property, Event, Type, Source, Dest, Context, Attribute, Assembly, EdgeData> >(label, this, writer);
 }
Пример #3
0
 public string SearchAssumptionAt(Label label)
 {
     return(ilDecoder.ForwardDecode <string, string, SearchAssumptions <Label, Local, Parameter, Method, Field, Property, Event, Type, Source, Dest, Context, Attribute, Assembly, EdgeData> >(label, this, null));
 }