Exemplo n.º 1
0
        private MethodDeclarationNode FromMethodCallToSWUM(MethodCall mcall, NamespaceDefinition globalNamespace, DataProject <CompleteWorkingSet> dataProject)
        {
            var mdef = globalNamespace.GetDescendants <MethodDefinition>().Where(decl => mcall.SignatureMatches(decl));

            if (mdef.Count() > 0)
            {
                var                   mdefXml = DataHelpers.GetElement(dataProject.SourceArchive, mdef.First().PrimaryLocation);
                MethodContext         mc      = ContextBuilder.BuildMethodContext(mdefXml);
                MethodDeclarationNode mdn     = new MethodDeclarationNode(mcall.Name, mc);
                BaseVerbRule          rule    = new BaseVerbRule(posData, tagger, splitter);
                if (rule.InClass(mdn))
                {
                    rule.ConstructSwum(mdn);
                    return(mdn);
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                Console.WriteLine(mcall.Name + " could not be found");
                return(null);
            }
        }