parameters: (filename)
docstring: Parse an XML file and generate the code.
docstring_summary: Parse an XML file and generate the code.
docstring_tokens: Parse an XML file and generate the code .
function: def gen_file(filename):
      """ Parse an XML file and generate the code. """
  
      tree = et.parse(filename)
      root = tree.getroot()
  
      for incs in root.iter("includes"):
          for inc in incs.iter("include"):
              writeln("#include %s" % inc.get("file"))
  
      writeln("")
      writeln("namespace anki")
      writeln("{")
      writeln("")
  
      doxygen_group_el = root.find("doxygen_group")
      if doxygen_group_el is not None:
          doxygen_group = doxygen_group_el.get("name")
          writeln("/// @addtogroup %s" % doxygen_group)
          writeln("/// @{")
          writeln("")
  
      prefix_code = root.find("prefix_code")
      if prefix_code is not None:
          writeln("%s" % prefix_code.text)
  
      for cls in root.iter("classes"):
          for cl in cls.iter("class"):
              gen_class(cl)
  
      if doxygen_group_el is not None:
          writeln("/// @}")
          writeln("")
  
      writeln("} // end namespace anki")
function_tokens: def gen_file ( filename ) : tree = et . parse ( filename ) root = tree . getroot ( ) for incs in root . iter ( "includes" ) : for inc in incs . iter ( "include" ) : writeln ( "#include %s" % inc . get ( "file" ) ) writeln ( "" ) writeln ( "namespace anki" ) writeln ( "{" ) writeln ( "" ) doxygen_group_el = root . find ( "doxygen_group" ) if doxygen_group_el is not None : doxygen_group = doxygen_group_el . get ( "name" ) writeln ( "/// @addtogroup %s" % doxygen_group ) writeln ( "/// @{" ) writeln ( "" ) prefix_code = root . find ( "prefix_code" ) if prefix_code is not None : writeln ( "%s" % prefix_code . text ) for cls in root . iter ( "classes" ) : for cl in cls . iter ( "class" ) : gen_class ( cl ) if doxygen_group_el is not None : writeln ( "/// @}" ) writeln ( "" ) writeln ( "} // end namespace anki" )