Beispiel #1
0
        public override IEnumerable <CFGBlock> ExceptionHandlers <Data, TType> (CFGBlock block, Subroutine innerSubroutine,
                                                                                Data data, IHandlerFilter <Data> handlerPredicate)
        {
            IHandlerFilter <Data> handleFilter       = handlerPredicate;
            LispList <Handler>    protectingHandlers = ProtectingHandlerList(block);

            if (innerSubroutine != null && innerSubroutine.IsFaultFinally)
            {
                for (; protectingHandlers != null; protectingHandlers = protectingHandlers.Tail)
                {
                    if (IsFaultOrFinally(protectingHandlers.Head) && this.FaultFinallySubroutines [protectingHandlers.Head] == innerSubroutine)
                    {
                        protectingHandlers = protectingHandlers.Tail;
                        break;
                    }
                }
            }

            for (; protectingHandlers != null; protectingHandlers = protectingHandlers.Tail)
            {
                Handler handler = protectingHandlers.Head;
                if (!IsFaultOrFinally(handler))
                {
                    if (handleFilter != null)
                    {
                        bool stopPropagation;
                        if (CodeProvider.IsCatchHandler(handler))
                        {
                            if (handleFilter.Catch(data, CodeProvider.CatchType(handler), out stopPropagation))
                            {
                                yield return(this.CatchFilterHeaders [handler]);
                            }
                        }
                        else if (handleFilter.Filter(data, new APC(this.FilterCodeBlocks [handler], 0, null), out stopPropagation))
                        {
                            yield return(this.CatchFilterHeaders [handler]);
                        }
                        if (stopPropagation)
                        {
                            yield break;
                        }
                    }
                    else
                    {
                        yield return(this.CatchFilterHeaders [handler]);
                    }

                    if (CodeProvider.IsCatchAllHandler(handler))
                    {
                        yield break;
                    }
                }
            }
            yield return(ExceptionExit);
        }
Beispiel #2
0
 public override IEnumerable <CFGBlock> ExceptionHandlers <Data, TType> (CFGBlock block, Subroutine innerSubroutine,
                                                                         Data data, IHandlerFilter <Data> handlerPredicate)
 {
     yield return(this.exception_exit);
 }
 public IEnumerable <APC> ExceptionHandlers <Type, Data>(APC ppoint, Data data, IHandlerFilter <Type, Data> handlerPredicate)
 {
     Contract.Ensures(Contract.Result <IEnumerable <APC> >() != null);
     throw new NotImplementedException();
 }
		public void AddHandlerFilter(IHandlerFilter filter)
		{
			if (filters == null)
			{
				filters = new List<IHandlerFilter>();
			}
			filters.Add(filter);
		}
Beispiel #5
0
 public abstract IEnumerable <CFGBlock> ExceptionHandlers <Data, Type> (CFGBlock block, Subroutine innerSubroutine,
                                                                        Data data, IHandlerFilter <Data> handlerPredicate);
 public IEnumerable <APC> ExceptionHandlers <Type, Data>(APC ppoint, Data data, IHandlerFilter <Type, Data> handlerPredicate)
 {
     return(underlying.ExceptionHandlers(ppoint, data, handlerPredicate));
 }