Exemplo n.º 1
0
        static public MethodExpressionAnalysis FromSemanticModel(MethodDeclarationSyntax methodSyntax, SemanticModel semanticModel)
        {
            var expression = SyntaxOperations.GetBodyOfMethod(methodSyntax).B.Common;
            var dataFlow   = semanticModel.AnalyzeDataFlow(expression);

            return(new MethodExpressionAnalysis(methodSyntax, expression, semanticModel, dataFlow));
        }
Exemplo n.º 2
0
        static public MethodBlockAnalysis FromSemanticModel(MethodDeclarationSyntax methodSyntax, SemanticModel semanticModel)
        {
            var block       = SyntaxOperations.GetBodyOfMethod(methodSyntax).A;
            var controlFlow = semanticModel.AnalyzeControlFlow(block);
            var dataFlow    = semanticModel.AnalyzeDataFlow(block);

            return(new MethodBlockAnalysis(methodSyntax, block, semanticModel, controlFlow, dataFlow));
        }