2 /*************************************************************************************
5 * Author: AUGER Mickael
6 * Copyright: Synchronic
7 * Release Version: 1.0.8.4
8 * Date Started: 2008/04/16
10 * KLone with C++ language file for GeSHi.
17 * TODO (updated 2008/04/16)
18 * -------------------------
19 * A tester et a completer si besoin
20 *************************************************************************************
22 * This file is part of GeSHi.
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.
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.
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
38 ************************************************************************************/
40 $language_data = array (
41 'LANG_NAME' => 'KLone C++',
42 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),//#pour precede les include de C
43 'COMMENT_MULTI' => array('/*' => '*/', '<!--' => '-->' ),//comentaires C et KLone suivi de ceux pour HTML
44 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE
,
45 'QUOTEMARKS' => array("'", '"'),
46 'ESCAPE_CHAR' => '\\',
48 1 => array(//mots-cles C++
49 'if', 'return', 'while', 'case', 'continue', 'default',
50 'do', 'else', 'for', 'switch', 'goto',
51 'break', 'true', 'enum', 'extern', 'inline', 'false',
52 'errno', 'stdin', 'stdout', 'stderr',
53 'virtual', 'public', 'private', 'protected', 'template', 'using', 'namespace',
54 'try', 'catch', 'dynamic_cast', 'const_cast', 'reinterpret_cast',
55 'static_cast', 'explicit', 'friend', 'typename', 'typeid', 'class',
56 'EDOM', 'ERANGE', 'FLT_RADIX', 'FLT_ROUNDS', 'FLT_DIG', 'DBL_DIG', 'LDBL_DIG',
57 'FLT_EPSILON', 'DBL_EPSILON', 'LDBL_EPSILON', 'FLT_MANT_DIG', 'DBL_MANT_DIG',
58 'LDBL_MANT_DIG', 'FLT_MAX', 'DBL_MAX', 'LDBL_MAX', 'FLT_MAX_EXP', 'DBL_MAX_EXP',
59 'LDBL_MAX_EXP', 'FLT_MIN', 'DBL_MIN', 'LDBL_MIN', 'FLT_MIN_EXP', 'DBL_MIN_EXP',
60 'LDBL_MIN_EXP', 'CHAR_BIT', 'CHAR_MAX', 'CHAR_MIN', 'SCHAR_MAX', 'SCHAR_MIN',
61 'UCHAR_MAX', 'SHRT_MAX', 'SHRT_MIN', 'USHRT_MAX', 'INT_MAX', 'INT_MIN',
62 'UINT_MAX', 'LONG_MAX', 'LONG_MIN', 'ULONG_MAX', 'HUGE_VAL', 'SIGABRT',
63 'SIGFPE', 'SIGILL', 'SIGINT', 'SIGSEGV', 'SIGTERM', 'SIG_DFL', 'SIG_ERR',
64 'SIG_IGN', 'BUFSIZ', 'EOF', 'FILENAME_MAX', 'FOPEN_MAX', 'L_tmpnam', 'NULL',
65 'SEEK_CUR', 'SEEK_END', 'SEEK_SET', 'TMP_MAX',
66 'EXIT_FAILURE', 'EXIT_SUCCESS', 'RAND_MAX', 'CLOCKS_PER_SEC'
68 2 => array(//mots-cles KLone
69 'out', 'request', 'response',
71 3 => array(//fonctions C++ usuelles
72 'cin', 'cerr', 'clog', 'cout', 'delete', 'new', 'this',
73 'printf', 'fprintf', 'snprintf', 'sprintf', 'assert',
74 'isalnum', 'isalpha', 'isdigit', 'iscntrl', 'isgraph', 'islower', 'isprint',
75 'ispunct', 'isspace', 'isupper', 'isxdigit', 'tolower', 'toupper',
76 'exp', 'log', 'log10', 'pow', 'sqrt', 'ceil', 'floor', 'fabs', 'ldexp',
77 'frexp', 'modf', 'fmod', 'sin', 'cos', 'tan', 'asin', 'acos', 'atan', 'atan2',
78 'sinh', 'cosh', 'tanh', 'setjmp', 'longjmp',
79 'va_start', 'va_arg', 'va_end', 'offsetof', 'sizeof', 'fopen', 'freopen',
80 'fflush', 'fclose', 'remove', 'rename', 'tmpfile', 'tmpname', 'setvbuf',
81 'setbuf', 'vfprintf', 'vprintf', 'vsprintf', 'fscanf', 'scanf', 'sscanf',
82 'fgetc', 'fgets', 'fputc', 'fputs', 'getc', 'getchar', 'gets', 'putc',
83 'putchar', 'puts', 'ungetc', 'fread', 'fwrite', 'fseek', 'ftell', 'rewind',
84 'fgetpos', 'fsetpos', 'clearerr', 'feof', 'ferror', 'perror', 'abs', 'labs',
85 'div', 'ldiv', 'atof', 'atoi', 'atol', 'strtod', 'strtol', 'strtoul', 'calloc',
86 'malloc', 'realloc', 'free', 'abort', 'exit', 'atexit', 'system', 'getenv',
87 'bsearch', 'qsort', 'rand', 'srand', 'strcpy', 'strncpy', 'strcat', 'strncat',
88 'strcmp', 'strncmp', 'strcoll', 'strchr', 'strrchr', 'strspn', 'strcspn',
89 'strpbrk', 'strstr', 'strlen', 'strerror', 'strtok', 'strxfrm', 'memcpy',
90 'memmove', 'memcmp', 'memchr', 'memset', 'clock', 'time', 'difftime', 'mktime',
91 'asctime', 'ctime', 'gmtime', 'localtime', 'strftime'
93 4 => array(//fonctions KLone usuelles
94 'request_get_cookies', 'request_get_cookie', 'request_get_args', 'request_get_arg',
95 'request_io', 'request_get_uri', 'request_get_filename', 'request_get_query_string', 'request_get_path_info',
96 'request_get_if_modified_since', 'request_get_http', 'request_get_client_request',
97 'request_get_content_length', 'request_get_uploads', 'request_get_uploaded_file',
98 'request_get_method', 'request_get_protocol', 'request_get_resolved_filename',
99 'request_get_resolved_path_info', 'request_get_addr', 'request_get_peer_addr',
100 'request_get_header', 'request_get_field', 'request_get_field_value',
101 'response_set_content_encoding', 'response_disable_caching', 'response_enable_caching',
102 'response_set_cookie', 'response_set_method', 'response_get_method',
103 'response_print_header', 'response_set_field', 'response_del_field',
104 'response_set_content_type', 'response_set_date', 'response_set_last_modified',
105 'response_set_content_length', 'response_get_status', 'response_get_header',
106 'response_io', 'response_redirect', 'response_set_status',
107 'session_get_vars', 'session_get', 'session_set', 'session_age', 'session_clean', 'session_del',
108 'io_type', 'io_pipe', 'io_dup', 'io_copy', 'io_seek', 'io_tell', 'io_close',
109 'io_free', 'io_read', 'io_printf', 'io_flush', 'io_write', 'io_putc', 'io_getc',
110 'io_get_until', 'io_gets', 'io_codec_add_head', 'io_codec_add_tail',
111 'io_codecs_remove', 'io_name_set', 'io_name_get'
113 5 => array(//types C++
114 'auto', 'bool', 'char', 'const', 'double', 'float', 'int', 'long', 'longint',
115 'register', 'short', 'shortint', 'signed', 'static', 'struct',
116 'typedef', 'union', 'unsigned', 'void', 'volatile', 'jmp_buf',
117 'signal', 'raise', 'va_list', 'ptrdiff_t', 'size_t', 'FILE', 'fpos_t',
118 'div_t', 'ldiv_t', 'clock_t', 'time_t', 'tm',
121 6 => array(//mots-cles HTML
122 'a', 'abbr', 'acronym', 'address', 'applet',
124 'base', 'basefont', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'b',
126 'caption', 'center', 'cite', 'code', 'colgroup', 'col',
128 'dd', 'del', 'dfn', 'dir', 'div', 'dl', 'dt',
132 'fieldset', 'font', 'form', 'frame', 'frameset',
134 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'html',
136 'iframe', 'ilayer', 'img', 'input', 'ins', 'isindex', 'i',
140 'label', 'legend', 'link', 'li',
144 'noframes', 'noscript',
146 'object', 'ol', 'optgroup', 'option',
152 'samp', 'script', 'select', 'small', 'span', 'strike', 'strong', 'style', 'sub', 'sup', 's',
154 'table', 'tbody', 'td', 'textarea', 'text', 'tfoot', 'thead', 'th', 'title', 'tr', 'tt',
160 7 => array(//autres mots-cles HTML
161 'abbr', 'accept-charset', 'accept', 'accesskey', 'action', 'align', 'alink', 'alt', 'archive', 'axis',
162 'background', 'bgcolor', 'border',
163 'cellpadding', 'cellspacing', 'char', 'charoff', 'charset', 'checked', 'cite', 'class', 'classid', 'clear', 'code', 'codebase', 'codetype', 'color', 'cols', 'colspan', 'compact', 'content', 'coords',
164 'data', 'datetime', 'declare', 'defer', 'dir', 'disabled',
166 'face', 'for', 'frame', 'frameborder',
167 'headers', 'height', 'href', 'hreflang', 'hspace', 'http-equiv',
169 'label', 'lang', 'language', 'link', 'longdesc',
170 'marginheight', 'marginwidth', 'maxlength', 'media', 'method', 'multiple',
171 'name', 'nohref', 'noresize', 'noshade', 'nowrap',
172 'object', 'onblur', 'onchange', 'onclick', 'ondblclick', 'onfocus', 'onkeydown', 'onkeypress', 'onkeyup', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onreset', 'onselect', 'onsubmit', 'onunload',
174 'readonly', 'rel', 'rev', 'rowspan', 'rows', 'rules',
175 'scheme', 'scope', 'scrolling', 'selected', 'shape', 'size', 'span', 'src', 'standby', 'start', 'style', 'summary',
176 'tabindex', 'target', 'text', 'title', 'type',
178 'valign', 'value', 'valuetype', 'version', 'vlink', 'vspace',
184 '<%=', '<%!', '<%', '%>'
187 '(', ')', '[', ']', '{', '}',
188 '!', '%', '&', '|', '/',
191 '.', ':', ',', ';', '^'
194 'CASE_SENSITIVE' => array(
195 GESHI_COMMENTS
=> false,
206 1 => 'color: #b1b100; font-weight: bold;',//pour les mots-cles C++
207 2 => 'color: #000000; font-weight: bold;',//pour les mots-cles KLone
208 3 => 'color: #6600FF;',//pour les fonctions C++
209 4 => 'color: #6600FF;',//pour les fonctions Klone
210 5 => 'color: #0099FF; font-weight: bold;',//pour les types C++
211 6 => 'color: #990099; font-weight: bold;',//pour les mots-cles HTML
212 7 => 'color: #000066;'//pour les autres mots-cles HTML
215 1 => 'color: #808080; font-style: italic;',//commentaire sur une ligne C++ et KLone
216 2 => 'color: #339933;',//pour les #... en C++
217 'MULTI' => 'color: #808080; font-style: italic;'//commentaire sur plusieurs lignes C++ et KLone
219 'ESCAPE_CHAR' => array(
220 0 => 'color: #000099; font-weight: bold;'
223 0 => 'color: #000000;'
226 0 => 'color: #ff0000;'
229 0 => 'color: #cc66cc;'
232 1 => 'color: #006600;',
233 2 => 'color: #006600;'
236 0 => 'color: #000000;',
237 1 => 'color: #000000; font-weight: bold;'
239 'REGEXPS' => array(),
241 0 => 'background-color:#ffccff; font-weight: bold; color:#000000;',
244 3 => 'color: #00bbdd; font-weight: bold;',
245 4 => 'color: #ddbb00;',
246 5 => 'color: #009900;'
252 3 => 'http://www.opengroup.org/onlinepubs/009695399/functions/{FNAMEL}.html',
253 4 => 'http://www.koanlogic.com/klone/api/html/globals.html',
255 6 => 'http://december.com/html/4/element/{FNAMEL}.html',
259 'OBJECT_SPLITTERS' => array(
265 'STRICT_MODE_APPLIES' => GESHI_ALWAYS
,
266 'SCRIPT_DELIMITERS' => array(
267 //delimiteurs pour KLone
277 //delimiteur pour HTML
288 'HIGHLIGHT_STRICT_BLOCK' => array(
297 'PARSER_CONTROL' => array(
300 'DISALLOWED_BEFORE' => '(?<=<|<\/)',
301 'DISALLOWED_AFTER' => '(?=\s|\/|>)',
304 'DISALLOWED_AFTER' => '(?=\s*=)',