parameters: (decl)
docstring: Creates functions based on declaration and add to appropriate classes and/or namespaces
docstring_summary: Creates functions based on declaration and add to appropriate classes and/or namespaces
docstring_tokens: Creates functions based on declaration and add to appropriate classes and / or namespaces
function: def add_func(decl):
      """
      Creates functions based on declaration and add to appropriate classes and/or namespaces
      """
      decl[0] = decl[0].replace('.', '::')
      namespace, classes, barename = split_decl_name(decl[0])
      name = "::".join(namespace+classes+[barename])
      full_classname = "::".join(namespace + classes)
      classname = "::".join(classes)
      namespace = '::'.join(namespace)
      is_static = False
      isphantom = False
      mapped_name = ''
  
      for m in decl[2]:
          if m == "/S":
              is_static = True
          elif m == "/phantom":
              print("phantom not supported yet ")
              return
          elif m.startswith("="):
              mapped_name = m[1:]
          elif m.startswith("/mappable="):
              print("Mappable not supported yet")
              return
          # if m == "/V":
          #     print("skipping ", name)
          #     return
  
      if classname and full_classname not in namespaces[namespace].classes:
          # print("HH1")
          # print(namespace, classname)
          namespaces[namespace].classes[full_classname] = ClassInfo(full_classname)
          assert(0)
  
  
      if is_static:
          # Add it as global function
          func_map = namespaces[namespace].funcs
          if name not in func_map:
              func_map[name] = []
          if not mapped_name:
              mapped_name = "_".join(classes + [barename])
          func_map[name].append(FuncVariant("", name, mapped_name, decl, namespace, True))
      else:
          if classname:
              func = FuncVariant(full_classname, name, barename, decl, namespace, False)
              if func.isconstructor:
                  namespaces[namespace].classes[full_classname].constructors.append(func)
              else:
                  func_map = namespaces[namespace].classes[full_classname].methods
                  if name not in func_map:
                      func_map[name] = []
                  func_map[name].append(func)
          else:
              func_map = namespaces[namespace].funcs
              if name not in func_map:
                  func_map[name] = []
              if not mapped_name:
                  mapped_name = barename
              func_map[name].append(FuncVariant("", name, mapped_name, decl, namespace, False))
function_tokens: def add_func ( decl ) : decl [ 0 ] = decl [ 0 ] . replace ( '.' , '::' ) namespace , classes , barename = split_decl_name ( decl [ 0 ] ) name = "::" . join ( namespace + classes + [ barename ] ) full_classname = "::" . join ( namespace + classes ) classname = "::" . join ( classes ) namespace = '::' . join ( namespace ) is_static = False isphantom = False mapped_name = '' for m in decl [ 2 ] : if m == "/S" : is_static = True elif m == "/phantom" : print ( "phantom not supported yet " ) return elif m . startswith ( "=" ) : mapped_name = m [ 1 : ] elif m . startswith ( "/mappable=" ) : print ( "Mappable not supported yet" ) return # if m == "/V": #     print("skipping ", name) #     return if classname and full_classname not in namespaces [ namespace ] . classes : # print("HH1") # print(namespace, classname) namespaces [ namespace ] . classes [ full_classname ] = ClassInfo ( full_classname ) assert ( 0 ) if is_static : # Add it as global function func_map = namespaces [ namespace ] . funcs if name not in func_map : func_map [ name ] = [ ] if not mapped_name : mapped_name = "_" . join ( classes + [ barename ] ) func_map [ name ] . append ( FuncVariant ( "" , name , mapped_name , decl , namespace , True ) ) else : if classname : func = FuncVariant ( full_classname , name , barename , decl , namespace , False ) if func . isconstructor : namespaces [ namespace ] . classes [ full_classname ] . constructors . append ( func ) else : func_map = namespaces [ namespace ] . classes [ full_classname ] . methods if name not in func_map : func_map [ name ] = [ ] func_map [ name ] . append ( func ) else : func_map = namespaces [ namespace ] . funcs if name not in func_map : func_map [ name ] = [ ] if not mapped_name : mapped_name = barename func_map [ name ] . append ( FuncVariant ( "" , name , mapped_name , decl , namespace , False ) )