コード例 #1
0
        private AbstractSyntaxTreeNode GatherDeclInformationOrDefault(string name, ClassExtractorObj obj, out string hashCode)
        {
            hashCode = null;
            foreach (var node in obj.ClassTemplateDecls)
            {
                if (!Splitter.Split(node.Value).Any(v => v.Equals(name)) || !ContainsDefinitionData(node))
                {
                    continue;
                }

                hashCode = GetClassHashCodeOrDefault(node);

                if (hashCode == null)
                {
                    continue;
                }

                return(node);
            }
            return(null);
        }
コード例 #2
0
        public AbstractSyntaxTreeNode GatherDeclInformation(string name, ClassExtractorObj obj, out string hashCode)
        {
            hashCode = null;
            foreach (var node in obj.ClassTemplateDecls)
            {
                if (!Splitter.Split(node.Value).Any(v => v.Equals(name)) || !ContainsDefinitionData(node))
                {
                    continue;
                }

                hashCode = GetClassHashCodeOrDefault(node);

                if (hashCode == null)
                {
                    continue;
                }

                return(node);
            }
            throw new EngineReportExceptionData($"Unable to find c++ class named \'{name}\'")
                  {
                      Type = "Compilation"
                  };
        }
コード例 #3
0
        public AbstractSyntaxTreeNode GatherMethodDeclaration(AbstractSyntaxTreeNode classNode, ClassExtractorObj obj, string hashCode)
        {
            var root = new AbstractSyntaxTreeNode("Root");

            root.Append(classNode);

            foreach (var node in obj.CxxMethodDecls.Where(wrapper => IsDefinedClassMethod(wrapper, hashCode)))
            {
                root.Append(node);
            }
            return(root);
        }
コード例 #4
0
 public ClassExtractorDeclVisitor(ClassExtractorObj extractorObj, ILineSplitter spiltter)
 {
     ExtractorObj = extractorObj;
     Spiltter     = spiltter;
 }