Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Start to document the plugin mechanism
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Mon, 1 Feb 2021 18:06:35 +0000 (19:06 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Tue, 2 Feb 2021 20:19:48 +0000 (21:19 +0100)
docs/find-missing.py
docs/source/Doxyfile
docs/source/_ext/autodoxy.py

index aa3aeeb..f1e9b72 100755 (executable)
@@ -39,6 +39,7 @@ xml_files = [
     'build/xml/classsimgrid_1_1s4u_1_1NetZone.xml',
     'build/xml/classsimgrid_1_1s4u_1_1Semaphore.xml',
     'build/xml/classsimgrid_1_1s4u_1_1VirtualMachine.xml',
+    'build/xml/classsimgrid_1_1xbt_1_1signal_3_01R_07P_8_8_8_08_4.xml',
     'build/xml/namespacesimgrid_1_1s4u_1_1this__actor.xml',
     'build/xml/actor_8h.xml',
     'build/xml/barrier_8h.xml',
index 50f9f92..d94a941 100644 (file)
@@ -15,6 +15,7 @@ INPUT                 += ../../include/simgrid/mutex.h
 INPUT                 += ../../include/simgrid/semaphore.h
 INPUT                 += ../../include/simgrid/vm.h
 INPUT                 += ../../include/simgrid/zone.h
+INPUT                 += ../../include/xbt/signal.hpp
 INPUT                 += ../../src/msg/
 INPUT                 += ../../src/plugins/
 RECURSIVE              = YES
index 07efce4..3b277ef 100644 (file)
@@ -15,6 +15,7 @@ from __future__ import print_function, absolute_import, division
 import os.path
 import re
 import sys
+import traceback # debug, big time
 
 from six import itervalues
 from lxml import etree as ET
@@ -45,7 +46,31 @@ def format_xml_paragraph(xmlnode):
     """
     return [l.rstrip() for l in _DoxygenXmlParagraphFormatter().generic_visit(xmlnode).lines]
 
-
+def elm2xml(xelm):
+    """Return the unparsed form of the element"""
+    res = '<{}'.format(xelm.tag)
+    for key in xelm.keys():
+        res += ' {}="{}"'.format(key, xelm.attrib[key])
+    res += ">"
+    if xelm.text is not None: # Text before the first child
+        res += xelm.text
+    for i in xelm.getchildren(): # serialize every subtag
+        res += elm2xml(i)
+    if xelm.tail is not None: # Text after last child
+        res += xelm.tail
+    res += '</{}>'.format(xelm.tag)
+    return res
+def elm2txt(xelm):
+    """Return the content of the element, with all tags removed. Only the text remains"""
+    res = ''
+    if xelm.text is not None: # Text before the first child
+        res += xelm.text
+    for i in xelm.getchildren(): # serialize every subtag
+        res += elm2txt(i)
+    if xelm.tail is not None: # Text after last child
+        res += xelm.tail
+    return res
+    
 class _DoxygenXmlParagraphFormatter(object):
     # This class follows the model of the stdlib's ast.NodeVisitor for tree traversal
     # where you dispatch on the element type to a different method for each node
@@ -377,10 +402,12 @@ class DoxygenMethodDocumenter(DoxygenDocumenter):
         return False
 
     def parse_id(self, id_to_parse):
+        print("Parse ID {}".format(id_to_parse))
         xp = './/*[@id="%s"]' % id_to_parse
         match = get_doxygen_root().xpath(xp)
         if match:
             match = match[0]
+            print("ID: {}".format(elm2xml(match)))
             self.fullname = match.find('./definition').text.split()[-1]
             self.modname = self.fullname
             self.objname = match.find('./name').text
@@ -394,6 +421,8 @@ class DoxygenMethodDocumenter(DoxygenDocumenter):
             # classname or method name
             return True
 
+#        sys.stderr.write("fullname: {}".format(self.fullname))
+#        traceback.print_stack()
         if '::' in self.fullname:
             (obj, meth) = self.fullname.rsplit('::', 1)
             # 'public-func' and 'public-static-func' are for classes while 'func' alone is for namespaces
@@ -424,6 +453,7 @@ class DoxygenMethodDocumenter(DoxygenDocumenter):
                 logger.warning("[autodoxy] WARNING: Could not find method {}{}{}".format(obj, meth, self.argsstring))
                 if not candidates:
                     logger.warning("[autodoxy] WARNING:  (no candidate found)")
+                    logger.warning("Query was: {}".format(xpath_query))
                 for cand in candidates:
                     logger.warning("[autodoxy] WARNING:   Existing candidate: {}{}{}".format(obj, meth, cand.find('argsstring').text))
             else:
@@ -476,31 +506,6 @@ class DoxygenMethodDocumenter(DoxygenDocumenter):
     def document_members(self, all_members=False):
         pass
 
-def elm2xml(xelm):
-    """Return the unparsed form of the element"""
-    res = '<{}'.format(xelm.tag)
-    for key in xelm.keys():
-        res += ' {}="{}"'.format(key, xelm.attrib[key])
-    res += ">"
-    if xelm.text is not None: # Text before the first child
-        res += xelm.text
-    for i in xelm.getchildren(): # serialize every subtag
-        res += elm2xml(i)
-    if xelm.tail is not None: # Text after last child
-        res += xelm.tail
-    res += '</{}>'.format(xelm.tag)
-    return res
-def elm2txt(xelm):
-    """Return the content of the element, with all tags removed. Only the text remains"""
-    res = ''
-    if xelm.text is not None: # Text before the first child
-        res += xelm.text
-    for i in xelm.getchildren(): # serialize every subtag
-        res += elm2txt(i)
-    if xelm.tail is not None: # Text after last child
-        res += xelm.tail
-    return res
-    
 class DoxygenVariableDocumenter(DoxygenDocumenter):
     objtype = 'doxyvar'
     directivetype = 'var'