Esempio n. 1
0
        public void Parse(Method method)
        {
            ArgumentUtility.CheckNotNull("method", method);
            IMethodGraphAnalyzer       methodParser                = new MethodGraphAnalyzer(_problemFilter);
            IMethodGraphBuilder        methodGraphBuilder          = new MethodGraphBuilder(method, _blacklistManager, _problemFilter);
            IInitialSymbolTableBuilder parameterSymbolTableBuilder = new InitialSymbolTableBuilder(method, _blacklistManager);

            methodParser.Parse(methodGraphBuilder, parameterSymbolTableBuilder);
        }
Esempio n. 2
0
 public void SetUp()
 {
     _blacklistManager    = new IDbCommandBlacklistManagerStub();
     _methodPreConditions = new SymbolTable(_blacklistManager);
     _methodPreConditions.MakeSafe("x", Fragment.CreateNamed("SqlFragment"));
     _methodPreConditions.MakeSafe("l", Fragment.CreateLiteral());
     _methodPreConditions.MakeUnsafe("y");
     _problemPipeStub     = new ProblemPipeStub();
     _methodGraphAnalyzer = new MethodGraphAnalyzer(_problemPipeStub);
     _mocks                       = new MockRepository();
     _methodGraph                 = _mocks.Stub <IMethodGraph>();
     _methodGraphBuilder          = _mocks.Stub <IMethodGraphBuilder>();
     _parameterSymbolTableBuilder = _mocks.Stub <IInitialSymbolTableBuilder>();
 }
        protected override void HandleStatement(HandleContext context)
        {
            AssignmentStatement assignmentStatement = (AssignmentStatement)context.Statement;

            if (!CoversAssignment(assignmentStatement))
            {
                return;
            }

            Method       assignedMethod     = GetAssignedDelegateMethod(assignmentStatement);
            DelegateNode sourceDelegateType = (DelegateNode)assignmentStatement.Source.Type;
            Fragment     returnFragment     = GetDelegateTypesReturnFragment(sourceDelegateType);
            ISymbolTable environment        = GetDelegatesEnvironment(sourceDelegateType);

            IMethodGraphAnalyzer       methodParser                = new MethodGraphAnalyzer(_blockParserContext.ProblemPipe);
            IMethodGraphBuilder        methodGraphBuilder          = new MethodGraphBuilder(assignedMethod, _blockParserContext.BlacklistManager, _blockParserContext.ProblemPipe, returnFragment);
            IInitialSymbolTableBuilder parameterSymbolTableBuilder = new EmbeddedInitialSymbolTableBuilder(assignedMethod, _blockParserContext.BlacklistManager, environment);

            methodParser.Parse(methodGraphBuilder, parameterSymbolTableBuilder);
        }