1 /* ----------------------------------------------------------------------------- 2 * This file is part of SWIG, which is licensed as a whole under version 3 3 * (or any later version) of the GNU General Public License. Some additional 4 * terms also apply to certain portions of SWIG. The full details of the SWIG 5 * license and copyrights can be found in the LICENSE and COPYRIGHT files 6 * included with the SWIG source code as distributed by the SWIG developers 7 * and at http://www.swig.org/legal.html. 8 * 9 * doxycommands.h 10 * 11 * Part of the Doxygen comment translation module of SWIG. 12 * ----------------------------------------------------------------------------- */ 13 14 #ifndef DOXYGENCOMMANDS_H 15 #define DOXYGENCOMMANDS_H 16 17 // doxy commands are not processed inside this block 18 const char *CMD_HTML_ONLY = "htmlonly"; 19 // doxy commands are not processed inside this block 20 const char *CMD_VERBATIM = "verbatim"; 21 const char *CMD_CODE = "code"; 22 const char *CMD_LATEX_1 = "f$"; 23 const char *CMD_LATEX_2 = "f{"; 24 const char *CMD_LATEX_3 = "f["; 25 const char *CMD_END_HTML_ONLY = "endhtmlonly"; 26 const char *CMD_END_VERBATIM = "endverbatim"; 27 const char *CMD_END_CODE = "endcode"; 28 const char *CMD_END_LATEX_1 = "f$"; 29 const char *CMD_END_LATEX_2 = "f}"; 30 const char *CMD_END_LATEX_3 = "f]"; 31 32 const char *sectionIndicators[] = { 33 "attention", "author", "authors", "brief", "bug", "cond", "date", 34 "deprecated", "details", "else", "elseif", "endcond", "endif", 35 "exception", "if", "ifnot", "invariant", "note", "par", "param", 36 "tparam", "post", "pre", "remarks", "remark", "result", "return", 37 "returns", "retval", "sa", "see", "since", "test", "throw", "throws", 38 "todo", "version", "warning", "xrefitem" 39 }; 40 41 const int sectionIndicatorsSize = sizeof(sectionIndicators) / sizeof(*sectionIndicators); 42 43 /* All of the doxygen commands divided up by how they are parsed */ 44 const char *simpleCommands[] = { 45 // the first line are escaped chars, except \~, which is a language ID command. 46 "n", "$", "@", "\\", "&", "~", "<", ">", "#", "%", "\"", ".", "::", 47 "endcond", 48 "callgraph", "callergraph", "showinitializer", "hideinitializer", "internal", 49 "nosubgrouping", "public", "publicsection", "private", "privatesection", 50 "protected", "protectedsection", "tableofcontents" 51 }; 52 53 const int simpleCommandsSize = sizeof(simpleCommands) / sizeof(*simpleCommands); 54 55 const char *commandWords[] = { 56 "a", "b", "c", "e", "em", "p", "def", "enum", "package", "relates", 57 "namespace", "relatesalso", "anchor", "dontinclude", "include", 58 "includelineno", "copydoc", "copybrief", "copydetails", "verbinclude", 59 "htmlinclude", "extends", "implements", "memberof", "related", "relatedalso", 60 "cite" 61 }; 62 63 const int commandWordsSize = sizeof(commandWords) / sizeof(*commandWords); 64 65 const char *commandLines[] = { 66 "addindex", "fn", "name", "line", "var", "skipline", "typedef", "skip", 67 "until", "property" 68 }; 69 70 const int commandLinesSize = sizeof(commandLines) / sizeof(*commandLines); 71 72 const char *commandParagraph[] = { 73 "partofdescription", "result", "return", "returns", "remarks", "remark", 74 "since", "test", "sa", "see", "pre", "post", "details", "invariant", 75 "deprecated", "date", "note", "warning", "version", "todo", "bug", 76 "attention", "brief", "author", "authors", "copyright", "short" 77 }; 78 79 const int commandParagraphSize = sizeof(commandParagraph) / sizeof(*commandParagraph); 80 81 const char *commandEndCommands[] = { 82 CMD_HTML_ONLY, "latexonly", "manonly", "xmlonly", "link", "rtfonly" 83 }; 84 85 const int commandEndCommandsSize = sizeof(commandEndCommands) / sizeof(*commandEndCommands); 86 87 const char *commandWordParagraphs[] = { 88 "param", "tparam", "throw", "throws", "retval", "exception", "example" 89 }; 90 91 const int commandWordParagraphsSize = sizeof(commandWordParagraphs) / sizeof(*commandWordParagraphs); 92 93 const char *commandWordLines[] = { 94 "page", "subsection", "subsubsection", "section", "paragraph", "defgroup", 95 "snippet", "mainpage" 96 }; 97 98 const int commandWordLinesSize = sizeof(commandWordLines) / sizeof(*commandWordLines); 99 100 const char *commandWordOWordOWords[] = { 101 "category", "class", "protocol", "interface", "struct", "union" 102 }; 103 104 const int commandWordOWordOWordsSize = sizeof(commandWordOWordOWords) / sizeof(*commandWordOWordOWords); 105 106 const char *commandOWords[] = { 107 "dir", "file", "cond" 108 }; 109 110 const int commandOWordsSize = sizeof(commandOWords) / sizeof(*commandOWords); 111 112 const char *commandErrorThrowings[] = { 113 "annotatedclassstd::list", "classhierarchy", "define", "functionindex", "header", 114 "headerfilestd::list", "inherit", "l", "postheader", "endcode", "enddot", "endmsc", "endhtmlonly", 115 "endlatexonly", "endmanonly", "endlink", "endverbatim", "endxmlonly", "f]", "f}", "endif", "else", 116 "endrtfonly" 117 }; 118 119 const int commandErrorThrowingsSize = sizeof(commandErrorThrowings) / sizeof(*commandErrorThrowings); 120 121 const char *commandUniques[] = { 122 "xrefitem", "arg", "ingroup", "par", "headerfile", "overload", "weakgroup", "ref", "subpage", "dotfile", "image", "addtogroup", "li", 123 "if", "ifnot", "elseif", "else", "mscfile", "code", CMD_VERBATIM, "f{", "f[", "f$", "dot", "msc" 124 }; 125 126 const int commandUniquesSize = sizeof(commandUniques) / sizeof(*commandUniques); 127 128 // These HTML commands are transformed when producing output in other formats. 129 // Other commands are left intact, but '<' and '> are replaced with entities in HTML 130 // output. So <varName> appears as <varName> in HTML output. The same 131 // behavior must be repeated by SWIG. See Doxygen doc for the list of commands. 132 // '<' is prepended to distinguish HTML tags from Doxygen commands. 133 const char *commandHtml[] = { 134 "<a", "<b", "<blockquote", "<body", "<br", "<center", "<caption", "<code", "<dd", "<dfn", 135 "<div", "<dl", "<dt", "<em", "<form", "<hr", "<h1", "<h2", "<h3", "<i", "<input", "<img", 136 "<li", "<meta", "<multicol", "<ol", "<p", "<pre", "<small", "<span", "<strong", 137 "<sub", "<sup", "<table", "<td", "<th", "<tr", "<tt", "<kbd", "<ul", "<var" 138 }; 139 140 const int commandHtmlSize = sizeof(commandHtml) / sizeof(*commandHtml); 141 142 // Only entities which are translatable to plain text are used here. Others 143 // are copied unchanged to output. 144 const char *commandHtmlEntities[] = { 145 "©", // (C) 146 "&trade", // (TM) 147 "®", // (R) 148 "<", // less-than symbol 149 ">", // greater-than symbol 150 "&", // ampersand 151 "&apos", // single quotation mark (straight) 152 """, // double quotation mark (straight) 153 "&lsquo", // left single quotation mark 154 "&rsquo", // right single quotation mark 155 "&ldquo", // left double quotation mark 156 "&rdquo", // right double quotation mark 157 "&ndash", // n-dash (for numeric ranges, e.g. 2–8) 158 "&mdash", // -- 159 " ", // 160 "×", // x 161 "&minus", // - 162 "&sdot", // . 163 "&sim", // ~ 164 "&le", // <= 165 "&ge", // >= 166 "&larr", // <-- 167 "&rarr" // --> 168 }; 169 170 const int commandHtmlEntitiesSize = sizeof(commandHtmlEntities) / sizeof(*commandHtmlEntities); 171 172 #endif 173