예제 #1
0
            public ExceptionHandlerScope(ExceptionHandlerContainerScope containingScope, ScopeType type, StarkPlatform.Cci.ITypeReference exceptionType)
            {
                Debug.Assert((type == ScopeType.Try) || (type == ScopeType.Catch) || (type == ScopeType.Filter) || (type == ScopeType.Finally) || (type == ScopeType.Fault));
                Debug.Assert((type == ScopeType.Catch) == (exceptionType != null));

                _containingScope = containingScope;
                _type            = type;
                _exceptionType   = exceptionType;
            }
예제 #2
0
            public override ScopeInfo OpenScope(ScopeType scopeType,
                                                StarkPlatform.Cci.ITypeReference exceptionType,
                                                ExceptionHandlerScope currentExceptionHandler)
            {
                Debug.Assert(((_handlers.Count == 0) && (scopeType == ScopeType.Try)) ||
                             ((_handlers.Count > 0) && ((scopeType == ScopeType.Catch) || (scopeType == ScopeType.Filter) || (scopeType == ScopeType.Finally) || (scopeType == ScopeType.Fault))));

                Debug.Assert(currentExceptionHandler == _containingHandler);

                var handler = new ExceptionHandlerScope(this, scopeType, exceptionType);

                _handlers.Add(handler);
                return(handler);
            }
예제 #3
0
 public virtual ScopeInfo OpenScope(ScopeType scopeType,
                                    StarkPlatform.Cci.ITypeReference exceptionType,
                                    ExceptionHandlerScope currentHandler)
 {
     if (scopeType == ScopeType.TryCatchFinally)
     {
         return(new ExceptionHandlerContainerScope(currentHandler));
     }
     else
     {
         Debug.Assert(scopeType == ScopeType.Variable || scopeType == ScopeType.StateMachineVariable);
         return(new LocalScopeInfo());
     }
 }