Exemplo n.º 1
0
        private ProblemCollection ParseGraph()
        {
            _methodGraphAnalyzer.Parse(_methodGraphBuilder, _parameterSymbolTableBuilder);
            ProblemCollection problemCollection = new ProblemCollection();

            _problemPipeStub.Problems.ForEach(problem => problemCollection.Add(new Problem(new Resolution("resolution"), c_InjectionCopRuleId)));
            return(problemCollection);
        }
Exemplo n.º 2
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);
        }
        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);
        }