{
    "mode": "ri",
    "parameter": "RDoc::Parser::C",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/ri/RDoc%3A%3AParser%3A%3AC/json",
    "generated": "2026-06-02T16:17:12Z",
    "sections": {
        "RDoc::Parser::C < RDoc::Parser": {
            "content": "------------------------------------------------------------------------",
            "subsections": []
        },
        "Includes:": {
            "content": "RDoc::Text (from gem rdoc-7.2.0)\n\n------------------------------------------------------------------------",
            "subsections": []
        },
        "Extended by:": {
            "content": "TSort (from gem rdoc-7.2.0)\n\n(from gem rdoc-7.2.0)\n------------------------------------------------------------------------\nRDoc::Parser::C attempts to parse C extension files.  It looks for the\nstandard patterns that you find in extensions: rbdefineclass,\nrbdefinemethod and so on.  It tries to find the corresponding C source\nfor the methods and extract comments, but if we fail we don't worry too\nmuch.\n\nThe comments associated with a Ruby method are extracted from the C\ncomment block associated with the routine that\nimplements that method, that is to say the method\nwhose name is given in the rbdefinemethod call. For example, you might\nwrite:\n\n/*\n* Returns a new array that is a one-dimensional flattening of this\n* array (recursively). That is, for every element that is an array,\n* extract its elements into the new array.\n*\n*    s = [ 1, 2, 3 ]           #=> [1, 2, 3]\n*    t = [ 4, 5, 6, [7, 8] ]   #=> [4, 5, 6, [7, 8]]\n*    a = [ s, t, 9, 10 ]       #=> [[1, 2, 3], [4, 5, 6, [7, 8]], 9, 10]\n*    a.flatten                 #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n*/\nstatic VALUE\nrbaryflatten(VALUE ary)\n{\nary = rbobjdup(ary);\nrbaryflattenbang(ary);\nreturn ary;\n}\n\n...\n\nvoid\nInitArray(void)\n{\n...\nrbdefinemethod(rbcArray, \"flatten\", rbaryflatten, 0);\n\nHere RDoc will determine from the rbdefinemethod line that there's a\nmethod called \"flatten\" in class Array, and will look for the\nimplementation in the method rbaryflatten. It will then use the\ncomment from that method in the HTML output. This method must be in the\nsame source file as the rbdefinemethod.\n\nThe comment blocks may include special directives:\n\nDocument-class: name:\nDocumentation for the named class.\n\n\nDocument-module: name:\nDocumentation for the named module.\n\n\nDocument-const: name:\nDocumentation for the named rbdefineconst.\n\nConstant values can be supplied on the first line of the comment like\nso:\n\n/* 300: The highest possible score in bowling */\nrbdefineconst(cFoo, \"PERFECT\", INT2FIX(300));\n\nThe value can contain internal colons so long as they are escaped with\na \\\n\n\nDocument-global: name:\nDocumentation for the named rbdefineglobalconst\n\n\nDocument-variable: name:\nDocumentation for the named rbdefinevariable\n\n\nDocument-method: methodname:\nDocumentation for the named method.  Use this when the method name is\nunambiguous.\n\n\nDocument-method: ClassName::methodname:\nDocumentation for a singleton method in the given class.  Use this\nwhen the method name alone is ambiguous.\n\n\nDocument-method: ClassName#methodname:\nDocumentation for a instance method in the given class.  Use this when\nthe method name alone is ambiguous.\n\n\nDocument-attr: name:\nDocumentation for the named attribute.\n\n\ncall-seq:  text up to an empty line:\nBecause C source doesn't give descriptive names to Ruby-level\nparameters, you need to document the calling sequence explicitly\n\n\nIn addition, RDoc assumes by default that the C method implementing a\nRuby function is in the same source file as the rbdefinemethod call.\nIf this isn't the case, add the comment:\n\nrbdefinemethod(....);  // in filename\n\nAs an example, we might have an extension that defines multiple classes\nin its Initxxx method. We could document them using\n\n/*\n* Document-class:  MyClass\n*\n* Encapsulate the writing and reading of the configuration\n* file. ...\n*/\n\n/*\n* Document-method: readvalue\n*\n* call-seq:\n*   cfg.readvalue(key)            -> value\n*   cfg.readvalue(key} { |key| }  -> value\n*\n* Return the value corresponding to +key+ from the configuration.\n* In the second form, if the key isn't found, invoke the\n* block and return its value.\n*/\n------------------------------------------------------------------------",
            "subsections": []
        },
        "Class methods:": {
            "content": "new\n",
            "subsections": []
        },
        "Instance methods:": {
            "content": "addalias\nclasses\ncontent\ndoaliases\ndoattrs\ndobootdefclass\ndoclassesandmodules\ndoconstants\ndoincludes\ndomethods\ndomissing\nenclosuredependencies\nfindaliascomment\nfindattrcomment\nfindbody\nfindclass\nfindclasscomment\nfindconstcomment\nfindmodifiers\nfindoverridecomment\ngenbodytable\ngenconsttable\nhandleattr\nhandleclassmodule\nhandleconstants\nhandleifdefsin\nhandlemethod\nhandlesingleton\nknownclasses\nloadvariablemap\nlookfordirectivesin\nmissingdependencies\nnewcomment\nrbscanargs\nremovecommentedoutlines\nscan\nsingletonclasses\ntoplevel\n",
            "subsections": []
        },
        "Attributes:": {
            "content": "attraccessor content\nattrreader classes\nattrreader enclosuredependencies\nattrreader knownclasses\nattrreader missingdependencies\nattrreader singletonclasses\nattrreader toplevel\n",
            "subsections": []
        }
    },
    "flags": [],
    "examples": [],
    "see_also": []
}