KXStudio Website https://kx.studio/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

klonecpp.php 13KB

11 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <?php
  2. /*************************************************************************************
  3. * klonecpp.php
  4. * --------
  5. * Author: AUGER Mickael
  6. * Copyright: Synchronic
  7. * Release Version: 1.0.8.10
  8. * Date Started: 2008/04/16
  9. *
  10. * KLone with C++ language file for GeSHi.
  11. *
  12. * CHANGES
  13. * -------
  14. * 2008/04/16 (1.0.8)
  15. * - First Release
  16. *
  17. * TODO (updated 2008/04/16)
  18. * -------------------------
  19. * A tester et a completer si besoin
  20. *************************************************************************************
  21. *
  22. * This file is part of GeSHi.
  23. *
  24. * GeSHi is free software; you can redistribute it and/or modify
  25. * it under the terms of the GNU General Public License as published by
  26. * the Free Software Foundation; either version 2 of the License, or
  27. * (at your option) any later version.
  28. *
  29. * GeSHi is distributed in the hope that it will be useful,
  30. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  31. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  32. * GNU General Public License for more details.
  33. *
  34. * You should have received a copy of the GNU General Public License
  35. * along with GeSHi; if not, write to the Free Software
  36. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  37. *
  38. ************************************************************************************/
  39. $language_data = array (
  40. 'LANG_NAME' => 'KLone C++',
  41. 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),//#pour precede les include de C
  42. 'COMMENT_MULTI' => array('/*' => '*/', '<!--' => '-->' ),//comentaires C et KLone suivi de ceux pour HTML
  43. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  44. 'QUOTEMARKS' => array("'", '"'),
  45. 'ESCAPE_CHAR' => '\\',
  46. 'KEYWORDS' => array(
  47. 1 => array(//mots-cles C++
  48. 'if', 'return', 'while', 'case', 'continue', 'default',
  49. 'do', 'else', 'for', 'switch', 'goto',
  50. 'break', 'true', 'enum', 'extern', 'inline', 'false',
  51. 'errno', 'stdin', 'stdout', 'stderr',
  52. 'virtual', 'public', 'private', 'protected', 'template', 'using', 'namespace',
  53. 'try', 'catch', 'dynamic_cast', 'const_cast', 'reinterpret_cast',
  54. 'static_cast', 'explicit', 'friend', 'typename', 'typeid', 'class',
  55. 'EDOM', 'ERANGE', 'FLT_RADIX', 'FLT_ROUNDS', 'FLT_DIG', 'DBL_DIG', 'LDBL_DIG',
  56. 'FLT_EPSILON', 'DBL_EPSILON', 'LDBL_EPSILON', 'FLT_MANT_DIG', 'DBL_MANT_DIG',
  57. 'LDBL_MANT_DIG', 'FLT_MAX', 'DBL_MAX', 'LDBL_MAX', 'FLT_MAX_EXP', 'DBL_MAX_EXP',
  58. 'LDBL_MAX_EXP', 'FLT_MIN', 'DBL_MIN', 'LDBL_MIN', 'FLT_MIN_EXP', 'DBL_MIN_EXP',
  59. 'LDBL_MIN_EXP', 'CHAR_BIT', 'CHAR_MAX', 'CHAR_MIN', 'SCHAR_MAX', 'SCHAR_MIN',
  60. 'UCHAR_MAX', 'SHRT_MAX', 'SHRT_MIN', 'USHRT_MAX', 'INT_MAX', 'INT_MIN',
  61. 'UINT_MAX', 'LONG_MAX', 'LONG_MIN', 'ULONG_MAX', 'HUGE_VAL', 'SIGABRT',
  62. 'SIGFPE', 'SIGILL', 'SIGINT', 'SIGSEGV', 'SIGTERM', 'SIG_DFL', 'SIG_ERR',
  63. 'SIG_IGN', 'BUFSIZ', 'EOF', 'FILENAME_MAX', 'FOPEN_MAX', 'L_tmpnam', 'NULL',
  64. 'SEEK_CUR', 'SEEK_END', 'SEEK_SET', 'TMP_MAX',
  65. 'EXIT_FAILURE', 'EXIT_SUCCESS', 'RAND_MAX', 'CLOCKS_PER_SEC'
  66. ),
  67. 2 => array(//mots-cles KLone
  68. 'out', 'request', 'response',
  69. ),
  70. 3 => array(//fonctions C++ usuelles
  71. 'cin', 'cerr', 'clog', 'cout', 'delete', 'new', 'this',
  72. 'printf', 'fprintf', 'snprintf', 'sprintf', 'assert',
  73. 'isalnum', 'isalpha', 'isdigit', 'iscntrl', 'isgraph', 'islower', 'isprint',
  74. 'ispunct', 'isspace', 'isupper', 'isxdigit', 'tolower', 'toupper',
  75. 'exp', 'log', 'log10', 'pow', 'sqrt', 'ceil', 'floor', 'fabs', 'ldexp',
  76. 'frexp', 'modf', 'fmod', 'sin', 'cos', 'tan', 'asin', 'acos', 'atan', 'atan2',
  77. 'sinh', 'cosh', 'tanh', 'setjmp', 'longjmp',
  78. 'va_start', 'va_arg', 'va_end', 'offsetof', 'sizeof', 'fopen', 'freopen',
  79. 'fflush', 'fclose', 'remove', 'rename', 'tmpfile', 'tmpname', 'setvbuf',
  80. 'setbuf', 'vfprintf', 'vprintf', 'vsprintf', 'fscanf', 'scanf', 'sscanf',
  81. 'fgetc', 'fgets', 'fputc', 'fputs', 'getc', 'getchar', 'gets', 'putc',
  82. 'putchar', 'puts', 'ungetc', 'fread', 'fwrite', 'fseek', 'ftell', 'rewind',
  83. 'fgetpos', 'fsetpos', 'clearerr', 'feof', 'ferror', 'perror', 'abs', 'labs',
  84. 'div', 'ldiv', 'atof', 'atoi', 'atol', 'strtod', 'strtol', 'strtoul', 'calloc',
  85. 'malloc', 'realloc', 'free', 'abort', 'exit', 'atexit', 'system', 'getenv',
  86. 'bsearch', 'qsort', 'rand', 'srand', 'strcpy', 'strncpy', 'strcat', 'strncat',
  87. 'strcmp', 'strncmp', 'strcoll', 'strchr', 'strrchr', 'strspn', 'strcspn',
  88. 'strpbrk', 'strstr', 'strlen', 'strerror', 'strtok', 'strxfrm', 'memcpy',
  89. 'memmove', 'memcmp', 'memchr', 'memset', 'clock', 'time', 'difftime', 'mktime',
  90. 'asctime', 'ctime', 'gmtime', 'localtime', 'strftime'
  91. ),
  92. 4 => array(//fonctions KLone usuelles
  93. 'request_get_cookies', 'request_get_cookie', 'request_get_args', 'request_get_arg',
  94. 'request_io', 'request_get_uri', 'request_get_filename', 'request_get_query_string', 'request_get_path_info',
  95. 'request_get_if_modified_since', 'request_get_http', 'request_get_client_request',
  96. 'request_get_content_length', 'request_get_uploads', 'request_get_uploaded_file',
  97. 'request_get_method', 'request_get_protocol', 'request_get_resolved_filename',
  98. 'request_get_resolved_path_info', 'request_get_addr', 'request_get_peer_addr',
  99. 'request_get_header', 'request_get_field', 'request_get_field_value',
  100. 'response_set_content_encoding', 'response_disable_caching', 'response_enable_caching',
  101. 'response_set_cookie', 'response_set_method', 'response_get_method',
  102. 'response_print_header', 'response_set_field', 'response_del_field',
  103. 'response_set_content_type', 'response_set_date', 'response_set_last_modified',
  104. 'response_set_content_length', 'response_get_status', 'response_get_header',
  105. 'response_io', 'response_redirect', 'response_set_status',
  106. 'session_get_vars', 'session_get', 'session_set', 'session_age', 'session_clean', 'session_del',
  107. 'io_type', 'io_pipe', 'io_dup', 'io_copy', 'io_seek', 'io_tell', 'io_close',
  108. 'io_free', 'io_read', 'io_printf', 'io_flush', 'io_write', 'io_putc', 'io_getc',
  109. 'io_get_until', 'io_gets', 'io_codec_add_head', 'io_codec_add_tail',
  110. 'io_codecs_remove', 'io_name_set', 'io_name_get'
  111. ),
  112. 5 => array(//types C++
  113. 'auto', 'bool', 'char', 'const', 'double', 'float', 'int', 'long', 'longint',
  114. 'register', 'short', 'shortint', 'signed', 'static', 'struct',
  115. 'typedef', 'union', 'unsigned', 'void', 'volatile', 'jmp_buf',
  116. 'signal', 'raise', 'va_list', 'ptrdiff_t', 'size_t', 'FILE', 'fpos_t',
  117. 'div_t', 'ldiv_t', 'clock_t', 'time_t', 'tm',
  118. 'string', 'wchar_t'
  119. ),
  120. 6 => array(//mots-cles HTML
  121. 'a', 'abbr', 'acronym', 'address', 'applet',
  122. 'base', 'basefont', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'b',
  123. 'caption', 'center', 'cite', 'code', 'colgroup', 'col',
  124. 'dd', 'del', 'dfn', 'dir', 'div', 'dl', 'dt',
  125. 'em',
  126. 'fieldset', 'font', 'form', 'frame', 'frameset',
  127. 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'html',
  128. 'iframe', 'ilayer', 'img', 'input', 'ins', 'isindex', 'i',
  129. 'kbd',
  130. 'label', 'legend', 'link', 'li',
  131. 'map', 'meta',
  132. 'noframes', 'noscript',
  133. 'object', 'ol', 'optgroup', 'option',
  134. 'param', 'pre', 'p',
  135. 'q',
  136. 'samp', 'script', 'select', 'small', 'span', 'strike', 'strong', 'style', 'sub', 'sup', 's',
  137. 'table', 'tbody', 'td', 'textarea', 'text', 'tfoot', 'thead', 'th', 'title', 'tr', 'tt',
  138. 'ul', 'u',
  139. 'var',
  140. ),
  141. 7 => array(//autres mots-cles HTML
  142. 'abbr', 'accept-charset', 'accept', 'accesskey', 'action', 'align', 'alink', 'alt', 'archive', 'axis',
  143. 'background', 'bgcolor', 'border',
  144. 'cellpadding', 'cellspacing', 'char', 'charoff', 'charset', 'checked', 'cite', 'class', 'classid', 'clear', 'code', 'codebase', 'codetype', 'color', 'cols', 'colspan', 'compact', 'content', 'coords',
  145. 'data', 'datetime', 'declare', 'defer', 'dir', 'disabled',
  146. 'enctype',
  147. 'face', 'for', 'frame', 'frameborder',
  148. 'headers', 'height', 'href', 'hreflang', 'hspace', 'http-equiv',
  149. 'id', 'ismap',
  150. 'label', 'lang', 'language', 'link', 'longdesc',
  151. 'marginheight', 'marginwidth', 'maxlength', 'media', 'method', 'multiple',
  152. 'name', 'nohref', 'noresize', 'noshade', 'nowrap',
  153. 'object', 'onblur', 'onchange', 'onclick', 'ondblclick', 'onfocus', 'onkeydown', 'onkeypress', 'onkeyup', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onreset', 'onselect', 'onsubmit', 'onunload',
  154. 'profile', 'prompt',
  155. 'readonly', 'rel', 'rev', 'rowspan', 'rows', 'rules',
  156. 'scheme', 'scope', 'scrolling', 'selected', 'shape', 'size', 'span', 'src', 'standby', 'start', 'style', 'summary',
  157. 'tabindex', 'target', 'text', 'title', 'type',
  158. 'usemap',
  159. 'valign', 'value', 'valuetype', 'version', 'vlink', 'vspace',
  160. 'width'
  161. )
  162. ),
  163. 'SYMBOLS' => array(
  164. 1 => array(
  165. '<%=', '<%!', '<%', '%>'
  166. ),
  167. 0 => array(
  168. '(', ')', '[', ']', '{', '}',
  169. '!', '%', '&', '|', '/',
  170. '<', '>',
  171. '=', '-', '+', '*',
  172. '.', ':', ',', ';', '^'
  173. )
  174. ),
  175. 'CASE_SENSITIVE' => array(
  176. GESHI_COMMENTS => false,
  177. 1 => false,
  178. 2 => false,
  179. 3 => false,
  180. 4 => false,
  181. 5 => false,
  182. 6 => false,
  183. 7 => false
  184. ),
  185. 'STYLES' => array(
  186. 'KEYWORDS' => array(
  187. 1 => 'color: #b1b100; font-weight: bold;',//pour les mots-cles C++
  188. 2 => 'color: #000000; font-weight: bold;',//pour les mots-cles KLone
  189. 3 => 'color: #6600FF;',//pour les fonctions C++
  190. 4 => 'color: #6600FF;',//pour les fonctions Klone
  191. 5 => 'color: #0099FF; font-weight: bold;',//pour les types C++
  192. 6 => 'color: #990099; font-weight: bold;',//pour les mots-cles HTML
  193. 7 => 'color: #000066;'//pour les autres mots-cles HTML
  194. ),
  195. 'COMMENTS' => array(
  196. 1 => 'color: #808080; font-style: italic;',//commentaire sur une ligne C++ et KLone
  197. 2 => 'color: #339933;',//pour les #... en C++
  198. 'MULTI' => 'color: #808080; font-style: italic;'//commentaire sur plusieurs lignes C++ et KLone
  199. ),
  200. 'ESCAPE_CHAR' => array(
  201. 0 => 'color: #000099; font-weight: bold;'
  202. ),
  203. 'BRACKETS' => array(
  204. 0 => 'color: #000000;'
  205. ),
  206. 'STRINGS' => array(
  207. 0 => 'color: #ff0000;'
  208. ),
  209. 'NUMBERS' => array(
  210. 0 => 'color: #cc66cc;'
  211. ),
  212. 'METHODS' => array(
  213. 1 => 'color: #006600;',
  214. 2 => 'color: #006600;'
  215. ),
  216. 'SYMBOLS' => array(
  217. 0 => 'color: #000000;',
  218. 1 => 'color: #000000; font-weight: bold;'
  219. ),
  220. 'REGEXPS' => array(),
  221. 'SCRIPT' => array(
  222. 0 => 'background-color:#ffccff; font-weight: bold; color:#000000;',
  223. 1 => '',
  224. 2 => '',
  225. 3 => 'color: #00bbdd; font-weight: bold;',
  226. 4 => 'color: #ddbb00;',
  227. 5 => 'color: #009900;'
  228. )
  229. ),
  230. 'URLS' => array(
  231. 1 => '',
  232. 2 => '',
  233. 3 => 'http://www.opengroup.org/onlinepubs/009695399/functions/{FNAMEL}.html',
  234. 4 => 'http://www.koanlogic.com/klone/api/html/globals.html',
  235. 5 => '',
  236. 6 => 'http://december.com/html/4/element/{FNAMEL}.html',
  237. 7 => ''
  238. ),
  239. 'OOLANG' => true,
  240. 'OBJECT_SPLITTERS' => array(
  241. 1 => '.',
  242. 2 => '::'
  243. ),
  244. 'REGEXPS' => array(
  245. ),
  246. 'STRICT_MODE_APPLIES' => GESHI_ALWAYS,
  247. 'SCRIPT_DELIMITERS' => array(
  248. //delimiteurs pour KLone
  249. 0 => array(
  250. '<%=' => '%>'
  251. ),
  252. 1 => array(
  253. '<%!' => '%>'
  254. ),
  255. 2 => array(
  256. '<%' => '%>'
  257. ),
  258. //delimiteur pour HTML
  259. 3 => array(
  260. '<!DOCTYPE' => '>'
  261. ),
  262. 4 => array(
  263. '&' => ';'
  264. ),
  265. 5 => array(
  266. '<' => '>'
  267. )
  268. ),
  269. 'HIGHLIGHT_STRICT_BLOCK' => array(
  270. 0 => false,
  271. 1 => true,
  272. 2 => true,
  273. 3 => false,
  274. 4 => false,
  275. 5 => true
  276. ),
  277. 'TAB_WIDTH' => 4,
  278. 'PARSER_CONTROL' => array(
  279. 'KEYWORDS' => array(
  280. 6 => array(
  281. 'DISALLOWED_BEFORE' => '(?<=&lt;|&lt;\/)',
  282. 'DISALLOWED_AFTER' => '(?=\s|\/|&gt;)',
  283. ),
  284. 7 => array(
  285. 'DISALLOWED_AFTER' => '(?=\s*=)',
  286. )
  287. )
  288. )
  289. );
  290. ?>