1 # Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved.
2 # This program is free software; you can redistribute it and/or
3 # modify it under the same terms as Perl itself.
5 # This file was generated from the 'octave.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Luis Silvestre and Federico Zenith
11 #generated: Sun Feb 3 22:02:05 2008, localtime
13 package Syntax::Highlight::Engine::Kate::Octave;
15 our $VERSION = '0.06';
19 use base('Syntax::Highlight::Engine::Kate::Template');
23 my $class = ref($proto) || $proto;
24 my $self = $class->SUPER::new(@_);
27 'Commands' => 'DecVal',
28 'Comment' => 'Comment',
29 'Delimiter' => 'Normal',
30 'Forge' => 'Operator',
31 'Functions' => 'Function',
32 'Incomplete String' => 'BString',
33 'Keyword' => 'Keyword',
34 'Normal Text' => 'Normal',
36 'Operator' => 'Operator',
38 'String Char' => 'Char',
39 'Variable' => 'Variable',
41 $self->listAdd('builtin',
46 'FFTW_WISDOM_PROGRAM',
83 '__kluge_procbuf_delay__',
88 'completion_append_char',
89 'crash_dumps_octave_core',
90 'current_script_file_name',
94 'debug_symtab_lookups',
95 'default_save_format',
97 'echo_executing_commands',
101 'fixed_point_format',
103 'gnuplot_command_axes',
104 'gnuplot_command_end',
105 'gnuplot_command_plot',
106 'gnuplot_command_replot',
107 'gnuplot_command_splot',
108 'gnuplot_command_title',
109 'gnuplot_command_using',
110 'gnuplot_command_with',
111 'gnuplot_has_frames',
115 'ignore_function_time_stamp',
118 'max_recursion_depth',
120 'octave_core_file_format',
121 'octave_core_file_limit',
122 'octave_core_file_name',
123 'output_max_field_width',
125 'page_output_immediately',
126 'page_screen_output',
128 'print_answer_id_name',
129 'print_empty_dimensions',
130 'print_rhs_assign_val',
131 'program_invocation_name',
135 'save_header_format_string',
138 'sighup_dumps_octave_core',
139 'sigterm_dumps_octave_core',
146 'struct_levels_to_print',
147 'suppress_verbose_help_message',
149 'variables_can_hide_functions',
150 'warn_assign_as_truth_value',
151 'warn_divide_by_zero',
152 'warn_empty_list_elements',
153 'warn_fortran_indexing',
154 'warn_function_name_clash',
155 'warn_future_time_stamp',
157 'warn_matlab_incompatible',
158 'warn_missing_semicolon',
159 'warn_neg_dim_as_zero',
161 'warn_precedence_change',
162 'warn_reload_forces_clear',
163 'warn_resize_on_range_error',
164 'warn_separator_insert',
165 'warn_single_quote_string',
167 'warn_undefined_return_values',
168 'warn_variable_switch_label',
171 $self->listAdd('commands',
210 $self->listAdd('forge',
216 'ExampleEigenValues',
217 'ExampleGenEigenValues',
220 'OCTAVE_FORGE_VERSION',
259 'airy_Ai_deriv_scaled',
263 'airy_Bi_deriv_scaled',
266 'airy_zero_Ai_deriv',
268 'airy_zero_Bi_deriv',
270 'anderson_darling_cdf',
271 'anderson_darling_test',
404 'create_lookup_table',
454 'display_fixed_operations',
536 'flag_implicit_samplerate',
606 'gmm_variance_inefficient',
737 'legendre_sphPlm_array',
908 'reset_fixed_operations',
1014 'test_nelder_mead_min_1',
1015 'test_nelder_mead_min_2',
1050 'unscale_parameters',
1061 'vrml_demo_tutorial_1',
1062 'vrml_demo_tutorial_2',
1063 'vrml_demo_tutorial_3',
1064 'vrml_demo_tutorial_4',
1073 'vrml_parallelogram',
1075 'vrml_select_points',
1107 $self->listAdd('functions',
1132 '__print_symbol_info__',
1133 '__print_symtab_info__',
1246 'chisquare_test_homogeneity',
1247 'chisquare_test_independence',
1265 'commutation_matrix',
1268 'completion_matches',
1345 'do_string_escapes',
1352 'duplication_matrix',
1386 'f_test_regression',
1413 'find_first_of_in_loadpath',
1514 'hypergeometric_cdf',
1515 'hypergeometric_inv',
1516 'hypergeometric_pdf',
1517 'hypergeometric_rnd',
1557 'is_duplicate_entry',
1626 'kolmogorov_smirnov_cdf',
1627 'kolmogorov_smirnov_test',
1628 'kolmogorov_smirnov_test_2',
1630 'kruskal_wallis_test',
1660 'logistic_regression',
1661 'logistic_regression_derivatives',
1662 'logistic_regression_likelihood',
1720 'native_float_format',
1740 'octave_config_info',
1741 'octave_tmp_file_name',
1830 'read_readline_init_file',
1995 't_test_regression',
2035 'undo_string_escapes',
2098 $self->listAdd('keywords',
2105 'end_unwind_protect',
2116 'unwind_protect_cleanup',
2120 $self->contextdata({
2122 callback => \&parse_adjoint,
2123 attribute => 'Operator',
2124 lineending => '#pop',
2127 callback => \&parse_normal,
2128 attribute => 'Normal Text',
2131 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
2132 $self->basecontext('_normal');
2133 $self->keywordscase(0);
2135 bless ($self, $class);
2144 my ($self, $text) = @_;
2146 # attribute => 'Operator'
2149 if ($self->testRegExpr($text, '\'+', 0, 0, 0, undef, 0, '#pop', 'Operator')) {
2156 my ($self, $text) = @_;
2157 # String => '\b(for)\b'
2158 # attribute => 'Keyword'
2159 # beginRegion => 'block'
2160 # context => '#stay'
2162 if ($self->testRegExpr($text, '\\b(for)\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
2165 # String => '\b(endfor)\b'
2166 # attribute => 'Keyword'
2167 # context => '#stay'
2168 # endRegion => 'block'
2170 if ($self->testRegExpr($text, '\\b(endfor)\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
2173 # String => '\b(if)\b'
2174 # attribute => 'Keyword'
2175 # beginRegion => 'block'
2176 # context => '#stay'
2178 if ($self->testRegExpr($text, '\\b(if)\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
2181 # String => '\b(endif)\b'
2182 # attribute => 'Keyword'
2183 # context => '#stay'
2184 # endRegion => 'block'
2186 if ($self->testRegExpr($text, '\\b(endif)\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
2189 # String => '\b(do)\b'
2190 # attribute => 'Keyword'
2191 # beginRegion => 'block'
2192 # context => '#stay'
2194 if ($self->testRegExpr($text, '\\b(do)\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
2197 # String => '\b(until)\b'
2198 # attribute => 'Keyword'
2199 # context => '#stay'
2200 # endRegion => 'block'
2202 if ($self->testRegExpr($text, '\\b(until)\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
2205 # String => '\b(while)\b'
2206 # attribute => 'Keyword'
2207 # beginRegion => 'block'
2208 # context => '#stay'
2210 if ($self->testRegExpr($text, '\\b(while)\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
2213 # String => '\b(endwhile)\b'
2214 # attribute => 'Keyword'
2215 # context => '#stay'
2216 # endRegion => 'block'
2218 if ($self->testRegExpr($text, '\\b(endwhile)\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
2221 # String => '\b(function)\b'
2222 # attribute => 'Keyword'
2223 # beginRegion => 'block'
2224 # context => '#stay'
2226 if ($self->testRegExpr($text, '\\b(function)\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
2229 # String => '\b(endfunction)\b'
2230 # attribute => 'Keyword'
2231 # context => '#stay'
2232 # endRegion => 'block'
2234 if ($self->testRegExpr($text, '\\b(endfunction)\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
2237 # String => '\b(switch)\b'
2238 # attribute => 'Keyword'
2239 # beginRegion => 'Switch'
2240 # context => '#stay'
2242 if ($self->testRegExpr($text, '\\b(switch)\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
2245 # String => '\b(endswitch)\b'
2246 # attribute => 'Keyword'
2247 # context => '#stay'
2248 # endRegion => 'Switch'
2250 if ($self->testRegExpr($text, '\\b(endswitch)\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
2253 # String => '\b(try)\b'
2254 # attribute => 'Keyword'
2255 # beginRegion => 'Try'
2256 # context => '#stay'
2258 if ($self->testRegExpr($text, '\\b(try)\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
2261 # String => '\b(end_try_catch)\b'
2262 # attribute => 'Keyword'
2263 # context => '#stay'
2264 # endRegion => 'Try'
2266 if ($self->testRegExpr($text, '\\b(end_try_catch)\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
2269 # String => '\b(end)\b'
2270 # attribute => 'Keyword'
2271 # context => '#stay'
2272 # endRegion => 'block'
2274 if ($self->testRegExpr($text, '\\b(end)\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
2277 # String => '[a-zA-Z]\w*(?=')'
2278 # attribute => 'Variable'
2279 # context => '_adjoint'
2281 if ($self->testRegExpr($text, '[a-zA-Z]\\w*(?=\')', 0, 0, 0, undef, 0, '_adjoint', 'Variable')) {
2284 # String => '(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?[ij]?(?=')'
2285 # attribute => 'Number'
2286 # context => '_adjoint'
2288 if ($self->testRegExpr($text, '(\\d+(\\.\\d+)?|\\.\\d+)([eE][+-]?\\d+)?[ij]?(?=\')', 0, 0, 0, undef, 0, '_adjoint', 'Number')) {
2291 # String => '[\)\]}](?=')'
2292 # attribute => 'Delimiter'
2293 # context => '_adjoint'
2295 if ($self->testRegExpr($text, '[\\)\\]}](?=\')', 0, 0, 0, undef, 0, '_adjoint', 'Delimiter')) {
2298 # String => '\.'(?=')'
2299 # attribute => 'Operator'
2300 # context => '_adjoint'
2302 if ($self->testRegExpr($text, '\\.\'(?=\')', 0, 0, 0, undef, 0, '_adjoint', 'Operator')) {
2305 # String => ''([^'\\]|''|\\'|\\[^'])*'(?=[^']|$)'
2306 # attribute => 'String'
2307 # context => '#stay'
2309 if ($self->testRegExpr($text, '\'([^\'\\\\]|\'\'|\\\\\'|\\\\[^\'])*\'(?=[^\']|$)', 0, 0, 0, undef, 0, '#stay', 'String')) {
2312 # String => ''([^']|''|\\')*'
2313 # attribute => 'Incomplete String'
2314 # context => '#stay'
2316 if ($self->testRegExpr($text, '\'([^\']|\'\'|\\\\\')*', 0, 0, 0, undef, 0, '#stay', 'Incomplete String')) {
2319 # String => '"([^"\\]|""|\\"|\\[^"])*"(?=[^"]|$)'
2320 # attribute => 'String'
2321 # context => '#stay'
2323 if ($self->testRegExpr($text, '"([^"\\\\]|""|\\\\"|\\\\[^"])*"(?=[^"]|$)', 0, 0, 0, undef, 0, '#stay', 'String')) {
2326 # String => '"([^"]|""|\\")*'
2327 # attribute => 'Incomplete String'
2328 # context => '#stay'
2330 if ($self->testRegExpr($text, '"([^"]|""|\\\\")*', 0, 0, 0, undef, 0, '#stay', 'Incomplete String')) {
2333 # String => 'keywords'
2334 # attribute => 'Keyword'
2335 # context => '#stay'
2337 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
2340 # String => 'commands'
2341 # attribute => 'Commands'
2342 # context => '#stay'
2344 if ($self->testKeyword($text, 'commands', 0, undef, 0, '#stay', 'Commands')) {
2347 # String => 'functions'
2348 # attribute => 'Functions'
2349 # context => '#stay'
2351 if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Functions')) {
2354 # String => 'builtin'
2355 # attribute => 'Builtin'
2356 # context => '#stay'
2358 if ($self->testKeyword($text, 'builtin', 0, undef, 0, '#stay', 'Builtin')) {
2362 # attribute => 'Forge'
2363 # context => '#stay'
2365 if ($self->testKeyword($text, 'forge', 0, undef, 0, '#stay', 'Forge')) {
2368 # String => '[%#].*$'
2369 # attribute => 'Comment'
2370 # context => '#stay'
2372 if ($self->testRegExpr($text, '[%#].*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
2375 # String => '[a-zA-Z]\w*'
2376 # attribute => 'Variable'
2377 # context => '#stay'
2379 if ($self->testRegExpr($text, '[a-zA-Z]\\w*', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
2382 # String => '(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?[ij]?'
2383 # attribute => 'Number'
2384 # context => '#stay'
2386 if ($self->testRegExpr($text, '(\\d+(\\.\\d+)?|\\.\\d+)([eE][+-]?\\d+)?[ij]?', 0, 0, 0, undef, 0, '#stay', 'Number')) {
2389 # String => '()[]{}'
2390 # attribute => 'Delimiter'
2391 # context => '#stay'
2393 if ($self->testAnyChar($text, '()[]{}', 0, 0, undef, 0, '#stay', 'Delimiter')) {
2397 # attribute => 'Operator'
2398 # context => '#stay'
2399 # type => 'StringDetect'
2400 if ($self->testStringDetect($text, '...', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2404 # attribute => 'Operator'
2405 # context => '#stay'
2406 # type => 'StringDetect'
2407 if ($self->testStringDetect($text, '==', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2411 # attribute => 'Operator'
2412 # context => '#stay'
2413 # type => 'StringDetect'
2414 if ($self->testStringDetect($text, '~=', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2418 # attribute => 'Operator'
2419 # context => '#stay'
2420 # type => 'StringDetect'
2421 if ($self->testStringDetect($text, '!=', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2425 # attribute => 'Operator'
2426 # context => '#stay'
2427 # type => 'StringDetect'
2428 if ($self->testStringDetect($text, '<=', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2432 # attribute => 'Operator'
2433 # context => '#stay'
2434 # type => 'StringDetect'
2435 if ($self->testStringDetect($text, '>=', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2439 # attribute => 'Operator'
2440 # context => '#stay'
2441 # type => 'StringDetect'
2442 if ($self->testStringDetect($text, '<>', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2446 # attribute => 'Operator'
2447 # context => '#stay'
2448 # type => 'StringDetect'
2449 if ($self->testStringDetect($text, '&&', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2453 # attribute => 'Operator'
2454 # context => '#stay'
2455 # type => 'StringDetect'
2456 if ($self->testStringDetect($text, '||', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2460 # attribute => 'Operator'
2461 # context => '#stay'
2462 # type => 'StringDetect'
2463 if ($self->testStringDetect($text, '++', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2467 # attribute => 'Operator'
2468 # context => '#stay'
2469 # type => 'StringDetect'
2470 if ($self->testStringDetect($text, '--', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2474 # attribute => 'Operator'
2475 # context => '#stay'
2476 # type => 'StringDetect'
2477 if ($self->testStringDetect($text, '**', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2481 # attribute => 'Operator'
2482 # context => '#stay'
2483 # type => 'StringDetect'
2484 if ($self->testStringDetect($text, '.*', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2488 # attribute => 'Operator'
2489 # context => '#stay'
2490 # type => 'StringDetect'
2491 if ($self->testStringDetect($text, '.**', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2495 # attribute => 'Operator'
2496 # context => '#stay'
2497 # type => 'StringDetect'
2498 if ($self->testStringDetect($text, '.^', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2502 # attribute => 'Operator'
2503 # context => '#stay'
2504 # type => 'StringDetect'
2505 if ($self->testStringDetect($text, './', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2509 # attribute => 'Operator'
2510 # context => '#stay'
2511 # type => 'StringDetect'
2512 if ($self->testStringDetect($text, '.\'', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2515 # String => '!"%(*+,/;=>[]|~#&)-:<>\^'
2516 # attribute => 'Operator'
2517 # context => '#stay'
2519 if ($self->testAnyChar($text, '!"%(*+,/;=>[]|~#&)-:<>\\^', 0, 0, undef, 0, '#stay', 'Operator')) {
2532 Syntax::Highlight::Engine::Kate::Octave - a Plugin for Octave syntax highlighting
2536 require Syntax::Highlight::Engine::Kate::Octave;
2537 my $sh = new Syntax::Highlight::Engine::Kate::Octave([
2542 Syntax::Highlight::Engine::Kate::Octave is a plugin module that provides syntax highlighting
2543 for Octave to the Syntax::Haghlight::Engine::Kate highlighting engine.
2545 This code is generated from the syntax definition files used
2546 by the Kate project.
2547 It works quite fine, but can use refinement and optimization.
2549 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
2555 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
2561 Unknown. If you find any, please contact the author