def visit_FunctionDef(self, node):
     #print(type(node).__name__, 'found:', node.name)
     methodNd = Cm.CfgMethodNode(node.name,
                                 node)  # add method node to model
     methodNd.comment = self.pyF1GetComment(node)  # extract comment
     self.pyF1AddFunctionArgs(node)  # extract arguments
     ast.NodeVisitor.generic_visit(self, node)
     omit = __class__.hasInvalidChildren(node)
     if omit:
         print('python ' + type(node).__name__ + ' name=' + node.name +
               ' could not be converted to config model\n')
     Cm.BaseCfgNode.finishNode(
         omit)  # pop node from active stack and omit if invalid
Exemplo n.º 2
0
 def enterMethod_def(self, ctx: ConfigParser.Method_defContext):
     name = ctx.id_str().getText()
     #print("enter method_def: " + name)
     methodNd = Cm.CfgMethodNode(name)  # add method node to model
     self.addComment(methodNd)  # extract comment