pike.git / lib / modules / Tools.pmod / Standalone.pmod / autodoc_to_html.pike

version» Context lines:

pike.git/lib/modules/Tools.pmod/Standalone.pmod/autodoc_to_html.pike:344:    ret += parse_children(n, "enum", parse_enum, noheader);    ret += parse_children(n, "class", parse_class, noheader);    ret += parse_children(n, "module", parse_module, noheader);       if(header)    ret += "</dd></dl>";       return ret;   }    + ADT.Stack old_class_name = ADT.Stack();   string parse_class(Node n, void|int noheader) {    string ret ="";    if(!noheader)    ret += "<dl><dt>"    "<table width='100%' cellpadding='3' cellspacing='0' border='0'><tr>"    "<td bgcolor='#EEEEEE'><font size='+3'>&nbsp; CLASS <b><font color='#005080'>" +    n->get_attributes()->class_path + n->get_attributes()->name +    "</font></b></font></td></tr></table><br />\n"    "</dt><dd>";       Node c = n->get_first_element("doc"); -  +  old_class_name->push(class_name); +  class_name = n->get_attributes()->class_path+n->get_attributes()->name;    if(c)    ret += "<dl>" + parse_doc(c) + "</dl>";       if((sizeof(n->get_elements("doc"))>1) &&    ((flags & (Tools.AutoDoc.FLAG_KEEP_GOING|Tools.AutoDoc.FLAG_DEBUG)) ==    Tools.AutoDoc.FLAG_DEBUG)) {    error( "More than one doc element in class node.\n" );    }       ret += parse_children(n, "docgroup", parse_docgroup);    ret += parse_children(n, "enum", parse_enum);    ret += parse_children(n, "class", parse_class, noheader); -  +  ret += parse_children(n, "module", parse_module, noheader);       if(!noheader)    ret += "</dd></dl>"; -  +  class_name = old_class_name->pop();    return ret;   }      string parse_enum(Node n, void|int noheader) {    string ret ="";    if(!noheader)    ret += "<dl><dt>"    "<table width='100%' cellpadding='3' cellspacing='0' border='0'><tr>"    "<td bgcolor='#EEEEEE'><font size='+3'>&nbsp; ENUM <b><font color='#005080'>" +    n->get_attributes()->class_path + n->get_attributes()->name +
pike.git/lib/modules/Tools.pmod/Standalone.pmod/autodoc_to_html.pike:1151: Inside #if 0
   reverse(n->get_ancestors(0))->get_any_name());    }    return " (could not resolve) ";   #ifdef DEBUG    error( "Parent module is " + n->get_parent()->get_any_name() + ".\n" );   #else    return "";   #endif   }   #endif /* 0 */ + string class_name = "";    -  +    string parse_not_doc(Node n) {    string ret = "";    int method, argument, variable, const, typedf, cppdir;       if (!n) return "";       foreach(n->get_children(), Node c) {       if(c->get_node_type()!=XML_ELEMENT)    continue;
pike.git/lib/modules/Tools.pmod/Standalone.pmod/autodoc_to_html.pike:1179:    case "source-position":    position->update(c);    continue;       case "method":    if(method++) ret += "<br />\n";   #if 0    if(!c->get_first_element("returntype"))    error( "No returntype element in method element.\n" );   #endif -  switch( c->get_attributes()->name ) +  switch( string method = c->get_attributes()->name )    {    case "create": -  ret += "<tt>" + parse_type(get_first_element(c->get_first_element("returntype"))); // Check for more children +  ret += "<tt>" +class_name; // Check for more children    ret += " "; -  ret += c->get_attributes()->class_path+"<b>(</b>"; +  ret += class_name+"<b>(</b>";    ret += parse_not_doc( c->get_first_element("arguments") );    ret += "<b>)</b></tt>";    break; -  +  +  case "__hash": +  method = method[1..]; +  case "_random": +  case "_sizeof": +  case "_indices": +  case "_values": +  /* simple overload type lfuns. */ +  ret += "<tt>"; +  ret += parse_type(get_first_element(c->get_first_element("returntype"))); +  ret += " "; +  ret += "<b><font color='#000066'>"+method[1..]+"</font>(</b> "; +  ret += "<font color='#202020'>"+class_name+"</font> <font color='#f000f0'>arg</font>"; +  ret += " <b>)</b>"; +  break; +  +  case "_m_delete": +  case "_equal": +  case "_search": +  ret += "<tt>"; +  ret += parse_type(get_first_element(c->get_first_element("returntype"))); +  ret += " <b><font color='#000066'>"+method[1..]; +  ret += "</font>(</b>"+class_name+" <font color='#F000F0'>from</font>, "; +  ret += parse_not_doc( c->get_first_element("arguments") ); +  ret += "<b>)</b></tt>"; +  break; +  +  case "_sprintf": +  ret += "<tt>"; +  ret += "<font color='#202020'>string</font> "; +  ret += ("<b><font color='#000066'>sprintf</font>(" +  "</b><font color='#202020'>string</font> " +  "<font color='#F000F0'>format</font>, ... <font color='#202020'>" +  +class_name+"</font> <font color='#F000F0'>" +  "arg</font> ... <b>)</b>"); +  break; +     default:    ret += "<tt>";    cc = c->get_first_element("modifiers");    if(cc) ret += map(cc->get_children(), parse_type)*" " + " "; -  ret += parse_type(get_first_element(c->get_first_element("returntype"))); // Check for more children +  ret += parse_type(get_first_element(c->get_first_element("returntype")));    ret += " ";    ret += c->get_attributes()->class_path;    ret += "<b><font color='#000066'>" + c->get_attributes()->name + "</font>(</b>";    ret += parse_not_doc( c->get_first_element("arguments") );    ret += "<b>)</b></tt>";    break;    }    break;       case "argument":