1 | 1 | simandl | <?php |
2 | | | /************************************************************************************* |
3 | | | * klonecpp.php |
4 | | | * -------- |
5 | | | * Author: AUGER Mickael |
6 | | | * Copyright: Synchronic |
7 | 3 | simandl | * Release Version: 1.0.8.3 |
8 | 1 | simandl | * 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 | | | |
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' => '\\', |
47 | | | 'KEYWORDS' => array( |
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' |
67 | | | ), |
68 | | | 2 => array(//mots-cles KLone |
69 | 3 | simandl | 'out', 'request', 'response', |
70 | 1 | simandl | ), |
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' |
92 | | | ), |
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' |
112 | | | ), |
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', |
119 | | | 'string', 'wchar_t' |
120 | | | ), |
121 | | | 6 => array(//mots-cles HTML |
122 | | | 'a', 'abbr', 'acronym', 'address', 'applet', |
123 | | | |
124 | | | 'base', 'basefont', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'b', |
125 | | | |
126 | | | 'caption', 'center', 'cite', 'code', 'colgroup', 'col', |
127 | | | |
128 | | | 'dd', 'del', 'dfn', 'dir', 'div', 'dl', 'dt', |
129 | | | |
130 | | | 'em', |
131 | | | |
132 | | | 'fieldset', 'font', 'form', 'frame', 'frameset', |
133 | | | |
134 | | | 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'html', |
135 | | | |
136 | | | 'iframe', 'ilayer', 'img', 'input', 'ins', 'isindex', 'i', |
137 | | | |
138 | | | 'kbd', |
139 | | | |
140 | | | 'label', 'legend', 'link', 'li', |
141 | | | |
142 | | | 'map', 'meta', |
143 | | | |
144 | | | 'noframes', 'noscript', |
145 | | | |
146 | | | 'object', 'ol', 'optgroup', 'option', |
147 | | | |
148 | | | 'param', 'pre', 'p', |
149 | | | |
150 | | | 'q', |
151 | | | |
152 | | | 'samp', 'script', 'select', 'small', 'span', 'strike', 'strong', 'style', 'sub', 'sup', 's', |
153 | | | |
154 | | | 'table', 'tbody', 'td', 'textarea', 'text', 'tfoot', 'thead', 'th', 'title', 'tr', 'tt', |
155 | | | |
156 | | | 'ul', 'u', |
157 | | | |
158 | | | 'var', |
159 | | | ), |
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', |
165 | | | 'enctype', |
166 | | | 'face', 'for', 'frame', 'frameborder', |
167 | | | 'headers', 'height', 'href', 'hreflang', 'hspace', 'http-equiv', |
168 | | | 'id', 'ismap', |
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', |
173 | | | 'profile', 'prompt', |
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', |
177 | | | 'usemap', |
178 | | | 'valign', 'value', 'valuetype', 'version', 'vlink', 'vspace', |
179 | | | 'width' |
180 | | | ) |
181 | | | ), |
182 | | | 'SYMBOLS' => array( |
183 | 3 | simandl | 1 => array( |
184 | | | '<%=', '<%!', '<%', '%>' |
185 | | | ), |
186 | | | |
187 | | | '(', ')', '[', ']', '{', '}', |
188 | | | '!', '%', '&', '|', '/', |
189 | | | '<', '>', |
190 | | | '=', '-', '+', '*', |
191 | | | '.', ':', ',', ';', '^' |
192 | | | ) |
193 | 1 | simandl | ), |
194 | | | 'CASE_SENSITIVE' => array( |
195 | | | GESHI_COMMENTS => false, |
196 | | | 1 => false, |
197 | | | 2 => false, |
198 | | | 3 => false, |
199 | | | 4 => false, |
200 | | | 5 => false, |
201 | | | 6 => false, |
202 | | | 7 => false |
203 | | | ), |
204 | | | 'STYLES' => array( |
205 | | | 'KEYWORDS' => array( |
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 |
213 | | | ), |
214 | | | 'COMMENTS' => array( |
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 |
218 | | | ), |
219 | | | 'ESCAPE_CHAR' => array( |
220 | | | |
221 | | | ), |
222 | | | 'BRACKETS' => array( |
223 | | | |
224 | | | ), |
225 | | | 'STRINGS' => array( |
226 | | | |
227 | | | ), |
228 | | | 'NUMBERS' => array( |
229 | | | |
230 | | | ), |
231 | | | 'METHODS' => array( |
232 | | | 1 => 'color: #006600;', |
233 | | | 2 => 'color: #006600;' |
234 | | | ), |
235 | | | 'SYMBOLS' => array( |
236 | 3 | simandl | |
237 | | | 1 => 'color: #000000; font-weight: bold;' |
238 | 1 | simandl | ), |
239 | | | 'REGEXPS' => array(), |
240 | | | 'SCRIPT' => array( |
241 | | | |
242 | | | 1 => '', |
243 | | | 2 => '', |
244 | | | 3 => 'color: #00bbdd; font-weight: bold;', |
245 | | | 4 => 'color: #ddbb00;', |
246 | | | 5 => 'color: #009900;' |
247 | | | ) |
248 | | | ), |
249 | | | 'URLS' => array( |
250 | | | 1 => '', |
251 | | | 2 => '', |
252 | | | 3 => 'http://www.opengroup.org/onlinepubs/009695399/functions/{FNAMEL}.html', |
253 | | | 4 => 'http://www.koanlogic.com/klone/api/html/globals.html', |
254 | | | 5 => '', |
255 | | | 6 => 'http://december.com/html/4/element/{FNAMEL}.html', |
256 | | | 7 => '' |
257 | | | ), |
258 | | | 'OOLANG' => true, |
259 | | | 'OBJECT_SPLITTERS' => array( |
260 | | | 1 => '.', |
261 | | | 2 => '::' |
262 | | | ), |
263 | | | 'REGEXPS' => array( |
264 | | | ), |
265 | | | 'STRICT_MODE_APPLIES' => GESHI_ALWAYS, |
266 | | | 'SCRIPT_DELIMITERS' => array( |
267 | | | //delimiteurs pour KLone |
268 | | | |
269 | | | '<%=' => '%>' |
270 | | | ), |
271 | | | 1 => array( |
272 | | | '<%!' => '%>' |
273 | | | ), |
274 | | | 2 => array( |
275 | | | '<%' => '%>' |
276 | | | ), |
277 | | | //delimiteur pour HTML |
278 | | | 3 => array( |
279 | | | '<!DOCTYPE' => '>' |
280 | | | ), |
281 | | | 4 => array( |
282 | | | '&' => ';' |
283 | | | ), |
284 | | | 5 => array( |
285 | | | '<' => '>' |
286 | | | ) |
287 | | | ), |
288 | | | 'HIGHLIGHT_STRICT_BLOCK' => array( |
289 | | | |
290 | | | 1 => true, |
291 | | | 2 => true, |
292 | | | 3 => false, |
293 | | | 4 => false, |
294 | | | 5 => true |
295 | | | ), |
296 | | | 'TAB_WIDTH' => 4, |
297 | | | 'PARSER_CONTROL' => array( |
298 | | | 'KEYWORDS' => array( |
299 | | | 6 => array( |
300 | | | 'DISALLOWED_BEFORE' => '(?<=<|<\/)', |
301 | | | 'DISALLOWED_AFTER' => '(?=\s|\/|>)', |
302 | 3 | simandl | ), |
303 | | | 7 => array( |
304 | | | 'DISALLOWED_AFTER' => '(?=\s*=)', |
305 | 1 | simandl | ) |
306 | | | ) |
307 | | | ) |
308 | | | ); |
309 | | | |
310 | | | ?> |