Syntax-Highlight-Engine-Kate-0.14/0000755000175000017500000000000013226471445016262 5ustar manwarmanwarSyntax-Highlight-Engine-Kate-0.14/.travis.yml0000644000175000017500000000017213032300413020350 0ustar manwarmanwarbranches: except: - gh-pages language: perl perl: - "5.20" - "5.18" - "5.16" - "5.14" - "5.12" - "5.10" Syntax-Highlight-Engine-Kate-0.14/t/0000755000175000017500000000000013226471445016525 5ustar manwarmanwarSyntax-Highlight-Engine-Kate-0.14/t/perl_todo.t0000644000175000017500000000341013032300413020654 0ustar manwarmanwaruse strict; use warnings; use Test::More; use Test::Differences; use lib 't/lib'; use TestHighlight 'highlight_perl'; plan tests => 2; # https://rt.cpan.org/Ticket/Display.html?id=76182 my $underscore_bug = <<'END'; my $underscore_bug = 10_000 ; END my $want = <<'END'; my $underscore_bug = 10_100 ; END my $have = highlight_perl($underscore_bug); TODO: { local $TODO = 'Kate does not yet handle numbers with underscores (10_000)'; eq_or_diff $have, $want, 'Numbers with underscores should parse correctly'; } # https://rt.cpan.org/Ticket/Display.html?id=76168 my $heredoc_bug = <<'END'; my $heredoc_bug = <<'HEY'; We be here HEY! <-- this is not the terminator and here HEY END $have = highlight_perl($heredoc_bug); $want = <<'END'; my $heredoc_bug = <<'HEY'; We be here HEY! <-- this is not the terminator and here HEY END TODO: { local $TODO = 'Kate sometimes guesses the heredoc terminator incorrectly'; eq_or_diff $have, $want, 'heredocs should parse correctly'; } __END__ #!/usr/bin/env perl my $heredoc_bug = <<'HEY'; We be here HEY! <-- this is not the terminator and here HEY # https://rt.cpan.org/Ticket/Display.html?id=76160 =head1 BORKED All Perl code after this was considered a "comment" and Kate could not highlight it correctly. =cut my $this_is_not_a_comment = 'or a pipe'; Syntax-Highlight-Engine-Kate-0.14/t/perl/0000755000175000017500000000000013226471445017467 5ustar manwarmanwarSyntax-Highlight-Engine-Kate-0.14/t/perl/before/0000755000175000017500000000000013226471445020731 5ustar manwarmanwarSyntax-Highlight-Engine-Kate-0.14/t/perl/before/maze.pl0000644000175000017500000000707313032300413022206 0ustar manwarmanwar#!perl use strict; use warnings; use diagnostics; use List::Util 'shuffle'; # The size of the maze. Take the arguments from the command line or from the # default. my ( $HEIGHT, $WIDTH ) = @ARGV ? @ARGV : ( 20, 20 ); # Time::HiRes was officially released with Perl 5.8.0, though Module::Corelist # reports that it was actually released as early as v5.7.3. If you don't have # this module, your version of Perl is probably over a decade old use Time::HiRes 'usleep'; # In Perl, $^O is the name of your operating system. On Windows (as of this # writing), it always 'MSWin32'. use constant IS_WIN32 => 'MSWin32' eq $^O; # On Windows, we assume that the command to clear the screen is 'cls'. On all # other systems, we assume it's 'clear'. You may need to adjust this. use constant CLEAR => IS_WIN32 ? 'cls' : 'clear'; # We will only redraw the screen (and thus show the recursive maze generation) # if and only if the system is capable of clearing the screen. The system() # command returns 0 upon success. See perldoc -f system. # The following line works because $x == $y returns a boolean value. #use constant CAN_REDRAW => 0 == system(CLEAR); use constant CAN_REDRAW => 0; # Time in microseconds between screen redraws. See Time::HiRes and the usleep # function use constant DELAY => 10_000; use constant OPPOSITE_OF => { north => 'south', south => 'north', west => 'east', east => 'west', }; my @maze; tunnel( 0, 0, \@maze ); my $num = 10_000; system(CLEAR) if CAN_REDRAW; print render_maze( \@maze ); exit; sub tunnel { my ( $x, $y, $maze ) = @_; if (CAN_REDRAW) { my $render = render_maze($maze); system(CLEAR); print $render; usleep DELAY; } # Here we need to use a unary plus in front of OPPOSITE_OF so that # Perl understands that this is a constant and that we're not trying # to access the %OPPOSITE_OF variable. my @directions = shuffle keys %{ +OPPOSITE_OF }; foreach my $direction (@directions) { my ( $new_x, $new_y ) = ( $x, $y ); if ( 'east' eq $direction ) { $new_x += 1; } elsif ( 'west' eq $direction ) { $new_x -= 1; } elsif ( 'south' eq $direction ) { $new_y += 1; } else { $new_y -= 1; } if ( have_not_visited( $new_x, $new_y, $maze ) ) { $maze->[$y][$x]{$direction} = 1; $maze->[$new_y][$new_x]{ OPPOSITE_OF->{$direction} } = 1; # This program will often recurse more than one hundred levels # deep and this is Perl's default recursion depth level prior to # issuing warnings. In this case, we're telling Perl that we know # that we'll exceed the recursion depth and to now warn us about # it no warnings 'recursion'; tunnel( $new_x, $new_y, $maze ); } } } sub have_not_visited { my ( $x, $y, $maze ) = @_; # the first two lines return false if we're out of bounds return if $x < 0 or $y < 0; return if $x > $WIDTH - 1 or $y > $HEIGHT - 1; # this returns false if we've already visited this cell return if $maze->[$y][$x]; # return true return 1; } sub render_maze { my $maze = shift; my $as_string = "_" x ( 1 + $WIDTH * 2 ); $as_string .= "\n"; for my $y ( 0 .. $HEIGHT - 1 ) { $as_string .= "|"; for my $x ( 0 .. $WIDTH - 1 ) { my $cell = $maze->[$y][$x]; $as_string .= $cell->{south} ? " " : "_"; $as_string .= $cell->{east} ? " " : "|"; } $as_string .= "\n"; } return $as_string; } Syntax-Highlight-Engine-Kate-0.14/t/perl/before/kate.pl0000755000175000017500000007341113032300413022200 0ustar manwarmanwar # Copyright (c) 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. package Syntax::Highlight::Engine::Kate; use 5.006; our $VERSION = '0.06'; use strict; use warnings; use Carp; use Data::Dumper; use File::Basename; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my %args = (@_); my $add = delete $args{'plugins'}; unless (defined($add)) { $add = [] }; my $language = delete $args{'language'}; unless (defined($language)) { $language = 'Off' }; my $self = $class->SUPER::new(%args); $self->{'plugins'} = {}; #begin autoinsert $self->{'extensions'} = { ' *.cls' => ['LaTeX', ], ' *.dtx' => ['LaTeX', ], ' *.ltx' => ['LaTeX', ], ' *.sty' => ['LaTeX', ], '*.4GL' => ['4GL', ], '*.4gl' => ['4GL', ], '*.ABC' => ['ABC', ], '*.ASM' => ['AVR Assembler', 'PicAsm', ], '*.BAS' => ['FreeBASIC', ], '*.BI' => ['FreeBASIC', ], '*.C' => ['C++', 'C', 'ANSI C89', ], '*.D' => ['D', ], '*.F' => ['Fortran', ], '*.F90' => ['Fortran', ], '*.F95' => ['Fortran', ], '*.FOR' => ['Fortran', ], '*.FPP' => ['Fortran', ], '*.GDL' => ['GDL', ], '*.H' => ['C++', ], '*.JSP' => ['JSP', ], '*.LOGO' => ['de_DE', 'en_US', 'nl', ], '*.LY' => ['LilyPond', ], '*.Logo' => ['de_DE', 'en_US', 'nl', ], '*.M' => ['Matlab', 'Octave', ], '*.MAB' => ['MAB-DB', ], '*.Mab' => ['MAB-DB', ], '*.PER' => ['4GL-PER', ], '*.PIC' => ['PicAsm', ], '*.PRG' => ['xHarbour', 'Clipper', ], '*.R' => ['R Script', ], '*.S' => ['GNU Assembler', ], '*.SQL' => ['SQL', 'SQL (MySQL)', 'SQL (PostgreSQL)', ], '*.SRC' => ['PicAsm', ], '*.V' => ['Verilog', ], '*.VCG' => ['GDL', ], '*.a' => ['Ada', ], '*.abc' => ['ABC', ], '*.ada' => ['Ada', ], '*.adb' => ['Ada', ], '*.ado' => ['Stata', ], '*.ads' => ['Ada', ], '*.ahdl' => ['AHDL', ], '*.ai' => ['PostScript', ], '*.ans' => ['Ansys', ], '*.asm' => ['AVR Assembler', 'Asm6502', 'Intel x86 (NASM)', 'PicAsm', ], '*.asm-avr' => ['AVR Assembler', ], '*.asp' => ['ASP', ], '*.awk' => ['AWK', ], '*.bas' => ['FreeBASIC', ], '*.basetest' => ['BaseTest', ], '*.bash' => ['Bash', ], '*.bi' => ['FreeBASIC', ], '*.bib' => ['BibTeX', ], '*.bro' => ['Component-Pascal', ], '*.c' => ['C', 'ANSI C89', 'LPC', ], '*.c++' => ['C++', ], '*.cc' => ['C++', ], '*.cfc' => ['ColdFusion', ], '*.cfg' => ['Quake Script', ], '*.cfm' => ['ColdFusion', ], '*.cfml' => ['ColdFusion', ], '*.cg' => ['Cg', ], '*.cgis' => ['CGiS', ], '*.ch' => ['xHarbour', 'Clipper', ], '*.cis' => ['Cisco', ], '*.cl' => ['Common Lisp', ], '*.cmake' => ['CMake', ], '*.config' => ['Logtalk', ], '*.cp' => ['Component-Pascal', ], '*.cpp' => ['C++', ], '*.cs' => ['C#', ], '*.css' => ['CSS', ], '*.cue' => ['CUE Sheet', ], '*.cxx' => ['C++', ], '*.d' => ['D', ], '*.daml' => ['XML', ], '*.dbm' => ['ColdFusion', ], '*.def' => ['Modula-2', ], '*.desktop' => ['.desktop', ], '*.diff' => ['Diff', ], '*.do' => ['Stata', ], '*.docbook' => ['XML', ], '*.dox' => ['Doxygen', ], '*.doxygen' => ['Doxygen', ], '*.e' => ['E Language', 'Eiffel', 'Euphoria', ], '*.ebuild' => ['Bash', ], '*.eclass' => ['Bash', ], '*.eml' => ['Email', ], '*.eps' => ['PostScript', ], '*.err' => ['4GL', ], '*.ex' => ['Euphoria', ], '*.exu' => ['Euphoria', ], '*.exw' => ['Euphoria', ], '*.f' => ['Fortran', ], '*.f90' => ['Fortran', ], '*.f95' => ['Fortran', ], '*.fe' => ['ferite', ], '*.feh' => ['ferite', ], '*.flex' => ['Lex/Flex', ], '*.for' => ['Fortran', ], '*.fpp' => ['Fortran', ], '*.frag' => ['GLSL', ], '*.gdl' => ['GDL', ], '*.glsl' => ['GLSL', ], '*.guile' => ['Scheme', ], '*.h' => ['C++', 'C', 'ANSI C89', 'Inform', 'LPC', 'Objective-C', ], '*.h++' => ['C++', ], '*.hcc' => ['C++', ], '*.hpp' => ['C++', ], '*.hs' => ['Haskell', ], '*.hsp' => ['Spice', ], '*.ht' => ['Apache Configuration', ], '*.htm' => ['HTML', ], '*.html' => ['HTML', 'Mason', ], '*.hxx' => ['C++', ], '*.i' => ['progress', ], '*.idl' => ['IDL', ], '*.inc' => ['POV-Ray', 'PHP (HTML)', 'LPC', ], '*.inf' => ['Inform', ], '*.ini' => ['INI Files', ], '*.java' => ['Java', ], '*.js' => ['JavaScript', ], '*.jsp' => ['JSP', ], '*.katetemplate' => ['Kate File Template', ], '*.kbasic' => ['KBasic', ], '*.kdelnk' => ['.desktop', ], '*.l' => ['Lex/Flex', ], '*.ldif' => ['LDIF', ], '*.lex' => ['Lex/Flex', ], '*.lgo' => ['de_DE', 'en_US', 'nl', ], '*.lgt' => ['Logtalk', ], '*.lhs' => ['Literate Haskell', ], '*.lisp' => ['Common Lisp', ], '*.logo' => ['de_DE', 'en_US', 'nl', ], '*.lsp' => ['Common Lisp', ], '*.lua' => ['Lua', ], '*.ly' => ['LilyPond', ], '*.m' => ['Matlab', 'Objective-C', 'Octave', ], '*.m3u' => ['M3U', ], '*.mab' => ['MAB-DB', ], '*.md' => ['Modula-2', ], '*.mi' => ['Modula-2', ], '*.ml' => ['Objective Caml', 'SML', ], '*.mli' => ['Objective Caml', ], '*.moc' => ['C++', ], '*.mod' => ['Modula-2', ], '*.mup' => ['Music Publisher', ], '*.not' => ['Music Publisher', ], '*.o' => ['LPC', ], '*.octave' => ['Octave', ], '*.p' => ['Pascal', 'progress', ], '*.pas' => ['Pascal', ], '*.pb' => ['PureBasic', ], '*.per' => ['4GL-PER', ], '*.per.err' => ['4GL-PER', ], '*.php' => ['PHP (HTML)', ], '*.php3' => ['PHP (HTML)', ], '*.phtm' => ['PHP (HTML)', ], '*.phtml' => ['PHP (HTML)', ], '*.pic' => ['PicAsm', ], '*.pike' => ['Pike', ], '*.pl' => ['Perl', ], '*.pls' => ['INI Files', ], '*.pm' => ['Perl', ], '*.po' => ['GNU Gettext', ], '*.pot' => ['GNU Gettext', ], '*.pov' => ['POV-Ray', ], '*.pp' => ['Pascal', ], '*.prg' => ['xHarbour', 'Clipper', ], '*.pro' => ['RSI IDL', ], '*.prolog' => ['Prolog', ], '*.ps' => ['PostScript', ], '*.py' => ['Python', ], '*.pyw' => ['Python', ], '*.rb' => ['Ruby', ], '*.rc' => ['XML', ], '*.rdf' => ['XML', ], '*.reg' => ['WINE Config', ], '*.rex' => ['REXX', ], '*.rib' => ['RenderMan RIB', ], '*.s' => ['GNU Assembler', 'MIPS Assembler', ], '*.sa' => ['Sather', ], '*.sce' => ['scilab', ], '*.scheme' => ['Scheme', ], '*.sci' => ['scilab', ], '*.scm' => ['Scheme', ], '*.sgml' => ['SGML', ], '*.sh' => ['Bash', ], '*.shtm' => ['HTML', ], '*.shtml' => ['HTML', ], '*.siv' => ['Sieve', ], '*.sml' => ['SML', ], '*.sp' => ['Spice', ], '*.spec' => ['RPM Spec', ], '*.sql' => ['SQL', 'SQL (MySQL)', 'SQL (PostgreSQL)', ], '*.src' => ['PicAsm', ], '*.ss' => ['Scheme', ], '*.t2t' => ['txt2tags', ], '*.tcl' => ['Tcl/Tk', ], '*.tdf' => ['AHDL', ], '*.tex' => ['LaTeX', ], '*.tji' => ['TaskJuggler', ], '*.tjp' => ['TaskJuggler', ], '*.tk' => ['Tcl/Tk', ], '*.tst' => ['BaseTestchild', ], '*.uc' => ['UnrealScript', ], '*.v' => ['Verilog', ], '*.vcg' => ['GDL', ], '*.vert' => ['GLSL', ], '*.vhd' => ['VHDL', ], '*.vhdl' => ['VHDL', ], '*.vl' => ['Verilog', ], '*.vm' => ['Velocity', ], '*.w' => ['progress', ], '*.wml' => ['PHP (HTML)', ], '*.wrl' => ['VRML', ], '*.xml' => ['XML', ], '*.xsl' => ['xslt', ], '*.xslt' => ['xslt', ], '*.y' => ['Yacc/Bison', ], '*.ys' => ['yacas', ], '*Makefile*' => ['Makefile', ], '*makefile*' => ['Makefile', ], '*patch' => ['Diff', ], 'CMakeLists.txt' => ['CMake', ], 'ChangeLog' => ['ChangeLog', ], 'QRPGLESRC.*' => ['ILERPG', ], 'apache.conf' => ['Apache Configuration', ], 'apache2.conf' => ['Apache Configuration', ], 'httpd.conf' => ['Apache Configuration', ], 'httpd2.conf' => ['Apache Configuration', ], 'xorg.conf' => ['x.org Configuration', ], }; $self->{'sections'} = { 'Assembler' => [ 'AVR Assembler', 'Asm6502', 'GNU Assembler', 'Intel x86 (NASM)', 'MIPS Assembler', 'PicAsm', ], 'Configuration' => [ '.desktop', 'Apache Configuration', 'Cisco', 'INI Files', 'WINE Config', 'x.org Configuration', ], 'Database' => [ '4GL', '4GL-PER', 'LDIF', 'SQL', 'SQL (MySQL)', 'SQL (PostgreSQL)', 'progress', ], 'Hardware' => [ 'AHDL', 'Spice', 'VHDL', 'Verilog', ], 'Logo' => [ 'de_DE', 'en_US', 'nl', ], 'Markup' => [ 'ASP', 'BibTeX', 'CSS', 'ColdFusion', 'Doxygen', 'GNU Gettext', 'HTML', 'JSP', 'Javadoc', 'Kate File Template', 'LaTeX', 'MAB-DB', 'PostScript', 'SGML', 'VRML', 'Wikimedia', 'XML', 'txt2tags', 'xslt', ], 'Other' => [ 'ABC', 'Alerts', 'CMake', 'CSS/PHP', 'CUE Sheet', 'ChangeLog', 'Debian Changelog', 'Debian Control', 'Diff', 'Email', 'JavaScript/PHP', 'LilyPond', 'M3U', 'Makefile', 'Music Publisher', 'POV-Ray', 'RPM Spec', 'RenderMan RIB', ], 'Scientific' => [ 'GDL', 'Matlab', 'Octave', 'TI Basic', 'scilab', ], 'Script' => [ 'Ansys', ], 'Scripts' => [ 'AWK', 'Bash', 'Common Lisp', 'Euphoria', 'JavaScript', 'Lua', 'Mason', 'PHP (HTML)', 'PHP/PHP', 'Perl', 'Pike', 'Python', 'Quake Script', 'R Script', 'REXX', 'Ruby', 'Scheme', 'Sieve', 'TaskJuggler', 'Tcl/Tk', 'UnrealScript', 'Velocity', 'ferite', ], 'Sources' => [ 'ANSI C89', 'Ada', 'C', 'C#', 'C++', 'CGiS', 'Cg', 'Clipper', 'Component-Pascal', 'D', 'E Language', 'Eiffel', 'Fortran', 'FreeBASIC', 'GLSL', 'Haskell', 'IDL', 'ILERPG', 'Inform', 'Java', 'KBasic', 'LPC', 'Lex/Flex', 'Literate Haskell', 'Logtalk', 'Modula-2', 'Objective Caml', 'Objective-C', 'Pascal', 'Prolog', 'PureBasic', 'RSI IDL', 'SML', 'Sather', 'Stata', 'Yacc/Bison', 'xHarbour', 'yacas', ], 'Test' => [ 'BaseTest', 'BaseTestchild', ], }; $self->{'syntaxes'} = { '.desktop' => 'Desktop', '4GL' => 'FourGL', '4GL-PER' => 'FourGLminusPER', 'ABC' => 'ABC', 'AHDL' => 'AHDL', 'ANSI C89' => 'ANSI_C89', 'ASP' => 'ASP', 'AVR Assembler' => 'AVR_Assembler', 'AWK' => 'AWK', 'Ada' => 'Ada', 'Alerts' => 'Alerts', 'Ansys' => 'Ansys', 'Apache Configuration' => 'Apache_Configuration', 'Asm6502' => 'Asm6502', 'BaseTest' => 'BaseTest', 'BaseTestchild' => 'BaseTestchild', 'Bash' => 'Bash', 'BibTeX' => 'BibTeX', 'C' => 'C', 'C#' => 'Cdash', 'C++' => 'Cplusplus', 'CGiS' => 'CGiS', 'CMake' => 'CMake', 'CSS' => 'CSS', 'CSS/PHP' => 'CSS_PHP', 'CUE Sheet' => 'CUE_Sheet', 'Cg' => 'Cg', 'ChangeLog' => 'ChangeLog', 'Cisco' => 'Cisco', 'Clipper' => 'Clipper', 'ColdFusion' => 'ColdFusion', 'Common Lisp' => 'Common_Lisp', 'Component-Pascal' => 'ComponentminusPascal', 'D' => 'D', 'Debian Changelog' => 'Debian_Changelog', 'Debian Control' => 'Debian_Control', 'Diff' => 'Diff', 'Doxygen' => 'Doxygen', 'E Language' => 'E_Language', 'Eiffel' => 'Eiffel', 'Email' => 'Email', 'Euphoria' => 'Euphoria', 'Fortran' => 'Fortran', 'FreeBASIC' => 'FreeBASIC', 'GDL' => 'GDL', 'GLSL' => 'GLSL', 'GNU Assembler' => 'GNU_Assembler', 'GNU Gettext' => 'GNU_Gettext', 'HTML' => 'HTML', 'Haskell' => 'Haskell', 'IDL' => 'IDL', 'ILERPG' => 'ILERPG', 'INI Files' => 'INI_Files', 'Inform' => 'Inform', 'Intel x86 (NASM)' => 'Intel_x86_NASM', 'JSP' => 'JSP', 'Java' => 'Java', 'JavaScript' => 'JavaScript', 'JavaScript/PHP' => 'JavaScript_PHP', 'Javadoc' => 'Javadoc', 'KBasic' => 'KBasic', 'Kate File Template' => 'Kate_File_Template', 'LDIF' => 'LDIF', 'LPC' => 'LPC', 'LaTeX' => 'LaTeX', 'Lex/Flex' => 'Lex_Flex', 'LilyPond' => 'LilyPond', 'Literate Haskell' => 'Literate_Haskell', 'Logtalk' => 'Logtalk', 'Lua' => 'Lua', 'M3U' => 'M3U', 'MAB-DB' => 'MABminusDB', 'MIPS Assembler' => 'MIPS_Assembler', 'Makefile' => 'Makefile', 'Mason' => 'Mason', 'Matlab' => 'Matlab', 'Modula-2' => 'Modulaminus2', 'Music Publisher' => 'Music_Publisher', 'Objective Caml' => 'Objective_Caml', 'Objective-C' => 'ObjectiveminusC', 'Octave' => 'Octave', 'PHP (HTML)' => 'PHP_HTML', 'PHP/PHP' => 'PHP_PHP', 'POV-Ray' => 'POVminusRay', 'Pascal' => 'Pascal', 'Perl' => 'Perl', 'PicAsm' => 'PicAsm', 'Pike' => 'Pike', 'PostScript' => 'PostScript', 'Prolog' => 'Prolog', 'PureBasic' => 'PureBasic', 'Python' => 'Python', 'Quake Script' => 'Quake_Script', 'R Script' => 'R_Script', 'REXX' => 'REXX', 'RPM Spec' => 'RPM_Spec', 'RSI IDL' => 'RSI_IDL', 'RenderMan RIB' => 'RenderMan_RIB', 'Ruby' => 'Ruby', 'SGML' => 'SGML', 'SML' => 'SML', 'SQL' => 'SQL', 'SQL (MySQL)' => 'SQL_MySQL', 'SQL (PostgreSQL)' => 'SQL_PostgreSQL', 'Sather' => 'Sather', 'Scheme' => 'Scheme', 'Sieve' => 'Sieve', 'Spice' => 'Spice', 'Stata' => 'Stata', 'TI Basic' => 'TI_Basic', 'TaskJuggler' => 'TaskJuggler', 'Tcl/Tk' => 'Tcl_Tk', 'UnrealScript' => 'UnrealScript', 'VHDL' => 'VHDL', 'VRML' => 'VRML', 'Velocity' => 'Velocity', 'Verilog' => 'Verilog', 'WINE Config' => 'WINE_Config', 'Wikimedia' => 'Wikimedia', 'XML' => 'XML', 'Yacc/Bison' => 'Yacc_Bison', 'de_DE' => 'De_DE', 'en_US' => 'En_US', 'ferite' => 'Ferite', 'nl' => 'Nl', 'progress' => 'Progress', 'scilab' => 'Scilab', 'txt2tags' => 'Txt2tags', 'x.org Configuration' => 'Xorg_Configuration', 'xHarbour' => 'XHarbour', 'xslt' => 'Xslt', 'yacas' => 'Yacas', }; #end autoinsert $self->{'language '} = ''; bless ($self, $class); if ($language ne '') { $self->language($language); } return $self; } sub extensions { my $self = shift; return $self->{'extensions'}; } #overriding Template's initialize method. now it should not do anything. sub initialize { my $cw = shift; } sub language { my $self = shift; if (@_) { $self->{'language'} = shift; $self->reset; } return $self->{'language'}; } sub languageAutoSet { my ($self, $file) = @_; my $lang = $self->languagePropose($file); if (defined $lang) { $self->language($lang) } else { $self->language('Off') } } sub languageList { my $self = shift; my $l = $self->{'syntaxes'}; return sort {uc($a) cmp uc($b)} keys %$l; } sub languagePropose { my ($self, $file) = @_; my $hsh = $self->extensions; foreach my $key (keys %$hsh) { my $reg = $key; $reg =~ s/\./\\./g; $reg =~ s/\+/\\+/g; $reg =~ s/\*/.*/g; $reg = "$reg\$"; if ($file =~ /$reg/) { return $hsh->{$key}->[0] } } return undef; } sub languagePlug { my ($self, $req) = @_; unless (exists($self->{'syntaxes'}->{$req})) { warn "undefined language: $req"; return undef; } return $self->{'syntaxes'}->{$req}; } sub reset { my $self = shift; my $lang = $self->language; if ($lang eq 'Off') { $self->stack([]); } else { my $plug = $self->pluginGet($lang); my $basecontext = $plug->basecontext; $self->stack([ [$plug, $basecontext] ]); } $self->out([]); $self->snippet(''); } sub sections { my $self = shift; return $self->{'sections'}; } sub syntaxes { my $self = shift; return $self->{'syntaxes'} } 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate - a port to Perl of the syntax highlight engine of the Kate texteditor. =head1 SYNOPSIS #if you want to create a compiled executable, you may want to do this: use Syntax::Highlight::Engine::Kate::All; use Syntax::Highlight::Engine::Kate; my $hl = new Syntax::Highlight::Engine::Kate( language => 'Perl', substitutions => { "<" => "<", ">" => ">", "&" => "&", " " => " ", "\t" => "   ", "\n" => "
\n", }, format_table => { Alert => ["", ""], BaseN => ["", ""], BString => ["", ""], Char => ["", ""], Comment => ["", ""], DataType => ["", ""], DecVal => ["", ""], Error => ["", ""], Float => ["", ""], Function => ["", ""], IString => ["", ""], Keyword => ["", ""], Normal => ["", ""], Operator => ["", ""], Others => ["", ""], RegionMarker => ["", ""], Reserved => ["", ""], String => ["", ""], Variable => ["", ""], Warning => ["", ""], }, ); #or my $hl = new Syntax::Highlight::Engine::Kate::Perl( substitutions => { "<" => "<", ">" => ">", "&" => "&", " " => " ", "\t" => "   ", "\n" => "
\n", }, format_table => { Alert => ["", ""], BaseN => ["", ""], BString => ["", ""], Char => ["", ""], Comment => ["", ""], DataType => ["", ""], DecVal => ["", ""], Error => ["", ""], Float => ["", ""], Function => ["", ""], IString => ["", ""], Keyword => ["", ""], Normal => ["", ""], Operator => ["", ""], Others => ["", ""], RegionMarker => ["", ""], Reserved => ["", ""], String => ["", ""], Variable => ["", ""], Warning => ["", ""], }, ); print "\n\n\n\n"; while (my $in = <>) { print $hl->highlightText($in); } print "\n\n"; =head1 DESCRIPTION Syntax::Highlight::Engine::Kate is a port to perl of the syntax highlight engine of the Kate text editor. The language xml files of kate have been rewritten to perl modules using a script. These modules function as plugins to this module. Syntax::Highlight::Engine::Kate inherits Syntax::Highlight::Engine::Kate::Template. =head1 OPTIONS =over 4 =item B Specify the language you want highlighted. look in the B section for supported languages. =item B If you created your own language plugins you may specify a list of them with this option. plugins => [ ["MyModuleName", "MyLanguageName", "*,ext1;*.ext2", "Section"], .... ] =item B This option must be specified if the B method needs to do anything useful for you. All mentioned keys in the synopsis must be specified. =item B With this option you can specify additional formatting options. =back =head1 METHODS =over 4 =item B returns a reference to the extensions hash, =item B(I) Sets and returns the current language that is highlighted. when setting the language a reset is also done. =item B(I<$filename>); Suggests language name for the fiven file B<$filename> =item B returns a list of languages for which plugins have been defined. =item B(I<$language>); returns the module name of the plugin for B<$language> =item B(I<$filename>); Suggests language name for the fiven file B<$filename> =item B Returns a reference to the sections hash. =back =head1 ATTRIBUTES In the kate XML syntax files you find under the section B<> entries like . Kate is an editor so it is ok to have definitions for forground and background colors and so on. However, since this Module is supposed to be a more universal highlight engine, the attributes need to be fully abstract. In which case, Kate does not have enough default attributes defined to fullfill all needs. Kate defines the following standard attributes: B, B, B, B, B, B, B, B, B, B, B, B, B, B. This module leaves out the "ds" part and uses following additional attributes: B, B, B, B, B. I have modified the XML files so that each highlight mode would get it's own attribute. In quite a few cases still not enough attributes were defined. So in some languages different modes have the same attribute. =head1 PLUGINS Below an overview of existing plugins. All have been tested on use and can be created. The ones for which no samplefile is available are marked. Those marked OK have highlighted the testfile without appearant mistakes. This does not mean that all bugs are shaken out. LANGUAGE MODULE COMMENT ******** ****** ****** .desktop Desktop OK 4GL FourGL No sample file 4GL-PER FourGLminusPER No sample file ABC ABC OK AHDL AHDL OK ANSI C89 ANSI_C89 No sample file ASP ASP OK AVR Assembler AVR_Assembler OK AWK AWK OK Ada Ada No sample file Alerts OK hidden module Ansys Ansys No sample file Apache Configuration Apache_Configuration No sample file Asm6502 Asm6502 No sample file Bash Bash OK BibTeX BibTeX OK C C No sample file C# Cdash No sample file C++ Cplusplus OK CGiS CGiS No sample file CMake CMake OK CSS CSS OK CUE Sheet CUE_Sheet No sample file Cg Cg No sample file ChangeLog ChangeLog No sample file Cisco Cisco No sample file Clipper Clipper OK ColdFusion ColdFusion No sample file Common Lisp Common_Lisp OK Component-Pascal ComponentminusPascal No sample file D D No sample file Debian Changelog Debian_Changelog No sample file Debian Control Debian_Control No sample file Diff Diff No sample file Doxygen Doxygen OK E Language E_Language OK Eiffel Eiffel No sample file Email Email OK Euphoria Euphoria OK Fortran Fortran OK FreeBASIC FreeBASIC No sample file GDL GDL No sample file GLSL GLSL OK GNU Assembler GNU_Assembler No sample file GNU Gettext GNU_Gettext No sample file HTML HTML OK Haskell Haskell OK IDL IDL No sample file ILERPG ILERPG No sample file INI Files INI_Files No sample file Inform Inform No sample file Intel x86 (NASM) Intel_X86_NASM seems to have issues JSP JSP OK Java Java OK JavaScript JavaScript OK Javadoc Javadoc No sample file KBasic KBasic No sample file Kate File Template Kate_File_Template No sample file LDIF LDIF No sample file LPC LPC No sample file LaTeX LaTex OK Lex/Flex Lex_Flex OK LilyPond LilyPond OK Literate Haskell Literate_Haskell OK Lua Lua No sample file M3U M3U OK MAB-DB MABminusDB No sample file MIPS Assembler MIPS_Assembler No sample file Makefile Makefile No sample file Mason Mason No sample file Matlab Matlab has issues Modula-2 Modulaminus2 No sample file Music Publisher Music_Publisher No sample file Octave Octave OK PHP (HTML) PHP_HTML OK PHP_PHP OK hidden module POV-Ray POV_Ray OK Pascal Pascal No sample file Perl Perl OK PicAsm PicAsm OK Pike Pike OK PostScript PostScript OK Prolog Prolog No sample file PureBasic PureBasic OK Python Python OK Quake Script Quake_Script No sample file R Script R_Script No sample file REXX REXX No sample file RPM Spec RPM_Spec No sample file RSI IDL RSI_IDL No sample file RenderMan RIB RenderMan_RIB OK Ruby Ruby OK SGML SGML No sample file SML SML No sample file SQL SQL No sample file SQL (MySQL) SQL_MySQL No sample file SQL (PostgreSQL) SQL_PostgreSQL No sample file Sather Sather No sample file Scheme Scheme OK Sieve Sieve No sample file Spice Spice OK Stata Stata OK TI Basic TI_Basic No sample file TaskJuggler TaskJuggler No sample file Tcl/Tk TCL_Tk OK UnrealScript UnrealScript OK VHDL VHDL No sample file VRML VRML OK Velocity Velocity No sample file Verilog Verilog No sample file WINE Config WINE_Config No sample file Wikimedia Wikimedia No sample file XML XML OK XML (Debug) XML_Debug No sample file Yacc/Bison Yacc_Bison OK de_DE De_DE No sample file en_EN En_EN No sample file ferite Ferite No sample file nl Nl No sample file progress Progress No sample file scilab Scilab No sample file txt2tags Txt2tags No sample file x.org Configuration X_org_Configuration OK xHarbour XHarbour OK xslt Xslt No sample file yacas Yacas No sample file =head1 BUGS Float is detected differently than in the Kate editor. The regular expression engine of the Kate editor, qregexp, appears to be more tolerant to mistakes in regular expressions than perl. This might lead to error messages and differences in behaviour. Most of the problems were sorted out while developing, because error messages appeared. For as far as differences in behaviour is concerned, testing is the only way to find out, so i hope the users out there will be able to tell me more. This module is mimicking the behaviour of the syntax highlight engine of the Kate editor. If you find a bug/mistake in the highlighting, please check if Kate behaves in the same way. If yes, the cause is likely to be found there. =head1 TO DO Rebuild the scripts i am using to generate the modules from xml files so they are more pro-actively tracking flaws in the build of the xml files like missing lists. Also regular expressions in the xml can be tested better before used in plugins. Refine the testmethods in Syntax::Highlight::Engine::Kate::Template, so that choices for casesensitivity, dynamic behaviour and lookahead can be determined at generate time of the plugin, might increase throughput. Implement codefolding. =head1 ACKNOWLEDGEMENTS All the people who wrote Kate and the syntax highlight xml files. =head1 AUTHOR AND COPYRIGHT This module is written and maintained by: Hans Jeuken < haje at toneel dot demon dot nl > Copyright (c) 2006 by Hans Jeuken, all rights reserved. You may freely distribute and/or modify this module under the same terms as Perl itself. =head1 SEE ALSO Syntax::Highlight::Engine::Kate::Template http:://www.kate-editor.org =cut Syntax-Highlight-Engine-Kate-0.14/t/perl/before/template.pl0000755000175000017500000006560613032300413023076 0ustar manwarmanwar# Copyright (c) 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. package Syntax::Highlight::Engine::Kate::Template; our $VERSION = '0.06'; use strict; use Carp qw(cluck); use Data::Dumper; #my $regchars = '\\^.$|()[]*+?'; sub new { my $proto = shift; my $class = ref($proto) || $proto; my %args = (@_); my $debug = delete $args{'debug'}; unless (defined($debug)) { $debug = 0 }; my $substitutions = delete $args{'substitutions'}; unless (defined($substitutions)) { $substitutions = {} }; my $formattable = delete $args{'format_table'}; unless (defined($formattable)) { $formattable = {} }; my $engine = delete $args{'engine'}; my $self = {}; $self->{'attributes'} = {}, $self->{'captured'} = []; $self->{'contextdata'} = {}; $self->{'basecontext'} = ''; $self->{'debug'} = $debug; $self->{'deliminators'} = ''; $self->{'engine'} = ''; $self->{'format_table'} = $formattable; $self->{'keywordcase'} = 1; $self->{'lastchar'} = ''; $self->{'linesegment'} = ''; $self->{'lists'} = {}; $self->{'linestart'} = 1; $self->{'out'} = []; $self->{'plugins'} = {}; $self->{'snippet'} = ''; $self->{'snippetattribute'} = ''; $self->{'stack'} = []; $self->{'substitutions'} = $substitutions; bless ($self, $class); unless (defined $engine) { $engine = $self }; $self->engine($engine); $self->initialize; return $self; } sub attributes { my $self = shift; if (@_) { $self->{'attributes'} = shift; }; return $self->{'attributes'}; } sub basecontext { my $self = shift; if (@_) { $self->{'basecontext'} = shift; }; return $self->{'basecontext'}; } sub captured { my ($self, $c) = @_; if (defined($c)) { my $t = $self->engine->stackTop; my $n = 0; my @o = (); while (defined($c->[$n])) { push @o, $c->[$n]; $n ++; } if (@o) { $t->[2] = \@o; } }; } sub capturedGet { my ($self, $num) = @_; my $s = $self->engine->stack; if (defined($s->[1])) { my $c = $s->[1]->[2]; $num --; if (defined($c)) { if (defined($c->[$num])) { my $r = $c->[$num]; return $r; } else { warn "capture number $num not defined"; } } else { warn "dynamic substitution is called for but nothing to substitute\n"; return undef; } } else { warn "no parent context to take captures from"; } } #sub captured { # my $self = shift; # if (@_) { # $self->{'captured'} = shift; ## print Dumper($self->{'captured'}); # }; # return $self->{'captured'} ## my ($self, $c) = @_; ## if (defined($c)) { ## my $t = $self->engine->stackTop; ## my $n = 0; ## my @o = (); ## while (defined($c->[$n])) { ## push @o, $c->[$n]; ## $n ++; ## } ## if (@o) { ## $t->[2] = \@o; ## } ## }; #} # #sub capturedGet { # my ($self, $num) = @_; # my $s = $self->captured; # if (defined $s) { # $num --; # if (defined($s->[$num])) { # return $s->[$num]; # } else { # $self->logwarning("capture number $num not defined"); # } # } else { # $self->logwarning("dynamic substitution is called for but nothing to substitute"); # return undef; # } #} sub capturedParse { my ($self, $string, $mode) = @_; my $s = ''; if (defined($mode)) { if ($string =~ s/^(\d)//) { $s = $self->capturedGet($1); if ($string ne '') { $self->logwarning("character class is longer then 1 character, ignoring the rest"); } } } else { while ($string ne '') { if ($string =~ s/^([^\%]*)\%(\d)//) { my $r = $self->capturedGet($2); if ($r ne '') { $s = $s . $1 . $r } else { $s = $s . $1 . '%' . $2; $self->logwarning("target is an empty string"); } } else { $string =~ s/^(.)//; $s = "$s$1"; } } } return $s; } sub column { my $self = shift; return length($self->linesegment); } sub contextdata { my $self = shift; if (@_) { $self->{'contextdata'} = shift; }; return $self->{'contextdata'}; } sub contextInfo { my ($self, $context, $item) = @_; if (exists $self->contextdata->{$context}) { my $c = $self->contextdata->{$context}; if (exists $c->{$item}) { return $c->{$item} } else { return undef; } } else { $self->logwarning("undefined context '$context'"); return undef; } } sub contextParse { my ($self, $plug, $context) = @_; if ($context =~ /^#pop/i) { while ($context =~ s/#pop//i) { $self->stackPull; } } elsif ($context =~ /^#stay/i) { #don't do anything } elsif ($context =~ /^##(.+)/) { my $new = $self->pluginGet($1); $self->stackPush([$new, $new->basecontext]); } else { $self->stackPush([$plug, $context]); } } sub debug { my $self = shift; if (@_) { $self->{'debug'} = shift; }; return $self->{'debug'}; } sub debugTest { my $self = shift; if (@_) { $self->{'debugtest'} = shift; }; return $self->{'debugtest'}; } sub deliminators { my $self = shift; if (@_) { $self->{'deliminators'} = shift; }; return $self->{'deliminators'}; } sub engine { my $self = shift; if (@_) { $self->{'engine'} = shift; }; return $self->{'engine'}; } sub firstnonspace { my ($self, $string) = @_; my $line = $self->linesegment; if (($line =~ /^\s*$/) and ($string =~ /^[^\s]/)) { return 1 } return '' } sub formatTable { my $self = shift; if (@_) { $self->{'format_table'} = shift; }; return $self->{'format_table'}; } sub highlight { my ($self, $text) = @_; $self->snippet(''); my $out = $self->out; @$out = (); while ($text ne '') { my $top = $self->stackTop; if (defined($top)) { my ($plug, $context) = @$top; if ($text =~ s/^(\n)//) { $self->snippetForce; my $e = $plug->contextInfo($context, 'lineending'); if (defined($e)) { $self->contextParse($plug, $e) } my $attr = $plug->attributes->{$plug->contextInfo($context, 'attribute')}; $self->snippetParse($1, $attr); $self->snippetForce; $self->linesegment(''); my $b = $plug->contextInfo($context, 'linebeginning'); if (defined($b)) { $self->contextParse($plug, $b) } } else { my $sub = $plug->contextInfo($context, 'callback'); my $result = &$sub($plug, \$text); unless($result) { my $f = $plug->contextInfo($context, 'fallthrough'); if (defined($f)) { $self->contextParse($plug, $f); } else { $text =~ s/^(.)//; my $attr = $plug->attributes->{$plug->contextInfo($context, 'attribute')}; $self->snippetParse($1, $attr); } } } } else { push @$out, length($text), 'Normal'; $text = ''; } } $self->snippetForce; return @$out; } sub highlightText { my ($self, $text) = @_; my $res = ''; my @hl = $self->highlight($text); while (@hl) { my $f = shift @hl; my $t = shift @hl; unless (defined($t)) { $t = 'Normal' } my $s = $self->substitutions; my $rr = ''; while ($f ne '') { my $k = substr($f , 0, 1); $f = substr($f, 1, length($f) -1); if (exists $s->{$k}) { $rr = $rr . $s->{$k} } else { $rr = $rr . $k; } } my $rt = $self->formatTable; if (exists $rt->{$t}) { my $o = $rt->{$t}; $res = $res . $o->[0] . $rr . $o->[1]; } else { $res = $res . $rr; $self->logwarning("undefined format tag '$t'"); } } return $res; } sub includePlugin { my ($self, $language, $text) = @_; my $eng = $self->engine; my $plug = $eng->pluginGet($language); if (defined($plug)) { my $context = $plug->basecontext; my $call = $plug->contextInfo($context, 'callback'); if (defined($call)) { return &$call($plug, $text); } else { $self->logwarning("cannot find callback for context '$context'"); } } return 0; } sub includeRules { my ($self, $context, $text) = @_; my $call = $self->contextInfo($context, 'callback'); if (defined($call)) { return &$call($self, $text); } else { $self->logwarning("cannot find callback for context '$context'"); } return 0; } sub initialize { my $self = shift; if ($self->engine eq $self) { $self->stack([[$self, $self->basecontext]]); } } sub keywordscase { my $self = shift; if (@_) { $self->{'keywordcase'} = shift; } return $self->{'keywordscase'} } sub languagePlug { my ($cw, $name) = @_; my %numb = ( '1' => 'One', '2' => 'Two', '3' => 'Three', '4' => 'Four', '5' => 'Five', '6' => 'Six', '7' => 'Seven', '8' => 'Eight', '9' => 'Nine', '0' => 'Zero', ); if ($name =~ s/^(\d)//) { $name = $numb{$1} . $name; } $name =~ s/\.//; $name =~ s/\+/plus/g; $name =~ s/\-/minus/g; $name =~ s/#/dash/g; $name =~ s/[^0-9a-zA-Z]/_/g; $name =~ s/__/_/g; $name =~ s/_$//; $name = ucfirst($name); return $name; } sub lastchar { my $self = shift; my $l = $self->linesegment; if ($l eq '') { return "\n" } #last character was a newline return substr($l, length($l) - 1, 1); } sub lastcharDeliminator { my $self = shift; my $deliminators = '\s|\~|\!|\%|\^|\&|\*|\+|\(|\)|-|=|\{|\}|\[|\]|:|;|<|>|,|\\|\||\.|\?|\/'; if ($self->linestart or ($self->lastchar =~ /$deliminators/)) { return 1; } return ''; } sub linesegment { my $self = shift; if (@_) { $self->{'linesegment'} = shift; }; return $self->{'linesegment'}; } sub linestart { my $self = shift; if ($self->linesegment eq '') { return 1 } return ''; } sub lists { my $self = shift; if (@_) { $self->{'lists'} = shift; } return $self->{'lists'} } sub out { my $self = shift; if (@_) { $self->{'out'} = shift; } return $self->{'out'}; } sub listAdd { my $self = shift; my $listname = shift; my $lst = $self->lists; if (@_) { my @l = reverse sort @_; $lst->{$listname} = \@l; } else { $lst->{$listname} = []; } } sub logwarning { my ($self, $warning) = @_; my $top = $self->engine->stackTop; if (defined $top) { my $lang = $top->[0]->language; my $context = $top->[1]; $warning = "$warning\n Language => $lang, Context => $context\n"; } else { $warning = "$warning\n STACK IS EMPTY: PANIC\n" } cluck($warning); } sub parseResult { my ($self, $text, $string, $lahead, $column, $fnspace, $context, $attr) = @_; my $eng = $self->engine; if ($fnspace) { unless ($eng->firstnonspace($$text)) { return '' } } if (defined($column)) { if ($column ne $eng->column) { return ''; } } unless ($lahead) { $$text = substr($$text, length($string)); my $r; unless (defined($attr)) { my $t = $eng->stackTop; my ($plug, $ctext) = @$t; $r = $plug->attributes->{$plug->contextInfo($ctext, 'attribute')}; } else { $r = $self->attributes->{$attr}; } $eng->snippetParse($string, $r); } $eng->contextParse($self, $context); return 1 } sub pluginGet { my ($self, $language) = @_; my $plugs = $self->{'plugins'}; unless (exists($plugs->{$language})) { my $modname = 'Syntax::Highlight::Engine::Kate::' . $self->languagePlug($language); unless (defined($modname)) { $self->logwarning("no valid module found for language '$language'"); return undef; } my $plug; eval "use $modname; \$plug = new $modname(engine => \$self);"; if (defined($plug)) { $plugs->{$language} = $plug; } else { $self->logwarning("cannot create plugin for language '$language'\n$@"); } } if (exists($plugs->{$language})) { return $plugs->{$language}; } return undef; } sub reset { my $self = shift; $self->stack([[$self, $self->basecontext]]); $self->out([]); $self->snippet(''); } sub snippet { my $self = shift; if (@_) { $self->{'snippet'} = shift; } return $self->{'snippet'}; } sub snippetAppend { my ($self, $ch) = @_; return if not defined $ch; $self->{'snippet'} = $self->{'snippet'} . $ch; if ($ch ne '') { $self->linesegment($self->linesegment . $ch); } return; } sub snippetAttribute { my $self = shift; if (@_) { $self->{'snippetattribute'} = shift; } return $self->{'snippetattribute'}; } sub snippetForce { my $self = shift; my $parse = $self->snippet; if ($parse ne '') { my $out = $self->{'out'}; push(@$out, $parse, $self->snippetAttribute); $self->snippet(''); } } sub snippetParse { my $self = shift; my $snip = shift; my $attr = shift; if ((defined $attr) and ($attr ne $self->snippetAttribute)) { $self->snippetForce; $self->snippetAttribute($attr); } $self->snippetAppend($snip); } sub stack { my $self = shift; if (@_) { $self->{'stack'} = shift; } return $self->{'stack'}; } sub stackPush { my ($self, $val) = @_; my $stack = $self->stack; unshift(@$stack, $val); } sub stackPull { my ($self, $val) = @_; my $stack = $self->stack; return shift(@$stack); } sub stackTop { my $self = shift; return $self->stack->[0]; } sub stateCompare { my ($self, $state) = @_; my $h = [ $self->stateGet ]; my $equal = 0; if (Dumper($h) eq Dumper($state)) { $equal = 1 }; return $equal; } sub stateGet { my $self = shift; my $s = $self->stack; return @$s; } sub stateSet { my $self = shift; my $s = $self->stack; @$s = (@_); } sub substitutions { my $self = shift; if (@_) { $self->{'substitutions'} = shift; } return $self->{'substitutions'}; } sub testAnyChar { my $self = shift; my $text = shift; my $string = shift; my $insensitive = shift; my $test = substr($$text, 0, 1); my $bck = $test; if ($insensitive) { $string = lc($string); $test = lc($test); } if (index($string, $test) > -1) { return $self->parseResult($text, $bck, @_); } return '' } sub testDetectChar { my $self = shift; my $text = shift; my $char = shift; my $insensitive = shift; my $dyn = shift; if ($dyn) { $char = $self->capturedParse($char, 1); } my $test = substr($$text, 0, 1); my $bck = $test; if ($insensitive) { $char = lc($char); $test = lc($test); } if ($char eq $test) { return $self->parseResult($text, $bck, @_); } return '' } sub testDetect2Chars { my $self = shift; my $text = shift; my $char = shift; my $char1 = shift; my $insensitive = shift; my $dyn = shift; if ($dyn) { $char = $self->capturedParse($char, 1); $char1 = $self->capturedParse($char1, 1); } my $string = $char . $char1; my $test = substr($$text, 0, 2); my $bck = $test; if ($insensitive) { $string = lc($string); $test = lc($test); } if ($string eq $test) { return $self->parseResult($text, $bck, @_); } return '' } sub testDetectIdentifier { my $self = shift; my $text = shift; if ($$text =~ /^([a-zA-Z_][a-zA-Z0-9_]+)/) { return $self->parseResult($text, $1, @_); } return '' } sub testDetectSpaces { my $self = shift; my $text = shift; if ($$text =~ /^([\\040|\\t]+)/) { return $self->parseResult($text, $1, @_); } return '' } sub testFloat { my $self = shift; my $text = shift; if ($self->engine->lastcharDeliminator) { if ($$text =~ /^((?=\.?\d)\d*(?:\.\d*)?(?:[Ee][+-]?\d+)?)/) { return $self->parseResult($text, $1, @_); } } return '' } sub testHlCChar { my $self = shift; my $text = shift; if ($$text =~ /^('.')/) { return $self->parseResult($text, $1, @_); } return '' } sub testHlCHex { my $self = shift; my $text = shift; if ($self->engine->lastcharDeliminator) { if ($$text =~ /^(0x[0-9a-fA-F]+)/) { return $self->parseResult($text, $1, @_); } } return '' } sub testHlCOct { my $self = shift; my $text = shift; if ($self->engine->lastcharDeliminator) { if ($$text =~ /^(0[0-7]+)/) { return $self->parseResult($text, $1, @_); } } return '' } sub testHlCStringChar { my $self = shift; my $text = shift; if ($$text =~ /^(\\[a|b|e|f|n|r|t|v|'|"|\?])/) { return $self->parseResult($text, $1, @_); } if ($$text =~ /^(\\x[0-9a-fA-F][0-9a-fA-F]?)/) { return $self->parseResult($text, $1, @_); } if ($$text =~ /^(\\[0-7][0-7]?[0-7]?)/) { return $self->parseResult($text, $1, @_); } return '' } sub testInt { my $self = shift; my $text = shift; if ($self->engine->lastcharDeliminator) { if ($$text =~ /^([+-]?\d+)/) { return $self->parseResult($text, $1, @_); } } return '' } sub testKeyword { my $self = shift; my $text = shift; my $list = shift; my $eng = $self->engine; my $deliminators = $self->deliminators; if (($eng->lastcharDeliminator) and ($$text =~ /^([^$deliminators]+)/)) { my $match = $1; my $l = $self->lists->{$list}; if (defined($l)) { my @list = @$l; my @rl = (); unless ($self->keywordscase) { @rl = grep { (lc($match) eq lc($_)) } @list; } else { @rl = grep { ($match eq $_) } @list; } if (@rl) { return $self->parseResult($text, $match, @_); } } else { $self->logwarning("list '$list' is not defined, failing test"); } } return '' } sub testLineContinue { my $self = shift; my $text = shift; my $lahead = shift; if ($lahead) { if ($$text =~ /^\\\n/) { $self->parseResult($text, "\\", $lahead, @_); return 1; } } else { if ($$text =~ s/^(\\)(\n)/$2/) { return $self->parseResult($text, "\\", $lahead, @_); } } return '' } sub testRangeDetect { my $self = shift; my $text = shift; my $char = shift; my $char1 = shift; my $insensitive = shift; my $string = "$char\[^$char1\]+$char1"; return $self->testRegExpr($text, $string, $insensitive, 0, @_); } sub testRegExpr { my $self = shift; my $text = shift; my $reg = shift; my $insensitive = shift; my $dynamic = shift; if ($dynamic) { $reg = $self->capturedParse($reg); } my $eng = $self->engine; if ($reg =~ s/^\^//) { unless ($eng->linestart) { return ''; } } elsif ($reg =~ s/^\\(b)//i) { my $lastchar = $self->engine->lastchar; if ($1 eq 'b') { if ($lastchar =~ /\w/) { return '' } } else { if ($lastchar =~ /\W/) { return '' } } } # $reg = "^($reg)"; $reg = "^$reg"; my $pos; # my @cap = (); my $sample = $$text; # emergency measurements to avoid exception (szabgab) $reg = eval { qr/$reg/ }; if ($@) { warn $@; return ''; } if ($insensitive) { if ($sample =~ /$reg/ig) { $pos = pos($sample); # @cap = ($1, $2, $3, $4, $5, $6, $7, $8, $9); # my @cap = (); if ($#-) { no strict 'refs'; my @cap = map {$$_} 1 .. $#-; $self->captured(\@cap) } # my $r = 1; # my $c = 1; # my @cap = (); # while ($r) { # eval "if (defined\$$c) { push \@cap, \$$c } else { \$r = 0 }"; # $c ++; # } # if (@cap) { $self->captured(\@cap) }; } } else { if ($sample =~ /$reg/g) { $pos = pos($sample); # @cap = ($1, $2, $3, $4, $5, $6, $7, $8, $9); # my @cap = (); if ($#-) { no strict 'refs'; my @cap = map {$$_} 1 .. $#-; $self->captured(\@cap); } # my $r = 1; # my $c = 1; # my @cap = (); # while ($r) { # eval "if (defined\$$c) { push \@cap, \$$c } else { \$r = 0 }"; # $c ++; # } # if (@cap) { $self->captured(\@cap) }; } } if (defined($pos) and ($pos > 0)) { my $string = substr($$text, 0, $pos); return $self->parseResult($text, $string, @_); } return '' } sub testStringDetect { my $self = shift; my $text = shift; my $string = shift; my $insensitive = shift; my $dynamic = shift; if ($dynamic) { $string = $self->capturedParse($string); } my $test = substr($$text, 0, length($string)); my $bck = $test; if ($insensitive) { $string = lc($string); $test = lc($test); } if ($string eq $test) { return $self->parseResult($text, $bck, @_); } return '' } 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Template - a template for syntax highlighting plugins =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Template is a framework to assist authors of plugin modules. All methods to provide highlighting to the Syntax::Highlight::Engine::Kate module are there, Just no syntax definitions and callbacks. An instance of Syntax::Highlight::Engine::Kate::Template should never be created, it's meant to be sub classed only. =head1 METHODS =over 4 =item B(I); Sets and returns a reference to the attributes hash. =item B(I); Sets and returns the basecontext instance variable. This is the context that is used when highlighting starts. =item B(I<$cap>); Puts $cap in the first element of the stack, the current context. Used when the context is dynamic. =item B(I<$num>); Returns the $num'th element that was captured in the current context. =item B(I<$string>, I<$mode>); If B<$mode> is specified, B<$string> should only be one character long and numeric. B will return the Nth captured element of the current context. If B<$mode> is not specified, all occurences of %[1-9] will be replaced by the captured element of the current context. =item B returns the column position in the line that is currently highlighted. =item B(I<\%data>); Sets and returns a reference to the contextdata hash. =item B(I<$context>, I<$item>); returns the value of several context options. B<$item> can be B, B, B, B, B. =item B(I<$plugin>, I<$context>); Called by the plugins after a test succeeds. if B<$context> has following values: #pop returns to the previous context, removes to top item in the stack. Can also be specified as #pop#pop etc. #stay does nothing. ##.... Switches to the plugin specified in .... and assumes it's basecontext. .... Swtiches to the context specified in .... =item B(I); Sets and returns a string that is a regular expression for detecting deliminators. =item B Returns a reference to the Syntax::Highlight::Engine::Kate module that created this plugin. =item B(I<$string>); returns true if the current line did not contain a non-spatial character so far and the first character in B<$string> is also a spatial character. =item B sets and returns the instance variable B. See also the option B =item B(I<$text>); highlights I<$text>. It does so by selecting the proper callback from the B hash and invoke it. It will do so untill $text has been reduced to an empty string. returns a paired list of snippets of text and the attribute with which they should be highlighted. =item B(I<$text>); highlights I<$text> and reformats it using the B and B =item B(I<$language>, I<\$text>); Includes the plugin for B<$language> in the highlighting. =item B(I<$language>, I<\$text>); Includes the plugin for B<$language> in the highlighting. =item B Sets and returns the keywordscase instance variable. =item B return the last character that was processed. =item B returns true if the last character processed was a deliminator. =item B returns the string of text in the current line that has been processed so far, =item B returns true if processing is currently at the beginning of a line. =item B(I<'listname'>, I<$item1>, I<$item2> ...); Adds a list to the 'lists' hash. =item B(I); sets and returns the instance variable 'lists'. =item B(I); sets and returns the instance variable 'out'. =item B(I<\$text>, I<$match>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); Called by every one of the test methods below. If the test matches, it will do a couple of subtests. If B<$column> is a defined numerical value it will test if the process is at the requested column. If B<$firnonspace> is true, it will test this also. Ig it is not a look ahead and all tests are passed, B<$match> is then parsed and removed from B<$$text>. =item B(I<$language>); Returns a reference to a plugin object for the specified language. Creating an instance if needed. =item B Resets the highlight engine to a fresh state, does not change the syntx. =item B Contains the current snippet of text that will have one attribute. The moment the attribute changes it will be parsed. =item B(I<$string>) appends I<$string> to the current snippet. =item B(I<$attribute>) Sets and returns the used attribute. =item B Forces the current snippet to be parsed. =item B(I<$text>, I) If attribute is defined and differs from the current attribute it does a snippetForce and sets the current attribute to B<$attribute>. Then it does a snippetAppend of B<$text> =item B sets and returns the instance variable 'stack', a reference to an array =item B retrieves the element that is on top of the stack, decrements stacksize by 1. =item B(I<$tagname>); puts I<$tagname> on top of the stack, increments stacksize by 1 =item B Retrieves the element that is on top of the stack. =item B(I<\@state>) Compares two lists, \@state and the stack. returns true if they match. =item B Returns a list containing the entire stack. =item B(I<@list>) Accepts I<@list> as the current stack. =item B sets and returns a reference to the substitutions hash. =back The methods below all return a boolean value. =over 4 =item B(I<\$text>, I<$string>, I<$insensitive>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$char>, I<$insensitive>, I<$dynamic>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$char1>, I<$char2>, I<$insensitive>, I<$dynamic>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$list>, I<$insensitive>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$char1>, I<$char2>, I<$insensitive>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$reg>, I<$insensitive>, I<$dynamic>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$string>, I<$insensitive>, I<$dynamic>, II<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =back =head1 ACKNOWLEDGEMENTS All the people who wrote Kate and the syntax highlight xml files. =head1 AUTHOR AND COPYRIGHT This module is written and maintained by: Hans Jeuken < haje at toneel dot demon dot nl > Copyright (c) 2006 by Hans Jeuken, all rights reserved. You may freely distribute and/or modify this module under same terms as Perl itself =head1 SEE ALSO Synax::Highlight::Engine::Kate http:://www.kate-editor.orgSyntax-Highlight-Engine-Kate-0.14/t/perl/highlighted/0000755000175000017500000000000013226471445021747 5ustar manwarmanwarSyntax-Highlight-Engine-Kate-0.14/t/perl/highlighted/maze.pl0000644000175000017500000003555313032300413023230 0ustar manwarmanwar#!perl use strict; use warnings; use diagnostics; use List::Util 'shuffle'; # The size of the maze. Take the arguments from the command line or from the # default. my ( $HEIGHT, $WIDTH ) = @ARGV ? @ARGV : ( 20, 20 ); # Time::HiRes was officially released with Perl 5.8.0, though Module::Corelist # reports that it was actually released as early as v5.7.3. If you don't have # this module, your version of Perl is probably over a decade old use Time::HiRes 'usleep'; # In Perl, $^O is the name of your operating system. On Windows (as of this # writing), it always 'MSWin32'. use constant IS_WIN32 => 'MSWin32' eq $^O; # On Windows, we assume that the command to clear the screen is 'cls'. On all # other systems, we assume it's 'clear'. You may need to adjust this. use constant CLEAR => IS_WIN32 ? 'cls' : 'clear'; # We will only redraw the screen (and thus show the recursive maze generation) # if and only if the system is capable of clearing the screen. The system() # command returns 0 upon success. See perldoc -f system. # The following line works because $x == $y returns a boolean value. #use constant CAN_REDRAW => 0 == system(CLEAR); use constant CAN_REDRAW => 0; # Time in microseconds between screen redraws. See Time::HiRes and the usleep # function use constant DELAY => 10_000; use constant OPPOSITE_OF => { north => 'south', south => 'north', west => 'east', east => 'west', }; my @maze; tunnel( 0, 0, \@maze ); my $num = 10_000; system(CLEAR) if CAN_REDRAW; print render_maze( \@maze ); exit; sub tunnel { my ( $x, $y, $maze ) = @_; if (CAN_REDRAW) { my $render = render_maze($maze); system(CLEAR); print $render; usleep DELAY; } # Here we need to use a unary plus in front of OPPOSITE_OF so that # Perl understands that this is a constant and that we're not trying # to access the %OPPOSITE_OF variable. my @directions = shuffle keys %{ +OPPOSITE_OF }; foreach my $direction (@directions) { my ( $new_x, $new_y ) = ( $x, $y ); if ( 'east' eq $direction ) { $new_x += 1; } elsif ( 'west' eq $direction ) { $new_x -= 1; } elsif ( 'south' eq $direction ) { $new_y += 1; } else { $new_y -= 1; } if ( have_not_visited( $new_x, $new_y, $maze ) ) { $maze->[$y][$x]{$direction} = 1; $maze->[$new_y][$new_x]{ OPPOSITE_OF->{$direction} } = 1; # This program will often recurse more than one hundred levels # deep and this is Perl's default recursion depth level prior to # issuing warnings. In this case, we're telling Perl that we know # that we'll exceed the recursion depth and to now warn us about # it no warnings 'recursion'; tunnel( $new_x, $new_y, $maze ); } } } sub have_not_visited { my ( $x, $y, $maze ) = @_; # the first two lines return false if we're out of bounds return if $x < 0 or $y < 0; return if $x > $WIDTH - 1 or $y > $HEIGHT - 1; # this returns false if we've already visited this cell return if $maze->[$y][$x]; # return true return 1; } sub render_maze { my $maze = shift; my $as_string = "_" x ( 1 + $WIDTH * 2 ); $as_string .= "\n"; for my $y ( 0 .. $HEIGHT - 1 ) { $as_string .= "|"; for my $x ( 0 .. $WIDTH - 1 ) { my $cell = $maze->[$y][$x]; $as_string .= $cell->{south} ? " " : "_"; $as_string .= $cell->{east} ? " " : "|"; } $as_string .= "\n"; } return $as_string; } Syntax-Highlight-Engine-Kate-0.14/t/perl/highlighted/kate.pl0000644000175000017500000043144713174330044023234 0ustar manwarmanwar # Copyright (c) 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. package Syntax::Highlight::Engine::Kate; use 5.006; our $VERSION = '0.06'; use strict; use warnings; use Carp; use Data::Dumper; use File::Basename; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my %args = (@_); my $add = delete $args{'plugins'}; unless (defined($add)) { $add = [] }; my $language = delete $args{'language'}; unless (defined($language)) { $language = 'Off' }; my $self = $class->SUPER::new(%args); $self->{'plugins'} = {}; #begin autoinsert $self->{'extensions'} = { ' *.cls' => ['LaTeX', ], ' *.dtx' => ['LaTeX', ], ' *.ltx' => ['LaTeX', ], ' *.sty' => ['LaTeX', ], '*.4GL' => ['4GL', ], '*.4gl' => ['4GL', ], '*.ABC' => ['ABC', ], '*.ASM' => ['AVR Assembler', 'PicAsm', ], '*.BAS' => ['FreeBASIC', ], '*.BI' => ['FreeBASIC', ], '*.C' => ['C++', 'C', 'ANSI C89', ], '*.D' => ['D', ], '*.F' => ['Fortran', ], '*.F90' => ['Fortran', ], '*.F95' => ['Fortran', ], '*.FOR' => ['Fortran', ], '*.FPP' => ['Fortran', ], '*.GDL' => ['GDL', ], '*.H' => ['C++', ], '*.JSP' => ['JSP', ], '*.LOGO' => ['de_DE', 'en_US', 'nl', ], '*.LY' => ['LilyPond', ], '*.Logo' => ['de_DE', 'en_US', 'nl', ], '*.M' => ['Matlab', 'Octave', ], '*.MAB' => ['MAB-DB', ], '*.Mab' => ['MAB-DB', ], '*.PER' => ['4GL-PER', ], '*.PIC' => ['PicAsm', ], '*.PRG' => ['xHarbour', 'Clipper', ], '*.R' => ['R Script', ], '*.S' => ['GNU Assembler', ], '*.SQL' => ['SQL', 'SQL (MySQL)', 'SQL (PostgreSQL)', ], '*.SRC' => ['PicAsm', ], '*.V' => ['Verilog', ], '*.VCG' => ['GDL', ], '*.a' => ['Ada', ], '*.abc' => ['ABC', ], '*.ada' => ['Ada', ], '*.adb' => ['Ada', ], '*.ado' => ['Stata', ], '*.ads' => ['Ada', ], '*.ahdl' => ['AHDL', ], '*.ai' => ['PostScript', ], '*.ans' => ['Ansys', ], '*.asm' => ['AVR Assembler', 'Asm6502', 'Intel x86 (NASM)', 'PicAsm', ], '*.asm-avr' => ['AVR Assembler', ], '*.asp' => ['ASP', ], '*.awk' => ['AWK', ], '*.bas' => ['FreeBASIC', ], '*.basetest' => ['BaseTest', ], '*.bash' => ['Bash', ], '*.bi' => ['FreeBASIC', ], '*.bib' => ['BibTeX', ], '*.bro' => ['Component-Pascal', ], '*.c' => ['C', 'ANSI C89', 'LPC', ], '*.c++' => ['C++', ], '*.cc' => ['C++', ], '*.cfc' => ['ColdFusion', ], '*.cfg' => ['Quake Script', ], '*.cfm' => ['ColdFusion', ], '*.cfml' => ['ColdFusion', ], '*.cg' => ['Cg', ], '*.cgis' => ['CGiS', ], '*.ch' => ['xHarbour', 'Clipper', ], '*.cis' => ['Cisco', ], '*.cl' => ['Common Lisp', ], '*.cmake' => ['CMake', ], '*.config' => ['Logtalk', ], '*.cp' => ['Component-Pascal', ], '*.cpp' => ['C++', ], '*.cs' => ['C#', ], '*.css' => ['CSS', ], '*.cue' => ['CUE Sheet', ], '*.cxx' => ['C++', ], '*.d' => ['D', ], '*.daml' => ['XML', ], '*.dbm' => ['ColdFusion', ], '*.def' => ['Modula-2', ], '*.desktop' => ['.desktop', ], '*.diff' => ['Diff', ], '*.do' => ['Stata', ], '*.docbook' => ['XML', ], '*.dox' => ['Doxygen', ], '*.doxygen' => ['Doxygen', ], '*.e' => ['E Language', 'Eiffel', 'Euphoria', ], '*.ebuild' => ['Bash', ], '*.eclass' => ['Bash', ], '*.eml' => ['Email', ], '*.eps' => ['PostScript', ], '*.err' => ['4GL', ], '*.ex' => ['Euphoria', ], '*.exu' => ['Euphoria', ], '*.exw' => ['Euphoria', ], '*.f' => ['Fortran', ], '*.f90' => ['Fortran', ], '*.f95' => ['Fortran', ], '*.fe' => ['ferite', ], '*.feh' => ['ferite', ], '*.flex' => ['Lex/Flex', ], '*.for' => ['Fortran', ], '*.fpp' => ['Fortran', ], '*.frag' => ['GLSL', ], '*.gdl' => ['GDL', ], '*.glsl' => ['GLSL', ], '*.guile' => ['Scheme', ], '*.h' => ['C++', 'C', 'ANSI C89', 'Inform', 'LPC', 'Objective-C', ], '*.h++' => ['C++', ], '*.hcc' => ['C++', ], '*.hpp' => ['C++', ], '*.hs' => ['Haskell', ], '*.hsp' => ['Spice', ], '*.ht' => ['Apache Configuration', ], '*.htm' => ['HTML', ], '*.html' => ['HTML', 'Mason', ], '*.hxx' => ['C++', ], '*.i' => ['progress', ], '*.idl' => ['IDL', ], '*.inc' => ['POV-Ray', 'PHP (HTML)', 'LPC', ], '*.inf' => ['Inform', ], '*.ini' => ['INI Files', ], '*.java' => ['Java', ], '*.js' => ['JavaScript', ], '*.jsp' => ['JSP', ], '*.katetemplate' => ['Kate File Template', ], '*.kbasic' => ['KBasic', ], '*.kdelnk' => ['.desktop', ], '*.l' => ['Lex/Flex', ], '*.ldif' => ['LDIF', ], '*.lex' => ['Lex/Flex', ], '*.lgo' => ['de_DE', 'en_US', 'nl', ], '*.lgt' => ['Logtalk', ], '*.lhs' => ['Literate Haskell', ], '*.lisp' => ['Common Lisp', ], '*.logo' => ['de_DE', 'en_US', 'nl', ], '*.lsp' => ['Common Lisp', ], '*.lua' => ['Lua', ], '*.ly' => ['LilyPond', ], '*.m' => ['Matlab', 'Objective-C', 'Octave', ], '*.m3u' => ['M3U', ], '*.mab' => ['MAB-DB', ], '*.md' => ['Modula-2', ], '*.mi' => ['Modula-2', ], '*.ml' => ['Objective Caml', 'SML', ], '*.mli' => ['Objective Caml', ], '*.moc' => ['C++', ], '*.mod' => ['Modula-2', ], '*.mup' => ['Music Publisher', ], '*.not' => ['Music Publisher', ], '*.o' => ['LPC', ], '*.octave' => ['Octave', ], '*.p' => ['Pascal', 'progress', ], '*.pas' => ['Pascal', ], '*.pb' => ['PureBasic', ], '*.per' => ['4GL-PER', ], '*.per.err' => ['4GL-PER', ], '*.php' => ['PHP (HTML)', ], '*.php3' => ['PHP (HTML)', ], '*.phtm' => ['PHP (HTML)', ], '*.phtml' => ['PHP (HTML)', ], '*.pic' => ['PicAsm', ], '*.pike' => ['Pike', ], '*.pl' => ['Perl', ], '*.pls' => ['INI Files', ], '*.pm' => ['Perl', ], '*.po' => ['GNU Gettext', ], '*.pot' => ['GNU Gettext', ], '*.pov' => ['POV-Ray', ], '*.pp' => ['Pascal', ], '*.prg' => ['xHarbour', 'Clipper', ], '*.pro' => ['RSI IDL', ], '*.prolog' => ['Prolog', ], '*.ps' => ['PostScript', ], '*.py' => ['Python', ], '*.pyw' => ['Python', ], '*.rb' => ['Ruby', ], '*.rc' => ['XML', ], '*.rdf' => ['XML', ], '*.reg' => ['WINE Config', ], '*.rex' => ['REXX', ], '*.rib' => ['RenderMan RIB', ], '*.s' => ['GNU Assembler', 'MIPS Assembler', ], '*.sa' => ['Sather', ], '*.sce' => ['scilab', ], '*.scheme' => ['Scheme', ], '*.sci' => ['scilab', ], '*.scm' => ['Scheme', ], '*.sgml' => ['SGML', ], '*.sh' => ['Bash', ], '*.shtm' => ['HTML', ], '*.shtml' => ['HTML', ], '*.siv' => ['Sieve', ], '*.sml' => ['SML', ], '*.sp' => ['Spice', ], '*.spec' => ['RPM Spec', ], '*.sql' => ['SQL', 'SQL (MySQL)', 'SQL (PostgreSQL)', ], '*.src' => ['PicAsm', ], '*.ss' => ['Scheme', ], '*.t2t' => ['txt2tags', ], '*.tcl' => ['Tcl/Tk', ], '*.tdf' => ['AHDL', ], '*.tex' => ['LaTeX', ], '*.tji' => ['TaskJuggler', ], '*.tjp' => ['TaskJuggler', ], '*.tk' => ['Tcl/Tk', ], '*.tst' => ['BaseTestchild', ], '*.uc' => ['UnrealScript', ], '*.v' => ['Verilog', ], '*.vcg' => ['GDL', ], '*.vert' => ['GLSL', ], '*.vhd' => ['VHDL', ], '*.vhdl' => ['VHDL', ], '*.vl' => ['Verilog', ], '*.vm' => ['Velocity', ], '*.w' => ['progress', ], '*.wml' => ['PHP (HTML)', ], '*.wrl' => ['VRML', ], '*.xml' => ['XML', ], '*.xsl' => ['xslt', ], '*.xslt' => ['xslt', ], '*.y' => ['Yacc/Bison', ], '*.ys' => ['yacas', ], '*Makefile*' => ['Makefile', ], '*makefile*' => ['Makefile', ], '*patch' => ['Diff', ], 'CMakeLists.txt' => ['CMake', ], 'ChangeLog' => ['ChangeLog', ], 'QRPGLESRC.*' => ['ILERPG', ], 'apache.conf' => ['Apache Configuration', ], 'apache2.conf' => ['Apache Configuration', ], 'httpd.conf' => ['Apache Configuration', ], 'httpd2.conf' => ['Apache Configuration', ], 'xorg.conf' => ['x.org Configuration', ], }; $self->{'sections'} = { 'Assembler' => [ 'AVR Assembler', 'Asm6502', 'GNU Assembler', 'Intel x86 (NASM)', 'MIPS Assembler', 'PicAsm', ], 'Configuration' => [ '.desktop', 'Apache Configuration', 'Cisco', 'INI Files', 'WINE Config', 'x.org Configuration', ], 'Database' => [ '4GL', '4GL-PER', 'LDIF', 'SQL', 'SQL (MySQL)', 'SQL (PostgreSQL)', 'progress', ], 'Hardware' => [ 'AHDL', 'Spice', 'VHDL', 'Verilog', ], 'Logo' => [ 'de_DE', 'en_US', 'nl', ], 'Markup' => [ 'ASP', 'BibTeX', 'CSS', 'ColdFusion', 'Doxygen', 'GNU Gettext', 'HTML', 'JSP', 'Javadoc', 'Kate File Template', 'LaTeX', 'MAB-DB', 'PostScript', 'SGML', 'VRML', 'Wikimedia', 'XML', 'txt2tags', 'xslt', ], 'Other' => [ 'ABC', 'Alerts', 'CMake', 'CSS/PHP', 'CUE Sheet', 'ChangeLog', 'Debian Changelog', 'Debian Control', 'Diff', 'Email', 'JavaScript/PHP', 'LilyPond', 'M3U', 'Makefile', 'Music Publisher', 'POV-Ray', 'RPM Spec', 'RenderMan RIB', ], 'Scientific' => [ 'GDL', 'Matlab', 'Octave', 'TI Basic', 'scilab', ], 'Script' => [ 'Ansys', ], 'Scripts' => [ 'AWK', 'Bash', 'Common Lisp', 'Euphoria', 'JavaScript', 'Lua', 'Mason', 'PHP (HTML)', 'PHP/PHP', 'Perl', 'Pike', 'Python', 'Quake Script', 'R Script', 'REXX', 'Ruby', 'Scheme', 'Sieve', 'TaskJuggler', 'Tcl/Tk', 'UnrealScript', 'Velocity', 'ferite', ], 'Sources' => [ 'ANSI C89', 'Ada', 'C', 'C#', 'C++', 'CGiS', 'Cg', 'Clipper', 'Component-Pascal', 'D', 'E Language', 'Eiffel', 'Fortran', 'FreeBASIC', 'GLSL', 'Haskell', 'IDL', 'ILERPG', 'Inform', 'Java', 'KBasic', 'LPC', 'Lex/Flex', 'Literate Haskell', 'Logtalk', 'Modula-2', 'Objective Caml', 'Objective-C', 'Pascal', 'Prolog', 'PureBasic', 'RSI IDL', 'SML', 'Sather', 'Stata', 'Yacc/Bison', 'xHarbour', 'yacas', ], 'Test' => [ 'BaseTest', 'BaseTestchild', ], }; $self->{'syntaxes'} = { '.desktop' => 'Desktop', '4GL' => 'FourGL', '4GL-PER' => 'FourGLminusPER', 'ABC' => 'ABC', 'AHDL' => 'AHDL', 'ANSI C89' => 'ANSI_C89', 'ASP' => 'ASP', 'AVR Assembler' => 'AVR_Assembler', 'AWK' => 'AWK', 'Ada' => 'Ada', 'Alerts' => 'Alerts', 'Ansys' => 'Ansys', 'Apache Configuration' => 'Apache_Configuration', 'Asm6502' => 'Asm6502', 'BaseTest' => 'BaseTest', 'BaseTestchild' => 'BaseTestchild', 'Bash' => 'Bash', 'BibTeX' => 'BibTeX', 'C' => 'C', 'C#' => 'Cdash', 'C++' => 'Cplusplus', 'CGiS' => 'CGiS', 'CMake' => 'CMake', 'CSS' => 'CSS', 'CSS/PHP' => 'CSS_PHP', 'CUE Sheet' => 'CUE_Sheet', 'Cg' => 'Cg', 'ChangeLog' => 'ChangeLog', 'Cisco' => 'Cisco', 'Clipper' => 'Clipper', 'ColdFusion' => 'ColdFusion', 'Common Lisp' => 'Common_Lisp', 'Component-Pascal' => 'ComponentminusPascal', 'D' => 'D', 'Debian Changelog' => 'Debian_Changelog', 'Debian Control' => 'Debian_Control', 'Diff' => 'Diff', 'Doxygen' => 'Doxygen', 'E Language' => 'E_Language', 'Eiffel' => 'Eiffel', 'Email' => 'Email', 'Euphoria' => 'Euphoria', 'Fortran' => 'Fortran', 'FreeBASIC' => 'FreeBASIC', 'GDL' => 'GDL', 'GLSL' => 'GLSL', 'GNU Assembler' => 'GNU_Assembler', 'GNU Gettext' => 'GNU_Gettext', 'HTML' => 'HTML', 'Haskell' => 'Haskell', 'IDL' => 'IDL', 'ILERPG' => 'ILERPG', 'INI Files' => 'INI_Files', 'Inform' => 'Inform', 'Intel x86 (NASM)' => 'Intel_x86_NASM', 'JSP' => 'JSP', 'Java' => 'Java', 'JavaScript' => 'JavaScript', 'JavaScript/PHP' => 'JavaScript_PHP', 'Javadoc' => 'Javadoc', 'KBasic' => 'KBasic', 'Kate File Template' => 'Kate_File_Template', 'LDIF' => 'LDIF', 'LPC' => 'LPC', 'LaTeX' => 'LaTeX', 'Lex/Flex' => 'Lex_Flex', 'LilyPond' => 'LilyPond', 'Literate Haskell' => 'Literate_Haskell', 'Logtalk' => 'Logtalk', 'Lua' => 'Lua', 'M3U' => 'M3U', 'MAB-DB' => 'MABminusDB', 'MIPS Assembler' => 'MIPS_Assembler', 'Makefile' => 'Makefile', 'Mason' => 'Mason', 'Matlab' => 'Matlab', 'Modula-2' => 'Modulaminus2', 'Music Publisher' => 'Music_Publisher', 'Objective Caml' => 'Objective_Caml', 'Objective-C' => 'ObjectiveminusC', 'Octave' => 'Octave', 'PHP (HTML)' => 'PHP_HTML', 'PHP/PHP' => 'PHP_PHP', 'POV-Ray' => 'POVminusRay', 'Pascal' => 'Pascal', 'Perl' => 'Perl', 'PicAsm' => 'PicAsm', 'Pike' => 'Pike', 'PostScript' => 'PostScript', 'Prolog' => 'Prolog', 'PureBasic' => 'PureBasic', 'Python' => 'Python', 'Quake Script' => 'Quake_Script', 'R Script' => 'R_Script', 'REXX' => 'REXX', 'RPM Spec' => 'RPM_Spec', 'RSI IDL' => 'RSI_IDL', 'RenderMan RIB' => 'RenderMan_RIB', 'Ruby' => 'Ruby', 'SGML' => 'SGML', 'SML' => 'SML', 'SQL' => 'SQL', 'SQL (MySQL)' => 'SQL_MySQL', 'SQL (PostgreSQL)' => 'SQL_PostgreSQL', 'Sather' => 'Sather', 'Scheme' => 'Scheme', 'Sieve' => 'Sieve', 'Spice' => 'Spice', 'Stata' => 'Stata', 'TI Basic' => 'TI_Basic', 'TaskJuggler' => 'TaskJuggler', 'Tcl/Tk' => 'Tcl_Tk', 'UnrealScript' => 'UnrealScript', 'VHDL' => 'VHDL', 'VRML' => 'VRML', 'Velocity' => 'Velocity', 'Verilog' => 'Verilog', 'WINE Config' => 'WINE_Config', 'Wikimedia' => 'Wikimedia', 'XML' => 'XML', 'Yacc/Bison' => 'Yacc_Bison', 'de_DE' => 'De_DE', 'en_US' => 'En_US', 'ferite' => 'Ferite', 'nl' => 'Nl', 'progress' => 'Progress', 'scilab' => 'Scilab', 'txt2tags' => 'Txt2tags', 'x.org Configuration' => 'Xorg_Configuration', 'xHarbour' => 'XHarbour', 'xslt' => 'Xslt', 'yacas' => 'Yacas', }; #end autoinsert $self->{'language '} = ''; bless ($self, $class); if ($language ne '') { $self->language($language); } return $self; } sub extensions { my $self = shift; return $self->{'extensions'}; } #overriding Template's initialize method. now it should not do anything. sub initialize { my $cw = shift; } sub language { my $self = shift; if (@_) { $self->{'language'} = shift; $self->reset; } return $self->{'language'}; } sub languageAutoSet { my ($self, $file) = @_; my $lang = $self->languagePropose($file); if (defined $lang) { $self->language($lang) } else { $self->language('Off') } } sub languageList { my $self = shift; my $l = $self->{'syntaxes'}; return sort {uc($a) cmp uc($b)} keys %$l; } sub languagePropose { my ($self, $file) = @_; my $hsh = $self->extensions; foreach my $key (keys %$hsh) { my $reg = $key; $reg =~ s/\./\\./g; $reg =~ s/\+/\\+/g; $reg =~ s/\*/.*/g; $reg = "$reg\$"; if ($file =~ /$reg/) { return $hsh->{$key}->[0] } } return undef; } sub languagePlug { my ($self, $req) = @_; unless (exists($self->{'syntaxes'}->{$req})) { warn "undefined language: $req"; return undef; } return $self->{'syntaxes'}->{$req}; } sub reset { my $self = shift; my $lang = $self->language; if ($lang eq 'Off') { $self->stack([]); } else { my $plug = $self->pluginGet($lang); my $basecontext = $plug->basecontext; $self->stack([ [$plug, $basecontext] ]); } $self->out([]); $self->snippet(''); } sub sections { my $self = shift; return $self->{'sections'}; } sub syntaxes { my $self = shift; return $self->{'syntaxes'} } 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate - a port to Perl of the syntax highlight engine of the Kate texteditor. =head1 SYNOPSIS #if you want to create a compiled executable, you may want to do this: use Syntax::Highlight::Engine::Kate::All; use Syntax::Highlight::Engine::Kate; my $hl = new Syntax::Highlight::Engine::Kate( language => 'Perl', substitutions => { "<" => "<", ">" => ">", "&" => "&", " " => " ", "\t" => "   ", "\n" => "
\n",
}, format_table => { Alert => ["", ""], BaseN => ["", ""], BString => ["", ""], Char => ["", ""], Comment => ["", ""], DataType => ["", ""], DecVal => ["", ""], Error => ["", ""], Float => ["", ""], Function => ["", ""], IString => ["", ""], Keyword => ["", ""], Normal => ["", ""], Operator => ["", ""], Others => ["", ""], RegionMarker => ["", ""], Reserved => ["", ""], String => ["", ""], Variable => ["", ""], Warning => ["", ""], }, ); #or my $hl = new Syntax::Highlight::Engine::Kate::Perl( substitutions => { "<" => "<", ">" => ">", "&" => "&", " " => " ", "\t" => "   ", "\n" => "
\n",
}, format_table => { Alert => ["", ""], BaseN => ["", ""], BString => ["", ""], Char => ["", ""], Comment => ["", ""], DataType => ["", ""], DecVal => ["", ""], Error => ["", ""], Float => ["", ""], Function => ["", ""], IString => ["", ""], Keyword => ["", ""], Normal => ["", ""], Operator => ["", ""], Others => ["", ""], RegionMarker => ["", ""], Reserved => ["", ""], String => ["", ""], Variable => ["", ""], Warning => ["", ""], }, ); print "\n\n\n\n"; while (my $in = <>) { print $hl->highlightText($in); } print "\n\n"; =head1 DESCRIPTION Syntax::Highlight::Engine::Kate is a port to perl of the syntax highlight engine of the Kate text editor. The language xml files of kate have been rewritten to perl modules using a script. These modules function as plugins to this module. Syntax::Highlight::Engine::Kate inherits Syntax::Highlight::Engine::Kate::Template. =head1 OPTIONS =over 4 =item B Specify the language you want highlighted. look in the B section for supported languages. =item B If you created your own language plugins you may specify a list of them with this option. plugins => [ ["MyModuleName", "MyLanguageName", "*,ext1;*.ext2", "Section"], .... ] =item B This option must be specified if the B method needs to do anything useful for you. All mentioned keys in the synopsis must be specified. =item B With this option you can specify additional formatting options. =back =head1 METHODS =over 4 =item B returns a reference to the extensions hash, =item B(I) Sets and returns the current language that is highlighted. when setting the language a reset is also done. =item B(I<$filename>); Suggests language name for the fiven file B<$filename> =item B returns a list of languages for which plugins have been defined. =item B(I<$language>); returns the module name of the plugin for B<$language> =item B(I<$filename>); Suggests language name for the fiven file B<$filename> =item B Returns a reference to the sections hash. =back =head1 ATTRIBUTES In the kate XML syntax files you find under the section B<> entries like . Kate is an editor so it is ok to have definitions for forground and background colors and so on. However, since this Module is supposed to be a more universal highlight engine, the attributes need to be fully abstract. In which case, Kate does not have enough default attributes defined to fullfill all needs. Kate defines the following standard attributes: B, B, B, B, B, B, B, B, B, B, B, B, B, B. This module leaves out the "ds" part and uses following additional attributes: B, B, B, B, B. I have modified the XML files so that each highlight mode would get it's own attribute. In quite a few cases still not enough attributes were defined. So in some languages different modes have the same attribute. =head1 PLUGINS Below an overview of existing plugins. All have been tested on use and can be created. The ones for which no samplefile is available are marked. Those marked OK have highlighted the testfile without appearant mistakes. This does not mean that all bugs are shaken out. LANGUAGE MODULE COMMENT ******** ****** ****** .desktop Desktop OK 4GL FourGL No sample file 4GL-PER FourGLminusPER No sample file ABC ABC OK AHDL AHDL OK ANSI C89 ANSI_C89 No sample file ASP ASP OK AVR Assembler AVR_Assembler OK AWK AWK OK Ada Ada No sample file Alerts OK hidden module Ansys Ansys No sample file Apache Configuration Apache_Configuration No sample file Asm6502 Asm6502 No sample file Bash Bash OK BibTeX BibTeX OK C C No sample file C# Cdash No sample file C++ Cplusplus OK CGiS CGiS No sample file CMake CMake OK CSS CSS OK CUE Sheet CUE_Sheet No sample file Cg Cg No sample file ChangeLog ChangeLog No sample file Cisco Cisco No sample file Clipper Clipper OK ColdFusion ColdFusion No sample file Common Lisp Common_Lisp OK Component-Pascal ComponentminusPascal No sample file D D No sample file Debian Changelog Debian_Changelog No sample file Debian Control Debian_Control No sample file Diff Diff No sample file Doxygen Doxygen OK E Language E_Language OK Eiffel Eiffel No sample file Email Email OK Euphoria Euphoria OK Fortran Fortran OK FreeBASIC FreeBASIC No sample file GDL GDL No sample file GLSL GLSL OK GNU Assembler GNU_Assembler No sample file GNU Gettext GNU_Gettext No sample file HTML HTML OK Haskell Haskell OK IDL IDL No sample file ILERPG ILERPG No sample file INI Files INI_Files No sample file Inform Inform No sample file Intel x86 (NASM) Intel_X86_NASM seems to have issues JSP JSP OK Java Java OK JavaScript JavaScript OK Javadoc Javadoc No sample file KBasic KBasic No sample file Kate File Template Kate_File_Template No sample file LDIF LDIF No sample file LPC LPC No sample file LaTeX LaTex OK Lex/Flex Lex_Flex OK LilyPond LilyPond OK Literate Haskell Literate_Haskell OK Lua Lua No sample file M3U M3U OK MAB-DB MABminusDB No sample file MIPS Assembler MIPS_Assembler No sample file Makefile Makefile No sample file Mason Mason No sample file Matlab Matlab has issues Modula-2 Modulaminus2 No sample file Music Publisher Music_Publisher No sample file Octave Octave OK PHP (HTML) PHP_HTML OK PHP_PHP OK hidden module POV-Ray POV_Ray OK Pascal Pascal No sample file Perl Perl OK PicAsm PicAsm OK Pike Pike OK PostScript PostScript OK Prolog Prolog No sample file PureBasic PureBasic OK Python Python OK Quake Script Quake_Script No sample file R Script R_Script No sample file REXX REXX No sample file RPM Spec RPM_Spec No sample file RSI IDL RSI_IDL No sample file RenderMan RIB RenderMan_RIB OK Ruby Ruby OK SGML SGML No sample file SML SML No sample file SQL SQL No sample file SQL (MySQL) SQL_MySQL No sample file SQL (PostgreSQL) SQL_PostgreSQL No sample file Sather Sather No sample file Scheme Scheme OK Sieve Sieve No sample file Spice Spice OK Stata Stata OK TI Basic TI_Basic No sample file TaskJuggler TaskJuggler No sample file Tcl/Tk TCL_Tk OK UnrealScript UnrealScript OK VHDL VHDL No sample file VRML VRML OK Velocity Velocity No sample file Verilog Verilog No sample file WINE Config WINE_Config No sample file Wikimedia Wikimedia No sample file XML XML OK XML (Debug) XML_Debug No sample file Yacc/Bison Yacc_Bison OK de_DE De_DE No sample file en_EN En_EN No sample file ferite Ferite No sample file nl Nl No sample file progress Progress No sample file scilab Scilab No sample file txt2tags Txt2tags No sample file x.org Configuration X_org_Configuration OK xHarbour XHarbour OK xslt Xslt No sample file yacas Yacas No sample file =head1 BUGS Float is detected differently than in the Kate editor. The regular expression engine of the Kate editor, qregexp, appears to be more tolerant to mistakes in regular expressions than perl. This might lead to error messages and differences in behaviour. Most of the problems were sorted out while developing, because error messages appeared. For as far as differences in behaviour is concerned, testing is the only way to find out, so i hope the users out there will be able to tell me more. This module is mimicking the behaviour of the syntax highlight engine of the Kate editor. If you find a bug/mistake in the highlighting, please check if Kate behaves in the same way. If yes, the cause is likely to be found there. =head1 TO DO Rebuild the scripts i am using to generate the modules from xml files so they are more pro-actively tracking flaws in the build of the xml files like missing lists. Also regular expressions in the xml can be tested better before used in plugins. Refine the testmethods in Syntax::Highlight::Engine::Kate::Template, so that choices for casesensitivity, dynamic behaviour and lookahead can be determined at generate time of the plugin, might increase throughput. Implement codefolding. =head1 ACKNOWLEDGEMENTS All the people who wrote Kate and the syntax highlight xml files. =head1 AUTHOR AND COPYRIGHT This module is written and maintained by: Hans Jeuken < haje at toneel dot demon dot nl > Copyright (c) 2006 by Hans Jeuken, all rights reserved. You may freely distribute and/or modify this module under the same terms as Perl itself. =head1 SEE ALSO Syntax::Highlight::Engine::Kate::Template http:://www.kate-editor.org =cut Syntax-Highlight-Engine-Kate-0.14/t/perl/highlighted/template.pl0000644000175000017500000043542613032300413024112 0ustar manwarmanwar# Copyright (c) 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. package Syntax::Highlight::Engine::Kate::Template; our $VERSION = '0.06'; use strict; use Carp qw(cluck); use Data::Dumper; #my $regchars = '\\^.$|()[]*+?'; sub new { my $proto = shift; my $class = ref($proto) || $proto; my %args = (@_); my $debug = delete $args{'debug'}; unless (defined($debug)) { $debug = 0 }; my $substitutions = delete $args{'substitutions'}; unless (defined($substitutions)) { $substitutions = {} }; my $formattable = delete $args{'format_table'}; unless (defined($formattable)) { $formattable = {} }; my $engine = delete $args{'engine'}; my $self = {}; $self->{'attributes'} = {}, $self->{'captured'} = []; $self->{'contextdata'} = {}; $self->{'basecontext'} = ''; $self->{'debug'} = $debug; $self->{'deliminators'} = ''; $self->{'engine'} = ''; $self->{'format_table'} = $formattable; $self->{'keywordcase'} = 1; $self->{'lastchar'} = ''; $self->{'linesegment'} = ''; $self->{'lists'} = {}; $self->{'linestart'} = 1; $self->{'out'} = []; $self->{'plugins'} = {}; $self->{'snippet'} = ''; $self->{'snippetattribute'} = ''; $self->{'stack'} = []; $self->{'substitutions'} = $substitutions; bless ($self, $class); unless (defined $engine) { $engine = $self }; $self->engine($engine); $self->initialize; return $self; } sub attributes { my $self = shift; if (@_) { $self->{'attributes'} = shift; }; return $self->{'attributes'}; } sub basecontext { my $self = shift; if (@_) { $self->{'basecontext'} = shift; }; return $self->{'basecontext'}; } sub captured { my ($self, $c) = @_; if (defined($c)) { my $t = $self->engine->stackTop; my $n = 0; my @o = (); while (defined($c->[$n])) { push @o, $c->[$n]; $n ++; } if (@o) { $t->[2] = \@o; } }; } sub capturedGet { my ($self, $num) = @_; my $s = $self->engine->stack; if (defined($s->[1])) { my $c = $s->[1]->[2]; $num --; if (defined($c)) { if (defined($c->[$num])) { my $r = $c->[$num]; return $r; } else { warn "capture number $num not defined"; } } else { warn "dynamic substitution is called for but nothing to substitute\n"; return undef; } } else { warn "no parent context to take captures from"; } } #sub captured { # my $self = shift; # if (@_) { # $self->{'captured'} = shift; ## print Dumper($self->{'captured'}); # }; # return $self->{'captured'} ## my ($self, $c) = @_; ## if (defined($c)) { ## my $t = $self->engine->stackTop; ## my $n = 0; ## my @o = (); ## while (defined($c->[$n])) { ## push @o, $c->[$n]; ## $n ++; ## } ## if (@o) { ## $t->[2] = \@o; ## } ## }; #} # #sub capturedGet { # my ($self, $num) = @_; # my $s = $self->captured; # if (defined $s) { # $num --; # if (defined($s->[$num])) { # return $s->[$num]; # } else { # $self->logwarning("capture number $num not defined"); # } # } else { # $self->logwarning("dynamic substitution is called for but nothing to substitute"); # return undef; # } #} sub capturedParse { my ($self, $string, $mode) = @_; my $s = ''; if (defined($mode)) { if ($string =~ s/^(\d)//) { $s = $self->capturedGet($1); if ($string ne '') { $self->logwarning("character class is longer then 1 character, ignoring the rest"); } } } else { while ($string ne '') { if ($string =~ s/^([^\%]*)\%(\d)//) { my $r = $self->capturedGet($2); if ($r ne '') { $s = $s . $1 . $r } else { $s = $s . $1 . '%' . $2; $self->logwarning("target is an empty string"); } } else { $string =~ s/^(.)//; $s = "$s$1"; } } } return $s; } sub column { my $self = shift; return length($self->linesegment); } sub contextdata { my $self = shift; if (@_) { $self->{'contextdata'} = shift; }; return $self->{'contextdata'}; } sub contextInfo { my ($self, $context, $item) = @_; if (exists $self->contextdata->{$context}) { my $c = $self->contextdata->{$context}; if (exists $c->{$item}) { return $c->{$item} } else { return undef; } } else { $self->logwarning("undefined context '$context'"); return undef; } } sub contextParse { my ($self, $plug, $context) = @_; if ($context =~ /^#pop/i) { while ($context =~ s/#pop//i) { $self->stackPull; } } elsif ($context =~ /^#stay/i) { #don't do anything } elsif ($context =~ /^##(.+)/) { my $new = $self->pluginGet($1); $self->stackPush([$new, $new->basecontext]); } else { $self->stackPush([$plug, $context]); } } sub debug { my $self = shift; if (@_) { $self->{'debug'} = shift; }; return $self->{'debug'}; } sub debugTest { my $self = shift; if (@_) { $self->{'debugtest'} = shift; }; return $self->{'debugtest'}; } sub deliminators { my $self = shift; if (@_) { $self->{'deliminators'} = shift; }; return $self->{'deliminators'}; } sub engine { my $self = shift; if (@_) { $self->{'engine'} = shift; }; return $self->{'engine'}; } sub firstnonspace { my ($self, $string) = @_; my $line = $self->linesegment; if (($line =~ /^\s*$/) and ($string =~ /^[^\s]/)) { return 1 } return '' } sub formatTable { my $self = shift; if (@_) { $self->{'format_table'} = shift; }; return $self->{'format_table'}; } sub highlight { my ($self, $text) = @_; $self->snippet(''); my $out = $self->out; @$out = (); while ($text ne '') { my $top = $self->stackTop; if (defined($top)) { my ($plug, $context) = @$top; if ($text =~ s/^(\n)//) { $self->snippetForce; my $e = $plug->contextInfo($context, 'lineending'); if (defined($e)) { $self->contextParse($plug, $e) } my $attr = $plug->attributes->{$plug->contextInfo($context, 'attribute')}; $self->snippetParse($1, $attr); $self->snippetForce; $self->linesegment(''); my $b = $plug->contextInfo($context, 'linebeginning'); if (defined($b)) { $self->contextParse($plug, $b) } } else { my $sub = $plug->contextInfo($context, 'callback'); my $result = &$sub($plug, \$text); unless($result) { my $f = $plug->contextInfo($context, 'fallthrough'); if (defined($f)) { $self->contextParse($plug, $f); } else { $text =~ s/^(.)//; my $attr = $plug->attributes->{$plug->contextInfo($context, 'attribute')}; $self->snippetParse($1, $attr); } } } } else { push @$out, length($text), 'Normal'; $text = ''; } } $self->snippetForce; return @$out; } sub highlightText { my ($self, $text) = @_; my $res = ''; my @hl = $self->highlight($text); while (@hl) { my $f = shift @hl; my $t = shift @hl; unless (defined($t)) { $t = 'Normal' } my $s = $self->substitutions; my $rr = ''; while ($f ne '') { my $k = substr($f , 0, 1); $f = substr($f, 1, length($f) -1); if (exists $s->{$k}) { $rr = $rr . $s->{$k} } else { $rr = $rr . $k; } } my $rt = $self->formatTable; if (exists $rt->{$t}) { my $o = $rt->{$t}; $res = $res . $o->[0] . $rr . $o->[1]; } else { $res = $res . $rr; $self->logwarning("undefined format tag '$t'"); } } return $res; } sub includePlugin { my ($self, $language, $text) = @_; my $eng = $self->engine; my $plug = $eng->pluginGet($language); if (defined($plug)) { my $context = $plug->basecontext; my $call = $plug->contextInfo($context, 'callback'); if (defined($call)) { return &$call($plug, $text); } else { $self->logwarning("cannot find callback for context '$context'"); } } return 0; } sub includeRules { my ($self, $context, $text) = @_; my $call = $self->contextInfo($context, 'callback'); if (defined($call)) { return &$call($self, $text); } else { $self->logwarning("cannot find callback for context '$context'"); } return 0; } sub initialize { my $self = shift; if ($self->engine eq $self) { $self->stack([[$self, $self->basecontext]]); } } sub keywordscase { my $self = shift; if (@_) { $self->{'keywordcase'} = shift; } return $self->{'keywordscase'} } sub languagePlug { my ($cw, $name) = @_; my %numb = ( '1' => 'One', '2' => 'Two', '3' => 'Three', '4' => 'Four', '5' => 'Five', '6' => 'Six', '7' => 'Seven', '8' => 'Eight', '9' => 'Nine', '0' => 'Zero', ); if ($name =~ s/^(\d)//) { $name = $numb{$1} . $name; } $name =~ s/\.//; $name =~ s/\+/plus/g; $name =~ s/\-/minus/g; $name =~ s/#/dash/g; $name =~ s/[^0-9a-zA-Z]/_/g; $name =~ s/__/_/g; $name =~ s/_$//; $name = ucfirst($name); return $name; } sub lastchar { my $self = shift; my $l = $self->linesegment; if ($l eq '') { return "\n" } #last character was a newline return substr($l, length($l) - 1, 1); } sub lastcharDeliminator { my $self = shift; my $deliminators = '\s|\~|\!|\%|\^|\&|\*|\+|\(|\)|-|=|\{|\}|\[|\]|:|;|<|>|,|\\|\||\.|\?|\/'; if ($self->linestart or ($self->lastchar =~ /$deliminators/)) { return 1; } return ''; } sub linesegment { my $self = shift; if (@_) { $self->{'linesegment'} = shift; }; return $self->{'linesegment'}; } sub linestart { my $self = shift; if ($self->linesegment eq '') { return 1 } return ''; } sub lists { my $self = shift; if (@_) { $self->{'lists'} = shift; } return $self->{'lists'} } sub out { my $self = shift; if (@_) { $self->{'out'} = shift; } return $self->{'out'}; } sub listAdd { my $self = shift; my $listname = shift; my $lst = $self->lists; if (@_) { my @l = reverse sort @_; $lst->{$listname} = \@l; } else { $lst->{$listname} = []; } } sub logwarning { my ($self, $warning) = @_; my $top = $self->engine->stackTop; if (defined $top) { my $lang = $top->[0]->language; my $context = $top->[1]; $warning = "$warning\n Language => $lang, Context => $context\n"; } else { $warning = "$warning\n STACK IS EMPTY: PANIC\n" } cluck($warning); } sub parseResult { my ($self, $text, $string, $lahead, $column, $fnspace, $context, $attr) = @_; my $eng = $self->engine; if ($fnspace) { unless ($eng->firstnonspace($$text)) { return '' } } if (defined($column)) { if ($column ne $eng->column) { return ''; } } unless ($lahead) { $$text = substr($$text, length($string)); my $r; unless (defined($attr)) { my $t = $eng->stackTop; my ($plug, $ctext) = @$t; $r = $plug->attributes->{$plug->contextInfo($ctext, 'attribute')}; } else { $r = $self->attributes->{$attr}; } $eng->snippetParse($string, $r); } $eng->contextParse($self, $context); return 1 } sub pluginGet { my ($self, $language) = @_; my $plugs = $self->{'plugins'}; unless (exists($plugs->{$language})) { my $modname = 'Syntax::Highlight::Engine::Kate::' . $self->languagePlug($language); unless (defined($modname)) { $self->logwarning("no valid module found for language '$language'"); return undef; } my $plug; eval "use $modname; \$plug = new $modname(engine => \$self);"; if (defined($plug)) { $plugs->{$language} = $plug; } else { $self->logwarning("cannot create plugin for language '$language'\n$@"); } } if (exists($plugs->{$language})) { return $plugs->{$language}; } return undef; } sub reset { my $self = shift; $self->stack([[$self, $self->basecontext]]); $self->out([]); $self->snippet(''); } sub snippet { my $self = shift; if (@_) { $self->{'snippet'} = shift; } return $self->{'snippet'}; } sub snippetAppend { my ($self, $ch) = @_; return if not defined $ch; $self->{'snippet'} = $self->{'snippet'} . $ch; if ($ch ne '') { $self->linesegment($self->linesegment . $ch); } return; } sub snippetAttribute { my $self = shift; if (@_) { $self->{'snippetattribute'} = shift; } return $self->{'snippetattribute'}; } sub snippetForce { my $self = shift; my $parse = $self->snippet; if ($parse ne '') { my $out = $self->{'out'}; push(@$out, $parse, $self->snippetAttribute); $self->snippet(''); } } sub snippetParse { my $self = shift; my $snip = shift; my $attr = shift; if ((defined $attr) and ($attr ne $self->snippetAttribute)) { $self->snippetForce; $self->snippetAttribute($attr); } $self->snippetAppend($snip); } sub stack { my $self = shift; if (@_) { $self->{'stack'} = shift; } return $self->{'stack'}; } sub stackPush { my ($self, $val) = @_; my $stack = $self->stack; unshift(@$stack, $val); } sub stackPull { my ($self, $val) = @_; my $stack = $self->stack; return shift(@$stack); } sub stackTop { my $self = shift; return $self->stack->[0]; } sub stateCompare { my ($self, $state) = @_; my $h = [ $self->stateGet ]; my $equal = 0; if (Dumper($h) eq Dumper($state)) { $equal = 1 }; return $equal; } sub stateGet { my $self = shift; my $s = $self->stack; return @$s; } sub stateSet { my $self = shift; my $s = $self->stack; @$s = (@_); } sub substitutions { my $self = shift; if (@_) { $self->{'substitutions'} = shift; } return $self->{'substitutions'}; } sub testAnyChar { my $self = shift; my $text = shift; my $string = shift; my $insensitive = shift; my $test = substr($$text, 0, 1); my $bck = $test; if ($insensitive) { $string = lc($string); $test = lc($test); } if (index($string, $test) > -1) { return $self->parseResult($text, $bck, @_); } return '' } sub testDetectChar { my $self = shift; my $text = shift; my $char = shift; my $insensitive = shift; my $dyn = shift; if ($dyn) { $char = $self->capturedParse($char, 1); } my $test = substr($$text, 0, 1); my $bck = $test; if ($insensitive) { $char = lc($char); $test = lc($test); } if ($char eq $test) { return $self->parseResult($text, $bck, @_); } return '' } sub testDetect2Chars { my $self = shift; my $text = shift; my $char = shift; my $char1 = shift; my $insensitive = shift; my $dyn = shift; if ($dyn) { $char = $self->capturedParse($char, 1); $char1 = $self->capturedParse($char1, 1); } my $string = $char . $char1; my $test = substr($$text, 0, 2); my $bck = $test; if ($insensitive) { $string = lc($string); $test = lc($test); } if ($string eq $test) { return $self->parseResult($text, $bck, @_); } return '' } sub testDetectIdentifier { my $self = shift; my $text = shift; if ($$text =~ /^([a-zA-Z_][a-zA-Z0-9_]+)/) { return $self->parseResult($text, $1, @_); } return '' } sub testDetectSpaces { my $self = shift; my $text = shift; if ($$text =~ /^([\\040|\\t]+)/) { return $self->parseResult($text, $1, @_); } return '' } sub testFloat { my $self = shift; my $text = shift; if ($self->engine->lastcharDeliminator) { if ($$text =~ /^((?=\.?\d)\d*(?:\.\d*)?(?:[Ee][+-]?\d+)?)/) { return $self->parseResult($text, $1, @_); } } return '' } sub testHlCChar { my $self = shift; my $text = shift; if ($$text =~ /^('.')/) { return $self->parseResult($text, $1, @_); } return '' } sub testHlCHex { my $self = shift; my $text = shift; if ($self->engine->lastcharDeliminator) { if ($$text =~ /^(0x[0-9a-fA-F]+)/) { return $self->parseResult($text, $1, @_); } } return '' } sub testHlCOct { my $self = shift; my $text = shift; if ($self->engine->lastcharDeliminator) { if ($$text =~ /^(0[0-7]+)/) { return $self->parseResult($text, $1, @_); } } return '' } sub testHlCStringChar { my $self = shift; my $text = shift; if ($$text =~ /^(\\[a|b|e|f|n|r|t|v|'|"|\?])/) { return $self->parseResult($text, $1, @_); } if ($$text =~ /^(\\x[0-9a-fA-F][0-9a-fA-F]?)/) { return $self->parseResult($text, $1, @_); } if ($$text =~ /^(\\[0-7][0-7]?[0-7]?)/) { return $self->parseResult($text, $1, @_); } return '' } sub testInt { my $self = shift; my $text = shift; if ($self->engine->lastcharDeliminator) { if ($$text =~ /^([+-]?\d+)/) { return $self->parseResult($text, $1, @_); } } return '' } sub testKeyword { my $self = shift; my $text = shift; my $list = shift; my $eng = $self->engine; my $deliminators = $self->deliminators; if (($eng->lastcharDeliminator) and ($$text =~ /^([^$deliminators]+)/)) { my $match = $1; my $l = $self->lists->{$list}; if (defined($l)) { my @list = @$l; my @rl = (); unless ($self->keywordscase) { @rl = grep { (lc($match) eq lc($_)) } @list; } else { @rl = grep { ($match eq $_) } @list; } if (@rl) { return $self->parseResult($text, $match, @_); } } else { $self->logwarning("list '$list' is not defined, failing test"); } } return '' } sub testLineContinue { my $self = shift; my $text = shift; my $lahead = shift; if ($lahead) { if ($$text =~ /^\\\n/) { $self->parseResult($text, "\\", $lahead, @_); return 1; } } else { if ($$text =~ s/^(\\)(\n)/$2/) { return $self->parseResult($text, "\\", $lahead, @_); } } return '' } sub testRangeDetect { my $self = shift; my $text = shift; my $char = shift; my $char1 = shift; my $insensitive = shift; my $string = "$char\[^$char1\]+$char1"; return $self->testRegExpr($text, $string, $insensitive, 0, @_); } sub testRegExpr { my $self = shift; my $text = shift; my $reg = shift; my $insensitive = shift; my $dynamic = shift; if ($dynamic) { $reg = $self->capturedParse($reg); } my $eng = $self->engine; if ($reg =~ s/^\^//) { unless ($eng->linestart) { return ''; } } elsif ($reg =~ s/^\\(b)//i) { my $lastchar = $self->engine->lastchar; if ($1 eq 'b') { if ($lastchar =~ /\w/) { return '' } } else { if ($lastchar =~ /\W/) { return '' } } } # $reg = "^($reg)"; $reg = "^$reg"; my $pos; # my @cap = (); my $sample = $$text; # emergency measurements to avoid exception (szabgab) $reg = eval { qr/$reg/ }; if ($@) { warn $@; return ''; } if ($insensitive) { if ($sample =~ /$reg/ig) { $pos = pos($sample); # @cap = ($1, $2, $3, $4, $5, $6, $7, $8, $9); # my @cap = (); if ($#-) { no strict 'refs'; my @cap = map {$$_} 1 .. $#-; $self->captured(\@cap) } # my $r = 1; # my $c = 1; # my @cap = (); # while ($r) { # eval "if (defined\$$c) { push \@cap, \$$c } else { \$r = 0 }"; # $c ++; # } # if (@cap) { $self->captured(\@cap) }; } } else { if ($sample =~ /$reg/g) { $pos = pos($sample); # @cap = ($1, $2, $3, $4, $5, $6, $7, $8, $9); # my @cap = (); if ($#-) { no strict 'refs'; my @cap = map {$$_} 1 .. $#-; $self->captured(\@cap); } # my $r = 1; # my $c = 1; # my @cap = (); # while ($r) { # eval "if (defined\$$c) { push \@cap, \$$c } else { \$r = 0 }"; # $c ++; # } # if (@cap) { $self->captured(\@cap) }; } } if (defined($pos) and ($pos > 0)) { my $string = substr($$text, 0, $pos); return $self->parseResult($text, $string, @_); } return '' } sub testStringDetect { my $self = shift; my $text = shift; my $string = shift; my $insensitive = shift; my $dynamic = shift; if ($dynamic) { $string = $self->capturedParse($string); } my $test = substr($$text, 0, length($string)); my $bck = $test; if ($insensitive) { $string = lc($string); $test = lc($test); } if ($string eq $test) { return $self->parseResult($text, $bck, @_); } return '' } 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Template - a template for syntax highlighting plugins =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Template is a framework to assist authors of plugin modules. All methods to provide highlighting to the Syntax::Highlight::Engine::Kate module are there, Just no syntax definitions and callbacks. An instance of Syntax::Highlight::Engine::Kate::Template should never be created, it's meant to be sub classed only. =head1 METHODS =over 4 =item B(I); Sets and returns a reference to the attributes hash. =item B(I); Sets and returns the basecontext instance variable. This is the context that is used when highlighting starts. =item B(I<$cap>); Puts $cap in the first element of the stack, the current context. Used when the context is dynamic. =item B(I<$num>); Returns the $num'th element that was captured in the current context. =item B(I<$string>, I<$mode>); If B<$mode> is specified, B<$string> should only be one character long and numeric. B will return the Nth captured element of the current context. If B<$mode> is not specified, all occurences of %[1-9] will be replaced by the captured element of the current context. =item B returns the column position in the line that is currently highlighted. =item B(I<\%data>); Sets and returns a reference to the contextdata hash. =item B(I<$context>, I<$item>); returns the value of several context options. B<$item> can be B, B, B, B, B. =item B(I<$plugin>, I<$context>); Called by the plugins after a test succeeds. if B<$context> has following values: #pop returns to the previous context, removes to top item in the stack. Can also be specified as #pop#pop etc. #stay does nothing. ##.... Switches to the plugin specified in .... and assumes it's basecontext. .... Swtiches to the context specified in .... =item B(I); Sets and returns a string that is a regular expression for detecting deliminators. =item B Returns a reference to the Syntax::Highlight::Engine::Kate module that created this plugin. =item B(I<$string>); returns true if the current line did not contain a non-spatial character so far and the first character in B<$string> is also a spatial character. =item B sets and returns the instance variable B. See also the option B =item B(I<$text>); highlights I<$text>. It does so by selecting the proper callback from the B hash and invoke it. It will do so untill $text has been reduced to an empty string. returns a paired list of snippets of text and the attribute with which they should be highlighted. =item B(I<$text>); highlights I<$text> and reformats it using the B and B =item B(I<$language>, I<\$text>); Includes the plugin for B<$language> in the highlighting. =item B(I<$language>, I<\$text>); Includes the plugin for B<$language> in the highlighting. =item B Sets and returns the keywordscase instance variable. =item B return the last character that was processed. =item B returns true if the last character processed was a deliminator. =item B returns the string of text in the current line that has been processed so far, =item B returns true if processing is currently at the beginning of a line. =item B(I<'listname'>, I<$item1>, I<$item2> ...); Adds a list to the 'lists' hash. =item B(I); sets and returns the instance variable 'lists'. =item B(I); sets and returns the instance variable 'out'. =item B(I<\$text>, I<$match>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); Called by every one of the test methods below. If the test matches, it will do a couple of subtests. If B<$column> is a defined numerical value it will test if the process is at the requested column. If B<$firnonspace> is true, it will test this also. Ig it is not a look ahead and all tests are passed, B<$match> is then parsed and removed from B<$$text>. =item B(I<$language>); Returns a reference to a plugin object for the specified language. Creating an instance if needed. =item B Resets the highlight engine to a fresh state, does not change the syntx. =item B Contains the current snippet of text that will have one attribute. The moment the attribute changes it will be parsed. =item B(I<$string>) appends I<$string> to the current snippet. =item B(I<$attribute>) Sets and returns the used attribute. =item B Forces the current snippet to be parsed. =item B(I<$text>, I) If attribute is defined and differs from the current attribute it does a snippetForce and sets the current attribute to B<$attribute>. Then it does a snippetAppend of B<$text> =item B sets and returns the instance variable 'stack', a reference to an array =item B retrieves the element that is on top of the stack, decrements stacksize by 1. =item B(I<$tagname>); puts I<$tagname> on top of the stack, increments stacksize by 1 =item B Retrieves the element that is on top of the stack. =item B(I<\@state>) Compares two lists, \@state and the stack. returns true if they match. =item B Returns a list containing the entire stack. =item B(I<@list>) Accepts I<@list> as the current stack. =item B sets and returns a reference to the substitutions hash. =back The methods below all return a boolean value. =over 4 =item B(I<\$text>, I<$string>, I<$insensitive>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$char>, I<$insensitive>, I<$dynamic>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$char1>, I<$char2>, I<$insensitive>, I<$dynamic>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$list>, I<$insensitive>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$char1>, I<$char2>, I<$insensitive>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$reg>, I<$insensitive>, I<$dynamic>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$string>, I<$insensitive>, I<$dynamic>, II<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =back =head1 ACKNOWLEDGEMENTS All the people who wrote Kate and the syntax highlight xml files. =head1 AUTHOR AND COPYRIGHT This module is written and maintained by: Hans Jeuken < haje at toneel dot demon dot nl > Copyright (c) 2006 by Hans Jeuken, all rights reserved. You may freely distribute and/or modify this module under same terms as Perl itself =head1 SEE ALSO Synax::Highlight::Engine::Kate http:://www.kate-editor.orgSyntax-Highlight-Engine-Kate-0.14/t/lib/0000755000175000017500000000000013226471445017273 5ustar manwarmanwarSyntax-Highlight-Engine-Kate-0.14/t/lib/TestHighlight.pm0000644000175000017500000000474413032300413022366 0ustar manwarmanwarpackage TestHighlight; use warnings; use Syntax::Highlight::Engine::Kate; use File::Find; use File::Spec::Functions 'catfile'; use Exporter 'import'; our @EXPORT_OK = qw( get_highlighter highlight_perl slurp get_sample_perl_files ); our %EXPORT_TAGS = ( all => \@EXPORT_OK ); my ( $BEFORE, $HIGHLIGHTED ) = ( 't/perl/before', 't/perl/highlighted' ); =head1 EXPORT =over 4 =item * get_highlighter my $highlighter = get_highlighter($language); Returns a new C highlighter for testing. Defaults to Perl if no language specified. All tokens are wrapped in tags corresponding to the token type: my =item * slurp Slurps and returns the contents of a file. =teim * get_sample_perl_files my $files = get_sample_perl_files(); while ( my ( $perl, $highlighted ) = each %$files ) { ... } Returns a hashref. Keys are the names of the raw Perl files in F and values are the filenames of the highlighted versions found in F. See F to understand how to regenerate these fixtures. See F for an example of testing with this. =back =cut sub highlight_perl { my $code = shift; return get_highlighter('Perl')->highlightText($code); } sub get_highlighter { my $syntax = shift || 'Perl'; return Syntax::Highlight::Engine::Kate->new( language => $syntax, format_table => { map { _make_token($_) } qw/ Alert BaseN BString Char Comment DataType DecVal Error Float Function IString Keyword Normal Operator Others RegionMarker Reserved String Variable Warning / } ); } sub _make_token { my $name = shift; my $token = lc $name; return $name => [ "<$token>" => "" ]; } sub slurp { my $file = shift; open my $fh, '<', $file or die "Cannot open $file for reading: $!"; return do { local $/; <$fh> }; } sub get_sample_perl_files { my %highlighted_file_for; find( sub { $highlighted_file_for{ catfile( $BEFORE, $_ ) } = catfile( $HIGHLIGHTED, $_ ) if -f $_ && /\.pl$/; }, $BEFORE ); return \%highlighted_file_for; } 1; Syntax-Highlight-Engine-Kate-0.14/t/02-perl.t0000644000175000017500000000216713032300413020056 0ustar manwarmanwar use strict; use warnings; use Test::More; use Test::Warn; use Syntax::Highlight::Engine::Kate; my @languages = ('Perl', 'PHP (HTML)', 'PHP/PHP'); plan tests => 2 + scalar @languages; foreach my $language (@languages) { my $hl = Syntax::Highlight::Engine::Kate->new( language => $language, ); isa_ok($hl, 'Syntax::Highlight::Engine::Kate'); } subtest klingon => sub { plan tests => 2; my $err; warnings_like { eval { Syntax::Highlight::Engine::Kate->new( language => 'Klingon', ); }; $err = $@; } {carped => [qr{undefined language: 'Klingon'}, qr{cannot create plugin for language 'Klingon'}]}, 'warn'; like $err, qr{Plugin for language 'Klingon' could not be found}; }; subtest basecontext => sub { plan tests => 2; my $err; warnings_like { eval { Syntax::Highlight::Engine::Kate->new( language => 'PHP (HTML) ', ); }; $err = $@; } {carped => [qr{undefined language: 'PHP \(HTML\) '}, qr{cannot create plugin for language 'PHP \(HTML\) '}]}, 'warn'; like $err, qr{Plugin for language 'PHP \(HTML\) ' could not be found}; }; Syntax-Highlight-Engine-Kate-0.14/t/10-case.t0000644000175000017500000000131513032300413020020 0ustar manwarmanwaruse strict; use warnings; use Test::More tests => 4; use Test::Warn; use Syntax::Highlight::Engine::Kate; my $hl = new Syntax::Highlight::Engine::Kate(); is($hl->languagePlug( 'HTML'), 'HTML', 'Standard "HTML" should work'); subtest html => sub { plan tests => 2; my $lang; warning_is { $lang = $hl->languagePlug( 'html') } q{undefined language: 'html'}, 'warn'; is($lang, undef, 'Standard "html" should not work'); }; is($hl->languagePlug( 'HTML', 1), 'HTML', 'Insesitive "HTML" should work'); subtest html_1 => sub { plan tests => 2; my $lang; warning_is { $lang = $hl->languagePlug( 'html', 1) } 'substituting language HTML for html', 'warn'; is($lang, 'HTML', 'Insesitive "html" should work'); }; Syntax-Highlight-Engine-Kate-0.14/t/Kate.t0000755000175000017500000000572413032300413017566 0ustar manwarmanwaruse strict; use Term::ANSIColor; use Test::More; my %reg = (); open RG, ") { chomp($t); my ($lang, $testfile) = split /\t/, $t; unless (defined($testfile)) { $testfile = "" } #diag "#language $lang, samplefile, ;$testfile; quovadis"; $reg{$lang} = $testfile; } close RG; my %filetypes = ( '../some/path/index.html' => 'HTML', 'Module.pm' => 'Perl', 'c:\\Documents and Settings\\My Documents\\settings.xml' => 'XML', ); my %options = ( substitutions => { "\n" => color('reset') . "\n", }, format_table => { Alert => [color('white bold on_green'), color('reset')], BaseN => [color('green'), color('reset')], BString => [color('red bold'), color('reset')], Char => [color('magenta'), color('reset')], Comment => [color('white bold on_blue'), color('reset')], DataType => [color('blue'), color('reset')], DecVal => [color('blue bold'), color('reset')], Error => [color('yellow bold on_red'), color('reset')], Float => [color('blue bold'), color('reset')], Function => [color('yellow bold on_blue'), color('reset')], IString => [color('red'), color('reset')], Keyword => [color('bold'), color('reset')], Normal => [color('reset'), color('reset')], Operator => [color('green'), color('reset')], Others => [color('yellow bold on_green'), color('reset')], RegionMarker => [color('black on_yellow bold'), color('reset')], Reserved => [color('magenta on_blue'), color('reset')], String => [color('red'), color('reset')], Variable => [color('blue on_red bold'), color('reset')], Warning => [color('green bold on_red'), color('reset')], }, ); my @langl = sort keys %reg; my @ftl = sort keys %filetypes; my $numtest = (@langl * 4) + 2 + (@ftl * 2); plan tests => $numtest; use Syntax::Highlight::Engine::Kate; ok(1, "cannot find Kate"); my $k = new Syntax::Highlight::Engine::Kate(%options); ok(defined($k), "cannot create Kate"); for (@ftl) { my $t = $_; my $l = $k->languagePropose($t); is($l, $filetypes{$t}, "Cannot select correct filetype for $t"); $k->languageAutoSet($t); is($k->language, $filetypes{$t}, "Cannot select correct filetype for $t"); } for (@langl) { my $ln = $_; #diag "testing $ln"; my $md = $k->syntaxes->{$ln}; my $mod = "Syntax::Highlight::Engine::Kate::$md"; eval "use $mod"; is($@, "", "cannot find $mod"); my $m = new $mod(%options); ok(defined($m), "cannot create $mod"); my $fl = $reg{$ln}; if ($fl ne "") { my $txt = ""; open(TST, "<$fl") or die "cannot open $fl"; while () { $txt = $txt . $_; }; close TST; my $res = ""; #diag "testing as kate plugin"; $k->language($ln); $k->reset; eval "\$res = \$k->highlightText(\$txt)"; is($@, "", "errors when highlighting"); # diag $res; #diag "testing standalone"; eval "\$res = \$m->highlightText(\$txt)"; is($@, "", "errors when highlighting"); # diag $res; } else { diag "Should be SKIP-ed! '$ln'"; ok(1); ok(1); #skip(1, "no test file"); #skip(1, "no test file"); } } Syntax-Highlight-Engine-Kate-0.14/t/perl_highlighting.t0000644000175000017500000000375513174330044022402 0ustar manwarmanwaruse strict; use warnings; use Test::More; use Test::Differences; use lib 't/lib'; use TestHighlight ':all'; diag <<'END'; We don't actually know if these are highlighted correctly, but this makes decent regression tests when we refactor. END my ( $before, $after ) = ( 't/perl/before', 't/perl/highlighted' ); my $highlighted_version_of = get_sample_perl_files(); plan tests => 1 + scalar keys %$highlighted_version_of; for my $perl ( sort keys %$highlighted_version_of ) { my $highlighted = $highlighted_version_of->{$perl}; my $have = get_highlighter('Perl')->highlightText( slurp($perl) ); my $want = slurp($highlighted); chomp $want; eq_or_diff $have, $want, "($perl) was highlighted correctly"; } # https://rt.cpan.org/Public/Bug/Display.html?id=76160 my $pod_bug = do { local $/; ; }; my $have = highlight_perl($pod_bug); my $want = <<'END'; #!/usr/bin/env perl # https://rt.cpan.org/Ticket/Display.html?id=76160 =pod =head1 BORKED All Perl code after this was considered a "comment" and Kate could not highlight it correctly. =cutabove =cut my $this_is_not_a_comment = 'or a pipe'; END chomp($want); eq_or_diff $have, $want, 'post pod parsing all good'; __DATA__ #!/usr/bin/env perl # https://rt.cpan.org/Ticket/Display.html?id=76160 =pod =head1 BORKED All Perl code after this was considered a "comment" and Kate could not highlight it correctly. =cutabove =cut my $this_is_not_a_comment = 'or a pipe'; Syntax-Highlight-Engine-Kate-0.14/lib/0000755000175000017500000000000013226471445017030 5ustar manwarmanwarSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/0000755000175000017500000000000013226471445020316 5ustar manwarmanwarSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/0000755000175000017500000000000013226471445022225 5ustar manwarmanwarSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/0000755000175000017500000000000013226471445023432 5ustar manwarmanwarSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/0000755000175000017500000000000013226471445024316 5ustar manwarmanwarSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Yacas.pm0000644000175000017500000002211513226470762025716 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'yacas.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.02 #kate version 2.3 #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::Yacas; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Char' => 'Char', 'Comment' => 'Comment', 'Decimal' => 'DecVal', 'Float' => 'Float', 'Highlight' => 'Alert', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Parens' => 'Normal', 'String' => 'String', 'Symbol' => 'Others', }); $self->listAdd('keywords', '=', 'And', 'ApplyPure', 'ArrayCreate', 'ArrayGet', 'ArraySet', 'ArraySize', 'Atom', 'Berlekamp', 'BitAnd', 'BitOr', 'BitXor', 'Bodied', 'CTokenizer', 'Check', 'Clear', 'CommonLispTokenizer', 'Concat', 'ConcatStrings', 'CurrentFile', 'CurrentLine', 'CustomEval', 'CustomEval\\\'Expression', 'CustomEval\\\'Locals', 'CustomEval\\\'Result', 'CustomEval\\\'Stop', 'DefLoad', 'DefLoadFunction', 'DefMacroRuleBase', 'DefMacroRuleBaseListed', 'DefaultDirectory', 'DefaultTokenizer', 'Delete', 'DestructiveDelete', 'DestructiveInsert', 'DestructiveReplace', 'DestructiveReverse', 'DllEnumerate', 'DllLoad', 'DllUnload', 'Equals', 'Eval', 'FastArcCos', 'FastArcSin', 'FastArcTan', 'FastAssoc', 'FastCos', 'FastExp', 'FastIsPrime', 'FastLog', 'FastPower', 'FastSin', 'FastTan', 'FindFile', 'FindFunction', 'FlatCopy', 'FromBase', 'FromFile', 'FromString', 'FullForm', 'GarbageCollect', 'GenericTypeName', 'GetExtraInfo', 'GetPrecision', 'GreaterThan', 'Head', 'Hold', 'HoldArg', 'If', 'Infix', 'Insert', 'IsAtom', 'IsBodied', 'IsBound', 'IsFunction', 'IsGeneric', 'IsInfix', 'IsInteger', 'IsList', 'IsNumber', 'IsPostfix', 'IsPrefix', 'IsString', 'LazyGlobal', 'LeftPrecedence', 'Length', 'LessThan', 'LispRead', 'LispReadListed', 'List', 'Listify', 'Load', 'Local', 'LocalSymbols', 'MacroClear', 'MacroLocal', 'MacroRule', 'MacroRuleBase', 'MacroRuleBaseListed', 'MacroRulePattern', 'MacroSet', 'MathAbs', 'MathAdd', 'MathAnd', 'MathArcCos', 'MathArcSin', 'MathArcTan', 'MathCeil', 'MathCos', 'MathDiv', 'MathDivide', 'MathExp', 'MathFac', 'MathFloor', 'MathGcd', 'MathGetExactBits', 'MathLibrary', 'MathLog', 'MathMod', 'MathMultiply', 'MathNot', 'MathNth', 'MathOr', 'MathPi', 'MathPower', 'MathSetExactBits', 'MathSin', 'MathSqrt', 'MathSubtract', 'MathTan', 'MaxEvalDepth', 'Not', 'OpLeftPrecedence', 'OpPrecedence', 'OpRightPrecedence', 'Or', 'PatchLoad', 'PatchString', 'PatternCreate', 'PatternMatches', 'Postfix', 'Precision', 'Prefix', 'PrettyPrinter', 'Prog', 'Read', 'ReadToken', 'Replace', 'Retract', 'RightAssociative', 'RightPrecedence', 'Rule', 'RuleBase', 'RuleBaseArgList', 'RuleBaseDefined', 'RuleBaseListed', 'RulePattern', 'Secure', 'Set', 'SetExtraInfo', 'SetStringMid', 'ShiftLeft', 'ShiftRight', 'String', 'StringMid', 'Subst', 'SystemCall', 'Tail', 'ToBase', 'ToFile', 'ToString', 'TraceRule', 'TraceStack', 'Type', 'UnFence', 'UnList', 'Use', 'Version', 'While', 'Write', 'WriteString', 'XmlExplodeTag', 'XmlTokenizer', '`', ); $self->contextdata({ 'default' => { callback => \&parsedefault, attribute => 'Normal Text', }, 'linecomment' => { callback => \&parselinecomment, attribute => 'Comment', lineending => '#pop', }, 'multilinecomment' => { callback => \&parsemultilinecomment, attribute => 'Comment', }, 'string' => { callback => \&parsestring, attribute => 'String', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|=|`'); $self->basecontext('default'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'yacas'; } sub parsedefault { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => 'string' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'String')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'linecomment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'linecomment', 'Comment')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '*' # context => 'multilinecomment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'multilinecomment', 'Comment')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '{[(' # attribute => 'Parens' # beginRegion => 'brace' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '{[(', 0, 0, undef, 0, '#stay', 'Parens')) { return 1 } # String => '}])' # attribute => 'Parens' # context => '#stay' # endRegion => 'brace' # type => 'AnyChar' if ($self->testAnyChar($text, '}])', 0, 0, undef, 0, '#stay', 'Parens')) { return 1 } # String => '+-*/=`~:!@#$^&*_|<>' # attribute => 'Symbol' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '+-*/=`~:!@#$^&*_|<>', 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # attribute => 'Float' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { return 1 } # attribute => 'Decimal' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { return 1 } return 0; }; sub parselinecomment { my ($self, $text) = @_; # String => '(FIXME|TODO)' # attribute => 'Highlight' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Highlight')) { return 1 } return 0; }; sub parsemultilinecomment { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } # String => '(FIXME|TODO)' # attribute => 'Highlight' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Highlight')) { return 1 } return 0; }; sub parsestring { my ($self, $text) = @_; # attribute => 'String' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Yacas - a Plugin for yacas syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Yacas; my $sh = new Syntax::Highlight::Engine::Kate::Yacas([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Yacas is a plugin module that provides syntax highlighting for yacas to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Euphoria.pm0000644000175000017500000003113013226470762026427 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'euphoria.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 2.08 #kate version 2.4 #kate author Irv Mullins (irvm@ellijay.com) #generated: Sun Feb 3 22:02:04 2008, localtime package Syntax::Highlight::Engine::Kate::Euphoria; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Comment' => 'Comment', 'Directive' => 'Others', 'GtkKeyword' => 'Keyword', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Number' => 'DecVal', 'Region Marker' => 'RegionMarker', 'String' => 'String', 'Type' => 'DataType', }); $self->listAdd('GtkKeywords', 'Error', 'FALSE', 'Info', 'NULL', 'Question', 'TRUE', 'Warn', 'YesNo', 'addto', 'adjustment', 'alignment', 'append_page', 'appendto', 'arrow', 'aspect_frame', 'button', 'calendar', 'cell_renderer_text', 'cell_renderer_toggle', 'check', 'check_menu_item', 'checkbutton', 'choice', 'color_selection', 'combo', 'connect', 'deallocate_strings', 'draw_arc', 'draw_image', 'draw_line', 'draw_line', 'draw_point', 'draw_polygon', 'draw_rectangle', 'drawingarea', 'end_submenu', 'entry', 'euget', 'event_box', 'file_selection', 'flatten', 'font', 'font_selection_dialog', 'frame', 'g_list', 'g_list_to_sequence', 'get', 'getImage', 'getSize', 'hbox', 'hbuttonbox', 'hpaned', 'hscale', 'hscrollbar', 'hseparator', 'idle_add', 'image', 'image_menu_item', 'init', 'label', 'limit', 'list_store', 'list_view', 'list_view_column', 'main', 'mark_day', 'menu', 'menu_item', 'menubar', 'mouse_button', 'new_gc', 'new_group', 'new_menu_group', 'notebook', 'option', 'option_menu', 'pack', 'path', 'pop', 'progress_bar', 'push', 'quit', 'radio', 'radio_menu_item', 'radiobutton', 'rc_parse', 'run', 'scrolled_window', 'separator_menu_item', 'seq_to_str', 'set', 'setProperty', 'set_submenu', 'setfg', 'show', 'spinbutton', 'statusbar', 'str', 'table', 'textbox', 'timer', 'togglebutton', 'toolbar', 'tooltip', 'tree_store', 'tree_view', 'tree_view_column', 'vbox', 'vbuttonbox', 'vpaned', 'vscale', 'vscrollbar', 'vseparator', 'when', 'window', ); $self->listAdd('constants', 'GET_SUCCESS', 'PI', ); $self->listAdd('keywords', '?', 'abort', 'allocate', 'allocate_string', 'allow_break', 'and', 'and_bits', 'append', 'arccos', 'arcsin', 'arctan', 'as', 'atom_to_float32', 'atom_to_float64', 'begin', 'bits_to_int', 'bytes_to_int', 'c_func', 'c_proc', 'call', 'call_back', 'call_func', 'call_proc', 'chdir', 'check_break', 'clear_screen', 'close', 'command_line', 'compare', 'cos', 'crash_file', 'crash_message', 'current_dir', 'custom_sort', 'date', 'define_c_func', 'define_c_proc', 'define_c_var', 'dir', 'display_text_image', 'do', 'else', 'elsif', 'end', 'equal', 'exit', 'find', 'float32_to_atom', 'float64_to_atom', 'floor', 'flush', 'for', 'free', 'free_console', 'function', 'get_bytes', 'get_key', 'get_mouse', 'get_position', 'get_screen_char', 'getc', 'getenv', 'gets', 'if', 'include', 'int_to_bits', 'int_to_bytes', 'length', 'lock_file', 'log', 'lower', 'machine_func', 'machine_proc', 'match', 'mem_copy', 'mem_set', 'mouse_events', 'mouse_pointer', 'not', 'not_bits', 'of', 'open', 'open_dll', 'or', 'or_bits', 'peek', 'peek4', 'peek4s', 'peek4u', 'platform', 'poke', 'poke4', 'position', 'power', 'prepend', 'print', 'printf', 'procedure', 'profile', 'prompt_number', 'prompt_string', 'put_screen_char', 'puts', 'rand', 'read_bitmap', 'register_block', 'remainder', 'repeat', 'return', 'reverse', 'routine_id', 'save_bitmap', 'save_text_image', 'scroll', 'seek', 'set_rand', 'sin', 'sleep', 'sort', 'sprint', 'sprintf', 'sqrt', 'system', 'system_exec', 'tan', 'text_color', 'then', 'time', 'to', 'trace', 'type', 'unlock_file', 'unregister_block', 'upper', 'value', 'video_config', 'wait_key', 'walk_dir', 'where', 'while', 'wildcard_file', 'wildcard_match', 'with', 'without', 'wrap', 'xor', 'xor_bits', ); $self->listAdd('types', 'atom', 'constant', 'global', 'integer', 'object', 'sequence', 'type', ); $self->contextdata({ 'Comment' => { callback => \&parseComment, attribute => 'Comment', lineending => '#pop', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'String' => { callback => \&parseString, attribute => 'String', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Euphoria'; } sub parseComment { my ($self, $text) = @_; # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # String => '\bend\s+for\b' # attribute => 'Keyword' # context => '#stay' # endRegion => 'regFor' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bend\\s+for\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bfor\b' # attribute => 'Keyword' # beginRegion => 'regFor' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bfor\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bend\s+if\b' # attribute => 'Keyword' # context => '#stay' # endRegion => 'regIf' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bend\\s+if\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bif\b' # attribute => 'Keyword' # beginRegion => 'regIf' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bif\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bend\s+function\b' # attribute => 'Keyword' # context => '#stay' # endRegion => 'regFunction' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bend\\s+function\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bfunction\b' # attribute => 'Keyword' # beginRegion => 'regFunction' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bfunction\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bend\s+procedure\b' # attribute => 'Keyword' # context => '#stay' # endRegion => 'regProcedure' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bend\\s+procedure\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bprocedure\b' # attribute => 'Keyword' # beginRegion => 'regProcedure' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bprocedure\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bend\s+while\b' # attribute => 'Keyword' # context => '#stay' # endRegion => 'regWhile' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bend\\s+while\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bwhile\b' # attribute => 'Keyword' # beginRegion => 'regWhile' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bwhile\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bend\s+type\b' # attribute => 'Keyword' # context => '#stay' # endRegion => 'regType' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bend\\s+type\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\btype\b' # attribute => 'Keyword' # beginRegion => 'regType' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\btype\\b', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'GtkKeywords' # attribute => 'GtkKeyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'GtkKeywords', 0, undef, 0, '#stay', 'GtkKeyword')) { return 1 } # String => 'types' # attribute => 'Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Type')) { return 1 } # attribute => 'Number' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Number')) { return 1 } # attribute => 'Number' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Number')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # String => '--\s*BEGIN.*' # attribute => 'Region Marker' # beginRegion => 'regMarker' # context => '#stay' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '--\\s*BEGIN.*', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { return 1 } # String => '--\s*END.*' # attribute => 'Region Marker' # context => '#stay' # endRegion => 'regMarker' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '--\\s*END.*', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { return 1 } # attribute => 'Comment' # char => '-' # char1 => '-' # context => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { return 1 } return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Euphoria - a Plugin for Euphoria syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Euphoria; my $sh = new Syntax::Highlight::Engine::Kate::Euphoria([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Euphoria is a plugin module that provides syntax highlighting for Euphoria to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Makefile.pm0000644000175000017500000001760113226470762026377 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'makefile.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.06 #kate version 2.4 #kate author Per Wigren (wigren@home.se) #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::Makefile; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Commands' => 'BaseN', 'Comment' => 'Comment', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Operator' => 'Char', 'Section' => 'Others', 'Special' => 'Float', 'String' => 'String', 'Target' => 'DecVal', 'Variable' => 'DataType', }); $self->listAdd('keywords', 'define', 'else', 'endef', 'endif', 'ifdef', 'ifeq', 'ifndef', 'ifneq', 'include', ); $self->contextdata({ 'Commands' => { callback => \&parseCommands, attribute => 'Normal Text', lineending => '#pop', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'String' => { callback => \&parseString, attribute => 'String', lineending => '#pop', }, 'Value' => { callback => \&parseValue, attribute => 'String', }, 'VarFromNormal' => { callback => \&parseVarFromNormal, attribute => 'Variable', }, 'VarFromValue' => { callback => \&parseVarFromValue, attribute => 'Variable', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Makefile'; } sub parseCommands { my ($self, $text) = @_; # String => '[$][\({]' # attribute => 'Operator' # context => 'VarFromNormal' # type => 'RegExpr' if ($self->testRegExpr($text, '[$][\\({]', 0, 0, 0, undef, 0, 'VarFromNormal', 'Operator')) { return 1 } # String => '[_\w-]*\b' # attribute => 'Commands' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[_\\w-]*\\b', 0, 0, 0, undef, 0, '#pop', 'Commands')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '[_\w\d]*\s*(?=:=|=)' # attribute => 'Variable' # context => 'Value' # type => 'RegExpr' if ($self->testRegExpr($text, '[_\\w\\d]*\\s*(?=:=|=)', 0, 0, 0, undef, 0, 'Value', 'Variable')) { return 1 } # String => '[_\w\d-]*\s*:' # attribute => 'Target' # context => '#stay' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '[_\\w\\d-]*\\s*:', 0, 0, 0, undef, 1, '#stay', 'Target')) { return 1 } # String => '^[.].*:' # attribute => 'Section' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '^[.].*:', 0, 0, 0, undef, 0, '#stay', 'Section')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # String => '[$][\({]' # attribute => 'Operator' # context => 'VarFromNormal' # type => 'RegExpr' if ($self->testRegExpr($text, '[$][\\({]', 0, 0, 0, undef, 0, 'VarFromNormal', 'Operator')) { return 1 } # String => '+*=%$():\\;' # attribute => 'Operator' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '+*=%$():\\\\;', 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '[@-]' # attribute => 'Operator' # context => 'Commands' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '[@-]', 0, 0, 0, undef, 1, 'Commands', 'Operator')) { return 1 } # String => '(:^|[^\\])#.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(:^|[^\\\\])#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; sub parseValue { my ($self, $text) = @_; # String => '\\$' # attribute => 'Operator' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\$', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '[^\\]?$' # attribute => 'String' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[^\\\\]?$', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } # String => '[$][\({]' # attribute => 'Operator' # context => 'VarFromValue' # type => 'RegExpr' if ($self->testRegExpr($text, '[$][\\({]', 0, 0, 0, undef, 0, 'VarFromValue', 'Operator')) { return 1 } # String => '@[-_\d\w]*@' # attribute => 'Special' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '@[-_\\d\\w]*@', 0, 0, 0, undef, 0, '#pop', 'Special')) { return 1 } # attribute => 'Operator' # char => ';' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'Operator')) { return 1 } return 0; }; sub parseVarFromNormal { my ($self, $text) = @_; # String => '[\)}]' # attribute => 'Operator' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\)}]', 0, 0, 0, undef, 0, '#pop', 'Operator')) { return 1 } return 0; }; sub parseVarFromValue { my ($self, $text) = @_; # String => '[\)}](?=/)' # attribute => 'Operator' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\)}](?=/)', 0, 0, 0, undef, 0, '#pop', 'Operator')) { return 1 } # String => '[\)}][^$]' # attribute => 'Operator' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\)}][^$]', 0, 0, 0, undef, 0, '#pop', 'Operator')) { return 1 } # String => '[\)}]$' # attribute => 'Operator' # context => '#pop#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\)}]$', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Makefile - a Plugin for Makefile syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Makefile; my $sh = new Syntax::Highlight::Engine::Kate::Makefile([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Makefile is a plugin module that provides syntax highlighting for Makefile to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/MIPS_Assembler.pm0000644000175000017500000002477213226470762027436 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'mips.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.03 #kate version 2.4 #kate author Dominik Haumann (dhdev@gmx.de) #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::MIPS_Assembler; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Char' => 'Char', 'Comment' => 'Comment', 'Decimal' => 'DecVal', 'Float' => 'Float', 'Floating Point Register' => 'Float', 'Hardware Instruction' => 'Keyword', 'Hex' => 'BaseN', 'Label' => 'Others', 'Main Register' => 'DataType', 'Normal Text' => 'Normal', 'Octal' => 'BaseN', 'Other Register' => 'DataType', 'Pseudo Instruction' => 'Function', 'Region Marker' => 'RegionMarker', 'Section' => 'DataType', 'String' => 'String', 'Type' => 'Keyword', }); $self->listAdd('fp', '$f0', '$f1', '$f10', '$f11', '$f12', '$f13', '$f14', '$f15', '$f16', '$f17', '$f18', '$f19', '$f2', '$f20', '$f21', '$f22', '$f23', '$f24', '$f25', '$f26', '$f27', '$f28', '$f29', '$f3', '$f30', '$f31', '$f4', '$f5', '$f6', '$f7', '$f8', '$f9', ); $self->listAdd('hardware', 'abs.d', 'abs.s', 'add', 'add.d', 'add.s', 'addi', 'addiu', 'addu', 'and', 'andi', 'bc0f', 'bc0t', 'bc1f', 'bc1t', 'bc2f', 'bc2t', 'bc3f', 'bc3t', 'beq', 'bgez', 'bgezal', 'bgtz', 'blez', 'bltz', 'bltzal', 'bne', 'break', 'c.eq.d', 'c.eq.s', 'c.le.d', 'c.le.s', 'c.lt.d', 'c.lt.s', 'c.ole.d', 'c.ole.s', 'c.olt.d', 'c.olt.s', 'c.seq.d', 'c.seq.s', 'c.ueq.d', 'c.ueq.s', 'c.ule.d', 'c.ule.s', 'c.ult.d', 'c.ult.s', 'c.un.d', 'c.un.s', 'cvt.d.s', 'cvt.d.w', 'cvt.s.d', 'cvt.s.w', 'cvt.w.d', 'cvt.w.s', 'div.d', 'div.s', 'j', 'jal', 'jalr', 'jr', 'lb', 'lbu', 'lh', 'lhu', 'lui', 'lw', 'lwc0', 'lwc1', 'lwc2', 'lwc3', 'lwl', 'lwr', 'mfc0', 'mfc1', 'mfc2', 'mfc3', 'mfhi', 'mflo', 'mtc0', 'mtc1', 'mtc2', 'mtc3', 'mthi', 'mtlo', 'mul.d', 'mul.s', 'mult', 'multu', 'nor', 'or', 'ori', 'rfe', 'sb', 'sh', 'sll', 'sllv', 'slt', 'slti', 'sltiu', 'sra', 'srav', 'srl', 'srlv', 'sub', 'sub.d', 'sub.s', 'subu', 'sw', 'sw', 'swc0', 'swc1', 'swc2', 'swc3', 'swcl', 'swl', 'swl', 'swr', 'swr', 'syscall', 'xor', 'xori', ); $self->listAdd('pseudo', 'abs', 'b', 'beqz', 'bge', 'bgeu', 'bgt', 'bgtu', 'ble', 'bleu', 'blt', 'bltu', 'bnez', 'div', 'divu', 'l.d', 'l.s', 'la', 'ld', 'li', 'li.d', 'li.s', 'mfc0.d', 'mfc1.d', 'mfc2.d', 'mfc3.d', 'mov.d', 'mov.s', 'move', 'mul', 'mulo', 'mulou', 'neg', 'neg.d', 'neg.s', 'negu', 'nop', 'not', 'rem', 'remu', 'rol', 'ror', 's.d', 's.s', 'sd', 'seq', 'sge', 'sgeu', 'sgt', 'sgtu', 'sle', 'sleu', 'sne', 'ulh', 'ulhu', 'ulw', 'ush', 'usw', ); $self->listAdd('register1', '$0', '$1', '$10', '$11', '$12', '$13', '$14', '$15', '$16', '$17', '$18', '$19', '$2', '$20', '$21', '$22', '$23', '$24', '$25', '$26', '$27', '$28', '$29', '$3', '$30', '$31', '$4', '$5', '$6', '$7', '$8', '$9', '$t0', '$t1', '$t2', '$t3', '$t4', '$t5', '$t6', '$t7', '$t8', '$t9', '$zero', ); $self->listAdd('register2', '$a0', '$a1', '$a2', '$a3', '$at', '$fp', '$gp', '$k0', '$k1', '$ra', '$s0', '$s1', '$s2', '$s3', '$s4', '$s5', '$s6', '$s7', '$sp', '$v0', '$v1', ); $self->listAdd('section', '.data', '.kdata', '.ktext', '.text', ); $self->listAdd('type', '.align', '.ascii', '.asciiz', '.byte', '.double', '.extern', '.float', '.globl', '.half', '.sdata', '.set', '.space', '.word', ); $self->contextdata({ 'normal' => { callback => \&parsenormal, attribute => 'Normal Text', }, 'string' => { callback => \&parsestring, attribute => 'String', }, }); $self->deliminators('\\s||\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|\\.'); $self->basecontext('normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'MIPS Assembler'; } sub parsenormal { my ($self, $text) = @_; # String => 'hardware' # attribute => 'Hardware Instruction' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'hardware', 0, undef, 0, '#stay', 'Hardware Instruction')) { return 1 } # String => 'pseudo' # attribute => 'Pseudo Instruction' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'pseudo', 0, undef, 0, '#stay', 'Pseudo Instruction')) { return 1 } # String => 'register1' # attribute => 'Other Register' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'register1', 0, undef, 0, '#stay', 'Other Register')) { return 1 } # String => 'register2' # attribute => 'Main Register' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'register2', 0, undef, 0, '#stay', 'Main Register')) { return 1 } # String => 'fp' # attribute => 'Floating Point Register' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'fp', 0, undef, 0, '#stay', 'Floating Point Register')) { return 1 } # String => 'section' # attribute => 'Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'section', 0, undef, 0, '#stay', 'Type')) { return 1 } # String => 'type' # attribute => 'Section' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'type', 0, undef, 0, '#stay', 'Section')) { return 1 } # String => '#\s*BEGIN.*$' # attribute => 'Region Marker' # beginRegion => 'region' # context => '#stay' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*BEGIN.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { return 1 } # String => '#\s*END.*$' # attribute => 'Region Marker' # context => '#stay' # endRegion => 'region' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*END.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { return 1 } # String => '#.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # String => '[\w_\.]+:' # attribute => 'Label' # context => '#stay' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\w_\\.]+:', 0, 0, 0, undef, 1, '#stay', 'Label')) { return 1 } # attribute => 'String' # char => '"' # context => 'string' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'String')) { return 1 } # attribute => 'Float' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { return 1 } # attribute => 'Octal' # context => '#stay' # type => 'HlCOct' if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) { return 1 } # attribute => 'Hex' # context => '#stay' # type => 'HlCHex' if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) { return 1 } # attribute => 'Decimal' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { return 1 } return 0; }; sub parsestring { my ($self, $text) = @_; # String => '\\.' # attribute => 'Char' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::MIPS_Assembler - a Plugin for MIPS Assembler syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::MIPS_Assembler; my $sh = new Syntax::Highlight::Engine::Kate::MIPS_Assembler([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::MIPS_Assembler is a plugin module that provides syntax highlighting for MIPS Assembler to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/SQL_PostgreSQL.pm0000644000175000017500000005312313226470762027403 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'sql-postgresql.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.08 #kate version 2.4 #kate author Shane Wright (me@shanewright.co.uk) #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::SQL_PostgreSQL; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Comment' => 'Comment', 'Data Type' => 'DataType', 'Decimal' => 'DecVal', 'Float' => 'Float', 'Function' => 'Function', 'Identifier' => 'Others', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Operator' => 'Normal', 'Preprocessor' => 'Others', 'String' => 'String', 'String Char' => 'Char', 'Symbol' => 'Char', }); $self->listAdd('functions', 'ABBREV', 'ABS', 'ACOS', 'AGE', 'AREA', 'ASCII', 'ASIN', 'ATAN', 'ATAN2', 'AVG', 'BIT_LENGTH', 'BOX', 'BOX', 'BROADCAST', 'BTRIM', 'CBRT', 'CEIL', 'CENTER', 'CHARACTER_LENGTH', 'CHAR_LENGTH', 'CHR', 'CIRCLE', 'COALESCE', 'COL_DESCRIPTION', 'CONVERT', 'COS', 'COT', 'COUNT', 'CURRVAL', 'DATE_PART', 'DATE_TRUNC', 'DECODE', 'DEGREES', 'DIAMETER', 'ENCODE', 'EXP', 'EXTRACT', 'EXTRACT', 'FLOOR', 'HAS_TABLE_PRIVILEGE', 'HEIGHT', 'HOST', 'INITCAP', 'ISCLOSED', 'ISFINITE', 'ISOPEN', 'LENGTH', 'LN', 'LOG', 'LOWER', 'LPAD', 'LSEG', 'LTRIM', 'MASKLEN', 'MAX', 'MIN', 'MOD', 'NETMASK', 'NETWORK', 'NEXTVAL', 'NOW', 'NPOINT', 'NULLIF', 'OBJ_DESCRIPTION', 'OCTET_LENGTH', 'PATH', 'PCLOSE', 'PG_CLIENT_ENCODING', 'PG_GET_INDEXDEF', 'PG_GET_RULEDEF', 'PG_GET_USERBYID', 'PG_GET_VIEWDEF', 'PI', 'POINT', 'POLYGON', 'POPEN', 'POSITION', 'POW', 'RADIANS', 'RADIUS', 'RANDOM', 'REPEAT', 'ROUND', 'RPAD', 'RTRIM', 'SETVAL', 'SET_MASKLEN', 'SIGN', 'SIN', 'SQRT', 'STDDEV', 'STRPOS', 'SUBSTR', 'SUBSTRING', 'SUM', 'TAN', 'TIMEOFDAY', 'TIMESTAMP', 'TO_ASCII', 'TO_CHAR', 'TO_DATE', 'TO_NUMBER', 'TO_TIMESTAMP', 'TRANSLATE', 'TRIM', 'TRUNC', 'UPPER', 'VARIANCE', 'WIDTH', ); $self->listAdd('keywords', 'ABORT', 'ACCESS', 'ACTION', 'ADD', 'ADMIN', 'AFTER', 'AGGREGATE', 'ALIAS', 'ALL', 'ALLOCATE', 'ALTER', 'ANALYSE', 'ANALYZE', 'ANY', 'ARE', 'AS', 'ASC', 'ASENSITIVE', 'ASSERTION', 'ASSIGNMENT', 'ASYMMETRIC', 'AT', 'ATOMIC', 'AUTHORIZATION', 'BACKWARD', 'BEFORE', 'BEGIN', 'BETWEEN', 'BINARY', 'BOTH', 'BREADTH', 'BY', 'C', 'CACHE', 'CALL', 'CALLED', 'CARDINALITY', 'CASCADE', 'CASCADED', 'CASE', 'CAST', 'CATALOG', 'CATALOG_NAME', 'CHAIN', 'CHARACTERISTICS', 'CHARACTER_LENGTH', 'CHARACTER_SET_CATALOG', 'CHARACTER_SET_NAME', 'CHARACTER_SET_SCHEMA', 'CHAR_LENGTH', 'CHECK', 'CHECKED', 'CHECKPOINT', 'CLASS', 'CLASS_ORIGIN', 'CLOB', 'CLOSE', 'CLUSTER', 'COALESCE', 'COBOL', 'COLLATE', 'COLLATION', 'COLLATION_CATALOG', 'COLLATION_NAME', 'COLLATION_SCHEMA', 'COLUMN', 'COLUMN_NAME', 'COMMAND_FUNCTION', 'COMMAND_FUNCTION_CODE', 'COMMENT', 'COMMIT', 'COMMITTED', 'COMPLETION', 'CONDITION_NUMBER', 'CONNECT', 'CONNECTION', 'CONNECTION_NAME', 'CONSTRAINT', 'CONSTRAINTS', 'CONSTRAINT_CATALOG', 'CONSTRAINT_NAME', 'CONSTRAINT_SCHEMA', 'CONSTRUCTOR', 'CONTAINS', 'CONTINUE', 'CONVERT', 'COPY', 'CORRESPONDING', 'COUNT', 'CREATE', 'CREATEDB', 'CREATEUSER', 'CROSS', 'CUBE', 'CURRENT', 'CURRENT_DATE', 'CURRENT_PATH', 'CURRENT_ROLE', 'CURRENT_TIME', 'CURRENT_TIMESTAMP', 'CURRENT_USER', 'CURSOR', 'CURSOR_NAME', 'CYCLE', 'DATA', 'DATABASE', 'DATE', 'DATETIME_INTERVAL_CODE', 'DATETIME_INTERVAL_PRECISION', 'DAY', 'DEALLOCATE', 'DEC', 'DECIMAL', 'DECLARE', 'DEFAULT', 'DEFERRABLE', 'DEFERRED', 'DEFINED', 'DEFINER', 'DELETE', 'DELIMITERS', 'DEPTH', 'DEREF', 'DESC', 'DESCRIBE', 'DESCRIPTOR', 'DESTROY', 'DESTRUCTOR', 'DETERMINISTIC', 'DIAGNOSTICS', 'DICTIONARY', 'DISCONNECT', 'DISPATCH', 'DISTINCT', 'DO', 'DOMAIN', 'DOUBLE', 'DROP', 'DYNAMIC', 'DYNAMIC_FUNCTION', 'DYNAMIC_FUNCTION_CODE', 'EACH', 'ELSE', 'ENCODING', 'ENCRYPTED', 'END', 'END-EXEC', 'EQUALS', 'ESCAPE', 'EVERY', 'EXCEPT', 'EXCEPTION', 'EXCLUSIVE', 'EXEC', 'EXECUTE', 'EXISTING', 'EXISTS', 'EXPLAIN', 'EXTERNAL', 'FALSE', 'FETCH', 'FINAL', 'FIRST', 'FOR', 'FORCE', 'FOREIGN', 'FORTRAN', 'FORWARD', 'FOUND', 'FREE', 'FREEZE', 'FROM', 'FULL', 'FUNCTION', 'G', 'GENERAL', 'GENERATED', 'GET', 'GLOBAL', 'GO', 'GOTO', 'GRANT', 'GRANTED', 'GROUP', 'GROUPING', 'HANDLER', 'HAVING', 'HIERARCHY', 'HOLD', 'HOST', 'HOUR', 'IDENTITY', 'IGNORE', 'ILIKE', 'IMMEDIATE', 'IMMUTABLE', 'IMPLEMENTATION', 'IN', 'INCREMENT', 'INDEX', 'INDICATOR', 'INFIX', 'INHERITS', 'INITIALIZE', 'INITIALLY', 'INNER', 'INOUT', 'INPUT', 'INSENSITIVE', 'INSERT', 'INSTANCE', 'INSTANTIABLE', 'INSTEAD', 'INTERSECT', 'INTERVAL', 'INTO', 'INVOKER', 'IS', 'ISNULL', 'ISOLATION', 'ITERATE', 'JOIN', 'K', 'KEY', 'KEY_MEMBER', 'KEY_TYPE', 'LANCOMPILER', 'LANGUAGE', 'LARGE', 'LAST', 'LATERAL', 'LEADING', 'LEFT', 'LENGTH', 'LESS', 'LEVEL', 'LIKE', 'LIMIT', 'LISTEN', 'LOAD', 'LOCAL', 'LOCALTIME', 'LOCALTIMESTAMP', 'LOCATION', 'LOCATOR', 'LOCK', 'LOWER', 'M', 'MAP', 'MATCH', 'MAX', 'MAXVALUE', 'MESSAGE_LENGTH', 'MESSAGE_OCTET_LENGTH', 'MESSAGE_TEXT', 'METHOD', 'MIN', 'MINUTE', 'MINVALUE', 'MOD', 'MODE', 'MODIFIES', 'MODIFY', 'MODULE', 'MONTH', 'MORE', 'MOVE', 'MUMPS', 'NAME', 'NAMES', 'NATIONAL', 'NATURAL', 'NEW', 'NEXT', 'NO', 'NOCREATEDB', 'NOCREATEUSER', 'NONE', 'NOT', 'NOTHING', 'NOTIFY', 'NOTNULL', 'NULL', 'NULLABLE', 'NULLIF', 'NUMBER', 'NUMERIC', 'OBJECT', 'OCTET_LENGTH', 'OF', 'OFF', 'OFFSET', 'OIDS', 'OLD', 'ON', 'ONLY', 'OPEN', 'OPERATION', 'OPERATOR', 'OPTION', 'OPTIONS', 'ORDER', 'ORDINALITY', 'OUT', 'OUTER', 'OUTPUT', 'OVERLAPS', 'OVERLAY', 'OVERRIDING', 'OWNER', 'PAD', 'PARAMETER', 'PARAMETERS', 'PARAMETER_MODE', 'PARAMETER_NAME', 'PARAMETER_ORDINAL_POSITION', 'PARAMETER_SPECIFIC_CATALOG', 'PARAMETER_SPECIFIC_NAME', 'PARAMETER_SPECIFIC_SCHEMA', 'PARTIAL', 'PASCAL', 'PASSWORD', 'PATH', 'PENDANT', 'PLI', 'POSITION', 'POSTFIX', 'PRECISION', 'PREFIX', 'PREORDER', 'PREPARE', 'PRESERVE', 'PRIMARY', 'PRIOR', 'PRIVILEGES', 'PROCEDURAL', 'PROCEDURE', 'PUBLIC', 'READ', 'READS', 'REAL', 'RECURSIVE', 'REF', 'REFERENCES', 'REFERENCING', 'REINDEX', 'RELATIVE', 'RENAME', 'REPEATABLE', 'REPLACE', 'RESET', 'RESTRICT', 'RESULT', 'RETURN', 'RETURNED_LENGTH', 'RETURNED_OCTET_LENGTH', 'RETURNED_SQLSTATE', 'RETURNS', 'REVOKE', 'RIGHT', 'ROLE', 'ROLLBACK', 'ROLLUP', 'ROUTINE', 'ROUTINE_CATALOG', 'ROUTINE_NAME', 'ROUTINE_SCHEMA', 'ROW', 'ROWS', 'ROW_COUNT', 'RULE', 'SAVEPOINT', 'SCALE', 'SCHEMA', 'SCHEMA_NAME', 'SCOPE', 'SCROLL', 'SEARCH', 'SECOND', 'SECTION', 'SECURITY', 'SELECT', 'SELF', 'SENSITIVE', 'SEQUENCE', 'SERIALIZABLE', 'SERVER_NAME', 'SESSION', 'SESSION_USER', 'SET', 'SETOF', 'SETS', 'SHARE', 'SHOW', 'SIMILAR', 'SIMPLE', 'SIZE', 'SOME', 'SOURCE', 'SPACE', 'SPECIFIC', 'SPECIFICTYPE', 'SPECIFIC_NAME', 'SQL', 'SQLCODE', 'SQLERROR', 'SQLEXCEPTION', 'SQLSTATE', 'SQLWARNING', 'STABLE', 'START', 'STATE', 'STATEMENT', 'STATIC', 'STATISTICS', 'STDIN', 'STDOUT', 'STRUCTURE', 'STYLE', 'SUBCLASS_ORIGIN', 'SUBLIST', 'SUBSTRING', 'SUM', 'SYMMETRIC', 'SYSID', 'SYSTEM', 'SYSTEM_USER', 'TABLE', 'TABLE_NAME', 'TEMP', 'TEMPLATE', 'TEMPORARY', 'TERMINATE', 'THAN', 'THEN', 'TIMEZONE_HOUR', 'TIMEZONE_MINUTE', 'TO', 'TOAST', 'TRAILING', 'TRANSACTION', 'TRANSACTIONS_COMMITTED', 'TRANSACTIONS_ROLLED_BACK', 'TRANSACTION_ACTIVE', 'TRANSFORM', 'TRANSFORMS', 'TRANSLATE', 'TRANSLATION', 'TREAT', 'TRIGGER', 'TRIGGER_CATALOG', 'TRIGGER_NAME', 'TRIGGER_SCHEMA', 'TRIM', 'TRUE', 'TRUNCATE', 'TRUSTED', 'TYPE', 'UNCOMMITTED', 'UNDER', 'UNENCRYPTED', 'UNION', 'UNIQUE', 'UNKNOWN', 'UNLISTEN', 'UNNAMED', 'UNNEST', 'UNTIL', 'UPDATE', 'UPPER', 'USAGE', 'USER', 'USER_DEFINED_TYPE_CATALOG', 'USER_DEFINED_TYPE_NAME', 'USER_DEFINED_TYPE_SCHEMA', 'USING', 'VACUUM', 'VALID', 'VALUE', 'VALUES', 'VARIABLE', 'VARYING', 'VERBOSE', 'VERSION', 'VIEW', 'VOLATILE', 'WHEN', 'WHENEVER', 'WHERE', 'WITH', 'WITHOUT', 'WORK', 'WRITE', 'YEAR', 'ZONE', ); $self->listAdd('operators', '!', '!!', '!=', '!~', '!~*', '#', '##', '%', '&', '&&', '&<', '&>', '*', '**', '+', '-', '..', '/', ':=', '<', '<->', '<<', '<<=', '<=', '<>', '<^', '=', '=>', '>', '>=', '>>', '>>=', '>^', '?#', '?-', '?-|', '?|', '?||', '@', '@-@', '@@', 'AND', 'NOT', 'OR', '^', '^=', '|', '|/', '||', '||/', '~', '~*', '~=', ); $self->listAdd('types', 'BIGINT', 'BIGSERIAL', 'BIT', 'BIT VARYING', 'BOOL', 'BOOLEAN', 'BOX', 'BYTEA', 'CHAR', 'CHARACTER', 'CHARACTER VARYING', 'CIDR', 'CIRCLE', 'DATE', 'DECIMAL', 'DOUBLE PRECISION', 'FLOAT8', 'INET', 'INT', 'INT2', 'INT4', 'INT8', 'INTEGER', 'INTERVAL', 'LINE', 'LSEG', 'LZTEXT', 'MACADDR', 'MONEY', 'NUMERIC', 'OID', 'PATH', 'POINT', 'POLYGON', 'REAL', 'SERIAL', 'SERIAL8', 'SMALLINT', 'TEXT', 'TIME', 'TIMESTAMP', 'TIMESTAMP WITH TIMEZONE', 'TIMESTAMPTZ', 'TIMETZ', 'VARBIT', 'VARCHAR', ); $self->contextdata({ 'Identifier' => { callback => \&parseIdentifier, attribute => 'Identifier', lineending => '#pop', }, 'MultiLineComment' => { callback => \&parseMultiLineComment, attribute => 'Comment', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'Preprocessor' => { callback => \&parsePreprocessor, attribute => 'Preprocessor', lineending => '#pop', }, 'SingleLineComment' => { callback => \&parseSingleLineComment, attribute => 'Comment', lineending => '#pop', }, 'String' => { callback => \&parseString, attribute => 'String', }, }); $self->deliminators('\\s||\\(|\\)|,|;|\\[|\\]|\\{|\\}|\\\\|\\+|-|\\*|\\/|\\||\\!|@|\\&|#|<|>|\\%|\\^|=|\\~|:|\\.|\\?'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'SQL (PostgreSQL)'; } sub parseIdentifier { my ($self, $text) = @_; # attribute => 'Identifier' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Identifier')) { return 1 } return 0; }; sub parseMultiLineComment { my ($self, $text) = @_; # attribute => 'Comment' # context => '#pop' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#pop', 'Comment')) { return 1 } # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # endRegion => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'operators' # attribute => 'Operator' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'operators', 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => 'functions' # attribute => 'Function' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) { return 1 } # String => 'types' # attribute => 'Data Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%bulk_exceptions\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%bulk_exceptions\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%bulk_rowcount\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%bulk_rowcount\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%found\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%found\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%isopen\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%isopen\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%notfound\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%notfound\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%rowcount\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%rowcount\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%rowtype\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%rowtype\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%type\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%type\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # attribute => 'Float' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { return 1 } # attribute => 'Decimal' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # attribute => 'String' # char => ''' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # attribute => 'Comment' # char => '#' # context => 'SingleLineComment' # type => 'DetectChar' if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'SingleLineComment', 'Comment')) { return 1 } # attribute => 'Comment' # char => '-' # char1 => '-' # context => 'SingleLineComment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, 'SingleLineComment', 'Comment')) { return 1 } # attribute => 'Comment' # beginRegion => 'Comment' # char => '/' # char1 => '*' # context => 'MultiLineComment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'MultiLineComment', 'Comment')) { return 1 } # String => 'rem\b' # attribute => 'Comment' # column => '0' # context => 'SingleLineComment' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, 'rem\\b', 1, 0, 0, 0, 0, 'SingleLineComment', 'Comment')) { return 1 } # attribute => 'Comment' # char => '"' # context => 'Identifier' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'Identifier', 'Comment')) { return 1 } # String => ':&' # attribute => 'Symbol' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, ':&', 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # String => '/$' # attribute => 'Symbol' # column => '0' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '/$', 0, 0, 0, 0, 0, '#stay', 'Symbol')) { return 1 } # String => '@@?[^@ \t\r\n]' # attribute => 'Preprocessor' # column => '0' # context => 'Preprocessor' # type => 'RegExpr' if ($self->testRegExpr($text, '@@?[^@ \\t\\r\\n]', 0, 0, 0, 0, 0, 'Preprocessor', 'Preprocessor')) { return 1 } return 0; }; sub parsePreprocessor { my ($self, $text) = @_; return 0; }; sub parseSingleLineComment { my ($self, $text) = @_; return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # context => '#pop' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#pop', 'String')) { return 1 } # attribute => 'String Char' # context => '#stay' # type => 'HlCStringChar' if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { return 1 } # attribute => 'Symbol' # char => '&' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '&', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # attribute => 'String' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::SQL_PostgreSQL - a Plugin for SQL (PostgreSQL) syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::SQL_PostgreSQL; my $sh = new Syntax::Highlight::Engine::Kate::SQL_PostgreSQL([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::SQL_PostgreSQL is a plugin module that provides syntax highlighting for SQL (PostgreSQL) to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Prolog.pm0000644000175000017500000002176713226470762026134 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'prolog.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.04 #kate version 2.1 #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::Prolog; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Arithmetic' => 'Keyword', 'Comment' => 'Comment', 'Data Type' => 'DataType', 'Identifier' => 'Normal', 'Integer' => 'DecVal', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'String' => 'String', 'Symbol' => 'Normal', 'Variable' => 'Others', }); $self->listAdd('arith', 'abs', 'arctan', 'cos', 'div', 'exp', 'ln', 'log', 'mod', 'random', 'randominit', 'round', 'sin', 'sqrt', 'tan', 'trunc', 'val', ); $self->listAdd('basetype', 'binary', 'byte', 'char', 'dword', 'integer', 'long', 'real', 'ref', 'sbyte', 'short', 'string', 'symbol', 'ulong', 'unsigned', 'ushort', 'word', ); $self->listAdd('compiler', 'bgidriver', 'bgifont', 'check_determ', 'code', 'config', 'diagnostics', 'error', 'errorlevel', 'gstacksize', 'heap', 'nobreak', 'nowarnings', 'printermenu', 'project', ); $self->listAdd('keywordl', 'abstract', 'align', 'and', 'as', 'class', 'clauses', 'constants', 'database', 'determ', 'domains', 'elsedef', 'endclass', 'enddef', 'erroneous', 'facts', 'failure', 'global', 'goal', 'if', 'ifdef', 'ifndef', 'implement', 'include', 'language', 'multi', 'nocopy', 'nondeterm', 'object', 'or', 'predicates', 'procedure', 'protected', 'reference', 'single', 'static', 'struct', 'this', ); $self->listAdd('keywords', 'false', 'true', ); $self->listAdd('keywordu', 'ABSTRACT', 'ALIGN', 'AND', 'AS', 'CLASS', 'CLAUSES', 'CONSTANTS', 'DATABASE', 'DETERM', 'DOMAINS', 'ELSEDEF', 'ENDCLASS', 'ENDDEF', 'ERRONEOUS', 'FACTS', 'FAILURE', 'GLOBAL', 'GOAL', 'IF', 'IFDEF', 'IFNDEF', 'IMPLEMENT', 'INCLUDE', 'LANGUAGE', 'MULTI', 'NOCOPY', 'NONDETERM', 'OBJECT', 'OR', 'PREDICATES', 'PROCEDURE', 'PROTECTED', 'REFERENCE', 'SINGLE', 'STATIC', 'STRUCT', 'THIS', ); $self->listAdd('special', 'assert', 'asserta', 'assertz', 'bound', 'chain_inserta', 'chain_insertafter', 'chain_insertz', 'chain_terms', 'consult', 'db_btrees', 'db_chains', 'fail', 'findall', 'format', 'free', 'msgrecv', 'msgsend', 'nl', 'not', 'readterm', 'ref_term', 'retract', 'retractall', 'save', 'term_bin', 'term_replace', 'term_str', 'trap', 'write', 'writef', ); $self->contextdata({ 'comment' => { callback => \&parsecomment, attribute => 'Comment', lineending => '#pop', }, 'comment region' => { callback => \&parsecommentregion, attribute => 'Comment', }, 'normal' => { callback => \&parsenormal, attribute => 'Symbol', }, 'string' => { callback => \&parsestring, attribute => 'String', }, 'string2' => { callback => \&parsestring2, attribute => 'String', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Prolog'; } sub parsecomment { my ($self, $text) = @_; return 0; }; sub parsecommentregion { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parsenormal { my ($self, $text) = @_; # String => 'keywordl' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywordl', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'keywordu' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywordu', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'arith' # attribute => 'Arithmetic' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'arith', 0, undef, 0, '#stay', 'Arithmetic')) { return 1 } # String => 'compiler' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'compiler', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'special' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'special', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'basetype' # attribute => 'Data Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'basetype', 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '[A-Z_][A-Za-z0-9_]*' # attribute => 'Variable' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[A-Z_][A-Za-z0-9_]*', 0, 0, 0, undef, 0, '#stay', 'Variable')) { return 1 } # String => '[a-z][A-Za-z0-9_]*' # attribute => 'Identifier' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[a-z][A-Za-z0-9_]*', 0, 0, 0, undef, 0, '#stay', 'Identifier')) { return 1 } # attribute => 'Comment' # char => '%' # context => 'comment' # type => 'DetectChar' if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'comment', 'Comment')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '*' # context => 'comment region' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'comment region', 'Comment')) { return 1 } # attribute => 'Integer' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Integer')) { return 1 } # attribute => 'String' # char => '"' # context => 'string' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'String')) { return 1 } # attribute => 'String' # char => ''' # context => 'string2' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'string2', 'String')) { return 1 } # String => '~!^*()-+=[]|\:;,./?&<>' # attribute => 'Symbol' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '~!^*()-+=[]|\\:;,./?&<>', 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } return 0; }; sub parsestring { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; sub parsestring2 { my ($self, $text) = @_; # attribute => 'String' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Prolog - a Plugin for Prolog syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Prolog; my $sh = new Syntax::Highlight::Engine::Kate::Prolog([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Prolog is a plugin module that provides syntax highlighting for Prolog to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Verilog.pm0000644000175000017500000003374413226470762026277 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'verilog.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.07 #kate version 2.4 #kate author Yevgen Voronenko (ysv22@drexel.edu) #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::Verilog; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Alert' => 'Alert', 'Binary' => 'BaseN', 'Block name' => 'DataType', 'Comment' => 'Comment', 'Data Type' => 'DataType', 'Decimal' => 'BaseN', 'Delay' => 'BaseN', 'Drive/charge strength' => 'BaseN', 'Float' => 'Float', 'Gate instantiation' => 'DataType', 'Hex' => 'BaseN', 'Integer' => 'DecVal', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Octal' => 'BaseN', 'Port connection' => 'DataType', 'Prep. Lib' => 'Float', 'Preprocessor' => 'Others', 'String' => 'String', 'String Char' => 'Char', 'Symbol' => 'Normal', 'System Task' => 'DataType', }); $self->listAdd('gates', 'and', 'buf', 'bufif0', 'bufif1', 'cmos', 'nand', 'nmos', 'nor', 'not', 'notif0', 'notif1', 'or', 'pmos', 'pulldown', 'pullup', 'rcmos', 'rnmos', 'rpmos', 'rtran', 'rtranif0', 'rtranif1', 'tran', 'tranif0', 'tranif1', 'xnor', 'xor', ); $self->listAdd('keywords', 'always', 'assign', 'begin', 'case', 'casex', 'casez', 'deassign', 'default', 'defparam', 'disable', 'edge', 'else', 'end', 'endcase', 'endfunction', 'endmodule', 'endspecify', 'endtable', 'endtask', 'for', 'force', 'forever', 'fork', 'function', 'if', 'ifnone', 'initial', 'join', 'macromodule', 'module', 'negedge', 'posedge', 'release', 'repeat', 'specify', 'specparam', 'table', 'task', 'wait', 'while', ); $self->listAdd('strength', 'highz0', 'highz1', 'large', 'medium', 'pull0', 'pull1', 'small', 'strong0', 'strong1', 'weak0', 'weak1', ); $self->listAdd('types', 'event', 'inout', 'input', 'integer', 'output', 'parameter', 'real', 'realtime', 'reg', 'scalared', 'supply0', 'supply1', 'time', 'tri', 'tri0', 'tri1', 'triand', 'trior', 'trireg', 'vectored', 'wand', 'wire', 'wor', ); $self->contextdata({ 'Block name' => { callback => \&parseBlockname, attribute => 'Block name', lineending => '#pop', }, 'Commentar 1' => { callback => \&parseCommentar1, attribute => 'Comment', lineending => '#pop', }, 'Commentar 2' => { callback => \&parseCommentar2, attribute => 'Comment', }, 'Commentar/Preprocessor' => { callback => \&parseCommentarPreprocessor, attribute => 'Comment', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'Preprocessor' => { callback => \&parsePreprocessor, attribute => 'Preprocessor', lineending => '#pop', }, 'Some Context' => { callback => \&parseSomeContext, attribute => 'Normal Text', lineending => '#pop', }, 'Some Context2' => { callback => \&parseSomeContext2, attribute => 'Comment', }, 'String' => { callback => \&parseString, attribute => 'String', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Verilog'; } sub parseBlockname { my ($self, $text) = @_; # String => '[^ ]+' # attribute => 'Data Type' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[^ ]+', 0, 0, 0, undef, 0, '#pop', 'Data Type')) { return 1 } return 0; }; sub parseCommentar1 { my ($self, $text) = @_; # String => '(FIXME|TODO)' # attribute => 'Alert' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) { return 1 } return 0; }; sub parseCommentar2 { my ($self, $text) = @_; # String => '(FIXME|TODO)' # attribute => 'Alert' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) { return 1 } # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseCommentarPreprocessor { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # String => 'begin\ *:' # attribute => 'Keyword' # context => 'Block name' # type => 'RegExpr' if ($self->testRegExpr($text, 'begin\\ *:', 0, 0, 0, undef, 0, 'Block name', 'Keyword')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'types' # attribute => 'Data Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => 'strength' # attribute => 'Drive/charge strength' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'strength', 0, undef, 0, '#stay', 'Drive/charge strength')) { return 1 } # String => 'gates' # attribute => 'Gate instantiation' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'gates', 0, undef, 0, '#stay', 'Gate instantiation')) { return 1 } # String => '[a-zA-Z]+[\w$]*' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[a-zA-Z]+[\\w$]*', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '\\[^ ]+ ' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\[^ ]+ ', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '[\d_]*'d[\d_]+' # attribute => 'Decimal' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\d_]*\'d[\\d_]+', 0, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => '[\d_]*'o[0-7xXzZ_]+' # attribute => 'Octal' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\d_]*\'o[0-7xXzZ_]+', 0, 0, 0, undef, 0, '#stay', 'Octal')) { return 1 } # String => '[\d_]*'h[\da-fA-FxXzZ_]+' # attribute => 'Hex' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\d_]*\'h[\\da-fA-FxXzZ_]+', 0, 0, 0, undef, 0, '#stay', 'Hex')) { return 1 } # String => '[\d_]*'b[01_zZxX]+' # attribute => 'Binary' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\d_]*\'b[01_zZxX]+', 0, 0, 0, undef, 0, '#stay', 'Binary')) { return 1 } # attribute => 'Float' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { return 1 } # attribute => 'Integer' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Integer')) { return 1 } # String => '[^\w$]\.[a-zA-Z]+[\w$]*' # attribute => 'Port connection' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[^\\w$]\\.[a-zA-Z]+[\\w$]*', 0, 0, 0, undef, 0, '#stay', 'Port connection')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Commentar 1' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '*' # context => 'Commentar 2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) { return 1 } # String => '!%&()+,-<=+/:;>?[]^{|}~@' # attribute => 'Symbol' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '!%&()+,-<=+/:;>?[]^{|}~@', 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # String => '#if 0' # attribute => 'Comment' # context => 'Some Context2' # firstNonSpace => 'true' # insensitive => 'FALSE' # type => 'StringDetect' if ($self->testStringDetect($text, '#if 0', 0, 0, 0, undef, 1, 'Some Context2', 'Comment')) { return 1 } # attribute => 'Preprocessor' # char => '`' # column => '0' # context => 'Preprocessor' # type => 'DetectChar' if ($self->testDetectChar($text, '`', 0, 0, 0, 0, 0, 'Preprocessor', 'Preprocessor')) { return 1 } # String => '\`[a-zA-Z_]+\w*' # attribute => 'Preprocessor' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\`[a-zA-Z_]+\\w*', 0, 0, 0, undef, 0, '#stay', 'Preprocessor')) { return 1 } # String => '\$[a-zA-Z_]+\w*' # attribute => 'System Task' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$[a-zA-Z_]+\\w*', 0, 0, 0, undef, 0, '#stay', 'System Task')) { return 1 } # String => '#[\d_]+' # attribute => 'Delay' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#[\\d_]+', 0, 0, 0, undef, 0, '#stay', 'Delay')) { return 1 } return 0; }; sub parsePreprocessor { my ($self, $text) = @_; # attribute => 'Preprocessor' # context => 'Some Context' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, 'Some Context', 'Preprocessor')) { return 1 } # attribute => 'Prep. Lib' # char => '"' # char1 => '"' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'Prep. Lib')) { return 1 } # attribute => 'Prep. Lib' # char => '<' # char1 => '>' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'Prep. Lib')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Commentar 1' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '*' # context => 'Commentar/Preprocessor' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar/Preprocessor', 'Comment')) { return 1 } return 0; }; sub parseSomeContext { my ($self, $text) = @_; return 0; }; sub parseSomeContext2 { my ($self, $text) = @_; # String => '(FIXME|TODO)' # attribute => 'Alert' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) { return 1 } # String => '#endif' # attribute => 'Comment' # context => '#pop' # firstNonSpace => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, '#endif', 0, 0, 0, undef, 1, '#pop', 'Comment')) { return 1 } return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # context => 'Some Context' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, 'Some Context', 'String')) { return 1 } # attribute => 'String Char' # context => '#stay' # type => 'HlCStringChar' if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Verilog - a Plugin for Verilog syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Verilog; my $sh = new Syntax::Highlight::Engine::Kate::Verilog([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Verilog is a plugin module that provides syntax highlighting for Verilog to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/D.pm0000644000175000017500000005456713226470762025061 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'd.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.36 #kate version 2.2 #kate author Simon J Mackenzie (project.katedxml@smackoz.fastmail.fm) #generated: Sun Feb 3 22:02:04 2008, localtime package Syntax::Highlight::Engine::Kate::D; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Assert' => 'Variable', 'Binary' => 'BaseN', 'Char' => 'Char', 'Comment' => 'Comment', 'Debug' => 'BaseN', 'Escape String' => 'String', 'Float' => 'Float', 'Hex' => 'BaseN', 'Integer' => 'DecVal', 'Keyword' => 'Keyword', 'Linkage' => 'IString', 'Linkage Type' => 'Others', 'Module' => 'Keyword', 'Module Name' => 'Reserved', 'Normal Text' => 'Normal', 'Octal' => 'BaseN', 'Phobos Library' => 'BString', 'Pragma' => 'Keyword', 'String' => 'String', 'Type' => 'DataType', 'Unit Test' => 'RegionMarker', 'Version' => 'Keyword', 'Version Type' => 'DataType', 'Wysiwyg' => 'Char', }); $self->listAdd('assert', 'assert', ); $self->listAdd('debug', 'debug', ); $self->listAdd('keywords', 'abstract', 'alias', 'align', 'asm', 'auto', 'body', 'break', 'case', 'cast', 'catch', 'class', 'const', 'continue', 'default', 'delegate', 'delete', 'deprecated', 'do', 'else', 'enum', 'export', 'false', 'final', 'finally', 'for', 'foreach', 'function', 'goto', 'if', 'in', 'inout', 'interface', 'invariant', 'is', 'mixin', 'new', 'null', 'out', 'override', 'package', 'private', 'protected', 'public', 'return', 'static', 'struct', 'super', 'switch', 'synchronized', 'template', 'this', 'throw', 'true', 'try', 'typedef', 'typeof', 'union', 'volatile', 'while', 'with', ); $self->listAdd('linkage', 'extern', ); $self->listAdd('ltypes', 'C', 'D', 'Pascal', 'Windows', ); $self->listAdd('modules', 'import', 'module', ); $self->listAdd('phobos', 'printf', 'writef', ); $self->listAdd('pragma', 'pragma', ); $self->listAdd('ptypes', 'msg', ); $self->listAdd('types', 'bit', 'byte', 'cdouble', 'cent', 'cfloat', 'char', 'creal', 'dchar', 'double', 'float', 'idouble', 'ifloat', 'int', 'ireal', 'long', 'real', 'short', 'ubyte', 'ucent', 'uint', 'ulong', 'ushort', 'void', 'wchar', ); $self->listAdd('unittest', 'unittest', ); $self->listAdd('version', 'version', ); $self->listAdd('vtypes', 'AMD64', 'BigEndian', 'D_InlineAsm', 'DigitalMars', 'LittleEndian', 'Win32', 'Win64', 'Windows', 'X86', 'linux', 'none', ); $self->contextdata({ 'Char' => { callback => \&parseChar, attribute => 'Char', }, 'CommentBlockA' => { callback => \&parseCommentBlockA, attribute => 'Comment', }, 'CommentBlockB' => { callback => \&parseCommentBlockB, attribute => 'Comment', }, 'CommentLine' => { callback => \&parseCommentLine, attribute => 'Comment', lineending => '#pop', }, 'Hex' => { callback => \&parseHex, attribute => 'Hex', }, 'Linkage' => { callback => \&parseLinkage, attribute => 'Linkage', lineending => '#pop', }, 'ModuleName' => { callback => \&parseModuleName, attribute => 'Module Name', }, 'Pragmas' => { callback => \&parsePragmas, attribute => 'Pragma', lineending => '#pop', }, 'String' => { callback => \&parseString, attribute => 'String', }, 'Version' => { callback => \&parseVersion, attribute => 'Version', lineending => '#pop', }, 'Wysiwyg' => { callback => \&parseWysiwyg, attribute => 'Wysiwyg', }, 'normal' => { callback => \&parsenormal, attribute => 'Normal Text', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('normal'); $self->keywordscase(1); $self->initialize; bless ($self, $class); return $self; } sub language { return 'D'; } sub parseChar { my ($self, $text) = @_; # attribute => 'Char' # char => '\' # char1 => ''' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '\'', 0, 0, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'Char' # char => '\' # char1 => '\' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'Char' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Char')) { return 1 } return 0; }; sub parseCommentBlockA { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # endRegion => 'CommentA' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseCommentBlockB { my ($self, $text) = @_; # attribute => 'Comment' # char => '+' # char1 => '/' # context => '#pop' # endRegion => 'CommentB' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '+', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseCommentLine { my ($self, $text) = @_; return 0; }; sub parseHex { my ($self, $text) = @_; # attribute => 'Hex' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Hex')) { return 1 } return 0; }; sub parseLinkage { my ($self, $text) = @_; # String => 'types' # attribute => 'Type' # context => '#pop' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#pop', 'Type')) { return 1 } # attribute => 'Normal Text' # char => '(' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => 'ltypes' # attribute => 'Linkage Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'ltypes', 0, undef, 0, '#stay', 'Linkage Type')) { return 1 } # attribute => 'Normal Text' # char => ')' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } # attribute => 'Normal Text' # char => ';' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } return 0; }; sub parseModuleName { my ($self, $text) = @_; # attribute => 'Normal Text' # char => ',' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, ',', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Normal Text' # char => ';' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'CommentLine' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'CommentLine', 'Comment')) { return 1 } # attribute => 'Comment' # beginRegion => 'CommentA' # char => '/' # char1 => '*' # context => 'CommentBlockA' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'CommentBlockA', 'Comment')) { return 1 } # attribute => 'Comment' # beginRegion => 'CommentB' # char => '/' # char1 => '+' # context => 'CommentBlockB' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '+', 0, 0, 0, undef, 0, 'CommentBlockB', 'Comment')) { return 1 } return 0; }; sub parsePragmas { my ($self, $text) = @_; # attribute => 'Normal Text' # char => '(' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => 'ptypes' # attribute => 'Version Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'ptypes', 0, undef, 0, '#stay', 'Version Type')) { return 1 } # String => 'vtypes' # attribute => 'Version Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'vtypes', 0, undef, 0, '#stay', 'Version Type')) { return 1 } # String => '[_a-z][\w]*' # attribute => 'Keyword' # context => '#pop' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '[_a-z][\\w]*', 1, 0, 0, undef, 0, '#pop', 'Keyword')) { return 1 } # attribute => 'Normal Text' # char => ',' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ',', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } # attribute => 'Normal Text' # char => ')' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; sub parseVersion { my ($self, $text) = @_; # attribute => 'Normal Text' # char => '=' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } # attribute => 'Normal Text' # char => '(' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => 'vtypes' # attribute => 'Version Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'vtypes', 0, undef, 0, '#stay', 'Version Type')) { return 1 } # String => '\w' # attribute => 'Normal Text' # context => '#pop' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\w', 1, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } # attribute => 'Normal Text' # char => ')' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } return 0; }; sub parseWysiwyg { my ($self, $text) = @_; # attribute => 'Wysiwyg' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Wysiwyg')) { return 1 } # attribute => 'Wysiwyg' # char => '`' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, '#pop', 'Wysiwyg')) { return 1 } return 0; }; sub parsenormal { my ($self, $text) = @_; # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'modules' # attribute => 'Module' # context => 'ModuleName' # type => 'keyword' if ($self->testKeyword($text, 'modules', 0, undef, 0, 'ModuleName', 'Module')) { return 1 } # String => 'types' # attribute => 'Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Type')) { return 1 } # String => 'phobos' # attribute => 'Phobos Library' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'phobos', 0, undef, 0, '#stay', 'Phobos Library')) { return 1 } # String => 'linkage' # attribute => 'Linkage' # context => 'Linkage' # type => 'keyword' if ($self->testKeyword($text, 'linkage', 0, undef, 0, 'Linkage', 'Linkage')) { return 1 } # String => 'debug' # attribute => 'Debug' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'debug', 0, undef, 0, '#stay', 'Debug')) { return 1 } # String => 'assert' # attribute => 'Assert' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'assert', 0, undef, 0, '#stay', 'Assert')) { return 1 } # String => 'pragma' # attribute => 'Pragma' # context => 'Pragmas' # type => 'keyword' if ($self->testKeyword($text, 'pragma', 0, undef, 0, 'Pragmas', 'Pragma')) { return 1 } # String => 'version' # attribute => 'Version' # context => 'Version' # type => 'keyword' if ($self->testKeyword($text, 'version', 0, undef, 0, 'Version', 'Version')) { return 1 } # String => 'unittest' # attribute => 'Unit Test' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'unittest', 0, undef, 0, '#stay', 'Unit Test')) { return 1 } # attribute => 'Wysiwyg' # char => 'r' # char1 => '"' # context => 'Wysiwyg' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, 'r', '"', 0, 0, 0, undef, 0, 'Wysiwyg', 'Wysiwyg')) { return 1 } # attribute => 'Hex' # char => 'x' # char1 => '"' # context => 'Hex' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, 'x', '"', 0, 0, 0, undef, 0, 'Hex', 'Hex')) { return 1 } # String => '[_a-z][\w]*' # attribute => 'Normal Text' # context => '#pop' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '[_a-z][\\w]*', 1, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } # String => '\#[ ]*line' # attribute => 'Pragma' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\#[ ]*line', 0, 0, 0, undef, 0, '#pop', 'Pragma')) { return 1 } # String => '\\[n|t|"]' # attribute => 'Escape String' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\[n|t|"]', 0, 0, 0, undef, 0, '#pop', 'Escape String')) { return 1 } # String => '(\\r\\n)' # attribute => 'Escape String' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '(\\\\r\\\\n)', 0, 0, 0, undef, 0, '#pop', 'Escape String')) { return 1 } # String => '\\0[0-7]+' # attribute => 'Escape String' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\0[0-7]+', 0, 0, 0, undef, 0, '#pop', 'Escape String')) { return 1 } # String => '\\u[\d]+' # attribute => 'Escape String' # context => '#pop' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\u[\\d]+', 1, 0, 0, undef, 0, '#pop', 'Escape String')) { return 1 } # String => '\\x[\da-fA-F]+' # attribute => 'Escape String' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\x[\\da-fA-F]+', 0, 0, 0, undef, 0, '#pop', 'Escape String')) { return 1 } # String => '0b[01]+[_01]*[ ]*\.\.[ ]*0b[01]+[_01]*(UL|LU|U|L)?' # attribute => 'Binary' # context => '#pop' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '0b[01]+[_01]*[ ]*\\.\\.[ ]*0b[01]+[_01]*(UL|LU|U|L)?', 1, 0, 0, undef, 0, '#pop', 'Binary')) { return 1 } # String => '0[0-7]+[_0-7]*[ ]*\.\.[ ]*0[0-7]+[_0-7]*(UL|LU|U|L)?' # attribute => 'Octal' # context => '#pop' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '0[0-7]+[_0-7]*[ ]*\\.\\.[ ]*0[0-7]+[_0-7]*(UL|LU|U|L)?', 1, 0, 0, undef, 0, '#pop', 'Octal')) { return 1 } # String => '0x[\da-f]+[_\da-f]*[ ]*\.\.[ ]*0x[\da-f]+[_\da-f]*(UL|LU|U|L)?' # attribute => 'Hex' # context => '#pop' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '0x[\\da-f]+[_\\da-f]*[ ]*\\.\\.[ ]*0x[\\da-f]+[_\\da-f]*(UL|LU|U|L)?', 1, 0, 0, undef, 0, '#pop', 'Hex')) { return 1 } # String => '[\d]+[_\d]*(UL|LU|U|L)?[ ]*\.\.[ ]*[\d]+[_\d]*(UL|LU|U|L)?' # attribute => 'Integer' # context => '#pop' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\d]+[_\\d]*(UL|LU|U|L)?[ ]*\\.\\.[ ]*[\\d]+[_\\d]*(UL|LU|U|L)?', 1, 0, 0, undef, 0, '#pop', 'Integer')) { return 1 } # String => '[\d]*[_\d]*\.[_\d]*(e-|e|e\+)?[\d]+[_\d]*(F|L|I|FI|LI|)?' # attribute => 'Float' # context => '#pop' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\d]*[_\\d]*\\.[_\\d]*(e-|e|e\\+)?[\\d]+[_\\d]*(F|L|I|FI|LI|)?', 1, 0, 0, undef, 0, '#pop', 'Float')) { return 1 } # String => '[\d]*[_\d]*\.?[_\d]*(e-|e|e\+)[\d]+[_\d]*(F|L|I|FI|LI|)?' # attribute => 'Float' # context => '#pop' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\d]*[_\\d]*\\.?[_\\d]*(e-|e|e\\+)[\\d]+[_\\d]*(F|L|I|FI|LI|)?', 1, 0, 0, undef, 0, '#pop', 'Float')) { return 1 } # String => '0x[\da-f]+[_\da-f]*\.[_\da-f]*(p-|p|p\+)?[\da-f]+[_\da-f]*(F|L|I|FI|LI)?' # attribute => 'Float' # context => '#pop' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '0x[\\da-f]+[_\\da-f]*\\.[_\\da-f]*(p-|p|p\\+)?[\\da-f]+[_\\da-f]*(F|L|I|FI|LI)?', 1, 0, 0, undef, 0, '#pop', 'Float')) { return 1 } # String => '0x[\da-f]+[_\da-f]*\.?[_\da-f]*(p-|p|p\+)[\da-f]+[_\da-f]*(F|L|I|FI|LI)?' # attribute => 'Float' # context => '#pop' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '0x[\\da-f]+[_\\da-f]*\\.?[_\\da-f]*(p-|p|p\\+)[\\da-f]+[_\\da-f]*(F|L|I|FI|LI)?', 1, 0, 0, undef, 0, '#pop', 'Float')) { return 1 } # String => '0B[01]+[_01]*(UL|LU|U|L)?' # attribute => 'Binary' # context => '#pop' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '0B[01]+[_01]*(UL|LU|U|L)?', 1, 0, 0, undef, 0, '#pop', 'Binary')) { return 1 } # String => '0[0-7]+[_0-7]*(UL|LU|U|L)?' # attribute => 'Octal' # context => '#pop' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '0[0-7]+[_0-7]*(UL|LU|U|L)?', 1, 0, 0, undef, 0, '#pop', 'Octal')) { return 1 } # String => '0x[\da-f]+[_\da-f]*(UL|LU|U|L)?' # attribute => 'Hex' # context => '#pop' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '0x[\\da-f]+[_\\da-f]*(UL|LU|U|L)?', 1, 0, 0, undef, 0, '#pop', 'Hex')) { return 1 } # String => '[\d]+[_\d]*(UL|LU|U|L)?' # attribute => 'Integer' # context => '#pop' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\d]+[_\\d]*(UL|LU|U|L)?', 1, 0, 0, undef, 0, '#pop', 'Integer')) { return 1 } # attribute => 'Char' # char => ''' # context => 'Char' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'Char', 'Char')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # attribute => 'Wysiwyg' # char => '`' # context => 'Wysiwyg' # type => 'DetectChar' if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, 'Wysiwyg', 'Wysiwyg')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'CommentLine' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'CommentLine', 'Comment')) { return 1 } # attribute => 'Comment' # beginRegion => 'CommentA' # char => '/' # char1 => '*' # context => 'CommentBlockA' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'CommentBlockA', 'Comment')) { return 1 } # attribute => 'Comment' # beginRegion => 'CommentB' # char => '/' # char1 => '+' # context => 'CommentBlockB' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '+', 0, 0, 0, undef, 0, 'CommentBlockB', 'Comment')) { return 1 } # attribute => 'Normal Text' # beginRegion => 'BraceA' # char => '{' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Normal Text' # char => '}' # context => '#stay' # endRegion => 'BraceA' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::D - a Plugin for D syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::D; my $sh = new Syntax::Highlight::Engine::Kate::D([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::D is a plugin module that provides syntax highlighting for D to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Matlab.pm0000644000175000017500000002013213226470762026053 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'matlab.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.20 #kate version 2.2 #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::Matlab; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Comment' => 'Comment', 'Delimiter' => 'Normal', 'Incomplete String' => 'Char', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Number' => 'Float', 'Operator' => 'Normal', 'String' => 'String', 'System' => 'BaseN', 'Variable' => 'Variable', }); $self->listAdd('KeywordsList', 'break', 'case', 'catch', 'continue', 'else', 'elseif', 'end', 'for', 'function', 'global', 'if', 'otherwise', 'persistent', 'return', 'switch', 'try', 'while', ); $self->contextdata({ '_adjoint' => { callback => \&parse_adjoint, attribute => 'Operator', lineending => '#pop', }, '_normal' => { callback => \&parse_normal, attribute => 'Normal Text', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('_normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Matlab'; } sub parse_adjoint { my ($self, $text) = @_; # String => ''+' # attribute => 'Operator' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\'+', 0, 0, 0, undef, 0, '#pop', 'Operator')) { return 1 } return 0; }; sub parse_normal { my ($self, $text) = @_; # String => '[a-zA-Z]\w*(?=')' # attribute => 'Variable' # context => '_adjoint' # type => 'RegExpr' if ($self->testRegExpr($text, '[a-zA-Z]\\w*(?=\')', 0, 0, 0, undef, 0, '_adjoint', 'Variable')) { return 1 } # String => '(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?[ij]?(?=')' # attribute => 'Number' # context => '_adjoint' # type => 'RegExpr' if ($self->testRegExpr($text, '(\\d+(\\.\\d+)?|\\.\\d+)([eE][+-]?\\d+)?[ij]?(?=\')', 0, 0, 0, undef, 0, '_adjoint', 'Number')) { return 1 } # String => '[\)\]}](?=')' # attribute => 'Delimiter' # context => '_adjoint' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\)\\]}](?=\')', 0, 0, 0, undef, 0, '_adjoint', 'Delimiter')) { return 1 } # String => '\.'(?=')' # attribute => 'Operator' # context => '_adjoint' # type => 'RegExpr' if ($self->testRegExpr($text, '\\.\'(?=\')', 0, 0, 0, undef, 0, '_adjoint', 'Operator')) { return 1 } # String => ''[^']*(''[^']*)*'(?=[^']|$)' # attribute => 'String' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\'[^\']*(\'\'[^\']*)*\'(?=[^\']|$)', 0, 0, 0, undef, 0, '#stay', 'String')) { return 1 } # String => ''[^']*(''[^']*)*' # attribute => 'Incomplete String' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\'[^\']*(\'\'[^\']*)*', 0, 0, 0, undef, 0, '#stay', 'Incomplete String')) { return 1 } # String => 'KeywordsList' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'KeywordsList', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '%.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '%.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # String => '!.*$' # attribute => 'System' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '!.*$', 0, 0, 0, undef, 0, '#stay', 'System')) { return 1 } # String => '[a-zA-Z]\w*' # attribute => 'Variable' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[a-zA-Z]\\w*', 0, 0, 0, undef, 0, '#stay', 'Variable')) { return 1 } # String => '(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?[ij]?' # attribute => 'Number' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(\\d+(\\.\\d+)?|\\.\\d+)([eE][+-]?\\d+)?[ij]?', 0, 0, 0, undef, 0, '#stay', 'Number')) { return 1 } # String => '()[]{}' # attribute => 'Delimiter' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '()[]{}', 0, 0, undef, 0, '#stay', 'Delimiter')) { return 1 } # String => '...' # attribute => 'Operator' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '...', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '==' # attribute => 'Operator' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '==', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '~=' # attribute => 'Operator' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '~=', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '<=' # attribute => 'Operator' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '<=', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '>=' # attribute => 'Operator' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '>=', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '&&' # attribute => 'Operator' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '&&', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '||' # attribute => 'Operator' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '||', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '.*' # attribute => 'Operator' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '.*', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '.^' # attribute => 'Operator' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '.^', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => './' # attribute => 'Operator' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, './', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '.'' # attribute => 'Operator' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '.\'', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '*+-/\&|<>~^=,;:@' # attribute => 'Operator' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '*+-/\\&|<>~^=,;:@', 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Matlab - a Plugin for Matlab syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Matlab; my $sh = new Syntax::Highlight::Engine::Kate::Matlab([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Matlab is a plugin module that provides syntax highlighting for Matlab to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/SGML.pm0000644000175000017500000001153013226470762025417 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'sgml.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.02 #kate version 2.1 #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::SGML; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Attribute Name' => 'Others', 'Attribute Value' => 'DataType', 'Comment' => 'Comment', 'Normal Text' => 'Normal', 'Tag' => 'Keyword', }); $self->contextdata({ 'Attribute' => { callback => \&parseAttribute, attribute => 'Attribute Name', }, 'Comment' => { callback => \&parseComment, attribute => 'Comment', }, 'Normal Text' => { callback => \&parseNormalText, attribute => 'Normal Text', }, 'Value' => { callback => \&parseValue, attribute => 'Attribute Value', }, 'Value 2' => { callback => \&parseValue2, attribute => 'Attribute Value', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal Text'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'SGML'; } sub parseAttribute { my ($self, $text) = @_; # attribute => 'Tag' # char => '/' # char1 => '>' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '>', 0, 0, 0, undef, 0, '#pop', 'Tag')) { return 1 } # attribute => 'Tag' # char => '>' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'Tag')) { return 1 } # String => '\s*=\s*' # attribute => 'Normal Text' # context => 'Value' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*=\\s*', 0, 0, 0, undef, 0, 'Value', 'Normal Text')) { return 1 } return 0; }; sub parseComment { my ($self, $text) = @_; # String => '-->' # attribute => 'Comment' # context => '#pop' # type => 'StringDetect' if ($self->testStringDetect($text, '-->', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseNormalText { my ($self, $text) = @_; # String => '' # attribute => 'Comment' # context => '#pop' # endRegion => 'comment' # type => 'StringDetect' if ($self->testStringDetect($text, '-->', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } # String => '-(-(?!->))+' # attribute => 'Error' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '-(-(?!->))+', 0, 0, 0, undef, 0, '#stay', 'Error')) { return 1 } return 0; }; sub parseDoctype { my ($self, $text) = @_; # context => 'FindPHP' # type => 'IncludeRules' if ($self->includeRules('FindPHP', $text)) { return 1 } # attribute => 'Doctype' # char => '>' # context => '#pop' # endRegion => 'doctype' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'Doctype')) { return 1 } # attribute => 'Doctype' # beginRegion => 'int_subset' # char => '[' # context => 'Doctype Internal Subset' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'Doctype Internal Subset', 'Doctype')) { return 1 } return 0; }; sub parseDoctypeInternalSubset { my ($self, $text) = @_; # context => 'FindPHP' # type => 'IncludeRules' if ($self->includeRules('FindPHP', $text)) { return 1 } # attribute => 'Doctype' # char => ']' # context => '#pop' # endRegion => 'int_subset' # type => 'DetectChar' if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Doctype')) { return 1 } # context => 'FindDTDRules' # type => 'IncludeRules' if ($self->includeRules('FindDTDRules', $text)) { return 1 } # String => '' # attribute => 'Html Comment' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\/*-->', 0, 0, 0, undef, 0, '#pop', 'Html Comment')) { return 1 } return 0; }; sub parseHtmlDoubleQuotedValue { my ($self, $text) = @_; # String => '<%--' # attribute => 'Jsp Comment' # context => 'Jsp Comment' # type => 'StringDetect' if ($self->testStringDetect($text, '<%--', 0, 0, 0, undef, 0, 'Jsp Comment', 'Jsp Comment')) { return 1 } # String => '<%(!|=)?' # attribute => 'Jsp Scriptlet' # context => 'Jsp Scriptlet' # type => 'RegExpr' if ($self->testRegExpr($text, '<%(!|=)?', 0, 0, 0, undef, 0, 'Jsp Scriptlet', 'Jsp Scriptlet')) { return 1 } # attribute => 'Jsp Expression' # char => '$' # char1 => '{' # context => 'Jsp Expression' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '$', '{', 0, 0, 0, undef, 0, 'Jsp Expression', 'Jsp Expression')) { return 1 } # String => '<\s*\/?\s*\$?\w*:\$?\w*' # attribute => 'Keyword' # context => 'Jsp Custom Tag' # type => 'RegExpr' if ($self->testRegExpr($text, '<\\s*\\/?\\s*\\$?\\w*:\\$?\\w*', 0, 0, 0, undef, 0, 'Jsp Custom Tag', 'Keyword')) { return 1 } # String => '("|"|")' # attribute => 'Types' # context => '#pop#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '("|"|")', 0, 0, 0, undef, 0, '#pop#pop', 'Types')) { return 1 } return 0; }; sub parseHtmlSingleQuotedValue { my ($self, $text) = @_; # String => '<%--' # attribute => 'Jsp Comment' # context => 'Jsp Comment' # type => 'StringDetect' if ($self->testStringDetect($text, '<%--', 0, 0, 0, undef, 0, 'Jsp Comment', 'Jsp Comment')) { return 1 } # String => '<%(!|=)?' # attribute => 'Jsp Scriptlet' # context => 'Jsp Scriptlet' # type => 'RegExpr' if ($self->testRegExpr($text, '<%(!|=)?', 0, 0, 0, undef, 0, 'Jsp Scriptlet', 'Jsp Scriptlet')) { return 1 } # attribute => 'Jsp Expression' # char => '$' # char1 => '{' # context => 'Jsp Expression' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '$', '{', 0, 0, 0, undef, 0, 'Jsp Expression', 'Jsp Expression')) { return 1 } # String => '<\s*\/?\s*\$?\w*:\$?\w*' # attribute => 'Keyword' # context => 'Jsp Custom Tag' # type => 'RegExpr' if ($self->testRegExpr($text, '<\\s*\\/?\\s*\\$?\\w*:\\$?\\w*', 0, 0, 0, undef, 0, 'Jsp Custom Tag', 'Keyword')) { return 1 } # String => '('|')' # attribute => 'Types' # context => '#pop#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '(\'|')', 0, 0, 0, undef, 0, '#pop#pop', 'Types')) { return 1 } return 0; }; sub parseHtmlUnquotedValue { my ($self, $text) = @_; # String => '<%--' # attribute => 'Jsp Comment' # context => 'Jsp Comment' # type => 'StringDetect' if ($self->testStringDetect($text, '<%--', 0, 0, 0, undef, 0, 'Jsp Comment', 'Jsp Comment')) { return 1 } # String => '<%(!|=)?' # attribute => 'Jsp Scriptlet' # context => 'Jsp Scriptlet' # type => 'RegExpr' if ($self->testRegExpr($text, '<%(!|=)?', 0, 0, 0, undef, 0, 'Jsp Scriptlet', 'Jsp Scriptlet')) { return 1 } # attribute => 'Jsp Expression' # char => '$' # char1 => '{' # context => 'Jsp Expression' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '$', '{', 0, 0, 0, undef, 0, 'Jsp Expression', 'Jsp Expression')) { return 1 } # String => '<\s*\/?\s*\$?\w*:\$?\w*' # attribute => 'Keyword' # context => 'Jsp Custom Tag' # type => 'RegExpr' if ($self->testRegExpr($text, '<\\s*\\/?\\s*\\$?\\w*:\\$?\\w*', 0, 0, 0, undef, 0, 'Jsp Custom Tag', 'Keyword')) { return 1 } # String => '\/?>' # attribute => 'Normal Text' # context => '#pop#pop#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\/?>', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Normal Text')) { return 1 } # String => '\s+' # attribute => 'Types' # context => '#pop#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#pop#pop', 'Types')) { return 1 } return 0; }; sub parseHtmlValue { my ($self, $text) = @_; # String => '<%--' # attribute => 'Jsp Comment' # context => 'Jsp Comment' # type => 'StringDetect' if ($self->testStringDetect($text, '<%--', 0, 0, 0, undef, 0, 'Jsp Comment', 'Jsp Comment')) { return 1 } # String => '<%(!|=)?' # attribute => 'Jsp Scriptlet' # context => 'Jsp Scriptlet' # type => 'RegExpr' if ($self->testRegExpr($text, '<%(!|=)?', 0, 0, 0, undef, 0, 'Jsp Scriptlet', 'Jsp Scriptlet')) { return 1 } # attribute => 'Jsp Expression' # char => '$' # char1 => '{' # context => 'Jsp Expression' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '$', '{', 0, 0, 0, undef, 0, 'Jsp Expression', 'Jsp Expression')) { return 1 } # String => '<\s*\/?\s*\$?\w*:\$?\w*' # attribute => 'Keyword' # context => 'Jsp Custom Tag' # type => 'RegExpr' if ($self->testRegExpr($text, '<\\s*\\/?\\s*\\$?\\w*:\\$?\\w*', 0, 0, 0, undef, 0, 'Jsp Custom Tag', 'Keyword')) { return 1 } # String => '("|"|")' # attribute => 'Types' # context => 'Html Double Quoted Value' # type => 'RegExpr' if ($self->testRegExpr($text, '("|"|")', 0, 0, 0, undef, 0, 'Html Double Quoted Value', 'Types')) { return 1 } # String => '('|')' # attribute => 'Types' # context => 'Html Single Quoted Value' # type => 'RegExpr' if ($self->testRegExpr($text, '(\'|')', 0, 0, 0, undef, 0, 'Html Single Quoted Value', 'Types')) { return 1 } # String => '\s*#?-?_?\.?[a-zA-Z0-9]*' # attribute => 'Types' # context => 'Html Unquoted Value' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*#?-?_?\\.?[a-zA-Z0-9]*', 0, 0, 0, undef, 0, 'Html Unquoted Value', 'Types')) { return 1 } # String => '\/?>' # attribute => 'Normal Text' # context => '#pop#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\/?>', 0, 0, 0, undef, 0, '#pop#pop', 'Normal Text')) { return 1 } return 0; }; sub parseJavaMultiLineComment { my ($self, $text) = @_; # attribute => 'Java Comment' # char => '*' # char1 => '/' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Java Comment')) { return 1 } return 0; }; sub parseJavaSingleLineComment { my ($self, $text) = @_; return 0; }; sub parseJavaString { my ($self, $text) = @_; # attribute => 'String' # char => '\' # char1 => '"' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '"', 0, 0, 0, undef, 0, '#stay', 'String')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; sub parseJspComment { my ($self, $text) = @_; # String => '--%>' # attribute => 'Jsp Comment' # context => '#pop' # type => 'StringDetect' if ($self->testStringDetect($text, '--%>', 0, 0, 0, undef, 0, '#pop', 'Jsp Comment')) { return 1 } return 0; }; sub parseJspCustomTag { my ($self, $text) = @_; # String => '\/?>' # attribute => 'Keyword' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\/?>', 0, 0, 0, undef, 0, '#pop', 'Keyword')) { return 1 } # String => '\s*=\s*' # attribute => 'Normal Text' # context => 'Jsp Custom Tag Value' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*=\\s*', 0, 0, 0, undef, 0, 'Jsp Custom Tag Value', 'Normal Text')) { return 1 } # String => '<%--' # attribute => 'Jsp Comment' # context => 'Jsp Comment' # type => 'StringDetect' if ($self->testStringDetect($text, '<%--', 0, 0, 0, undef, 0, 'Jsp Comment', 'Jsp Comment')) { return 1 } # String => '<%(!|=)?' # attribute => 'Jsp Scriptlet' # context => 'Jsp Scriptlet' # type => 'RegExpr' if ($self->testRegExpr($text, '<%(!|=)?', 0, 0, 0, undef, 0, 'Jsp Scriptlet', 'Jsp Scriptlet')) { return 1 } # attribute => 'Jsp Expression' # char => '$' # char1 => '{' # context => 'Jsp Expression' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '$', '{', 0, 0, 0, undef, 0, 'Jsp Expression', 'Jsp Expression')) { return 1 } return 0; }; sub parseJspCustomTagValue { my ($self, $text) = @_; # String => '<%--' # attribute => 'Jsp Comment' # context => 'Jsp Comment' # type => 'StringDetect' if ($self->testStringDetect($text, '<%--', 0, 0, 0, undef, 0, 'Jsp Comment', 'Jsp Comment')) { return 1 } # String => '<%(!|=)?' # attribute => 'Jsp Scriptlet' # context => 'Jsp Scriptlet' # type => 'RegExpr' if ($self->testRegExpr($text, '<%(!|=)?', 0, 0, 0, undef, 0, 'Jsp Scriptlet', 'Jsp Scriptlet')) { return 1 } # attribute => 'Jsp Expression' # char => '$' # char1 => '{' # context => 'Jsp Expression' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '$', '{', 0, 0, 0, undef, 0, 'Jsp Expression', 'Jsp Expression')) { return 1 } # attribute => 'Types' # char => '"' # context => 'Jsp Double Quoted Custom Tag Value' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'Jsp Double Quoted Custom Tag Value', 'Types')) { return 1 } # attribute => 'Types' # char => ''' # context => 'Jsp Single Quoted Custom Tag Value' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'Jsp Single Quoted Custom Tag Value', 'Types')) { return 1 } # String => '\/?>' # attribute => 'Normal Text' # context => '#pop#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\/?>', 0, 0, 0, undef, 0, '#pop#pop', 'Normal Text')) { return 1 } return 0; }; sub parseJspDoubleQuotedCustomTagValue { my ($self, $text) = @_; # attribute => 'Types' # char => '"' # context => '#pop#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop#pop', 'Types')) { return 1 } # String => '<%--' # attribute => 'Jsp Comment' # context => 'Jsp Comment' # type => 'StringDetect' if ($self->testStringDetect($text, '<%--', 0, 0, 0, undef, 0, 'Jsp Comment', 'Jsp Comment')) { return 1 } # String => '<%(!|=)?' # attribute => 'Jsp Scriptlet' # context => 'Jsp Scriptlet' # type => 'RegExpr' if ($self->testRegExpr($text, '<%(!|=)?', 0, 0, 0, undef, 0, 'Jsp Scriptlet', 'Jsp Scriptlet')) { return 1 } # attribute => 'Jsp Expression' # char => '$' # char1 => '{' # context => 'Jsp Expression' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '$', '{', 0, 0, 0, undef, 0, 'Jsp Expression', 'Jsp Expression')) { return 1 } return 0; }; sub parseJspDoubleQuotedParamValue { my ($self, $text) = @_; # attribute => 'Jsp Param Value' # char => '"' # context => '#pop#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop#pop', 'Jsp Param Value')) { return 1 } # String => '<%--' # attribute => 'Jsp Comment' # context => 'Jsp Comment' # type => 'StringDetect' if ($self->testStringDetect($text, '<%--', 0, 0, 0, undef, 0, 'Jsp Comment', 'Jsp Comment')) { return 1 } # String => '<%(!|=)?' # attribute => 'Jsp Scriptlet' # context => 'Jsp Scriptlet' # type => 'RegExpr' if ($self->testRegExpr($text, '<%(!|=)?', 0, 0, 0, undef, 0, 'Jsp Scriptlet', 'Jsp Scriptlet')) { return 1 } # attribute => 'Jsp Expression' # char => '$' # char1 => '{' # context => 'Jsp Expression' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '$', '{', 0, 0, 0, undef, 0, 'Jsp Expression', 'Jsp Expression')) { return 1 } return 0; }; sub parseJspExpression { my ($self, $text) = @_; # String => ''${'' # attribute => 'Normal Text' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\'${\'', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Jsp Scriptlet' # char => '}' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Jsp Scriptlet')) { return 1 } # String => 'java-1.4.2-keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'java-1.4.2-keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'jsp-reserved-words' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'jsp-reserved-words', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'java-1.4.2-types' # attribute => 'Types' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'java-1.4.2-types', 0, undef, 0, '#stay', 'Types')) { return 1 } # String => 'java-1.4.2-classes' # attribute => 'Java 1.4.2 Classes' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'java-1.4.2-classes', 0, undef, 0, '#stay', 'Java 1.4.2 Classes')) { return 1 } # attribute => 'Float' # context => '#stay' # items => 'ARRAY(0x19b69e0)' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { # String => 'fF' # attribute => 'Float' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, 'fF', 0, 0, undef, 0, '#stay', 'Float')) { return 1 } } # attribute => 'Octal' # context => '#stay' # type => 'HlCOct' if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) { return 1 } # attribute => 'Hex' # context => '#stay' # type => 'HlCHex' if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) { return 1 } # attribute => 'Decimal' # context => '#stay' # items => 'ARRAY(0x19bc750)' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { # String => 'ULL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, 'ULL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LUL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, 'LUL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LLU' # attribute => 'Decimal' # context => '#stay' # insensitive => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, 'LLU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'UL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, 'UL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LU' # attribute => 'Decimal' # context => '#stay' # insensitive => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, 'LU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, 'LL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'U' # attribute => 'Decimal' # context => '#stay' # insensitive => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, 'U', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'L' # attribute => 'Decimal' # context => '#stay' # insensitive => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, 'L', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } } # attribute => 'Char' # context => '#stay' # type => 'HlCChar' if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'String' # char => '"' # context => 'Java String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'Java String', 'String')) { return 1 } # String => '!%&()+,-<=>?[]^{|}~' # attribute => 'Symbol' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '!%&()+,-<=>?[]^{|}~', 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } return 0; }; sub parseJspScriptlet { my ($self, $text) = @_; # attribute => 'Jsp Scriptlet' # char => '%' # char1 => '>' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '%', '>', 0, 0, 0, undef, 0, '#pop', 'Jsp Scriptlet')) { return 1 } # String => '<\s*jsp:(declaration|expression|scriptlet)\s*>' # attribute => 'Jsp Scriptlet' # context => 'Jsp Scriptlet' # type => 'RegExpr' if ($self->testRegExpr($text, '<\\s*jsp:(declaration|expression|scriptlet)\\s*>', 0, 0, 0, undef, 0, 'Jsp Scriptlet', 'Jsp Scriptlet')) { return 1 } # String => 'java-1.4.2-keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'java-1.4.2-keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'jsp-reserved-words' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'jsp-reserved-words', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'java-1.4.2-types' # attribute => 'Types' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'java-1.4.2-types', 0, undef, 0, '#stay', 'Types')) { return 1 } # String => 'java-1.4.2-classes' # attribute => 'Java 1.4.2 Classes' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'java-1.4.2-classes', 0, undef, 0, '#stay', 'Java 1.4.2 Classes')) { return 1 } # attribute => 'Float' # context => '#stay' # items => 'ARRAY(0x12a3610)' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { # String => 'fF' # attribute => 'Float' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, 'fF', 0, 0, undef, 0, '#stay', 'Float')) { return 1 } } # attribute => 'Octal' # context => '#stay' # type => 'HlCOct' if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) { return 1 } # attribute => 'Hex' # context => '#stay' # type => 'HlCHex' if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) { return 1 } # attribute => 'Decimal' # context => '#stay' # items => 'ARRAY(0x19ad810)' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { # String => 'ULL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, 'ULL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LUL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, 'LUL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LLU' # attribute => 'Decimal' # context => '#stay' # insensitive => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, 'LLU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'UL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, 'UL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LU' # attribute => 'Decimal' # context => '#stay' # insensitive => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, 'LU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, 'LL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'U' # attribute => 'Decimal' # context => '#stay' # insensitive => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, 'U', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'L' # attribute => 'Decimal' # context => '#stay' # insensitive => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, 'L', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } } # attribute => 'Char' # context => '#stay' # type => 'HlCChar' if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) { return 1 } # String => '//\s*BEGIN.*$' # attribute => 'Decimal' # beginRegion => 'Region1' # context => '#stay' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '//\\s*BEGIN.*$', 0, 0, 0, undef, 1, '#stay', 'Decimal')) { return 1 } # String => '//\s*END.*$' # attribute => 'Decimal' # context => '#stay' # endRegion => 'Region1' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '//\\s*END.*$', 0, 0, 0, undef, 1, '#stay', 'Decimal')) { return 1 } # attribute => 'String' # char => '"' # context => 'Java String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'Java String', 'String')) { return 1 } # attribute => 'Normal Text' # beginRegion => 'Brace1' # char => '{' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Normal Text' # char => '}' # context => '#stay' # endRegion => 'Brace1' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '!%&()+,-<=>?[]^{|}~' # attribute => 'Symbol' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '!%&()+,-<=>?[]^{|}~', 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # attribute => 'Java Comment' # char => '/' # char1 => '/' # context => 'Java Single-Line Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Java Single-Line Comment', 'Java Comment')) { return 1 } # attribute => 'Java Comment' # char => '/' # char1 => '*' # context => 'Java Multi-Line Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Java Multi-Line Comment', 'Java Comment')) { return 1 } return 0; }; sub parseJspSingleQuotedCustomTagValue { my ($self, $text) = @_; # attribute => 'Types' # char => ''' # context => '#pop#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop#pop', 'Types')) { return 1 } # String => '<%--' # attribute => 'Jsp Comment' # context => 'Jsp Comment' # type => 'StringDetect' if ($self->testStringDetect($text, '<%--', 0, 0, 0, undef, 0, 'Jsp Comment', 'Jsp Comment')) { return 1 } # String => '<%(!|=)?' # attribute => 'Jsp Scriptlet' # context => 'Jsp Scriptlet' # type => 'RegExpr' if ($self->testRegExpr($text, '<%(!|=)?', 0, 0, 0, undef, 0, 'Jsp Scriptlet', 'Jsp Scriptlet')) { return 1 } # attribute => 'Jsp Expression' # char => '$' # char1 => '{' # context => 'Jsp Expression' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '$', '{', 0, 0, 0, undef, 0, 'Jsp Expression', 'Jsp Expression')) { return 1 } return 0; }; sub parseJspSingleQuotedParamValue { my ($self, $text) = @_; # attribute => 'Jsp Param Value' # char => ''' # context => '#pop#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop#pop', 'Jsp Param Value')) { return 1 } # String => '<%--' # attribute => 'Jsp Comment' # context => 'Jsp Comment' # type => 'StringDetect' if ($self->testStringDetect($text, '<%--', 0, 0, 0, undef, 0, 'Jsp Comment', 'Jsp Comment')) { return 1 } # String => '<%(!|=)?' # attribute => 'Jsp Scriptlet' # context => 'Jsp Scriptlet' # type => 'RegExpr' if ($self->testRegExpr($text, '<%(!|=)?', 0, 0, 0, undef, 0, 'Jsp Scriptlet', 'Jsp Scriptlet')) { return 1 } # attribute => 'Jsp Expression' # char => '$' # char1 => '{' # context => 'Jsp Expression' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '$', '{', 0, 0, 0, undef, 0, 'Jsp Expression', 'Jsp Expression')) { return 1 } return 0; }; sub parseJspStandardDirective { my ($self, $text) = @_; # attribute => 'Jsp Directive' # char => '%' # char1 => '>' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '%', '>', 0, 0, 0, undef, 0, '#pop', 'Jsp Directive')) { return 1 } # String => '\s*=\s*' # attribute => 'Normal Text' # context => 'Jsp Standard Directive Value' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*=\\s*', 0, 0, 0, undef, 0, 'Jsp Standard Directive Value', 'Normal Text')) { return 1 } # String => '<%--' # attribute => 'Jsp Comment' # context => 'Jsp Comment' # type => 'StringDetect' if ($self->testStringDetect($text, '<%--', 0, 0, 0, undef, 0, 'Jsp Comment', 'Jsp Comment')) { return 1 } # String => '<%(!|=)?' # attribute => 'Jsp Scriptlet' # context => 'Jsp Scriptlet' # type => 'RegExpr' if ($self->testRegExpr($text, '<%(!|=)?', 0, 0, 0, undef, 0, 'Jsp Scriptlet', 'Jsp Scriptlet')) { return 1 } # attribute => 'Jsp Expression' # char => '$' # char1 => '{' # context => 'Jsp Expression' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '$', '{', 0, 0, 0, undef, 0, 'Jsp Expression', 'Jsp Expression')) { return 1 } # String => '<\s*\/?\s*\$?\w*:\$?\w*' # attribute => 'Keyword' # context => 'Jsp Custom Tag' # type => 'RegExpr' if ($self->testRegExpr($text, '<\\s*\\/?\\s*\\$?\\w*:\\$?\\w*', 0, 0, 0, undef, 0, 'Jsp Custom Tag', 'Keyword')) { return 1 } return 0; }; sub parseJspStandardDirectiveValue { my ($self, $text) = @_; # String => '<%--' # attribute => 'Jsp Comment' # context => 'Jsp Comment' # type => 'StringDetect' if ($self->testStringDetect($text, '<%--', 0, 0, 0, undef, 0, 'Jsp Comment', 'Jsp Comment')) { return 1 } # String => '<%(!|=)?' # attribute => 'Jsp Scriptlet' # context => 'Jsp Scriptlet' # type => 'RegExpr' if ($self->testRegExpr($text, '<%(!|=)?', 0, 0, 0, undef, 0, 'Jsp Scriptlet', 'Jsp Scriptlet')) { return 1 } # attribute => 'Jsp Expression' # char => '$' # char1 => '{' # context => 'Jsp Expression' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '$', '{', 0, 0, 0, undef, 0, 'Jsp Expression', 'Jsp Expression')) { return 1 } # attribute => 'Jsp Param Value' # char => '"' # context => 'Jsp Double Quoted Param Value' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'Jsp Double Quoted Param Value', 'Jsp Param Value')) { return 1 } # attribute => 'Jsp Param Value' # char => ''' # context => 'Jsp Single Quoted Param Value' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'Jsp Single Quoted Param Value', 'Jsp Param Value')) { return 1 } # attribute => 'Jsp Directive' # char => '%' # char1 => '>' # context => '#pop#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '%', '>', 0, 0, 0, undef, 0, '#pop#pop', 'Jsp Directive')) { return 1 } return 0; }; sub parseJspXmlDirective { my ($self, $text) = @_; # String => '\s*\/?\s*>' # attribute => 'Jsp Directive' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*\\/?\\s*>', 0, 0, 0, undef, 0, '#pop', 'Jsp Directive')) { return 1 } # String => '\s*=\s*' # attribute => 'Normal Text' # context => 'Jsp Xml Directive Value' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*=\\s*', 0, 0, 0, undef, 0, 'Jsp Xml Directive Value', 'Normal Text')) { return 1 } # String => '<%--' # attribute => 'Jsp Comment' # context => 'Jsp Comment' # type => 'StringDetect' if ($self->testStringDetect($text, '<%--', 0, 0, 0, undef, 0, 'Jsp Comment', 'Jsp Comment')) { return 1 } # String => '<%(!|=)?' # attribute => 'Jsp Scriptlet' # context => 'Jsp Scriptlet' # type => 'RegExpr' if ($self->testRegExpr($text, '<%(!|=)?', 0, 0, 0, undef, 0, 'Jsp Scriptlet', 'Jsp Scriptlet')) { return 1 } # attribute => 'Jsp Expression' # char => '$' # char1 => '{' # context => 'Jsp Expression' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '$', '{', 0, 0, 0, undef, 0, 'Jsp Expression', 'Jsp Expression')) { return 1 } return 0; }; sub parseJspXmlDirectiveValue { my ($self, $text) = @_; # String => '<%--' # attribute => 'Jsp Comment' # context => 'Jsp Comment' # type => 'StringDetect' if ($self->testStringDetect($text, '<%--', 0, 0, 0, undef, 0, 'Jsp Comment', 'Jsp Comment')) { return 1 } # String => '<%(!|=)?' # attribute => 'Jsp Scriptlet' # context => 'Jsp Scriptlet' # type => 'RegExpr' if ($self->testRegExpr($text, '<%(!|=)?', 0, 0, 0, undef, 0, 'Jsp Scriptlet', 'Jsp Scriptlet')) { return 1 } # attribute => 'Jsp Expression' # char => '$' # char1 => '{' # context => 'Jsp Expression' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '$', '{', 0, 0, 0, undef, 0, 'Jsp Expression', 'Jsp Expression')) { return 1 } # attribute => 'Jsp Param Value' # char => '"' # context => 'Jsp Double Quoted Param Value' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'Jsp Double Quoted Param Value', 'Jsp Param Value')) { return 1 } # attribute => 'Jsp Param Value' # char => ''' # context => 'Jsp Single Quoted Param Value' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'Jsp Single Quoted Param Value', 'Jsp Param Value')) { return 1 } # String => '\s*\/?\s*>' # attribute => 'Jsp Directive' # context => '#pop#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*\\/?\\s*>', 0, 0, 0, undef, 0, '#pop#pop', 'Jsp Directive')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # String => '<%@\s*[a-zA-Z0-9_\.]*' # attribute => 'Jsp Directive' # context => 'Jsp Standard Directive' # type => 'RegExpr' if ($self->testRegExpr($text, '<%@\\s*[a-zA-Z0-9_\\.]*', 0, 0, 0, undef, 0, 'Jsp Standard Directive', 'Jsp Directive')) { return 1 } # String => '<\s*jsp:(declaration|expression|scriptlet)\s*>' # attribute => 'Jsp Scriptlet' # context => 'Jsp Scriptlet' # type => 'RegExpr' if ($self->testRegExpr($text, '<\\s*jsp:(declaration|expression|scriptlet)\\s*>', 0, 0, 0, undef, 0, 'Jsp Scriptlet', 'Jsp Scriptlet')) { return 1 } # String => '<\s*\/?s*jsp:[a-zA-Z0-9_\.]*' # attribute => 'Jsp Directive' # context => 'Jsp Xml Directive' # type => 'RegExpr' if ($self->testRegExpr($text, '<\\s*\\/?s*jsp:[a-zA-Z0-9_\\.]*', 0, 0, 0, undef, 0, 'Jsp Xml Directive', 'Jsp Directive')) { return 1 } # String => '<%--' # attribute => 'Jsp Comment' # context => 'Jsp Comment' # type => 'StringDetect' if ($self->testStringDetect($text, '<%--', 0, 0, 0, undef, 0, 'Jsp Comment', 'Jsp Comment')) { return 1 } # String => '<%(!|=)?' # attribute => 'Jsp Scriptlet' # context => 'Jsp Scriptlet' # type => 'RegExpr' if ($self->testRegExpr($text, '<%(!|=)?', 0, 0, 0, undef, 0, 'Jsp Scriptlet', 'Jsp Scriptlet')) { return 1 } # String => '' # attribute => 'NoWiki' # type => 'RegExpr' if ($self->testRegExpr($text, '', 0, 0, 0, undef, 0, '#stay', 'NoWiki')) { return 1 } # String => '' # attribute => 'Wiki-Tag' # context => '#pop' # type => 'StringDetect' if ($self->testStringDetect($text, '', 0, 0, 0, undef, 0, '#pop', 'Wiki-Tag')) { return 1 } # String => '[<][^>]+[>]' # attribute => 'HTML-Tag' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[<][^>]+[>]', 0, 0, 0, undef, 0, '#stay', 'HTML-Tag')) { return 1 } # String => '
'
   # attribute => 'HTML-Tag'
   # context => 'Pre'
   # type => 'StringDetect'
   if ($self->testStringDetect($text, '
', 0, 0, 0, undef, 0, 'Pre', 'HTML-Tag')) {
      return 1
   }
   return 0;
};

sub parsePre {
   my ($self, $text) = @_;
   # String => '
' # attribute => 'Wiki-Tag' # context => '#pop' # type => 'StringDetect' if ($self->testStringDetect($text, '
', 0, 0, 0, undef, 0, '#pop', 'Wiki-Tag')) { return 1 } return 0; }; sub parseTable { my ($self, $text) = @_; # String => '' # attribute => 'Comment' # context => '#pop' # endRegion => 'comment' # type => 'StringDetect' if ($self->testStringDetect($text, '-->', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parsenormal { my ($self, $text) = @_; # String => '' # attribute => 'HTML Comment' # context => '#pop' # type => 'StringDetect' if ($self->testStringDetect($text, '-->', 0, 0, 0, undef, 0, '#pop', 'HTML Comment')) { return 1 } return 0; }; sub parseML_htmltag { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # lookAhead => 'true' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 1, undef, 0, '#pop', 'Comment')) { return 1 } # attribute => 'HTML Tag' # char => '/' # char1 => '>' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '>', 0, 0, 0, undef, 0, '#pop', 'HTML Tag')) { return 1 } # attribute => 'HTML Tag' # char => '>' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'HTML Tag')) { return 1 } # String => '\s*=\s*' # attribute => 'Identifier' # context => 'ML_identifiers' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*=\\s*', 0, 0, 0, undef, 0, 'ML_identifiers', 'Identifier')) { return 1 } return 0; }; sub parseML_identifiers { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # lookAhead => 'true' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 1, undef, 0, '#pop', 'Comment')) { return 1 } # String => '\s*#?[a-zA-Z0-9]*' # attribute => 'String' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*#?[a-zA-Z0-9]*', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } # attribute => 'Types' # char => ''' # context => 'ML_types1' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'ML_types1', 'Types')) { return 1 } # attribute => 'Types' # char => '"' # context => 'ML_types2' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'ML_types2', 'Types')) { return 1 } return 0; }; sub parseML_types1 { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # lookAhead => 'true' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 1, undef, 0, '#pop', 'Comment')) { return 1 } # attribute => 'Types' # char => ''' # context => '#pop#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop#pop', 'Types')) { return 1 } return 0; }; sub parseML_types2 { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # lookAhead => 'true' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 1, undef, 0, '#pop', 'Comment')) { return 1 } # attribute => 'Types' # char => '"' # context => '#pop#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop#pop', 'Types')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # String => '//(!|(/(?=[^/]|$))) 'Comment' # context => 'LineComment' # type => 'RegExpr' if ($self->testRegExpr($text, '//(!|(/(?=[^/]|$))) '/\*(\*[^*/]|!|\*$) 'Comment' # beginRegion => 'BlockComment' # context => 'BlockComment' # type => 'RegExpr' if ($self->testRegExpr($text, '/\\*(\\*[^*/]|!|\\*$) 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # String => '\S\s' # attribute => 'Word' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\S\\s', 0, 0, 0, undef, 0, '#pop', 'Word')) { return 1 } # String => '\S' # attribute => 'Word' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#stay', 'Word')) { return 1 } return 0; }; sub parseSL_TagString { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # String => '' # attribute => 'HTML Comment' # context => '#pop' # type => 'StringDetect' if ($self->testStringDetect($text, '-->', 0, 0, 0, undef, 0, '#pop', 'HTML Comment')) { return 1 } return 0; }; sub parseSL_htmltag { my ($self, $text) = @_; # attribute => 'HTML Tag' # char => '/' # char1 => '>' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '>', 0, 0, 0, undef, 0, '#pop', 'HTML Tag')) { return 1 } # attribute => 'HTML Tag' # char => '>' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'HTML Tag')) { return 1 } # String => '\s*=\s*' # attribute => 'Identifier' # context => 'SL_identifiers' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*=\\s*', 0, 0, 0, undef, 0, 'SL_identifiers', 'Identifier')) { return 1 } return 0; }; sub parseSL_identifiers { my ($self, $text) = @_; # String => '\s*#?[a-zA-Z0-9]*' # attribute => 'String' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*#?[a-zA-Z0-9]*', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } # attribute => 'Types' # char => ''' # context => 'SL_types1' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'SL_types1', 'Types')) { return 1 } # attribute => 'Types' # char => '"' # context => 'SL_types2' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'SL_types2', 'Types')) { return 1 } return 0; }; sub parseSL_types1 { my ($self, $text) = @_; # attribute => 'Types' # char => ''' # context => '#pop#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop#pop', 'Types')) { return 1 } return 0; }; sub parseSL_types2 { my ($self, $text) = @_; # attribute => 'Types' # char => '"' # context => '#pop#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop#pop', 'Types')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Doxygen - a Plugin for Doxygen syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Doxygen; my $sh = new Syntax::Highlight::Engine::Kate::Doxygen([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Doxygen is a plugin module that provides syntax highlighting for Doxygen to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/FourGL.pm0000644000175000017500000001502013226470762026011 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'fgl-4gl.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.01 #kate version 2.3 #kate author Andrej Falout (andrej@falout.org) #generated: Sun Feb 3 22:02:04 2008, localtime package Syntax::Highlight::Engine::Kate::FourGL; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Alert' => 'Alert', 'Char' => 'Char', 'Comment' => 'Comment', 'Data Type' => 'DataType', 'Decimal' => 'DecVal', 'Float' => 'Float', 'Hex' => 'BaseN', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Octal' => 'BaseN', 'Prep. Lib' => 'Others', 'Preprocessor' => 'Others', 'String' => 'String', 'String Char' => 'Char', 'Symbol' => 'Normal', }); $self->listAdd('keywords', 'ABSOLUTE', 'ACCEPT', 'ALL', 'ANY', 'BEGIN', 'BOLD', 'CONSTRAINT', 'CURRENT', 'DEFER', 'DIRTY', 'DISTINCT', 'DROP', 'ESC', 'ESCAPE', 'EXTERNAL', 'FREE', 'GROUP', 'HAVING', 'HIDE', 'HOLD', 'HOUR', 'INTERRUPT', 'INT_FLAG', 'ISOLATION', 'LOCK', 'MAGENTA', 'MINUTE', 'MODE', 'MODIFY', 'NEED', 'NOTFOUND', 'PAGENO', 'PIPE', 'READ', 'ROLLBACK', 'SCREEN', 'SECOND', 'STEP', 'STOP', 'TABLE', 'TEMP', 'UNIQUE', 'UNITS', 'UNLOAD', 'WAIT', 'WHILE', 'WORK', 'WRAP', 'add', 'after', 'alter', 'and', 'ascii', 'at', 'attribute', 'attributes', 'avg', 'before', 'between', 'blink', 'blue', 'border', 'bottom', 'by', 'call', 'case', 'clear', 'clipped', 'close', 'cluster', 'column', 'columns', 'command', 'comment', 'commit', 'committed', 'connect', 'construct', 'continue', 'count', 'create', 'cursor', 'cyan', 'database', 'day', 'declare', 'defaults', 'define', 'delete', 'delimiter', 'desc', 'display', 'downshift', 'else', 'enable', 'end', 'error', 'every', 'exclusive', 'execute', 'exists', 'exit', 'false', 'fetch', 'fgl_lastkey', 'fgl_lastkey()', 'field', 'file', 'finish', 'first', 'flush', 'for', 'foreach', 'form', 'format', 'formhandler', 'from', 'function', 'globals', 'go', 'goto', 'green', 'header', 'help', 'if', 'in', 'index', 'infield', 'initialize', 'input', 'insert', 'into', 'is', 'key', 'label', 'last', 'left', 'length', 'let', 'like', 'line', 'lines', 'load', 'locate', 'log', 'main', 'margin', 'matches', 'max', 'mdy', 'menu', 'message', 'min', 'month', 'name', 'next', 'no', 'normal', 'not', 'null', 'of', 'on', 'open', 'option', 'options', 'or', 'order', 'otherwise', 'outer', 'output', 'page', 'pause', 'prepare', 'previous', 'print', 'printer', 'program', 'prompt', 'put', 'quit', 'quit_flag', 'record', 'red', 'report', 'return', 'returning', 'reverse', 'revoke', 'right', 'row', 'rows', 'run', 'scroll', 'select', 'set', 'share', 'show', 'skip', 'sleep', 'sort', 'space', 'spaces', 'start', 'statistics', 'status', 'sum', 'text', 'then', 'thru', 'to', 'today', 'top', 'trailer', 'true', 'union', 'up', 'update', 'upshift', 'user', 'using', 'values', 'waiting', 'when', 'whenever', 'where', 'white', 'window', 'with', 'without', 'wordwrap', 'year', 'yellow', ); $self->listAdd('types', 'DATETIME', 'DECIMAL', 'FRACTION', 'INTERVAL', 'NUMERIC', 'VARCHAR', 'array', 'char', 'date', 'float', 'integer', 'money', 'serial', 'smallint', ); $self->contextdata({ 'noname' => { callback => \&parsenoname, attribute => 'Comment', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('noname'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return '4GL'; } sub parsenoname { my ($self, $text) = @_; # String => '#if' # attribute => 'Comment' # context => '9' # type => 'RegExpr' if ($self->testRegExpr($text, '#if', 0, 0, 0, undef, 0, '9', 'Comment')) { return 1 } # String => '#endif' # attribute => 'Comment' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '#endif', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::FourGL - a Plugin for 4GL syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::FourGL; my $sh = new Syntax::Highlight::Engine::Kate::FourGL([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::FourGL is a plugin module that provides syntax highlighting for 4GL to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Bash.pm0000644000175000017500000014724213226470762025544 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'bash.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 2.05 #kate version 2.4 #kate author Wilbert Berendsen (wilbert@kde.nl) #generated: Sun Feb 3 22:02:04 2008, localtime package Syntax::Highlight::Engine::Kate::Bash; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Backquote' => 'Keyword', 'Builtin' => 'Reserved', 'Command' => 'BString', 'Comment' => 'Comment', 'Control' => 'Keyword', 'Escape' => 'DataType', 'Expression' => 'Others', 'Function' => 'Char', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Option' => 'Normal', 'Path' => 'Normal', 'Redirection' => 'Operator', 'String DoubleQ' => 'String', 'String Escape' => 'DataType', 'String SingleQ' => 'String', 'String Transl.' => 'String', 'Variable' => 'Others', }); $self->listAdd('builtins', '.', ':', 'alias', 'bg', 'bind', 'break', 'builtin', 'cd', 'command', 'compgen', 'complete', 'continue', 'dirs', 'disown', 'echo', 'enable', 'eval', 'exec', 'exit', 'fc', 'fg', 'getopts', 'hash', 'help', 'history', 'jobs', 'kill', 'let', 'logout', 'popd', 'printf', 'pushd', 'pwd', 'return', 'set', 'shift', 'shopt', 'source', 'suspend', 'test', 'times', 'trap', 'type', 'ulimit', 'umask', 'unalias', 'wait', ); $self->listAdd('builtins_var', 'declare', 'export', 'local', 'read', 'readonly', 'typeset', 'unset', ); $self->listAdd('keywords', '.', 'elif', 'else', 'for', 'function', 'in', 'select', 'set', 'then', 'until', 'while', ); $self->listAdd('unixcommands', 'aclocal', 'aconnect', 'aplay', 'apm', 'apmsleep', 'apropos', 'ar', 'arch', 'arecord', 'as', 'as86', 'autoconf', 'autoheader', 'automake', 'awk', 'awk', 'basename', 'bash', 'bc', 'bison', 'bunzip2', 'bzcat', 'bzcmp', 'bzdiff', 'bzegrep', 'bzfgrep', 'bzgrep', 'bzip2', 'bzip2recover', 'bzless', 'bzmore', 'c++', 'cal', 'cat', 'cat', 'cc', 'cd-read', 'cdda2wav', 'cdparanoia', 'cdrdao', 'cdrecord', 'chattr', 'chfn', 'chgrp', 'chgrp', 'chmod', 'chmod', 'chown', 'chown', 'chroot', 'chsh', 'chvt', 'clear', 'cmp', 'co', 'col', 'comm', 'cp', 'cp', 'cpio', 'cpp', 'cut', 'date', 'dc', 'dcop', 'dd', 'dd', 'deallocvt', 'df', 'df', 'diff', 'diff3', 'dir', 'dir', 'dircolors', 'dircolors', 'directomatic', 'dirname', 'dmesg', 'dnsdomainname', 'domainname', 'du', 'du', 'dumpkeys', 'echo', 'ed', 'egrep', 'env', 'expr', 'false', 'fbset', 'fgconsole', 'fgrep', 'file', 'find', 'flex', 'flex++', 'fmt', 'free', 'ftp', 'funzip', 'fuser', 'fuser', 'g++', 'gawk', 'gawk', 'gc', 'gcc', 'gdb', 'getent', 'getkeycodes', 'getopt', 'gettext', 'gettextize', 'gimp', 'gimp-remote', 'gimptool', 'gmake', 'gocr', 'grep', 'groups', 'gs', 'gunzip', 'gzexe', 'gzip', 'head', 'hexdump', 'hostname', 'id', 'igawk', 'install', 'install', 'join', 'kbd_mode', 'kbdrate', 'kdialog', 'kfile', 'kill', 'killall', 'killall', 'last', 'lastb', 'ld', 'ld86', 'ldd', 'less', 'lex', 'link', 'ln', 'ln', 'loadkeys', 'loadunimap', 'locate', 'lockfile', 'login', 'logname', 'lp', 'lpr', 'ls', 'ls', 'lsattr', 'lsmod', 'lsmod.old', 'lynx', 'm4', 'make', 'man', 'mapscrn', 'mesg', 'mkdir', 'mkdir', 'mkfifo', 'mknod', 'mknod', 'mktemp', 'more', 'mount', 'msgfmt', 'mv', 'mv', 'namei', 'nano', 'nasm', 'nawk', 'netstat', 'nice', 'nisdomainname', 'nl', 'nm', 'nm86', 'nmap', 'nohup', 'nop', 'od', 'openvt', 'passwd', 'patch', 'pcregrep', 'pcretest', 'perl', 'perror', 'pgawk', 'pidof', 'pidof', 'ping', 'pr', 'printf', 'procmail', 'prune', 'ps', 'ps2ascii', 'ps2epsi', 'ps2frag', 'ps2pdf', 'ps2ps', 'psbook', 'psmerge', 'psnup', 'psresize', 'psselect', 'pstops', 'pstree', 'pwd', 'rbash', 'rcs', 'readlink', 'red', 'resizecons', 'rev', 'rm', 'rm', 'rmdir', 'run-parts', 'sash', 'scp', 'sed', 'sed', 'seq', 'setfont', 'setkeycodes', 'setleds', 'setmetamode', 'setserial', 'setterm', 'sh', 'showkey', 'shred', 'shred', 'size', 'size86', 'skill', 'sleep', 'slogin', 'snice', 'sort', 'sox', 'split', 'ssed', 'ssh', 'ssh-add', 'ssh-agent', 'ssh-keygen', 'ssh-keyscan', 'stat', 'stat', 'strings', 'strip', 'stty', 'su', 'sudo', 'suidperl', 'sum', 'sync', 'tac', 'tail', 'tar', 'tee', 'tempfile', 'test', 'touch', 'tr', 'true', 'umount', 'uname', 'unicode_start', 'unicode_stop', 'uniq', 'unlink', 'unlink', 'unzip', 'updatedb', 'updmap', 'uptime', 'users', 'utmpdump', 'uuidgen', 'vdir', 'vmstat', 'w', 'wall', 'wc', 'wc', 'wget', 'whatis', 'whereis', 'which', 'who', 'whoami', 'write', 'xargs', 'xhost', 'xmodmap', 'xset', 'yacc', 'yes', 'ypdomainname', 'zcat', 'zcmp', 'zdiff', 'zegrep', 'zfgrep', 'zforce', 'zgrep', 'zip', 'zless', 'zmore', 'znew', 'zsh', 'zsoelim', ); $self->contextdata({ 'Assign' => { callback => \&parseAssign, attribute => 'Normal Text', lineending => '#pop', fallthrough => '#pop', }, 'AssignArray' => { callback => \&parseAssignArray, attribute => 'Normal Text', lineending => '#pop', }, 'AssignSubscr' => { callback => \&parseAssignSubscr, attribute => 'Normal Text', lineending => '#pop', fallthrough => '#pop', }, 'Case' => { callback => \&parseCase, attribute => 'Normal Text', }, 'CaseExpr' => { callback => \&parseCaseExpr, attribute => 'Normal Text', }, 'CaseIn' => { callback => \&parseCaseIn, attribute => 'Normal Text', }, 'Comment' => { callback => \&parseComment, attribute => 'Comment', lineending => '#pop', }, 'CommentBackq' => { callback => \&parseCommentBackq, attribute => 'Comment', lineending => '#pop', }, 'CommentParen' => { callback => \&parseCommentParen, attribute => 'Comment', lineending => '#pop', }, 'ExprBracket' => { callback => \&parseExprBracket, attribute => 'Normal Text', }, 'ExprDblBracket' => { callback => \&parseExprDblBracket, attribute => 'Normal Text', }, 'ExprDblParen' => { callback => \&parseExprDblParen, attribute => 'Normal Text', }, 'ExprDblParenSubst' => { callback => \&parseExprDblParenSubst, attribute => 'Normal Text', }, 'ExprSubParen' => { callback => \&parseExprSubParen, attribute => 'Normal Text', }, 'FindAll' => { callback => \&parseFindAll, attribute => 'Normal Text', }, 'FindCommands' => { callback => \&parseFindCommands, attribute => 'Normal Text', }, 'FindComments' => { callback => \&parseFindComments, attribute => 'Normal Text', lineending => '#pop', }, 'FindCommentsBackq' => { callback => \&parseFindCommentsBackq, attribute => 'Normal Text', lineending => '#pop', }, 'FindCommentsParen' => { callback => \&parseFindCommentsParen, attribute => 'Normal Text', lineending => '#pop', }, 'FindMost' => { callback => \&parseFindMost, attribute => 'Normal Text', }, 'FindOthers' => { callback => \&parseFindOthers, attribute => 'Normal Text', }, 'FindStrings' => { callback => \&parseFindStrings, attribute => 'Normal Text', }, 'FindSubstitutions' => { callback => \&parseFindSubstitutions, attribute => 'Normal Text', }, 'FunctionDef' => { callback => \&parseFunctionDef, attribute => 'Function', lineending => '#pop', fallthrough => '#pop', }, 'Group' => { callback => \&parseGroup, attribute => 'Normal Text', }, 'HereDoc' => { callback => \&parseHereDoc, attribute => 'Normal Text', }, 'HereDocINQ' => { callback => \&parseHereDocINQ, attribute => 'Normal Text', dynamic => 1, }, 'HereDocIQ' => { callback => \&parseHereDocIQ, attribute => 'Normal Text', dynamic => 1, }, 'HereDocNQ' => { callback => \&parseHereDocNQ, attribute => 'Normal Text', dynamic => 1, }, 'HereDocQ' => { callback => \&parseHereDocQ, attribute => 'Normal Text', dynamic => 1, }, 'HereDocRemainder' => { callback => \&parseHereDocRemainder, attribute => 'Normal Text', lineending => '#pop', }, 'ProcessSubst' => { callback => \&parseProcessSubst, attribute => 'Normal Text', }, 'Start' => { callback => \&parseStart, attribute => 'Normal Text', }, 'StringDQ' => { callback => \&parseStringDQ, attribute => 'String DoubleQ', }, 'StringEsc' => { callback => \&parseStringEsc, attribute => 'String SingleQ', }, 'StringSQ' => { callback => \&parseStringSQ, attribute => 'String SingleQ', }, 'SubShell' => { callback => \&parseSubShell, attribute => 'Normal Text', }, 'Subscript' => { callback => \&parseSubscript, attribute => 'Variable', }, 'SubstBackq' => { callback => \&parseSubstBackq, attribute => 'Normal Text', }, 'SubstCommand' => { callback => \&parseSubstCommand, attribute => 'Normal Text', }, 'SubstFile' => { callback => \&parseSubstFile, attribute => 'Normal Text', }, 'VarBrace' => { callback => \&parseVarBrace, attribute => 'Variable', }, 'VarName' => { callback => \&parseVarName, attribute => 'Normal Text', lineending => '#pop', fallthrough => '#pop', }, }); $self->deliminators('\\s||\\(|\\)|\\!|\\+|,|<|=|>|\\&|\\*|\\/|;|\\?|\\||\\~|\\\\|\\^|\\%|#|\\[|\\]|\\$|\\.|_|\\{|\\}|:|-'); $self->basecontext('Start'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Bash'; } sub parseAssign { my ($self, $text) = @_; # attribute => 'Variable' # char => '(' # context => 'AssignArray' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'AssignArray', 'Variable')) { return 1 } # context => 'FindStrings' # type => 'IncludeRules' if ($self->includeRules('FindStrings', $text)) { return 1 } # context => 'FindSubstitutions' # type => 'IncludeRules' if ($self->includeRules('FindSubstitutions', $text)) { return 1 } # context => 'FindOthers' # type => 'IncludeRules' if ($self->includeRules('FindOthers', $text)) { return 1 } # String => '[\w:,+_./-]+' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\w:,+_./-]+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } return 0; }; sub parseAssignArray { my ($self, $text) = @_; # attribute => 'Variable' # char => ')' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Variable')) { return 1 } # attribute => 'Variable' # char => '[' # context => 'Subscript' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'Subscript', 'Variable')) { return 1 } # attribute => 'Variable' # char => '=' # context => 'Assign' # type => 'DetectChar' if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, 'Assign', 'Variable')) { return 1 } # context => 'FindMost' # type => 'IncludeRules' if ($self->includeRules('FindMost', $text)) { return 1 } return 0; }; sub parseAssignSubscr { my ($self, $text) = @_; # attribute => 'Variable' # char => '[' # context => 'Subscript' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'Subscript', 'Variable')) { return 1 } # attribute => 'Variable' # char => '=' # context => 'Assign' # type => 'DetectChar' if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, 'Assign', 'Variable')) { return 1 } # context => 'FindStrings' # type => 'IncludeRules' if ($self->includeRules('FindStrings', $text)) { return 1 } # context => 'FindSubstitutions' # type => 'IncludeRules' if ($self->includeRules('FindSubstitutions', $text)) { return 1 } # context => 'FindOthers' # type => 'IncludeRules' if ($self->includeRules('FindOthers', $text)) { return 1 } return 0; }; sub parseCase { my ($self, $text) = @_; # String => '\sin\b' # attribute => 'Keyword' # context => 'CaseIn' # type => 'RegExpr' if ($self->testRegExpr($text, '\\sin\\b', 0, 0, 0, undef, 0, 'CaseIn', 'Keyword')) { return 1 } # context => 'FindMost' # type => 'IncludeRules' if ($self->includeRules('FindMost', $text)) { return 1 } return 0; }; sub parseCaseExpr { my ($self, $text) = @_; # attribute => 'Keyword' # char => ';' # char1 => ';' # context => '#pop' # endRegion => 'caseexpr' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, ';', ';', 0, 0, 0, undef, 0, '#pop', 'Keyword')) { return 1 } # context => 'FindAll' # type => 'IncludeRules' if ($self->includeRules('FindAll', $text)) { return 1 } return 0; }; sub parseCaseIn { my ($self, $text) = @_; # String => '\besac(?=$|[\s;)])' # attribute => 'Keyword' # context => '#pop#pop' # endRegion => 'case' # type => 'RegExpr' if ($self->testRegExpr($text, '\\besac(?=$|[\\s;)])', 0, 0, 0, undef, 0, '#pop#pop', 'Keyword')) { return 1 } # attribute => 'Keyword' # beginRegion => 'caseexpr' # char => ')' # context => 'CaseExpr' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, 'CaseExpr', 'Keyword')) { return 1 } # String => '(|' # attribute => 'Keyword' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '(|', 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # context => 'FindMost' # type => 'IncludeRules' if ($self->includeRules('FindMost', $text)) { return 1 } return 0; }; sub parseComment { my ($self, $text) = @_; # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } return 0; }; sub parseCommentBackq { my ($self, $text) = @_; # String => '[^`](?=`)' # attribute => 'Comment' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[^`](?=`)', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } return 0; }; sub parseCommentParen { my ($self, $text) = @_; # String => '[^)](?=\))' # attribute => 'Comment' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[^)](?=\\))', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } return 0; }; sub parseExprBracket { my ($self, $text) = @_; # String => '\s\](?=($|[\s;|&]))' # attribute => 'Builtin' # context => '#pop' # endRegion => 'expression' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s\\](?=($|[\\s;|&]))', 0, 0, 0, undef, 0, '#pop', 'Builtin')) { return 1 } # String => '\](?=($|[\s;|&]))' # attribute => 'Builtin' # column => '0' # context => '#pop' # endRegion => 'expression' # type => 'RegExpr' if ($self->testRegExpr($text, '\\](?=($|[\\s;|&]))', 0, 0, 0, 0, 0, '#pop', 'Builtin')) { return 1 } # attribute => 'Normal Text' # char => '(' # context => 'ExprSubParen' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'ExprSubParen', 'Normal Text')) { return 1 } # context => 'FindMost' # type => 'IncludeRules' if ($self->includeRules('FindMost', $text)) { return 1 } return 0; }; sub parseExprDblBracket { my ($self, $text) = @_; # String => '\s\]\](?=($|[\s;|&]))' # attribute => 'Keyword' # context => '#pop' # endRegion => 'expression' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s\\]\\](?=($|[\\s;|&]))', 0, 0, 0, undef, 0, '#pop', 'Keyword')) { return 1 } # String => '\]\](?=($|[\s;|&]))' # attribute => 'Keyword' # column => '0' # context => '#pop' # endRegion => 'expression' # type => 'RegExpr' if ($self->testRegExpr($text, '\\]\\](?=($|[\\s;|&]))', 0, 0, 0, 0, 0, '#pop', 'Keyword')) { return 1 } # attribute => 'Normal Text' # char => '(' # context => 'ExprSubParen' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'ExprSubParen', 'Normal Text')) { return 1 } # context => 'FindMost' # type => 'IncludeRules' if ($self->includeRules('FindMost', $text)) { return 1 } return 0; }; sub parseExprDblParen { my ($self, $text) = @_; # attribute => 'Keyword' # char => ')' # char1 => ')' # context => '#pop' # endRegion => 'expression' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, ')', ')', 0, 0, 0, undef, 0, '#pop', 'Keyword')) { return 1 } # attribute => 'Normal Text' # char => '(' # context => 'ExprSubParen' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'ExprSubParen', 'Normal Text')) { return 1 } # context => 'FindMost' # type => 'IncludeRules' if ($self->includeRules('FindMost', $text)) { return 1 } return 0; }; sub parseExprDblParenSubst { my ($self, $text) = @_; # attribute => 'Variable' # char => ')' # char1 => ')' # context => '#pop' # endRegion => 'expression' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, ')', ')', 0, 0, 0, undef, 0, '#pop', 'Variable')) { return 1 } # attribute => 'Normal Text' # char => '(' # context => 'ExprSubParen' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'ExprSubParen', 'Normal Text')) { return 1 } # context => 'FindMost' # type => 'IncludeRules' if ($self->includeRules('FindMost', $text)) { return 1 } return 0; }; sub parseExprSubParen { my ($self, $text) = @_; # attribute => 'Normal Text' # char => ')' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } # attribute => 'Normal Text' # char => '(' # context => 'ExprSubParen' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'ExprSubParen', 'Normal Text')) { return 1 } # context => 'FindMost' # type => 'IncludeRules' if ($self->includeRules('FindMost', $text)) { return 1 } return 0; }; sub parseFindAll { my ($self, $text) = @_; # context => 'FindComments' # type => 'IncludeRules' if ($self->includeRules('FindComments', $text)) { return 1 } # context => 'FindCommands' # type => 'IncludeRules' if ($self->includeRules('FindCommands', $text)) { return 1 } # context => 'FindStrings' # type => 'IncludeRules' if ($self->includeRules('FindStrings', $text)) { return 1 } # context => 'FindSubstitutions' # type => 'IncludeRules' if ($self->includeRules('FindSubstitutions', $text)) { return 1 } # context => 'FindOthers' # type => 'IncludeRules' if ($self->includeRules('FindOthers', $text)) { return 1 } return 0; }; sub parseFindCommands { my ($self, $text) = @_; # attribute => 'Keyword' # beginRegion => 'expression' # char => '(' # char1 => '(' # context => 'ExprDblParen' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '(', '(', 0, 0, 0, undef, 0, 'ExprDblParen', 'Keyword')) { return 1 } # String => '\[\[(?=($|\s))' # attribute => 'Keyword' # beginRegion => 'expression' # column => '0' # context => 'ExprDblBracket' # type => 'RegExpr' if ($self->testRegExpr($text, '\\[\\[(?=($|\\s))', 0, 0, 0, 0, 0, 'ExprDblBracket', 'Keyword')) { return 1 } # String => '\s\[\[(?=($|\s))' # attribute => 'Keyword' # beginRegion => 'expression' # context => 'ExprDblBracket' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s\\[\\[(?=($|\\s))', 0, 0, 0, undef, 0, 'ExprDblBracket', 'Keyword')) { return 1 } # String => '\[(?=($|\s))' # attribute => 'Builtin' # beginRegion => 'expression' # column => '0' # context => 'ExprBracket' # type => 'RegExpr' if ($self->testRegExpr($text, '\\[(?=($|\\s))', 0, 0, 0, 0, 0, 'ExprBracket', 'Builtin')) { return 1 } # String => '\s\[(?=($|\s))' # attribute => 'Builtin' # beginRegion => 'expression' # context => 'ExprBracket' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s\\[(?=($|\\s))', 0, 0, 0, undef, 0, 'ExprBracket', 'Builtin')) { return 1 } # String => '\{(?=($|\s))' # attribute => 'Keyword' # beginRegion => 'group' # context => 'Group' # type => 'RegExpr' if ($self->testRegExpr($text, '\\{(?=($|\\s))', 0, 0, 0, undef, 0, 'Group', 'Keyword')) { return 1 } # attribute => 'Keyword' # beginRegion => 'subshell' # char => '(' # context => 'SubShell' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'SubShell', 'Keyword')) { return 1 } # String => '\bdo(?![\w$+-])' # attribute => 'Keyword' # beginRegion => 'do' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bdo(?![\\w$+-])', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bdone(?![\w$+-])' # attribute => 'Keyword' # context => '#stay' # endRegion => 'do' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bdone(?![\\w$+-])', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bif(?![\w$+-])' # attribute => 'Keyword' # beginRegion => 'if' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bif(?![\\w$+-])', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bfi(?![\w$+-])' # attribute => 'Keyword' # context => '#stay' # endRegion => 'if' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bfi(?![\\w$+-])', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bcase(?![\w$+-])' # attribute => 'Keyword' # beginRegion => 'case' # context => 'Case' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bcase(?![\\w$+-])', 0, 0, 0, undef, 0, 'Case', 'Keyword')) { return 1 } # String => '-[A-Za-z0-9]+' # attribute => 'Option' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '-[A-Za-z0-9]+', 0, 0, 0, undef, 0, '#stay', 'Option')) { return 1 } # String => '--[a-z][A-Za-z0-9_-]*' # attribute => 'Option' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '--[a-z][A-Za-z0-9_-]*', 0, 0, 0, undef, 0, '#stay', 'Option')) { return 1 } # String => '\b[A-Za-z_][A-Za-z0-9_]*=' # attribute => 'Variable' # context => 'Assign' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b[A-Za-z_][A-Za-z0-9_]*=', 0, 0, 0, undef, 0, 'Assign', 'Variable')) { return 1 } # String => '\b[A-Za-z_][A-Za-z0-9_]*(?=\[[^]]+\]=)' # attribute => 'Variable' # context => 'AssignSubscr' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b[A-Za-z_][A-Za-z0-9_]*(?=\\[[^]]+\\]=)', 0, 0, 0, undef, 0, 'AssignSubscr', 'Variable')) { return 1 } # String => ':()' # attribute => 'Function' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ':()', 0, 0, 0, undef, 0, '#stay', 'Function')) { return 1 } # String => '\bfunction\b' # attribute => 'Keyword' # context => 'FunctionDef' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bfunction\\b', 0, 0, 0, undef, 0, 'FunctionDef', 'Keyword')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'builtins' # attribute => 'Builtin' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'builtins', 0, undef, 0, '#stay', 'Builtin')) { return 1 } # String => 'unixcommands' # attribute => 'Command' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'unixcommands', 0, undef, 0, '#stay', 'Command')) { return 1 } # String => 'builtins_var' # attribute => 'Builtin' # context => 'VarName' # type => 'keyword' if ($self->testKeyword($text, 'builtins_var', 0, undef, 0, 'VarName', 'Builtin')) { return 1 } # String => '<<<' # attribute => 'Redirection' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '<<<', 0, 0, 0, undef, 0, '#stay', 'Redirection')) { return 1 } # String => '<<' # attribute => 'Redirection' # context => 'HereDoc' # lookAhead => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, '<<', 0, 0, 1, undef, 0, 'HereDoc', 'Redirection')) { return 1 } # String => '[<>]\(' # attribute => 'Redirection' # context => 'ProcessSubst' # type => 'RegExpr' if ($self->testRegExpr($text, '[<>]\\(', 0, 0, 0, undef, 0, 'ProcessSubst', 'Redirection')) { return 1 } # String => '([0-9]*(>{1,2}|<)(&[0-9]+-?)?|&>|>&|[0-9]*<>)' # attribute => 'Redirection' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '([0-9]*(>{1,2}|<)(&[0-9]+-?)?|&>|>&|[0-9]*<>)', 0, 0, 0, undef, 0, '#stay', 'Redirection')) { return 1 } # String => '([|&])\1?' # attribute => 'Control' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '([|&])\\1?', 0, 0, 0, undef, 0, '#stay', 'Control')) { return 1 } # String => '[A-Za-z_:][A-Za-z0-9_:#%@-]*\s*\(\)' # attribute => 'Function' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[A-Za-z_:][A-Za-z0-9_:#%@-]*\\s*\\(\\)', 0, 0, 0, undef, 0, '#stay', 'Function')) { return 1 } return 0; }; sub parseFindComments { my ($self, $text) = @_; # attribute => 'Comment' # char => '#' # context => 'Comment' # firstNonSpace => 'true' # type => 'DetectChar' if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 1, 'Comment', 'Comment')) { return 1 } # String => '[\s;](?=#)' # attribute => 'Normal Text' # context => 'Comment' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\s;](?=#)', 0, 0, 0, undef, 0, 'Comment', 'Normal Text')) { return 1 } return 0; }; sub parseFindCommentsBackq { my ($self, $text) = @_; # attribute => 'Comment' # char => '#' # context => 'CommentBackq' # firstNonSpace => 'true' # type => 'DetectChar' if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 1, 'CommentBackq', 'Comment')) { return 1 } # String => '[\s;](?=#)' # attribute => 'Normal Text' # context => 'CommentBackq' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\s;](?=#)', 0, 0, 0, undef, 0, 'CommentBackq', 'Normal Text')) { return 1 } return 0; }; sub parseFindCommentsParen { my ($self, $text) = @_; # attribute => 'Comment' # char => '#' # context => 'CommentParen' # firstNonSpace => 'true' # type => 'DetectChar' if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 1, 'CommentParen', 'Comment')) { return 1 } # String => '[\s;](?=#)' # attribute => 'Normal Text' # context => 'CommentParen' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\s;](?=#)', 0, 0, 0, undef, 0, 'CommentParen', 'Normal Text')) { return 1 } return 0; }; sub parseFindMost { my ($self, $text) = @_; # context => 'FindComments' # type => 'IncludeRules' if ($self->includeRules('FindComments', $text)) { return 1 } # context => 'FindStrings' # type => 'IncludeRules' if ($self->includeRules('FindStrings', $text)) { return 1 } # context => 'FindSubstitutions' # type => 'IncludeRules' if ($self->includeRules('FindSubstitutions', $text)) { return 1 } # context => 'FindOthers' # type => 'IncludeRules' if ($self->includeRules('FindOthers', $text)) { return 1 } return 0; }; sub parseFindOthers { my ($self, $text) = @_; # String => '\\[][;"\\'$`{}()|&<>* ]' # attribute => 'Escape' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\[][;"\\\\\'$`{}()|&<>* ]', 0, 0, 0, undef, 0, '#stay', 'Escape')) { return 1 } # String => '\\$' # attribute => 'Keyword' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\$', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\{(?!(\s|$))\S*\}' # attribute => 'Escape' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\{(?!(\\s|$))\\S*\\}', 0, 0, 0, undef, 0, '#stay', 'Escape')) { return 1 } # String => '\.?/[\w_@.+-]+(?=([\s/):]|$))' # attribute => 'Path' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\.?/[\\w_@.+-]+(?=([\\s/):]|$))', 0, 0, 0, undef, 0, '#stay', 'Path')) { return 1 } return 0; }; sub parseFindStrings { my ($self, $text) = @_; # attribute => 'String SingleQ' # char => ''' # context => 'StringSQ' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'StringSQ', 'String SingleQ')) { return 1 } # attribute => 'String DoubleQ' # char => '"' # context => 'StringDQ' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'StringDQ', 'String DoubleQ')) { return 1 } # attribute => 'String SingleQ' # char => '$' # char1 => ''' # context => 'StringEsc' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '$', '\'', 0, 0, 0, undef, 0, 'StringEsc', 'String SingleQ')) { return 1 } # attribute => 'String Transl.' # char => '$' # char1 => '"' # context => 'StringDQ' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '$', '"', 0, 0, 0, undef, 0, 'StringDQ', 'String Transl.')) { return 1 } return 0; }; sub parseFindSubstitutions { my ($self, $text) = @_; # String => '\$[*@#?$!_0-9-]' # attribute => 'Variable' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$[*@#?$!_0-9-]', 0, 0, 0, undef, 0, '#stay', 'Variable')) { return 1 } # String => '\$[A-Za-z_][A-Za-z0-9_]*\[' # attribute => 'Variable' # context => 'Subscript' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$[A-Za-z_][A-Za-z0-9_]*\\[', 0, 0, 0, undef, 0, 'Subscript', 'Variable')) { return 1 } # String => '\$[A-Za-z_][A-Za-z0-9_]*' # attribute => 'Variable' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$[A-Za-z_][A-Za-z0-9_]*', 0, 0, 0, undef, 0, '#stay', 'Variable')) { return 1 } # String => '\$\{[*@#?$!_0-9-]\}' # attribute => 'Variable' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$\\{[*@#?$!_0-9-]\\}', 0, 0, 0, undef, 0, '#stay', 'Variable')) { return 1 } # String => '\$\{#[A-Za-z_][A-Za-z0-9_]*\}' # attribute => 'Variable' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$\\{#[A-Za-z_][A-Za-z0-9_]*\\}', 0, 0, 0, undef, 0, '#stay', 'Variable')) { return 1 } # String => '\$\{![A-Za-z_][A-Za-z0-9_]*\*?\}' # attribute => 'Variable' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$\\{![A-Za-z_][A-Za-z0-9_]*\\*?\\}', 0, 0, 0, undef, 0, '#stay', 'Variable')) { return 1 } # String => '\$\{[A-Za-z_][A-Za-z0-9_]*' # attribute => 'Variable' # context => 'VarBrace' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$\\{[A-Za-z_][A-Za-z0-9_]*', 0, 0, 0, undef, 0, 'VarBrace', 'Variable')) { return 1 } # String => '\$\{[*@#?$!_0-9-](?=[:#%/])' # attribute => 'Variable' # context => 'VarBrace' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$\\{[*@#?$!_0-9-](?=[:#%/])', 0, 0, 0, undef, 0, 'VarBrace', 'Variable')) { return 1 } # String => '$((' # attribute => 'Variable' # beginRegion => 'expression' # context => 'ExprDblParenSubst' # type => 'StringDetect' if ($self->testStringDetect($text, '$((', 0, 0, 0, undef, 0, 'ExprDblParenSubst', 'Variable')) { return 1 } # String => '$(<' # attribute => 'Redirection' # context => 'SubstFile' # type => 'StringDetect' if ($self->testStringDetect($text, '$(<', 0, 0, 0, undef, 0, 'SubstFile', 'Redirection')) { return 1 } # String => '$(' # attribute => 'Variable' # context => 'SubstCommand' # type => 'StringDetect' if ($self->testStringDetect($text, '$(', 0, 0, 0, undef, 0, 'SubstCommand', 'Variable')) { return 1 } # attribute => 'Backquote' # char => '`' # context => 'SubstBackq' # type => 'DetectChar' if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, 'SubstBackq', 'Backquote')) { return 1 } # String => '\\[`$\\]' # attribute => 'Escape' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\[`$\\\\]', 0, 0, 0, undef, 0, '#stay', 'Escape')) { return 1 } return 0; }; sub parseFunctionDef { my ($self, $text) = @_; # String => '\s+[A-Za-z_:][A-Za-z0-9_:#%@-]*(\s*\(\))?' # attribute => 'Function' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s+[A-Za-z_:][A-Za-z0-9_:#%@-]*(\\s*\\(\\))?', 0, 0, 0, undef, 0, '#pop', 'Function')) { return 1 } return 0; }; sub parseGroup { my ($self, $text) = @_; # attribute => 'Keyword' # char => '}' # context => '#pop' # endRegion => 'group' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Keyword')) { return 1 } # context => 'FindAll' # type => 'IncludeRules' if ($self->includeRules('FindAll', $text)) { return 1 } return 0; }; sub parseHereDoc { my ($self, $text) = @_; # String => '(<<\s*"([^|&;()<>\s]+)")' # attribute => 'Redirection' # context => 'HereDocQ' # lookAhead => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '(<<\\s*"([^|&;()<>\\s]+)")', 0, 0, 1, undef, 0, 'HereDocQ', 'Redirection')) { return 1 } # String => '(<<\s*'([^|&;()<>\s]+)')' # attribute => 'Redirection' # context => 'HereDocQ' # lookAhead => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '(<<\\s*\'([^|&;()<>\\s]+)\')', 0, 0, 1, undef, 0, 'HereDocQ', 'Redirection')) { return 1 } # String => '(<<\s*\\([^|&;()<>\s]+))' # attribute => 'Redirection' # context => 'HereDocQ' # lookAhead => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '(<<\\s*\\\\([^|&;()<>\\s]+))', 0, 0, 1, undef, 0, 'HereDocQ', 'Redirection')) { return 1 } # String => '(<<\s*([^|&;()<>\s]+))' # attribute => 'Redirection' # context => 'HereDocNQ' # lookAhead => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '(<<\\s*([^|&;()<>\\s]+))', 0, 0, 1, undef, 0, 'HereDocNQ', 'Redirection')) { return 1 } # String => '(<<-\s*"([^|&;()<>\s]+)")' # attribute => 'Redirection' # context => 'HereDocIQ' # lookAhead => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '(<<-\\s*"([^|&;()<>\\s]+)")', 0, 0, 1, undef, 0, 'HereDocIQ', 'Redirection')) { return 1 } # String => '(<<-\s*'([^|&;()<>\s]+)')' # attribute => 'Redirection' # context => 'HereDocIQ' # lookAhead => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '(<<-\\s*\'([^|&;()<>\\s]+)\')', 0, 0, 1, undef, 0, 'HereDocIQ', 'Redirection')) { return 1 } # String => '(<<-\s*\\([^|&;()<>\s]+))' # attribute => 'Redirection' # context => 'HereDocIQ' # lookAhead => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '(<<-\\s*\\\\([^|&;()<>\\s]+))', 0, 0, 1, undef, 0, 'HereDocIQ', 'Redirection')) { return 1 } # String => '(<<-\s*([^|&;()<>\s]+))' # attribute => 'Redirection' # context => 'HereDocINQ' # lookAhead => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '(<<-\\s*([^|&;()<>\\s]+))', 0, 0, 1, undef, 0, 'HereDocINQ', 'Redirection')) { return 1 } # String => '<<' # attribute => 'Redirection' # context => '#pop' # type => 'StringDetect' if ($self->testStringDetect($text, '<<', 0, 0, 0, undef, 0, '#pop', 'Redirection')) { return 1 } return 0; }; sub parseHereDocINQ { my ($self, $text) = @_; # String => '%1' # attribute => 'Redirection' # context => 'HereDocRemainder' # dynamic => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%1', 0, 1, 0, undef, 0, 'HereDocRemainder', 'Redirection')) { return 1 } # String => '\s*%2[\s;]*$' # attribute => 'Redirection' # column => '0' # context => '#pop#pop' # dynamic => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*%2[\\s;]*$', 0, 1, 0, 0, 0, '#pop#pop', 'Redirection')) { return 1 } # context => 'FindSubstitutions' # type => 'IncludeRules' if ($self->includeRules('FindSubstitutions', $text)) { return 1 } return 0; }; sub parseHereDocIQ { my ($self, $text) = @_; # String => '%1' # attribute => 'Redirection' # context => 'HereDocRemainder' # dynamic => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%1', 0, 1, 0, undef, 0, 'HereDocRemainder', 'Redirection')) { return 1 } # String => '\s*%2[\s;]*$' # attribute => 'Redirection' # column => '0' # context => '#pop#pop' # dynamic => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*%2[\\s;]*$', 0, 1, 0, 0, 0, '#pop#pop', 'Redirection')) { return 1 } return 0; }; sub parseHereDocNQ { my ($self, $text) = @_; # String => '%1' # attribute => 'Redirection' # context => 'HereDocRemainder' # dynamic => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%1', 0, 1, 0, undef, 0, 'HereDocRemainder', 'Redirection')) { return 1 } # String => '%2[\s;]*$' # attribute => 'Redirection' # column => '0' # context => '#pop#pop' # dynamic => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%2[\\s;]*$', 0, 1, 0, 0, 0, '#pop#pop', 'Redirection')) { return 1 } # context => 'FindSubstitutions' # type => 'IncludeRules' if ($self->includeRules('FindSubstitutions', $text)) { return 1 } return 0; }; sub parseHereDocQ { my ($self, $text) = @_; # String => '%1' # attribute => 'Redirection' # context => 'HereDocRemainder' # dynamic => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%1', 0, 1, 0, undef, 0, 'HereDocRemainder', 'Redirection')) { return 1 } # String => '%2[\s;]*$' # attribute => 'Redirection' # column => '0' # context => '#pop#pop' # dynamic => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%2[\\s;]*$', 0, 1, 0, 0, 0, '#pop#pop', 'Redirection')) { return 1 } return 0; }; sub parseHereDocRemainder { my ($self, $text) = @_; # context => 'FindAll' # type => 'IncludeRules' if ($self->includeRules('FindAll', $text)) { return 1 } return 0; }; sub parseProcessSubst { my ($self, $text) = @_; # attribute => 'Redirection' # char => ')' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Redirection')) { return 1 } # context => 'FindCommentsParen' # type => 'IncludeRules' if ($self->includeRules('FindCommentsParen', $text)) { return 1 } # context => 'FindCommands' # type => 'IncludeRules' if ($self->includeRules('FindCommands', $text)) { return 1 } # context => 'FindStrings' # type => 'IncludeRules' if ($self->includeRules('FindStrings', $text)) { return 1 } # context => 'FindSubstitutions' # type => 'IncludeRules' if ($self->includeRules('FindSubstitutions', $text)) { return 1 } # context => 'FindOthers' # type => 'IncludeRules' if ($self->includeRules('FindOthers', $text)) { return 1 } return 0; }; sub parseStart { my ($self, $text) = @_; # context => 'FindAll' # type => 'IncludeRules' if ($self->includeRules('FindAll', $text)) { return 1 } return 0; }; sub parseStringDQ { my ($self, $text) = @_; # attribute => 'String DoubleQ' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String DoubleQ')) { return 1 } # String => '\\[`"\\$\n]' # attribute => 'String Escape' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\[`"\\\\$\\n]', 0, 0, 0, undef, 0, '#stay', 'String Escape')) { return 1 } # context => 'FindSubstitutions' # type => 'IncludeRules' if ($self->includeRules('FindSubstitutions', $text)) { return 1 } return 0; }; sub parseStringEsc { my ($self, $text) = @_; # attribute => 'String SingleQ' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String SingleQ')) { return 1 } # String => '\\[abefnrtv\\']' # attribute => 'String Escape' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\[abefnrtv\\\\\']', 0, 0, 0, undef, 0, '#stay', 'String Escape')) { return 1 } # String => '\\([0-7]{1,3}|x[A-Fa-f0-9]{1,2}|c.)' # attribute => 'String Escape' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\([0-7]{1,3}|x[A-Fa-f0-9]{1,2}|c.)', 0, 0, 0, undef, 0, '#stay', 'String Escape')) { return 1 } return 0; }; sub parseStringSQ { my ($self, $text) = @_; # attribute => 'String SingleQ' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String SingleQ')) { return 1 } return 0; }; sub parseSubShell { my ($self, $text) = @_; # attribute => 'Keyword' # char => ')' # context => '#pop' # endRegion => 'subshell' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Keyword')) { return 1 } # context => 'FindAll' # type => 'IncludeRules' if ($self->includeRules('FindAll', $text)) { return 1 } return 0; }; sub parseSubscript { my ($self, $text) = @_; # attribute => 'Variable' # char => ']' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Variable')) { return 1 } # context => 'FindStrings' # type => 'IncludeRules' if ($self->includeRules('FindStrings', $text)) { return 1 } # context => 'FindSubstitutions' # type => 'IncludeRules' if ($self->includeRules('FindSubstitutions', $text)) { return 1 } # context => 'FindOthers' # type => 'IncludeRules' if ($self->includeRules('FindOthers', $text)) { return 1 } return 0; }; sub parseSubstBackq { my ($self, $text) = @_; # attribute => 'Keyword' # char => '`' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, '#pop', 'Keyword')) { return 1 } # context => 'FindCommentsBackq' # type => 'IncludeRules' if ($self->includeRules('FindCommentsBackq', $text)) { return 1 } # context => 'FindCommands' # type => 'IncludeRules' if ($self->includeRules('FindCommands', $text)) { return 1 } # context => 'FindStrings' # type => 'IncludeRules' if ($self->includeRules('FindStrings', $text)) { return 1 } # context => 'FindSubstitutions' # type => 'IncludeRules' if ($self->includeRules('FindSubstitutions', $text)) { return 1 } # context => 'FindOthers' # type => 'IncludeRules' if ($self->includeRules('FindOthers', $text)) { return 1 } return 0; }; sub parseSubstCommand { my ($self, $text) = @_; # attribute => 'Variable' # char => ')' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Variable')) { return 1 } # context => 'FindCommentsParen' # type => 'IncludeRules' if ($self->includeRules('FindCommentsParen', $text)) { return 1 } # context => 'FindCommands' # type => 'IncludeRules' if ($self->includeRules('FindCommands', $text)) { return 1 } # context => 'FindStrings' # type => 'IncludeRules' if ($self->includeRules('FindStrings', $text)) { return 1 } # context => 'FindSubstitutions' # type => 'IncludeRules' if ($self->includeRules('FindSubstitutions', $text)) { return 1 } # context => 'FindOthers' # type => 'IncludeRules' if ($self->includeRules('FindOthers', $text)) { return 1 } return 0; }; sub parseSubstFile { my ($self, $text) = @_; # attribute => 'Redirection' # char => ')' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Redirection')) { return 1 } # context => 'FindCommentsParen' # type => 'IncludeRules' if ($self->includeRules('FindCommentsParen', $text)) { return 1 } # context => 'FindStrings' # type => 'IncludeRules' if ($self->includeRules('FindStrings', $text)) { return 1 } # context => 'FindSubstitutions' # type => 'IncludeRules' if ($self->includeRules('FindSubstitutions', $text)) { return 1 } # context => 'FindOthers' # type => 'IncludeRules' if ($self->includeRules('FindOthers', $text)) { return 1 } return 0; }; sub parseVarBrace { my ($self, $text) = @_; # attribute => 'Variable' # char => '}' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Variable')) { return 1 } # attribute => 'Variable' # char => '[' # context => 'Subscript' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'Subscript', 'Variable')) { return 1 } # context => 'FindStrings' # type => 'IncludeRules' if ($self->includeRules('FindStrings', $text)) { return 1 } # context => 'FindSubstitutions' # type => 'IncludeRules' if ($self->includeRules('FindSubstitutions', $text)) { return 1 } return 0; }; sub parseVarName { my ($self, $text) = @_; # String => '-[A-Za-z0-9]+' # attribute => 'Option' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '-[A-Za-z0-9]+', 0, 0, 0, undef, 0, '#stay', 'Option')) { return 1 } # String => '--[a-z][A-Za-z0-9_-]*' # attribute => 'Option' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '--[a-z][A-Za-z0-9_-]*', 0, 0, 0, undef, 0, '#stay', 'Option')) { return 1 } # String => '\b[A-Za-z_][A-Za-z0-9_]*' # attribute => 'Variable' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b[A-Za-z_][A-Za-z0-9_]*', 0, 0, 0, undef, 0, '#stay', 'Variable')) { return 1 } # attribute => 'Variable' # char => '[' # context => 'Subscript' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'Subscript', 'Variable')) { return 1 } # attribute => 'Variable' # char => '=' # context => 'Assign' # type => 'DetectChar' if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, 'Assign', 'Variable')) { return 1 } # context => 'FindMost' # type => 'IncludeRules' if ($self->includeRules('FindMost', $text)) { return 1 } # String => '[^]})|;`&><]' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[^]})|;`&><]', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Bash - a Plugin for Bash syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Bash; my $sh = new Syntax::Highlight::Engine::Kate::Bash([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Bash is a plugin module that provides syntax highlighting for Bash to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/XHarbour.pm0000644000175000017500000004343213226470762026415 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'xharbour.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.04 #kate version 2.4 #kate author Giancarlo Niccolai (giancarlo@niccolai.ws) #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::XHarbour; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Comment' => 'Comment', 'Function' => 'Function', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Number' => 'DecVal', 'Operator' => 'BaseN', 'Preprocessor' => 'Others', 'String' => 'String', }); $self->listAdd('class_keywords', 'classdata', 'data', 'from', 'hidden', 'init', 'inline', 'method', ); $self->listAdd('context_beginners', 'BEGIN', 'FOR', 'FUNCTION', 'IF', 'METHOD', 'PROCEDURE', 'SWITCH', 'TRY', 'WHILE', ); $self->listAdd('context_terminators', 'END', 'ENDCASE', 'ENDDO', 'ENDIF', 'NEXT', ); $self->listAdd('functions', 'ABS', 'ALLTRIM', 'ASC', 'AT', 'CDOW', 'CHR', 'CMONTH', 'CTOD', 'CURDIR', 'CreateMutex', 'DATE', 'DAY', 'DAYS', 'DBAPPEND', 'DBCLEARFILTER', 'DBCLOSEALL', 'DBCLOSEAREA', 'DBCOMMIT', 'DBCOMMITALL', 'DBCREATE', 'DBDELETE', 'DBEVAL', 'DBF', 'DBFILTER', 'DBGOBOTTOM', 'DBGOTO', 'DBGOTOP', 'DBRECALL', 'DBRLOCK', 'DBRLOCKLIST', 'DBRUNLOCK', 'DBSEEK', 'DBSELECTAREA', 'DBSETDRIVER', 'DBSETFILTER', 'DBSKIP', 'DBSTRUCT', 'DBUNLOCK', 'DBUNLOCKALL', 'DBUSEAREA', 'DIRCHANGE', 'DIRREMOVE', 'DISKSPACE', 'DOW', 'DTOC', 'DTOS', 'DestroyMutex', 'EXP', 'FCLOSE', 'FCREATE', 'FERASE', 'FERROR', 'FOPEN', 'FREAD', 'FREADSTR', 'FSEEK', 'FWRITE', 'GETENV', 'HARDCR', 'HB_ANSITOOEM', 'HB_DISKSPACE', 'HB_FEOF', 'HB_ISBYREF', 'HB_LANGNAME', 'HB_LANGSELECT', 'HB_OEMTOANSI', 'HB_SETKEYSAVE', 'HB_SetKeyCheck', 'HB_SetKeyGet', 'HB_VALTOSTR', 'HB_pvalue', 'INDEXEXT', 'INDEXKEY', 'INDEXORD', 'INT', 'ISAFFIRM', 'ISALPHA', 'ISDIGIT', 'ISDISK', 'ISLOWER', 'ISNEGATIVE', 'ISUPPER', 'InetAccept', 'InetAddress', 'InetCleanup', 'InetClearTimeout', 'InetConnect', 'InetConnectIP', 'InetCreate', 'InetDGram', 'InetDGramRecv', 'InetDGramSend', 'InetDestroy', 'InetError', 'InetErrorDesc', 'InetGetHosts', 'InetGetTimeout', 'InetInit', 'InetPort', 'InetRecv', 'InetRecvAll', 'InetSend', 'InetSendAll', 'InetServer', 'InetSetTimeout', 'KillAllThreads', 'LEFT', 'LEN', 'LOG', 'LOWER', 'LTRIM', 'MAKEDIR', 'MAX', 'MEMOTRAN', 'MIN', 'MOD', 'MONTH', 'MutexLock', 'MutexUnlock', 'NATIONMSG', 'Notify', 'NotifyAll', 'ORDBAGEXT', 'ORDBAGNAME', 'ORDCONDSET', 'ORDCREATE', 'ORDDESTROY', 'ORDFOR', 'ORDKEY', 'ORDLISTADD', 'ORDLISTCLEAR', 'ORDLISTREBUILD', 'ORDNAME', 'ORDNUMBER', 'ORDSETFOCUS', 'PADC', 'PADL', 'PADR', 'PROCFILE', 'PROCLINE', 'PROCNAME', 'RAT', 'RDDLIST', 'RDDNAME', 'RDDSETDEFAULT', 'REPLICATE', 'RIGHT', 'ROUND', 'RTRIM', 'SET', 'SETKEY', 'SETMODE', 'SETTYPEAHEAD', 'SPACE', 'SQRT', 'STR', 'STRTRAN', 'STRZERO', 'SUBSTR', 'Subscribe', 'SubscribeNow', 'TAssociativeArray', 'TRANSFORM', 'TRIM', 'TYPE', 'ThreadJoin', 'ThreadKill', 'ThreadSleep', 'ThreadStart', 'ThreadStop', 'UPPER', 'VAL', 'VALTYPE', 'VERSION', 'WaitForThreads', 'YEAR', '__DBCONTINUE', '__DBZAP', '__FLEDIT', '__QUIT', '__RDDSETDEFAULT', '__SETCENTURY', '__SetFunction', '__WAIT', '__atprompt', '__dbCopyStruct', '__dbCopyXStruct', '__dbCreate', '__dbStructFilter', '__dbdelim', '__dbsdf', '__dir', '__input', '__menuto', '__nonoallert', '__run', '__typefile', '__xrestscreen', '__xsavescreen', 'aadd', 'achoice', 'aclone', 'adel', 'adir', 'aeval', 'afill', 'ains', 'alert', 'array', 'ascan', 'asize', 'asort', 'atail', 'bin21', 'bin2l', 'bin2u', 'bin2w', 'break', 'browse', 'col', 'dbSkipper', 'dbedit', 'descend', 'devoutpict', 'do', 'elaptime', 'empty', 'errornew', 'errorsys', 'eval', 'fieldblock', 'fieldwblock', 'file', 'frename', 'hb_chechsum', 'hb_class', 'hb_colorindex', 'hb_crypt', 'hb_decrypt', 'hb_exec', 'hb_execfromarray', 'hb_hextonum', 'hb_keyput', 'hb_numtohex', 'hb_osnewline', 'hb_random', 'hb_readini', 'hb_regex', 'hb_regexcomp', 'hb_regexmatch', 'hb_regexsplit', 'hb_writeini', 'i2bin', 'inkey', 'l2bin', 'lastkey', 'maxcol', 'maxrow', 'mcol', 'mrow', 'nextkey', 'os', 'outerr', 'outstd', 'pcount', 'readkey', 'readvar', 'row', 'seconds', 'secs', 'throw', 'time', 'tone', 'u2bin', 'valtoprg', 'w2bin', 'word', ); $self->listAdd('keywords', '?', 'alias', 'all', 'as', 'box', 'case', 'catch', 'class', 'clear', 'close', 'color', 'databases', 'date', 'do', 'each', 'else', 'elseif', 'exit', 'extern', 'external', 'field', 'get', 'global', 'has', 'in', 'index', 'like', 'local', 'loop', 'nil', 'off', 'on', 'otherwise', 'read', 'return', 'say', 'say', 'screen', 'select', 'self', 'set', 'static', 'super', 'switch', 'to', 'use', ); $self->listAdd('pragma', '#define', '#else', '#endif', '#if', '#ifdef', '#ifndef', '#include', ); $self->listAdd('set_commands', 'ALTERNATE', 'ALTFILE', 'AUTOPEN', 'AUTORDER', 'AUTOSHARE', 'BELL', 'CANCEL', 'COLOR', 'CONFIRM', 'CONSOLE', 'CURSOR', 'DATEFORMAT', 'DEBUG', 'DECIMALS', 'DEFAULT', 'DELETED', 'DELIMCHARS', 'DELIMITERS', 'DEVICE', 'DIRCASE', 'DIRSEPARATOR', 'EPOCH', 'ESCAPE', 'EVENTMASK', 'EXACT', 'EXCLUSIVE', 'EXIT', 'EXTRA', 'EXTRAFILE', 'FILECASE', 'FIXED', 'IDLEREPEAT', 'INSERT', 'INTENSITY', 'INVALID', 'LANGUAGE', 'MARGIN', 'MBLOCKSIZE', 'MCENTER', 'MESSAGE', 'MFILEEXT', 'OPTIMIZE', 'PATH', 'PRINTER', 'PRINTFILE', 'SCOREBOARD', 'SCROLLBREAK', 'SOFTSEEK', 'STRICTREAD', 'TRACE', 'TRACEFILE', 'TRACESTACK', 'TYPEAHEAD', 'UNIQUE', 'VIDEOMODE', 'WRAP', ); $self->contextdata({ 'ClassContext' => { callback => \&parseClassContext, attribute => 'Normal Text', }, 'TopLevel' => { callback => \&parseTopLevel, attribute => 'Normal Text', }, 'comment' => { callback => \&parsecomment, attribute => 'Comment', lineending => '#pop', }, 'logic' => { callback => \&parselogic, attribute => 'Operator', lineending => '#pop', }, 'ml_comment' => { callback => \&parseml_comment, attribute => 'Comment', }, 'string' => { callback => \&parsestring, attribute => 'String', lineending => '#pop', }, 'stringc' => { callback => \&parsestringc, attribute => 'String', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('TopLevel'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'xHarbour'; } sub parseClassContext { my ($self, $text) = @_; # attribute => 'Comment' # beginRegion => 'comment_region' # char => '/' # char1 => '*' # context => 'ml_comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'ml_comment', 'Comment')) { return 1 } # attribute => 'Comment' # char => '*' # context => 'comment' # firstNonSpace => 'true' # type => 'DetectChar' if ($self->testDetectChar($text, '*', 0, 0, 0, undef, 1, 'comment', 'Comment')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'comment', 'Comment')) { return 1 } # String => 'class_keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'class_keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'END(CLASS)? *$' # attribute => 'Keyword' # context => '#pop' # endRegion => 'ClassDeclRegion' # firstNonSpace => 'true' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, 'END(CLASS)? *$', 1, 0, 0, undef, 1, '#pop', 'Keyword')) { return 1 } return 0; }; sub parseTopLevel { my ($self, $text) = @_; # attribute => 'Comment' # beginRegion => 'comment_region' # char => '/' # char1 => '*' # context => 'ml_comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'ml_comment', 'Comment')) { return 1 } # attribute => 'Comment' # char => '*' # context => 'comment' # firstNonSpace => 'true' # type => 'DetectChar' if ($self->testDetectChar($text, '*', 0, 0, 0, undef, 1, 'comment', 'Comment')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'comment', 'Comment')) { return 1 } # attribute => 'String' # char => '"' # context => 'string' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'String')) { return 1 } # attribute => 'String' # char => ''' # context => 'stringc' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'stringc', 'String')) { return 1 } # String => '.and.' # attribute => 'Operator' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, '.and.', 1, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '.or.' # attribute => 'Operator' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, '.or.', 1, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '.not.' # attribute => 'Operator' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, '.not.', 1, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '.f.' # attribute => 'Operator' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, '.f.', 1, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '.t.' # attribute => 'Operator' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, '.t.', 1, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => ':=!' # attribute => 'Operator' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, ':=!', 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # attribute => 'Keyword' # char => '@' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '@', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'CLASS[\t ]+' # attribute => 'Keyword' # beginRegion => 'ClassDeclRegion' # context => 'ClassContext' # firstNonSpace => 'true' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, 'CLASS[\\t ]+', 1, 0, 0, undef, 1, 'ClassContext', 'Keyword')) { return 1 } # String => 'DO[\t ]+CASE[\t ]*$' # attribute => 'Keyword' # beginRegion => 'IndentRegion' # context => '#stay' # firstNonSpace => 'true' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, 'DO[\\t ]+CASE[\\t ]*$', 1, 0, 0, undef, 1, '#stay', 'Keyword')) { return 1 } # String => 'context_beginners' # attribute => 'Keyword' # beginRegion => 'IndentRegion' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'context_beginners', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'context_terminators' # attribute => 'Keyword' # context => '#stay' # endRegion => 'IndentRegion' # type => 'keyword' if ($self->testKeyword($text, 'context_terminators', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'return ?' # attribute => 'Keyword' # column => '0' # context => '#stay' # endRegion => 'IndentRegion' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, 'return ?', 1, 0, 0, 0, 0, '#stay', 'Keyword')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'set_commands' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'set_commands', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'functions' # attribute => 'Function' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) { return 1 } # String => 'pragma' # attribute => 'Preprocessor' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'pragma', 0, undef, 0, '#stay', 'Preprocessor')) { return 1 } # attribute => 'Operator' # char => '-' # char1 => '>' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '-', '>', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '\d+' # attribute => 'Number' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\d+', 0, 0, 0, undef, 0, '#stay', 'Number')) { return 1 } return 0; }; sub parsecomment { my ($self, $text) = @_; return 0; }; sub parselogic { my ($self, $text) = @_; # attribute => 'Operator' # char => '.' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '.', 0, 0, 0, undef, 0, '#pop', 'Operator')) { return 1 } return 0; }; sub parseml_comment { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # endRegion => 'comment_region' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parsestring { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; sub parsestringc { my ($self, $text) = @_; # attribute => 'String' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::XHarbour - a Plugin for xHarbour syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::XHarbour; my $sh = new Syntax::Highlight::Engine::Kate::XHarbour([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::XHarbour is a plugin module that provides syntax highlighting for xHarbour to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Xslt.pm0000644000175000017500000005364613226470762025625 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'xslt.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.03 #kate version 2.1 #kate author Peter Lammich (views@gmx.de) #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::Xslt; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Alert' => 'Alert', 'Attribute' => 'Others', 'Attribute Value' => 'BaseN', 'Comment' => 'Comment', 'Entity Reference' => 'Char', 'Invalid' => 'Error', 'Normal Text' => 'Normal', 'Tag' => 'Keyword', 'Variable' => 'Variable', 'XPath' => 'Others', 'XPath 2.0/ XSLT 2.0 Function' => 'Operator', 'XPath Attribute' => 'Float', 'XPath Axis' => 'DecVal', 'XPath String' => 'BaseN', 'XPath/ XSLT Function' => 'Function', 'XSLT 2.0 Tag' => 'Reserved', 'XSLT Tag' => 'Reserved', }); $self->listAdd('functions', 'boolean', 'ceiling', 'concat', 'contains', 'count', 'current', 'document', 'element-available', 'false', 'floor', 'format-number', 'function-available', 'generate-id', 'id', 'key', 'lang', 'last', 'local-name', 'name', 'namespace-uri', 'normalize-space', 'not', 'number', 'position', 'round', 'starts-with', 'string', 'string-length', 'substring', 'substring-after', 'substring-before', 'sum', 'system-property', 'text', 'translate', 'true', 'unparsed-entity-uri', ); $self->listAdd('functions_2.0', 'QName', 'abs', 'adjust-date-to-timezone', 'adjust-dateTime-to-timezone', 'adjust-time-to-timezone', 'avg', 'base-uri', 'codepoints-to-string', 'collection', 'compare', 'current-date', 'current-dateTime', 'current-group', 'current-grouping-key', 'current-time', 'data', 'dateTime', 'day-from-date', 'day-from-dateTime', 'days-from-duration', 'deep-equal', 'default-collation', 'distinct-values', 'doc', 'document-uri', 'empty', 'ends-with', 'error', 'escape-uri', 'exactly-one', 'exists', 'expanded-QName', 'format-date', 'format-dateTime', 'format-time', 'hours-from-dateTime', 'hours-from-duration', 'hours-from-time', 'idref', 'implicit-timezone', 'in-scope-prefixes', 'index-of', 'input', 'insert-before', 'local-name-from-QName', 'lower-case', 'matches', 'max', 'min', 'minutes-from-dateTime', 'minutes-from-duration', 'minutes-from-time', 'month-from-date', 'month-from-dateTime', 'months-from-duration', 'namespace-uri-for-prefix', 'namespace-uri-from-QName', 'node-kind', 'node-name', 'normalize-unicode', 'one-or-more', 'regex-group', 'remove', 'replace', 'resolve-QName', 'resolve-uri', 'reverse', 'root', 'round-half-to-even', 'seconds-from-dateTime', 'seconds-from-duration', 'seconds-from-time', 'sequence-node-identical', 'static-base-uri', 'string-join', 'string-to-codepoints', 'subsequence', 'subtract-dateTimes-yielding-dayTimeDuration', 'subtract-dateTimes-yielding-yearMonthDuration', 'subtract-dates-yielding-dayTimeDuration', 'subtract-dates-yielding-yearMonthDuration', 'timezone-from-date', 'timezone-from-dateTime', 'timezone-from-time', 'tokenize', 'trace', 'unordered', 'unparsed-entity-public-id', 'unparsed-text', 'upper-case', 'year-from-date', 'year-from-dateTime', 'years-from-duration', 'zero-or-one', ); $self->listAdd('keytags', 'xsl:apply-imports', 'xsl:apply-templates', 'xsl:attribute', 'xsl:attribute-set', 'xsl:call-template', 'xsl:choose', 'xsl:comment', 'xsl:copy', 'xsl:copy-of', 'xsl:decimal-format', 'xsl:element', 'xsl:fallback', 'xsl:for-each', 'xsl:if', 'xsl:import', 'xsl:include', 'xsl:key', 'xsl:message', 'xsl:namespace-alias', 'xsl:number', 'xsl:otherwise', 'xsl:output', 'xsl:param', 'xsl:preserve-space', 'xsl:processing-instruction', 'xsl:sort', 'xsl:strip-space', 'xsl:stylesheet', 'xsl:template', 'xsl:text', 'xsl:transform', 'xsl:value-of', 'xsl:variable', 'xsl:when', 'xsl:with-param', ); $self->listAdd('keytags_2.0', 'xsl:analyze-string', 'xsl:character-map', 'xsl:document', 'xsl:for-each-group', 'xsl:function', 'xsl:import-schema', 'xsl:matching-substring', 'xsl:namespace', 'xsl:next-match', 'xsl:non-matching-substring', 'xsl:output-character', 'xsl:perform-sort', 'xsl:result-document', 'xsl:sequence', ); $self->contextdata({ 'attrValue' => { callback => \&parseattrValue, attribute => 'Invalid', }, 'attributes' => { callback => \&parseattributes, attribute => 'Attribute', }, 'comment' => { callback => \&parsecomment, attribute => 'Comment', }, 'detectEntRef' => { callback => \&parsedetectEntRef, attribute => 'Normal Text', }, 'normalText' => { callback => \&parsenormalText, attribute => 'Normal Text', }, 'sqstring' => { callback => \&parsesqstring, attribute => 'Attribute Value', }, 'sqxpath' => { callback => \&parsesqxpath, attribute => 'XPath', }, 'sqxpathstring' => { callback => \&parsesqxpathstring, attribute => 'XPath String', }, 'string' => { callback => \&parsestring, attribute => 'Attribute Value', }, 'tagname' => { callback => \&parsetagname, attribute => 'Tag', }, 'xattrValue' => { callback => \&parsexattrValue, attribute => 'Invalid', }, 'xattributes' => { callback => \&parsexattributes, attribute => 'Attribute', }, 'xpath' => { callback => \&parsexpath, attribute => 'XPath', }, 'xpathstring' => { callback => \&parsexpathstring, attribute => 'XPath String', }, }); $self->deliminators('\\s||\\.|\\(|\\)|\\!|\\+|,|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|-|:'); $self->basecontext('normalText'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'xslt'; } sub parseattrValue { my ($self, $text) = @_; # attribute => 'Invalid' # char => '/' # char1 => '>' # context => '#pop#pop#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '>', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Invalid')) { return 1 } # attribute => 'Invalid' # char => '>' # context => '#pop#pop#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Invalid')) { return 1 } # attribute => 'Attribute Value' # char => '"' # context => 'string' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'Attribute Value')) { return 1 } # attribute => 'Attribute Value' # char => ''' # context => 'sqstring' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'sqstring', 'Attribute Value')) { return 1 } return 0; }; sub parseattributes { my ($self, $text) = @_; # attribute => 'Tag' # char => '/' # char1 => '>' # context => '#pop#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '>', 0, 0, 0, undef, 0, '#pop#pop', 'Tag')) { return 1 } # attribute => 'Tag' # char => '>' # context => '#pop#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop#pop', 'Tag')) { return 1 } # String => '\s*=\s*' # attribute => 'Normal Text' # context => 'attrValue' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*=\\s*', 0, 0, 0, undef, 0, 'attrValue', 'Normal Text')) { return 1 } return 0; }; sub parsecomment { my ($self, $text) = @_; # String => '-->' # attribute => 'Comment' # context => '#pop' # endRegion => 'comment' # type => 'StringDetect' if ($self->testStringDetect($text, '-->', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } # String => '-(-(?!->))+' # attribute => 'Invalid' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '-(-(?!->))+', 0, 0, 0, undef, 0, '#stay', 'Invalid')) { return 1 } # String => '(FIXME|TODO|HACK)' # attribute => 'Alert' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(FIXME|TODO|HACK)', 0, 0, 0, undef, 0, '#stay', 'Alert')) { return 1 } return 0; }; sub parsedetectEntRef { my ($self, $text) = @_; # String => '&(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z_:][\w.:_-]*);' # attribute => 'Entity Reference' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '&(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z_:][\\w.:_-]*);', 0, 0, 0, undef, 0, '#stay', 'Entity Reference')) { return 1 } return 0; }; sub parsenormalText { my ($self, $text) = @_; # String => '' # attribute => 'Operator' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '-->', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '!;' # attribute => 'Operator' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '!;', 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # attribute => 'Operator' # char => '-' # char1 => '>' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '-', '>', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # attribute => 'Operator' # char => '\' # char1 => '+' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '+', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '?@' # attribute => 'Operator' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '?@', 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # attribute => 'Normal' # char => ':' # char1 => '-' # context => '#stay' # firstNonSpace => 'false' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, ':', '-', 0, 0, 0, undef, 0, '#stay', 'Normal')) { return 1 } # String => '\b[a-z]\w*' # attribute => 'Normal' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b[a-z]\\w*', 0, 0, 0, undef, 0, '#stay', 'Normal')) { return 1 } return 0; }; sub parsesinglelinecomment { my ($self, $text) = @_; return 0; }; sub parsestring { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Logtalk - a Plugin for Logtalk syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Logtalk; my $sh = new Syntax::Highlight::Engine::Kate::Logtalk([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Logtalk is a plugin module that provides syntax highlighting for Logtalk to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Pike.pm0000644000175000017500000003043213226470762025547 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'pike.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.07 #kate version 2.4 #kate author Paul Pogonyshev #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::Pike; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Binary' => 'BaseN', 'Builtin Function' => 'Function', 'Char' => 'Char', 'Comment' => 'Comment', 'Data Type' => 'DataType', 'Decimal' => 'DecVal', 'Float' => 'Float', 'Hex' => 'BaseN', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Note' => 'Alert', 'Octal' => 'BaseN', 'Preprocessor' => 'Others', 'Preprocessor Lib' => 'String', 'String' => 'String', 'String Char' => 'Char', }); $self->listAdd('builtins', 'catch', 'gauge', 'sscanf', 'typeof', ); $self->listAdd('keywords', 'break', 'case', 'class', 'continue', 'default', 'do', 'else', 'for', 'foreach', 'if', 'return', 'switch', 'while', ); $self->listAdd('types', 'array', 'float', 'function', 'int', 'mapping', 'mixed', 'multiset>', 'object', 'program', 'static', 'string', 'void', ); $self->contextdata({ 'Block Comment' => { callback => \&parseBlockComment, attribute => 'Comment', }, 'Line Comment' => { callback => \&parseLineComment, attribute => 'Comment', lineending => '#pop', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'Outscoped' => { callback => \&parseOutscoped, attribute => 'Comment', }, 'Outscoped intern' => { callback => \&parseOutscopedintern, attribute => 'Comment', }, 'Preprocessor' => { callback => \&parsePreprocessor, attribute => 'Preprocessor', lineending => '#pop', }, 'String' => { callback => \&parseString, attribute => 'String', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Pike'; } sub parseBlockComment { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # endRegion => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } # String => '(FIXME|TODO|NOT(IC)?E):?' # attribute => 'Note' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(FIXME|TODO|NOT(IC)?E):?', 0, 0, 0, undef, 0, '#stay', 'Note')) { return 1 } return 0; }; sub parseLineComment { my ($self, $text) = @_; # String => '(FIXME|TODO|NOT(IC)?E):?' # attribute => 'Note' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(FIXME|TODO|NOT(IC)?E):?', 0, 0, 0, undef, 0, '#stay', 'Note')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'types' # attribute => 'Data Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => 'builtins' # attribute => 'Builtin Function' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'builtins', 0, undef, 0, '#stay', 'Builtin Function')) { return 1 } # String => '`([\+\-\*/%~&\|^]|[!=<>]=|<>?|(\[\]|->)=?)' # attribute => 'Builtin Function' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '`([\\+\\-\\*/%~&\\|^]|[!=<>]=|<>?|(\\[\\]|->)=?)', 0, 0, 0, undef, 0, '#stay', 'Builtin Function')) { return 1 } # attribute => 'Float' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { return 1 } # String => '0[bB][01]+' # attribute => 'Binary' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '0[bB][01]+', 0, 0, 0, undef, 0, '#stay', 'Binary')) { return 1 } # attribute => 'Octal' # context => '#stay' # type => 'HlCOct' if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) { return 1 } # attribute => 'Hex' # context => '#stay' # type => 'HlCHex' if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) { return 1 } # attribute => 'Decimal' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # attribute => 'Char' # context => '#stay' # type => 'HlCChar' if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'Normal Text' # beginRegion => 'Brace' # char => '{' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Normal Text' # char => '}' # context => '#stay' # endRegion => 'Brace' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Line Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Line Comment', 'Comment')) { return 1 } # attribute => 'Comment' # char => '#' # char1 => '!' # context => 'Line Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '#', '!', 0, 0, 0, undef, 0, 'Line Comment', 'Comment')) { return 1 } # attribute => 'Comment' # beginRegion => 'Comment' # char => '/' # char1 => '*' # context => 'Block Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Block Comment', 'Comment')) { return 1 } # String => '#\s*if\s+0' # attribute => 'Preprocessor' # beginRegion => 'Outscoped' # context => 'Outscoped' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*if\\s+0', 0, 0, 0, undef, 1, 'Outscoped', 'Preprocessor')) { return 1 } # attribute => 'Preprocessor' # char => '#' # context => 'Preprocessor' # firstNonSpace => 'true' # type => 'DetectChar' if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 1, 'Preprocessor', 'Preprocessor')) { return 1 } return 0; }; sub parseOutscoped { my ($self, $text) = @_; # String => '(FIXME|TODO|NOT(IC)?E):?' # attribute => 'Note' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(FIXME|TODO|NOT(IC)?E):?', 0, 0, 0, undef, 0, '#stay', 'Note')) { return 1 } # attribute => 'Comment' # beginRegion => 'Comment' # char => '/' # char1 => '*' # context => 'Block Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Block Comment', 'Comment')) { return 1 } # String => '#\s*if' # attribute => 'Comment' # beginRegion => 'Outscoped' # context => 'Outscoped intern' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*if', 0, 0, 0, undef, 1, 'Outscoped intern', 'Comment')) { return 1 } # String => '#\s*(endif|elif|else)' # attribute => 'Preprocessor' # context => '#pop' # endRegion => 'Outscoped' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*(endif|elif|else)', 0, 0, 0, undef, 1, '#pop', 'Preprocessor')) { return 1 } return 0; }; sub parseOutscopedintern { my ($self, $text) = @_; # attribute => 'Comment' # beginRegion => 'Comment' # char => '/' # char1 => '*' # context => 'Block Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Block Comment', 'Comment')) { return 1 } # String => '#\s*if' # attribute => 'Comment' # beginRegion => 'Outscoped' # context => 'Outscoped intern' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*if', 0, 0, 0, undef, 1, 'Outscoped intern', 'Comment')) { return 1 } # String => '#\s*endif' # attribute => 'Comment' # context => '#pop' # endRegion => 'Outscoped' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*endif', 0, 0, 0, undef, 1, '#pop', 'Comment')) { return 1 } return 0; }; sub parsePreprocessor { my ($self, $text) = @_; # attribute => 'Preprocessor Lib' # char => '"' # char1 => '"' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'Preprocessor Lib')) { return 1 } # attribute => 'Preprocessor Lib' # char => '<' # char1 => '>' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'Preprocessor Lib')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Line Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Line Comment', 'Comment')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '*' # context => 'Block Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Block Comment', 'Comment')) { return 1 } # attribute => 'Preprocessor' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Preprocessor')) { return 1 } return 0; }; sub parseString { my ($self, $text) = @_; # String => '\\d[0-9]+' # attribute => 'String Char' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\d[0-9]+', 0, 0, 0, undef, 0, '#stay', 'String Char')) { return 1 } # attribute => 'String Char' # context => '#stay' # type => 'HlCStringChar' if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } # attribute => 'String' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Pike - a Plugin for Pike syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Pike; my $sh = new Syntax::Highlight::Engine::Kate::Pike([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Pike is a plugin module that provides syntax highlighting for Pike to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Diff.pm0000644000175000017500000000744013226470762025532 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'diff.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.02 #kate version 2.4 #generated: Sun Feb 3 22:02:04 2008, localtime package Syntax::Highlight::Engine::Kate::Diff; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Added line' => 'String', 'Comment' => 'Comment', 'Data Type' => 'DataType', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Removed line' => 'Others', }); $self->contextdata({ 'Added' => { callback => \&parseAdded, attribute => 'Added line', lineending => '#pop', }, 'Data' => { callback => \&parseData, attribute => 'Data Type', lineending => '#pop', }, 'Keyword' => { callback => \&parseKeyword, attribute => 'Keyword', lineending => '#pop', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'Removed' => { callback => \&parseRemoved, attribute => 'Removed line', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Diff'; } sub parseAdded { my ($self, $text) = @_; return 0; }; sub parseData { my ($self, $text) = @_; return 0; }; sub parseKeyword { my ($self, $text) = @_; return 0; }; sub parseNormal { my ($self, $text) = @_; # String => '(\+\+\+|\-\-\-|\*\*\*|diff|\d)' # attribute => 'Keyword' # column => '0' # context => 'Keyword' # type => 'RegExpr' if ($self->testRegExpr($text, '(\\+\\+\\+|\\-\\-\\-|\\*\\*\\*|diff|\\d)', 0, 0, 0, 0, 0, 'Keyword', 'Keyword')) { return 1 } # String => '(\+|>|!)' # attribute => 'Added line' # column => '0' # context => 'Added' # type => 'RegExpr' if ($self->testRegExpr($text, '(\\+|>|!)', 0, 0, 0, 0, 0, 'Added', 'Added line')) { return 1 } # String => '-<' # attribute => 'Removed line' # column => '0' # context => 'Removed' # type => 'AnyChar' if ($self->testAnyChar($text, '-<', 0, 0, 0, 0, 'Removed', 'Removed line')) { return 1 } # attribute => 'Data Type' # char => '@' # char1 => '@' # column => '0' # context => 'Data' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '@', '@', 0, 0, 0, 0, 0, 'Data', 'Data Type')) { return 1 } return 0; }; sub parseRemoved { my ($self, $text) = @_; return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Diff - a Plugin for Diff syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Diff; my $sh = new Syntax::Highlight::Engine::Kate::Diff([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Diff is a plugin module that provides syntax highlighting for Diff to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/BaseTest.pm0000644000175000017500000000030513226470762026365 0ustar manwarmanwarpackage Syntax::Highlight::Engine::Kate::BaseTest; our $VERSION = '0.14'; use strict; use warnings; # stub, just to get indexed by PAUSE and hide old version of this file from CPAN smokers. 1; Syntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/TaskJuggler.pm0000644000175000017500000003317513226470762027110 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'taskjuggler.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.21 #kate version 2.1 #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::TaskJuggler; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Builtin Function' => 'Function', 'Char' => 'Char', 'Comment' => 'Comment', 'Data Types' => 'DataType', 'Decimal' => 'DecVal', 'Float' => 'Float', 'Hex' => 'BaseN', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Octal' => 'BaseN', 'String' => 'String', 'String Char' => 'Char', 'Symbol' => 'Normal', }); $self->listAdd('builtinfuncs', 'accountid', 'accountreport', 'accumulate', 'allocate', 'allowredefinitions', 'alternative', 'barlabels', 'booking', 'caption', 'celltext', 'cellurl', 'columns', 'complete', 'completed', 'copyright', 'cost', 'credit', 'criticalness', 'csvaccountreport', 'csvresourcereport', 'csvtaskreport', 'currency', 'currencydigits', 'currencyformat', 'dailymax', 'dailyworkinghours', 'db', 'depends', 'disabled', 'duration', 'efficiency', 'effort', 'empty', 'end', 'endbuffer', 'endbufferstart', 'endcredit', 'endsAfter', 'endsBefore', 'export', 'extend', 'finished', 'flags', 'follows', 'freeload', 'gapduration', 'gaplength', 'headline', 'hideaccount', 'hidecelltext', 'hidecellurl', 'hideresource', 'hidetask', 'hierarchindex', 'hierarchno', 'htmlaccountreport', 'htmlresourcereport', 'htmlstatusreport', 'htmltaskreport', 'htmlweeklycalendar', 'id', 'include', 'index', 'inherit', 'inprogress', 'journalentry', 'kotrusid', 'kotrusmode', 'label', 'late', 'length', 'limits', 'load', 'loadunit', 'macro', 'mandatory', 'maxeffort', 'maxend', 'maxstart', 'milestone', 'mineffort', 'minend', 'minstart', 'monthlymax', 'name', 'no', 'nokotrus', 'note', 'notimestamp', 'notstarted', 'now', 'numberformat', 'ontime', 'optimize', 'order', 'pathcriticalness', 'persistent', 'precedes', 'priority', 'profit', 'projectid', 'projectids', 'projection', 'rate', 'rawhead', 'rawstylesheet', 'rawtail', 'reference', 'resourceid', 'resourcereport', 'resources', 'responsibilities', 'responsible', 'revenue', 'rollupaccount', 'rollupresource', 'rolluptask', 'scenario', 'scenarios', 'schedule', 'scheduled', 'scheduling', 'select', 'separator', 'seqno', 'shorttimeformat', 'showprojectids', 'sortaccounts', 'sortresources', 'sorttasks', 'start', 'startbuffer', 'startbufferend', 'startcredit', 'startsAfter', 'startsBefore', 'status', 'statusnote', 'subtitle', 'subtitleurl', 'supplement', 'table', 'taskattributes', 'taskid', 'taskprefix', 'taskreport', 'taskroot', 'text', 'timeformat', 'timezone', 'timingresolution', 'title', 'titleurl', 'total', 'tree', 'treeLevel', 'url', 'utilization', 'vacation', 'version', 'weeklymax', 'weekstartsmonday', 'weekstartssunday', 'workinghours', 'xml', 'xmlreport', 'yearlyworkingdays', ); $self->listAdd('keywords', 'account', 'project', 'resource', 'scenario', 'shift', 'task', ); $self->listAdd('types', 'alap', 'all', 'asap', 'completeddown', 'completedup', 'containstask', 'criticalnessdown', 'criticalnessup', 'd', 'daily', 'day', 'days', 'enddown', 'endup', 'fri', 'fullnamedown', 'fullnameup', 'h', 'hours', 'iddown', 'idup', 'indexdown', 'indexup', 'inprogressearly', 'inprogresslate', 'isAResource', 'isATask', 'isAccount', 'isAllocated', 'isAllocatedToProject', 'isAnAccount', 'isChildOf', 'isDutyOf', 'isLeaf', 'isMilestone', 'isParentOf', 'isResource', 'isTask', 'isTaskOfProject', 'isTaskStatus', 'isactualallocated', 'isatask', 'isplanallocated', 'issubtaskof', 'kotrusiddown', 'kotrusidup', 'longauto', 'm', 'maxeffortdown', 'maxeffortup', 'maxloaded', 'min', 'minallocated', 'mineffortdown', 'mineffortup', 'minloaded', 'minutes', 'mon', 'month', 'monthly', 'months', 'namedown', 'nameup', 'off', 'pathcriticalnessdown', 'pathcriticalnessup', 'prioritydown', 'priorityup', 'quarter', 'quarterly', 'random', 'ratedown', 'rateup', 'responsibledown', 'responsibleup', 'sat', 'sequencedown', 'sequenceup', 'shortauto', 'startdown', 'startup', 'statusdown', 'statusup', 'sun', 'thu', 'tue', 'undefined', 'w', 'wed', 'week', 'weekly', 'weeks', 'y', 'year', 'yearly', 'years', ); $self->contextdata({ 'Comment1' => { callback => \&parseComment1, attribute => 'Comment', lineending => '#pop', }, 'Comment2' => { callback => \&parseComment2, attribute => 'Comment', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'String1' => { callback => \&parseString1, attribute => 'String', }, 'String2' => { callback => \&parseString2, attribute => 'String', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'TaskJuggler'; } sub parseComment1 { my ($self, $text) = @_; # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } return 0; }; sub parseComment2 { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # String => 'builtinfuncs' # attribute => 'Builtin Function' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'builtinfuncs', 0, undef, 0, '#stay', 'Builtin Function')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'types' # attribute => 'Data Types' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Types')) { return 1 } # attribute => 'Symbol' # beginRegion => 'Brace2' # char => '{' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # attribute => 'Symbol' # char => '}' # context => '#stay' # endRegion => 'Brace2' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # attribute => 'Symbol' # beginRegion => 'Brace1' # char => '[' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # attribute => 'Symbol' # char => ']' # context => '#stay' # endRegion => 'Brace1' # type => 'DetectChar' if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # attribute => 'Float' # context => '#stay' # items => 'ARRAY(0x1782620)' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { # String => 'fF' # attribute => 'Float' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, 'fF', 0, 0, undef, 0, '#stay', 'Float')) { return 1 } } # attribute => 'Decimal' # context => '#stay' # items => 'ARRAY(0x16a0c30)' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { # String => 'ULL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'ULL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LUL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LUL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LLU' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LLU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'UL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'UL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LU' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'U' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'U', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'L' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'L', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } } # attribute => 'String' # char => ''' # context => 'String1' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String1', 'String')) { return 1 } # attribute => 'String' # char => '"' # context => 'String2' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String2', 'String')) { return 1 } # attribute => 'Comment' # char => '#' # context => 'Comment1' # type => 'DetectChar' if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'Comment1', 'Comment')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '*' # context => 'Comment2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Comment2', 'Comment')) { return 1 } return 0; }; sub parseString1 { my ($self, $text) = @_; # attribute => 'String' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; sub parseString2 { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::TaskJuggler - a Plugin for TaskJuggler syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::TaskJuggler; my $sh = new Syntax::Highlight::Engine::Kate::TaskJuggler([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::TaskJuggler is a plugin module that provides syntax highlighting for TaskJuggler to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Desktop.pm0000644000175000017500000000653213226470762026274 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'desktop.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.04 #kate version 2.4 #generated: Sun Feb 3 22:02:04 2008, localtime package Syntax::Highlight::Engine::Kate::Desktop; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Comment' => 'Comment', 'Key' => 'DataType', 'Language' => 'DecVal', 'Normal Text' => 'Normal', 'Section' => 'Keyword', }); $self->contextdata({ 'Comment' => { callback => \&parseComment, attribute => 'Comment', lineending => '#pop', }, 'Normal' => { callback => \&parseNormal, attribute => 'Key', }, 'Value' => { callback => \&parseValue, attribute => 'Normal Text', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(1); $self->initialize; bless ($self, $class); return $self; } sub language { return '.desktop'; } sub parseComment { my ($self, $text) = @_; return 0; }; sub parseNormal { my ($self, $text) = @_; # String => '\[.*\]$' # attribute => 'Section' # beginRegion => 'Section' # column => '0' # context => '#stay' # endRegion => 'Section' # type => 'RegExpr' if ($self->testRegExpr($text, '\\[.*\\]$', 0, 0, 0, 0, 0, '#stay', 'Section')) { return 1 } # String => '\[.*\]' # attribute => 'Language' # context => 'Value' # type => 'RegExpr' if ($self->testRegExpr($text, '\\[.*\\]', 0, 0, 0, undef, 0, 'Value', 'Language')) { return 1 } # attribute => 'Comment' # char => '#' # context => 'Comment' # firstNonSpace => 'true' # type => 'DetectChar' if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 1, 'Comment', 'Comment')) { return 1 } # attribute => 'Normal Text' # char => '=' # context => 'Value' # type => 'DetectChar' if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, 'Value', 'Normal Text')) { return 1 } return 0; }; sub parseValue { my ($self, $text) = @_; return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Desktop - a Plugin for .desktop syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Desktop; my $sh = new Syntax::Highlight::Engine::Kate::Desktop([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Desktop is a plugin module that provides syntax highlighting for .desktop to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/KBasic.pm0000644000175000017500000001121713226470762026013 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'kbasic.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.02 #kate version 2.1 #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::KBasic; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Comment' => 'Comment', 'Identifier' => 'Others', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'String' => 'String', 'Types' => 'DataType', }); $self->listAdd('keywords', 'And', 'As', 'Close', 'Declare', 'Dim', 'Do', 'Else', 'End', 'Exit', 'Explicit', 'False', 'For', 'Function', 'Get', 'Global', 'Goto', 'If', 'Implements', 'In', 'Input', 'Let', 'Load', 'Loop', 'Next', 'Not', 'Open', 'Option', 'Or', 'Output', 'Print', 'Private', 'Property', 'Public', 'Put', 'Repeat', 'Seek', 'Set', 'Sub', 'Sub', 'Then', 'To', 'True', 'Unload', 'Until', 'Wend', 'While', 'Xor', ); $self->listAdd('types', 'Boolean', 'Byte', 'Control', 'Currency', 'Double', 'Integer', 'Long', 'Object', 'Single', 'String', 'Variant', ); $self->contextdata({ 'Comment' => { callback => \&parseComment, attribute => 'Comment', lineending => '#pop', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'String' => { callback => \&parseString, attribute => 'String', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'KBasic'; } sub parseComment { my ($self, $text) = @_; return 0; }; sub parseNormal { my ($self, $text) = @_; # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'types' # attribute => 'Identifier' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Identifier')) { return 1 } # attribute => 'String' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'String')) { return 1 } # attribute => 'Types' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Types')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # attribute => 'Comment' # char => ''' # context => 'Comment' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { return 1 } return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::KBasic - a Plugin for KBasic syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::KBasic; my $sh = new Syntax::Highlight::Engine::Kate::KBasic([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::KBasic is a plugin module that provides syntax highlighting for KBasic to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Cplusplus.pm0000644000175000017500000005041113226470762026650 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'cpp.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.37 #kate version 2.4 #generated: Sun Feb 3 22:02:04 2008, localtime package Syntax::Highlight::Engine::Kate::Cplusplus; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Char' => 'Char', 'Comment' => 'Comment', 'Data Type' => 'DataType', 'Decimal' => 'DecVal', 'Extensions' => 'Keyword', 'Float' => 'Float', 'Hex' => 'BaseN', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Octal' => 'BaseN', 'Prep. Lib' => 'Others', 'Preprocessor' => 'Others', 'Region Marker' => 'RegionMarker', 'String' => 'String', 'String Char' => 'Char', 'Symbol' => 'Normal', }); $self->listAdd('extensions', 'FALSE', 'K_DCOP', 'Q_ARG', 'Q_ASSERT', 'Q_ASSERT_X', 'Q_CLASSINFO', 'Q_CLEANUP_RESOURCE', 'Q_D', 'Q_DECLARE_FLAGS', 'Q_DECLARE_FLAGS', 'Q_DECLARE_INTERFACE', 'Q_DECLARE_OPERATORS_FOR_FLAGS', 'Q_DECLARE_PRIVATE', 'Q_DECLARE_PUBLIC', 'Q_DECLARE_SHARED', 'Q_DECLARE_TYPEINFO', 'Q_DISABLE_COPY', 'Q_ENUMS', 'Q_EXPORT', 'Q_FLAGS', 'Q_FOREACH', 'Q_FOREVER', 'Q_GADGET', 'Q_GLOBAL_STATIC', 'Q_GLOBAL_STATIC_WITH_ARGS', 'Q_INIT_RESOURCE', 'Q_INTERFACES', 'Q_INVOKABLE', 'Q_OBJECT', 'Q_OVERRIDE', 'Q_PROPERTY', 'Q_Q', 'Q_RETURN_ARG', 'Q_SCRIPTABLE', 'Q_SETS', 'Q_SIGNALS', 'Q_SLOTS', 'SIGNAL', 'SLOT', 'TRUE', 'connect', 'disconnect', 'emit', 'foreach', 'forever', 'signals', 'slots', ); $self->listAdd('keywords', 'and', 'and_eq', 'asm', 'bad_cast', 'bad_typeid', 'bitand', 'bitor', 'break', 'case', 'catch', 'class', 'compl', 'const_cast', 'continue', 'default', 'delete', 'do', 'dynamic_cast', 'else', 'enum', 'except', 'explicit', 'export', 'extern', 'false', 'finally', 'for', 'friend', 'goto', 'if', 'inline', 'namespace', 'new', 'not', 'not_eq', 'operator', 'or', 'or_eq', 'private', 'protected', 'public', 'qobject_cast', 'reinterpret_cast', 'return', 'sizeof', 'static_cast', 'struct', 'switch', 'template', 'this', 'throw', 'true', 'try', 'type_info', 'typedef', 'typeid', 'typename', 'union', 'using', 'virtual', 'while', 'xalloc', 'xor', 'xor_eq', ); $self->listAdd('types', 'auto', 'bool', 'char', 'const', 'double', 'float', 'int', 'int16_t', 'int32_t', 'int64_t', 'int8_t', 'long', 'mutable', 'register', 'short', 'signed', 'static', 'uchar', 'uint', 'uint16_t', 'uint32_t', 'uint64_t', 'uint8_t', 'unsigned', 'void', 'volatile', 'wchar_t', ); $self->contextdata({ 'Commentar 1' => { callback => \&parseCommentar1, attribute => 'Comment', lineending => '#pop', }, 'Commentar 2' => { callback => \&parseCommentar2, attribute => 'Comment', }, 'Commentar/Preprocessor' => { callback => \&parseCommentarPreprocessor, attribute => 'Comment', }, 'Define' => { callback => \&parseDefine, attribute => 'Preprocessor', lineending => '#pop', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'Outscoped' => { callback => \&parseOutscoped, attribute => 'Comment', }, 'Outscoped intern' => { callback => \&parseOutscopedintern, attribute => 'Comment', }, 'Preprocessor' => { callback => \&parsePreprocessor, attribute => 'Preprocessor', lineending => '#pop', }, 'Region Marker' => { callback => \&parseRegionMarker, attribute => 'Region Marker', lineending => '#pop', }, 'String' => { callback => \&parseString, attribute => 'String', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'C++'; } sub parseCommentar1 { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } return 0; }; sub parseCommentar2 { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # endRegion => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } return 0; }; sub parseCommentarPreprocessor { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } return 0; }; sub parseDefine { my ($self, $text) = @_; # attribute => 'Preprocessor' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Preprocessor')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # String => '#\s*if\s+0' # attribute => 'Preprocessor' # beginRegion => 'Outscoped' # context => 'Outscoped' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*if\\s+0', 0, 0, 0, undef, 1, 'Outscoped', 'Preprocessor')) { return 1 } # attribute => 'Preprocessor' # char => '#' # context => 'Preprocessor' # firstNonSpace => 'true' # type => 'DetectChar' if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 1, 'Preprocessor', 'Preprocessor')) { return 1 } # String => '//BEGIN' # attribute => 'Region Marker' # beginRegion => 'Region1' # context => 'Region Marker' # firstNonSpace => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, '//BEGIN', 0, 0, 0, undef, 1, 'Region Marker', 'Region Marker')) { return 1 } # String => '//END' # attribute => 'Region Marker' # context => 'Region Marker' # endRegion => 'Region1' # firstNonSpace => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, '//END', 0, 0, 0, undef, 1, 'Region Marker', 'Region Marker')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'extensions' # attribute => 'Extensions' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'extensions', 0, undef, 0, '#stay', 'Extensions')) { return 1 } # String => 'types' # attribute => 'Data Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) { return 1 } # attribute => 'Char' # context => '#stay' # type => 'HlCChar' if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'Float' # context => '#stay' # items => 'ARRAY(0x1255cd0)' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { # String => 'fF' # attribute => 'Float' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, 'fF', 0, 0, undef, 0, '#stay', 'Float')) { return 1 } } # attribute => 'Octal' # context => '#stay' # type => 'HlCOct' if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) { return 1 } # attribute => 'Hex' # context => '#stay' # type => 'HlCHex' if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) { return 1 } # attribute => 'Decimal' # context => '#stay' # items => 'ARRAY(0x132c920)' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { # String => 'ULL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'ULL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LUL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LUL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LLU' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LLU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'UL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'UL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LU' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'U' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'U', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'L' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'L', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } } # context => '##Doxygen' # type => 'IncludeRules' if ($self->includePlugin('Doxygen', $text)) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Commentar 1' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) { return 1 } # attribute => 'Comment' # beginRegion => 'Comment' # char => '/' # char1 => '*' # context => 'Commentar 2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) { return 1 } # attribute => 'Symbol' # beginRegion => 'Brace1' # char => '{' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # attribute => 'Symbol' # char => '}' # context => '#stay' # endRegion => 'Brace1' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # String => ':!%&()+,-/.*<=>?[]{|}~^;' # attribute => 'Symbol' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, ':!%&()+,-/.*<=>?[]{|}~^;', 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } return 0; }; sub parseOutscoped { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # context => '##Doxygen' # type => 'IncludeRules' if ($self->includePlugin('Doxygen', $text)) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Commentar 1' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) { return 1 } # attribute => 'Comment' # beginRegion => 'Comment' # char => '/' # char1 => '*' # context => 'Commentar 2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) { return 1 } # String => '#\s*if' # attribute => 'Comment' # beginRegion => 'Outscoped' # context => 'Outscoped intern' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*if', 0, 0, 0, undef, 1, 'Outscoped intern', 'Comment')) { return 1 } # String => '#\s*(endif|else|elif)' # attribute => 'Preprocessor' # context => '#pop' # endRegion => 'Outscoped' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*(endif|else|elif)', 0, 0, 0, undef, 1, '#pop', 'Preprocessor')) { return 1 } return 0; }; sub parseOutscopedintern { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # context => '##Doxygen' # type => 'IncludeRules' if ($self->includePlugin('Doxygen', $text)) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Commentar 1' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) { return 1 } # attribute => 'Comment' # beginRegion => 'Comment' # char => '/' # char1 => '*' # context => 'Commentar 2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) { return 1 } # String => '#\s*if' # attribute => 'Comment' # beginRegion => 'Outscoped' # context => 'Outscoped intern' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*if', 0, 0, 0, undef, 1, 'Outscoped intern', 'Comment')) { return 1 } # String => '#\s*endif' # attribute => 'Comment' # context => '#pop' # endRegion => 'Outscoped' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*endif', 0, 0, 0, undef, 1, '#pop', 'Comment')) { return 1 } return 0; }; sub parsePreprocessor { my ($self, $text) = @_; # attribute => 'Preprocessor' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Preprocessor')) { return 1 } # String => 'define.*((?=\\))' # attribute => 'Preprocessor' # context => 'Define' # type => 'RegExpr' if ($self->testRegExpr($text, 'define.*((?=\\\\))', 0, 0, 0, undef, 0, 'Define', 'Preprocessor')) { return 1 } # String => 'define.*' # attribute => 'Preprocessor' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, 'define.*', 0, 0, 0, undef, 0, '#stay', 'Preprocessor')) { return 1 } # attribute => 'Prep. Lib' # char => '"' # char1 => '"' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'Prep. Lib')) { return 1 } # attribute => 'Prep. Lib' # char => '<' # char1 => '>' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'Prep. Lib')) { return 1 } # context => '##Doxygen' # type => 'IncludeRules' if ($self->includePlugin('Doxygen', $text)) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Commentar 1' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '*' # context => 'Commentar/Preprocessor' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar/Preprocessor', 'Comment')) { return 1 } return 0; }; sub parseRegionMarker { my ($self, $text) = @_; return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) { return 1 } # attribute => 'String Char' # context => '#stay' # type => 'HlCStringChar' if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Cplusplus - a Plugin for C++ syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Cplusplus; my $sh = new Syntax::Highlight::Engine::Kate::Cplusplus([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Cplusplus is a plugin module that provides syntax highlighting for C++ to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/M3U.pm0000644000175000017500000000640413226470762025265 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'm3u.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.10 #kate author Jan Janssen (medhefgo@web.de) #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::M3U; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Comment' => 'Comment', 'Descr' => 'String', 'EXTINF' => 'Others', 'Lenght' => 'DecVal', 'M3USpec' => 'Keyword', 'Normal Text' => 'Normal', }); $self->contextdata({ 'FindEXTINF' => { callback => \&parseFindEXTINF, attribute => 'Normal Text', }, 'M3U' => { callback => \&parseM3U, attribute => 'Normal Text', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('M3U'); $self->keywordscase(1); $self->initialize; bless ($self, $class); return $self; } sub language { return 'M3U'; } sub parseFindEXTINF { my ($self, $text) = @_; # String => ':\d+' # attribute => 'Lenght' # type => 'RegExpr' if ($self->testRegExpr($text, ':\\d+', 0, 0, 0, undef, 0, '#stay', 'Lenght')) { return 1 } # String => ',.*$' # attribute => 'Descr' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, ',.*$', 0, 0, 0, undef, 0, '#pop', 'Descr')) { return 1 } return 0; }; sub parseM3U { my ($self, $text) = @_; # String => '#EXTM3U' # attribute => 'M3USpec' # column => '0' # context => '#pop' # type => 'StringDetect' if ($self->testStringDetect($text, '#EXTM3U', 0, 0, 0, 0, 0, '#pop', 'M3USpec')) { return 1 } # String => '#EXTINF' # attribute => 'EXTINF' # column => '0' # context => 'FindEXTINF' # type => 'StringDetect' if ($self->testStringDetect($text, '#EXTINF', 0, 0, 0, 0, 0, 'FindEXTINF', 'EXTINF')) { return 1 } # String => '#.*$' # attribute => 'Comment' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 1, '#stay', 'Comment')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::M3U - a Plugin for M3U syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::M3U; my $sh = new Syntax::Highlight::Engine::Kate::M3U([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::M3U is a plugin module that provides syntax highlighting for M3U to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/MABminusDB.pm0000644000175000017500000001027513226470762026543 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'mab.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.03 #kate version 2.4 #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::MABminusDB; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Comment' => 'Comment', 'Database Header' => 'Operator', 'Header Medium' => 'Reserved', 'Header Piece' => 'Keyword', 'Mab Comment Description' => 'Others', 'Mab Comment Type' => 'Alert', 'Mab I Field' => 'DecVal', 'Mab M Field' => 'Float', 'Normal Text' => 'Normal', }); $self->contextdata({ 'Section' => { callback => \&parseSection, attribute => 'Normal Text', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Section'); $self->keywordscase(1); $self->initialize; bless ($self, $class); return $self; } sub language { return 'MAB-DB'; } sub parseSection { my ($self, $text) = @_; # String => '\*I [a-zA-Z0-9]* ' # attribute => 'Mab I Field' # column => '0' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\*I [a-zA-Z0-9]* ', 0, 0, 0, 0, 0, '#stay', 'Mab I Field')) { return 1 } # String => '\*\*\*\**E.*' # attribute => 'Header Piece' # column => '0' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\*\\*\\*\\**E.*', 0, 0, 0, 0, 0, '#stay', 'Header Piece')) { return 1 } # String => '\*\*\*\**M.*' # attribute => 'Header Medium' # column => '0' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\*\\*\\*\\**M.*', 0, 0, 0, 0, 0, '#stay', 'Header Medium')) { return 1 } # String => '\*\*\*\* BIBLIOTHECA.*' # attribute => 'Database Header' # column => '0' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\*\\*\\*\\* BIBLIOTHECA.*', 0, 0, 0, 0, 0, '#stay', 'Database Header')) { return 1 } # String => '\*M [a-zA-Z0-9]* ' # attribute => 'Mab M Field' # column => '0' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\*M [a-zA-Z0-9]* ', 0, 0, 0, 0, 0, '#stay', 'Mab M Field')) { return 1 } # String => '\*X TYP .*' # attribute => 'Mab Comment Description' # column => '0' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\*X TYP .*', 0, 0, 0, 0, 0, '#stay', 'Mab Comment Description')) { return 1 } # String => '\*X DESC .*' # attribute => 'Mab Comment Type' # column => '0' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\*X DESC .*', 0, 0, 0, 0, 0, '#stay', 'Mab Comment Type')) { return 1 } # String => '\*X .*' # attribute => 'Comment' # column => '0' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\*X .*', 0, 0, 0, 0, 0, '#stay', 'Comment')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::MABminusDB - a Plugin for MAB-DB syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::MABminusDB; my $sh = new Syntax::Highlight::Engine::Kate::MABminusDB([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::MABminusDB is a plugin module that provides syntax highlighting for MAB-DB to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/LDIF.pm0000644000175000017500000003264013226470762025400 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'ldif.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.02 #kate version 2.4 #kate author Andreas Hochsteger (e9625392@student.tuwien.ac.at) #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::LDIF; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'AttributeType' => 'DataType', 'Comment' => 'Comment', 'Description Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'ObjectClass' => 'Reserved', 'Value (Encoded)' => 'BString', 'Value (Encrypted)' => 'BaseN', 'Value (Keyword)' => 'Float', 'Value (Standard)' => 'String', 'Value (URL)' => 'Others', }); $self->listAdd('attributetypes', 'IPPhone', 'URL', 'aRecord', 'aliasedEntryName', 'aliasedObjectName', 'associatedDomain', 'associatedName', 'audio', 'authorityRevocationList', 'bootFile', 'bootParameter', 'buildingName', 'businessCategory', 'c', 'cACertificate', 'cNAMERecord', 'certificateRevocationList', 'cn', 'comment', 'commonName', 'conferenceInformation', 'corbaContainer', 'corbaRepositoryId', 'countryName', 'crossCertificatePair', 'custom1', 'custom2', 'custom3', 'custom4', 'dITRedirect', 'dSAQuality', 'dc', 'deltaRevocationList', 'description', 'destinationIndicator', 'distinguishedName', 'dmdName', 'dnQualifier', 'documentAuthor', 'documentIdentifier', 'documentLocation', 'documentPublisher', 'documentTitle', 'documentVersion', 'domainComponent', 'enhancedSearchGuide', 'facsimileTelephoneNumber', 'fax', 'gecos', 'generationQualifier', 'gidNumber', 'givenName', 'gn', 'homeDirectory', 'homePostalAddress', 'homeUrl', 'host', 'houseIdentifier', 'info', 'initials', 'internationaliSDNNumber', 'ipHostNumber', 'ipNetmaskNumber', 'ipNetworkNumber', 'ipProtocolNumber', 'ipServicePort', 'ipServiceProtocol', 'janetMailbox', 'javaClassNames', 'javaCodebase', 'javaContainer', 'javaDoc', 'javaFactory', 'javaReferenceAddress', 'javaSerializedData', 'knowledgeInformation', 'l', 'labeledURI', 'lastModifiedBy', 'lastModifiedTime', 'lmpassword', 'localityName', 'loginShell', 'mDRecord', 'mXRecord', 'macAddress', 'mail', 'manager', 'member', 'memberNisNetgroup', 'memberUid', 'mozillaHomeCountryName', 'mozillaHomeFriendlyCountryName', 'mozillaHomeLocalityName', 'mozillaHomePostalAddress2', 'mozillaHomePostalCode', 'mozillaHomeState', 'mozillaPostalAddress2', 'mozillaSecondemail', 'nSRecord', 'name', 'nisMapEntry', 'nisMapName', 'nisNetgroupTriple', 'ntpasswd', 'o', 'objectClass', 'oncRpcNumber', 'organizationName', 'organizationalStatus', 'organizationalUnitName', 'otherFacsimiletelephoneNumber', 'otherMailbox', 'ou', 'owner', 'personalSignature', 'personalTitle', 'photo', 'physicalDeliveryOfficeName', 'postOfficeBox', 'postalAddress', 'postalCode', 'preferredDeliveryMethod', 'presentationAddress', 'protocolInformation', 'rdn', 'registeredAddress', 'reports', 'rfc822Mailbox', 'roleOccupant', 'roomNumber', 'sOARecord', 'searchGuide', 'secretary', 'seeAlso', 'serialNumber', 'shadowExpire', 'shadowFlag', 'shadowInactive', 'shadowLastChange', 'shadowMax', 'shadowMin', 'shadowWarning', 'singleLevelQuality', 'sn', 'st', 'stateOrProvinceName', 'street', 'streetAddress', 'subtreeMaximumQuality', 'subtreeMinimumQuality', 'supportedAlgorithms', 'supportedApplicationContext', 'surname', 'telephoneNumber', 'teletexTerminalIdentifier', 'telexNumber', 'textEncodedORAddress', 'title', 'uid', 'uidNumber', 'uniqueIdentifier', 'uniqueMember', 'userCertificate', 'userClass', 'userPassword', 'userid', 'workUrl', 'x121Address', 'x500UniqueIdentifier', 'xmozillaNickname', 'xmozillaUseHtmlMail', 'xmozillanickname', 'xmozillausehtmlmail', ); $self->listAdd('objectclasses', 'RFC822localPart', 'SUP', 'account', 'alias', 'applicationEntity', 'applicationProcess', 'bootableDevice', 'cRLDistributionPoint', 'certificationAuthority', 'certificationAuthority-V2', 'corbaObject', 'corbaObjectReference', 'country', 'dNSDomain', 'dSA', 'dcObject', 'deltaCRL', 'device', 'dmd', 'document', 'documentSeries', 'domain', 'domainRelatedObject', 'friendlyCountry', 'groupOfNames', 'groupOfUniqueNames', 'ieee802Device', 'inetOrgPerson', 'ipHost', 'ipNetwork', 'ipProtocol', 'ipService', 'javaClassName', 'javaMarshalledObject', 'javaNamingReference', 'javaObject', 'javaSerializedObject', 'labeledURIObject', 'locality', 'mozillaAbPersonObsolete', 'nisMap', 'nisNetgroup', 'nisObject', 'officePerson', 'oncRpc', 'organization', 'organizationalPerson', 'organizationalRole', 'organizationalUnit', 'pager', 'pagerTelephoneNumber', 'person', 'pilotDSA', 'pilotObject', 'pilotOrganization', 'pkiCA', 'pkiUser', 'posixAccount', 'posixGroup', 'qualityLabelledData', 'residentialPerson', 'rid', 'room', 'sambaAccount', 'shadowAccount', 'simpleSecurityObject', 'strongAuthenticationUser', 'telephoneNumber', 'top', 'uid', 'uidNumber', 'uidObject', 'userSecurityInformation', 'userid', 'xmozillaanyphone', 'zillaPerson', ); $self->contextdata({ 'ctxEncoded' => { callback => \&parsectxEncoded, attribute => 'Value (Encoded)', }, 'ctxEncrypted' => { callback => \&parsectxEncrypted, attribute => 'Value (Encrypted)', }, 'ctxStandard' => { callback => \&parsectxStandard, attribute => 'Value (Standard)', }, 'ctxStart' => { callback => \&parsectxStart, attribute => 'Value (Standard)', }, 'ctxURL' => { callback => \&parsectxURL, attribute => 'Value (URL)', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('ctxStart'); $self->keywordscase(1); $self->initialize; bless ($self, $class); return $self; } sub language { return 'LDIF'; } sub parsectxEncoded { my ($self, $text) = @_; # String => '#.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # String => '\s.*$' # attribute => 'Value (Encoded)' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s.*$', 0, 0, 0, undef, 0, '#stay', 'Value (Encoded)')) { return 1 } # String => '[\w\-]+((;[\w\-]+)+)?:' # attribute => 'Description Keyword' # column => '0' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\w\\-]+((;[\\w\\-]+)+)?:', 0, 0, 0, 0, 0, '#pop', 'Description Keyword')) { return 1 } return 0; }; sub parsectxEncrypted { my ($self, $text) = @_; # String => '#.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # String => '\s.*$' # attribute => 'Value (Encrypted)' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s.*$', 0, 0, 0, undef, 0, '#stay', 'Value (Encrypted)')) { return 1 } # String => '[\w\-]+((;[\w\-]+)+)?:' # attribute => 'Description Keyword' # column => '0' # context => '#pop#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\w\\-]+((;[\\w\\-]+)+)?:', 0, 0, 0, 0, 0, '#pop#pop', 'Description Keyword')) { return 1 } return 0; }; sub parsectxStandard { my ($self, $text) = @_; # String => '#.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # String => '\{\w+\}.*$' # attribute => 'Value (Encrypted)' # context => 'ctxEncrypted' # type => 'RegExpr' if ($self->testRegExpr($text, '\\{\\w+\\}.*$', 0, 0, 0, undef, 0, 'ctxEncrypted', 'Value (Encrypted)')) { return 1 } # String => 'attributetypes' # attribute => 'AttributeType' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'attributetypes', 0, undef, 0, '#stay', 'AttributeType')) { return 1 } # String => 'objectclasses' # attribute => 'ObjectClass' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'objectclasses', 0, undef, 0, '#stay', 'ObjectClass')) { return 1 } # String => '[\w\-]+((;[\w\-]+)+)?:' # attribute => 'Description Keyword' # column => '0' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\w\\-]+((;[\\w\\-]+)+)?:', 0, 0, 0, 0, 0, '#pop', 'Description Keyword')) { return 1 } # String => '[a-zA-Z0-9\-]+=' # attribute => 'Value (Keyword)' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[a-zA-Z0-9\\-]+=', 0, 0, 0, undef, 0, '#stay', 'Value (Keyword)')) { return 1 } return 0; }; sub parsectxStart { my ($self, $text) = @_; # String => '#.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # attribute => 'Description Keyword' # char => ':' # context => 'ctxEncoded' # type => 'DetectChar' if ($self->testDetectChar($text, ':', 0, 0, 0, undef, 0, 'ctxEncoded', 'Description Keyword')) { return 1 } # attribute => 'Description Keyword' # char => '<' # context => 'ctxURL' # type => 'DetectChar' if ($self->testDetectChar($text, '<', 0, 0, 0, undef, 0, 'ctxURL', 'Description Keyword')) { return 1 } # String => '[^:<]' # attribute => 'Value (Standard)' # context => 'ctxStandard' # type => 'RegExpr' if ($self->testRegExpr($text, '[^:<]', 0, 0, 0, undef, 0, 'ctxStandard', 'Value (Standard)')) { return 1 } # String => '[\w\-]+((;[\w\-]+)+)?:' # attribute => 'Description Keyword' # column => '0' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\w\\-]+((;[\\w\\-]+)+)?:', 0, 0, 0, 0, 0, '#stay', 'Description Keyword')) { return 1 } return 0; }; sub parsectxURL { my ($self, $text) = @_; # String => '#.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # String => '\s+[\w]+://[\w/.]+' # attribute => 'Value (URL)' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s+[\\w]+://[\\w/.]+', 0, 0, 0, undef, 0, '#stay', 'Value (URL)')) { return 1 } # String => '\s.*$' # attribute => 'Value (URL)' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s.*$', 0, 0, 0, undef, 0, '#stay', 'Value (URL)')) { return 1 } # String => '[\w\-]+((;[\w\-]+)+)?:' # attribute => 'Description Keyword' # column => '0' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\w\\-]+((;[\\w\\-]+)+)?:', 0, 0, 0, 0, 0, '#pop', 'Description Keyword')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::LDIF - a Plugin for LDIF syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::LDIF; my $sh = new Syntax::Highlight::Engine::Kate::LDIF([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::LDIF is a plugin module that provides syntax highlighting for LDIF to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Fortran.pm0000644000175000017500000007371613226470762026306 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'fortran.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.11 #kate version 2.4 #kate author Franchin Matteo (fnch@libero.it) #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::Fortran; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Comment' => 'Comment', 'Data Type' => 'DataType', 'Decimal' => 'DecVal', 'Elemental Procedure' => 'BString', 'Float' => 'Float', 'IO Function' => 'Function', 'Inquiry Function' => 'Function', 'Keyword' => 'Keyword', 'Logical' => 'Reserved', 'Non elemental subroutine' => 'Keyword', 'Normal Text' => 'Normal', 'Operator' => 'Operator', 'Preprocessor' => 'Others', 'String' => 'String', 'Symbol' => 'Normal', 'Transformational Function' => 'Variable', }); $self->listAdd('elemental_procs', 'abs', 'achar', 'acos', 'adjustl', 'adjustr', 'aimag', 'aint', 'alog', 'alog10', 'amax0', 'amax1', 'amin0', 'amin1', 'amod', 'anint', 'aprime', 'asin', 'atan', 'atan2', 'btest', 'cabs', 'ccos', 'ceiling', 'cexp', 'char', 'clog', 'cmplx', 'conjg', 'cos', 'cosh', 'csin', 'csqrt', 'dabs', 'dacos', 'dasin', 'datan', 'datan2', 'dble', 'dcmplx', 'dconjg', 'dcos', 'dcosh', 'ddim', 'ddmim', 'dexp', 'dfloat', 'dim', 'dimag', 'dint', 'dlog', 'dlog10', 'dmax1', 'dmin1', 'dmod', 'dnint', 'dprod', 'dreal', 'dsign', 'dsin', 'dsinh', 'dsqrt', 'dtan', 'dtanh', 'exp', 'exponent', 'float', 'floor', 'fraction', 'iabs', 'iachar', 'iand', 'ibclr', 'ibits', 'ibset', 'ichar', 'idim', 'idint', 'idnint', 'ieor', 'ifix', 'index', 'int', 'ior', 'ishft', 'ishftc', 'isign', 'len_trim', 'lge', 'lgt', 'lle', 'llt', 'log', 'log10', 'logical', 'max', 'max0', 'max1', 'merge', 'min', 'min0', 'min1', 'mod', 'modulo', 'mvbits', 'nearest', 'nint', 'not', 'rand', 'real', 'rrspacing', 'scale', 'scan', 'set_exponent', 'sign', 'sin', 'sinh', 'sngl', 'spacing', 'sqrt', 'tan', 'tanh', 'verify', ); $self->listAdd('inquire_keywords', 'access', 'action', 'blank', 'delim', 'direct', 'err', 'exist', 'file', 'form', 'formatted', 'iostat', 'name', 'named', 'nextrec', 'number', 'opened', 'pad', 'position', 'read', 'readwrite', 'recl', 'sequential', 'unformatted', 'unit', 'write', ); $self->listAdd('inquiry_fn', 'allocated', 'associated', 'bit_size', 'digits', 'epsilon', 'huge', 'kind', 'lbound', 'len', 'maxexponent', 'minexponent', 'precision', 'present', 'radix', 'range', 'shape', 'size', 'tiny', 'ubound', ); $self->listAdd('io_functions', 'access', 'backspace', 'close', 'format', 'inquire', 'open', 'print', 'read', 'rewind', 'write', ); $self->listAdd('io_keywords', 'advance', 'end', 'eor', 'err', 'fmt', 'iostat', 'size', 'status', 'unit', ); $self->listAdd('keywords', 'allocate', 'assignment', 'break', 'call', 'case', 'common', 'contains', 'continue', 'cycle', 'deallocate', 'default', 'do', 'elemental', 'else', 'elseif', 'elsewhere', 'entry', 'equivalence', 'exit', 'external', 'for', 'forall', 'go', 'goto', 'if', 'implicit', 'include', 'interface', 'intrinsic', 'namelist', 'none', 'nullify', 'only', 'operator', 'pause', 'procedure', 'pure', 'record', 'recursive', 'result', 'return', 'select', 'selectcase', 'stop', 'then', 'to', 'use', 'where', 'while', ); $self->listAdd('non_elem_subr', 'date_and_time', 'random_number', 'random_seed', 'system_clock', ); $self->listAdd('open_keywords', 'access', 'action', 'blank', 'delim', 'err', 'file', 'form', 'iostat', 'pad', 'position', 'recl', 'status', 'unit', ); $self->listAdd('transform_fn', 'all', 'any', 'count', 'cshift', 'dot_product', 'eoshift', 'matmul', 'maxloc', 'maxval', 'minloc', 'minval', 'pack', 'product', 'repeat', 'reshape', 'selected_int_kind', 'selected_real_kind', 'spread', 'sum', 'transfer', 'transpose', 'trim', 'unpack', ); $self->listAdd('types', 'allocatable', 'double', 'optional', 'parameter', 'pointer', 'precision', 'private', 'public', 'save', 'sequence', 'target', ); $self->contextdata({ 'default' => { callback => \&parsedefault, attribute => 'Normal Text', }, 'end_of_string' => { callback => \&parseend_of_string, attribute => 'String', fallthrough => '#pop#pop', }, 'find_begin_stmnts' => { callback => \&parsefind_begin_stmnts, attribute => 'Normal Text', }, 'find_comments' => { callback => \&parsefind_comments, attribute => 'Normal Text', }, 'find_decls' => { callback => \&parsefind_decls, attribute => 'Normal Text', }, 'find_end_stmnts' => { callback => \&parsefind_end_stmnts, attribute => 'Normal Text', }, 'find_intrinsics' => { callback => \&parsefind_intrinsics, attribute => 'Normal Text', }, 'find_io_paren' => { callback => \&parsefind_io_paren, attribute => 'Normal Text', }, 'find_io_stmnts' => { callback => \&parsefind_io_stmnts, attribute => 'Normal Text', }, 'find_numbers' => { callback => \&parsefind_numbers, attribute => 'Normal Text', }, 'find_op_and_log' => { callback => \&parsefind_op_and_log, attribute => 'Normal Text', }, 'find_paren' => { callback => \&parsefind_paren, attribute => 'Data Type', lineending => '#pop', }, 'find_preprocessor' => { callback => \&parsefind_preprocessor, attribute => 'Normal Text', }, 'find_strings' => { callback => \&parsefind_strings, attribute => 'String', }, 'find_symbols' => { callback => \&parsefind_symbols, attribute => 'Normal Text', }, 'format_stmnt' => { callback => \&parseformat_stmnt, attribute => 'Normal Text', }, 'inside_func_paren' => { callback => \&parseinside_func_paren, attribute => 'Normal Text', }, 'string_1' => { callback => \&parsestring_1, attribute => 'String', fallthrough => '#pop', }, 'string_2' => { callback => \&parsestring_2, attribute => 'String', fallthrough => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('default'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Fortran'; } sub parsedefault { my ($self, $text) = @_; # context => 'find_strings' # type => 'IncludeRules' if ($self->includeRules('find_strings', $text)) { return 1 } # context => 'find_decls' # type => 'IncludeRules' if ($self->includeRules('find_decls', $text)) { return 1 } # context => 'find_intrinsics' # type => 'IncludeRules' if ($self->includeRules('find_intrinsics', $text)) { return 1 } # context => 'find_io_stmnts' # type => 'IncludeRules' if ($self->includeRules('find_io_stmnts', $text)) { return 1 } # context => 'find_op_and_log' # type => 'IncludeRules' if ($self->includeRules('find_op_and_log', $text)) { return 1 } # context => 'find_numbers' # type => 'IncludeRules' if ($self->includeRules('find_numbers', $text)) { return 1 } # context => 'find_preprocessor' # type => 'IncludeRules' if ($self->includeRules('find_preprocessor', $text)) { return 1 } # context => 'find_comments' # type => 'IncludeRules' if ($self->includeRules('find_comments', $text)) { return 1 } # context => 'find_symbols' # type => 'IncludeRules' if ($self->includeRules('find_symbols', $text)) { return 1 } # context => 'find_end_stmnts' # type => 'IncludeRules' if ($self->includeRules('find_end_stmnts', $text)) { return 1 } # context => 'find_begin_stmnts' # type => 'IncludeRules' if ($self->includeRules('find_begin_stmnts', $text)) { return 1 } return 0; }; sub parseend_of_string { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # String => '&\s*$' # attribute => 'Keyword' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '&\\s*$', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # attribute => 'Keyword' # char => '&' # context => '#pop' # firstNonSpace => 'true' # type => 'DetectChar' if ($self->testDetectChar($text, '&', 0, 0, 0, undef, 1, '#pop', 'Keyword')) { return 1 } # String => '(!.*)?$' # attribute => 'Comment' # context => '#stay' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '(!.*)?$', 0, 0, 0, undef, 1, '#stay', 'Comment')) { return 1 } return 0; }; sub parsefind_begin_stmnts { my ($self, $text) = @_; # String => '\bmodule\s+procedure\b' # attribute => 'Keyword' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bmodule\\s+procedure\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(program|subroutine|function|module|block\s*data)\b' # attribute => 'Keyword' # beginRegion => 'Unit' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(program|subroutine|function|module|block\\s*data)\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } return 0; }; sub parsefind_comments { my ($self, $text) = @_; # String => '[cC\*].*$' # attribute => 'Comment' # column => '0' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[cC\\*].*$', 0, 0, 0, 0, 0, '#stay', 'Comment')) { return 1 } # String => '!.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '!.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } return 0; }; sub parsefind_decls { my ($self, $text) = @_; # String => '\binteger[\*]\d{1,2}' # attribute => 'Data Type' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\binteger[\\*]\\d{1,2}', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '\breal[\*]\d{1,2}' # attribute => 'Data Type' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\breal[\\*]\\d{1,2}', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '\bcomplex[\*]\d{1,2}' # attribute => 'Data Type' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bcomplex[\\*]\\d{1,2}', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '\bend\s*type\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bend\\s*type\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => 'types' # attribute => 'Data Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '^\s*data\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '^\\s*data\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '^\s*real\s*[(]' # attribute => 'Data Type' # context => 'find_paren' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '^\\s*real\\s*[(]', 1, 0, 0, undef, 0, 'find_paren', 'Data Type')) { return 1 } # String => '^\s*real(?![\w\*])' # attribute => 'Data Type' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '^\\s*real(?![\\w\\*])', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '\bcharacter[*][0-9]+\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bcharacter[*][0-9]+\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '\b(type|integer|complex|character|logical|intent|dimension)\b\s*[(]' # attribute => 'Data Type' # context => 'find_paren' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(type|integer|complex|character|logical|intent|dimension)\\b\\s*[(]', 1, 0, 0, undef, 0, 'find_paren', 'Data Type')) { return 1 } # String => '\b(type|integer|complex|character|logical|intent|dimension)\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(type|integer|complex|character|logical|intent|dimension)\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # attribute => 'Data Type' # char => ':' # char1 => ':' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, ':', ':', 0, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } return 0; }; sub parsefind_end_stmnts { my ($self, $text) = @_; # String => '\bend\s*(program|subroutine|function|module|block\s*data)\b' # attribute => 'Keyword' # context => '#stay' # endRegion => 'Unit' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bend\\s*(program|subroutine|function|module|block\\s*data)\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bend\s*(do|if|select|where|forall|interface)\b' # attribute => 'Keyword' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bend\\s*(do|if|select|where|forall|interface)\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bend\b' # attribute => 'Keyword' # context => '#stay' # endRegion => 'Unit' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bend\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } return 0; }; sub parsefind_intrinsics { my ($self, $text) = @_; # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'elemental_procs' # attribute => 'Elemental Procedure' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'elemental_procs', 0, undef, 0, '#stay', 'Elemental Procedure')) { return 1 } # String => 'inquiry_fn' # attribute => 'Inquiry Function' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'inquiry_fn', 0, undef, 0, '#stay', 'Inquiry Function')) { return 1 } # String => 'transform_fn' # attribute => 'Transformational Function' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'transform_fn', 0, undef, 0, '#stay', 'Transformational Function')) { return 1 } # String => 'non_elem_subr' # attribute => 'Non elemental subroutine' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'non_elem_subr', 0, undef, 0, '#stay', 'Non elemental subroutine')) { return 1 } return 0; }; sub parsefind_io_paren { my ($self, $text) = @_; # attribute => 'IO Function' # char => '*' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '*', 0, 0, 0, undef, 0, '#stay', 'IO Function')) { return 1 } # attribute => 'Normal Text' # char => '(' # context => 'inside_func_paren' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'inside_func_paren', 'Normal Text')) { return 1 } # attribute => 'IO Function' # char => ')' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'IO Function')) { return 1 } # String => 'io_keywords' # attribute => 'IO Function' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'io_keywords', 0, undef, 0, '#stay', 'IO Function')) { return 1 } # String => 'inquire_keywords' # attribute => 'IO Function' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'inquire_keywords', 0, undef, 0, '#stay', 'IO Function')) { return 1 } # String => 'open_keywords' # attribute => 'IO Function' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'open_keywords', 0, undef, 0, '#stay', 'IO Function')) { return 1 } # context => 'find_strings' # type => 'IncludeRules' if ($self->includeRules('find_strings', $text)) { return 1 } # context => 'find_intrinsics' # type => 'IncludeRules' if ($self->includeRules('find_intrinsics', $text)) { return 1 } # context => 'find_numbers' # type => 'IncludeRules' if ($self->includeRules('find_numbers', $text)) { return 1 } # context => 'find_symbols' # type => 'IncludeRules' if ($self->includeRules('find_symbols', $text)) { return 1 } return 0; }; sub parsefind_io_stmnts { my ($self, $text) = @_; # String => '\b(read|write|backspace|rewind|end\s*file|close)\s*[(]' # attribute => 'IO Function' # context => 'find_io_paren' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(read|write|backspace|rewind|end\\s*file|close)\\s*[(]', 1, 0, 0, undef, 0, 'find_io_paren', 'IO Function')) { return 1 } # String => '\bopen\s*[(]' # attribute => 'IO Function' # context => 'find_io_paren' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bopen\\s*[(]', 1, 0, 0, undef, 0, 'find_io_paren', 'IO Function')) { return 1 } # String => '\binquire\s*[(]' # attribute => 'IO Function' # context => 'find_io_paren' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\binquire\\s*[(]', 1, 0, 0, undef, 0, 'find_io_paren', 'IO Function')) { return 1 } # String => '\bformat\s*[(]' # attribute => 'IO Function' # context => 'format_stmnt' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bformat\\s*[(]', 1, 0, 0, undef, 0, 'format_stmnt', 'IO Function')) { return 1 } # String => '\bend\s*file\b' # attribute => 'IO Function' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bend\\s*file\\b', 1, 0, 0, undef, 0, '#stay', 'IO Function')) { return 1 } # String => 'io_functions' # attribute => 'IO Function' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'io_functions', 0, undef, 0, '#stay', 'IO Function')) { return 1 } return 0; }; sub parsefind_numbers { my ($self, $text) = @_; # String => '[0-9]*\.[0-9]+([de][+-]?[0-9]+)?([_]([0-9]+|[a-z][\w_]*))?' # attribute => 'Float' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '[0-9]*\\.[0-9]+([de][+-]?[0-9]+)?([_]([0-9]+|[a-z][\\w_]*))?', 1, 0, 0, undef, 0, '#stay', 'Float')) { return 1 } # String => '\b[0-9]+\.[0-9]*([de][+-]?[0-9]+)?([_]([0-9]+|[a-z][\w_]*))?(?![a-z])' # attribute => 'Float' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b[0-9]+\\.[0-9]*([de][+-]?[0-9]+)?([_]([0-9]+|[a-z][\\w_]*))?(?![a-z])', 1, 0, 0, undef, 0, '#stay', 'Float')) { return 1 } # String => '\b[0-9]+[de][+-]?[0-9]+([_]([0-9]+|[a-z][\w_]*))?' # attribute => 'Float' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b[0-9]+[de][+-]?[0-9]+([_]([0-9]+|[a-z][\\w_]*))?', 1, 0, 0, undef, 0, '#stay', 'Float')) { return 1 } # String => '\b[0-9]+([_]([0-9]+|[a-zA-Z][\w_]*))?' # attribute => 'Decimal' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b[0-9]+([_]([0-9]+|[a-zA-Z][\\w_]*))?', 0, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => '\b[bozx](['][0-9a-f]+[']|["][0-9a-f]+["])' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b[bozx]([\'][0-9a-f]+[\']|["][0-9a-f]+["])', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } return 0; }; sub parsefind_op_and_log { my ($self, $text) = @_; # String => '\.(true|false)\.' # attribute => 'Logical' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\.(true|false)\\.', 1, 0, 0, undef, 0, '#stay', 'Logical')) { return 1 } # String => '\.[A-Za-z]+\.' # attribute => 'Operator' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\.[A-Za-z]+\\.', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '(==|/=|<|<=|>|>=)' # attribute => 'Operator' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(==|/=|<|<=|>|>=)', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } return 0; }; sub parsefind_paren { my ($self, $text) = @_; # attribute => 'Data Type' # char => '(' # context => 'find_paren' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'find_paren', 'Data Type')) { return 1 } # attribute => 'Data Type' # char => ')' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Data Type')) { return 1 } return 0; }; sub parsefind_preprocessor { my ($self, $text) = @_; # String => '(#|cDEC\$|CDEC\$).*$' # attribute => 'Preprocessor' # column => '0' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(#|cDEC\\$|CDEC\\$).*$', 0, 0, 0, 0, 0, '#stay', 'Preprocessor')) { return 1 } return 0; }; sub parsefind_strings { my ($self, $text) = @_; # attribute => 'String' # char => ''' # context => 'string_1' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'string_1', 'String')) { return 1 } # attribute => 'String' # char => '"' # context => 'string_2' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string_2', 'String')) { return 1 } return 0; }; sub parsefind_symbols { my ($self, $text) = @_; # attribute => 'Keyword' # char => '*' # char1 => '*' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '*', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # attribute => 'Keyword' # char => '(' # char1 => '/' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '(', '/', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # attribute => 'Keyword' # char => '/' # char1 => ')' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', ')', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '&+-*/=?[]^{|}~' # attribute => 'Keyword' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '&+-*/=?[]^{|}~', 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '(),' # attribute => 'Symbol' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '(),', 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } return 0; }; sub parseformat_stmnt { my ($self, $text) = @_; # attribute => 'IO Function' # char => '(' # context => 'format_stmnt' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'format_stmnt', 'IO Function')) { return 1 } # attribute => 'IO Function' # char => ')' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'IO Function')) { return 1 } # String => '[0-9]*/' # attribute => 'IO Function' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '[0-9]*/', 1, 0, 0, undef, 0, '#stay', 'IO Function')) { return 1 } # String => ':' # attribute => 'IO Function' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, ':', 0, 0, undef, 0, '#stay', 'IO Function')) { return 1 } # context => 'find_strings' # type => 'IncludeRules' if ($self->includeRules('find_strings', $text)) { return 1 } # context => 'find_symbols' # type => 'IncludeRules' if ($self->includeRules('find_symbols', $text)) { return 1 } return 0; }; sub parseinside_func_paren { my ($self, $text) = @_; # attribute => 'Normal Text' # char => '(' # context => 'inside_func_paren' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'inside_func_paren', 'Normal Text')) { return 1 } # attribute => 'Normal Text' # char => ')' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } # context => 'find_strings' # type => 'IncludeRules' if ($self->includeRules('find_strings', $text)) { return 1 } # context => 'find_intrinsics' # type => 'IncludeRules' if ($self->includeRules('find_intrinsics', $text)) { return 1 } # context => 'find_numbers' # type => 'IncludeRules' if ($self->includeRules('find_numbers', $text)) { return 1 } return 0; }; sub parsestring_1 { my ($self, $text) = @_; # String => '[^']*'' # attribute => 'String' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[^\']*\'', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } # String => '&\s*$' # attribute => 'Keyword' # context => 'end_of_string' # type => 'RegExpr' if ($self->testRegExpr($text, '&\\s*$', 0, 0, 0, undef, 0, 'end_of_string', 'Keyword')) { return 1 } # String => '.*(?=&\s*$)' # attribute => 'String' # context => 'end_of_string' # type => 'RegExpr' if ($self->testRegExpr($text, '.*(?=&\\s*$)', 0, 0, 0, undef, 0, 'end_of_string', 'String')) { return 1 } return 0; }; sub parsestring_2 { my ($self, $text) = @_; # String => '[^"]*"' # attribute => 'String' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[^"]*"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } # String => '&\s*$' # attribute => 'Keyword' # context => 'end_of_string' # type => 'RegExpr' if ($self->testRegExpr($text, '&\\s*$', 0, 0, 0, undef, 0, 'end_of_string', 'Keyword')) { return 1 } # String => '.*(?=&\s*$)' # attribute => 'String' # context => 'end_of_string' # type => 'RegExpr' if ($self->testRegExpr($text, '.*(?=&\\s*$)', 0, 0, 0, undef, 0, 'end_of_string', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Fortran - a Plugin for Fortran syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Fortran; my $sh = new Syntax::Highlight::Engine::Kate::Fortran([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Fortran is a plugin module that provides syntax highlighting for Fortran to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Cg.pm0000644000175000017500000003520513226470762025213 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'cg.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.11 #kate version 2.4 #kate author Florian Schanda (florian.schanda@schanda.de) #generated: Sun Feb 3 22:02:04 2008, localtime package Syntax::Highlight::Engine::Kate::Cg; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Alert' => 'Alert', 'Binding' => 'Keyword', 'Comment' => 'Comment', 'Data Type' => 'DataType', 'Decimal' => 'DecVal', 'Error' => 'Error', 'Fixed' => 'Float', 'Float' => 'Float', 'Function' => 'Function', 'Half' => 'Float', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'StdFunction' => 'Reserved', 'Swizzle' => 'Operator', 'Symbol' => 'Normal', }); $self->listAdd('attention', 'BUG', 'FIXME', 'TODO', ); $self->listAdd('binding', 'BCOL0', 'BCOL1', 'BINORMAL', 'BLENDINDICES', 'BLENDWEIGHT', 'COLOR', 'COLOR0', 'COLOR1', 'COLOR2', 'COLOR3', 'DEPTH', 'FACE', 'FOG', 'FOGCOORD', 'NORMAL', 'POSITION', 'PSIZE', 'TANGENT', 'TESSFACTOR', 'TEXCOORD0', 'TEXCOORD1', 'TEXCOORD10', 'TEXCOORD11', 'TEXCOORD12', 'TEXCOORD13', 'TEXCOORD14', 'TEXCOORD15', 'TEXCOORD2', 'TEXCOORD3', 'TEXCOORD4', 'TEXCOORD5', 'TEXCOORD6', 'TEXCOORD7', 'TEXCOORD8', 'TEXCOORD9', 'TEXUNIT0', 'TEXUNIT1', 'TEXUNIT10', 'TEXUNIT11', 'TEXUNIT12', 'TEXUNIT13', 'TEXUNIT14', 'TEXUNIT15', 'TEXUNIT2', 'TEXUNIT3', 'TEXUNIT4', 'TEXUNIT5', 'TEXUNIT6', 'TEXUNIT7', 'TEXUNIT8', 'TEXUNIT9', 'WPOS', ); $self->listAdd('keywords', 'discard', 'do', 'else', 'false', 'for', 'if', 'return', 'static', 'struct', 'true', 'typedef', 'while', ); $self->listAdd('stdlib', 'abs', 'acos', 'all', 'any', 'asin', 'atan', 'atan2', 'ceil', 'clamp', 'cos', 'cosh', 'cross', 'ddx', 'ddy', 'debug', 'degrees', 'determinant', 'distance', 'dot', 'exp', 'exp2', 'faceforward', 'floor', 'fmod', 'frac', 'frexp', 'isfinite', 'isinf', 'isnan', 'ldexp', 'length', 'lerp', 'lit', 'log', 'log10', 'log2', 'max', 'min', 'modf', 'mul', 'noise', 'normalize', 'pack_2half', 'pack_2ushort', 'pack_4byte', 'pack_4ubyte', 'pow', 'radians', 'reflect', 'refract', 'round', 'rsqrt', 'saturate', 'sign', 'sin', 'sincos', 'sinh', 'smoothstep', 'sqrt', 'step', 'tan', 'tanh', 'tex1D', 'tex1Dproj', 'tex2D', 'tex2Dproj', 'tex3D', 'tex3Dproj', 'texCUBE', 'texCUBEproj', 'texRECT', 'texRECTproj', 'transpose', 'unpack_2half', 'unpack_2ushort', 'unpack_4byte', 'unpack_4ubyte', ); $self->listAdd('stdstruct', 'fragout', 'fragout_float', ); $self->listAdd('types', 'bool', 'const', 'fixed', 'float', 'half', 'in', 'inout', 'int', 'out', 'packed', 'sampler', 'sampler1D', 'sampler2D', 'sampler3D', 'samplerCUBE', 'samplerRECT', 'uniform', 'void', ); $self->contextdata({ 'Commentar 1' => { callback => \&parseCommentar1, attribute => 'Comment', lineending => '#pop', }, 'Commentar 2' => { callback => \&parseCommentar2, attribute => 'Comment', }, 'Commentar/Preprocessor' => { callback => \&parseCommentarPreprocessor, attribute => 'Comment', }, 'Member' => { callback => \&parseMember, attribute => 'Normal Text', lineending => '#pop', fallthrough => '#pop', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'Outscoped' => { callback => \&parseOutscoped, attribute => 'Comment', }, 'Outscoped intern' => { callback => \&parseOutscopedintern, attribute => 'Comment', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Cg'; } sub parseCommentar1 { my ($self, $text) = @_; # String => 'attention' # attribute => 'Alert' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'attention', 0, undef, 0, '#stay', 'Alert')) { return 1 } return 0; }; sub parseCommentar2 { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # endRegion => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } # String => 'attention' # attribute => 'Alert' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'attention', 0, undef, 0, '#stay', 'Alert')) { return 1 } return 0; }; sub parseCommentarPreprocessor { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # endRegion => 'Comment2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseMember { my ($self, $text) = @_; # String => '\b[_\w][_\w\d]*(?=[\s]*)' # attribute => 'Function' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b[_\\w][_\\w\\d]*(?=[\\s]*)', 0, 0, 0, undef, 0, '#pop', 'Function')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'binding' # attribute => 'Binding' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'binding', 0, undef, 0, '#stay', 'Binding')) { return 1 } # String => 'attention' # attribute => 'Alert' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'attention', 0, undef, 0, '#stay', 'Alert')) { return 1 } # attribute => 'Symbol' # beginRegion => 'Brace1' # char => '{' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # attribute => 'Symbol' # char => '}' # context => '#stay' # endRegion => 'Brace1' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # String => 'float[1234](x[1234])?' # attribute => 'Data Type' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, 'float[1234](x[1234])?', 0, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => 'half[1234](x[1234])?' # attribute => 'Data Type' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, 'half[1234](x[1234])?', 0, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => 'fixed[1234](x[1234])?' # attribute => 'Data Type' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, 'fixed[1234](x[1234])?', 0, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => 'bool[1234](x[1234])?' # attribute => 'Data Type' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, 'bool[1234](x[1234])?', 0, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => 'int[1234](x[1234])?' # attribute => 'Data Type' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, 'int[1234](x[1234])?', 0, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => 'types' # attribute => 'Data Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => 'stdstruct' # attribute => 'Data Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'stdstruct', 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '[0123456789]*[.][0123456789]+f' # attribute => 'Float' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[0123456789]*[.][0123456789]+f', 0, 0, 0, undef, 0, '#stay', 'Float')) { return 1 } # String => '[0123456789]*[.][0123456789]+h' # attribute => 'Half' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[0123456789]*[.][0123456789]+h', 0, 0, 0, undef, 0, '#stay', 'Half')) { return 1 } # String => '[0123456789]*[.][0123456789]+x' # attribute => 'Fixed' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[0123456789]*[.][0123456789]+x', 0, 0, 0, undef, 0, '#stay', 'Fixed')) { return 1 } # String => '[0123456789]*[.][0123456789]+' # attribute => 'Float' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[0123456789]*[.][0123456789]+', 0, 0, 0, undef, 0, '#stay', 'Float')) { return 1 } # attribute => 'Decimal' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Commentar 1' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) { return 1 } # attribute => 'Comment' # beginRegion => 'Comment' # char => '/' # char1 => '*' # context => 'Commentar 2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) { return 1 } # String => 'stdlib' # attribute => 'StdFunction' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'stdlib', 0, undef, 0, '#stay', 'StdFunction')) { return 1 } # String => '\b[_\w][_\w\d]*(?=[\s]*[(])' # attribute => 'Function' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b[_\\w][_\\w\\d]*(?=[\\s]*[(])', 0, 0, 0, undef, 0, '#stay', 'Function')) { return 1 } # String => '[.]{1,1}[rgbaxyzw]+(?=[\s/*-+<>])' # attribute => 'Swizzle' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[.]{1,1}[rgbaxyzw]+(?=[\\s/*-+<>])', 0, 0, 0, undef, 0, '#stay', 'Swizzle')) { return 1 } # String => '[.]{1,1}' # attribute => 'Symbol' # context => 'Member' # type => 'RegExpr' if ($self->testRegExpr($text, '[.]{1,1}', 0, 0, 0, undef, 0, 'Member', 'Symbol')) { return 1 } # String => ':!%&()+,-/.*<=>?[]|~^;' # attribute => 'Symbol' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, ':!%&()+,-/.*<=>?[]|~^;', 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } return 0; }; sub parseOutscoped { my ($self, $text) = @_; # attribute => 'Comment' # beginRegion => 'Comment' # char => '/' # char1 => '*' # context => 'Commentar 2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) { return 1 } # String => 'attention' # attribute => 'Alert' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'attention', 0, undef, 0, '#stay', 'Alert')) { return 1 } # String => '#\s*if' # attribute => 'Comment' # beginRegion => 'Outscoped' # context => 'Outscoped intern' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*if', 0, 0, 0, undef, 1, 'Outscoped intern', 'Comment')) { return 1 } # String => '#\s*(endif|else|elif)' # attribute => 'Preprocessor' # context => '#pop' # endRegion => 'Outscoped' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*(endif|else|elif)', 0, 0, 0, undef, 1, '#pop', 'Preprocessor')) { return 1 } return 0; }; sub parseOutscopedintern { my ($self, $text) = @_; # attribute => 'Comment' # beginRegion => 'Comment' # char => '/' # char1 => '*' # context => 'Commentar 2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) { return 1 } # String => '#\s*if' # attribute => 'Comment' # beginRegion => 'Outscoped' # context => 'Outscoped intern' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*if', 0, 0, 0, undef, 1, 'Outscoped intern', 'Comment')) { return 1 } # String => '#\s*endif' # attribute => 'Comment' # context => '#pop' # endRegion => 'Outscoped' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*endif', 0, 0, 0, undef, 1, '#pop', 'Comment')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Cg - a Plugin for Cg syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Cg; my $sh = new Syntax::Highlight::Engine::Kate::Cg([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Cg is a plugin module that provides syntax highlighting for Cg to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/LPC.pm0000644000175000017500000003067713226470762025310 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'lpc.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 0.76 #kate version 2.4 #kate author Andreas Klauer (Andreas.Klauer@metamorpher.de) #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::LPC; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Alert' => 'Alert', 'Binary' => 'BaseN', 'Char' => 'Char', 'Closure' => 'Others', 'Datatype' => 'DataType', 'Default' => 'Normal', 'Floats' => 'Float', 'Hexadecimal' => 'BaseN', 'Integer' => 'DecVal', 'Keywords' => 'Keyword', 'Modifier' => 'DataType', 'Multi-Line comments' => 'Comment', 'Octal' => 'BaseN', 'Preprocessor' => 'Others', 'Preprocessor-Strings' => 'String', 'Region Marker' => 'RegionMarker', 'Single-Line comments' => 'Comment', 'Strings' => 'String', }); $self->listAdd('attention', '###', 'FIXME', 'HACK', 'NOTE', 'NOTICE', 'TODO', 'WARNING', ); $self->listAdd('keywords', 'break', 'case', 'continue', 'default', 'do', 'else', 'for', 'foreach', 'functions', 'if', 'inherit', 'nolog', 'publish', 'return', 'switch', 'variables', 'while', ); $self->listAdd('modifiers', 'nomask', 'nosave', 'private', 'protected', 'public', 'static', 'varargs', 'virtual', ); $self->listAdd('types', 'array', 'closure', 'float', 'int', 'mapping', 'mixed', 'object', 'status', 'string', 'symbol', 'void', ); $self->contextdata({ 'Comment1' => { callback => \&parseComment1, attribute => 'Single-Line comments', lineending => '#pop', }, 'Comment2' => { callback => \&parseComment2, attribute => 'Multi-Line comments', }, 'Normal' => { callback => \&parseNormal, attribute => 'Default', }, 'Preprocessor' => { callback => \&parsePreprocessor, attribute => 'Preprocessor', lineending => '#pop', }, 'String1' => { callback => \&parseString1, attribute => 'Strings', lineending => '#pop', }, 'String2' => { callback => \&parseString2, attribute => 'Preprocessor-Strings', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'LPC'; } sub parseComment1 { my ($self, $text) = @_; # attribute => 'Single-Line comments' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Single-Line comments')) { return 1 } # String => 'attention' # attribute => 'Alert' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'attention', 0, undef, 0, '#stay', 'Alert')) { return 1 } return 0; }; sub parseComment2 { my ($self, $text) = @_; # attribute => 'Multi-Line comments' # char => '*' # char1 => '/' # context => '#pop' # endRegion => 'blockComment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Multi-Line comments')) { return 1 } # String => 'attention' # attribute => 'Alert' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'attention', 0, undef, 0, '#stay', 'Alert')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # String => '//\s*BEGIN.*$' # attribute => 'Region Marker' # beginRegion => 'regionMarker' # context => '#stay' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '//\\s*BEGIN.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { return 1 } # String => '//\s*END.*$' # attribute => 'Region Marker' # context => '#stay' # endRegion => 'regionMarker' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '//\\s*END.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { return 1 } # attribute => 'Single-Line comments' # char => '/' # char1 => '/' # context => 'Comment1' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment1', 'Single-Line comments')) { return 1 } # attribute => 'Multi-Line comments' # beginRegion => 'blockComment' # char => '/' # char1 => '*' # context => 'Comment2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Comment2', 'Multi-Line comments')) { return 1 } # String => 'modifiers' # attribute => 'Modifier' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'modifiers', 0, undef, 0, '#stay', 'Modifier')) { return 1 } # String => 'types' # attribute => 'Datatype' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Datatype')) { return 1 } # String => 'keywords' # attribute => 'Keywords' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keywords')) { return 1 } # attribute => 'Preprocessor' # char => '#' # column => '0' # context => 'Preprocessor' # type => 'DetectChar' if ($self->testDetectChar($text, '#', 0, 0, 0, 0, 0, 'Preprocessor', 'Preprocessor')) { return 1 } # attribute => 'Floats' # context => '#stay' # items => 'ARRAY(0x19c5720)' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Floats')) { # String => 'fFeE' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, 'fFeE', 0, 0, undef, 0, '#stay', undef)) { return 1 } } # String => '0b[01]+' # attribute => 'Binary' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '0b[01]+', 0, 0, 0, undef, 0, '#stay', 'Binary')) { return 1 } # String => '0x[0-9a-fA-F]+' # attribute => 'Hexadecimal' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '0x[0-9a-fA-F]+', 0, 0, 0, undef, 0, '#stay', 'Hexadecimal')) { return 1 } # String => '0o[0-7]+' # attribute => 'Octal' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '0o[0-7]+', 0, 0, 0, undef, 0, '#stay', 'Octal')) { return 1 } # attribute => 'Integer' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Integer')) { return 1 } # String => '#'[^\t ][^\t ,);}\]/]*' # attribute => 'Closure' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#\'[^\\t ][^\\t ,);}\\]/]*', 0, 0, 0, undef, 0, '#stay', 'Closure')) { return 1 } # attribute => 'Strings' # char => '"' # context => 'String1' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String1', 'Strings')) { return 1 } # attribute => 'Char' # context => '#stay' # type => 'HlCStringChar' if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'Default' # beginRegion => 'brace' # char => '{' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Default')) { return 1 } # attribute => 'Default' # char => '}' # context => '#stay' # endRegion => 'brace' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Default')) { return 1 } return 0; }; sub parsePreprocessor { my ($self, $text) = @_; # attribute => 'Preprocessor' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Preprocessor')) { return 1 } # attribute => 'Single-Line comments' # char => '/' # char1 => '/' # context => 'Comment1' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment1', 'Single-Line comments')) { return 1 } # attribute => 'Multi-Line comments' # beginRegion => 'blockComment' # char => '/' # char1 => '*' # context => 'Comment2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Comment2', 'Multi-Line comments')) { return 1 } # String => 'modifiers' # attribute => 'Modifier' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'modifiers', 0, undef, 0, '#stay', 'Modifier')) { return 1 } # String => 'types' # attribute => 'Datatype' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Datatype')) { return 1 } # String => 'keywords' # attribute => 'Keywords' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keywords')) { return 1 } # attribute => 'Preprocessor-Strings' # char => '"' # context => 'String2' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String2', 'Preprocessor-Strings')) { return 1 } return 0; }; sub parseString1 { my ($self, $text) = @_; # attribute => 'Default' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Default')) { return 1 } # attribute => 'Strings' # char => '\' # char1 => '\' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'Strings')) { return 1 } # attribute => 'Strings' # char => '\' # char1 => '"' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '"', 0, 0, 0, undef, 0, '#stay', 'Strings')) { return 1 } # attribute => 'Strings' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Strings')) { return 1 } return 0; }; sub parseString2 { my ($self, $text) = @_; # attribute => 'Default' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Default')) { return 1 } # attribute => 'Preprocessor-Strings' # char => '\' # char1 => '\' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'Preprocessor-Strings')) { return 1 } # attribute => 'Preprocessor-Strings' # char => '\' # char1 => '"' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '"', 0, 0, 0, undef, 0, '#stay', 'Preprocessor-Strings')) { return 1 } # attribute => 'Preprocessor-Strings' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Preprocessor-Strings')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::LPC - a Plugin for LPC syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::LPC; my $sh = new Syntax::Highlight::Engine::Kate::LPC([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::LPC is a plugin module that provides syntax highlighting for LPC to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Stata.pm0000644000175000017500000002722013226470762025734 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'stata.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.01 #kate version 2.1 #kate author Edwin Leuven (e.leuven@uva.nl) #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::Stata; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Comment' => 'Comment', 'Data Type' => 'DataType', 'Keyword' => 'Keyword', 'Macro' => 'Others', 'Normal Text' => 'Normal', 'String' => 'String', 'String Char' => 'Char', }); $self->listAdd('keywords', '_pctile', 'about', 'adjust', 'ado', 'alpha', 'anova', 'anovadef', 'append', 'arch', 'areg', 'args', 'arima', 'assert', 'bar', 'binreg', 'biprobit', 'bitest', 'boxcox', 'break', 'brier', 'browse', 'bstrap', 'by', 'canon', 'cap', 'capture', 'cat', 'cd', 'centile', 'cf', 'checksum', 'ci', 'class', 'clavg', 'clcomp', 'clear', 'clgen', 'clist', 'clkmeans', 'clkmed', 'clnote', 'clogit', 'cloglog', 'clsing', 'cltree', 'cluster', 'clutil', 'cmdlog', 'cnreg', 'cnsreg', 'codebook', 'collapse', 'compare', 'compress', 'confirm', 'constraint', 'continue', 'contract', 'copy', 'copyright', 'corr', 'corr2data', 'correlate', 'corrgram', 'count', 'cox', 'creturn', 'cross', 'ct', 'ctset', 'cttost', 'cumsp', 'cumul', 'cusum', 'datatypes', 'decode', 'define', 'describe', 'destring', 'dfuller', 'di', 'diagplots', 'dir', 'discard', 'display', 'do', 'doedit', 'dotplot', 'drawnorm', 'drop', 'dstdize', 'edit', 'egen', 'eivreg', 'else', 'encode', 'end', 'epitab', 'erase', 'ereturn', 'exit', 'expand', 'export', 'factor', 'fdadescribe', 'fdasave', 'fdause', 'file', 'filefilter', 'fillin', 'flist', 'for', 'foreach', 'format', 'forv', 'forval', 'forvalues', 'fracpoly', 'g', 'gen', 'generate', 'gettoken', 'glm', 'glogit', 'gprefs', 'gr', 'gr7', 'graph', 'graph7', 'grmeanby', 'gsort', 'hadimvo', 'hausman', 'haver', 'heckman', 'heckprob', 'help', 'hetprob', 'hexdump', 'hilite', 'hist', 'hotel', 'icd9', 'if', 'impute', 'in', 'infile', 'infile1', 'infile2', 'infiling', 'infix', 'input', 'insheet', 'inspect', 'ipolate', 'ivreg', 'jknife', 'joinby', 'kappa', 'kdensity', 'keep', 'ksm', 'ksmirnov', 'kwallis', 'label', 'ladder', 'levels', 'lfit', 'limits', 'lincom', 'line', 'linktest', 'list', 'lnskew0', 'log', 'logistic', 'logit', 'loneway', 'lowess', 'lroc', 'lrtest', 'lsens', 'lstat', 'ltable', 'lv', 'manova', 'manovatest', 'mark', 'markin', 'markout', 'marksample', 'matsize', 'maximize', 'means', 'median', 'memory', 'merge', 'mfx', 'mkdir', 'mkspline', 'ml', 'mleval', 'mlmatbysum', 'mlmatsum', 'mlogit', 'mlsum', 'mlvecsum', 'more', 'move', 'mvencode', 'mvreg', 'nbreg', 'net', 'newey', 'news', 'nl', 'nlogit', 'nobreak', 'nois', 'noisily', 'notes', 'nptrend', 'numlist', 'obs', 'odbc', 'ologit', 'oneway', 'oprobit', 'order', 'orthog', 'outfile', 'outsheet', 'parse', 'pcorr', 'pctile', 'pergram', 'pk', 'pkcollapse', 'pkcross', 'pkequiv', 'pkexamine', 'pkshape', 'pksumm', 'plot', 'poisson', 'post', 'postclose', 'postfile', 'postutil', 'pperron', 'prais', 'predict', 'preserve', 'probit', 'program', 'prtest', 'pwcorr', 'qc', 'qreg', 'quadchk', 'query', 'qui', 'quietly', 'range', 'ranksum', 'recast', 'recode', 'reg', 'reg3', 'regdiag', 'regress', 'rename', 'replace', 'reshape', 'restore', 'return', 'roc', 'rocplot', 'rotate', 'rreg', 'run', 'runtest', 'sample', 'sampsi', 'save', 'scatter', 'scobit', 'score', 'sdtest', 'search', 'separate', 'serrbar', 'set', 'shell', 'signrank', 'signtest', 'simul', 'sktest', 'smooth', 'snapspan', 'sort', 'spearman', 'spikeplot', 'sreturn', 'st', 'stack', 'statsby', 'stb', 'stbase', 'stci', 'stcox', 'stdes', 'stem', 'stfill', 'stgen', 'stir', 'stphplot', 'stptime', 'strate', 'streg', 'sts', 'stset', 'stsplit', 'stsum', 'sttocc', 'sttoct', 'stvary', 'sum', 'summarize', 'sureg', 'svy', 'svydes', 'svylc', 'svymean', 'svyset', 'svytab', 'svytest', 'sw', 'swilk', 'symmetry', 'syntax', 'tab', 'tabdisp', 'table', 'tabstat', 'tabsum', 'tabulate', 'tempfile', 'tempname', 'tempvar', 'test', 'testnl', 'tobit', 'tokenize', 'translate', 'translator', 'transmap', 'treatreg', 'truncreg', 'tsreport', 'tsrevar', 'tsset', 'ttest', 'tutorials', 'twoway', 'type', 'unabbr', 'unabcmd', 'update', 'use', 'using', 'vce', 'version', 'view', 'vwls', 'weibull', 'whelp', 'which', 'while', 'wntestb', 'wntestq', 'xcorr', 'xi', 'xpose', 'xt', 'xtabond', 'xtclog', 'xtdata', 'xtdes', 'xtgee', 'xtgls', 'xtile', 'xtintreg', 'xtivreg', 'xtlogit', 'xtnbreg', 'xtpcse', 'xtpois', 'xtprobit', 'xtrchh', 'xtreg', 'xtregar', 'xtsum', 'xttab', 'xttobit', 'zip', ); $self->listAdd('types', 'char', 'double', 'error', 'float', 'global', 'int', 'local', 'long', 'macro', 'mat', 'matrix', 'result', 'scalar', 'text', 'var', 'variable', 'varlist', 'varname', ); $self->contextdata({ 'Comment 1' => { callback => \&parseComment1, attribute => 'Comment', lineending => '#pop', }, 'Comment 2' => { callback => \&parseComment2, attribute => 'Comment', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'string' => { callback => \&parsestring, attribute => 'String', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Stata'; } sub parseComment1 { my ($self, $text) = @_; return 0; }; sub parseComment2 { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # endRegion => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'types' # attribute => 'Data Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) { return 1 } # attribute => 'String' # char => '"' # context => 'string' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'String')) { return 1 } # attribute => 'Macro' # char => '`' # char1 => ''' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '`', '\'', 0, 0, undef, 0, '#stay', 'Macro')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Comment 1' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment 1', 'Comment')) { return 1 } # attribute => 'Comment' # beginRegion => 'Comment' # char => '/' # char1 => '*' # context => 'Comment 2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Comment 2', 'Comment')) { return 1 } # attribute => 'Normal Text' # beginRegion => 'block' # char => '{' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Normal Text' # char => '}' # context => '#stay' # endRegion => 'block' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } return 0; }; sub parsestring { my ($self, $text) = @_; # attribute => 'String Char' # context => '#stay' # type => 'HlCStringChar' if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Stata - a Plugin for Stata syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Stata; my $sh = new Syntax::Highlight::Engine::Kate::Stata([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Stata is a plugin module that provides syntax highlighting for Stata to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/PureBasic.pm0000644000175000017500000007370713226470762026550 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'purebasic.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 3.91 #kate version 2.3 #kate author Sven Langenkamp (ace@kylixforum.de) #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::PureBasic; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Comment' => 'Comment', 'Constant' => 'DataType', 'Functions' => 'Function', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Number' => 'DecVal', 'Region Marker ' => 'RegionMarker', 'String' => 'String', }); $self->listAdd('functions', 'ACos', 'ASin', 'ATan', 'Abs', 'ActivateGadget', 'ActivateRichEdit', 'ActivateWindow', 'Add3DArchive', 'AddBillboard', 'AddDate', 'AddElement', 'AddGadgetColumn', 'AddGadgetItem', 'AddKeyboardShortcut', 'AddMaterialLayer', 'AddPackFile', 'AddPackMemory', 'AddStatusBarField', 'AddSysTrayIcon', 'AdvancedGadgetEvents', 'AllocateMemory', 'AmbientColor', 'AnimateEntity', 'Asc', 'AvailableScreenMemory', 'BackColor', 'Base64Encoder', 'BillboardGroupLocate', 'BillboardGroupMaterial', 'BillboardGroupX', 'BillboardGroupY', 'BillboardGroupZ', 'BillboardHeight', 'BillboardLocate', 'BillboardWidth', 'BillboardX', 'BillboardY', 'BillboardZ', 'Bin', 'Blue', 'Box', 'ButtonGadget', 'ButtonImageGadget', 'CDAudioLength', 'CDAudioName', 'CDAudioStatus', 'CDAudioTrackLength', 'CDAudioTrackSeconds', 'CDAudioTracks', 'CRC32Fingerprint', 'CallCFunction', 'CallCFunctionFast', 'CallCOM', 'CallDX', 'CallFunction', 'CallFunctionFast', 'CameraBackColor', 'CameraFOV', 'CameraLocate', 'CameraLookAt', 'CameraProjection', 'CameraRange', 'CameraRenderMode', 'CameraX', 'CameraY', 'CameraZ', 'CatchImage', 'CatchSound', 'CatchSprite', 'ChangeAlphaIntensity', 'ChangeAlphaIntensity', 'ChangeCurrentElement', 'ChangeGamma', 'ChangeListIconGadgetDisplay', 'ChangeRichEditOptions', 'ChangeSysTrayIcon', 'CheckBoxGadget', 'Chr', 'Circle', 'ClearBillboards', 'ClearClipboard', 'ClearConsole', 'ClearError', 'ClearGadgetItemList', 'ClearList', 'ClearScreen', 'ClipSprite', 'CloseConsole', 'CloseDatabase', 'CloseFile', 'CloseFont', 'CloseGadgetList', 'CloseHelp', 'CloseLibrary', 'CloseNetworkConnection', 'CloseNetworkServer', 'ClosePack', 'ClosePreferences', 'CloseRichEdit', 'CloseScreen', 'CloseSubMenu', 'CloseTreeGadgetNode', 'CloseWindow', 'ColorRequester', 'ComboBoxGadget', 'CompareMemory', 'CompareMemoryString', 'ConsoleColor', 'ConsoleCursor', 'ConsoleLocate', 'ConsoleTitle', 'ContainerGadget', 'CopyDirectory', 'CopyEntity', 'CopyFile', 'CopyImage', 'CopyLight', 'CopyMaterial', 'CopyMemory', 'CopyMemoryString', 'CopyMesh', 'CopySprite', 'CopyTexture', 'Cos', 'CountBillboards', 'CountGadgetItems', 'CountLibraryFunctions', 'CountList', 'CountMaterialLayers', 'CountRenderedTriangles', 'CountString', 'CountTreeGadgetNodeItems', 'CreateBillboardGroup', 'CreateCamera', 'CreateDirectory', 'CreateEntity', 'CreateFile', 'CreateGadgetList', 'CreateImage', 'CreateLight', 'CreateMaterial', 'CreateMenu', 'CreateMesh', 'CreateNetworkServer', 'CreatePack', 'CreatePalette', 'CreateParticleEmitter', 'CreatePopupMenu', 'CreatePreferences', 'CreateSprite', 'CreateSprite3D', 'CreateStatusBar', 'CreateTerrain', 'CreateTexture', 'CreateThread', 'CreateToolBar', 'DESFingerprint', 'DatabaseColumnName', 'DatabaseColumnType', 'DatabaseColumns', 'DatabaseDriverDescription', 'DatabaseDriverName', 'DatabaseError', 'DatabaseQuery', 'DatabaseUpdate', 'Date', 'Day', 'DayOfWeek', 'DayOfYear', 'DefaultPrinter', 'Delay', 'DeleteDirectory', 'DeleteElement', 'DeleteFile', 'DetachMenu', 'DirectoryEntryAttributes', 'DirectoryEntryAttributes', 'DirectoryEntryName', 'DirectoryEntrySize', 'DisASMCommand', 'DisableGadget', 'DisableMaterialLighting', 'DisableMenuItem', 'DisableToolBarButton', 'DisplayAlphaSprite', 'DisplayAlphaSprite', 'DisplayPalette', 'DisplayPopupMenu', 'DisplayRGBFilter', 'DisplayShadowSprite', 'DisplayShadowSprite', 'DisplaySolidSprite', 'DisplaySprite', 'DisplaySprite3D', 'DisplayTranslucideSprite', 'DisplayTransparentSprite', 'DrawImage', 'DrawText', 'DrawingBuffer', 'DrawingBufferPitch', 'DrawingBufferPixelFormat', 'DrawingFont', 'DrawingMode', 'EditorGadget', 'EjectCDAudio', 'ElapsedMilliseconds', 'Ellipse', 'EndTimer', 'Engine3DFrameRate', 'EntityAnimationLength', 'EntityLocate', 'EntityMaterial', 'EntityMesh', 'EntityX', 'EntityY', 'EntityZ', 'Eof', 'EventGadgetID', 'EventMenuID', 'EventType', 'EventWindowID', 'EventlParam', 'EventwParam', 'ExamineDatabaseDrivers', 'ExamineDirectory', 'ExamineIPAddresses', 'ExamineJoystick', 'ExamineKeyboard', 'ExamineLibraryFunctions', 'ExamineMouse', 'ExamineScreenModes', 'ExplorerComboGadget', 'ExplorerListGadget', 'ExplorerTreeGadget', 'FileSeek', 'FileSize', 'FillArea', 'FindString', 'FindText', 'FirstDatabaseRow', 'FirstElement', 'FlipBuffers', 'Fog', 'FontDialog', 'FontID', 'FontRequester', 'FormatDate', 'Frame3DGadget', 'FreeBillboardGroup', 'FreeCamera', 'FreeEntity', 'FreeGadget', 'FreeImage', 'FreeLight', 'FreeMaterial', 'FreeMemory', 'FreeMenu', 'FreeMesh', 'FreeModule', 'FreeMovie', 'FreePalette', 'FreeParticleEmitter', 'FreeSound', 'FreeSprite', 'FreeSprite3D', 'FreeStatusBar', 'FreeTexture', 'FreeToolBar', 'FrontColor', 'GadgetHeight', 'GadgetID', 'GadgetItemID', 'GadgetToolTip', 'GadgetWidth', 'GadgetX', 'GadgetY', 'GetClipboardData', 'GetClipboardText', 'GetCurrentEIP', 'GetDatabaseFloat', 'GetDatabaseLong', 'GetDatabaseString', 'GetDisASMString', 'GetEntityAnimationTime', 'GetErrorAddress', 'GetErrorCounter', 'GetErrorDLL', 'GetErrorDescription', 'GetErrorLineNR', 'GetErrorModuleName', 'GetErrorNumber', 'GetErrorRegister', 'GetExtensionPart', 'GetFilePart', 'GetGadgetAttribute', 'GetGadgetItemAttribute', 'GetGadgetItemState', 'GetGadgetItemText', 'GetGadgetState', 'GetGadgetText', 'GetMaxTimerResolution', 'GetMenuItemState', 'GetMinTimerResolution', 'GetModulePosition', 'GetModuleRow', 'GetPaletteColor', 'GetPathPart', 'GetRichEditStyle', 'GetRichEditText', 'GetSelectedText', 'GetWindowTitle', 'GoToEIP', 'GrabImage', 'GrabSprite', 'Green', 'Hex', 'HideBillboardGroup', 'HideEntity', 'HideGadget', 'HideLight', 'HideMenu', 'HideParticleEmitter', 'HideWindow', 'Hostname', 'Hour', 'HyperLinkGadget', 'IPAddressField', 'IPAddressGadget', 'IPString', 'IPString', 'ImageDepth', 'ImageGadget', 'ImageHeight', 'ImageID', 'ImageOutput', 'ImageWidth', 'InitCDAudio', 'InitDatabase', 'InitEngine3D', 'InitJoystick', 'InitKeyboard', 'InitModule', 'InitMouse', 'InitMovie', 'InitNetwork', 'InitPalette', 'InitSound', 'InitSprite', 'InitSprite3D', 'Inkey', 'Input', 'InputRequester', 'InsertElement', 'Int', 'IsDatabase', 'IsDirectory', 'IsFile', 'IsFilename', 'IsFont', 'IsFunction', 'IsFunctionEntry', 'IsGadget', 'IsImage', 'IsLibrary', 'IsMenu', 'IsModule', 'IsMovie', 'IsPalette', 'IsScreenActive', 'IsSprite', 'IsSprite3D', 'IsStatusBar', 'IsSysTrayIcon', 'IsToolBar', 'IsWindow', 'JoystickAxisX', 'JoystickAxisY', 'JoystickButton', 'KeyboardInkey', 'KeyboardMode', 'KeyboardPushed', 'KeyboardReleased', 'KillThread', 'LCase', 'LSet', 'LTrim', 'LastElement', 'Left', 'Len', 'LibraryFunctionAddress', 'LibraryFunctionName', 'LightColor', 'LightLocate', 'LightSpecularColor', 'Line', 'LineXY', 'ListIconGadget', 'ListIndex', 'ListViewGadget', 'LoadFont', 'LoadImage', 'LoadMesh', 'LoadModule', 'LoadMovie', 'LoadPalette', 'LoadSound', 'LoadSprite', 'LoadTexture', 'LoadWorld', 'Loc', 'Locate', 'Lof', 'Log', 'Log10', 'MD5FileFingerprint', 'MD5Fingerprint', 'MDIGadget', 'MakeIPAddress', 'MakeIPAddress', 'MaterialAmbientColor', 'MaterialBlendingMode', 'MaterialDiffuseColor', 'MaterialFilteringMode', 'MaterialID', 'MaterialShadingMode', 'MaterialSpecularColor', 'MemoryStringLength', 'MenuBar', 'MenuHeight', 'MenuID', 'MenuItem', 'MenuTitle', 'MeshID', 'MessageRequester', 'Mid', 'Minute', 'ModuleVolume', 'Month', 'MouseButton', 'MouseDeltaX', 'MouseDeltaY', 'MouseLocate', 'MouseWheel', 'MouseX', 'MouseY', 'MoveBillboard', 'MoveBillboardGroup', 'MoveCamera', 'MoveEntity', 'MoveLight', 'MoveParticleEmitter', 'MoveWindow', 'MovieAudio', 'MovieHeight', 'MovieInfo', 'MovieLength', 'MovieSeek', 'MovieStatus', 'MovieWidth', 'NetworkClientEvent', 'NetworkClientID', 'NetworkServerEvent', 'NewPrinterPage', 'NextDatabaseDriver', 'NextDatabaseRow', 'NextDirectoryEntry', 'NextElement', 'NextIPAddress', 'NextLibraryFunction', 'NextPackFile', 'NextScreenMode', 'NextSelectedFileName', 'OSVersion', 'OffsetOf', 'OnErrorExit', 'OnErrorGosub', 'OnErrorGoto', 'OnErrorResume', 'OpenComPort', 'OpenConsole', 'OpenDatabase', 'OpenDatabaseRequester', 'OpenFile', 'OpenFileRequester', 'OpenGadgetList', 'OpenHelp', 'OpenLibrary', 'OpenNetworkConnection', 'OpenPack', 'OpenPreferences', 'OpenRichEdit', 'OpenScreen', 'OpenSubMenu', 'OpenTreeGadgetNode', 'OpenWindow', 'OpenWindowedScreen', 'OptionGadget', 'PackFileSize', 'PackMemory', 'PackerCallback', 'PanelGadget', 'ParseDate', 'ParticleColorFader', 'ParticleColorRange', 'ParticleEmissionRate', 'ParticleEmitterLocate', 'ParticleEmitterX', 'ParticleEmitterY', 'ParticleEmitterZ', 'ParticleMaterial', 'ParticleSize', 'ParticleTimeToLive', 'ParticleVelocity', 'PathRequester', 'PauseCDAudio', 'PauseMovie', 'PauseThread', 'PeekB', 'PeekF', 'PeekL', 'PeekS', 'PeekW', 'PlayCDAudio', 'PlayModule', 'PlayMovie', 'PlaySound', 'Plot', 'Point', 'PokeB', 'PokeF', 'PokeL', 'PokeS', 'PokeW', 'Pow', 'PreferenceComment', 'PreferenceGroup', 'PreviousDatabaseRow', 'PreviousElement', 'Print', 'PrintN', 'PrintRequester', 'PrinterOutput', 'PrinterPageHeight', 'PrinterPageWidth', 'ProgramParameter', 'ProgressBarGadget', 'RGB', 'RSet', 'RTrim', 'Random', 'RandomSeed', 'ReAllocateMemory', 'ReadByte', 'ReadData', 'ReadFile', 'ReadFloat', 'ReadLong', 'ReadPreferenceFloat', 'ReadPreferenceLong', 'ReadPreferenceString', 'ReadString', 'ReadWord', 'ReceiveNetworkData', 'ReceiveNetworkFile', 'Red', 'ReleaseMouse', 'RemoveBillboard', 'RemoveGadgetColumn', 'RemoveGadgetItem', 'RemoveKeyboardShortcut', 'RemoveMaterialLayer', 'RemoveString', 'RemoveSysTrayIcon', 'RenameFile', 'RenderMovieFrame', 'RenderWorld', 'ReplaceString', 'ReplaceText', 'ResetList', 'ResizeBillboard', 'ResizeEntity', 'ResizeGadget', 'ResizeImage', 'ResizeMovie', 'ResizeParticleEmitter', 'ResizeRichEdit', 'ResizeWindow', 'ResumeCDAudio', 'ResumeMovie', 'ResumeThread', 'RichEditBackground', 'RichEditBackgroundColor', 'RichEditFont', 'RichEditFontFace', 'RichEditFontSize', 'RichEditHeight', 'RichEditID', 'RichEditIndex', 'RichEditLocate', 'RichEditMouseX', 'RichEditMouseY', 'RichEditOptions', 'RichEditParent', 'RichEditTextColor', 'RichEditWidth', 'RichEditX', 'RichEditY', 'Right', 'RotateBillboardGroup', 'RotateCamera', 'RotateEntity', 'RotateMaterial', 'RotateParticleEmitter', 'RotateSprite3D', 'Round', 'RunProgram', 'SaveFileRequester', 'SaveImage', 'SaveSprite', 'ScaleEntity', 'ScaleMaterial', 'ScreenID', 'ScreenModeDepth', 'ScreenModeHeight', 'ScreenModeRefreshRate', 'ScreenModeWidth', 'ScreenOutput', 'ScrollAreaGadget', 'ScrollBarGadget', 'ScrollMaterial', 'Second', 'SelectElement', 'SelectText', 'SelectedFilePattern', 'SelectedFontColor', 'SelectedFontName', 'SelectedFontSize', 'SelectedFontStyle', 'SelectedRange', 'SendNetworkData', 'SendNetworkFile', 'SendNetworkString', 'Set/GetWindowTitle', 'SetClipboardData', 'SetClipboardText', 'SetEntityAnimationTime', 'SetErrorNumber', 'SetFrameRate', 'SetGadgetAttribute', 'SetGadgetFont', 'SetGadgetItemAttribute', 'SetGadgetItemState', 'SetGadgetItemText', 'SetGadgetState', 'SetGadgetText', 'SetMenuItemState', 'SetMeshData', 'SetModulePosition', 'SetPaletteColor', 'SetRefreshRate', 'SetRichEditCallback', 'SetRichEditText', 'SetWindowCallback', 'SetWindowTitle', 'Sin', 'SizeOf', 'SkyBox', 'SkyDome', 'SortArray', 'SortList', 'SoundFrequency', 'SoundPan', 'SoundVolume', 'Space', 'SpinGadget', 'SplitterGadget', 'Sprite3DBlendingMode', 'Sprite3DQuality', 'SpriteCollision', 'SpriteDepth', 'SpriteHeight', 'SpriteOutput', 'SpritePixelCollision', 'SpriteWidth', 'Sqr', 'Start3D', 'StartDrawing', 'StartPrinting', 'StartSpecialFX', 'StartTimer', 'StatusBarIcon', 'StatusBarText', 'Stop3D', 'StopCDAudio', 'StopDrawing', 'StopModule', 'StopMovie', 'StopPrinting', 'StopSound', 'StopSpecialFX', 'Str', 'StrF', 'StrU', 'StreamFileIn', 'StreamFileOut', 'StringField', 'StringGadget', 'SysTrayIconToolTip', 'Tan', 'TerrainHeight', 'TextGadget', 'TextLength', 'TextureHeight', 'TextureID', 'TextureOutput', 'TextureWidth', 'ThreadPriority', 'ToolBarImageButton', 'ToolBarSeparator', 'ToolBarStandardButton', 'ToolBarToolTip', 'TrackBarGadget', 'TransformSprite3D', 'TransparentSpriteColor', 'TreeGadget', 'TreeGadgetItemNumber', 'Trim', 'UCase', 'UnpackMemory', 'UseBuffer', 'UseCDAudio', 'UseDatabase', 'UseDirectory', 'UseFile', 'UseFont', 'UseGadgetList', 'UseImage', 'UseJPEGImageDecoder', 'UseJPEGImageEncoder', 'UseMovie', 'UseOGGSoundDecoder', 'UsePNGImageDecoder', 'UsePNGImageEncoder', 'UsePalette', 'UseRichEdit', 'UseTGAImageDecoder', 'UseTIFFImageDecoder', 'UseWindow', 'Val', 'ValF', 'WaitThread', 'WaitWindowEvent', 'WebGadget', 'WindowEvent', 'WindowHeight', 'WindowID', 'WindowMouseX', 'WindowMouseY', 'WindowOutput', 'WindowWidth', 'WindowX', 'WindowY', 'WriteByte', 'WriteData', 'WriteFloat', 'WriteLong', 'WritePreferenceFloat', 'WritePreferenceLong', 'WritePreferenceString', 'WriteString', 'WriteStringN', 'WriteWord', 'Year', 'ZoomSprite3D', ); $self->listAdd('keywords', 'Break', 'Case', 'CompilerCase', 'CompilerDefault', 'CompilerElse', 'CompilerEndIf', 'CompilerEndSelect', 'CompilerIf', 'CompilerSelect', 'Continue', 'Data', 'DataSection', 'Debug', 'Declare', 'DefType', 'Default', 'Dim', 'Else', 'ElseIf', 'End', 'EndDataSection', 'EndEnumeration', 'EndIf', 'EndInterface', 'EndProcedure', 'EndSelect', 'EndStructure', 'Enumeration', 'Extends', 'FakeReturn', 'For', 'ForEach', 'Global', 'Gosub', 'Goto', 'If', 'IncludeBinary', 'IncludeFile', 'IncludePath', 'Interface', 'NewList', 'Next', 'Procedure', 'ProcedureDLL', 'ProcedureReturn', 'Protected', 'Read', 'Repeat', 'Restore', 'Return', 'Select', 'Shared', 'Static', 'Step', 'Structure', 'To', 'Until', 'Wend', 'While', 'XIncludeFile', ); $self->contextdata({ 'Comment1' => { callback => \&parseComment1, attribute => 'Comment', lineending => '#pop', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'String' => { callback => \&parseString, attribute => 'String', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'PureBasic'; } sub parseComment1 { my ($self, $text) = @_; # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # String => '\b(if)([\s]|$)' # attribute => 'Keyword' # beginRegion => 'IfRegion' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(if)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(endif)([\s]|$)' # attribute => 'Keyword' # context => '#stay' # endRegion => 'IfRegion' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(endif)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(while)([\s]|$)' # attribute => 'Keyword' # beginRegion => 'WhileRegion' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(while)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(wend)([\s]|$)' # attribute => 'Keyword' # context => '#stay' # endRegion => 'WhileRegion' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(wend)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(repeat)([\s]|$)' # attribute => 'Keyword' # beginRegion => 'RepeatRegion' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(repeat)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(until)([\s]|$)' # attribute => 'Keyword' # context => '#stay' # endRegion => 'RepeatRegion' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(until)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(select)([\s]|$)' # attribute => 'Keyword' # beginRegion => 'SelectRegion' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(select)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(endselect)([\s]|$)' # attribute => 'Keyword' # context => '#stay' # endRegion => 'SelectRegion' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(endselect)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(for|foreach)([\s]|$)' # attribute => 'Keyword' # beginRegion => 'ForRegion' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(for|foreach)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(next)([\s]|$)' # attribute => 'Keyword' # context => '#stay' # endRegion => 'ForRegion' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(next)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(procedure|proceduredll)([.\s]|$)' # attribute => 'Keyword' # beginRegion => 'ProcedureRegion' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(procedure|proceduredll)([.\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(endprocedure)([\s]|$)' # attribute => 'Keyword' # context => '#stay' # endRegion => 'ProcedureRegion' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(endprocedure)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(structure)([\s]|$)' # attribute => 'Keyword' # beginRegion => 'StructureRegion' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(structure)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(endstructure)([\s]|$)' # attribute => 'Keyword' # context => '#stay' # endRegion => 'StructureRegion' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(endstructure)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(interface)([\s]|$)' # attribute => 'Keyword' # beginRegion => 'InterfaceRegion' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(interface)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(endinterface)([\s]|$)' # attribute => 'Keyword' # context => '#stay' # endRegion => 'InterfaceRegion' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(endinterface)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(enumeration)([\s]|$)' # attribute => 'Keyword' # beginRegion => 'EnumerationRegion' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(enumeration)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(endenumeration)([\s]|$)' # attribute => 'Keyword' # context => '#stay' # endRegion => 'EnumerationRegion' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(endenumeration)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(datasection)([\s]|$)' # attribute => 'Keyword' # beginRegion => 'DataSectionRegion' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(datasection)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(enddatasection)([\s]|$)' # attribute => 'Keyword' # context => '#stay' # endRegion => 'DataSectionRegion' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(enddatasection)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(compilerif)([\s]|$)' # attribute => 'Keyword' # beginRegion => 'CompilerIfRegion' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(compilerif)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(compilerendif)([\s]|$)' # attribute => 'Keyword' # context => '#stay' # endRegion => 'CompilerIfRegion' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(compilerendif)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(compilerselect)([\s]|$)' # attribute => 'Keyword' # beginRegion => 'CompilerSelectRegion' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(compilerselect)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(compilerendselect)([\s]|$)' # attribute => 'Keyword' # context => '#stay' # endRegion => 'CompilerEndSelectRegion' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(compilerendselect)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'functions' # attribute => 'Functions' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Functions')) { return 1 } # String => '\#+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*' # attribute => 'Constant' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\#+[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*', 0, 0, 0, undef, 0, '#stay', 'Constant')) { return 1 } # attribute => 'Number' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Number')) { return 1 } # attribute => 'Number' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Number')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # String => '^\s*;+\s*BEGIN.*$' # attribute => 'Region Marker' # beginRegion => 'marker' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '^\\s*;+\\s*BEGIN.*$', 0, 0, 0, undef, 0, '#stay', 'Region Marker')) { return 1 } # String => '^\s*;+\s*END.*$' # attribute => 'Region Marker' # context => '#stay' # endRegion => 'marker' # type => 'RegExpr' if ($self->testRegExpr($text, '^\\s*;+\\s*END.*$', 0, 0, 0, undef, 0, '#stay', 'Region Marker')) { return 1 } # attribute => 'Comment' # char => ';' # context => 'Comment1' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, 'Comment1', 'Comment')) { return 1 } return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::PureBasic - a Plugin for PureBasic syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::PureBasic; my $sh = new Syntax::Highlight::Engine::Kate::PureBasic([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::PureBasic is a plugin module that provides syntax highlighting for PureBasic to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Txt2tags.pm0000644000175000017500000002054213226470762026400 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'txt2tags.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.01 #kate version 2.4 #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::Txt2tags; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Bar' => 'IString', 'Bold' => 'Float', 'BoldItalic' => 'Operator', 'Comment' => 'Comment', 'Date' => 'BaseN', 'DefList' => 'Reserved', 'Italic' => 'DecVal', 'Link' => 'Variable', 'List' => 'Reserved', 'Monospaced' => 'Others', 'Normal' => 'Normal', 'NumList' => 'Reserved', 'Quote' => 'Function', 'Tabel' => 'BString', 'Title' => 'Keyword', 'Verbatim Area' => 'String', 'Verbatim Line' => 'String', }); $self->contextdata({ 'Context' => { callback => \&parseContext, attribute => 'Normal', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Context'); $self->keywordscase(1); $self->initialize; bless ($self, $class); return $self; } sub language { return 'txt2tags'; } sub parseContext { my ($self, $text) = @_; # String => '%%date(\(.*\))?' # attribute => 'Date' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, '%%date(\\(.*\\))?', 0, 0, 0, undef, 0, 'Context', 'Date')) { return 1 } # String => '%.*' # attribute => 'Comment' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, '%.*', 0, 0, 0, undef, 0, 'Context', 'Comment')) { return 1 } # String => '\*\*.*\*\*' # attribute => 'Bold' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, '\\*\\*.*\\*\\*', 0, 0, 0, undef, 0, 'Context', 'Bold')) { return 1 } # String => '//.*//' # attribute => 'Italic' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, '//.*//', 0, 0, 0, undef, 0, 'Context', 'Italic')) { return 1 } # String => '\*\*//.*//\*\*' # attribute => 'BoldItalic' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, '\\*\\*//.*//\\*\\*', 0, 0, 0, undef, 0, 'Context', 'BoldItalic')) { return 1 } # String => '__.*__' # attribute => 'BoldItalic' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, '__.*__', 0, 0, 0, undef, 0, 'Context', 'BoldItalic')) { return 1 } # String => '``.*``' # attribute => 'Monospaced' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, '``.*``', 0, 0, 0, undef, 0, 'Context', 'Monospaced')) { return 1 } # String => '``` .*' # attribute => 'Verbatim Line' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, '``` .*', 0, 0, 0, undef, 0, 'Context', 'Verbatim Line')) { return 1 } # String => ' *=[^=].*[^=]=\s*$' # attribute => 'Title' # column => '0' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, ' *=[^=].*[^=]=\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) { return 1 } # String => ' *==[^=].*[^=]==\s*$' # attribute => 'Title' # column => '0' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, ' *==[^=].*[^=]==\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) { return 1 } # String => ' *===[^=].*[^=]===\s*$' # attribute => 'Title' # column => '0' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, ' *===[^=].*[^=]===\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) { return 1 } # String => ' *====[^=].*[^=]====\s*$' # attribute => 'Title' # column => '0' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, ' *====[^=].*[^=]====\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) { return 1 } # String => ' *=====[^=].*[^=]=====\s*$' # attribute => 'Title' # column => '0' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, ' *=====[^=].*[^=]=====\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) { return 1 } # String => ' *\+[^=].*[^=]\+\s*$' # attribute => 'Title' # column => '0' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, ' *\\+[^=].*[^=]\\+\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) { return 1 } # String => ' *\+\+[^=].*[^=]\+\+\s*$' # attribute => 'Title' # column => '0' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, ' *\\+\\+[^=].*[^=]\\+\\+\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) { return 1 } # String => ' *\+\+\+[^=].*[^=]\+\+\+\s*$' # attribute => 'Title' # column => '0' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, ' *\\+\\+\\+[^=].*[^=]\\+\\+\\+\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) { return 1 } # String => ' *\+\+\+\+[^=].*[^=]\+\+\+\+\s*$' # attribute => 'Title' # column => '0' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, ' *\\+\\+\\+\\+[^=].*[^=]\\+\\+\\+\\+\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) { return 1 } # String => ' *\+\+\+\+\+[^=].*[^=]\+\+\+\+\+\s*$' # attribute => 'Title' # column => '0' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, ' *\\+\\+\\+\\+\\+[^=].*[^=]\\+\\+\\+\\+\\+\\s*$', 0, 0, 0, 0, 0, 'Context', 'Title')) { return 1 } # attribute => 'Link' # char => '[' # char1 => ']' # type => 'RangeDetect' if ($self->testRangeDetect($text, '[', ']', 0, 0, undef, 0, '#stay', 'Link')) { return 1 } # String => ' *\|\| .*' # attribute => 'Tabel' # column => '0' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, ' *\\|\\| .*', 0, 0, 0, 0, 0, 'Context', 'Tabel')) { return 1 } # String => ' *\| .*' # attribute => 'Tabel' # column => '0' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, ' *\\| .*', 0, 0, 0, 0, 0, 'Context', 'Tabel')) { return 1 } # String => ' *\: .*' # attribute => 'DefList' # column => '0' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, ' *\\: .*', 0, 0, 0, 0, 0, 'Context', 'DefList')) { return 1 } # String => ' *\- .*' # attribute => 'List' # column => '0' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, ' *\\- .*', 0, 0, 0, 0, 0, 'Context', 'List')) { return 1 } # String => ' *\+ .*' # attribute => 'NumList' # column => '0' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, ' *\\+ .*', 0, 0, 0, 0, 0, 'Context', 'NumList')) { return 1 } # String => '\t.*' # attribute => 'Quote' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, '\\t.*', 0, 0, 0, undef, 0, 'Context', 'Quote')) { return 1 } # String => '\s*([_=-]{20,})\s*$' # attribute => 'Bar' # context => 'Context' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*([_=-]{20,})\\s*$', 0, 0, 0, undef, 0, 'Context', 'Bar')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Txt2tags - a Plugin for txt2tags syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Txt2tags; my $sh = new Syntax::Highlight::Engine::Kate::Txt2tags([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Txt2tags is a plugin module that provides syntax highlighting for txt2tags to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Eiffel.pm0000644000175000017500000001255013226470762026052 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'eiffel.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.02 #kate version 2.1 #kate author Sebastian Vuorinen #generated: Sun Feb 3 22:02:04 2008, localtime package Syntax::Highlight::Engine::Kate::Eiffel; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Assertions' => 'Others', 'Char' => 'Char', 'Comment' => 'Comment', 'Decimal' => 'DecVal', 'Float' => 'Float', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Predefined entities' => 'Others', 'String' => 'String', }); $self->listAdd('assertions', 'check', 'ensure', 'invariant', 'require', 'variant', ); $self->listAdd('keywords', 'agent', 'alias', 'all', 'and', 'as', 'assign', 'class', 'convert', 'create', 'creation', 'debug', 'deferred', 'do', 'else', 'elseif', 'end', 'expanded', 'export', 'external', 'feature', 'from', 'frozen', 'if', 'implies', 'indexing', 'infix', 'inherit', 'inspect', 'is', 'like', 'local', 'loop', 'not', 'obsolete', 'old', 'once', 'or', 'prefix', 'pure', 'redefine', 'reference', 'rename', 'rescue', 'retry', 'separate', 'then', 'undefine', ); $self->listAdd('predefined-entities', 'Current', 'False', 'Precursor', 'Result', 'TUPLE', 'True', ); $self->contextdata({ 'Documentation' => { callback => \&parseDocumentation, attribute => 'Comment', lineending => '#pop', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'Quoted String' => { callback => \&parseQuotedString, attribute => 'String', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Eiffel'; } sub parseDocumentation { my ($self, $text) = @_; return 0; }; sub parseNormal { my ($self, $text) = @_; # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'predefined-entities' # attribute => 'Predefined entities' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'predefined-entities', 0, undef, 0, '#stay', 'Predefined entities')) { return 1 } # String => 'assertions' # attribute => 'Assertions' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'assertions', 0, undef, 0, '#stay', 'Assertions')) { return 1 } # attribute => 'Decimal' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # attribute => 'Float' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { return 1 } # attribute => 'Char' # context => '#stay' # type => 'HlCChar' if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'String' # char => '"' # context => 'Quoted String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'Quoted String', 'String')) { return 1 } # attribute => 'Comment' # char => '-' # char1 => '-' # context => 'Documentation' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, 'Documentation', 'Comment')) { return 1 } return 0; }; sub parseQuotedString { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Eiffel - a Plugin for Eiffel syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Eiffel; my $sh = new Syntax::Highlight::Engine::Kate::Eiffel([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Eiffel is a plugin module that provides syntax highlighting for Eiffel to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/GDL.pm0000644000175000017500000010055313226470762025267 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'gdl.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.01 #kate version 2.0 #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::GDL; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Char' => 'Char', 'Comment' => 'Comment', 'Datatype' => 'DataType', 'Float' => 'Float', 'Integer' => 'DecVal', 'Keyword' => 'Keyword', 'Normal' => 'Normal', 'String' => 'String', 'Value' => 'Others', }); $self->listAdd('algorithms', 'dfs', 'forcedir', 'maxdegree', 'maxdepth', 'maxdepthslow', 'maxindegree', 'maxoutdegree', 'minbackward', 'mindegree', 'mindepth', 'mindepthslow', 'minindegree', 'minoutdegree', 'normal', 'tree', ); $self->listAdd('colors', 'aquamarine', 'black', 'blue', 'cyan', 'darkblue', 'darkcyan', 'darkgray', 'darkgreen', 'darkgrey', 'darkmagenta', 'darkred', 'darkyellow', 'gold', 'green', 'khaki', 'lightblue', 'lightcyan', 'lightgray', 'lightgreen', 'lightgrey', 'lightmagenta', 'lightred', 'lightyellow', 'lilac', 'magenta', 'orange', 'orchid', 'pink', 'purple', 'red', 'turquoise', 'white', 'yellow', 'yellowgreen', ); $self->listAdd('fisheye', 'cfish', 'dcfish', 'dpfish', 'fcfish', 'fpfish', 'pfish', ); $self->listAdd('forcedir', 'attraction', 'randomfactor', 'randomimpulse', 'randomrounds', 'repulsion', 'tempmax', 'tempmin', 'tempscheme', 'temptreshold', ); $self->listAdd('lines', 'continuous', 'dashed', 'dotted', 'double', 'invisible', 'solid', 'triple', ); $self->listAdd('magnetic', 'circular', 'no', 'orthogonal', 'polar', 'polcircular', ); $self->listAdd('orientation', 'bottom_to_top', 'bottomtotop', 'left_to_right', 'lefttoright', 'right_to_left', 'righttoleft', 'top_to_bottom', 'toptobottom', ); $self->listAdd('shapes', 'box', 'circle', 'ellipse', 'hexagon', 'lparallelogram', 'rhomb', 'rhomboid', 'rparallelogram', 'trapeze', 'trapezoid', 'triangle', 'uptrapeze', 'uptrapezoid', ); $self->listAdd('states', 'boxed', 'clustered', 'exclusive', 'folded', 'unfolded', 'white', 'wrapped', ); $self->contextdata({ 'algid' => { callback => \&parsealgid, attribute => 'Normal', }, 'arrow' => { callback => \&parsearrow, attribute => 'Normal', }, 'arrowmode' => { callback => \&parsearrowmode, attribute => 'Normal', }, 'boolean' => { callback => \&parseboolean, attribute => 'Normal', }, 'ccomment' => { callback => \&parseccomment, attribute => 'Comment', lineending => 'default', }, 'cecolon' => { callback => \&parsececolon, attribute => 'Normal', }, 'centry' => { callback => \&parsecentry, attribute => 'Normal', lineending => 'default', }, 'classname' => { callback => \&parseclassname, attribute => 'Normal', }, 'colorid' => { callback => \&parsecolorid, attribute => 'Normal', }, 'cppcomment' => { callback => \&parsecppcomment, attribute => 'Comment', }, 'default' => { callback => \&parsedefault, attribute => 'Normal', }, 'fishid' => { callback => \&parsefishid, attribute => 'Normal', }, 'floatval' => { callback => \&parsefloatval, attribute => 'Normal', }, 'fontbase' => { callback => \&parsefontbase, attribute => 'Normal', }, 'fontlq' => { callback => \&parsefontlq, attribute => 'Normal', }, 'fontsize' => { callback => \&parsefontsize, attribute => 'Normal', }, 'intval' => { callback => \&parseintval, attribute => 'Normal', }, 'lineid' => { callback => \&parselineid, attribute => 'Normal', }, 'longint' => { callback => \&parselongint, attribute => 'Normal', lineending => 'default', }, 'lquote' => { callback => \&parselquote, attribute => 'Normal', }, 'magnor' => { callback => \&parsemagnor, attribute => 'Normal', }, 'nodealign' => { callback => \&parsenodealign, attribute => 'Normal', }, 'nodelevel' => { callback => \&parsenodelevel, attribute => 'Normal', }, 'orient' => { callback => \&parseorient, attribute => 'Normal', }, 'rgb' => { callback => \&parsergb, attribute => 'Normal', }, 'scaling' => { callback => \&parsescaling, attribute => 'Normal', }, 'shapeid' => { callback => \&parseshapeid, attribute => 'Normal', }, 'stateid' => { callback => \&parsestateid, attribute => 'Normal', }, 'string' => { callback => \&parsestring, attribute => 'String', }, 'textmode' => { callback => \&parsetextmode, attribute => 'Normal', }, 'weight' => { callback => \&parseweight, attribute => 'Normal', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('default'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'GDL'; } sub parsealgid { my ($self, $text) = @_; # String => 'algorithms' # attribute => 'Datatype' # context => 'default' # type => 'keyword' if ($self->testKeyword($text, 'algorithms', 0, undef, 0, 'default', 'Datatype')) { return 1 } return 0; }; sub parsearrow { my ($self, $text) = @_; # String => '(solid|line|none)' # attribute => 'Datatype' # context => 'default' # type => 'RegExpr' if ($self->testRegExpr($text, '(solid|line|none)', 0, 0, 0, undef, 0, 'default', 'Datatype')) { return 1 } return 0; }; sub parsearrowmode { my ($self, $text) = @_; # String => '(free|fixed)' # attribute => 'Datatype' # context => 'default' # type => 'RegExpr' if ($self->testRegExpr($text, '(free|fixed)', 0, 0, 0, undef, 0, 'default', 'Datatype')) { return 1 } return 0; }; sub parseboolean { my ($self, $text) = @_; # String => '(yes|no)' # attribute => 'Datatype' # context => 'default' # type => 'RegExpr' if ($self->testRegExpr($text, '(yes|no)', 0, 0, 0, undef, 0, 'default', 'Datatype')) { return 1 } return 0; }; sub parseccomment { my ($self, $text) = @_; return 0; }; sub parsececolon { my ($self, $text) = @_; # attribute => 'Value' # char => ':' # context => 'rgb' # type => 'DetectChar' if ($self->testDetectChar($text, ':', 0, 0, 0, undef, 0, 'rgb', 'Value')) { return 1 } return 0; }; sub parsecentry { my ($self, $text) = @_; # String => '[0-9][0-9]?' # attribute => 'Value' # context => 'cecolon' # type => 'RegExpr' if ($self->testRegExpr($text, '[0-9][0-9]?', 0, 0, 0, undef, 0, 'cecolon', 'Value')) { return 1 } return 0; }; sub parseclassname { my ($self, $text) = @_; # String => '[0-9]+' # attribute => 'Value' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[0-9]+', 0, 0, 0, undef, 0, '#stay', 'Value')) { return 1 } # attribute => 'Value' # char => ':' # context => 'lquote' # type => 'DetectChar' if ($self->testDetectChar($text, ':', 0, 0, 0, undef, 0, 'lquote', 'Value')) { return 1 } return 0; }; sub parsecolorid { my ($self, $text) = @_; # String => 'colors' # attribute => 'Datatype' # context => 'default' # type => 'keyword' if ($self->testKeyword($text, 'colors', 0, undef, 0, 'default', 'Datatype')) { return 1 } # String => '[0-9][0-9]?' # attribute => 'Datatype' # context => 'default' # type => 'RegExpr' if ($self->testRegExpr($text, '[0-9][0-9]?', 0, 0, 0, undef, 0, 'default', 'Datatype')) { return 1 } return 0; }; sub parsecppcomment { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => 'default' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, 'default', 'Comment')) { return 1 } return 0; }; sub parsedefault { my ($self, $text) = @_; # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'ccomment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'ccomment', 'Comment')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '*' # context => 'cppcomment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'cppcomment', 'Comment')) { return 1 } # String => 'focus' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, 'focus', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '(graph|edge|node|region|backedge|(left|right|)(bent|)nearedge):' # attribute => 'Keyword' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(graph|edge|node|region|backedge|(left|right|)(bent|)nearedge):', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'loc *:' # attribute => 'Value' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, 'loc *:', 0, 0, 0, undef, 0, '#stay', 'Value')) { return 1 } # String => 'colorentry' # attribute => 'Value' # context => 'centry' # type => 'StringDetect' if ($self->testStringDetect($text, 'colorentry', 0, 0, 0, undef, 0, 'centry', 'Value')) { return 1 } # String => 'arrow_?mode *:' # attribute => 'Value' # context => 'arrowmode' # type => 'RegExpr' if ($self->testRegExpr($text, 'arrow_?mode *:', 0, 0, 0, undef, 0, 'arrowmode', 'Value')) { return 1 } # String => '(foldnode.|node.|)(text|border|)color *:' # attribute => 'Value' # context => 'colorid' # type => 'RegExpr' if ($self->testRegExpr($text, '(foldnode.|node.|)(text|border|)color *:', 0, 0, 0, undef, 0, 'colorid', 'Value')) { return 1 } # String => '(foldedge.|edge.|)(arrow|backarrow|)color *:' # attribute => 'Value' # context => 'colorid' # type => 'RegExpr' if ($self->testRegExpr($text, '(foldedge.|edge.|)(arrow|backarrow|)color *:', 0, 0, 0, undef, 0, 'colorid', 'Value')) { return 1 } # String => '(foldedge.|edge.|)(arrow|backarrow)style *:' # attribute => 'Value' # context => 'arrow' # type => 'RegExpr' if ($self->testRegExpr($text, '(foldedge.|edge.|)(arrow|backarrow)style *:', 0, 0, 0, undef, 0, 'arrow', 'Value')) { return 1 } # String => '(foldedge.|edge.|)linestyle *:' # attribute => 'Value' # context => 'lineid' # type => 'RegExpr' if ($self->testRegExpr($text, '(foldedge.|edge.|)linestyle *:', 0, 0, 0, undef, 0, 'lineid', 'Value')) { return 1 } # String => '(foldnode.|node.|)borderstyle *:' # attribute => 'Value' # context => 'lineid' # type => 'RegExpr' if ($self->testRegExpr($text, '(foldnode.|node.|)borderstyle *:', 0, 0, 0, undef, 0, 'lineid', 'Value')) { return 1 } # String => 'view *:' # attribute => 'Value' # context => 'fishid' # type => 'RegExpr' if ($self->testRegExpr($text, 'view *:', 0, 0, 0, undef, 0, 'fishid', 'Value')) { return 1 } # String => '(foldnode.|node.|)shape' # attribute => 'Value' # context => 'shapeid' # type => 'RegExpr' if ($self->testRegExpr($text, '(foldnode.|node.|)shape', 0, 0, 0, undef, 0, 'shapeid', 'Value')) { return 1 } # String => '(source|target)(name|)' # attribute => 'Value' # context => 'lquote' # type => 'RegExpr' if ($self->testRegExpr($text, '(source|target)(name|)', 0, 0, 0, undef, 0, 'lquote', 'Value')) { return 1 } # String => 'title *:' # attribute => 'Value' # context => 'lquote' # type => 'RegExpr' if ($self->testRegExpr($text, 'title *:', 0, 0, 0, undef, 0, 'lquote', 'Value')) { return 1 } # String => '(foldnode.|node.|foldedge.|edge.|)label *:' # attribute => 'Value' # context => 'lquote' # type => 'RegExpr' if ($self->testRegExpr($text, '(foldnode.|node.|foldedge.|edge.|)label *:', 0, 0, 0, undef, 0, 'lquote', 'Value')) { return 1 } # String => '(foldnode.|node.|foldedge.|edge.|)fontname *:' # attribute => 'Value' # context => 'fontlq' # type => 'RegExpr' if ($self->testRegExpr($text, '(foldnode.|node.|foldedge.|edge.|)fontname *:', 0, 0, 0, undef, 0, 'fontlq', 'Value')) { return 1 } # String => 'infoname(1|2|3) *:' # attribute => 'Value' # context => 'lquote' # type => 'RegExpr' if ($self->testRegExpr($text, 'infoname(1|2|3) *:', 0, 0, 0, undef, 0, 'lquote', 'Value')) { return 1 } # String => '(foldnode.|node.|)info(1|2|3) *:' # attribute => 'Value' # context => 'lquote' # type => 'RegExpr' if ($self->testRegExpr($text, '(foldnode.|node.|)info(1|2|3) *:', 0, 0, 0, undef, 0, 'lquote', 'Value')) { return 1 } # String => 'spreadlevel *:' # attribute => 'Value' # context => 'intval' # type => 'RegExpr' if ($self->testRegExpr($text, 'spreadlevel *:', 0, 0, 0, undef, 0, 'intval', 'Value')) { return 1 } # String => '(foldnode.|node.|)(level|vertical_?order) *:' # attribute => 'Value' # context => 'nodelevel' # type => 'RegExpr' if ($self->testRegExpr($text, '(foldnode.|node.|)(level|vertical_?order) *:', 0, 0, 0, undef, 0, 'nodelevel', 'Value')) { return 1 } # String => '(foldnode.|node.|foldedge.|edge.|)horizontal_?order *:' # attribute => 'Value' # context => 'intval' # type => 'RegExpr' if ($self->testRegExpr($text, '(foldnode.|node.|foldedge.|edge.|)horizontal_?order *:', 0, 0, 0, undef, 0, 'intval', 'Value')) { return 1 } # String => 'stat(e|us) *:' # attribute => 'Value' # context => 'stateid' # type => 'RegExpr' if ($self->testRegExpr($text, 'stat(e|us) *:', 0, 0, 0, undef, 0, 'stateid', 'Value')) { return 1 } # String => 'layout_?algorithm *:' # attribute => 'Value' # context => 'algid' # type => 'RegExpr' if ($self->testRegExpr($text, 'layout_?algorithm *:', 0, 0, 0, undef, 0, 'algid', 'Value')) { return 1 } # String => 'crossing_?optimization *:' # attribute => 'Value' # context => 'boolean' # type => 'RegExpr' if ($self->testRegExpr($text, 'crossing_?optimization *:', 0, 0, 0, undef, 0, 'boolean', 'Value')) { return 1 } # String => 'crossing_?phase2 *:' # attribute => 'Value' # context => 'boolean' # type => 'RegExpr' if ($self->testRegExpr($text, 'crossing_?phase2 *:', 0, 0, 0, undef, 0, 'boolean', 'Value')) { return 1 } # String => '(dirty_edge_|display_edge_|displayedge|late_edge_|subgraph_?)labels *:' # attribute => 'Value' # context => 'boolean' # type => 'RegExpr' if ($self->testRegExpr($text, '(dirty_edge_|display_edge_|displayedge|late_edge_|subgraph_?)labels *:', 0, 0, 0, undef, 0, 'boolean', 'Value')) { return 1 } # String => 's?manhatt(a|e)n_?edges *:' # attribute => 'Value' # context => 'boolean' # type => 'RegExpr' if ($self->testRegExpr($text, 's?manhatt(a|e)n_?edges *:', 0, 0, 0, undef, 0, 'boolean', 'Value')) { return 1 } # String => '(nodes|near_?edges|edges|splines) *:' # attribute => 'Value' # context => 'boolean' # type => 'RegExpr' if ($self->testRegExpr($text, '(nodes|near_?edges|edges|splines) *:', 0, 0, 0, undef, 0, 'boolean', 'Value')) { return 1 } # String => 'classname' # attribute => 'Value' # context => 'classname' # type => 'RegExpr' if ($self->testRegExpr($text, 'classname', 0, 0, 0, undef, 0, 'classname', 'Value')) { return 1 } # String => 'orientation *:' # attribute => 'Value' # context => 'orient' # type => 'RegExpr' if ($self->testRegExpr($text, 'orientation *:', 0, 0, 0, undef, 0, 'orient', 'Value')) { return 1 } # String => 'node_alignment *:' # attribute => 'Value' # context => 'nodealign' # type => 'RegExpr' if ($self->testRegExpr($text, 'node_alignment *:', 0, 0, 0, undef, 0, 'nodealign', 'Value')) { return 1 } # String => '(foldnode.|node.|)textmode *:' # attribute => 'Value' # context => 'textmode' # type => 'RegExpr' if ($self->testRegExpr($text, '(foldnode.|node.|)textmode *:', 0, 0, 0, undef, 0, 'textmode', 'Value')) { return 1 } # String => 'equal_y_dist *:' # attribute => 'Value' # context => 'boolean' # type => 'RegExpr' if ($self->testRegExpr($text, 'equal_y_dist *:', 0, 0, 0, undef, 0, 'boolean', 'Value')) { return 1 } # String => 'equal_?ydist *:' # attribute => 'Value' # context => 'boolean' # type => 'RegExpr' if ($self->testRegExpr($text, 'equal_?ydist *:', 0, 0, 0, undef, 0, 'boolean', 'Value')) { return 1 } # String => 'crossing_?weight *:' # attribute => 'Value' # context => 'weight' # type => 'RegExpr' if ($self->testRegExpr($text, 'crossing_?weight *:', 0, 0, 0, undef, 0, 'weight', 'Value')) { return 1 } # String => '(fast_?|)icons *:' # attribute => 'Value' # context => 'boolean' # type => 'RegExpr' if ($self->testRegExpr($text, '(fast_?|)icons *:', 0, 0, 0, undef, 0, 'boolean', 'Value')) { return 1 } # String => 'fine_?tuning *:' # attribute => 'Value' # context => 'boolean' # type => 'RegExpr' if ($self->testRegExpr($text, 'fine_?tuning *:', 0, 0, 0, undef, 0, 'boolean', 'Value')) { return 1 } # String => '(f?straight_?|priority_)phase *:' # attribute => 'Value' # context => 'boolean' # type => 'RegExpr' if ($self->testRegExpr($text, '(f?straight_?|priority_)phase *:', 0, 0, 0, undef, 0, 'boolean', 'Value')) { return 1 } # String => 'ignore_?singles *:' # attribute => 'Value' # context => 'boolean' # type => 'RegExpr' if ($self->testRegExpr($text, 'ignore_?singles *:', 0, 0, 0, undef, 0, 'boolean', 'Value')) { return 1 } # String => '(in|out|)port_?sharing *:' # attribute => 'Value' # context => 'boolean' # type => 'RegExpr' if ($self->testRegExpr($text, '(in|out|)port_?sharing *:', 0, 0, 0, undef, 0, 'boolean', 'Value')) { return 1 } # String => 'linear_?segments *:' # attribute => 'Value' # context => 'boolean' # type => 'RegExpr' if ($self->testRegExpr($text, 'linear_?segments *:', 0, 0, 0, undef, 0, 'boolean', 'Value')) { return 1 } # String => '(foldnode.|node.|)(height|width|borderwidth|stretch|shrink) *:' # attribute => 'Value' # context => 'intval' # type => 'RegExpr' if ($self->testRegExpr($text, '(foldnode.|node.|)(height|width|borderwidth|stretch|shrink) *:', 0, 0, 0, undef, 0, 'intval', 'Value')) { return 1 } # String => '(foldedge.|edge.|)(arrowsize|backarrowsize|thickness|class|priority) *:' # attribute => 'Value' # context => 'intval' # type => 'RegExpr' if ($self->testRegExpr($text, '(foldedge.|edge.|)(arrowsize|backarrowsize|thickness|class|priority) *:', 0, 0, 0, undef, 0, 'intval', 'Value')) { return 1 } # String => 'anchor *:' # attribute => 'Value' # context => 'intval' # type => 'RegExpr' if ($self->testRegExpr($text, 'anchor *:', 0, 0, 0, undef, 0, 'intval', 'Value')) { return 1 } # String => 'iconcolors *:' # attribute => 'Value' # context => 'intval' # type => 'RegExpr' if ($self->testRegExpr($text, 'iconcolors *:', 0, 0, 0, undef, 0, 'intval', 'Value')) { return 1 } # String => 'hidden *:' # attribute => 'Value' # context => 'intval' # type => 'RegExpr' if ($self->testRegExpr($text, 'hidden *:', 0, 0, 0, undef, 0, 'intval', 'Value')) { return 1 } # String => 'energetic *:' # attribute => 'Value' # context => 'boolean' # type => 'RegExpr' if ($self->testRegExpr($text, 'energetic *:', 0, 0, 0, undef, 0, 'boolean', 'Value')) { return 1 } # String => 'layout_(up|down|near|spline)factor *:' # attribute => 'Value' # context => 'intval' # type => 'RegExpr' if ($self->testRegExpr($text, 'layout_(up|down|near|spline)factor *:', 0, 0, 0, undef, 0, 'intval', 'Value')) { return 1 } # String => 'border +(x|y) *:' # attribute => 'Value' # context => 'intval' # type => 'RegExpr' if ($self->testRegExpr($text, 'border +(x|y) *:', 0, 0, 0, undef, 0, 'intval', 'Value')) { return 1 } # String => 'splinefactor *:' # attribute => 'Value' # context => 'intval' # type => 'RegExpr' if ($self->testRegExpr($text, 'splinefactor *:', 0, 0, 0, undef, 0, 'intval', 'Value')) { return 1 } # String => '(gravity|tempfactor|treefactor) *:' # attribute => 'Value' # context => 'floatval' # type => 'RegExpr' if ($self->testRegExpr($text, '(gravity|tempfactor|treefactor) *:', 0, 0, 0, undef, 0, 'floatval', 'Value')) { return 1 } # String => '(xspace|xbase|xmax|xraster|x) *:' # attribute => 'Value' # context => 'intval' # type => 'RegExpr' if ($self->testRegExpr($text, '(xspace|xbase|xmax|xraster|x) *:', 0, 0, 0, undef, 0, 'intval', 'Value')) { return 1 } # String => '(yspace|ybase|ymax|yraster|y) *:' # attribute => 'Value' # context => 'intval' # type => 'RegExpr' if ($self->testRegExpr($text, '(yspace|ybase|ymax|yraster|y) *:', 0, 0, 0, undef, 0, 'intval', 'Value')) { return 1 } # String => '(xlraster|xlspace) *:' # attribute => 'Value' # context => 'intval' # type => 'RegExpr' if ($self->testRegExpr($text, '(xlraster|xlspace) *:', 0, 0, 0, undef, 0, 'intval', 'Value')) { return 1 } # String => 'magnetic_force(1|2) *:' # attribute => 'Value' # context => 'intval' # type => 'RegExpr' if ($self->testRegExpr($text, 'magnetic_force(1|2) *:', 0, 0, 0, undef, 0, 'intval', 'Value')) { return 1 } # String => 'magnetic_field(1|2) *:' # attribute => 'Value' # context => 'magnor' # type => 'RegExpr' if ($self->testRegExpr($text, 'magnetic_field(1|2) *:', 0, 0, 0, undef, 0, 'magnor', 'Value')) { return 1 } # String => '(a|b|c|fd|p|r|s)(max) *:' # attribute => 'Value' # context => 'intval' # type => 'RegExpr' if ($self->testRegExpr($text, '(a|b|c|fd|p|r|s)(max) *:', 0, 0, 0, undef, 0, 'intval', 'Value')) { return 1 } # String => '(c|p|r)(min) *:' # attribute => 'Value' # context => 'intval' # type => 'RegExpr' if ($self->testRegExpr($text, '(c|p|r)(min) *:', 0, 0, 0, undef, 0, 'intval', 'Value')) { return 1 } # String => 'forcedir' # attribute => 'Value' # context => 'intval' # type => 'keyword' if ($self->testKeyword($text, 'forcedir', 0, undef, 0, 'intval', 'Value')) { return 1 } # String => 'scaling *:' # attribute => 'Value' # context => 'scaling' # type => 'RegExpr' if ($self->testRegExpr($text, 'scaling *:', 0, 0, 0, undef, 0, 'scaling', 'Value')) { return 1 } # String => 'useraction(name|cmd)(1|2|3|4) *:' # attribute => 'Value' # context => 'lquote' # type => 'RegExpr' if ($self->testRegExpr($text, 'useraction(name|cmd)(1|2|3|4) *:', 0, 0, 0, undef, 0, 'lquote', 'Value')) { return 1 } return 0; }; sub parsefishid { my ($self, $text) = @_; # String => 'fisheye' # attribute => 'Datatype' # context => 'default' # type => 'keyword' if ($self->testKeyword($text, 'fisheye', 0, undef, 0, 'default', 'Datatype')) { return 1 } return 0; }; sub parsefloatval { my ($self, $text) = @_; # attribute => 'Float' # context => 'default' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, 'default', 'Float')) { return 1 } return 0; }; sub parsefontbase { my ($self, $text) = @_; # String => '((tim|ncen)(R|B|I|BI)|(cour|helv)(R|B|O|BO)|symb)' # attribute => 'Datatype' # context => 'fontsize' # type => 'RegExpr' if ($self->testRegExpr($text, '((tim|ncen)(R|B|I|BI)|(cour|helv)(R|B|O|BO)|symb)', 0, 0, 0, undef, 0, 'fontsize', 'Datatype')) { return 1 } return 0; }; sub parsefontlq { my ($self, $text) = @_; # attribute => 'Datatype' # char => '"' # context => 'fontbase' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'fontbase', 'Datatype')) { return 1 } return 0; }; sub parsefontsize { my ($self, $text) = @_; # String => '(08|10|12|14|18|24)(.vcf|)' # attribute => 'Datatype' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(08|10|12|14|18|24)(.vcf|)', 0, 0, 0, undef, 0, '#stay', 'Datatype')) { return 1 } # attribute => 'Datatype' # char => '"' # context => 'default' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'default', 'Datatype')) { return 1 } return 0; }; sub parseintval { my ($self, $text) = @_; # attribute => 'Integer' # context => 'longint' # type => 'Int' if ($self->testInt($text, 0, undef, 0, 'longint', 'Integer')) { return 1 } return 0; }; sub parselineid { my ($self, $text) = @_; # String => 'lines' # attribute => 'Datatype' # context => 'default' # type => 'keyword' if ($self->testKeyword($text, 'lines', 0, undef, 0, 'default', 'Datatype')) { return 1 } return 0; }; sub parselongint { my ($self, $text) = @_; # attribute => 'Integer' # context => 'longint' # type => 'Int' if ($self->testInt($text, 0, undef, 0, 'longint', 'Integer')) { return 1 } # String => '\ ' # attribute => 'Normal' # context => 'default' # type => 'RegExpr' if ($self->testRegExpr($text, '\\ ', 0, 0, 0, undef, 0, 'default', 'Normal')) { return 1 } return 0; }; sub parselquote { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => 'string' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'String')) { return 1 } return 0; }; sub parsemagnor { my ($self, $text) = @_; # String => 'magnetic' # attribute => 'Datatype' # context => 'default' # type => 'keyword' if ($self->testKeyword($text, 'magnetic', 0, undef, 0, 'default', 'Datatype')) { return 1 } # String => 'orientation' # attribute => 'Datatype' # context => 'default' # type => 'keyword' if ($self->testKeyword($text, 'orientation', 0, undef, 0, 'default', 'Datatype')) { return 1 } return 0; }; sub parsenodealign { my ($self, $text) = @_; # String => '(top|center|bottom)' # attribute => 'Datatype' # context => 'default' # type => 'RegExpr' if ($self->testRegExpr($text, '(top|center|bottom)', 0, 0, 0, undef, 0, 'default', 'Datatype')) { return 1 } return 0; }; sub parsenodelevel { my ($self, $text) = @_; # String => 'maxlevel' # attribute => 'Datatype' # context => 'default' # type => 'StringDetect' if ($self->testStringDetect($text, 'maxlevel', 0, 0, 0, undef, 0, 'default', 'Datatype')) { return 1 } # attribute => 'Integer' # context => 'longint' # type => 'Int' if ($self->testInt($text, 0, undef, 0, 'longint', 'Integer')) { return 1 } return 0; }; sub parseorient { my ($self, $text) = @_; # String => 'orientation' # attribute => 'Datatype' # context => 'default' # type => 'keyword' if ($self->testKeyword($text, 'orientation', 0, undef, 0, 'default', 'Datatype')) { return 1 } return 0; }; sub parsergb { my ($self, $text) = @_; # String => '[0-9][0-9]?[0-9]? +[0-9][0-9]?[0-9]? +[0-9][0-9]?[0-9]?' # attribute => 'Integer' # context => 'default' # type => 'RegExpr' if ($self->testRegExpr($text, '[0-9][0-9]?[0-9]? +[0-9][0-9]?[0-9]? +[0-9][0-9]?[0-9]?', 0, 0, 0, undef, 0, 'default', 'Integer')) { return 1 } return 0; }; sub parsescaling { my ($self, $text) = @_; # String => 'maxspect' # attribute => 'Datatype' # context => 'default' # type => 'StringDetect' if ($self->testStringDetect($text, 'maxspect', 0, 0, 0, undef, 0, 'default', 'Datatype')) { return 1 } # attribute => 'Float' # context => 'default' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, 'default', 'Float')) { return 1 } return 0; }; sub parseshapeid { my ($self, $text) = @_; # String => 'shapes' # attribute => 'Datatype' # context => 'default' # type => 'keyword' if ($self->testKeyword($text, 'shapes', 0, undef, 0, 'default', 'Datatype')) { return 1 } return 0; }; sub parsestateid { my ($self, $text) = @_; # String => 'states' # attribute => 'Datatype' # context => 'default' # type => 'keyword' if ($self->testKeyword($text, 'states', 0, undef, 0, 'default', 'Datatype')) { return 1 } return 0; }; sub parsestring { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => 'default' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'default', 'String')) { return 1 } # attribute => 'Char' # char => '\' # char1 => '"' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '"', 0, 0, 0, undef, 0, '#stay', 'Char')) { return 1 } # String => '\\(n|a|t|b)' # attribute => 'Char' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\(n|a|t|b)', 0, 0, 0, undef, 0, '#stay', 'Char')) { return 1 } # String => '\\fi(0|1|2)[0-9][0-9]' # attribute => 'Char' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\fi(0|1|2)[0-9][0-9]', 0, 0, 0, undef, 0, '#stay', 'Char')) { return 1 } # String => '\\f(u|I|b|B|n|[0-9][0-9])' # attribute => 'Char' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\f(u|I|b|B|n|[0-9][0-9])', 0, 0, 0, undef, 0, '#stay', 'Char')) { return 1 } return 0; }; sub parsetextmode { my ($self, $text) = @_; # String => '(center|left_justify|right_justify)' # attribute => 'Datatype' # context => 'default' # type => 'RegExpr' if ($self->testRegExpr($text, '(center|left_justify|right_justify)', 0, 0, 0, undef, 0, 'default', 'Datatype')) { return 1 } return 0; }; sub parseweight { my ($self, $text) = @_; # String => '(medianbary|barymedian|bary|median)' # attribute => 'Datatype' # context => 'default' # type => 'RegExpr' if ($self->testRegExpr($text, '(medianbary|barymedian|bary|median)', 0, 0, 0, undef, 0, 'default', 'Datatype')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::GDL - a Plugin for GDL syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::GDL; my $sh = new Syntax::Highlight::Engine::Kate::GDL([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::GDL is a plugin module that provides syntax highlighting for GDL to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Sieve.pm0000644000175000017500000001563513226470762025742 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'sieve.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.05 #kate version 2.4 #kate author Petter E. Stokke #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::Sieve; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Comment' => 'Comment', 'Decimal' => 'DecVal', 'Function' => 'Function', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'String' => 'String', 'String Char' => 'Char', 'Symbol' => 'Normal', 'Tagged Argument' => 'Others', }); $self->listAdd('keywords', 'discard', 'else', 'elsif', 'fileinto', 'if', 'keep', 'redirect', 'reject', 'require', 'stop', ); $self->contextdata({ 'Comment' => { callback => \&parseComment, attribute => 'Comment', }, 'Member' => { callback => \&parseMember, attribute => 'Normal Text', lineending => '#pop', fallthrough => '#pop', }, 'MultilineString' => { callback => \&parseMultilineString, attribute => 'String', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'String' => { callback => \&parseString, attribute => 'String', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Sieve'; } sub parseComment { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # endRegion => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseMember { my ($self, $text) = @_; # String => '\b[_a-zA-Z]\w*(?=[\s]*)' # attribute => 'Function' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b[_a-zA-Z]\\w*(?=[\\s]*)', 0, 0, 0, undef, 0, '#pop', 'Function')) { return 1 } return 0; }; sub parseMultilineString { my ($self, $text) = @_; # String => '\.$' # attribute => 'String' # column => '0' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\.$', 0, 0, 0, 0, 0, '#pop', 'String')) { return 1 } # attribute => 'String Char' # context => '#stay' # type => 'HlCStringChar' if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # attribute => 'Symbol' # beginRegion => 'Brace1' # char => '{' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # attribute => 'Symbol' # char => '}' # context => '#stay' # endRegion => 'Brace1' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # String => '\d+[KMG]?' # attribute => 'Decimal' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\d+[KMG]?', 0, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # String => 'text:$' # attribute => 'String' # beginRegion => 'String' # context => 'MultilineString' # type => 'RegExpr' if ($self->testRegExpr($text, 'text:$', 0, 0, 0, undef, 0, 'MultilineString', 'String')) { return 1 } # attribute => 'Comment' # beginRegion => 'Comment' # char => '/' # char1 => '*' # context => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { return 1 } # String => '#.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # String => ':\w+' # attribute => 'Tagged Argument' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, ':\\w+', 0, 0, 0, undef, 0, '#stay', 'Tagged Argument')) { return 1 } # String => '[.]{1,1}' # attribute => 'Symbol' # context => 'Member' # type => 'RegExpr' if ($self->testRegExpr($text, '[.]{1,1}', 0, 0, 0, undef, 0, 'Member', 'Symbol')) { return 1 } # String => ':!%&()+,-/.*<=>?[]|~^;' # attribute => 'Symbol' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, ':!%&()+,-/.*<=>?[]|~^;', 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) { return 1 } # attribute => 'String Char' # context => '#stay' # type => 'HlCStringChar' if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Sieve - a Plugin for Sieve syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Sieve; my $sh = new Syntax::Highlight::Engine::Kate::Sieve([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Sieve is a plugin module that provides syntax highlighting for Sieve to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/VHDL.pm0000644000175000017500000002231713226470762025417 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'vhdl.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.04 #kate version 2.1 #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::VHDL; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Attribute' => 'BaseN', 'Bit' => 'Char', 'Comment' => 'Comment', 'Data Type' => 'DataType', 'Integer' => 'DecVal', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Operator' => 'Others', 'Vector' => 'String', }); $self->listAdd('keywords', 'ACCESS', 'AFTER', 'ALIAS', 'ALL', 'AND', 'ARCHITECTURE', 'ASSERT', 'BEGIN', 'BLOCK', 'BODY', 'BUFFER', 'BUS', 'CASE', 'COMPONENT', 'CONFIGURATION', 'CONSTANT', 'DISCONNECT', 'DOWNTO', 'ELSE', 'ELSIF', 'END', 'ENTITY', 'ERROR', 'EXIT', 'FAILURE', 'FILE', 'FOR', 'FUNCTION', 'GENERATE', 'GENERIC', 'GROUP', 'GUARDED', 'IF', 'IMPURE', 'IN', 'INERTIAL', 'INOUT', 'IS', 'LABEL', 'LIBRARY', 'LINKAGE', 'LITERAL', 'LOOP', 'MAP', 'NEW', 'NEXT', 'NOT', 'NOTE', 'NULL', 'OF', 'ON', 'OPEN', 'OR', 'OTHERS', 'OUT', 'PACKAGE', 'PORT', 'POSTPONED', 'PROCEDURE', 'PROCESS', 'PURE', 'RANGE', 'RECORD', 'REGISTER', 'REJECT', 'REPORT', 'RETURN', 'SELECT', 'SEVERITY', 'SHARED', 'SIGNAL', 'SUBTYPE', 'THEN', 'TO', 'TRANSPORT', 'TYPE', 'UNAFFECTED', 'UNITS', 'UNTIL', 'USE', 'VARIABLE', 'WAIT', 'WARNING', 'WHEN', 'WHILE', 'WITH', 'XOR', 'access', 'after', 'alias', 'all', 'and', 'architecture', 'assert', 'begin', 'block', 'body', 'buffer', 'bus', 'case', 'component', 'configuration', 'constant', 'disconnect', 'downto', 'else', 'elsif', 'end', 'entity', 'error', 'exit', 'failure', 'file', 'for', 'function', 'generate', 'generic', 'group', 'guarded', 'if', 'impure', 'in', 'inertial', 'inout', 'is', 'label', 'library', 'linkage', 'literal', 'loop', 'map', 'new', 'next', 'not', 'note', 'null', 'of', 'on', 'open', 'or', 'others', 'out', 'package', 'port', 'postponed', 'procedure', 'process', 'pure', 'range', 'record', 'register', 'reject', 'report', 'return', 'select', 'severity', 'shared', 'signal', 'subtype', 'then', 'to', 'transport', 'type', 'unaffected', 'units', 'until', 'use', 'variable', 'wait', 'warning', 'when', 'while', 'with', 'xor', ); $self->listAdd('types', 'BIT', 'BIT_VECTOR', 'BOOLEAN', 'CHARACTER', 'INTEGER', 'LINE', 'MUX_BIT', 'MUX_VECTOR', 'NATURAL', 'POSITIVE', 'QSIM_12STATE', 'QSIM_12STATE_VECTOR', 'QSIM_STATE', 'QSIM_STATE_VECTOR', 'QSIM_STRENGTH', 'REAL', 'REG_BIT', 'REG_VECTOR', 'SEVERITY_LEVEL', 'SIGNED', 'STD_LOGIC', 'STD_LOGIC_VECTOR', 'STD_ULOGIC', 'STD_ULOGIC_VECTOR', 'STRING', 'TEXT', 'TIME', 'UNSIGNED', 'WOR_BIT', 'WOR_VECTOR', 'bit', 'bit_vector', 'boolean', 'character', 'integer', 'line', 'mux_bit', 'mux_vector', 'natural', 'positive', 'qsim_12state', 'qsim_12state_vector', 'qsim_state', 'qsim_state_vector', 'qsim_strength', 'real', 'reg_bit', 'reg_vector', 'severity_level', 'signed', 'std_logic', 'std_logic_vector', 'std_ulogic', 'std_ulogic_vector', 'string', 'text', 'time', 'unsigned', 'wor_bit', 'wor_vector', ); $self->contextdata({ 'attribute' => { callback => \&parseattribute, attribute => 'Attribute', lineending => '#pop', }, 'comment' => { callback => \&parsecomment, attribute => 'Comment', lineending => '#pop', }, 'normal' => { callback => \&parsenormal, attribute => 'Normal Text', }, 'quot in att' => { callback => \&parsequotinatt, attribute => 'Attribute', }, 'string' => { callback => \&parsestring, attribute => 'Vector', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'VHDL'; } sub parseattribute { my ($self, $text) = @_; # attribute => 'Attribute' # char => '"' # context => 'quot in att' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'quot in att', 'Attribute')) { return 1 } # attribute => 'Normal Text' # char => ' ' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ' ', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } # String => ')=<>' # attribute => 'Attribute' # context => '#pop' # type => 'AnyChar' if ($self->testAnyChar($text, ')=<>', 0, 0, undef, 0, '#pop', 'Attribute')) { return 1 } return 0; }; sub parsecomment { my ($self, $text) = @_; return 0; }; sub parsenormal { my ($self, $text) = @_; # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'types' # attribute => 'Data Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) { return 1 } # attribute => 'Comment' # char => '-' # char1 => '-' # context => 'comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, 'comment', 'Comment')) { return 1 } # attribute => 'Integer' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Integer')) { return 1 } # attribute => 'Bit' # context => '#stay' # type => 'HlCChar' if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Bit')) { return 1 } # attribute => 'Vector' # char => '"' # context => 'string' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'Vector')) { return 1 } # String => '[&><=:+\-*\/|]().,;' # attribute => 'Operator' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '[&><=:+\\-*\\/|]().,;', 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # attribute => 'Attribute' # char => ''' # context => 'attribute' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'attribute', 'Attribute')) { return 1 } return 0; }; sub parsequotinatt { my ($self, $text) = @_; # attribute => 'Attribute' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Attribute')) { return 1 } return 0; }; sub parsestring { my ($self, $text) = @_; # attribute => 'Vector' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Vector')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::VHDL - a Plugin for VHDL syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::VHDL; my $sh = new Syntax::Highlight::Engine::Kate::VHDL([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::VHDL is a plugin module that provides syntax highlighting for VHDL to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/INI_Files.pm0000644000175000017500000001213113226470762026414 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'ini.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.0 #kate author Jan Janssen (medhefgo@web.de) #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::INI_Files; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Assignment' => 'Others', 'Comment' => 'Comment', 'Float' => 'Float', 'Int' => 'DecVal', 'Keyword' => 'Keyword', 'Normal Text' => 'DataType', 'Section' => 'Keyword', 'Value' => 'String', }); $self->listAdd('keywords', 'Default', 'Defaults', 'E_ALL', 'E_COMPILE_ERROR', 'E_COMPILE_WARNING', 'E_CORE_ERROR', 'E_CORE_WARNING', 'E_ERROR', 'E_NOTICE', 'E_PARSE', 'E_STRICT', 'E_USER_ERROR', 'E_USER_NOTICE', 'E_USER_WARNING', 'E_WARNING', 'False', 'Localhost', 'No', 'Normal', 'Null', 'Off', 'On', 'True', 'Yes', ); $self->contextdata({ 'Comment' => { callback => \&parseComment, attribute => 'Comment', lineending => '#pop', }, 'Value' => { callback => \&parseValue, attribute => 'Value', lineending => '#pop', }, 'ini' => { callback => \&parseini, attribute => 'Normal Text', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('ini'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'INI Files'; } sub parseComment { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } return 0; }; sub parseValue { my ($self, $text) = @_; # attribute => 'Float' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { return 1 } # attribute => 'Int' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Int')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => ';.*$' # attribute => 'Comment' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, ';.*$', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } # String => '#.*$' # attribute => 'Comment' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseini { my ($self, $text) = @_; # attribute => 'Section' # beginRegion => 'Section' # char => '[' # char1 => ']' # context => '#pop' # endRegion => 'Section' # type => 'RangeDetect' if ($self->testRangeDetect($text, '[', ']', 0, 0, undef, 0, '#pop', 'Section')) { return 1 } # attribute => 'Assignment' # char => '=' # context => 'Value' # type => 'DetectChar' if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, 'Value', 'Assignment')) { return 1 } # attribute => 'Comment' # char => ';' # context => 'Comment' # firstNonSpace => 'true' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 1, 'Comment', 'Comment')) { return 1 } # attribute => 'Comment' # char => '#' # context => 'Comment' # firstNonSpace => 'true' # type => 'DetectChar' if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 1, 'Comment', 'Comment')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::INI_Files - a Plugin for INI Files syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::INI_Files; my $sh = new Syntax::Highlight::Engine::Kate::INI_Files([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::INI_Files is a plugin module that provides syntax highlighting for INI Files to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/AHDL.pm0000644000175000017500000002445613226470762025400 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'ahdl.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.04 #kate version 2.4 #kate author Dominik Haumann (dhdev@gmx.de) #generated: Sun Feb 3 22:02:04 2008, localtime package Syntax::Highlight::Engine::Kate::AHDL; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Bit' => 'DecVal', 'Char' => 'Char', 'Comment' => 'Comment', 'Data Type' => 'DataType', 'Decimal' => 'DecVal', 'Hex' => 'BaseN', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Octal' => 'BaseN', 'Operator' => 'Others', 'Region Marker' => 'RegionMarker', 'String' => 'String', }); $self->listAdd('keywords', 'assert', 'bidir', 'bits', 'buried', 'case', 'clique', 'connected_pins', 'constant', 'defaults', 'define', 'design', 'device', 'else', 'elsif', 'for', 'function', 'generate', 'gnd', 'help_id', 'in', 'include', 'input', 'is', 'machine', 'node', 'of', 'options', 'others', 'output', 'parameters', 'returns', 'states', 'subdesign', 'then', 'title', 'to', 'tri_state_node', 'variable', 'vcc', 'when', 'with', ); $self->listAdd('operator', 'and', 'ceil', 'div', 'floor', 'log2', 'mod', 'nand', 'nor', 'not', 'or', 'used', 'xnor', 'xor', ); $self->listAdd('types', 'carry', 'cascade', 'dff', 'dffe', 'exp', 'global', 'jkff', 'jkffe', 'latch', 'lcell', 'mcell', 'memory', 'opendrn', 'soft', 'srff', 'srffe', 'tff', 'tffe', 'tri', 'wire', 'x', ); $self->contextdata({ 'comment' => { callback => \&parsecomment, attribute => 'Comment', }, 'normal' => { callback => \&parsenormal, attribute => 'Normal Text', }, 'string' => { callback => \&parsestring, attribute => 'String', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'AHDL'; } sub parsecomment { my ($self, $text) = @_; # attribute => 'Comment' # char => '%' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parsenormal { my ($self, $text) = @_; # String => '\bdefaults\b' # attribute => 'Keyword' # beginRegion => 'def' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bdefaults\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bend\s+defaults\b' # attribute => 'Keyword' # context => '#stay' # endRegion => 'def' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bend\\s+defaults\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bif\b' # attribute => 'Keyword' # beginRegion => 'if' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bif\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bend\s+if\b' # attribute => 'Keyword' # context => '#stay' # endRegion => 'if' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bend\\s+if\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\btable\b' # attribute => 'Keyword' # beginRegion => 'table' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\btable\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bend\s+table\b' # attribute => 'Keyword' # context => '#stay' # endRegion => 'table' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bend\\s+table\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bcase\b' # attribute => 'Keyword' # beginRegion => 'case' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bcase\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bend\s+case\b' # attribute => 'Keyword' # context => '#stay' # endRegion => 'case' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bend\\s+case\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bbegin\b' # attribute => 'Keyword' # beginRegion => 'block' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bbegin\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bend\b' # attribute => 'Keyword' # context => '#stay' # endRegion => 'block' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bend\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # attribute => 'Normal Text' # beginRegion => 'bracket' # char => '(' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Normal Text' # char => ')' # context => '#stay' # endRegion => 'bracket' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'types' # attribute => 'Data Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => 'operator' # attribute => 'Operator' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'operator', 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '\b(\d+)\b' # attribute => 'Decimal' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(\\d+)\\b', 0, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => '\bb"(0|1|x)+"' # attribute => 'Bit' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bb"(0|1|x)+"', 1, 0, 0, undef, 0, '#stay', 'Bit')) { return 1 } # String => '\b(o|q)"[0-7*]"' # attribute => 'Octal' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(o|q)"[0-7*]"', 1, 0, 0, undef, 0, '#stay', 'Octal')) { return 1 } # String => '\b(h|x)"[0-9a-f]*"' # attribute => 'Hex' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(h|x)"[0-9a-f]*"', 1, 0, 0, undef, 0, '#stay', 'Hex')) { return 1 } # attribute => 'String' # char => '"' # context => 'string' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'String')) { return 1 } # String => '--\s*BEGIN.*$' # attribute => 'Region Marker' # beginRegion => 'region' # context => '#stay' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '--\\s*BEGIN.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { return 1 } # String => '--\s*END.*$' # attribute => 'Region Marker' # context => '#stay' # endRegion => 'region' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '--\\s*END.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { return 1 } # String => '--.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '--.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # attribute => 'Comment' # char => '%' # context => 'comment' # type => 'DetectChar' if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'comment', 'Comment')) { return 1 } # attribute => 'Char' # context => '#stay' # type => 'HlCChar' if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) { return 1 } return 0; }; sub parsestring { my ($self, $text) = @_; # attribute => 'Char' # char => '\' # char1 => '"' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '"', 0, 0, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::AHDL - a Plugin for AHDL syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::AHDL; my $sh = new Syntax::Highlight::Engine::Kate::AHDL([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::AHDL is a plugin module that provides syntax highlighting for AHDL to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/ObjectiveminusC.pm0000644000175000017500000002703513226470762027755 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'objectivec.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.07 #kate version 2.3 #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::ObjectiveminusC; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Char' => 'Char', 'Comment' => 'Comment', 'Data Type' => 'DataType', 'Decimal' => 'DecVal', 'Float' => 'Float', 'Hex' => 'BaseN', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Octal' => 'BaseN', 'Prep. Lib' => 'Others', 'Preprocessor' => 'Others', 'String' => 'String', 'String Char' => 'Char', 'Symbol' => 'Normal', }); $self->listAdd('keywords', '@class', '@defs', '@encode', '@end', '@implementation', '@interface', '@private', '@protected', '@protocol', '@public', '@selector', 'break', 'case', 'continue', 'default', 'do', 'else', 'enum', 'extern', 'for', 'goto', 'if', 'return', 'self', 'sizeof', 'struct', 'super', 'switch', 'typedef', 'union', 'while', ); $self->listAdd('types', 'auto', 'char', 'const', 'double', 'float', 'int', 'long', 'register', 'short', 'signed', 'static', 'unsigned', 'void', 'volatile', ); $self->contextdata({ 'Default' => { callback => \&parseDefault, attribute => 'Normal Text', }, 'MultiLineComment' => { callback => \&parseMultiLineComment, attribute => 'Comment', }, 'MultiLineCommentPrep' => { callback => \&parseMultiLineCommentPrep, attribute => 'Comment', }, 'Preprocessor' => { callback => \&parsePreprocessor, attribute => 'Preprocessor', lineending => 'Default', }, 'SingleLineComment' => { callback => \&parseSingleLineComment, attribute => 'Comment', lineending => '#pop', }, 'String' => { callback => \&parseString, attribute => 'String', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Default'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Objective-C'; } sub parseDefault { my ($self, $text) = @_; # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'types' # attribute => 'Data Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) { return 1 } # attribute => 'Symbol' # beginRegion => 'Brace1' # char => '{' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # attribute => 'Symbol' # char => '}' # context => '#stay' # endRegion => 'Brace1' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # attribute => 'Float' # context => '#stay' # items => 'ARRAY(0x197ace0)' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { # String => 'fF' # attribute => 'Float' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, 'fF', 0, 0, undef, 0, '#stay', 'Float')) { return 1 } } # attribute => 'Octal' # context => '#stay' # type => 'HlCOct' if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) { return 1 } # attribute => 'Hex' # context => '#stay' # type => 'HlCHex' if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) { return 1 } # attribute => 'Decimal' # context => '#stay' # items => 'ARRAY(0x1835840)' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { # String => 'ULL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'ULL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LUL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LUL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LLU' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LLU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'UL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'UL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LU' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'U' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'U', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'L' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'L', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } } # attribute => 'Char' # context => '#stay' # type => 'HlCChar' if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'SingleLineComment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'SingleLineComment', 'Comment')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '*' # context => 'MultiLineComment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'MultiLineComment', 'Comment')) { return 1 } # String => ':!%&()+,-/.*<=>?[]|~^;' # attribute => 'Symbol' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, ':!%&()+,-/.*<=>?[]|~^;', 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # String => '^#' # attribute => 'Preprocessor' # context => 'Preprocessor' # type => 'RegExpr' if ($self->testRegExpr($text, '^#', 0, 0, 0, undef, 0, 'Preprocessor', 'Preprocessor')) { return 1 } # attribute => 'String' # char => '@' # char1 => '"' # context => 'String' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '@', '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } return 0; }; sub parseMultiLineComment { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseMultiLineCommentPrep { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop#pop', 'Comment')) { return 1 } return 0; }; sub parsePreprocessor { my ($self, $text) = @_; # attribute => 'Preprocessor' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Preprocessor')) { return 1 } # attribute => 'Prep. Lib' # char => '"' # char1 => '"' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'Prep. Lib')) { return 1 } # attribute => 'Prep. Lib' # char => '<' # char1 => '>' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'Prep. Lib')) { return 1 } # context => '##Doxygen' # type => 'IncludeRules' if ($self->includePlugin('Doxygen', $text)) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'SingleLineComment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'SingleLineComment', 'Comment')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '*' # context => 'MultiLineCommentPrep' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'MultiLineCommentPrep', 'Comment')) { return 1 } return 0; }; sub parseSingleLineComment { my ($self, $text) = @_; return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) { return 1 } # attribute => 'String Char' # context => '#stay' # type => 'HlCStringChar' if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::ObjectiveminusC - a Plugin for Objective-C syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::ObjectiveminusC; my $sh = new Syntax::Highlight::Engine::Kate::ObjectiveminusC([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::ObjectiveminusC is a plugin module that provides syntax highlighting for Objective-C to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/TI_Basic.pm0000644000175000017500000001046613226470762026301 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'tibasic.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.01 #kate version 2.3 #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::TI_Basic; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Assignment' => 'Others', 'Keyword' => 'Keyword', 'Matrix' => 'Normal', 'Normal Text' => 'Normal', 'Special operators' => 'Normal', 'String' => 'String', }); $self->listAdd('keywords', 'ClrHome', 'ClrTable', 'DS<', 'DelVar', 'Disp', 'DispGraph', 'DispTable', 'Else', 'End', 'For', 'Get', 'GetCalc', 'Goto', 'GraphStyle', 'IS>', 'If', 'Input', 'Lbl', 'Menu', 'Output', 'Pause', 'Prompt', 'Repeat', 'Return', 'Send', 'Then', 'While', 'getKey', 'prgm', 'prgm', ); $self->listAdd('special_sym', '%THETA', 'eogt', 'eolt', 'net', 'sqrt', ); $self->contextdata({ 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'String' => { callback => \&parseString, attribute => 'String', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|=|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|\\%|<|>'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'TI Basic'; } sub parseNormal { my ($self, $text) = @_; # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'special_sym' # attribute => 'Special operators' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'special_sym', 0, undef, 0, '#stay', 'Special operators')) { return 1 } # attribute => 'Assignment' # char => '-' # char1 => '>' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '-', '>', 0, 0, 0, undef, 0, '#stay', 'Assignment')) { return 1 } # attribute => 'Assignment' # char => 's' # char1 => 't' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, 's', 't', 0, 0, 0, undef, 0, '#stay', 'Assignment')) { return 1 } # String => '\[\w\]' # attribute => 'Matrix' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\[\\w\\]', 0, 0, 0, undef, 0, '#stay', 'Matrix')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::TI_Basic - a Plugin for TI Basic syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::TI_Basic; my $sh = new Syntax::Highlight::Engine::Kate::TI_Basic([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::TI_Basic is a plugin module that provides syntax highlighting for TI Basic to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/CSS.pm0000644000175000017500000006476313226470762025325 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'css.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 2.00 #kate version 2.4 #kate author Wilbert Berendsen (wilbert@kde.nl) #generated: Sun Feb 3 22:02:04 2008, localtime package Syntax::Highlight::Engine::Kate::CSS; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Alert' => 'Alert', 'At Rule' => 'DecVal', 'Comment' => 'Comment', 'Error' => 'Error', 'Important' => 'Keyword', 'Media' => 'Others', 'Normal Text' => 'Normal', 'Property' => 'Keyword', 'Region Marker' => 'RegionMarker', 'Selector Attr' => 'Char', 'Selector Class' => 'Float', 'Selector Id' => 'BaseN', 'Selector Pseudo' => 'DecVal', 'String' => 'String', 'Unknown Property' => 'Error', 'Value' => 'DataType', }); $self->listAdd('colors', 'ActiveBorder', 'ActiveCaption', 'AppWorkspace', 'Background', 'ButtonFace', 'ButtonHighlight', 'ButtonShadow', 'ButtonText', 'CaptionText', 'GrayText', 'Highlight', 'HighlightText', 'InactiveBorder', 'InactiveCaption', 'InactiveCaptionText', 'InfoBackground', 'InfoText', 'Menu', 'MenuText', 'Scrollbar', 'ThreeDDarkShadow', 'ThreeDFace', 'ThreeDHighlight', 'ThreeDLightShadow', 'ThreeDShadow', 'Window', 'WindowFrame', 'WindowText', 'aqua', 'black', 'blue', 'fuchsia', 'gray', 'green', 'lime', 'maroon', 'navy', 'olive', 'purple', 'red', 'silver', 'teal', 'white', 'yellow', ); $self->listAdd('mediatypes', 'all', 'aural', 'braille', 'embossed', 'handheld', 'print', 'projection', 'screen', 'tty', 'tv', ); $self->listAdd('paren', 'attr', 'counter', 'counters', 'format', 'local', 'rect', 'rgb', 'url', ); $self->listAdd('properties', 'ascent', 'azimuth', 'background', 'background-attachment', 'background-color', 'background-image', 'background-position', 'background-repeat', 'baseline', 'bbox', 'border', 'border-bottom', 'border-bottom-color', 'border-bottom-style', 'border-bottom-width', 'border-collapse', 'border-color', 'border-left', 'border-left-color', 'border-left-style', 'border-left-width', 'border-right', 'border-right-color', 'border-right-style', 'border-right-width', 'border-spacing', 'border-style', 'border-top', 'border-top-color', 'border-top-style', 'border-top-width', 'border-width', 'bottom', 'box-sizing', 'cap-height', 'caption-side', 'centerline', 'clear', 'clip', 'color', 'content', 'counter-increment', 'counter-reset', 'cue', 'cue-after', 'cue-before', 'cursor', 'definition-src', 'descent', 'direction', 'display', 'elevation', 'empty-cells', 'float', 'font', 'font-family', 'font-family', 'font-size', 'font-size', 'font-size-adjust', 'font-stretch', 'font-stretch', 'font-style', 'font-style', 'font-variant', 'font-variant', 'font-weight', 'font-weight', 'height', 'konq_bgpos_x', 'konq_bgpos_y', 'left', 'letter-spacing', 'line-height', 'list-style', 'list-style-image', 'list-style-keyword', 'list-style-position', 'list-style-type', 'margin', 'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'marker-offset', 'mathline', 'max-height', 'max-width', 'min-height', 'min-width', 'opacity', 'orphans', 'outline', 'outline-color', 'outline-style', 'outline-width', 'overflow', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'page', 'page-break-after', 'page-break-before', 'page-break-inside', 'panose-1', 'pause', 'pause-after', 'pause-before', 'pitch', 'pitch-range', 'play-during', 'position', 'quotes', 'richness', 'right', 'size', 'slope', 'speak', 'speak-header', 'speak-numeral', 'speak-punctuation', 'speech-rate', 'src', 'stemh', 'stemv', 'stress', 'table-layout', 'text-align', 'text-decoration', 'text-decoration-color', 'text-indent', 'text-shadow', 'text-shadow', 'text-transform', 'top', 'topline', 'unicode-bidi', 'unicode-range', 'units-per-em', 'vertical-align', 'visibility', 'voice-family', 'volume', 'white-space', 'widows', 'width', 'widths', 'word-spacing', 'x-height', 'z-index', ); $self->listAdd('pseudoclasses', 'active', 'after', 'before', 'checked', 'disabled', 'empty', 'enabled', 'first-child', 'first-letter', 'first-line', 'first-of-type', 'focus', 'hover', 'indeterminate', 'last-child', 'last-of-type', 'link', 'not', 'nth-child', 'nth-last-child', 'nth-last-of-type', 'nth-of-type', 'only-child', 'only-of-type', 'root', 'selection', 'target', 'visited', ); $self->listAdd('types', '100', '200', '300', '400', '500', '600', '700', '800', '900', 'above', 'absolute', 'always', 'armenian', 'auto', 'avoid', 'baseline', 'below', 'bidi-override', 'blink', 'block', 'bold', 'bolder', 'border-box', 'both', 'bottom', 'box', 'break', 'capitalize', 'caption', 'center', 'circle', 'cjk-ideographic', 'close-quote', 'collapse', 'compact', 'condensed', 'content-box', 'crop', 'cross', 'crosshair', 'cursive', 'dashed', 'decimal', 'decimal-leading-zero', 'default', 'disc', 'dotted', 'double', 'e-resize', 'embed', 'expanded', 'extra-condensed', 'extra-expanded', 'fantasy', 'fixed', 'georgian', 'groove', 'hand', 'hebrew', 'help', 'hidden', 'hide', 'higher', 'hiragana', 'hiragana-iroha', 'icon', 'inherit', 'inline', 'inline-block', 'inline-table', 'inset', 'inside', 'invert', 'italic', 'justify', 'katakana', 'katakana-iroha', 'konq-center', 'landscape', 'large', 'larger', 'left', 'level', 'light', 'lighter', 'line-through', 'list-item', 'loud', 'lower', 'lower-alpha', 'lower-greek', 'lower-latin', 'lower-roman', 'lowercase', 'ltr', 'marker', 'medium', 'menu', 'message-box', 'middle', 'mix', 'monospace', 'move', 'n-resize', 'narrower', 'ne-resize', 'no-close-quote', 'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap', 'nw-resize', 'oblique', 'open-quote', 'outset', 'outside', 'overline', 'pointer', 'portrait', 'pre', 'pre-line', 'pre-wrap', 'relative', 'repeat', 'repeat-x', 'repeat-y', 'ridge', 'right', 'rtl', 'run-in', 's-resize', 'sans-serif', 'scroll', 'se-resize', 'semi-condensed', 'semi-expanded', 'separate', 'serif', 'show', 'small', 'small-caps', 'small-caption', 'smaller', 'solid', 'square', 'static', 'static-position', 'status-bar', 'sub', 'super', 'sw-resize', 'table', 'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row', 'table-row-group', 'text', 'text-bottom', 'text-top', 'thick', 'thin', 'top', 'transparent', 'ultra-condensed', 'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin', 'upper-roman', 'uppercase', 'visible', 'w-resize', 'wait', 'wider', 'x-large', 'x-small', 'xx-large', 'xx-small', ); $self->contextdata({ 'Base' => { callback => \&parseBase, attribute => 'Normal Text', }, 'Comment' => { callback => \&parseComment, attribute => 'Comment', }, 'FindComments' => { callback => \&parseFindComments, attribute => 'Normal Text', }, 'FindRuleSets' => { callback => \&parseFindRuleSets, attribute => 'Normal Text', }, 'FindStrings' => { callback => \&parseFindStrings, attribute => 'Normal Text', }, 'FindValues' => { callback => \&parseFindValues, attribute => 'Normal Text', }, 'Import' => { callback => \&parseImport, attribute => 'Normal Text', }, 'InsideString' => { callback => \&parseInsideString, attribute => 'String', }, 'Media' => { callback => \&parseMedia, attribute => 'Normal Text', }, 'Media2' => { callback => \&parseMedia2, attribute => 'Normal Text', }, 'PropParen' => { callback => \&parsePropParen, attribute => 'Normal Text', }, 'PropParen2' => { callback => \&parsePropParen2, attribute => 'Normal Text', }, 'Rule' => { callback => \&parseRule, attribute => 'Normal Text', }, 'Rule2' => { callback => \&parseRule2, attribute => 'Normal Text', }, 'RuleSet' => { callback => \&parseRuleSet, attribute => 'Normal Text', }, 'SelAttr' => { callback => \&parseSelAttr, attribute => 'Selector Attr', }, 'SelPseudo' => { callback => \&parseSelPseudo, attribute => 'Selector Pseudo', lineending => '#pop', fallthrough => '#pop', }, 'StringDQ' => { callback => \&parseStringDQ, attribute => 'String', }, 'StringSQ' => { callback => \&parseStringSQ, attribute => 'String', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|<|=|>|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|-|\\%'); $self->basecontext('Base'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'CSS'; } sub parseBase { my ($self, $text) = @_; # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', undef)) { return 1 } # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # context => 'FindRuleSets' # type => 'IncludeRules' if ($self->includeRules('FindRuleSets', $text)) { return 1 } return 0; }; sub parseComment { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # endRegion => 'comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } return 0; }; sub parseFindComments { my ($self, $text) = @_; # String => '/\*BEGIN.*\*/' # attribute => 'Region Marker' # beginRegion => 'UserDefined' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '/\\*BEGIN.*\\*/', 0, 0, 0, undef, 0, '#stay', 'Region Marker')) { return 1 } # String => '/\*END.*\*/' # attribute => 'Region Marker' # context => '#stay' # endRegion => 'UserDefined' # type => 'RegExpr' if ($self->testRegExpr($text, '/\\*END.*\\*/', 0, 0, 0, undef, 0, '#stay', 'Region Marker')) { return 1 } # attribute => 'Comment' # beginRegion => 'comment' # char => '/' # char1 => '*' # context => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { return 1 } return 0; }; sub parseFindRuleSets { my ($self, $text) = @_; # String => '@media\b' # attribute => 'Media' # context => 'Media' # type => 'RegExpr' if ($self->testRegExpr($text, '@media\\b', 0, 0, 0, undef, 0, 'Media', 'Media')) { return 1 } # String => '@import\b' # attribute => 'At Rule' # context => 'Import' # type => 'RegExpr' if ($self->testRegExpr($text, '@import\\b', 0, 0, 0, undef, 0, 'Import', 'At Rule')) { return 1 } # String => '@(font-face|charset)\b' # attribute => 'At Rule' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '@(font-face|charset)\\b', 0, 0, 0, undef, 0, '#stay', 'At Rule')) { return 1 } # attribute => 'Property' # beginRegion => 'ruleset' # char => '{' # context => 'RuleSet' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'RuleSet', 'Property')) { return 1 } # attribute => 'Selector Attr' # char => '[' # context => 'SelAttr' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'SelAttr', 'Selector Attr')) { return 1 } # String => '#[A-Za-z0-9][\w\-]*' # attribute => 'Selector Id' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#[A-Za-z0-9][\\w\\-]*', 0, 0, 0, undef, 0, '#stay', 'Selector Id')) { return 1 } # String => '\.[A-Za-z0-9][\w\-]*' # attribute => 'Selector Class' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\.[A-Za-z0-9][\\w\\-]*', 0, 0, 0, undef, 0, '#stay', 'Selector Class')) { return 1 } # String => ':lang\([\w_-]+\)' # attribute => 'Selector Pseudo' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, ':lang\\([\\w_-]+\\)', 0, 0, 0, undef, 0, '#stay', 'Selector Pseudo')) { return 1 } # attribute => 'Selector Pseudo' # char => ':' # context => 'SelPseudo' # type => 'DetectChar' if ($self->testDetectChar($text, ':', 0, 0, 0, undef, 0, 'SelPseudo', 'Selector Pseudo')) { return 1 } # context => 'FindStrings' # type => 'IncludeRules' if ($self->includeRules('FindStrings', $text)) { return 1 } # context => 'FindComments' # type => 'IncludeRules' if ($self->includeRules('FindComments', $text)) { return 1 } return 0; }; sub parseFindStrings { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => 'StringDQ' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'StringDQ', 'String')) { return 1 } # attribute => 'String' # char => ''' # context => 'StringSQ' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'StringSQ', 'String')) { return 1 } return 0; }; sub parseFindValues { my ($self, $text) = @_; # String => '[-+]?[0-9.]+(em|ex|px|in|cm|mm|pt|pc|deg|rad|grad|ms|s|Hz|kHz)\b' # attribute => 'Value' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[-+]?[0-9.]+(em|ex|px|in|cm|mm|pt|pc|deg|rad|grad|ms|s|Hz|kHz)\\b', 0, 0, 0, undef, 0, '#stay', 'Value')) { return 1 } # String => '[-+]?[0-9.]+[%]?' # attribute => 'Value' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[-+]?[0-9.]+[%]?', 0, 0, 0, undef, 0, '#stay', 'Value')) { return 1 } # String => '[\w\-]+' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\w\\-]+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } return 0; }; sub parseImport { my ($self, $text) = @_; # attribute => 'At Rule' # char => ';' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'At Rule')) { return 1 } # String => 'mediatypes' # attribute => 'Media' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'mediatypes', 0, undef, 0, '#stay', 'Media')) { return 1 } # context => 'FindValues' # type => 'IncludeRules' if ($self->includeRules('FindValues', $text)) { return 1 } # context => 'FindStrings' # type => 'IncludeRules' if ($self->includeRules('FindStrings', $text)) { return 1 } # context => 'FindComments' # type => 'IncludeRules' if ($self->includeRules('FindComments', $text)) { return 1 } return 0; }; sub parseInsideString { my ($self, $text) = @_; # String => '\\["']' # attribute => 'String' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\["\']', 0, 0, 0, undef, 0, '#stay', 'String')) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } return 0; }; sub parseMedia { my ($self, $text) = @_; # attribute => 'Media' # beginRegion => 'media' # char => '{' # context => 'Media2' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'Media2', 'Media')) { return 1 } # String => 'mediatypes' # attribute => 'Media' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'mediatypes', 0, undef, 0, '#stay', 'Media')) { return 1 } # attribute => 'Media' # char => ',' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, ',', 0, 0, 0, undef, 0, '#stay', 'Media')) { return 1 } # context => 'FindComments' # type => 'IncludeRules' if ($self->includeRules('FindComments', $text)) { return 1 } # String => '\S+' # attribute => 'Error' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\S+', 0, 0, 0, undef, 0, '#stay', 'Error')) { return 1 } return 0; }; sub parseMedia2 { my ($self, $text) = @_; # attribute => 'Media' # char => '}' # context => '#pop#pop' # endRegion => 'media' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop', 'Media')) { return 1 } # context => 'FindRuleSets' # type => 'IncludeRules' if ($self->includeRules('FindRuleSets', $text)) { return 1 } return 0; }; sub parsePropParen { my ($self, $text) = @_; # attribute => 'Value' # char => '(' # context => 'PropParen2' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'PropParen2', 'Value')) { return 1 } # context => 'FindComments' # type => 'IncludeRules' if ($self->includeRules('FindComments', $text)) { return 1 } # String => '\S' # attribute => 'Error' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#stay', 'Error')) { return 1 } return 0; }; sub parsePropParen2 { my ($self, $text) = @_; # attribute => 'Value' # char => ')' # context => '#pop#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop#pop', 'Value')) { return 1 } # context => 'FindValues' # type => 'IncludeRules' if ($self->includeRules('FindValues', $text)) { return 1 } # context => 'FindStrings' # type => 'IncludeRules' if ($self->includeRules('FindStrings', $text)) { return 1 } # context => 'FindComments' # type => 'IncludeRules' if ($self->includeRules('FindComments', $text)) { return 1 } return 0; }; sub parseRule { my ($self, $text) = @_; # attribute => 'Property' # char => ':' # context => 'Rule2' # type => 'DetectChar' if ($self->testDetectChar($text, ':', 0, 0, 0, undef, 0, 'Rule2', 'Property')) { return 1 } # String => '\S' # attribute => 'Error' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#stay', 'Error')) { return 1 } return 0; }; sub parseRule2 { my ($self, $text) = @_; # attribute => 'Property' # char => ';' # context => '#pop#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop#pop', 'Property')) { return 1 } # attribute => 'Property' # char => '}' # context => '#pop#pop#pop' # endRegion => 'ruleset' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Property')) { return 1 } # String => 'types' # attribute => 'Value' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Value')) { return 1 } # String => 'colors' # attribute => 'Value' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'colors', 0, undef, 0, '#stay', 'Value')) { return 1 } # String => '#([0-9A-Fa-f]{3}){1,4}\b' # attribute => 'Value' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#([0-9A-Fa-f]{3}){1,4}\\b', 0, 0, 0, undef, 0, '#stay', 'Value')) { return 1 } # String => 'paren' # attribute => 'Value' # context => 'PropParen' # type => 'keyword' if ($self->testKeyword($text, 'paren', 0, undef, 0, 'PropParen', 'Value')) { return 1 } # String => '!important\b' # attribute => 'Important' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '!important\\b', 0, 0, 0, undef, 0, '#stay', 'Important')) { return 1 } # context => 'FindValues' # type => 'IncludeRules' if ($self->includeRules('FindValues', $text)) { return 1 } # context => 'FindStrings' # type => 'IncludeRules' if ($self->includeRules('FindStrings', $text)) { return 1 } # context => 'FindComments' # type => 'IncludeRules' if ($self->includeRules('FindComments', $text)) { return 1 } return 0; }; sub parseRuleSet { my ($self, $text) = @_; # attribute => 'Property' # char => '}' # context => '#pop' # endRegion => 'ruleset' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Property')) { return 1 } # String => 'properties' # attribute => 'Property' # context => 'Rule' # type => 'keyword' if ($self->testKeyword($text, 'properties', 0, undef, 0, 'Rule', 'Property')) { return 1 } # String => '-?[A-Za-z_-]+(?=\s*:)' # attribute => 'Unknown Property' # context => 'Rule' # type => 'RegExpr' if ($self->testRegExpr($text, '-?[A-Za-z_-]+(?=\\s*:)', 0, 0, 0, undef, 0, 'Rule', 'Unknown Property')) { return 1 } # context => 'FindComments' # type => 'IncludeRules' if ($self->includeRules('FindComments', $text)) { return 1 } # String => '\S' # attribute => 'Error' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#stay', 'Error')) { return 1 } return 0; }; sub parseSelAttr { my ($self, $text) = @_; # attribute => 'Selector Attr' # char => ']' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Selector Attr')) { return 1 } # context => 'FindStrings' # type => 'IncludeRules' if ($self->includeRules('FindStrings', $text)) { return 1 } return 0; }; sub parseSelPseudo { my ($self, $text) = @_; # String => 'pseudoclasses' # attribute => 'Selector Pseudo' # context => '#pop' # type => 'keyword' if ($self->testKeyword($text, 'pseudoclasses', 0, undef, 0, '#pop', 'Selector Pseudo')) { return 1 } return 0; }; sub parseStringDQ { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } # context => 'InsideString' # type => 'IncludeRules' if ($self->includeRules('InsideString', $text)) { return 1 } return 0; }; sub parseStringSQ { my ($self, $text) = @_; # attribute => 'String' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } # context => 'InsideString' # type => 'IncludeRules' if ($self->includeRules('InsideString', $text)) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::CSS - a Plugin for CSS syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::CSS; my $sh = new Syntax::Highlight::Engine::Kate::CSS([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::CSS is a plugin module that provides syntax highlighting for CSS to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Common_Lisp.pm0000644000175000017500000007554613226470762027115 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'commonlisp.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.02 #kate version 2.3 #kate author Dominik Haumann (dhdev@gmx.de) #generated: Sun Feb 3 22:02:04 2008, localtime package Syntax::Highlight::Engine::Kate::Common_Lisp; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'BaseN' => 'BaseN', 'Brackets' => 'BString', 'Char' => 'Char', 'Comment' => 'Comment', 'Data' => 'DataType', 'Decimal' => 'DecVal', 'Definition' => 'Others', 'Float' => 'Float', 'Function' => 'Function', 'Keyword' => 'Keyword', 'Modifier' => 'Reserved', 'Normal' => 'Normal', 'Operator' => 'Operator', 'Region Marker' => 'RegionMarker', 'String' => 'String', 'Variable' => 'Variable', }); $self->listAdd('definitions', 'defclass', 'defconstant', 'defgeneric', 'define-compiler-macro', 'define-condition', 'define-method-combination', 'define-modify-macro', 'define-setf-expander', 'define-setf-method', 'define-symbol-macro', 'defmacro', 'defmethod', 'defpackage', 'defparameter', 'defsetf', 'defstruct', 'deftype', 'defun', 'defvar', ); $self->listAdd('keywords', 'abort', 'abs', 'access', 'acons', 'acos', 'acosh', 'add-method', 'adjoin', 'adjust-array', 'adjustable-array-p', 'allocate-instance', 'alpha-char-p', 'alphanumericp', 'and', 'append', 'apply', 'applyhook', 'apropos', 'apropos-list', 'aref', 'arithmetic-error', 'arithmetic-error-operands', 'arithmetic-error-operation', 'array', 'array-dimension', 'array-dimension-limit', 'array-dimensions', 'array-displacement', 'array-element-type', 'array-has-fill-pointer-p', 'array-in-bounds-p', 'array-rank', 'array-rank-limit', 'array-row-major-index', 'array-total-size', 'array-total-size-limit', 'arrayp', 'ash', 'asin', 'asinh', 'assert', 'assoc', 'assoc-if', 'assoc-if-not', 'atan', 'atanh', 'atom', 'base-char', 'base-string', 'bignum', 'bit', 'bit-and', 'bit-andc1', 'bit-andc2', 'bit-eqv', 'bit-ior', 'bit-nand', 'bit-nor', 'bit-not', 'bit-orc1', 'bit-orc2', 'bit-vector', 'bit-vector-p', 'bit-xor', 'block', 'boole', 'boole-1', 'boole-2', 'boole-and', 'boole-andc1', 'boole-andc2', 'boole-c1', 'boole-c2', 'boole-clr', 'boole-eqv', 'boole-ior', 'boole-nand', 'boole-nor', 'boole-orc1', 'boole-orc2', 'boole-set', 'boole-xor', 'boolean', 'both-case-p', 'boundp', 'break', 'broadcast-stream', 'broadcast-stream-streams', 'built-in-class', 'butlast', 'byte', 'byte-position', 'byte-size', 'call-arguments-limit', 'call-method', 'call-next-method', 'capitalize', 'car', 'case', 'catch', 'ccase', 'cdr', 'ceiling', 'cell-error', 'cell-error-name', 'cerror', 'change-class', 'char', 'char-bit', 'char-bits', 'char-bits-limit', 'char-code', 'char-code-limit', 'char-control-bit', 'char-downcase', 'char-equal', 'char-font', 'char-font-limit', 'char-greaterp', 'char-hyper-bit', 'char-int', 'char-lessp', 'char-meta-bit', 'char-name', 'char-not-equal', 'char-not-greaterp', 'char-not-lessp', 'char-super-bit', 'char-upcase', 'char/=', 'char<', 'char<=', 'char=', 'char>', 'char>=', 'character', 'characterp', 'check-type', 'cis', 'class', 'class-name', 'class-of', 'clear-input', 'clear-output', 'close', 'clrhash', 'code-char', 'coerce', 'commonp', 'compilation-speed', 'compile', 'compile-file', 'compile-file-pathname', 'compiled-function', 'compiled-function-p', 'compiler-let', 'compiler-macro', 'compiler-macro-function', 'complement', 'complex', 'complexp', 'compute-applicable-methods', 'compute-restarts', 'concatenate', 'concatenated-stream', 'concatenated-stream-streams', 'cond', 'condition', 'conjugate', 'cons', 'consp', 'constantly', 'constantp', 'continue', 'control-error', 'copy-alist', 'copy-list', 'copy-pprint-dispatch', 'copy-readtable', 'copy-seq', 'copy-structure', 'copy-symbol', 'copy-tree', 'cos', 'cosh', 'count', 'count-if', 'count-if-not', 'ctypecase', 'debug', 'decf', 'declaim', 'declaration', 'declare', 'decode-float', 'decode-universal-time', 'delete', 'delete-duplicates', 'delete-file', 'delete-if', 'delete-if-not', 'delete-package', 'denominator', 'deposit-field', 'describe', 'describe-object', 'destructuring-bind', 'digit-char', 'digit-char-p', 'directory', 'directory-namestring', 'disassemble', 'division-by-zero', 'do', 'do*', 'do-all-symbols', 'do-exeternal-symbols', 'do-external-symbols', 'do-symbols', 'documentation', 'dolist', 'dotimes', 'double-float', 'double-float-epsilon', 'double-float-negative-epsilon', 'dpb', 'dribble', 'dynamic-extent', 'ecase', 'echo-stream', 'echo-stream-input-stream', 'echo-stream-output-stream', 'ed', 'eighth', 'elt', 'encode-universal-time', 'end-of-file', 'endp', 'enough-namestring', 'ensure-directories-exist', 'ensure-generic-function', 'eq', 'eql', 'equal', 'equalp', 'error', 'etypecase', 'eval', 'eval-when', 'evalhook', 'evenp', 'every', 'exp', 'export', 'expt', 'extended-char', 'fboundp', 'fceiling', 'fdefinition', 'ffloor', 'fifth', 'file-author', 'file-error', 'file-error-pathname', 'file-length', 'file-namestring', 'file-position', 'file-stream', 'file-string-length', 'file-write-date', 'fill', 'fill-pointer', 'find', 'find-all-symbols', 'find-class', 'find-if', 'find-if-not', 'find-method', 'find-package', 'find-restart', 'find-symbol', 'finish-output', 'first', 'fixnum', 'flet', 'float', 'float-digits', 'float-precision', 'float-radix', 'float-sign', 'floating-point-inexact', 'floating-point-invalid-operation', 'floating-point-overflow', 'floating-point-underflow', 'floatp', 'floor', 'fmakunbound', 'force-output', 'format', 'formatter', 'fourth', 'fresh-line', 'fround', 'ftruncate', 'ftype', 'funcall', 'function', 'function-keywords', 'function-lambda-expression', 'functionp', 'gbitp', 'gcd', 'generic-function', 'gensym', 'gentemp', 'get', 'get-decoded-time', 'get-dispatch-macro-character', 'get-internal-real-time', 'get-internal-run-time', 'get-macro-character', 'get-output-stream-string', 'get-properties', 'get-setf-expansion', 'get-setf-method', 'get-universal-time', 'getf', 'gethash', 'go', 'graphic-char-p', 'handler-bind', 'handler-case', 'hash-table', 'hash-table-count', 'hash-table-p', 'hash-table-rehash-size', 'hash-table-rehash-threshold', 'hash-table-size', 'hash-table-test', 'host-namestring', 'identity', 'if', 'if-exists', 'ignorable', 'ignore', 'ignore-errors', 'imagpart', 'import', 'in-package', 'in-package', 'incf', 'initialize-instance', 'inline', 'input-stream-p', 'inspect', 'int-char', 'integer', 'integer-decode-float', 'integer-length', 'integerp', 'interactive-stream-p', 'intern', 'internal-time-units-per-second', 'intersection', 'invalid-method-error', 'invoke-debugger', 'invoke-restart', 'invoke-restart-interactively', 'isqrt', 'keyword', 'keywordp', 'labels', 'lambda', 'lambda-list-keywords', 'lambda-parameters-limit', 'last', 'lcm', 'ldb', 'ldb-test', 'ldiff', 'least-negative-double-float', 'least-negative-long-float', 'least-negative-normalized-double-float', 'least-negative-normalized-long-float', 'least-negative-normalized-short-float', 'least-negative-normalized-single-float', 'least-negative-short-float', 'least-negative-single-float', 'least-positive-double-float', 'least-positive-long-float', 'least-positive-normalized-double-float', 'least-positive-normalized-long-float', 'least-positive-normalized-short-float', 'least-positive-normalized-single-float', 'least-positive-short-float', 'least-positive-single-float', 'length', 'let', 'let*', 'lisp', 'lisp-implementation-type', 'lisp-implementation-version', 'list', 'list*', 'list-all-packages', 'list-length', 'listen', 'listp', 'load', 'load-logical-pathname-translations', 'load-time-value', 'locally', 'log', 'logand', 'logandc1', 'logandc2', 'logbitp', 'logcount', 'logeqv', 'logical-pathname', 'logical-pathname-translations', 'logior', 'lognand', 'lognor', 'lognot', 'logorc1', 'logorc2', 'logtest', 'logxor', 'long-float', 'long-float-epsilon', 'long-float-negative-epsilon', 'long-site-name', 'loop', 'loop-finish', 'lower-case-p', 'machine-instance', 'machine-type', 'machine-version', 'macro-function', 'macroexpand', 'macroexpand-1', 'macroexpand-l', 'macrolet', 'make-array', 'make-array', 'make-broadcast-stream', 'make-char', 'make-concatenated-stream', 'make-condition', 'make-dispatch-macro-character', 'make-echo-stream', 'make-hash-table', 'make-instance', 'make-instances-obsolete', 'make-list', 'make-load-form', 'make-load-form-saving-slots', 'make-method', 'make-package', 'make-pathname', 'make-random-state', 'make-sequence', 'make-string', 'make-string-input-stream', 'make-string-output-stream', 'make-symbol', 'make-synonym-stream', 'make-two-way-stream', 'makunbound', 'map', 'map-into', 'mapc', 'mapcan', 'mapcar', 'mapcon', 'maphash', 'mapl', 'maplist', 'mask-field', 'max', 'member', 'member-if', 'member-if-not', 'merge', 'merge-pathname', 'merge-pathnames', 'method', 'method-combination', 'method-combination-error', 'method-qualifiers', 'min', 'minusp', 'mismatch', 'mod', 'most-negative-double-float', 'most-negative-fixnum', 'most-negative-long-float', 'most-negative-short-float', 'most-negative-single-float', 'most-positive-double-float', 'most-positive-fixnum', 'most-positive-long-float', 'most-positive-short-float', 'most-positive-single-float', 'muffle-warning', 'multiple-value-bind', 'multiple-value-call', 'multiple-value-list', 'multiple-value-prog1', 'multiple-value-seteq', 'multiple-value-setq', 'multiple-values-limit', 'name-char', 'namestring', 'nbutlast', 'nconc', 'next-method-p', 'nil', 'nintersection', 'ninth', 'no-applicable-method', 'no-next-method', 'not', 'notany', 'notevery', 'notinline', 'nreconc', 'nreverse', 'nset-difference', 'nset-exclusive-or', 'nstring', 'nstring-capitalize', 'nstring-downcase', 'nstring-upcase', 'nsublis', 'nsubst', 'nsubst-if', 'nsubst-if-not', 'nsubstitute', 'nsubstitute-if', 'nsubstitute-if-not', 'nth', 'nth-value', 'nthcdr', 'null', 'number', 'numberp', 'numerator', 'nunion', 'oddp', 'open', 'open-stream-p', 'optimize', 'or', 'otherwise', 'output-stream-p', 'package', 'package-error', 'package-error-package', 'package-name', 'package-nicknames', 'package-shadowing-symbols', 'package-use-list', 'package-used-by-list', 'packagep', 'pairlis', 'parse-error', 'parse-integer', 'parse-namestring', 'pathname', 'pathname-device', 'pathname-directory', 'pathname-host', 'pathname-match-p', 'pathname-name', 'pathname-type', 'pathname-version', 'pathnamep', 'peek-char', 'phase', 'pi', 'plusp', 'pop', 'position', 'position-if', 'position-if-not', 'pprint', 'pprint-dispatch', 'pprint-exit-if-list-exhausted', 'pprint-fill', 'pprint-indent', 'pprint-linear', 'pprint-logical-block', 'pprint-newline', 'pprint-pop', 'pprint-tab', 'pprint-tabular', 'prin1', 'prin1-to-string', 'princ', 'princ-to-string', 'print', 'print-not-readable', 'print-not-readable-object', 'print-object', 'print-unreadable-object', 'probe-file', 'proclaim', 'prog', 'prog*', 'prog1', 'prog2', 'progn', 'program-error', 'progv', 'provide', 'psetf', 'psetq', 'push', 'pushnew', 'putprop', 'quote', 'random', 'random-state', 'random-state-p', 'rassoc', 'rassoc-if', 'rassoc-if-not', 'ratio', 'rational', 'rationalize', 'rationalp', 'read', 'read-byte', 'read-char', 'read-char-no-hang', 'read-delimited-list', 'read-eval-print', 'read-from-string', 'read-line', 'read-preserving-whitespace', 'read-sequence', 'reader-error', 'readtable', 'readtable-case', 'readtablep', 'real', 'realp', 'realpart', 'reduce', 'reinitialize-instance', 'rem', 'remf', 'remhash', 'remove', 'remove-duplicates', 'remove-if', 'remove-if-not', 'remove-method', 'remprop', 'rename-file', 'rename-package', 'replace', 'require', 'rest', 'restart', 'restart-bind', 'restart-case', 'restart-name', 'return', 'return-from', 'revappend', 'reverse', 'room', 'rotatef', 'round', 'row-major-aref', 'rplaca', 'rplacd', 'safety', 'satisfies', 'sbit', 'scale-float', 'schar', 'search', 'second', 'sequence', 'serious-condition', 'set', 'set-char-bit', 'set-difference', 'set-dispatch-macro-character', 'set-exclusive-or', 'set-macro-character', 'set-pprint-dispatch', 'set-syntax-from-char', 'setf', 'setq', 'seventh', 'shadow', 'shadowing-import', 'shared-initialize', 'shiftf', 'short-float', 'short-float-epsilon', 'short-float-negative-epsilon', 'short-site-name', 'signal', 'signed-byte', 'signum', 'simle-condition', 'simple-array', 'simple-base-string', 'simple-bit-vector', 'simple-bit-vector-p', 'simple-condition-format-arguments', 'simple-condition-format-control', 'simple-error', 'simple-string', 'simple-string-p', 'simple-type-error', 'simple-vector', 'simple-vector-p', 'simple-warning', 'sin', 'single-flaot-epsilon', 'single-float', 'single-float-epsilon', 'single-float-negative-epsilon', 'sinh', 'sixth', 'sleep', 'slot-boundp', 'slot-exists-p', 'slot-makunbound', 'slot-missing', 'slot-unbound', 'slot-value', 'software-type', 'software-version', 'some', 'sort', 'space', 'special', 'special-form-p', 'special-operator-p', 'speed', 'sqrt', 'stable-sort', 'standard', 'standard-char', 'standard-char-p', 'standard-class', 'standard-generic-function', 'standard-method', 'standard-object', 'step', 'storage-condition', 'store-value', 'stream', 'stream-element-type', 'stream-error', 'stream-error-stream', 'stream-external-format', 'streamp', 'streamup', 'string', 'string-capitalize', 'string-char', 'string-char-p', 'string-downcase', 'string-equal', 'string-greaterp', 'string-left-trim', 'string-lessp', 'string-not-equal', 'string-not-greaterp', 'string-not-lessp', 'string-right-strim', 'string-right-trim', 'string-stream', 'string-trim', 'string-upcase', 'string/=', 'string<', 'string<=', 'string=', 'string>', 'string>=', 'stringp', 'structure', 'structure-class', 'structure-object', 'style-warning', 'sublim', 'sublis', 'subseq', 'subsetp', 'subst', 'subst-if', 'subst-if-not', 'substitute', 'substitute-if', 'substitute-if-not', 'subtypep', 'svref', 'sxhash', 'symbol', 'symbol-function', 'symbol-macrolet', 'symbol-name', 'symbol-package', 'symbol-plist', 'symbol-value', 'symbolp', 'synonym-stream', 'synonym-stream-symbol', 'sys', 'system', 't', 'tagbody', 'tailp', 'tan', 'tanh', 'tenth', 'terpri', 'the', 'third', 'throw', 'time', 'trace', 'translate-logical-pathname', 'translate-pathname', 'tree-equal', 'truename', 'truncase', 'truncate', 'two-way-stream', 'two-way-stream-input-stream', 'two-way-stream-output-stream', 'type', 'type-error', 'type-error-datum', 'type-error-expected-type', 'type-of', 'typecase', 'typep', 'unbound-slot', 'unbound-slot-instance', 'unbound-variable', 'undefined-function', 'unexport', 'unintern', 'union', 'unless', 'unread', 'unread-char', 'unsigned-byte', 'untrace', 'unuse-package', 'unwind-protect', 'update-instance-for-different-class', 'update-instance-for-redefined-class', 'upgraded-array-element-type', 'upgraded-complex-part-type', 'upper-case-p', 'use-package', 'use-value', 'user', 'user-homedir-pathname', 'values', 'values-list', 'vector', 'vector-pop', 'vector-push', 'vector-push-extend', 'vectorp', 'warn', 'warning', 'when', 'wild-pathname-p', 'with-accessors', 'with-compilation-unit', 'with-condition-restarts', 'with-hash-table-iterator', 'with-input-from-string', 'with-open-file', 'with-open-stream', 'with-output-to-string', 'with-package-iterator', 'with-simple-restart', 'with-slots', 'with-standard-io-syntax', 'write', 'write-byte', 'write-char', 'write-line', 'write-sequence', 'write-string', 'write-to-string', 'y-or-n-p', 'yes-or-no-p', 'zerop', ); $self->listAdd('modifiers', ':abort', ':adjustable', ':append', ':array', ':base', ':case', ':circle', ':conc-name', ':constructor', ':copier', ':count', ':create', ':default', ':defaults', ':device', ':direction', ':directory', ':displaced-index-offset', ':displaced-to', ':element-type', ':end', ':end1', ':end2', ':error', ':escape', ':external', ':from-end', ':gensym', ':host', ':if-does-not-exist:pretty', ':if-exists:print', ':include:print-function', ':index', ':inherited', ':initial-contents', ':initial-element', ':initial-offset', ':initial-value', ':input', ':internal:size', ':io', ':junk-allowed', ':key', ':length', ':level', ':name', ':named', ':new-version', ':nicknames', ':output', ':output-file', ':overwrite', ':predicate', ':preserve-whitespace', ':probe', ':radix', ':read-only', ':rehash-size', ':rehash-threshold', ':rename', ':rename-and-delete', ':start', ':start1', ':start2', ':stream', ':supersede', ':test', ':test-not', ':type', ':use', ':verbose', ':version', ); $self->listAdd('symbols', '*', '**', '***', '+', '++', '+++', '-', '/', '//', '///', '/=', '1+', '1-', '<', '<=', '=', '=>', '>', '>=', ); $self->listAdd('variables', '*applyhook*', '*break-on-signals*', '*break-on-signals*', '*break-on-warnings*', '*compile-file-pathname*', '*compile-file-pathname*', '*compile-file-truename*', '*compile-file-truename*', '*compile-print*', '*compile-verbose*', '*compile-verbose*', '*debug-io*', '*debugger-hook*', '*default-pathname-defaults*', '*error-output*', '*evalhook*', '*features*', '*gensym-counter*', '*load-pathname*', '*load-print*', '*load-truename*', '*load-verbose*', '*macroexpand-hook*', '*modules*', '*package*', '*print-array*', '*print-base*', '*print-case*', '*print-circle*', '*print-escape*', '*print-gensym*', '*print-length*', '*print-level*', '*print-lines*', '*print-miser-width*', '*print-miser-width*', '*print-pprint-dispatch*', '*print-pprint-dispatch*', '*print-pretty*', '*print-radix*', '*print-readably*', '*print-right-margin*', '*print-right-margin*', '*query-io*', '*random-state*', '*read-base*', '*read-default-float-format*', '*read-eval*', '*read-suppress*', '*readtable*', '*standard-input*', '*standard-output*', '*terminal-io*', '*trace-output*', ); $self->contextdata({ 'MultiLineComment' => { callback => \&parseMultiLineComment, attribute => 'Comment', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal', }, 'SpecialNumber' => { callback => \&parseSpecialNumber, attribute => 'Normal', lineending => '#pop', }, 'String' => { callback => \&parseString, attribute => 'String', }, 'function_decl' => { callback => \&parsefunction_decl, attribute => 'Function', }, }); $self->deliminators('\\s||\\.|\\(|\\)|,|\\%|\\&|;|\\[|\\]|\\^|\\{|\\||\\}|\\~|-|\\+|\\*|\\?|\\!|<|>|=|\\/|:|#|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Common Lisp'; } sub parseMultiLineComment { my ($self, $text) = @_; # attribute => 'Comment' # char => '|' # char1 => '#' # context => '#pop' # endRegion => 'region' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '|', '#', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # String => ';+\s*BEGIN.*$' # attribute => 'Region Marker' # beginRegion => 'region' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, ';+\\s*BEGIN.*$', 0, 0, 0, undef, 0, '#stay', 'Region Marker')) { return 1 } # String => ';+\s*END.*$' # attribute => 'Region Marker' # context => '#stay' # endRegion => 'region' # type => 'RegExpr' if ($self->testRegExpr($text, ';+\\s*END.*$', 0, 0, 0, undef, 0, '#stay', 'Region Marker')) { return 1 } # String => ';.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, ';.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # attribute => 'Comment' # beginRegion => 'region' # char => '#' # char1 => '|' # context => 'MultiLineComment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '#', '|', 0, 0, 0, undef, 0, 'MultiLineComment', 'Comment')) { return 1 } # attribute => 'Brackets' # char => '(' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, '#stay', 'Brackets')) { return 1 } # attribute => 'Brackets' # char => ')' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#stay', 'Brackets')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'symbols' # attribute => 'Operator' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'symbols', 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => 'modifiers' # attribute => 'Modifier' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'modifiers', 0, undef, 0, '#stay', 'Modifier')) { return 1 } # String => 'variables' # attribute => 'Variable' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'variables', 0, undef, 0, '#stay', 'Variable')) { return 1 } # String => 'definitions' # attribute => 'Definition' # context => 'function_decl' # type => 'keyword' if ($self->testKeyword($text, 'definitions', 0, undef, 0, 'function_decl', 'Definition')) { return 1 } # String => '#\\.' # attribute => 'Char' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\\\.', 0, 0, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # String => '#[bodxei]' # attribute => 'Char' # context => 'SpecialNumber' # type => 'RegExpr' if ($self->testRegExpr($text, '#[bodxei]', 0, 0, 0, undef, 0, 'SpecialNumber', 'Char')) { return 1 } # String => '#[tf]' # attribute => 'Decimal' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#[tf]', 0, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # attribute => 'Float' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { return 1 } # attribute => 'Decimal' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { return 1 } return 0; }; sub parseSpecialNumber { my ($self, $text) = @_; # attribute => 'Float' # context => '#pop' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#pop', 'Float')) { return 1 } # attribute => 'Decimal' # context => '#pop' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#pop', 'Decimal')) { return 1 } # attribute => 'BaseN' # context => '#pop' # type => 'HlCOct' if ($self->testHlCOct($text, 0, undef, 0, '#pop', 'BaseN')) { return 1 } # attribute => 'Float' # context => '#pop' # type => 'HlCHex' if ($self->testHlCHex($text, 0, undef, 0, '#pop', 'Float')) { return 1 } return 0; }; sub parseString { my ($self, $text) = @_; # String => '#\\.' # attribute => 'Char' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\\\.', 0, 0, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; sub parsefunction_decl { my ($self, $text) = @_; # String => '\s*[A-Za-z0-9-+\<\>//\*]*\s*' # attribute => 'Function' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*[A-Za-z0-9-+\\<\\>//\\*]*\\s*', 0, 0, 0, undef, 0, '#pop', 'Function')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Common_Lisp - a Plugin for Common Lisp syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Common_Lisp; my $sh = new Syntax::Highlight::Engine::Kate::Common_Lisp([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Common_Lisp is a plugin module that provides syntax highlighting for Common Lisp to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Objective_Caml.pm0000644000175000017500000002613413226470762027531 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'ocaml.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.04 #kate version 2.4 #kate author Glyn Webster (glyn@wave.co.nz) #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::Objective_Caml; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Binary' => 'BaseN', 'Camlp4 Quotation' => 'String', 'Character' => 'Char', 'Comment' => 'Comment', 'Core Data Type' => 'DataType', 'Decimal' => 'DecVal', 'Directive' => 'Others', 'Escaped characters' => 'Char', 'Float' => 'Float', 'Hexadecimal' => 'BaseN', 'Identifier' => 'Normal', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Octal' => 'BaseN', 'Revised Syntax Keyword' => 'Normal', 'String' => 'String', }); $self->listAdd('core types', 'array', 'bool', 'char', 'exn', 'format', 'int', 'lazy_t', 'list', 'option', 'real', 'ref', 'string', 'unit', ); $self->listAdd('keywords', 'and', 'as', 'asr', 'assert', 'begin', 'class', 'closed', 'constraint', 'do', 'done', 'downto', 'else', 'end', 'exception', 'external', 'false', 'for', 'fun', 'function', 'functor', 'if', 'in', 'include', 'inherit', 'land', 'lazy', 'let', 'lor', 'lsl', 'lsr', 'lxor', 'match', 'method', 'mod', 'module', 'mutable', 'new', 'of', 'open', 'or', 'parser', 'private', 'rec', 'sig', 'struct', 'then', 'to', 'true', 'try', 'type', 'val', 'virtual', 'when', 'while', 'with', ); $self->listAdd('revised syntax keywords', 'declare', 'value', 'where', ); $self->contextdata({ 'Camlp4 Quotation Constant' => { callback => \&parseCamlp4QuotationConstant, attribute => 'Camlp4 Quotation', }, 'Multiline Comment' => { callback => \&parseMultilineComment, attribute => 'Comment', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'String Constant' => { callback => \&parseStringConstant, attribute => 'String', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Objective Caml'; } sub parseCamlp4QuotationConstant { my ($self, $text) = @_; # attribute => 'Camlp4 Quotation' # char => '>' # char1 => '>' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '>', '>', 0, 0, 0, undef, 0, '#pop', 'Camlp4 Quotation')) { return 1 } # attribute => 'Camlp4 Quotation' # char => '<' # char1 => '<' # context => 'Camlp4 Quotation Constant' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '<', '<', 0, 0, 0, undef, 0, 'Camlp4 Quotation Constant', 'Camlp4 Quotation')) { return 1 } # String => '<:[A-Za-z\300-\326\330-\366\370-\377_][A-Za-z\300-\326\330-\366\370-\3770-9_']*<' # attribute => 'Camlp4 Quotation' # context => 'Camlp4 Quotation Constant' # type => 'RegExpr' if ($self->testRegExpr($text, '<:[A-Za-z\\300-\\326\\330-\\366\\370-\\377_][A-Za-z\\300-\\326\\330-\\366\\370-\\3770-9_\']*<', 0, 0, 0, undef, 0, 'Camlp4 Quotation Constant', 'Camlp4 Quotation')) { return 1 } # String => '\\(\\|>>|<<)' # attribute => 'Escaped characters' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\(\\\\|>>|<<)', 0, 0, 0, undef, 0, '#stay', 'Escaped characters')) { return 1 } # String => '\\<:[A-Za-z\300-\326\330-\366\370-\377_][A-Za-z\300-\326\330-\366\370-\3770-9_']*<' # attribute => 'Escaped characters' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\<:[A-Za-z\\300-\\326\\330-\\366\\370-\\377_][A-Za-z\\300-\\326\\330-\\366\\370-\\3770-9_\']*<', 0, 0, 0, undef, 0, '#stay', 'Escaped characters')) { return 1 } return 0; }; sub parseMultilineComment { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => ')' # context => '#pop' # endRegion => 'comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', ')', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } # attribute => 'Comment' # beginRegion => 'comment' # char => '(' # char1 => '*' # context => 'Multiline Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '(', '*', 0, 0, 0, undef, 0, 'Multiline Comment', 'Comment')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # attribute => 'Comment' # beginRegion => 'comment' # char => '(' # char1 => '*' # context => 'Multiline Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '(', '*', 0, 0, 0, undef, 0, 'Multiline Comment', 'Comment')) { return 1 } # String => '#[A-Za-z\300-\326\330-\366\370-\377_][A-Za-z\300-\326\330-\366\370-\3770-9_']*.*$' # attribute => 'Directive' # context => '#stay' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#[A-Za-z\\300-\\326\\330-\\366\\370-\\377_][A-Za-z\\300-\\326\\330-\\366\\370-\\3770-9_\']*.*$', 0, 0, 0, undef, 1, '#stay', 'Directive')) { return 1 } # attribute => 'String' # char => '"' # context => 'String Constant' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String Constant', 'String')) { return 1 } # String => ''((\\[ntbr'"\\]|\\[0-9]{3}|\\x[0-9A-Fa-f]{2})|[^'])'' # attribute => 'Character' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\'((\\\\[ntbr\'"\\\\]|\\\\[0-9]{3}|\\\\x[0-9A-Fa-f]{2})|[^\'])\'', 0, 0, 0, undef, 0, '#stay', 'Character')) { return 1 } # attribute => 'Camlp4 Quotation' # char => '<' # char1 => '<' # context => 'Camlp4 Quotation Constant' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '<', '<', 0, 0, 0, undef, 0, 'Camlp4 Quotation Constant', 'Camlp4 Quotation')) { return 1 } # String => '<:[A-Za-z\300-\326\330-\366\370-\377_][A-Za-z\300-\326\330-\366\370-\3770-9_']*<' # attribute => 'Camlp4 Quotation' # context => 'Camlp4 Quotation Constant' # type => 'RegExpr' if ($self->testRegExpr($text, '<:[A-Za-z\\300-\\326\\330-\\366\\370-\\377_][A-Za-z\\300-\\326\\330-\\366\\370-\\3770-9_\']*<', 0, 0, 0, undef, 0, 'Camlp4 Quotation Constant', 'Camlp4 Quotation')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'revised syntax keywords' # attribute => 'Revised Syntax Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'revised syntax keywords', 0, undef, 0, '#stay', 'Revised Syntax Keyword')) { return 1 } # String => 'core types' # attribute => 'Core Data Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'core types', 0, undef, 0, '#stay', 'Core Data Type')) { return 1 } # String => '[A-Za-z\300-\326\330-\366\370-\377_][A-Za-z\300-\326\330-\366\370-\3770-9_']*' # attribute => 'Identifier' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[A-Za-z\\300-\\326\\330-\\366\\370-\\377_][A-Za-z\\300-\\326\\330-\\366\\370-\\3770-9_\']*', 0, 0, 0, undef, 0, '#stay', 'Identifier')) { return 1 } # String => '-?0[xX][0-9A-Fa-f_]+' # attribute => 'Hexadecimal' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '-?0[xX][0-9A-Fa-f_]+', 0, 0, 0, undef, 0, '#stay', 'Hexadecimal')) { return 1 } # String => '-?0[oO][0-7_]+' # attribute => 'Octal' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '-?0[oO][0-7_]+', 0, 0, 0, undef, 0, '#stay', 'Octal')) { return 1 } # String => '-?0[bB][01_]+' # attribute => 'Binary' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '-?0[bB][01_]+', 0, 0, 0, undef, 0, '#stay', 'Binary')) { return 1 } # String => '-?[0-9][0-9_]*(\.[0-9][0-9_]*([eE][-+]?[0-9][0-9_]*)?|[eE][-+]?[0-9][0-9_]*)' # attribute => 'Float' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '-?[0-9][0-9_]*(\\.[0-9][0-9_]*([eE][-+]?[0-9][0-9_]*)?|[eE][-+]?[0-9][0-9_]*)', 0, 0, 0, undef, 0, '#stay', 'Float')) { return 1 } # String => '-?[0-9][0-9_]*' # attribute => 'Decimal' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '-?[0-9][0-9_]*', 0, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } return 0; }; sub parseStringConstant { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } # String => '(\\[ntbr'"\\]|\\[0-9]{3}|\\x[0-9A-Fa-f]{2})' # attribute => 'Escaped characters' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(\\\\[ntbr\'"\\\\]|\\\\[0-9]{3}|\\\\x[0-9A-Fa-f]{2})', 0, 0, 0, undef, 0, '#stay', 'Escaped characters')) { return 1 } # String => '\\$' # attribute => 'Escaped characters' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\$', 0, 0, 0, undef, 0, '#stay', 'Escaped characters')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Objective_Caml - a Plugin for Objective Caml syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Objective_Caml; my $sh = new Syntax::Highlight::Engine::Kate::Objective_Caml([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Objective_Caml is a plugin module that provides syntax highlighting for Objective Caml to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/GNU_Assembler.pm0000644000175000017500000002376713226470762027322 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'gnuassembler.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.05 #kate version 2.4 #kate author John Zaitseff (J.Zaitseff@zap.org.au), Roland Pabel (roland@pabel.name) #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::GNU_Assembler; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Binary' => 'BaseN', 'Char' => 'Char', 'Comment' => 'Comment', 'Decimal' => 'DecVal', 'Float' => 'Float', 'Hex' => 'BaseN', 'Keyword' => 'Keyword', 'Label' => 'Normal', 'Normal Text' => 'Normal', 'Octal' => 'BaseN', 'Preprocessor' => 'Others', 'String' => 'String', 'String Char' => 'Char', 'Symbol' => 'Normal', }); $self->listAdd('keywords', '.abort', '.align', '.appfile', '.appline', '.arm', '.ascii', '.asciz', '.balign', '.balignl', '.balignw', '.bss', '.byte', '.code', '.comm', '.common', '.common.s', '.data', '.dc', '.dc.b', '.dc.d', '.dc.l', '.dc.s', '.dc.w', '.dc.x', '.dcb', '.dcb.b', '.dcb.d', '.dcb.l', '.dcb.s', '.dcb.w', '.dcb.x', '.debug', '.def', '.desc', '.dim', '.double', '.ds', '.ds.b', '.ds.d', '.ds.l', '.ds.p', '.ds.s', '.ds.w', '.ds.x', '.dsect', '.eject', '.else', '.elsec', '.elseif', '.end', '.endc', '.endef', '.endfunc', '.endif', '.endm', '.endr', '.equ', '.equiv', '.err', '.even', '.exitm', '.extend', '.extern', '.fail', '.file', '.fill', '.float', '.force_thumb', '.format', '.func', '.global', '.globl', '.hidden', '.hword', '.ident', '.if', '.ifc', '.ifdef', '.ifeq', '.ifeqs', '.ifge', '.ifgt', '.ifle', '.iflt', '.ifnc', '.ifndef', '.ifne', '.ifnes', '.ifnotdef', '.include', '.int', '.internal', '.irep', '.irepc', '.irp', '.irpc', '.lcomm', '.ldouble', '.lflags', '.line', '.linkonce', '.list', '.llen', '.ln', '.loc', '.long', '.lsym', '.ltorg', '.macro', '.mexit', '.name', '.noformat', '.nolist', '.nopage', '.octa', '.offset', '.org', '.p2align', '.p2alignl', '.p2alignw', '.packed', '.page', '.plen', '.pool', '.popsection', '.previous', '.print', '.protected', '.psize', '.purgem', '.pushsection', '.quad', '.rep', '.rept', '.req', '.rva', '.sbttl', '.scl', '.sect', '.sect.s', '.section', '.section.s', '.set', '.short', '.single', '.size', '.skip', '.sleb128', '.space', '.spc', '.stabd', '.stabn', '.stabs', '.string', '.struct', '.subsection', '.symver', '.tag', '.text', '.thumb', '.thumb_func', '.thumb_set', '.title', '.ttl', '.type', '.uleb128', '.use', '.val', '.version', '.vtable_entry', '.vtable_inherit', '.weak', '.word', '.xcom', '.xdef', '.xref', '.xstabs', '.zero', ); $self->contextdata({ 'Commentar 1' => { callback => \&parseCommentar1, attribute => 'Comment', }, 'Commentar 2' => { callback => \&parseCommentar2, attribute => 'Comment', lineending => '#pop', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'Preprocessor' => { callback => \&parsePreprocessor, attribute => 'Preprocessor', lineending => '#pop', }, 'Some Context' => { callback => \&parseSomeContext, attribute => 'Normal Text', lineending => '#pop', }, 'String' => { callback => \&parseString, attribute => 'String', lineending => '#pop', }, }); $self->deliminators('\\s||\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|_|\\.|\\$'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'GNU Assembler'; } sub parseCommentar1 { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseCommentar2 { my ($self, $text) = @_; return 0; }; sub parseNormal { my ($self, $text) = @_; # String => '[A-Za-z0-9_.$]+:' # attribute => 'Label' # context => '#stay' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '[A-Za-z0-9_.$]+:', 0, 0, 0, undef, 1, '#stay', 'Label')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # attribute => 'Octal' # context => '#stay' # type => 'HlCOct' if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) { return 1 } # attribute => 'Hex' # context => '#stay' # type => 'HlCHex' if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) { return 1 } # String => '0[bB][01]+' # attribute => 'Binary' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '0[bB][01]+', 0, 0, 0, undef, 0, '#stay', 'Binary')) { return 1 } # attribute => 'Decimal' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => '0[fFeEdD][-+]?[0-9]*\.?[0-9]*[eE]?[-+]?[0-9]+' # attribute => 'Float' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '0[fFeEdD][-+]?[0-9]*\\.?[0-9]*[eE]?[-+]?[0-9]+', 0, 0, 0, undef, 0, '#stay', 'Float')) { return 1 } # String => '[A-Za-z_.$][A-Za-z0-9_.$]*' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[A-Za-z_.$][A-Za-z0-9_.$]*', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => ''(\\x[0-9a-fA-F][0-9a-fA-F]?|\\[0-7]?[0-7]?[0-7]?|\\.|.)' # attribute => 'Char' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\'(\\\\x[0-9a-fA-F][0-9a-fA-F]?|\\\\[0-7]?[0-7]?[0-7]?|\\\\.|.)', 0, 0, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '*' # context => 'Commentar 1' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) { return 1 } # String => '@;' # attribute => 'Comment' # context => 'Commentar 2' # type => 'AnyChar' if ($self->testAnyChar($text, '@;', 0, 0, undef, 0, 'Commentar 2', 'Comment')) { return 1 } # String => '!#%&*()+,-<=>?/:[]^{|}~' # attribute => 'Symbol' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '!#%&*()+,-<=>?/:[]^{|}~', 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # String => '^#' # attribute => 'Preprocessor' # context => 'Preprocessor' # type => 'RegExpr' if ($self->testRegExpr($text, '^#', 0, 0, 0, undef, 0, 'Preprocessor', 'Preprocessor')) { return 1 } return 0; }; sub parsePreprocessor { my ($self, $text) = @_; return 0; }; sub parseSomeContext { my ($self, $text) = @_; return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # context => 'Some Context' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, 'Some Context', 'String')) { return 1 } # attribute => 'String Char' # context => '#stay' # type => 'HlCStringChar' if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::GNU_Assembler - a Plugin for GNU Assembler syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::GNU_Assembler; my $sh = new Syntax::Highlight::Engine::Kate::GNU_Assembler([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::GNU_Assembler is a plugin module that provides syntax highlighting for GNU Assembler to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/ASP.pm0000644000175000017500000006633213226470762025312 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'asp.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.02 #kate version 2.1 #kate author Antonio Salazar (savedfastcool@gmail.com) #generated: Sun Feb 3 22:02:04 2008, localtime package Syntax::Highlight::Engine::Kate::ASP; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'ASP Text' => 'Normal', 'Comment' => 'Comment', 'Control Structures' => 'Operator', 'Decimal' => 'DecVal', 'Escape Code' => 'Char', 'Float' => 'Float', 'Function' => 'Function', 'HTML Comment' => 'Comment', 'HTML Tag' => 'BString', 'Hex' => 'BaseN', 'Identifier' => 'Others', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Octal' => 'BaseN', 'Other' => 'Others', 'String' => 'String', 'Types' => 'DataType', 'Variable' => 'Variable', }); $self->listAdd('control structures', 'case', 'continue', 'do', 'each', 'else', 'elseif', 'end if', 'end select', 'exit', 'for', 'if', 'in', 'loop', 'next', 'select', 'then', 'to', 'until', 'wend', 'while', ); $self->listAdd('functions', 'Add', 'AddFolders', 'BuildPath', 'Clear', 'Close', 'Copy', 'CopyFile', 'CopyFolder', 'CreateFolder', 'CreateTextFile', 'Date', 'DateDiff', 'DatePart', 'DateSerial', 'DateValue', 'Day', 'Delete', 'DeleteFile', 'DeleteFolder', 'DriveExists', 'Exists', 'Exp', 'FileExists', 'Filter', 'Fix', 'FolderExists', 'FormatCurrency', 'FormatDateTime', 'FormatNumber', 'FormatPercent', 'GetAbsolutePathName', 'GetBaseName', 'GetDrive', 'GetDriveName', 'GetExtensionName', 'GetFile', 'GetFileName', 'GetFolder', 'GetObject', 'GetParentFolderName', 'GetSpecialFolder', 'GetTempName', 'Hex', 'Hour', 'InStr', 'InStrRev', 'InputBox', 'Int', 'IsArray', 'IsDate', 'IsEmpty', 'IsNull', 'IsNumeric', 'IsObject', 'Items', 'Join', 'Keys', 'LBound', 'LCase', 'LTrim', 'Left', 'Len', 'LoadPicture', 'Log', 'Mid', 'Minute', 'Month', 'MonthName', 'Move', 'MoveFile', 'MoveFolder', 'MsgBox', 'Now', 'Oct', 'OpenAsTextStream', 'OpenTextFile', 'RGB', 'RTrim', 'Raise', 'Read', 'ReadAll', 'ReadLine', 'Remove', 'RemoveAll', 'Replace', 'Right', 'Rnd', 'Round', 'ScriptEngine', 'ScriptEngineBuildVersion', 'ScriptEngineMajorVersion', 'ScriptEngineMinorVersion', 'Second', 'Sgn', 'Sin', 'Skip', 'SkipLine', 'Space', 'Split', 'Sqr', 'StrComp', 'StrReverse', 'String', 'Tan', 'Time', 'TimeSerial', 'TimeValue', 'Timer', 'Trim', 'TypeName', 'UBound', 'UCase', 'VarType', 'Weekday', 'WeekdayName', 'Write', 'WriteBlankLines', 'WriteLine', 'Year', 'abs', 'array', 'asc', 'atn', 'cbool', 'cbyte', 'ccur', 'cdate', 'cdbl', 'chr', 'cint', 'clng', 'cookies', 'cos', 'createobject', 'csng', 'cstr', 'date', 'dateadd', 'end', 'form', 'item', 'querystring', 'redirect', 'request', 'response', 'server', 'servervariables', 'session', 'write', ); $self->listAdd('keywords', 'and', 'call', 'class', 'close', 'const', 'dim', 'eof', 'erase', 'execute', 'false', 'function', 'me', 'movenext', 'new', 'not', 'nothing', 'open', 'or', 'preserve', 'private', 'public', 'randomize', 'redim', 'set', 'sub', 'true', 'with', 'xor', ); $self->contextdata({ 'asp_onelinecomment' => { callback => \&parseasp_onelinecomment, attribute => 'Comment', lineending => '#pop', }, 'aspsource' => { callback => \&parseaspsource, attribute => 'ASP Text', }, 'doublequotestring' => { callback => \&parsedoublequotestring, attribute => 'String', }, 'htmlcomment' => { callback => \&parsehtmlcomment, attribute => 'HTML Comment', }, 'htmltag' => { callback => \&parsehtmltag, attribute => 'Identifier', }, 'identifiers' => { callback => \&parseidentifiers, attribute => 'Identifier', }, 'nosource' => { callback => \&parsenosource, attribute => 'Normal Text', }, 'scripts' => { callback => \&parsescripts, attribute => 'Normal Text', }, 'scripts_onelinecomment' => { callback => \&parsescripts_onelinecomment, attribute => 'Comment', lineending => '#pop', }, 'singlequotestring' => { callback => \&parsesinglequotestring, attribute => 'String', }, 'twolinecomment' => { callback => \&parsetwolinecomment, attribute => 'Comment', }, 'types1' => { callback => \&parsetypes1, attribute => 'Types', }, 'types2' => { callback => \&parsetypes2, attribute => 'Types', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('nosource'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'ASP'; } sub parseasp_onelinecomment { my ($self, $text) = @_; # String => '%>' # attribute => 'Keyword' # context => '#pop#pop' # type => 'StringDetect' if ($self->testStringDetect($text, '%>', 0, 0, 0, undef, 0, '#pop#pop', 'Keyword')) { return 1 } return 0; }; sub parseaspsource { my ($self, $text) = @_; # String => '%>' # attribute => 'Keyword' # context => '#pop' # type => 'StringDetect' if ($self->testStringDetect($text, '%>', 0, 0, 0, undef, 0, '#pop', 'Keyword')) { return 1 } # attribute => 'Comment' # char => ''' # context => 'asp_onelinecomment' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'asp_onelinecomment', 'Comment')) { return 1 } # attribute => 'String' # char => '"' # context => 'doublequotestring' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'doublequotestring', 'String')) { return 1 } # attribute => 'String' # char => ''' # context => 'singlequotestring' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'singlequotestring', 'String')) { return 1 } # attribute => 'Keyword' # char => '&' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '&', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '' # attribute => 'String' # context => '' # type => 'RegExpr' if ($self->testRegExpr($text, '', 0, 0, 0, undef, 0, '', 'String')) { return 1 } # String => '[0123456789]*\.\.\.[0123456789]*' # attribute => 'String' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[0123456789]*\\.\\.\\.[0123456789]*', 0, 0, 0, undef, 0, '#stay', 'String')) { return 1 } # attribute => 'Octal' # context => '#stay' # type => 'HlCOct' if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) { return 1 } # attribute => 'Hex' # context => '#stay' # type => 'HlCHex' if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) { return 1 } # attribute => 'Float' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { return 1 } # attribute => 'Decimal' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => ';()}{:,[]' # attribute => 'Other' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, ';()}{:,[]', 0, 0, undef, 0, '#stay', 'Other')) { return 1 } # String => '\belseif\b' # attribute => 'Control Structures' # beginRegion => 'iffi1' # context => '#stay' # endRegion => 'iffi1' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\belseif\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { return 1 } # String => '\belse\b' # attribute => 'Control Structures' # beginRegion => 'iffi1' # context => '#stay' # endRegion => 'iffi1' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\belse\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { return 1 } # String => '\bif\b' # attribute => 'Control Structures' # beginRegion => 'iffi1' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bif\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { return 1 } # String => '\bend if\b' # attribute => 'Control Structures' # context => '#stay' # endRegion => 'iffi1' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bend if\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { return 1 } # String => '\bexit function\b' # attribute => 'Keyword' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bexit function\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bfunction\b' # attribute => 'Keyword' # beginRegion => 'funendfun1' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bfunction\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bend function\b' # attribute => 'Keyword' # context => '#stay' # endRegion => 'funendfun1' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bend function\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bexit sub\b' # attribute => 'Keyword' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bexit sub\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bsub\b' # attribute => 'Keyword' # beginRegion => 'subendsub1' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bsub\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bend sub\b' # attribute => 'Keyword' # context => '#stay' # endRegion => 'subendsub1' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bend sub\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bclass\b' # attribute => 'Keyword' # beginRegion => 'classendclass1' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bclass\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bend class\b' # attribute => 'Keyword' # context => '#stay' # endRegion => 'classendclass1' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bend class\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bexit do\b' # attribute => 'Control Structures' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bexit do\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { return 1 } # String => '\bdo\b' # attribute => 'Control Structures' # beginRegion => 'doloop1' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bdo\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { return 1 } # String => '\bloop\b' # attribute => 'Control Structures' # context => '#stay' # endRegion => 'doloop1' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bloop\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { return 1 } # String => '\bexit while\b' # attribute => 'Control Structures' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bexit while\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { return 1 } # String => '\bwhile\b' # attribute => 'Control Structures' # beginRegion => 'whilewend1' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bwhile\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { return 1 } # String => '\bwend\b' # attribute => 'Control Structures' # context => '#stay' # endRegion => 'whilewend1' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bwend\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { return 1 } # String => '\bexit for\b' # attribute => 'Control Structures' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bexit for\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { return 1 } # String => '\bfor\b' # attribute => 'Control Structures' # beginRegion => 'fornext1' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bfor\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { return 1 } # String => '\bnext\b' # attribute => 'Control Structures' # context => '#stay' # endRegion => 'fornext1' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bnext\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { return 1 } # String => '\bselect case\b' # attribute => 'Control Structures' # beginRegion => 'selcase1' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bselect case\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { return 1 } # String => '\bend select\b' # attribute => 'Control Structures' # context => '#stay' # endRegion => 'selcase1' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bend select\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'control structures' # attribute => 'Control Structures' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'control structures', 0, undef, 0, '#stay', 'Control Structures')) { return 1 } # String => 'functions' # attribute => 'Function' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) { return 1 } return 0; }; sub parsedoublequotestring { my ($self, $text) = @_; # attribute => 'Escape Code' # char => '"' # char1 => '"' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '"', '"', 0, 0, 0, undef, 0, '#stay', 'Escape Code')) { return 1 } # String => '\\[0-7]{1,3}' # attribute => 'Escape Code' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\[0-7]{1,3}', 0, 0, 0, undef, 0, '#stay', 'Escape Code')) { return 1 } # String => '\\x[0-9A-Fa-f]{1,2}' # attribute => 'Escape Code' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\x[0-9A-Fa-f]{1,2}', 0, 0, 0, undef, 0, '#stay', 'Escape Code')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; sub parsehtmlcomment { my ($self, $text) = @_; # String => '<%' # attribute => 'Keyword' # context => 'aspsource' # type => 'StringDetect' if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) { return 1 } # String => '<%' # attribute => 'Keyword' # context => 'aspsource' # type => 'StringDetect' if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) { return 1 } # String => '-->' # attribute => 'HTML Comment' # context => '#pop' # type => 'StringDetect' if ($self->testStringDetect($text, '-->', 0, 0, 0, undef, 0, '#pop', 'HTML Comment')) { return 1 } # String => '\s*=\s*' # attribute => 'Normal Text' # context => 'identifiers' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*=\\s*', 0, 0, 0, undef, 0, 'identifiers', 'Normal Text')) { return 1 } return 0; }; sub parsehtmltag { my ($self, $text) = @_; # attribute => 'HTML Tag' # char => '/' # char1 => '>' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '>', 0, 0, 0, undef, 0, '#pop', 'HTML Tag')) { return 1 } # attribute => 'HTML Tag' # char => '>' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'HTML Tag')) { return 1 } # String => '<%' # attribute => 'Keyword' # context => 'aspsource' # type => 'StringDetect' if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) { return 1 } # String => '<%' # attribute => 'Keyword' # context => 'aspsource' # type => 'StringDetect' if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) { return 1 } # String => '\s*=\s*' # attribute => 'Identifier' # context => 'identifiers' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*=\\s*', 0, 0, 0, undef, 0, 'identifiers', 'Identifier')) { return 1 } return 0; }; sub parseidentifiers { my ($self, $text) = @_; # String => '\s*#?[a-zA-Z0-9]*' # attribute => 'String' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*#?[a-zA-Z0-9]*', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } # attribute => 'Types' # char => ''' # context => 'types1' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'types1', 'Types')) { return 1 } # attribute => 'Types' # char => '"' # context => 'types2' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'types2', 'Types')) { return 1 } return 0; }; sub parsenosource { my ($self, $text) = @_; # String => '<%' # attribute => 'Keyword' # context => 'aspsource' # type => 'StringDetect' if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) { return 1 } # String => '<\s*script(\s|>)' # attribute => 'HTML Tag' # context => 'scripts' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '<\\s*script(\\s|>)', 1, 0, 0, undef, 0, 'scripts', 'HTML Tag')) { return 1 } # String => '<\s*\/?\s*[a-zA-Z_:][a-zA-Z0-9._:-]*' # attribute => 'HTML Tag' # context => 'htmltag' # type => 'RegExpr' if ($self->testRegExpr($text, '<\\s*\\/?\\s*[a-zA-Z_:][a-zA-Z0-9._:-]*', 0, 0, 0, undef, 0, 'htmltag', 'HTML Tag')) { return 1 } # String => '' # attribute => 'CF Comment' # context => '#pop' # type => 'StringDetect' if ($self->testStringDetect($text, '--->', 0, 0, 0, undef, 0, '#pop', 'CF Comment')) { return 1 } return 0; }; sub parsectxCFTag { my ($self, $text) = @_; # attribute => 'CF Tags' # char => '>' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'CF Tags')) { return 1 } # attribute => 'Normal Text' # char => '=' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '"[^"]*"' # attribute => 'Attribute Values' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '"[^"]*"', 0, 0, 0, undef, 0, '#stay', 'Attribute Values')) { return 1 } # String => ''[^']*'' # attribute => 'Attribute Values' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\'[^\']*\'', 0, 0, 0, undef, 0, '#stay', 'Attribute Values')) { return 1 } return 0; }; sub parsectxCFSCRIPTBlock { my ($self, $text) = @_; # attribute => 'Script Comment' # char => '/' # char1 => '*' # context => 'ctxC Style Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'ctxC Style Comment', 'Script Comment')) { return 1 } # attribute => 'Script Comment' # char => '/' # char1 => '/' # context => 'ctxOne Line Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'ctxOne Line Comment', 'Script Comment')) { return 1 } # String => '"[^"]*"' # attribute => 'Script Strings' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '"[^"]*"', 0, 0, 0, undef, 0, '#stay', 'Script Strings')) { return 1 } # String => ''[^']*'' # attribute => 'Script Strings' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\'[^\']*\'', 0, 0, 0, undef, 0, '#stay', 'Script Strings')) { return 1 } # attribute => 'Script Numbers' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Script Numbers')) { return 1 } # attribute => 'Script Numbers' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Script Numbers')) { return 1 } # String => '[()[\]=+-*/]+' # attribute => 'Script Operators' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '[()[\\]=+-*/]+', 0, 0, undef, 0, '#stay', 'Script Operators')) { return 1 } # String => '{}' # attribute => 'Brackets' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '{}', 0, 0, undef, 0, '#stay', 'Brackets')) { return 1 } # String => 'CFSCRIPT Keywords' # attribute => 'Script Keywords' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'CFSCRIPT Keywords', 0, undef, 0, '#stay', 'Script Keywords')) { return 1 } # String => 'CFSCRIPT Functions' # attribute => 'Script Functions' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'CFSCRIPT Functions', 0, undef, 0, '#stay', 'Script Functions')) { return 1 } # String => '' # attribute => 'Script Tags' # context => '#pop#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '', 0, 0, 0, undef, 0, '#pop#pop', 'Script Tags')) { return 1 } return 0; }; sub parsectxCFSCRIPTTag { my ($self, $text) = @_; # attribute => 'Script Tags' # char => '>' # context => 'ctxCFSCRIPT Block' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, 'ctxCFSCRIPT Block', 'Script Tags')) { return 1 } # attribute => 'Normal Text' # char => '=' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '"[^"]*"' # attribute => 'Attribute Values' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '"[^"]*"', 0, 0, 0, undef, 0, '#stay', 'Attribute Values')) { return 1 } # String => ''[^']*'' # attribute => 'Attribute Values' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\'[^\']*\'', 0, 0, 0, undef, 0, '#stay', 'Attribute Values')) { return 1 } return 0; }; sub parsectxCFXTag { my ($self, $text) = @_; # attribute => 'CFX Tags' # char => '>' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'CFX Tags')) { return 1 } # attribute => 'Normal Text' # char => '=' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '"[^"]*"' # attribute => 'Attribute Values' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '"[^"]*"', 0, 0, 0, undef, 0, '#stay', 'Attribute Values')) { return 1 } # String => ''[^']*'' # attribute => 'Attribute Values' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\'[^\']*\'', 0, 0, 0, undef, 0, '#stay', 'Attribute Values')) { return 1 } return 0; }; sub parsectxCustomTag { my ($self, $text) = @_; # attribute => 'Custom Tags' # char => '>' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'Custom Tags')) { return 1 } # attribute => 'Normal Text' # char => '=' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '"[^"]*"' # attribute => 'Attribute Values' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '"[^"]*"', 0, 0, 0, undef, 0, '#stay', 'Attribute Values')) { return 1 } # String => ''[^']*'' # attribute => 'Attribute Values' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\'[^\']*\'', 0, 0, 0, undef, 0, '#stay', 'Attribute Values')) { return 1 } return 0; }; sub parsectxHTMLComment { my ($self, $text) = @_; # String => '' # attribute => 'HTML Comment' # context => '#pop' # type => 'StringDetect' if ($self->testStringDetect($text, '-->', 0, 0, 0, undef, 0, '#pop', 'HTML Comment')) { return 1 } return 0; }; sub parsectxHTMLEntities { my ($self, $text) = @_; # attribute => 'HTML Entities' # char => ';' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'HTML Entities')) { return 1 } return 0; }; sub parsectxImageTag { my ($self, $text) = @_; # attribute => 'Image Tags' # char => '>' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'Image Tags')) { return 1 } # attribute => 'Normal Text' # char => '=' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '"[^"]*"' # attribute => 'Attribute Values' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '"[^"]*"', 0, 0, 0, undef, 0, '#stay', 'Attribute Values')) { return 1 } # String => ''[^']*'' # attribute => 'Attribute Values' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\'[^\']*\'', 0, 0, 0, undef, 0, '#stay', 'Attribute Values')) { return 1 } return 0; }; sub parsectxOneLineComment { my ($self, $text) = @_; return 0; }; sub parsectxSCRIPTBlock { my ($self, $text) = @_; # attribute => 'Script Comment' # char => '/' # char1 => '*' # context => 'ctxC Style Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'ctxC Style Comment', 'Script Comment')) { return 1 } # attribute => 'Script Comment' # char => '/' # char1 => '/' # context => 'ctxOne Line Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'ctxOne Line Comment', 'Script Comment')) { return 1 } # String => '"[^"]*"' # attribute => 'Script Strings' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '"[^"]*"', 0, 0, 0, undef, 0, '#stay', 'Script Strings')) { return 1 } # String => ''[^']*'' # attribute => 'Script Strings' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\'[^\']*\'', 0, 0, 0, undef, 0, '#stay', 'Script Strings')) { return 1 } # attribute => 'Script Numbers' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Script Numbers')) { return 1 } # attribute => 'Script Numbers' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Script Numbers')) { return 1 } # String => '[()[\]=+-*/]+' # attribute => 'Script Operators' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '[()[\\]=+-*/]+', 0, 0, undef, 0, '#stay', 'Script Operators')) { return 1 } # String => '{}' # attribute => 'Brackets' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '{}', 0, 0, undef, 0, '#stay', 'Brackets')) { return 1 } # String => 'Script Keywords' # attribute => 'Script Keywords' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'Script Keywords', 0, undef, 0, '#stay', 'Script Keywords')) { return 1 } # String => 'Script Objects' # attribute => 'Script Objects' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'Script Objects', 0, undef, 0, '#stay', 'Script Objects')) { return 1 } # String => 'Script Methods' # attribute => 'Script Functions' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'Script Methods', 0, undef, 0, '#stay', 'Script Functions')) { return 1 } # String => '' # attribute => 'Script Tags' # context => '#pop#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '', 0, 0, 0, undef, 0, '#pop#pop', 'Script Tags')) { return 1 } return 0; }; sub parsectxSCRIPTTag { my ($self, $text) = @_; # attribute => 'Script Tags' # char => '>' # context => 'ctxSCRIPT Block' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, 'ctxSCRIPT Block', 'Script Tags')) { return 1 } # attribute => 'Normal Text' # char => '=' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '"[^"]*"' # attribute => 'Attribute Values' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '"[^"]*"', 0, 0, 0, undef, 0, '#stay', 'Attribute Values')) { return 1 } # String => ''[^']*'' # attribute => 'Attribute Values' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\'[^\']*\'', 0, 0, 0, undef, 0, '#stay', 'Attribute Values')) { return 1 } return 0; }; sub parsectxSTYLEBlock { my ($self, $text) = @_; # attribute => 'Script Comment' # char => '/' # char1 => '*' # context => 'ctxC Style Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'ctxC Style Comment', 'Script Comment')) { return 1 } # attribute => 'Brackets' # char => '{' # context => 'ctxStyle Properties' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'ctxStyle Properties', 'Brackets')) { return 1 } # String => '' # attribute => 'Style Tags' # context => '#pop#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '', 0, 0, 0, undef, 0, '#pop#pop', 'Style Tags')) { return 1 } return 0; }; sub parsectxSTYLETag { my ($self, $text) = @_; # attribute => 'Style Tags' # char => '>' # context => 'ctxSTYLE Block' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, 'ctxSTYLE Block', 'Style Tags')) { return 1 } # attribute => 'Normal Text' # char => '=' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '"[^"]*"' # attribute => 'Attribute Values' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '"[^"]*"', 0, 0, 0, undef, 0, '#stay', 'Attribute Values')) { return 1 } # String => ''[^']*'' # attribute => 'Attribute Values' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\'[^\']*\'', 0, 0, 0, undef, 0, '#stay', 'Attribute Values')) { return 1 } return 0; }; sub parsectxStyleProperties { my ($self, $text) = @_; # attribute => 'Brackets' # char => '}' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Brackets')) { return 1 } # attribute => 'Script Comment' # char => '/' # char1 => '*' # context => 'ctxC Style Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'ctxC Style Comment', 'Script Comment')) { return 1 } # attribute => 'Normal Text' # char => ':' # context => 'ctxStyle Values' # type => 'DetectChar' if ($self->testDetectChar($text, ':', 0, 0, 0, undef, 0, 'ctxStyle Values', 'Normal Text')) { return 1 } return 0; }; sub parsectxStyleValues { my ($self, $text) = @_; # attribute => 'Normal Text' # char => ';' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } # attribute => 'Normal Text' # char => ',' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, ',', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Numbers' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Numbers')) { return 1 } # attribute => 'Numbers' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Numbers')) { return 1 } # String => '#([0-9a-fA-F]{3})|([0-9a-fA-F]{6})' # attribute => 'Numbers' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#([0-9a-fA-F]{3})|([0-9a-fA-F]{6})', 0, 0, 0, undef, 0, '#stay', 'Numbers')) { return 1 } # String => '"[^"]*"' # attribute => 'Attribute Values' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '"[^"]*"', 0, 0, 0, undef, 0, '#stay', 'Attribute Values')) { return 1 } # String => ''[^']*'' # attribute => 'Attribute Values' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\'[^\']*\'', 0, 0, 0, undef, 0, '#stay', 'Attribute Values')) { return 1 } return 0; }; sub parsectxTableTag { my ($self, $text) = @_; # attribute => 'Table Tags' # char => '>' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'Table Tags')) { return 1 } # attribute => 'Normal Text' # char => '=' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '"[^"]*"' # attribute => 'Attribute Values' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '"[^"]*"', 0, 0, 0, undef, 0, '#stay', 'Attribute Values')) { return 1 } # String => ''[^']*'' # attribute => 'Attribute Values' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\'[^\']*\'', 0, 0, 0, undef, 0, '#stay', 'Attribute Values')) { return 1 } return 0; }; sub parsectxTag { my ($self, $text) = @_; # attribute => 'Tags' # char => '>' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'Tags')) { return 1 } # attribute => 'Normal Text' # char => '=' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '"[^"]*"' # attribute => 'Attribute Values' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '"[^"]*"', 0, 0, 0, undef, 0, '#stay', 'Attribute Values')) { return 1 } # String => ''[^']*'' # attribute => 'Attribute Values' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\'[^\']*\'', 0, 0, 0, undef, 0, '#stay', 'Attribute Values')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::ColdFusion - a Plugin for ColdFusion syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::ColdFusion; my $sh = new Syntax::Highlight::Engine::Kate::ColdFusion([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::ColdFusion is a plugin module that provides syntax highlighting for ColdFusion to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/LaTeX.pm0000644000175000017500000005145113226470762025640 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'latex.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.14 #kate version 2.4 #kate author Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net) #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::LaTeX; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Comment' => 'Comment', 'Environment' => 'DataType', 'Keyword' => 'Keyword', 'Keyword Mathmode' => 'Reserved', 'Math' => 'Float', 'Normal Text' => 'Normal', 'Region Marker' => 'RegionMarker', 'Structure' => 'String', 'Verbatim' => 'BString', }); $self->contextdata({ 'Comment' => { callback => \&parseComment, attribute => 'Comment', lineending => '#pop', }, 'ContrSeq' => { callback => \&parseContrSeq, attribute => 'Keyword', lineending => '#pop', }, 'Environment' => { callback => \&parseEnvironment, attribute => 'Environment', }, 'FindEnvironment' => { callback => \&parseFindEnvironment, attribute => 'Normal Text', }, 'Label' => { callback => \&parseLabel, attribute => 'Normal Text', lineending => '#pop#pop', fallthrough => '#pop#pop', }, 'MathContrSeq' => { callback => \&parseMathContrSeq, attribute => 'Keyword Mathmode', lineending => '#pop', }, 'MathEnv' => { callback => \&parseMathEnv, attribute => 'Environment', }, 'MathFindEnd' => { callback => \&parseMathFindEnd, attribute => 'Normal Text', lineending => '#pop', fallthrough => '#pop', }, 'MathMode' => { callback => \&parseMathMode, attribute => 'Math', }, 'MathModeEnv' => { callback => \&parseMathModeEnv, attribute => 'Math', }, 'Normal Text' => { callback => \&parseNormalText, attribute => 'Normal Text', }, 'ToEndOfLine' => { callback => \&parseToEndOfLine, attribute => 'Normal Text', lineending => '#pop', }, 'Verb' => { callback => \&parseVerb, attribute => 'Verbatim', lineending => '#pop', fallthrough => '#pop', }, 'VerbFindEnd' => { callback => \&parseVerbFindEnd, attribute => 'Normal Text', lineending => '#pop', fallthrough => '#pop', }, 'Verbatim' => { callback => \&parseVerbatim, attribute => 'Verbatim', }, 'VerbatimEnv' => { callback => \&parseVerbatimEnv, attribute => 'Environment', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal Text'); $self->keywordscase(1); $self->initialize; bless ($self, $class); return $self; } sub language { return 'LaTeX'; } sub parseComment { my ($self, $text) = @_; return 0; }; sub parseContrSeq { my ($self, $text) = @_; # String => 'verb*' # attribute => 'Keyword' # context => 'Verb' # type => 'StringDetect' if ($self->testStringDetect($text, 'verb*', 0, 0, 0, undef, 0, 'Verb', 'Keyword')) { return 1 } # String => 'verb' # attribute => 'Keyword' # context => 'Verb' # type => 'StringDetect' if ($self->testStringDetect($text, 'verb', 0, 0, 0, undef, 0, 'Verb', 'Keyword')) { return 1 } # String => '[a-zA-Z]+' # attribute => 'Keyword' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[a-zA-Z]+', 0, 0, 0, undef, 0, '#pop', 'Keyword')) { return 1 } # String => '[^a-zA-Z]' # attribute => 'Keyword' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[^a-zA-Z]', 0, 0, 0, undef, 0, '#pop', 'Keyword')) { return 1 } return 0; }; sub parseEnvironment { my ($self, $text) = @_; # attribute => 'Normal Text' # char => '}' # context => '#pop#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop', 'Normal Text')) { return 1 } # attribute => 'Normal Text' # char => ']' # context => '#pop#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop#pop', 'Normal Text')) { return 1 } # String => '(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\*?' # attribute => 'Environment' # context => 'VerbatimEnv' # type => 'RegExpr' if ($self->testRegExpr($text, '(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\\*?', 0, 0, 0, undef, 0, 'VerbatimEnv', 'Environment')) { return 1 } # String => '(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\*?' # attribute => 'Environment' # context => 'MathEnv' # type => 'RegExpr' if ($self->testRegExpr($text, '(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\\*?', 0, 0, 0, undef, 0, 'MathEnv', 'Environment')) { return 1 } return 0; }; sub parseFindEnvironment { my ($self, $text) = @_; # attribute => 'Normal Text' # char => '{' # context => 'Environment' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'Environment', 'Normal Text')) { return 1 } # String => '\S' # attribute => 'Normal Text' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } return 0; }; sub parseLabel { my ($self, $text) = @_; # String => '\s*\{\s*' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*\\{\\s*', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '[^\}\{]+' # attribute => 'Environment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[^\\}\\{]+', 0, 0, 0, undef, 0, '#stay', 'Environment')) { return 1 } # String => '\s*\}\s*' # attribute => 'Normal Text' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*\\}\\s*', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } return 0; }; sub parseMathContrSeq { my ($self, $text) = @_; # String => '[a-zA-Z]+' # attribute => 'Keyword Mathmode' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[a-zA-Z]+', 0, 0, 0, undef, 0, '#pop', 'Keyword Mathmode')) { return 1 } # String => '[^a-zA-Z]' # attribute => 'Keyword Mathmode' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[^a-zA-Z]', 0, 0, 0, undef, 0, '#pop', 'Keyword Mathmode')) { return 1 } return 0; }; sub parseMathEnv { my ($self, $text) = @_; # attribute => 'Normal Text' # char => '}' # context => 'MathModeEnv' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, 'MathModeEnv', 'Normal Text')) { return 1 } # String => '\S' # attribute => 'Normal Text' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } return 0; }; sub parseMathFindEnd { my ($self, $text) = @_; # attribute => 'Normal Text' # char => '{' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '[a-zA-Z]*(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\*?' # attribute => 'Environment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[a-zA-Z]*(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\\*?', 0, 0, 0, undef, 0, '#stay', 'Environment')) { return 1 } # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'Normal Text' # char => '}' # context => '#pop#pop#pop#pop#pop' # endRegion => 'block' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop#pop#pop#pop', 'Normal Text')) { return 1 } return 0; }; sub parseMathMode { my ($self, $text) = @_; # attribute => 'Math' # char => '\' # char1 => ']' # context => '#pop' # endRegion => 'mathMode' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', ']', 0, 0, 0, undef, 0, '#pop', 'Math')) { return 1 } # attribute => 'Math' # char => '\' # char1 => ')' # context => '#pop' # endRegion => 'mathMode' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', ')', 0, 0, 0, undef, 0, '#pop', 'Math')) { return 1 } # String => '\\begin(?=[^a-zA-Z])' # attribute => 'Keyword Mathmode' # beginRegion => 'block' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\begin(?=[^a-zA-Z])', 0, 0, 0, undef, 0, '#stay', 'Keyword Mathmode')) { return 1 } # String => '\\end(?=[^a-zA-Z])' # attribute => 'Keyword Mathmode' # context => '#stay' # endRegion => 'block' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\end(?=[^a-zA-Z])', 0, 0, 0, undef, 0, '#stay', 'Keyword Mathmode')) { return 1 } # attribute => 'Keyword Mathmode' # char => '\' # context => 'MathContrSeq' # type => 'DetectChar' if ($self->testDetectChar($text, '\\', 0, 0, 0, undef, 0, 'MathContrSeq', 'Keyword Mathmode')) { return 1 } # String => '$$' # attribute => 'Math' # context => '#pop' # endRegion => 'mathMode' # type => 'StringDetect' if ($self->testStringDetect($text, '$$', 0, 0, 0, undef, 0, '#pop', 'Math')) { return 1 } # attribute => 'Math' # char => '$' # context => '#pop' # endRegion => 'mathMode' # type => 'DetectChar' if ($self->testDetectChar($text, '$', 0, 0, 0, undef, 0, '#pop', 'Math')) { return 1 } # String => '%\s*BEGIN.*$' # attribute => 'Region Marker' # beginRegion => 'regionMarker' # context => '#stay' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%\\s*BEGIN.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { return 1 } # String => '%\s*END.*$' # attribute => 'Region Marker' # context => '#stay' # endRegion => 'regionMarker' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%\\s*END.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { return 1 } # attribute => 'Comment' # char => '%' # context => 'Comment' # type => 'DetectChar' if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { return 1 } return 0; }; sub parseMathModeEnv { my ($self, $text) = @_; # String => '\\end(?=\s*\{\s*[a-zA-Z]*(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\*?\s*\})' # attribute => 'Structure' # context => 'MathFindEnd' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\end(?=\\s*\\{\\s*[a-zA-Z]*(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\\*?\\s*\\})', 0, 0, 0, undef, 0, 'MathFindEnd', 'Structure')) { return 1 } # String => '\\begin(?=[^a-zA-Z])' # attribute => 'Keyword Mathmode' # beginRegion => 'block' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\begin(?=[^a-zA-Z])', 0, 0, 0, undef, 0, '#stay', 'Keyword Mathmode')) { return 1 } # String => '\\end(?=[^a-zA-Z])' # attribute => 'Keyword Mathmode' # context => '#stay' # endRegion => 'block' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\end(?=[^a-zA-Z])', 0, 0, 0, undef, 0, '#stay', 'Keyword Mathmode')) { return 1 } # String => '\(' # attribute => 'Math' # beginRegion => 'mathMode' # context => 'MathMode' # type => 'StringDetect' if ($self->testStringDetect($text, '\\(', 0, 0, 0, undef, 0, 'MathMode', 'Math')) { return 1 } # String => '\[' # attribute => 'Math' # beginRegion => 'mathMode' # context => 'MathMode' # type => 'StringDetect' if ($self->testStringDetect($text, '\\[', 0, 0, 0, undef, 0, 'MathMode', 'Math')) { return 1 } # attribute => 'Keyword Mathmode' # char => '\' # context => 'MathContrSeq' # type => 'DetectChar' if ($self->testDetectChar($text, '\\', 0, 0, 0, undef, 0, 'MathContrSeq', 'Keyword Mathmode')) { return 1 } # String => '$$' # attribute => 'Math' # beginRegion => 'mathMode' # context => 'MathMode' # type => 'StringDetect' if ($self->testStringDetect($text, '$$', 0, 0, 0, undef, 0, 'MathMode', 'Math')) { return 1 } # attribute => 'Math' # beginRegion => 'mathMode' # char => '$' # context => 'MathMode' # type => 'DetectChar' if ($self->testDetectChar($text, '$', 0, 0, 0, undef, 0, 'MathMode', 'Math')) { return 1 } # String => '%\s*BEGIN.*$' # attribute => 'Region Marker' # beginRegion => 'regionMarker' # context => '#stay' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%\\s*BEGIN.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { return 1 } # String => '%\s*END.*$' # attribute => 'Region Marker' # context => '#stay' # endRegion => 'regionMarker' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%\\s*END.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { return 1 } # attribute => 'Comment' # char => '%' # context => 'Comment' # type => 'DetectChar' if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { return 1 } return 0; }; sub parseNormalText { my ($self, $text) = @_; # String => '\\begin(?=[^a-zA-Z])' # attribute => 'Structure' # beginRegion => 'block' # context => 'FindEnvironment' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\begin(?=[^a-zA-Z])', 0, 0, 0, undef, 0, 'FindEnvironment', 'Structure')) { return 1 } # String => '\\end(?=[^a-zA-Z])' # attribute => 'Structure' # context => 'FindEnvironment' # endRegion => 'block' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\end(?=[^a-zA-Z])', 0, 0, 0, undef, 0, 'FindEnvironment', 'Structure')) { return 1 } # String => '\\(label|pageref|ref|cite)(?=[^a-zA-Z])' # attribute => 'Structure' # context => 'Label' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\(label|pageref|ref|cite)(?=[^a-zA-Z])', 0, 0, 0, undef, 0, 'Label', 'Structure')) { return 1 } # String => '\\(part|chapter|section|subsection|subsubsection|paragraph|subparagraph)(?=[^a-zA-Z])' # attribute => 'Structure' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\(part|chapter|section|subsection|subsubsection|paragraph|subparagraph)(?=[^a-zA-Z])', 0, 0, 0, undef, 0, '#stay', 'Structure')) { return 1 } # String => '\renewcommand' # attribute => 'Keyword' # context => 'ToEndOfLine' # type => 'StringDetect' if ($self->testStringDetect($text, '\\renewcommand', 0, 0, 0, undef, 0, 'ToEndOfLine', 'Keyword')) { return 1 } # String => '\newcommand' # attribute => 'Keyword' # context => 'ToEndOfLine' # type => 'StringDetect' if ($self->testStringDetect($text, '\\newcommand', 0, 0, 0, undef, 0, 'ToEndOfLine', 'Keyword')) { return 1 } # String => '\(' # attribute => 'Math' # beginRegion => 'mathMode' # context => 'MathMode' # type => 'StringDetect' if ($self->testStringDetect($text, '\\(', 0, 0, 0, undef, 0, 'MathMode', 'Math')) { return 1 } # String => '\[' # attribute => 'Math' # beginRegion => 'mathMode' # context => 'MathMode' # type => 'StringDetect' if ($self->testStringDetect($text, '\\[', 0, 0, 0, undef, 0, 'MathMode', 'Math')) { return 1 } # attribute => 'Keyword' # char => '\' # context => 'ContrSeq' # type => 'DetectChar' if ($self->testDetectChar($text, '\\', 0, 0, 0, undef, 0, 'ContrSeq', 'Keyword')) { return 1 } # String => '$$' # attribute => 'Math' # beginRegion => 'mathMode' # context => 'MathMode' # type => 'StringDetect' if ($self->testStringDetect($text, '$$', 0, 0, 0, undef, 0, 'MathMode', 'Math')) { return 1 } # attribute => 'Math' # beginRegion => 'mathMode' # char => '$' # context => 'MathMode' # type => 'DetectChar' if ($self->testDetectChar($text, '$', 0, 0, 0, undef, 0, 'MathMode', 'Math')) { return 1 } # String => '%\s*BEGIN.*$' # attribute => 'Region Marker' # beginRegion => 'regionMarker' # context => '#stay' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%\\s*BEGIN.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { return 1 } # String => '%\s*END.*$' # attribute => 'Region Marker' # context => '#stay' # endRegion => 'regionMarker' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%\\s*END.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { return 1 } # attribute => 'Comment' # char => '%' # context => 'Comment' # type => 'DetectChar' if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { return 1 } return 0; }; sub parseToEndOfLine { my ($self, $text) = @_; return 0; }; sub parseVerb { my ($self, $text) = @_; # String => '(.).*\1' # attribute => 'Verbatim' # context => '#pop#pop' # minimal => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '(.).*?\\1', 0, 0, 0, undef, 0, '#pop#pop', 'Verbatim')) { return 1 } return 0; }; sub parseVerbFindEnd { my ($self, $text) = @_; # attribute => 'Normal Text' # char => '{' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\*?' # attribute => 'Environment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\\*?', 0, 0, 0, undef, 0, '#stay', 'Environment')) { return 1 } # attribute => 'Normal Text' # char => '}' # context => '#pop#pop#pop#pop#pop' # endRegion => 'block' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop#pop#pop#pop', 'Normal Text')) { return 1 } return 0; }; sub parseVerbatim { my ($self, $text) = @_; # String => '\\end(?=\{(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\*?\})' # attribute => 'Structure' # context => 'VerbFindEnd' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\end(?=\\{(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\\*?\\})', 0, 0, 0, undef, 0, 'VerbFindEnd', 'Structure')) { return 1 } return 0; }; sub parseVerbatimEnv { my ($self, $text) = @_; # attribute => 'Normal Text' # char => '*' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '*', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Normal Text' # char => '}' # context => 'Verbatim' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, 'Verbatim', 'Normal Text')) { return 1 } # String => '\S' # attribute => 'Normal Text' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::LaTeX - a Plugin for LaTeX syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::LaTeX; my $sh = new Syntax::Highlight::Engine::Kate::LaTeX([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::LaTeX is a plugin module that provides syntax highlighting for LaTeX to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/SQL.pm0000644000175000017500000006162613226470762025327 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'sql.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.11 #kate version 2.4 #kate author Yury Lebedev (yurylebedev@mail.ru) #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::SQL; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Comment' => 'Comment', 'Data Type' => 'DataType', 'Decimal' => 'DecVal', 'External Variable' => 'Char', 'Float' => 'Float', 'Function' => 'Function', 'Identifier' => 'Others', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Operator' => 'Normal', 'Preprocessor' => 'Others', 'String' => 'String', 'String Char' => 'Char', 'Symbol' => 'Char', }); $self->listAdd('functions', 'ABS', 'ACOS', 'ADD_MONTHS', 'ASCII', 'ASCIISTR', 'ASIN', 'ATAN', 'ATAN2', 'AVG', 'BFILENAME', 'BIN_TO_NUM', 'BITAND', 'CARDINALITY', 'CAST', 'CEIL', 'CHARTOROWID', 'CHR', 'COALESCE', 'COLLECT', 'COMPOSE', 'CONCAT', 'CONVERT', 'CORR', 'CORR_K', 'CORR_S', 'COS', 'COSH', 'COUNT', 'COVAR_POP', 'COVAR_SAMP', 'CUME_DIST', 'CURRENT_DATE', 'CURRENT_TIMESTAMP', 'CV', 'DBTIMEZONE', 'DECODE', 'DECOMPOSE', 'DENSE_RANK', 'DEPTH', 'DEREF', 'DUMP', 'EMPTY_BLOB', 'EMPTY_CLOB', 'EXISTSNODE', 'EXP', 'EXTRACT', 'EXTRACTVALUE', 'FIRST', 'FIRST_VALUE', 'FLOOR', 'FROM_TZ', 'GREATEST', 'GROUPING', 'GROUPING_ID', 'GROUP_ID', 'HEXTORAW', 'INITCAP', 'INSTR', 'INSTRB', 'LAG', 'LAST', 'LAST_DAY', 'LAST_VALUE', 'LEAD', 'LEAST', 'LENGTH', 'LENGTHB', 'LN', 'LNNVL', 'LOCALTIMESTAMP', 'LOG', 'LOWER', 'LPAD', 'LTRIM', 'MAKE_REF', 'MAX', 'MEDIAN', 'MIN', 'MOD', 'MONTHS_BETWEEN', 'NANVL', 'NCHR', 'NEW_TIME', 'NEXT_DAY', 'NLSSORT', 'NLS_CHARSET_DECL_LEN', 'NLS_CHARSET_ID', 'NLS_CHARSET_NAME', 'NLS_INITCAP', 'NLS_LOWER', 'NLS_UPPER', 'NTILE', 'NULLIF', 'NUMTODSINTERVAL', 'NUMTOYMINTERVAL', 'NVL', 'NVL2', 'ORA_HASH', 'ORA_ROWSCN', 'PERCENTILE_CONT', 'PERCENTILE_DISC', 'PERCENT_RANK', 'POWER', 'POWERMULTISET', 'POWERMULTISET_BY_CARDINALITY', 'PRESENTNNV', 'PRESENTV', 'RANK', 'RATIO_TO_REPORT', 'RAWTOHEX', 'RAWTONHEX', 'REF', 'REFTOHEX', 'REGEXP_INSTR', 'REGEXP_LIKE', 'REGEXP_REPLACE', 'REGEXP_SUBSTR', 'REGR_AVGX', 'REGR_AVGY', 'REGR_COUNT', 'REGR_INTERCEPT', 'REGR_R2', 'REGR_SLOPE', 'REGR_SXX', 'REGR_SXY', 'REGR_SYY', 'REMAINDER', 'ROUND', 'ROWIDTOCHAR', 'ROWIDTONCHAR', 'ROW_NUMBER', 'RPAD', 'RTRIM', 'SCN_TO_TIMESTAMP', 'SESSIONTIMEZONE', 'SIGN', 'SIN', 'SINH', 'SOUNDEX', 'SQRT', 'STATS_BINOMIAL_TEST', 'STATS_CROSSTAB', 'STATS_F_TEST', 'STATS_KS_TEST', 'STATS_MODE', 'STATS_MW_TEST', 'STATS_ONE_WAY_ANOVA', 'STATS_T_TEST_INDEP', 'STATS_T_TEST_INDEPU', 'STATS_T_TEST_ONE', 'STATS_T_TEST_PAIRED', 'STATS_WSR_TEST', 'STDDEV', 'STDDEV_POP', 'STDDEV_SAMP', 'SUBSTR', 'SUBSTRB', 'SUM', 'SYSDATE', 'SYSTIMESTAMP', 'SYS_CONNECT_BY_PATH', 'SYS_CONTEXT', 'SYS_DBURIGEN', 'SYS_EXTRACT_UTC', 'SYS_GUID', 'SYS_TYPEID', 'SYS_XMLAGG', 'SYS_XMLGEN', 'TAN', 'TANH', 'TIMESTAMP_TO_SCN', 'TO_BINARY_DOUBLE', 'TO_BINARY_FLOAT', 'TO_CHAR', 'TO_CLOB', 'TO_DATE', 'TO_DSINTERVAL', 'TO_LOB', 'TO_MULTI_BYTE', 'TO_NCHAR', 'TO_NCLOB', 'TO_NUMBER', 'TO_SINGLE_BYTE', 'TO_TIMESTAMP', 'TO_TIMESTAMP_TZ', 'TO_YMINTERVAL', 'TRANSLATE', 'TREAT', 'TRIM', 'TRUNC', 'TZ_OFFSET', 'UID', 'UNISTR', 'UPDATEXML', 'UPPER', 'USER', 'USERENV', 'VALUE', 'VARIANCE', 'VAR_POP', 'VAR_SAMP', 'VSIZE', 'WIDTH_BUCKET', 'XMLAGG', 'XMLCOLATTVAL', 'XMLCONCAT', 'XMLELEMENT', 'XMLFOREST', 'XMLSEQUENCE', 'XMLTRANSFORM', ); $self->listAdd('keywords', 'ACCESS', 'ACCOUNT', 'ADD', 'ADMIN', 'ADMINISTER', 'ADVISE', 'AFTER', 'AGENT', 'ALL', 'ALLOCATE', 'ALL_ROWS', 'ALTER', 'ANALYZE', 'ANCILLARY', 'AND', 'ANY', 'ARCHIVE', 'ARCHIVELOG', 'AS', 'ASC', 'ASSERTION', 'ASSOCIATE', 'AT', 'ATTRIBUTE', 'ATTRIBUTES', 'AUDIT', 'AUTHENTICATED', 'AUTHID', 'AUTHORIZATION', 'AUTOALLOCATE', 'AUTOEXTEND', 'AUTOMATIC', 'BACKUP', 'BECOME', 'BEFORE', 'BEGIN', 'BEHALF', 'BETWEEN', 'BINDING', 'BITMAP', 'BLOCK', 'BLOCK_RANGE', 'BODY', 'BOTH', 'BOUND', 'BREAK', 'BROADCAST', 'BTITLE', 'BUFFER_POOL', 'BUILD', 'BULK', 'BY', 'CACHE', 'CACHE_INSTANCES', 'CALL', 'CANCEL', 'CASCADE', 'CASE', 'CATEGORY', 'CHAINED', 'CHANGE', 'CHECK', 'CHECKPOINT', 'CHILD', 'CHOOSE', 'CHUNK', 'CLASS', 'CLEAR', 'CLONE', 'CLOSE', 'CLOSE_CACHED_OPEN_CURSORS', 'CLUSTER', 'COALESCE', 'COLUMN', 'COLUMNS', 'COLUMN_VALUE', 'COMMENT', 'COMMIT', 'COMMITTED', 'COMPATIBILITY', 'COMPILE', 'COMPLETE', 'COMPOSITE_LIMIT', 'COMPRESS', 'COMPUTE', 'CONNECT', 'CONNECT_TIME', 'CONSIDER', 'CONSISTENT', 'CONSTANT', 'CONSTRAINT', 'CONSTRAINTS', 'CONTAINER', 'CONTENTS', 'CONTEXT', 'CONTINUE', 'CONTROLFILE', 'COPY', 'COST', 'CPU_PER_CALL', 'CPU_PER_SESSION', 'CREATE', 'CREATE_STORED_OUTLINES', 'CROSS', 'CUBE', 'CURRENT', 'CURSOR', 'CYCLE', 'DANGLING', 'DATA', 'DATABASE', 'DATAFILE', 'DATAFILES', 'DBA', 'DDL', 'DEALLOCATE', 'DEBUG', 'DECLARE', 'DEFAULT', 'DEFERRABLE', 'DEFERRED', 'DEFINER', 'DEGREE', 'DELETE', 'DEMAND', 'DESC', 'DETERMINES', 'DICTIONARY', 'DIMENSION', 'DIRECTORY', 'DISABLE', 'DISASSOCIATE', 'DISCONNECT', 'DISKGROUP', 'DISMOUNT', 'DISTINCT', 'DISTRIBUTED', 'DOMAIN', 'DROP', 'DYNAMIC', 'EACH', 'ELSE', 'EMPTY', 'ENABLE', 'END', 'ENFORCE', 'ENTRY', 'ESCAPE', 'ESTIMATE', 'EVENTS', 'EXCEPT', 'EXCEPTION', 'EXCEPTIONS', 'EXCHANGE', 'EXCLUDING', 'EXCLUSIVE', 'EXEC', 'EXECUTE', 'EXISTS', 'EXPIRE', 'EXPLAIN', 'EXPLOSION', 'EXTENDS', 'EXTENT', 'EXTENTS', 'EXTERNALLY', 'FAILED_LOGIN_ATTEMPTS', 'FALSE', 'FAST', 'FILE', 'FILTER', 'FIRST_ROWS', 'FLAGGER', 'FLASHBACK', 'FLUSH', 'FOLLOWING', 'FOR', 'FORCE', 'FOREIGN', 'FREELIST', 'FREELISTS', 'FRESH', 'FROM', 'FULL', 'FUNCTION', 'FUNCTIONS', 'GENERATED', 'GLOBAL', 'GLOBALLY', 'GLOBAL_NAME', 'GRANT', 'GROUP', 'GROUPS', 'HASH', 'HASHKEYS', 'HAVING', 'HEADER', 'HEAP', 'HIERARCHY', 'HOUR', 'ID', 'IDENTIFIED', 'IDENTIFIER', 'IDGENERATORS', 'IDLE_TIME', 'IF', 'IMMEDIATE', 'IN', 'INCLUDING', 'INCREMENT', 'INCREMENTAL', 'INDEX', 'INDEXED', 'INDEXES', 'INDEXTYPE', 'INDEXTYPES', 'INDICATOR', 'INITIAL', 'INITIALIZED', 'INITIALLY', 'INITRANS', 'INNER', 'INSERT', 'INSTANCE', 'INSTANCES', 'INSTEAD', 'INTERMEDIATE', 'INTERSECT', 'INTO', 'INVALIDATE', 'IS', 'ISOLATION', 'ISOLATION_LEVEL', 'JAVA', 'JOIN', 'KEEP', 'KEY', 'KILL', 'LABEL', 'LAYER', 'LEADING', 'LEFT', 'LESS', 'LEVEL', 'LIBRARY', 'LIKE', 'LIMIT', 'LINK', 'LIST', 'LOCAL', 'LOCATOR', 'LOCK', 'LOCKED', 'LOGFILE', 'LOGGING', 'LOGICAL_READS_PER_CALL', 'LOGICAL_READS_PER_SESSION', 'LOGOFF', 'LOGON', 'MANAGE', 'MANAGED', 'MANAGEMENT', 'MASTER', 'MATERIALIZED', 'MAXARCHLOGS', 'MAXDATAFILES', 'MAXEXTENTS', 'MAXINSTANCES', 'MAXLOGFILES', 'MAXLOGHISTORY', 'MAXLOGMEMBERS', 'MAXSIZE', 'MAXTRANS', 'MAXVALUE', 'MEMBER', 'MERGE', 'METHOD', 'MINEXTENTS', 'MINIMIZE', 'MINIMUM', 'MINUS', 'MINUTE', 'MINVALUE', 'MODE', 'MODIFY', 'MONITORING', 'MOUNT', 'MOVE', 'MOVEMENT', 'MTS_DISPATCHERS', 'MULTISET', 'NAMED', 'NATURAL', 'NEEDED', 'NESTED', 'NESTED_TABLE_ID', 'NETWORK', 'NEVER', 'NEW', 'NEXT', 'NLS_CALENDAR', 'NLS_CHARACTERSET', 'NLS_COMP', 'NLS_CURRENCY', 'NLS_DATE_FORMAT', 'NLS_DATE_LANGUAGE', 'NLS_ISO_CURRENCY', 'NLS_LANG', 'NLS_LANGUAGE', 'NLS_NUMERIC_CHARACTERS', 'NLS_SORT', 'NLS_SPECIAL_CHARS', 'NLS_TERRITORY', 'NO', 'NOARCHIVELOG', 'NOAUDIT', 'NOCACHE', 'NOCOMPRESS', 'NOCYCLE', 'NOFORCE', 'NOLOGGING', 'NOMAXVALUE', 'NOMINIMIZE', 'NOMINVALUE', 'NOMONITORING', 'NONE', 'NOORDER', 'NOOVERRIDE', 'NOPARALLEL', 'NORELY', 'NORESETLOGS', 'NOREVERSE', 'NORMAL', 'NOSEGMENT', 'NOSORT', 'NOT', 'NOTHING', 'NOVALIDATE', 'NOWAIT', 'NULL', 'NULLS', 'OBJNO', 'OBJNO_REUSE', 'OF', 'OFF', 'OFFLINE', 'OID', 'OIDINDEX', 'OLD', 'ON', 'ONLINE', 'ONLY', 'OPCODE', 'OPEN', 'OPERATOR', 'OPTIMAL', 'OPTIMIZER_GOAL', 'OPTION', 'OR', 'ORDER', 'ORGANIZATION', 'OUT', 'OUTER', 'OUTLINE', 'OVER', 'OVERFLOW', 'OVERLAPS', 'OWN', 'PACKAGE', 'PACKAGES', 'PARALLEL', 'PARAMETERS', 'PARENT', 'PARTITION', 'PARTITIONS', 'PARTITION_HASH', 'PARTITION_RANGE', 'PASSWORD', 'PASSWORD_GRACE_TIME', 'PASSWORD_LIFE_TIME', 'PASSWORD_LOCK_TIME', 'PASSWORD_REUSE_MAX', 'PASSWORD_REUSE_TIME', 'PASSWORD_VERIFY_FUNCTION', 'PCTFREE', 'PCTINCREASE', 'PCTTHRESHOLD', 'PCTUSED', 'PCTVERSION', 'PERCENT', 'PERMANENT', 'PLAN', 'PLSQL_DEBUG', 'POST_TRANSACTION', 'PREBUILT', 'PRECEDING', 'PREPARE', 'PRESENT', 'PRESERVE', 'PREVIOUS', 'PRIMARY', 'PRIOR', 'PRIVATE', 'PRIVATE_SGA', 'PRIVILEGE', 'PRIVILEGES', 'PROCEDURE', 'PROFILE', 'PUBLIC', 'PURGE', 'QUERY', 'QUEUE', 'QUOTA', 'RANDOM', 'RANGE', 'RBA', 'READ', 'READS', 'REBUILD', 'RECORDS_PER_BLOCK', 'RECOVER', 'RECOVERABLE', 'RECOVERY', 'RECYCLE', 'REDUCED', 'REFERENCES', 'REFERENCING', 'REFRESH', 'RELY', 'RENAME', 'REPLACE', 'RESET', 'RESETLOGS', 'RESIZE', 'RESOLVE', 'RESOLVER', 'RESOURCE', 'RESTRICT', 'RESTRICTED', 'RESUME', 'RETURN', 'RETURNING', 'REUSE', 'REVERSE', 'REVOKE', 'REWRITE', 'RIGHT', 'ROLE', 'ROLES', 'ROLLBACK', 'ROLLUP', 'ROW', 'ROWNUM', 'ROWS', 'RULE', 'SAMPLE', 'SAVEPOINT', 'SCAN', 'SCAN_INSTANCES', 'SCHEMA', 'SCN', 'SCOPE', 'SD_ALL', 'SD_INHIBIT', 'SD_SHOW', 'SEGMENT', 'SEG_BLOCK', 'SEG_FILE', 'SELECT', 'SELECTIVITY', 'SEQUENCE', 'SERIALIZABLE', 'SERVERERROR', 'SESSION', 'SESSIONS_PER_USER', 'SESSION_CACHED_CURSORS', 'SET', 'SHARE', 'SHARED', 'SHARED_POOL', 'SHRINK', 'SHUTDOWN', 'SINGLETASK', 'SIZE', 'SKIP', 'SKIP_UNUSABLE_INDEXES', 'SNAPSHOT', 'SOME', 'SORT', 'SOURCE', 'SPECIFICATION', 'SPLIT', 'SQL_TRACE', 'STANDBY', 'START', 'STARTUP', 'STATEMENT_ID', 'STATIC', 'STATISTICS', 'STOP', 'STORAGE', 'STORE', 'STRUCTURE', 'SUBMULTISET', 'SUBPARTITION', 'SUBPARTITIONS', 'SUCCESSFUL', 'SUMMARY', 'SUPPLEMENTAL', 'SUSPEND', 'SWITCH', 'SYNONYM', 'SYSDBA', 'SYSOPER', 'SYSTEM', 'SYS_OP_BITVEC', 'SYS_OP_ENFORCE_NOT_NULL$', 'SYS_OP_NOEXPAND', 'SYS_OP_NTCIMG$', 'TABLE', 'TABLES', 'TABLESPACE', 'TABLESPACE_NO', 'TABNO', 'TEMPFILE', 'TEMPORARY', 'THAN', 'THE', 'THEN', 'THREAD', 'THROUGH', 'TIMEOUT', 'TIMEZONE_HOUR', 'TIMEZONE_MINUTE', 'TIME_ZONE', 'TO', 'TOPLEVEL', 'TRACE', 'TRACING', 'TRAILING', 'TRANSACTION', 'TRANSITIONAL', 'TRIGGER', 'TRIGGERS', 'TRUE', 'TRUNCATE', 'TYPE', 'TYPES', 'UNARCHIVED', 'UNBOUND', 'UNBOUNDED', 'UNDO', 'UNIFORM', 'UNION', 'UNIQUE', 'UNLIMITED', 'UNLOCK', 'UNRECOVERABLE', 'UNTIL', 'UNUSABLE', 'UNUSED', 'UPDATABLE', 'UPDATE', 'UPD_INDEXES', 'UPPPER', 'USAGE', 'USE', 'USER_DEFINED', 'USE_STORED_OUTLINES', 'USING', 'VALIDATE', 'VALIDATION', 'VALUES', 'VIEW', 'WHEN', 'WHENEVER', 'WHERE', 'WITH', 'WITHOUT', 'WORK', 'WRITE', ); $self->listAdd('operators', '!=', '*', '**', '+', '-', '..', '/', ':=', '<', '<=', '<>', '=', '=>', '>', '>=', '^=', '||', '~=', ); $self->listAdd('types', 'ANYDATA', 'ANYDATASET', 'ANYTYPE', 'ARRAY', 'BFILE', 'BINARY_DOUBLE', 'BINARY_FLOAT', 'BINARY_INTEGER', 'BLOB', 'BOOLEAN', 'CFILE', 'CHAR', 'CHARACTER', 'CLOB', 'DATE', 'DAY', 'DBURITYPE', 'DEC', 'DECIMAL', 'DOUBLE', 'FLOAT', 'FLOB', 'HTTPURITYPE', 'INT', 'INTEGER', 'INTERVAL', 'LOB', 'LONG', 'MLSLABEL', 'MONTH', 'NATIONAL', 'NCHAR', 'NCLOB', 'NUMBER', 'NUMERIC', 'NVARCHAR', 'OBJECT', 'PLS_INTEGER', 'PRECISION', 'RAW', 'REAL', 'RECORD', 'ROWID', 'SECOND', 'SINGLE', 'SMALLINT', 'TIME', 'TIMESTAMP', 'URIFACTORYTYPE', 'URITYPE', 'UROWID', 'VARCHAR', 'VARCHAR2', 'VARRAY', 'VARYING', 'XMLTYPE', 'YEAR', 'ZONE', ); $self->contextdata({ 'Multiline C-style comment' => { callback => \&parseMultilineCstylecomment, attribute => 'Comment', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'SQL*Plus directive to include file' => { callback => \&parseSQLPlusdirectivetoincludefile, attribute => 'Preprocessor', lineending => '#pop', }, 'SQL*Plus remark directive' => { callback => \&parseSQLPlusremarkdirective, attribute => 'Comment', lineending => '#pop', }, 'Singleline PL/SQL-style comment' => { callback => \&parseSinglelinePLSQLstylecomment, attribute => 'Comment', lineending => '#pop', }, 'String literal' => { callback => \&parseStringliteral, attribute => 'String', }, 'User-defined identifier' => { callback => \&parseUserdefinedidentifier, attribute => 'Identifier', lineending => '#pop', }, }); $self->deliminators('\\s||\\(|\\)|,|\\%|\\&|;|\\?|\\[|\\]|\\{|\\}|\\\\|\\+|-|\\*|\\/|\\||=|\\!|<|>|\\~|\\^|:|\\.'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'SQL'; } sub parseMultilineCstylecomment { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'operators' # attribute => 'Operator' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'operators', 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => 'functions' # attribute => 'Function' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) { return 1 } # String => 'types' # attribute => 'Data Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%bulk_exceptions\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%bulk_exceptions\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%bulk_rowcount\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%bulk_rowcount\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%found\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%found\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%isopen\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%isopen\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%notfound\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%notfound\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%rowcount\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%rowcount\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%rowtype\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%rowtype\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%type\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%type\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # attribute => 'Float' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { return 1 } # attribute => 'Decimal' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # attribute => 'String' # char => ''' # context => 'String literal' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String literal', 'String')) { return 1 } # attribute => 'Comment' # char => '-' # char1 => '-' # context => 'Singleline PL/SQL-style comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, 'Singleline PL/SQL-style comment', 'Comment')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '*' # context => 'Multiline C-style comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Multiline C-style comment', 'Comment')) { return 1 } # String => '^rem\b' # attribute => 'Comment' # column => '0' # context => 'SQL*Plus remark directive' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '^rem\\b', 1, 0, 0, 0, 0, 'SQL*Plus remark directive', 'Comment')) { return 1 } # attribute => 'Identifier' # char => '"' # context => 'User-defined identifier' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'User-defined identifier', 'Identifier')) { return 1 } # String => '(:|&&?)\w+' # attribute => 'External Variable' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(:|&&?)\\w+', 0, 0, 0, undef, 0, '#stay', 'External Variable')) { return 1 } # String => '^/$' # attribute => 'Symbol' # column => '0' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '^/$', 0, 0, 0, 0, 0, '#stay', 'Symbol')) { return 1 } # String => '^@@?[^@ \t\r\n]' # attribute => 'Preprocessor' # column => '0' # context => 'SQL*Plus directive to include file' # type => 'RegExpr' if ($self->testRegExpr($text, '^@@?[^@ \\t\\r\\n]', 0, 0, 0, 0, 0, 'SQL*Plus directive to include file', 'Preprocessor')) { return 1 } return 0; }; sub parseSQLPlusdirectivetoincludefile { my ($self, $text) = @_; return 0; }; sub parseSQLPlusremarkdirective { my ($self, $text) = @_; return 0; }; sub parseSinglelinePLSQLstylecomment { my ($self, $text) = @_; return 0; }; sub parseStringliteral { my ($self, $text) = @_; # attribute => 'String Char' # context => '#stay' # type => 'HlCStringChar' if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { return 1 } # String => '&&?\w+' # attribute => 'External Variable' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '&&?\\w+', 0, 0, 0, undef, 0, '#stay', 'External Variable')) { return 1 } # attribute => 'String' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; sub parseUserdefinedidentifier { my ($self, $text) = @_; # attribute => 'Identifier' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Identifier')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::SQL - a Plugin for SQL syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::SQL; my $sh = new Syntax::Highlight::Engine::Kate::SQL([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::SQL is a plugin module that provides syntax highlighting for SQL to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/XML.pm0000644000175000017500000004065413226470762025326 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'xml.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.96 #kate version 2.4 #kate author Wilbert Berendsen (wilbert@kde.nl) #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::XML; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Attribute' => 'Others', 'CDATA' => 'BaseN', 'Comment' => 'Comment', 'Doctype' => 'DataType', 'Element' => 'Keyword', 'EntityRef' => 'DecVal', 'Error' => 'Error', 'Normal Text' => 'Normal', 'PEntityRef' => 'DecVal', 'Processing Instruction' => 'Keyword', 'Value' => 'String', }); $self->contextdata({ 'Attribute' => { callback => \&parseAttribute, attribute => 'Normal Text', }, 'CDATA' => { callback => \&parseCDATA, attribute => 'Normal Text', }, 'Comment' => { callback => \&parseComment, attribute => 'Comment', }, 'Doctype' => { callback => \&parseDoctype, attribute => 'Normal Text', }, 'Doctype Internal Subset' => { callback => \&parseDoctypeInternalSubset, attribute => 'Normal Text', }, 'Doctype Markupdecl' => { callback => \&parseDoctypeMarkupdecl, attribute => 'Normal Text', }, 'Doctype Markupdecl DQ' => { callback => \&parseDoctypeMarkupdeclDQ, attribute => 'Value', }, 'Doctype Markupdecl SQ' => { callback => \&parseDoctypeMarkupdeclSQ, attribute => 'Value', }, 'El Content' => { callback => \&parseElContent, attribute => 'Normal Text', }, 'El End' => { callback => \&parseElEnd, attribute => 'Normal Text', }, 'Element' => { callback => \&parseElement, attribute => 'Normal Text', }, 'FindEntityRefs' => { callback => \&parseFindEntityRefs, attribute => 'Normal Text', }, 'FindPEntityRefs' => { callback => \&parseFindPEntityRefs, attribute => 'Normal Text', }, 'FindXML' => { callback => \&parseFindXML, attribute => 'Normal Text', }, 'PI' => { callback => \&parsePI, attribute => 'Normal Text', }, 'Start' => { callback => \&parseStart, attribute => 'Normal Text', }, 'Value' => { callback => \&parseValue, attribute => 'Normal Text', }, 'Value DQ' => { callback => \&parseValueDQ, attribute => 'Value', }, 'Value SQ' => { callback => \&parseValueSQ, attribute => 'Value', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Start'); $self->keywordscase(1); $self->initialize; bless ($self, $class); return $self; } sub language { return 'XML'; } sub parseAttribute { my ($self, $text) = @_; # attribute => 'Attribute' # char => '=' # context => 'Value' # type => 'DetectChar' if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, 'Value', 'Attribute')) { return 1 } # String => '\S' # attribute => 'Error' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#stay', 'Error')) { return 1 } return 0; }; sub parseCDATA { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # String => ']]>' # attribute => 'CDATA' # context => '#pop' # endRegion => 'cdata' # type => 'StringDetect' if ($self->testStringDetect($text, ']]>', 0, 0, 0, undef, 0, '#pop', 'CDATA')) { return 1 } # String => ']]>' # attribute => 'EntityRef' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ']]>', 0, 0, 0, undef, 0, '#stay', 'EntityRef')) { return 1 } return 0; }; sub parseComment { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # String => '-->' # attribute => 'Comment' # context => '#pop' # endRegion => 'comment' # type => 'StringDetect' if ($self->testStringDetect($text, '-->', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } # String => '-(-(?!->))+' # attribute => 'Error' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '-(-(?!->))+', 0, 0, 0, undef, 0, '#stay', 'Error')) { return 1 } # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } return 0; }; sub parseDoctype { my ($self, $text) = @_; # attribute => 'Doctype' # char => '>' # context => '#pop' # endRegion => 'doctype' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'Doctype')) { return 1 } # attribute => 'Doctype' # beginRegion => 'int_subset' # char => '[' # context => 'Doctype Internal Subset' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'Doctype Internal Subset', 'Doctype')) { return 1 } return 0; }; sub parseDoctypeInternalSubset { my ($self, $text) = @_; # attribute => 'Doctype' # char => ']' # context => '#pop' # endRegion => 'int_subset' # type => 'DetectChar' if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Doctype')) { return 1 } # String => ' 'Doctype' # context => 'Doctype Markupdecl' # type => 'RegExpr' if ($self->testRegExpr($text, ' '', 0, 0, 0, undef, 0, '#pop', 'Error')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, '-->', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } # type => Detect2Chars if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, '#stay', 'Error')) { return 1 } return 0; }; sub parse13PIafterXMLDecl { my ($self, $text) = @_; # type => Detect2Chars if ($self->testDetect2Chars($text, '?', '>', 0, 0, 0, undef, 0, '#pop', 'Processing Instruction')) { return 1 } return 0; }; sub parse14DoctypeDeclName { my ($self, $text) = @_; # type => RegExpr if ($self->testRegExpr($text, '(?![Ù -Ù©Û°-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯à¹-๙à»-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*(\\s+|$)', 0, 0, 0, undef, 0, '15:Doctype Decl ExternalID', 'Doctype Declaration')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { return 1 } return 0; }; sub parse15DoctypeDeclExternalID { my ($self, $text) = @_; # type => RegExpr if ($self->testRegExpr($text, 'PUBLIC(\\s+|$)', 0, 0, 0, undef, 0, '16:Doctype Decl PublicID', 'Doctype Declaration')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, 'SYSTEM(\\s+|$)', 0, 0, 0, undef, 0, '19:Doctype Decl SystemID', 'Doctype Declaration')) { return 1 } # type => DetectChar if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, '23:Doctype Decl IS', 'Doctype Declaration')) { return 1 } # type => DetectChar if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '23:Doctype Decl IS', 'Doctype Declaration')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { return 1 } return 0; }; sub parse16DoctypeDeclPublicID { my ($self, $text) = @_; # type => DetectChar if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '17:Doctype Decl PublicID qq', 'Value')) { return 1 } # type => DetectChar if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '18:Doctype Decl PublicID q', 'Value')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { return 1 } return 0; }; sub parse17DoctypeDeclPublicIDqq { my ($self, $text) = @_; # type => DetectChar if ($self->testDetectChar($text, '"(\\s+|$)', 0, 0, 0, undef, 0, '19:Doctype Decl SystemID', 'Value')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, '[ a-zA-Z0-9\'()+,./:=?;!*#@$_%-]', 0, 0, 0, undef, 0, '#stay', 'Value')) { return 1 } return 0; }; sub parse18DoctypeDeclPublicIDq { my ($self, $text) = @_; # type => DetectChar if ($self->testDetectChar($text, '\'(\\s+|$)', 0, 0, 0, undef, 0, '19:Doctype Decl SystemID', 'Value')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, '[ a-zA-Z0-9()+,./:=?;!*#@$_%-]', 0, 0, 0, undef, 0, '#stay', 'Value')) { return 1 } return 0; }; sub parse19DoctypeDeclSystemID { my ($self, $text) = @_; # type => DetectChar if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '20:Doctype Decl SystemID qq', 'Value')) { return 1 } # type => DetectChar if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '21:Doctype Decl SystemID q', 'Value')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { return 1 } return 0; }; sub parse1XMLDeclVersion { my ($self, $text) = @_; # type => RegExpr if ($self->testRegExpr($text, '\\s*version\\s*', 0, 0, 0, undef, 0, '2:XMLDecl Version Eq', 'Attribute')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { return 1 } return 0; }; sub parse20DoctypeDeclSystemIDqq { my ($self, $text) = @_; # type => DetectChar if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '22:Doctype Decl IS or end', 'Value')) { return 1 } return 0; }; sub parse21DoctypeDeclSystemIDq { my ($self, $text) = @_; # type => DetectChar if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '22:Doctype Decl IS or end', 'Value')) { return 1 } return 0; }; sub parse22DoctypeDeclISorend { my ($self, $text) = @_; # type => DetectChar if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, '23:Doctype Decl IS', 'Doctype Declaration')) { return 1 } # type => DetectChar if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '79:Outside', 'Doctype Declaration')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { return 1 } return 0; }; sub parse23DoctypeDeclIS { my ($self, $text) = @_; # type => RegExpr if ($self->testRegExpr($text, '%(?![Ù -Ù©Û°-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯à¹-๙à»-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*;', 0, 0, 0, undef, 0, '#stay', 'Entity')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, ' RegExpr if ($self->testRegExpr($text, ' RegExpr if ($self->testRegExpr($text, ' RegExpr if ($self->testRegExpr($text, ' RegExpr if ($self->testRegExpr($text, '\\s*', 0, 0, 0, undef, 0, '23:Doctype Decl IS', 'Error')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, '-->', 0, 0, 0, undef, 0, '23:Doctype Decl IS', 'Comment')) { return 1 } # type => Detect2Chars if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, '#stay', 'Error')) { return 1 } return 0; }; sub parse78PIinsideIS { my ($self, $text) = @_; # type => Detect2Chars if ($self->testDetect2Chars($text, '?', '>', 0, 0, 0, undef, 0, '23:Doctype Decl IS', 'Processing Instruction')) { return 1 } return 0; }; sub parse79Outside { my ($self, $text) = @_; # type => RegExpr if ($self->testRegExpr($text, '<[xX][mM][lL](\\w|[_.-])*(:(\\w|[_.-])+)?', 0, 0, 0, undef, 0, '80:STag', 'Error')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, '<(?![Ù -Ù©Û°-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯à¹-๙à»-໙༠-༩]|\\d)(\\w|_)(\\w|[_.-])*(:(\\w|[_.-])+)?', 0, 0, 0, undef, 0, '80:STag', 'Normal Tag')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, '<(?![Ù -Ù©Û°-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯à¹-๙à»-໙༠-༩]|\\d)(\\w|[:_])(\\w|[:_.-])*', 0, 0, 0, undef, 0, '80:STag', 'Error')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, ' RegExpr if ($self->testRegExpr($text, ' RegExpr if ($self->testRegExpr($text, ' RegExpr if ($self->testRegExpr($text, '&(?![Ù -Ù©Û°-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯à¹-๙à»-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*;', 0, 0, 0, undef, 0, '#stay', 'Entity')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, '&#(x[0-9a-fA-F]+|[0-9]+);', 0, 0, 0, undef, 0, '#stay', 'Entity')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, ' RegExpr if ($self->testRegExpr($text, '', 0, 0, 0, undef, 0, '79:Outside', 'Error')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, '-->', 0, 0, 0, undef, 0, '79:Outside', 'Comment')) { return 1 } # type => Detect2Chars if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, '#stay', 'Error')) { return 1 } return 0; }; sub parse88PIinsideIS { my ($self, $text) = @_; # type => Detect2Chars if ($self->testDetect2Chars($text, '?', '>', 0, 0, 0, undef, 0, '79:Outside', 'Processing Instruction')) { return 1 } return 0; }; sub parse8XMLDeclStandaloneEq { my ($self, $text) = @_; # type => RegExpr if ($self->testRegExpr($text, '\\s*=\\s*', 0, 0, 0, undef, 0, '9:XMLDecl Standalone', 'Attribute')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Attribute')) { return 1 } return 0; }; sub parse9XMLDeclStandalone { my ($self, $text) = @_; # type => RegExpr if ($self->testRegExpr($text, '\\s*"(yes|no)"|\'(yes|no)\'\\s*', 0, 0, 0, undef, 0, '10:XMLDecl Standalone', 'Value')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Attribute')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::XML_Debug - a Plugin for XML (Debug) syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::XML_Debug; my $sh = new Syntax::Highlight::Engine::Kate::XML_Debug([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::XML_Debug is a plugin module that provides syntax highlighting for XML (Debug) to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Quake_Script.pm0000644000175000017500000014761213226470762027262 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'idconsole.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.02 #kate version 2.1 #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::Quake_Script; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Action' => 'Reserved', 'Command' => 'Keyword', 'Comment' => 'Comment', 'Float' => 'Float', 'Hex' => 'BaseN', 'Identifier' => 'DataType', 'Int' => 'Float', 'Normal Text' => 'Normal', 'String' => 'String', 'String Char' => 'Char', 'Symbol' => 'Others', 'Variable' => 'Variable', }); $self->listAdd('Actions', '+activate', '+alt1', '+attack', '+back', '+break', '+button0', '+button1', '+button10', '+button11', '+button12', '+button13', '+button14', '+button2', '+button3', '+button4', '+button5', '+button6', '+button7', '+button8', '+button9', '+camdistance', '+camin', '+cammousemove', '+camout', '+campitchdown', '+campitchup', '+camyawleft', '+camyawright', '+commandmenu', '+dropweapon', '+duck', '+forward', '+graph', '+jlook', '+jump', '+kick', '+klook', '+leanleft', '+leanright', '+left', '+lookdown', '+lookup', '+mlook', '+movedown', '+moveleft', '+moveright', '+moveup', '+nvgadjust', '+quickgren', '+reload', '+right', '+salute', '+score', '+showscores', '+speed', '+sprint', '+strafe', '+ttack2', '+use', '+useitem', '+voicerecord', '+wbutton7', '+zoom', '-activate', '-alt1', '-attack', '-attack2', '-back', '-break', '-button0', '-button1', '-button10', '-button11', '-button12', '-button13', '-button14', '-button2', '-button3', '-button4', '-button5', '-button6', '-button7', '-button8', '-button9', '-camdistance', '-camin', '-cammousemove', '-camout', '-campitchdown', '-campitchup', '-camyawleft', '-camyawright', '-commandmenu', '-dropweapon', '-duck', '-forward', '-graph', '-jlook', '-jump', '-kick', '-klook', '-leanleft', '-leanright', '-left', '-lookdown', '-lookup', '-mlook', '-movedown', '-moveleft', '-moveright', '-moveup', '-nvgadjust', '-quickgren', '-reload', '-right', '-salute', '-score', '-showscores', '-speed', '-sprint', '-strafe', '-use', '-useitem', '-voicerecord', '-wbutton7', '-zoom', ); $self->listAdd('BindFamily', 'bind', 'unbind', ); $self->listAdd('Commands', 'ForceCloseComman', '_config_com_baud', '_config_com_modem', '_vid_default_mode', '_vid_default_mode_win', '_vid_wait_override', '_windowed_mouse', 'addip', 'addressbook', 'adjust_crosshair', 'advancedupdate', 'allow_download', 'allow_download_maps', 'allow_download_models', 'allow_download_skins', 'allow_download_sounds', 'allskins', 'appenddemo', 'autosave', 'ban', 'banClient', 'banUser', 'banid', 'baseskin', 'begin', 'bf', 'bgetmod', 'bindlist', 'block_switch', 'bottomcolor', 'buyNow', 'buyequip', 'cache_endgather', 'cache_flush', 'cache_mapchange', 'cache_print', 'cache_profile', 'cache_setindex', 'cache_startgather', 'cache_usedfile', 'cancelselect', 'cd', 'centerview', 'changeVectors', 'changelevel', 'changelevel2', 'changing', 'chase_active', 'cinematic', 'cl_deadbodyfilter', 'cl_gibfilter', 'cl_hightrack', 'cl_hudswap', 'cl_messages', 'cl_nodelta', 'cl_nolerp', 'cl_nopred', 'cl_predict_players', 'cl_rate', 'cl_sbar', 'cl_sbar_separator', 'cl_shownet', 'cl_sidespeed', 'cl_solid_players', 'cl_warncmd', 'cl_writecfg', 'clear', 'clearplayers', 'clientinfo', 'clientkick', 'cmd', 'cmdline', 'cmdlist', 'color', 'commands', 'condebug', 'condump', 'configstrings', 'confirm_quit', 'connect', 'contimes', 'coop', 'crash', 'credits', 'cropimages', 'crosshair', 'cvar_restart', 'cvarlist', 'd_mipcap', 'd_subdiv16', 'deathmatch', 'delta_clear', 'delta_stats', 'demo', 'demolist', 'demomap', 'demos', 'developer', 'devmap', 'dir', 'disconnect', 'dlfile', 'dmoptions', 'download', 'drawradar', 'drop', 'dropclient', 'dumpuser', 'edict', 'edictcount', 'edicts', 'endmovie', 'entities', 'envmap', 'error', 'escape', 'exec', 'exit', 'fastsprites', 'fdir', 'filterban', 'firstperson', 'floodprot', 'floodprotmsg', 'flush', 'fly', 'force_centerview', 'fov', 'fraglogfile', 'freelook', 'freeze', 'front', 'fs_openedList', 'fs_referencedList', 'fullinfo', 'fullserverinfo', 'game', 'gameCompleteStatus', 'gamedir', 'gamemap', 'gameversion', 'getcertificate', 'gfxinfo', 'gg', 'gib', 'gibload', 'gibstats', 'give', 'gl_affinemodels', 'gl_clear', 'gl_colorlights', 'gl_constretch', 'gl_cull', 'gl_dlight_lightmap', 'gl_dlight_polyblend', 'gl_dlight_smooth', 'gl_fb_bmodels', 'gl_fb_models', 'gl_finish', 'gl_fires', 'gl_flashblend', 'gl_keeptjunctions', 'gl_lerp_anim', 'gl_lightmode', 'gl_max_size', 'gl_multitexture', 'gl_nobind', 'gl_nocolors', 'gl_picmip', 'gl_playermip', 'gl_polyblend', 'gl_reportjunctions', 'gl_sky_clip', 'gl_skymultipass', 'gl_smoothmodels', 'gl_texsort', 'gl_texturemode', 'gl_triplebuffer', 'gl_ztrick', 'globalservers', 'god', 'gun', 'gun_model', 'gun_next', 'gun_prev', 'gunsmoke', 'heartbeat', 'help', 'hideconsole', 'hideradar', 'host_speeds', 'hostname', 'hpkextract', 'hpklist', 'hpkremove', 'hpkval', 'hud_centerid', 'imagelist', 'impulse', 'imt', 'in_bind', 'in_paste_buffer', 'in_restart', 'in_unbind', 'info', 'interp', 'invdrop', 'inven', 'invnext', 'invnextp', 'invnextw', 'invprev', 'invprevp', 'invprevw', 'invuse', 'joinserver', 'joy', 'joy_advancedupdate', 'joy_enable', 'joyadvanced', 'joyadvancedupdat', 'joyadvancedupdate', 'joyname', 'joystick', 'keys', 'kick', 'kill', 'killserver', 'lefthand', 'link', 'list', 'listdemo', 'listen', 'listid', 'listip', 'listmaps', 'load', 'loadas8bit', 'loadgame', 'loading', 'loadsky', 'loadtranslations', 'loc', 'localinfo', 'localservers', 'log', 'logaddress', 'logfile', 'lookspring', 'lookstrafe', 'm_filter', 'main', 'map', 'map_restart', 'maplist', 'maps', 'max_shells', 'max_smokepuffs', 'maxplayers', 'mcache', 'meminfo', 'menu', 'menu_addressbook', 'menu_credits', 'menu_dmoptions', 'menu_game', 'menu_help', 'menu_joinserver', 'menu_keys', 'menu_load', 'menu_loadgame', 'menu_main', 'menu_multiplayer', 'menu_options', 'menu_playerconfig', 'menu_quit', 'menu_save', 'menu_savegame', 'menu_select', 'menu_setup', 'menu_singleplayer', 'menu_startserver', 'menu_video', 'messagemode', 'messagemode2', 'messagemode3', 'messagemode4', 'model', 'modelist', 'modellist', 'msg', 'multiplayer', 'music', 'name', 'net_stats', 'new', 'next', 'nextul', 'nightvision', 'no_pogo_stick', 'noaim', 'noclip', 'noexit', 'nomonsters', 'noskins', 'nosound', 'notarget', 'options', 'packet', 'password', 'path', 'pausable', 'pause', 'paused', 'ping', 'pingservers', 'play', 'playdemo', 'playerconfig', 'players', 'playvol', 'pointfile', 'ppdemostart', 'pr_boundscheck', 'precache', 'prespawn', 'prev', 'profile', 'profilequit', 'prog', 'pushlatency', 'quit', 'r_drawentities', 'r_drawflat', 'r_draworder', 'r_drawviewmodel', 'r_dspeeds', 'r_dynamic', 'r_fullbright', 'r_lightmap', 'r_netgraph', 'r_netgraph_box', 'r_norefresh', 'r_novis', 'r_numedges', 'r_numsurfs', 'r_particles', 'r_polymodelstats', 'r_reportsurfout', 'r_shadows', 'r_speeds', 'r_timegraph', 'r_wateralpha', 'r_waterripple', 'r_waterwarp', 'r_zgraph', 'rcon', 'rcon_password', 'reconnect', 'record', 'registered', 'reload', 'removedemo', 'removeid', 'removeip', 'rerecord', 'reset', 'resetrcon', 'restart', 'retry', 's_disable_a3d', 's_enable_a3d', 's_info', 's_list', 's_stop', 'samelevel', 'save', 'savegame', 'savetranslations', 'score', 'screenshot', 'screenshotJPEG', 'sectorlist', 'sendents', 'serverinfo', 'serverprofile', 'serverrecord', 'serverstatus', 'serverstop', 'setRecommended', 'setdemoinfo', 'setenv', 'setinfo', 'setmaster', 'setrom', 'shaderlist', 'show_fps', 'show_time', 'showdrop', 'showinfo', 'showip', 'showpackets', 'showpause', 'showram', 'showturtle', 'shutdownserver', 'singlePlayLink', 'sizedown', 'sizeup', 'skill', 'skin', 'skinlist', 'skins', 'sky', 'skyboxlist', 'slist', 'slot1', 'slot10', 'slot2', 'slot3', 'slot4', 'slot5', 'slot6', 'slot7', 'slot8', 'slot9', 'snap', 'snapall', 'snapshot', 'snapto', 'snd', 'snd_noextraupdate', 'snd_restart', 'snd_show', 'soundfade', 'soundinfo', 'soundlist', 'spawn', 'spdevmap', 'speak', 'special', 'specmode', 'spectator', 'spectator_password', 'spk', 'spmap', 'startLimboMode', 'startSingleplayer', 'startdemos', 'startmovie', 'startserver', 'stat', 'stats', 'status', 'stop', 'stopLimboMode', 'stopdemo', 'stoprecord', 'stopsound', 'stopul', 'streamingsound', 'stuffcmd', 'stuffcmds', 'sv', 'sv_allow_log', 'sv_allow_pings', 'sv_allow_status', 'sv_gamedir', 'sv_highchars', 'sv_mapcheck', 'sv_maplist', 'sv_nostep', 'sv_spectatormaxspeed', 'sv_spetalk', 'swapdemo', 'sys_cpuid', 'sys_dead_sleep', 'sys_extrasleep', 'sys_nostdout', 'systeminfo', 'taginfo', 'team', 'teamplay', 'tell', 'test', 'test2', 'thirdperson', 'time', 'timedemo', 'timeleft', 'timerefresh', 'toggle', 'togglebrowser', 'togglechat', 'toggleconsole', 'togglemenu', 'topcolor', 'touchFile', 'trackplayer', 'ui_restart', 'unalias', 'unbindall', 'updatehunkusage', 'updatescreen', 'upload', 'use', 'user', 'userinfo', 'users', 'v_centerspeed', 'v_cshift', 'v_idlescale', 'version', 'vid', 'vid_center', 'vid_config_x', 'vid_describecurrentmode', 'vid_describemode', 'vid_describemodes', 'vid_forcemode', 'vid_front', 'vid_fullscreen', 'vid_fullscreen_mode', 'vid_minimize', 'vid_nopageflip', 'vid_nummodes', 'vid_restart', 'vid_stretch_by_2', 'vid_testmode', 'vid_windowed', 'vid_windowed_mode', 'video', 'viewframe', 'viewmodel', 'viewnext', 'viewpos', 'viewprev', 'vminfo', 'vmprofile', 'voice_showbanned', 'votemap', 'vstr', 'wait', 'watervis', 'wave', 'weaplast', 'weapnext', 'weapon', 'weapon_knife', 'weapprev', 'windowsr_drawentities', 'writecfg', 'writeconfig', 'writeid', 'writeip', 'z_stats', ); $self->listAdd('KeyTypes', '\\\'', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '=', 'ALT', 'AUX1', 'AUX10', 'AUX11', 'AUX12', 'AUX13', 'AUX14', 'AUX15', 'AUX16', 'AUX17', 'AUX18', 'AUX2', 'AUX20', 'AUX21', 'AUX22', 'AUX23', 'AUX24', 'AUX25', 'AUX26', 'AUX27', 'AUX28', 'AUX29', 'AUX3', 'AUX30', 'AUX31', 'AUX32', 'AUX4', 'AUX5', 'AUX6', 'AUX7', 'AUX8', 'AUX9', 'BACKSPACE', 'CAPSLOCK', 'CTRL', 'DEL', 'DOWNARROW', 'END', 'ENTER', 'ESCAPE', 'F1', 'F10', 'F11', 'F12', 'F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8', 'F9', 'HOME', 'INS', 'JOY1', 'JOY2', 'JOY3', 'JOY4', 'KP_5', 'KP_DEL', 'KP_DOWNARROW', 'KP_END', 'KP_HOME', 'KP_INS', 'KP_LEFTARROW', 'KP_PGDN', 'KP_PGUP', 'KP_RIGHTARROW', 'KP_SLASH', 'KP_UPARROW', 'LEFTARROW', 'MOUSE1', 'MOUSE2', 'MOUSE3', 'MWHEELDOWN', 'MWHEELUP', 'PAUSE', 'PGDN', 'PGUP', 'RIGHTARROW', 'SEMICOLON', 'SHIFT', 'SPACE', 'TAB', 'UPARROW', '[', '\\\\', ']', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '~', ); $self->listAdd('PrintsString', 'echo', 'say', 'say_team', ); $self->listAdd('Symbols', '$', ';', ); $self->listAdd('Variables', 'ActiveAction', '_cl_color', '_cl_name', '_config_com_baud', '_config_com_irq', '_config_com_modem', '_config_com_port', '_config_modem_clear', '_config_modem_dialtype', '_config_modem_hangup', '_config_modem_init', '_snd_mixahead', '_vid_default_mode', '_vid_default_mode_win', '_vid_wait_override', '_windowed_mouse', 'address', 'adr', 'adr0', 'adr1', 'adr2', 'adr3', 'adr4', 'adr5', 'adr6', 'adr7', 'adr8', 'advanced', 'advaxisr', 'advaxisu', 'advaxisv', 'advaxisx', 'advaxisy', 'advaxisz', 'ah', 'airaccelerate', 'allow', 'allow_download_players', 'ambient_fade', 'ambient_level', 'anglespeedkey', 'arch', 'array', 'arrays', 'att', 'auto', 'autoskins', 'b', 'bgmbuffer', 'bgmvolume', 'bit', 'bitdepth', 'blend', 'bob', 'bob_pitch', 'bob_roll', 'bob_up', 'bot_aasoptimize', 'bot_challenge', 'bot_debug', 'bot_developer', 'bot_enable', 'bot_fastchat', 'bot_forceclustering', 'bot_forcereachability', 'bot_forcewrite', 'bot_grapple', 'bot_groundonly', 'bot_interbreedbots', 'bot_interbreedchar', 'bot_interbreedcycle', 'bot_interbreedwrite', 'bot_maxdebugpolys', 'bot_miniplayers', 'bot_minplayers', 'bot_nochat', 'bot_pause', 'bot_reachability', 'bot_reloadcharacters', 'bot_report', 'bot_rocketjump', 'bot_saveroutingcache', 'bot_testclusters', 'bot_testichat', 'bot_testrchat', 'bot_testsolid', 'bot_thinktime', 'bot_visualizejumppads', 'brighten', 'brightness', 'broken', 'cd', 'cd_loopcount', 'cd_looptrack', 'cd_nocd', 'cd_plugin', 'centermove', 'centerspeed', 'centertime', 'cg_autoactivate', 'cg_autoswitch', 'cg_blinktime', 'cg_bloodTime', 'cg_bobpitch', 'cg_bobroll', 'cg_bobup', 'cg_brassTime', 'cg_cameraOrbitDelay', 'cg_clipboardName', 'cg_coronafardist', 'cg_coronas', 'cg_crosshairAlpha', 'cg_crosshairHealth', 'cg_crosshairSize', 'cg_crosshairX', 'cg_crosshairY', 'cg_currentSelectedPlayer', 'cg_currentSelectedPlayerName', 'cg_cursorHints', 'cg_cycleAllWeaps', 'cg_deferPlayers', 'cg_descriptiveText', 'cg_draw2D', 'cg_draw3dIcons', 'cg_drawAllWeaps', 'cg_drawAmmoWarning', 'cg_drawAttacker', 'cg_drawCompass', 'cg_drawCrosshair', 'cg_drawCrosshairNames', 'cg_drawCrosshairPickups', 'cg_drawFPGun', 'cg_drawFPS', 'cg_drawFrags', 'cg_drawGun', 'cg_drawIcons', 'cg_drawNotifyText', 'cg_drawRewards', 'cg_drawSnapshot', 'cg_drawSpreadScale', 'cg_drawStatus', 'cg_drawTeamOverlay', 'cg_drawTimer', 'cg_emptyswitch', 'cg_forcemodel', 'cg_fov', 'cg_gibs', 'cg_hudAlpha', 'cg_hudFiles', 'cg_lagometer', 'cg_marks', 'cg_marktime', 'cg_noTaunt', 'cg_noVoiceChats', 'cg_noVoiceText', 'cg_noplayeranims', 'cg_nopredict', 'cg_particleDist', 'cg_particleLOD', 'cg_popupLimboMenu', 'cg_predictItems', 'cg_quickMessageAlt', 'cg_railTrailTime', 'cg_recoilPitch', 'cg_reticleBrightness', 'cg_reticleType', 'cg_runpitch', 'cg_runroll', 'cg_scorePlums', 'cg_selectedPlayer', 'cg_selectedPlayerName', 'cg_shadows', 'cg_showblood', 'cg_simpleItems', 'cg_skybox', 'cg_stereoSeparation', 'cg_teamChatHeight', 'cg_teamChatTime', 'cg_teamChatsOnly', 'cg_thirdPersonAngle', 'cg_thirdperson', 'cg_thirdpersonrange', 'cg_useWeapsForZoom', 'cg_uselessNostalgia', 'cg_viewsize', 'cg_voiceSpriteTime', 'cg_weaponCycleDelay', 'cg_wolfparticles', 'cg_zoomDefaultBinoc', 'cg_zoomDefaultFG', 'cg_zoomDefaultSniper', 'cg_zoomDefaultSnooper', 'cg_zoomStepBinoc', 'cg_zoomStepFG', 'cg_zoomStepSnooper', 'cg_zoomfov', 'cg_zoomstepsniper', 'chase_active', 'chase_back', 'chase_right', 'chase_up', 'cheats', 'cl', 'cl_allowDownload', 'cl_anglespeedkey', 'cl_anonymous', 'cl_autoexec', 'cl_autoskins', 'cl_avidemo', 'cl_backspeed', 'cl_blend', 'cl_bob', 'cl_bobcycle', 'cl_bobup', 'cl_bypassMouseInput', 'cl_cacheGathering', 'cl_camera_maxpitch', 'cl_camera_maxyaw', 'cl_chasecam', 'cl_chatmode', 'cl_conXOffset', 'cl_crossx', 'cl_crossy', 'cl_cshift_bonus', 'cl_cshift_content', 'cl_cshift_damage', 'cl_cshift_powerup', 'cl_debugMove', 'cl_debugTranslation', 'cl_demospeed', 'cl_entities', 'cl_footsteps', 'cl_forceavidemo', 'cl_forwardspeed', 'cl_freelook', 'cl_freezeDemo', 'cl_gun', 'cl_hidefrags', 'cl_hightrack', 'cl_hudswap', 'cl_language', 'cl_lights', 'cl_maxPing', 'cl_maxfps', 'cl_maxpackets', 'cl_motd', 'cl_motdString', 'cl_mouseAccel', 'cl_movespeedkey', 'cl_nodelta', 'cl_nofake', 'cl_nolerp', 'cl_nopred', 'cl_noprint', 'cl_noskins', 'cl_observercrosshair', 'cl_packetdup', 'cl_parsesay', 'cl_particles', 'cl_paused', 'cl_pitchspeed', 'cl_predict', 'cl_predict_players', 'cl_predict_players2', 'cl_quakerc', 'cl_rollangle', 'cl_rollspeed', 'cl_run', 'cl_running', 'cl_serverStatusResendTime', 'cl_showSend', 'cl_showServerCommands', 'cl_showTimeDelta', 'cl_showfps', 'cl_showmiss', 'cl_showmouserate', 'cl_shownet', 'cl_shownuments', 'cl_sidespeed', 'cl_stats', 'cl_stereo', 'cl_stereo_separation', 'cl_testblend', 'cl_testentities', 'cl_testlights', 'cl_testparticles', 'cl_timeNudge', 'cl_timeout', 'cl_upspeed', 'cl_verstring', 'cl_visibleClients', 'cl_vwep', 'cl_waitForFire', 'cl_wavefilerecord', 'cl_yawspeed', 'clear', 'clearcolor', 'clientport', 'cm_playerCurveClip', 'cmd_highchars', 'cmd_warncmd', 'cmdlist', 'color', 'color1', 'color2', 'com_blood', 'com_buildScript', 'com_cameraMode', 'com_dropsim', 'com_hunkMegs', 'com_hunkused', 'com_introplayed', 'com_maxfps', 'com_recommendedSet', 'com_showtrace', 'com_soundMegs', 'com_speeds', 'com_zoneMegs', 'compiled', 'con_debug', 'con_notifytime', 'con_restricted', 'conspeed', 'contrast', 'coop', 'crosshair', 'crosshaircolor', 'cull', 'd_mipcap', 'd_mipscale', 'deathmatch', 'debug_protocol', 'debuggraph', 'dedicated', 'devdll', 'developer', 'dlabs', 'dm', 'dmflags', 'down', 'download', 'drawall', 'drawbuffer', 'drawentities', 'drawflat', 'draworder', 'drawworld', 'driver', 'dspeeds', 'dynamic', 'easter_eggs', 'edgefriction', 'empty', 'enforcetime', 'entities', 'entlatency', 'ext', 'filter', 'filterban', 'finish', 'fixedtime', 'flashblend', 'flood', 'flood_msgs', 'flood_persecond', 'flood_waitdelay', 'flushmap', 'footsteps', 'forward', 'forwardsensitivity', 'forwardspeed', 'forwardthreshold', 'fov', 'fraglimit', 'freelook', 'fs_basegame', 'fs_basepath', 'fs_cdpath', 'fs_copyfiles', 'fs_debug', 'fs_game', 'fs_globalcfg', 'fs_homepath', 'fs_pluginpath', 'fs_restrict', 'fs_sharepath', 'fs_skinbase', 'fs_usercfg', 'fs_userpath', 'fullbright', 'fullscreen', 'g_allowvote', 'g_altStopwatchMode', 'g_arenasFile', 'g_blueTeam', 'g_botsFile', 'g_complaintlimit', 'g_currentRound', 'g_friendlyFire', 'g_gameskill', 'g_gametype', 'g_maxlives', 'g_minGameClients', 'g_missionStats', 'g_nextTimeLimit', 'g_noTeamSwitching', 'g_redTeam', 'g_select_empty', 'g_spAwards', 'g_spScores1', 'g_spScores2', 'g_spScores3', 'g_spScores4', 'g_spScores5', 'g_spSkill', 'g_spVideos', 'g_userAlliedRespawnTime', 'g_userAxisRespawnTime', 'g_userTimeLimit', 'game', 'gamecfg', 'gamedate', 'gamedir', 'gamename', 'gamestate', 'gamma', 'gender', 'gender_auto', 'gl_3dlabs_broken', 'gl_allow_software', 'gl_bitdepth', 'gl_clear', 'gl_conalpha', 'gl_conspin', 'gl_cshiftpercent', 'gl_cull', 'gl_drawbuffer', 'gl_driver', 'gl_dynamic', 'gl_ext_compiled_vertex_array', 'gl_ext_multitexture', 'gl_ext_palettedtexture', 'gl_ext_pointparameters', 'gl_ext_swapinterval', 'gl_finish', 'gl_flashblend', 'gl_keeptjunctions', 'gl_lightmap', 'gl_lightmap_align', 'gl_lightmap_subimage', 'gl_lockpvs', 'gl_log', 'gl_max_size', 'gl_mesh_cache', 'gl_mode', 'gl_modulate', 'gl_monolightmap', 'gl_nobind', 'gl_nocolors', 'gl_nosubimage', 'gl_occlusion', 'gl_particle_att_a', 'gl_particle_att_b', 'gl_particle_att_c', 'gl_particle_max_size', 'gl_particle_min_size', 'gl_particle_mip', 'gl_particle_size', 'gl_picmip', 'gl_playermip', 'gl_polyblend', 'gl_reporttjunctions', 'gl_round_down', 'gl_saturatelighting', 'gl_screenshot_byte_swap', 'gl_shadows', 'gl_showtris', 'gl_sky_debug', 'gl_sky_divide', 'gl_skymip', 'gl_smoothmodels', 'gl_subdivide_size', 'gl_swapinterval', 'gl_texsort', 'gl_texturealphamode', 'gl_texturemode', 'gl_texturesolidmode', 'gl_triplebuffer', 'gl_vertex_arrays', 'gl_ztrick', 'graphheight', 'graphscale', 'graphshift', 'gravity', 'gun', 'gun_x', 'gun_y', 'gun_z', 'hand', 'handicap', 'head', 'headModel', 'headmodel', 'host', 'host_framerate', 'host_speeds', 'hostname', 'hostport', 'hud_fastswitch', 'in', 'in_amp', 'in_bind_imt', 'in_debugjoystick', 'in_dga', 'in_dga_mouseaccel', 'in_dgamouse', 'in_grab', 'in_joystick', 'in_midi', 'in_mouse', 'in_mouse_amp', 'in_mouse_filter', 'in_mouse_pre_amp', 'in_pre_amp', 'initsound', 'intensity', 'ip', 'ip_clientport', 'ip_hostport', 'ipx', 'ipx_clientport', 'ipx_hostport', 'journal', 'joy', 'joy_advanced', 'joy_advaxisr', 'joy_advaxisu', 'joy_advaxisv', 'joy_advaxisx', 'joy_advaxisy', 'joy_advaxisz', 'joy_amp', 'joy_device', 'joy_forwardsensitivity', 'joy_forwardthreshold', 'joy_name', 'joy_pitchsensitivity', 'joy_pitchthreshold', 'joy_pre_amp', 'joy_sensitivity', 'joy_sidesensitivity', 'joy_sidethreshold', 'joy_threshold', 'joy_upsensitivity', 'joy_upthreshold', 'joy_yawsensitivity', 'joy_yawthreshold', 'joyadvanced', 'joyadvaxisr', 'joyadvaxisu', 'joyadvaxisv', 'joyadvaxisx', 'joyadvaxisy', 'joyadvaxisz', 'joyaxis1', 'joyaxis2', 'joyaxis3', 'joyaxis4', 'joyaxis5', 'joyaxis6', 'joyaxis7', 'joyaxis8', 'joyforwardsensitivity', 'joyforwardthreshold', 'joyname', 'joypitchsensitivity', 'joypitchthreshold', 'joysidesensitivity', 'joysidethreshold', 'joystick', 'joywwhack1', 'joywwhack2', 'joyyawsensitivity', 'joyyawthreshold', 'khz', 'lcd_x', 'lcd_yaw', 'lerpmodels', 'lightmap', 'lights', 'limit', 'listen', 'loadas', 'loadas8bit', 'localid', 'lockpvs', 'log', 'log_stats', 'logfile', 'lookspring', 'lookstrafe', 'loopcount', 'looptrack', 'm_filter', 'm_forward', 'm_pitch', 'm_side', 'm_yaw', 'mapname', 'maps', 'max', 'maxclients', 'maxedges', 'maxentities', 'maxfps', 'maxplayers', 'maxspectators', 'maxsurfs', 'maxvelocity', 'min', 'mipcap', 'mipscale', 'mixahead', 'mode', 'model', 'models', 'modex', 'modulate', 'monolightmap', 'mouse', 'mp_autokick', 'mp_autoteambalance', 'mp_c4timer', 'mp_currentPlayerType', 'mp_currentTeam', 'mp_flashlight', 'mp_footsteps', 'mp_forcechasecam', 'mp_freezetime', 'mp_friendlyfire', 'mp_hostagepenalty', 'mp_limitteams', 'mp_logmessages', 'mp_mapvoteration', 'mp_playerType', 'mp_roundtime', 'mp_team', 'mp_timelimit', 'mp_tkpunish', 'mp_weapon', 'msg', 'msgs', 'multitexture', 'name', 'net_graph', 'net_ip', 'net_messagetimeout', 'net_noudp', 'net_port', 'net_qport', 'net_restart', 'netdosexpire', 'netdosvalues', 'netgraph', 'nextdemo', 'nextmap', 'nextserver', 'noalttab', 'nobind', 'nocd', 'nocull', 'nodelta', 'noexit', 'nomonsters', 'norefresh', 'noreload', 'noskins', 'nosound', 'nosubimage', 'novis', 'palettedtexture', 'particle', 'particles', 'password', 'pausable', 'persecond', 'picmip', 'pitch', 'pitchsensitivity', 'pitchspeed', 'pitchthreshold', 'playermip', 'players', 'pointparameters', 'polyblend', 'polymodelstats', 'port', 'pr_checkextensions', 'pr_deadbeef_ents', 'pr_deadbeef_locals', 'pr_debug', 'pr_source_path', 'precache', 'predict', 'primary', 'printspeed', 'protocol', 'public', 'pushlatency', 'qport', 'r_aliastransadj', 'r_aliastransbase', 'r_allowExtensions', 'r_allowSoftwareGL', 'r_ambient', 'r_ambientScale', 'r_bonesDebug', 'r_cache', 'r_cacheModels', 'r_cacheShaders', 'r_clear', 'r_clearcolor', 'r_colorMipLevels', 'r_colorbits', 'r_compressModels', 'r_customaspect', 'r_customheight', 'r_customwidth', 'r_debugSort', 'r_debugSurface', 'r_debuglight', 'r_depthbits', 'r_detailtextures', 'r_directedScale', 'r_displayRefresh', 'r_dlightBacks', 'r_dlight_lightmap', 'r_dlight_max', 'r_drawBuffer', 'r_drawSun', 'r_drawentities', 'r_drawexplosions', 'r_drawflat', 'r_draworder', 'r_drawviewmodel', 'r_drawworld', 'r_dspeeds', 'r_dynamic', 'r_dynamiclight', 'r_explosionclip', 'r_exportCompressedModels', 'r_ext_compiled_vertex_array', 'r_ext_compress_textures', 'r_ext_compressed_textures', 'r_ext_gamma_control', 'r_ext_multitexture', 'r_ext_texture_env_add', 'r_facePlaneCull', 'r_fastsky', 'r_finish', 'r_firecolor', 'r_flareFade', 'r_flareSize', 'r_flares', 'r_fullbright', 'r_fullscreen', 'r_gamma', 'r_glDriver', 'r_glIgnoreWicked3D', 'r_graphheight', 'r_highQualit', 'r_highQualityVideo', 'r_ignore', 'r_ignoreFastPath', 'r_ignoreGLErrors', 'r_ignorehwgamma', 'r_inGameVideo', 'r_intensity', 'r_lastValidRenderer', 'r_lerpmodels', 'r_lightmap', 'r_lightmap_components', 'r_lockpvs', 'r_lodCurveError', 'r_lodbias', 'r_lodscale', 'r_logFile', 'r_lowMemTextureSize', 'r_lowMemTextureThreshold', 'r_mapOverBrightBits', 'r_maxedges', 'r_maxpolys', 'r_maxpolyverts', 'r_maxsurfs', 'r_measureOverdraw', 'r_mirroralpha', 'r_mode', 'r_netgraph', 'r_netgraph_alpha', 'r_nobind', 'r_nocull', 'r_nocurves', 'r_noportals', 'r_norefresh', 'r_novis', 'r_numedges', 'r_numsurfs', 'r_offsetfactor', 'r_offsetunits', 'r_overBrightBits', 'r_particles_max', 'r_particles_style', 'r_picmip', 'r_picmip2', 'r_polymodelstats', 'r_portalOnly', 'r_preloadTextures', 'r_previousglDriver', 'r_primitives', 'r_printShaders', 'r_railCoreWidth', 'r_railSegmentLength', 'r_railWidth', 'r_reportedgeout', 'r_reportsurfout', 'r_rmse', 'r_roundImagesDown', 'r_saveFontData', 'r_shadows', 'r_showImages', 'r_showSmp', 'r_showcluster', 'r_shownormals', 'r_showsky', 'r_showtris', 'r_simpleMipMaps', 'r_singleShader', 'r_skipBackEnd', 'r_skyname', 'r_smp', 'r_speeds', 'r_stencilbits', 'r_stereo', 'r_subdivisions', 'r_swapInterval', 'r_textureMode', 'r_texturebits', 'r_timegraph', 'r_uiFullScreen', 'r_verbose', 'r_vertexLight', 'r_wateralpha', 'r_waterwarp', 'r_wolffog', 'r_zfar', 'r_znear', 'rate', 'rcon', 'rconAddress', 'rconPassword', 'rcon_address', 'rcon_password', 'reconnect', 'ref', 'registered', 'reportedgeout', 'reportsurfout', 'roll', 'rollangle', 'rollspeed', 'round', 'run', 'run_pitch', 'run_roll', 's_compression', 's_defaultsound', 's_doppler', 's_initsound', 's_khz', 's_loadas8bit', 's_mixPreStep', 's_mixahead', 's_musicvolume', 's_mute', 's_nocompressed', 's_primary', 's_separation', 's_show', 's_testsound', 's_usingA3D', 's_volume', 's_wavonly', 'samelevel', 'saturatelighting', 'saved1', 'saved2', 'saved3', 'saved4', 'savedgamecfg', 'scr', 'scr_centertime', 'scr_consize', 'scr_conspeed', 'scr_drawall', 'scr_ofsx', 'scr_ofsy', 'scr_ofsz', 'scr_printspeed', 'scr_showpause', 'scr_showturtle', 'scratch1', 'scratch2', 'scratch3', 'scratch4', 'screenshot', 'select', 'sensitivity', 'separation', 'server1', 'server10', 'server11', 'server12', 'server13', 'server14', 'server15', 'server16', 'server2', 'server3', 'server4', 'server5', 'server6', 'server7', 'server8', 'server9', 'serverprofile', 'sex', 'shadows', 'show', 'showclamp', 'showdrop', 'showmiss', 'shownet', 'showpackets', 'showpause', 'showram', 'showtrace', 'showtris', 'showturtle', 'side', 'sidesensitivity', 'sidespeed', 'sidethreshold', 'size', 'skill', 'skin', 'skymip', 'snaps', 'snd_bits', 'snd_device', 'snd_interp', 'snd_loadas8bit', 'snd_mixahead', 'snd_noextraupdate', 'snd_oss_mmaped', 'snd_output', 'snd_phasesep', 'snd_rate', 'snd_render', 'snd_show', 'snd_stereo', 'snd_volumesep', 'sndbits', 'sndchannels', 'snddevice', 'sndspeed', 'software', 'sounds', 'spectator', 'spectator_password', 'speeds', 'stats', 'stereo', 'stipplealpha', 'surfcacheoverride', 'sv', 'sv_accelerate', 'sv_aim', 'sv_airaccelerate', 'sv_allowAnonymous', 'sv_allowDownload', 'sv_cheats', 'sv_enforcetime', 'sv_floodProtect', 'sv_fps', 'sv_friction', 'sv_gravity', 'sv_hostname', 'sv_idealpitchscale', 'sv_keywords', 'sv_killserver', 'sv_mapChecksum', 'sv_master1', 'sv_master2', 'sv_master3', 'sv_master4', 'sv_master5', 'sv_maxPing', 'sv_maxRate', 'sv_maxclients', 'sv_maxrate', 'sv_maxspeed', 'sv_maxtic', 'sv_maxvelocity', 'sv_minPing', 'sv_minqfversion', 'sv_mintic', 'sv_netdosprotect', 'sv_noreload', 'sv_nostep', 'sv_onlyVisibleClients', 'sv_padPackets', 'sv_pakNames', 'sv_paks', 'sv_paused', 'sv_phs', 'sv_privateClients', 'sv_privatePassword', 'sv_progs', 'sv_pure', 'sv_reconnect_limit', 'sv_reconnectlimit', 'sv_referencedPakNames', 'sv_referencedPaks', 'sv_restartround', 'sv_rollangle', 'sv_rollspeed', 'sv_running', 'sv_serverid', 'sv_showAverageBPS', 'sv_showloss', 'sv_spectalk', 'sv_stopspeed', 'sv_timefmt', 'sv_timekick', 'sv_timekick_fuzz', 'sv_timekick_interval', 'sv_timeout', 'sv_timestamps', 'sv_wateraccelerate', 'sv_waterfriction', 'sv_zombietime', 'sw', 'sw_allow_modex', 'sw_clearcolor', 'sw_drawflat', 'sw_draworder', 'sw_maxedges', 'sw_maxsurfs', 'sw_mipcap', 'sw_mipscale', 'sw_mode', 'sw_polymodelstats', 'sw_reportedgeout', 'sw_reportsurfout', 'sw_stipplealpha', 'sw_surfcacheoverride', 'sw_waterwarp', 'swapinterval', 'sys_cpustring', 'sys_nostdout', 'sys_sleep', 'sys_ticrate', 'team', 'team_headmodel', 'team_model', 'teamplay', 'teamtask', 'temp1', 'testblend', 'testentities', 'testlights', 'testparticles', 'testsound', 'texturealphamode', 'texturemode', 'texturesolidmode', 'timedemo', 'timegraph', 'timelimit', 'timeout', 'timescale', 'topcolor', 'triplebuffer', 'ttycon', 'ui_Q3Model', 'ui_actualNetGametype', 'ui_bigFont', 'ui_browserGameType', 'ui_browserMaster', 'ui_browserShowEmpty', 'ui_browserShowFriendlyFire', 'ui_browserShowFull', 'ui_browserShowMaxlives', 'ui_browserShowTourney', 'ui_browserSortKey', 'ui_cdkeychecked', 'ui_class', 'ui_cmd', 'ui_ctf_capturelimit', 'ui_ctf_friendly', 'ui_ctf_timelimit', 'ui_currentMap', 'ui_currentNetMap', 'ui_dedicated', 'ui_ffa_fraglimit', 'ui_ffa_timelimit', 'ui_gametype', 'ui_glCustom', 'ui_isSpectator', 'ui_joinGametype', 'ui_limboMode', 'ui_limboObjective', 'ui_limboOptions', 'ui_limboPrevOptions', 'ui_mapIndex', 'ui_master', 'ui_menuFiles', 'ui_mousePitch', 'ui_netGametype', 'ui_netSource', 'ui_notebookCurrentPage', 'ui_objective', 'ui_prevClass', 'ui_prevTeam', 'ui_prevWeapon', 'ui_serverStatusTimeOut', 'ui_singlePlayerActive', 'ui_smallFont', 'ui_spSelection', 'ui_team', 'ui_teamArenaFirstRun', 'ui_team_fraglimit', 'ui_team_friendly', 'ui_team_timelimit', 'ui_tourney_fraglimit', 'ui_tourney_timelimit', 'ui_userAlliedRespawnTime', 'ui_userAxisRespawnTime', 'ui_userTimeLimit', 'ui_weapon', 'up', 'upsensitivity', 'upspeed', 'upthreshold', 'username', 'v_centermove', 'v_centerspeed', 'v_idlescale', 'v_ipitch_cycle', 'v_ipitch_level', 'v_iroll_cycle', 'v_iroll_level', 'v_iuaw_cycle', 'v_iyaw_cycle', 'v_iyaw_level', 'v_kickpitch', 'v_kickroll', 'v_kicktime', 'version', 'vertex', 'vid', 'vid_config_x', 'vid_config_y', 'vid_fullscreen', 'vid_fullscreen_mode', 'vid_gamma', 'vid_height', 'vid_mode', 'vid_nopageflip', 'vid_ref', 'vid_system_gamma', 'vid_use8bit', 'vid_wait', 'vid_width', 'vid_window_x', 'vid_window_y', 'vid_windowed_mode', 'vid_xpos', 'vid_ypos', 'viewlog', 'viewsize', 'vm_cgame', 'vm_game', 'vm_ui', 'volume', 'vwep', 'waitdelay', 'waterwarp', 'wavonly', 'win', 'win_hinstance', 'win_noalttab', 'win_wndproc', 'xpos', 'yaw', 'yawsensitivity', 'yawspeed', 'yawthreshold', 'ypos', 'zombietime', 'ztrick', ); $self->listAdd('setFamily', 'set', 'seta', 'sets', 'setu', ); $self->contextdata({ 'Alias phrase' => { callback => \&parseAliasphrase, attribute => 'Identifier', lineending => 'Normal Text', }, 'Arg area' => { callback => \&parseArgarea, attribute => 'Normal Text', lineending => 'Normal Text', }, 'Arg area in sub phrase' => { callback => \&parseArgareainsubphrase, attribute => 'Normal Text', lineending => 'Normal Text', }, 'Bind phrase' => { callback => \&parseBindphrase, attribute => 'Normal Text', lineending => 'Normal Text', }, 'Comment' => { callback => \&parseComment, attribute => 'Comment', lineending => 'Normal Text', }, 'Echo' => { callback => \&parseEcho, attribute => 'String', lineending => 'Normal Text', }, 'Normal Text' => { callback => \&parseNormalText, attribute => 'Normal Text', }, 'String' => { callback => \&parseString, attribute => 'String', lineending => 'Normal Text', }, 'Sub phrase' => { callback => \&parseSubphrase, attribute => 'Normal Text', lineending => 'Normal Text', }, }); $self->deliminators('\\s||\\(|\\)|:|\\!|<|>|\\%|\\&|\\*|;|\\?|\\^|\\{|\\||\\}|,|\\+|\\~|-|=|\\/|\\\\|\\.|\\[|\\]|\\$'); $self->basecontext('Normal Text'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Quake Script'; } sub parseAliasphrase { my ($self, $text) = @_; # attribute => 'Identifier' # char => ' ' # context => 'Sub phrase' # type => 'DetectChar' if ($self->testDetectChar($text, ' ', 0, 0, 0, undef, 0, 'Sub phrase', 'Identifier')) { return 1 } return 0; }; sub parseArgarea { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # attribute => 'Float' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { return 1 } # attribute => 'Int' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Int')) { return 1 } # attribute => 'Symbol' # char => ';' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'Symbol')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { return 1 } # attribute => 'Symbol' # char => '$' # context => 'Normal Text' # type => 'DetectChar' if ($self->testDetectChar($text, '$', 0, 0, 0, undef, 0, 'Normal Text', 'Symbol')) { return 1 } return 0; }; sub parseArgareainsubphrase { my ($self, $text) = @_; # attribute => 'Float' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { return 1 } # attribute => 'Int' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Int')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { return 1 } # attribute => 'Symbol' # char => ';' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'Symbol')) { return 1 } return 0; }; sub parseBindphrase { my ($self, $text) = @_; # String => 'KeyTypes' # attribute => 'Hex' # context => 'Sub phrase' # type => 'keyword' if ($self->testKeyword($text, 'KeyTypes', 0, undef, 0, 'Sub phrase', 'Hex')) { return 1 } return 0; }; sub parseComment { my ($self, $text) = @_; return 0; }; sub parseEcho { my ($self, $text) = @_; # attribute => 'Symbol' # char => ';' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'Symbol')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { return 1 } return 0; }; sub parseNormalText { my ($self, $text) = @_; # String => 'Commands' # attribute => 'Command' # context => 'Arg area' # type => 'keyword' if ($self->testKeyword($text, 'Commands', 0, undef, 0, 'Arg area', 'Command')) { return 1 } # String => 'Variables' # attribute => 'Variable' # context => 'Arg area' # type => 'keyword' if ($self->testKeyword($text, 'Variables', 0, undef, 0, 'Arg area', 'Variable')) { return 1 } # String => 'Actions' # attribute => 'Action' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'Actions', 0, undef, 0, '#stay', 'Action')) { return 1 } # String => 'Symbols' # attribute => 'Symbol' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'Symbols', 0, undef, 0, '#stay', 'Symbol')) { return 1 } # String => 'BindFamily' # attribute => 'Command' # context => 'Bind phrase' # type => 'keyword' if ($self->testKeyword($text, 'BindFamily', 0, undef, 0, 'Bind phrase', 'Command')) { return 1 } # String => 'setFamily' # attribute => 'Command' # context => 'Alias phrase' # type => 'keyword' if ($self->testKeyword($text, 'setFamily', 0, undef, 0, 'Alias phrase', 'Command')) { return 1 } # String => 'PrintsString' # attribute => 'Command' # context => 'Echo' # type => 'keyword' if ($self->testKeyword($text, 'PrintsString', 0, undef, 0, 'Echo', 'Command')) { return 1 } # String => 'alias' # attribute => 'Command' # context => 'Alias phrase' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'alias', 1, 0, 0, undef, 0, 'Alias phrase', 'Command')) { return 1 } # String => 'PrintsString' # attribute => 'Command' # context => 'Echo' # type => 'keyword' if ($self->testKeyword($text, 'PrintsString', 0, undef, 0, 'Echo', 'Command')) { return 1 } # attribute => 'Symbol' # char => '$' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '$', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { return 1 } return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; sub parseSubphrase { my ($self, $text) = @_; # String => 'Commands' # attribute => 'Command' # context => 'Arg area in sub phrase' # type => 'keyword' if ($self->testKeyword($text, 'Commands', 0, undef, 0, 'Arg area in sub phrase', 'Command')) { return 1 } # String => 'Variables' # attribute => 'Variable' # context => 'Arg area in sub phrase' # type => 'keyword' if ($self->testKeyword($text, 'Variables', 0, undef, 0, 'Arg area in sub phrase', 'Variable')) { return 1 } # String => 'Actions' # attribute => 'Action' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'Actions', 0, undef, 0, '#stay', 'Action')) { return 1 } # String => 'Symbols' # attribute => 'Symbol' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'Symbols', 0, undef, 0, '#stay', 'Symbol')) { return 1 } # String => 'BindFamily' # attribute => 'Command' # context => 'Bind phrase' # type => 'keyword' if ($self->testKeyword($text, 'BindFamily', 0, undef, 0, 'Bind phrase', 'Command')) { return 1 } # String => 'setFamily' # attribute => 'Command' # context => 'Normal Text' # type => 'keyword' if ($self->testKeyword($text, 'setFamily', 0, undef, 0, 'Normal Text', 'Command')) { return 1 } # String => 'PrintsString' # attribute => 'Command' # context => 'Echo' # type => 'keyword' if ($self->testKeyword($text, 'PrintsString', 0, undef, 0, 'Echo', 'Command')) { return 1 } # String => 'alias' # attribute => 'Command' # context => 'Alias phrase' # type => 'StringDetect' if ($self->testStringDetect($text, 'alias', 0, 0, 0, undef, 0, 'Alias phrase', 'Command')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { return 1 } # attribute => 'Symbol' # char => ';' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # attribute => 'Int' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Int')) { return 1 } # attribute => 'Symbol' # char => ';' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'Symbol')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Quake_Script - a Plugin for Quake Script syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Quake_Script; my $sh = new Syntax::Highlight::Engine::Kate::Quake_Script([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Quake_Script is a plugin module that provides syntax highlighting for Quake Script to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/De_DE.pm0000644000175000017500000001511713226470762025562 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'logohighlightstyle.de_DE.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 0.2 #kate version 2.1 #generated: Sun Feb 3 22:02:04 2008, localtime package Syntax::Highlight::Engine::Kate::De_DE; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Boolean Operators' => 'BString', 'Comment' => 'Comment', 'Execution Controllers' => 'BaseN', 'Expressers' => 'Datatype', 'MetaFunctions' => 'Function', 'Normal' => 'Normal', 'Normal Text' => 'Normal', 'Number' => 'Float', 'Operator' => 'Operator', 'Raw String' => 'String', 'Scopes' => 'RegionMarker', 'Statements' => 'Keyword', 'String' => 'String', }); $self->listAdd('boolops', 'nicht', 'oder', 'und', ); $self->listAdd('controllers', 'abbrechen', 'bis', 'fürjedes', 'in', 'solange', 'sonst', 'tue', 'von', 'warte', 'wdh', 'wenn', 'wiederhole', 'zurück', ); $self->listAdd('metafunctions', 'lerne', ); $self->listAdd('statements', 'drucke', 'drücke', 'eingabefenster', 'gehe', 'gehex', 'gehey', 'gx', 'gy', 'indiemitte', 'lauf', 'ls', 'lösche', 'nachlinks', 'nachrechts', 'nachricht', 'nl', 'nr', 'papierfarbe', 'papiergröße', 'pf', 'pg', 'richtung', 'rtg', 'rw', 'rückwärts', 'schriftart', 'schriftgröße', 'stbr', 'stf', 'sth', 'stiftbreite', 'stiftfarbe', 'stifthoch', 'stiftrunter', 'str', 'umbruchan', 'umbruchaus', 'verberge', 'vg', 'vorwärts', 'vw', 'wc', 'wechsle', 'zeige', 'zg', 'zufall', 'zurücksetzen', ); $self->contextdata({ 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'String' => { callback => \&parseString, attribute => 'String', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'de_DE'; } sub parseNormal { my ($self, $text) = @_; # String => 'metafunctions' # attribute => 'MetaFunctions' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'metafunctions', 0, undef, 0, '#stay', 'MetaFunctions')) { return 1 } # String => 'statements' # attribute => 'Statements' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'statements', 0, undef, 0, '#stay', 'Statements')) { return 1 } # String => 'controllers' # attribute => 'Execution Controllers' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'controllers', 0, undef, 0, '#stay', 'Execution Controllers')) { return 1 } # String => 'boolops' # attribute => 'Boolean Operators' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'boolops', 0, undef, 0, '#stay', 'Boolean Operators')) { return 1 } # String => '([!=><][=]|[><])' # attribute => 'Expressers' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '([!=><][=]|[><])', 0, 0, 0, undef, 0, '#stay', 'Expressers')) { return 1 } # String => '[a-zA-Z_][a-zA-Z_0-9]+' # attribute => 'Normal' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[a-zA-Z_][a-zA-Z_0-9]+', 0, 0, 0, undef, 0, '#stay', 'Normal')) { return 1 } # String => '([0-9]+\.[0-9]*|\.[0-9]+)?|[0-9]*' # attribute => 'Number' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '([0-9]+\\.[0-9]*|\\.[0-9]+)?|[0-9]*', 0, 0, 0, undef, 0, '#stay', 'Number')) { return 1 } # String => '#.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # String => '[+*/\(\)-]' # attribute => 'Operator' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[+*/\\(\\)-]', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '[\[\]]' # attribute => 'Scopes' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\[\\]]', 0, 0, 0, undef, 0, '#stay', 'Scopes')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # context => '#stay' # type => 'HlCStringChar' if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String')) { return 1 } # String => '%[a-zA-Z]' # attribute => 'Operator' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '%[a-zA-Z]', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::De_DE - a Plugin for de_DE syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::De_DE; my $sh = new Syntax::Highlight::Engine::Kate::De_DE([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::De_DE is a plugin module that provides syntax highlighting for de_DE to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Haskell.pm0000644000175000017500000003112013226470762026235 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'haskell.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.04 #kate version 2.3 #kate author Marcel Martin (mmar@freenet.de) #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::Haskell; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Char' => 'Char', 'Class' => 'Keyword', 'Comment' => 'Comment', 'Constructor' => 'Others', 'Data Constructor' => 'Keyword', 'Decimal' => 'DecVal', 'Float' => 'Float', 'Function' => 'Function', 'Function Definition' => 'Function', 'Infix Operator' => 'Others', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'String' => 'String', 'Type Constructor' => 'DataType', }); $self->listAdd('classes', 'Bounded', 'Enum', 'Eq', 'Floating', 'Fractional', 'Functor', 'Integral', 'Ix', 'Monad', 'Num', 'Ord', 'Read', 'Real', 'RealFloat', 'RealFrac', 'Show', ); $self->listAdd('data constructors', 'EQ', 'False', 'GT', 'Just', 'LT', 'Left', 'Nothing', 'Right', 'True', ); $self->listAdd('functions', 'FilePath', 'IOError', 'abs', 'acos', 'acosh', 'all', 'and', 'any', 'appendFile', 'approxRational', 'asTypeOf', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'basicIORun', 'break', 'catch', 'ceiling', 'chr', 'compare', 'concat', 'concatMap', 'const', 'cos', 'cosh', 'curry', 'cycle', 'decodeFloat', 'denominator', 'digitToInt', 'div', 'divMod', 'drop', 'dropWhile', 'either', 'elem', 'encodeFloat', 'enumFrom', 'enumFromThen', 'enumFromThenTo', 'enumFromTo', 'error', 'even', 'exp', 'exponent', 'fail', 'filter', 'flip', 'floatDigits', 'floatRadix', 'floatRange', 'floor', 'fmap', 'foldl', 'foldl1', 'foldr', 'foldr1', 'fromDouble', 'fromEnum', 'fromInt', 'fromInteger', 'fromIntegral', 'fromRational', 'fst', 'gcd', 'getChar', 'getContents', 'getLine', 'head', 'id', 'inRange', 'index', 'init', 'intToDigit', 'interact', 'ioError', 'isAlpha', 'isAlphaNum', 'isAscii', 'isControl', 'isDenormalized', 'isDigit', 'isHexDigit', 'isIEEE', 'isInfinite', 'isLower', 'isNaN', 'isNegativeZero', 'isOctDigit', 'isPrint', 'isSpace', 'isUpper', 'iterate', 'last', 'lcm', 'length', 'lex', 'lexDigits', 'lexLitChar', 'lines', 'log', 'logBase', 'lookup', 'map', 'mapM', 'mapM_', 'max', 'maxBound', 'maximum', 'maybe', 'min', 'minBound', 'minimum', 'mod', 'negate', 'not', 'notElem', 'null', 'numerator', 'odd', 'or', 'ord', 'otherwise', 'pi', 'pred', 'primExitWith', 'print', 'product', 'properFraction', 'putChar', 'putStr', 'putStrLn', 'quot', 'quotRem', 'range', 'rangeSize', 'read', 'readDec', 'readFile', 'readFloat', 'readHex', 'readIO', 'readInt', 'readList', 'readLitChar', 'readLn', 'readOct', 'readParen', 'readSigned', 'reads', 'readsPrec', 'realToFrac', 'recip', 'rem', 'repeat', 'replicate', 'return', 'reverse', 'round', 'scaleFloat', 'scanl', 'scanl1', 'scanr', 'scanr1', 'seq', 'sequence', 'sequence_', 'show', 'showChar', 'showInt', 'showList', 'showLitChar', 'showParen', 'showSigned', 'showString', 'shows', 'showsPrec', 'significand', 'signum', 'sin', 'sinh', 'snd', 'span', 'splitAt', 'sqrt', 'subtract', 'succ', 'sum', 'tail', 'take', 'takeWhile', 'tan', 'tanh', 'threadToIOResult', 'toEnum', 'toInt', 'toInteger', 'toLower', 'toRational', 'toUpper', 'truncate', 'uncurry', 'undefined', 'unlines', 'until', 'unwords', 'unzip', 'unzip3', 'userError', 'words', 'writeFile', 'zip', 'zip3', 'zipWith', 'zipWith3', ); $self->listAdd('infix operators', 'div', 'elem', 'mod', 'notElem', 'quot', 'rem', 'seq', ); $self->listAdd('keywords', 'case', 'class', 'data', 'deriving', 'do', 'else', 'if', 'in', 'infixl', 'infixr', 'instance', 'let', 'module', 'of', 'primitive', 'then', 'type', 'where', ); $self->listAdd('type constructors', 'Bool', 'Char', 'Double', 'Either', 'Float', 'IO', 'Int', 'Integer', 'Maybe', 'Ordering', 'Ratio', 'Rational', 'ReadS', 'ShowS', 'String', ); $self->contextdata({ 'comment_multi_line' => { callback => \&parsecomment_multi_line, attribute => 'Comment', }, 'comment_single_line' => { callback => \&parsecomment_single_line, attribute => 'Comment', lineending => '#pop', }, 'function_definition' => { callback => \&parsefunction_definition, attribute => 'Function Definition', lineending => '#pop', }, 'infix' => { callback => \&parseinfix, attribute => 'Infix Operator', }, 'normal' => { callback => \&parsenormal, attribute => 'Normal Text', }, 'single_char' => { callback => \&parsesingle_char, attribute => 'Char', lineending => '#pop', }, 'string' => { callback => \&parsestring, attribute => 'String', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Haskell'; } sub parsecomment_multi_line { my ($self, $text) = @_; # attribute => 'Comment' # char => '-' # char1 => '}' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '-', '}', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parsecomment_single_line { my ($self, $text) = @_; return 0; }; sub parsefunction_definition { my ($self, $text) = @_; # attribute => 'Function Definition' # char => ';' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'Function Definition')) { return 1 } return 0; }; sub parseinfix { my ($self, $text) = @_; # attribute => 'Infix Operator' # char => '`' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, '#pop', 'Infix Operator')) { return 1 } return 0; }; sub parsenormal { my ($self, $text) = @_; # attribute => 'Comment' # char => '{' # char1 => '-' # context => 'comment_multi_line' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '{', '-', 0, 0, 0, undef, 0, 'comment_multi_line', 'Comment')) { return 1 } # attribute => 'Comment' # char => '-' # char1 => '-' # context => 'comment_single_line' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, 'comment_single_line', 'Comment')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'classes' # attribute => 'Class' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'classes', 0, undef, 0, '#stay', 'Class')) { return 1 } # String => 'type constructors' # attribute => 'Type Constructor' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'type constructors', 0, undef, 0, '#stay', 'Type Constructor')) { return 1 } # String => 'functions' # attribute => 'Function' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) { return 1 } # String => 'data constructors' # attribute => 'Data Constructor' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'data constructors', 0, undef, 0, '#stay', 'Data Constructor')) { return 1 } # attribute => 'String' # char => '"' # context => 'string' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'String')) { return 1 } # attribute => 'Infix Operator' # char => '`' # context => 'infix' # type => 'DetectChar' if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, 'infix', 'Infix Operator')) { return 1 } # String => '\w[']+' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\w[\']+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Char' # char => ''' # context => 'single_char' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'single_char', 'Char')) { return 1 } # String => '[a-z_]+\w*'*\s*::' # attribute => 'Function Definition' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[a-z_]+\\w*\'*\\s*::', 0, 0, 0, undef, 0, '#stay', 'Function Definition')) { return 1 } # attribute => 'Float' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { return 1 } # attribute => 'Decimal' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { return 1 } return 0; }; sub parsesingle_char { my ($self, $text) = @_; # String => '\\.' # attribute => 'Char' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'Char' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Char')) { return 1 } return 0; }; sub parsestring { my ($self, $text) = @_; # String => '\\.' # attribute => 'String' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'String')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Haskell - a Plugin for Haskell syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Haskell; my $sh = new Syntax::Highlight::Engine::Kate::Haskell([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Haskell is a plugin module that provides syntax highlighting for Haskell to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/CMake.pm0000644000175000017500000002106413226470762025640 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'cmake.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.02 #kate version 2.4 #generated: Sun Feb 3 22:02:04 2008, localtime package Syntax::Highlight::Engine::Kate::CMake; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Commands' => 'Keyword', 'Comment' => 'Comment', 'Macros' => 'Keyword', 'Normal Text' => 'Normal', 'Region Marker' => 'RegionMarker', 'Special Args' => 'Others', 'Variable' => 'DecVal', }); $self->listAdd('commands', 'ABSTRACT_FILES', 'ADD_CUSTOM_COMMAND', 'ADD_CUSTOM_TARGET', 'ADD_DEFINITIONS', 'ADD_DEPENDENCIES', 'ADD_EXECUTABLE', 'ADD_LIBRARY', 'ADD_TEST', 'AUX_SOURCE_DIRECTORY', 'BUILD_COMMAND', 'BUILD_NAME', 'CMAKE_MINIMUM_REQUIRED', 'CONFIGURE_FILE', 'CREATE_TEST_SOURCELIST', 'ELSE', 'ENABLE_TESTING', 'ENDFOREACH', 'ENDIF', 'ENDMACRO', 'EXEC_PROGRAM', 'EXPORT_LIBRARY_DEPENDENCIES', 'FILE', 'FIND_FILE', 'FIND_LIBRARY', 'FIND_PACKAGE', 'FIND_PATH', 'FIND_PROGRAM', 'FLTK_WRAP_UI', 'FOREACH', 'GET_CMAKE_PROPERTY', 'GET_DIRECTORY_PROPERTY', 'GET_FILENAME_COMPONENT', 'GET_SOURCE_FILE_PROPERTY', 'GET_TARGET_PROPERTY', 'IF', 'INCLUDE', 'INCLUDE_DIRECTORIES', 'INCLUDE_EXTERNAL_MSPROJECT', 'INCLUDE_REGULAR_EXPRESSION', 'INSTALL_FILES', 'INSTALL_PROGRAMS', 'INSTALL_TARGETS', 'ITK_WRAP_TCL', 'LINK_DIRECTORIE', 'LINK_LIBRARIES', 'LOAD_CACHE', 'LOAD_COMMAND', 'MACRO', 'MAKE_DIRECTORY', 'MARK_AS_ADVANCED', 'MESSAGE', 'OPTION', 'OUTPUT_REQUIRED_FILES', 'PROJECT', 'QT_WRAP_CPP', 'QT_WRAP_UI', 'REMOVE', 'REMOVE_DEFINITIONS', 'SEPARATE_ARGUMENTS', 'SET', 'SET_DIRECTORY_PROPERTIES', 'SET_SOURCE_FILES_PROPERTIES', 'SET_TARGET_PROPERTIES', 'SITE_NAME', 'SOURCE_FILES', 'SOURCE_FILES_REMOVE', 'SOURCE_GROUP', 'STRING', 'SUBDIRS', 'SUBDIR_DEPENDS', 'TARGET_LINK_LIBRARIES', 'TRY_COMPILE', 'TRY_RUN', 'USE_MANGLED_MESA', 'UTILITY_SOURCE', 'VARIABLE_REQUIRES', 'VTK_MAKE_INSTANTIATOR', 'VTK_WRAP_JAVA', 'VTK_WRAP_PYTHON', 'VTK_WRAP_TCL', 'WRAP_EXCLUDE_FILES', 'WRITE_FILE', ); $self->listAdd('special_args', 'ABSOLUTE', 'ABSTRACT', 'ADDITIONAL_MAKE_CLEAN_FILES', 'ALL', 'AND', 'APPEND', 'ARGS', 'ASCII', 'BEFORE', 'CACHE', 'CACHE_VARIABLES', 'CLEAR', 'COMMAND', 'COMMANDS', 'COMMAND_NAME', 'COMMENT', 'COMPARE', 'COMPILE_FLAGS', 'COPYONLY', 'DEFINED', 'DEFINE_SYMBOL', 'DEPENDS', 'DOC', 'EQUAL', 'ESCAPE_QUOTES', 'EXCLUDE', 'EXCLUDE_FROM_ALL', 'EXISTS', 'EXPORT_MACRO', 'EXT', 'EXTRA_INCLUDE', 'FATAL_ERROR', 'FILE', 'FILES', 'FORCE', 'FUNCTION', 'GENERATED', 'GLOB', 'GLOB_RECURSE', 'GREATER', 'GROUP_SIZE', 'HEADER_FILE_ONLY', 'HEADER_LOCATION', 'IMMEDIATE', 'INCLUDES', 'INCLUDE_DIRECTORIES', 'INCLUDE_INTERNALS', 'INCLUDE_REGULAR_EXPRESSION', 'LESS', 'LINK_DIRECTORIES', 'LINK_FLAGS', 'LOCATION', 'MACOSX_BUNDLE', 'MACROS', 'MAIN_DEPENDENCY', 'MAKE_DIRECTORY', 'MATCH', 'MATCHALL', 'MATCHES', 'MODULE', 'NAME', 'NAME_WE', 'NOT', 'NOTEQUAL', 'NO_SYSTEM_PATH', 'OBJECT_DEPENDS', 'OPTIONAL', 'OR', 'OUTPUT', 'OUTPUT_VARIABLE', 'PATH', 'PATHS', 'POST_BUILD', 'POST_INSTALL_SCRIPT', 'PREFIX', 'PREORDER', 'PRE_BUILD', 'PRE_INSTALL_SCRIPT', 'PRE_LINK', 'PROGRAM', 'PROGRAM_ARGS', 'PROPERTIES', 'QUIET', 'RANGE', 'READ', 'REGEX', 'REGULAR_EXPRESSION', 'REPLACE', 'REQUIRED', 'RETURN_VALUE', 'RUNTIME_DIRECTORY', 'SEND_ERROR', 'SHARED', 'SOURCES', 'STATIC', 'STATUS', 'STREQUAL', 'STRGREATER', 'STRLESS', 'SUFFIX', 'TARGET', 'TOLOWER', 'TOUPPER', 'VAR', 'VARIABLES', 'VERSION', 'WIN32', 'WRAP_EXCLUDE', 'WRITE', ); $self->contextdata({ 'Function Args' => { callback => \&parseFunctionArgs, attribute => 'Normal Text', }, 'Normal Text' => { callback => \&parseNormalText, attribute => 'Normal Text', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal Text'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'CMake'; } sub parseFunctionArgs { my ($self, $text) = @_; # attribute => 'Normal Text' # char => ')' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } # String => 'special_args' # attribute => 'Special Args' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'special_args', 0, undef, 0, '#stay', 'Special Args')) { return 1 } # String => '#.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # String => '\$\{\s*\w+\s*\}' # attribute => 'Variable' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$\\{\\s*\\w+\\s*\\}', 0, 0, 0, undef, 0, '#stay', 'Variable')) { return 1 } return 0; }; sub parseNormalText { my ($self, $text) = @_; # String => 'commands' # attribute => 'Commands' # context => 'Function Args' # type => 'keyword' if ($self->testKeyword($text, 'commands', 0, undef, 0, 'Function Args', 'Commands')) { return 1 } # String => '#\s*BEGIN.*$' # attribute => 'Region Marker' # beginRegion => 'block' # context => '#stay' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*BEGIN.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { return 1 } # String => '#\s*END.*$' # attribute => 'Region Marker' # context => '#stay' # endRegion => 'block' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*END.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { return 1 } # String => '#.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # String => '\$\{\s*\w+\s*\}' # attribute => 'Variable' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$\\{\\s*\\w+\\s*\\}', 0, 0, 0, undef, 0, '#stay', 'Variable')) { return 1 } # String => '\s*\w+\s*(?=\(.*\))' # attribute => 'Macros' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*\\w+\\s*(?=\\(.*\\))', 0, 0, 0, undef, 0, '#stay', 'Macros')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::CMake - a Plugin for CMake syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::CMake; my $sh = new Syntax::Highlight::Engine::Kate::CMake([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::CMake is a plugin module that provides syntax highlighting for CMake to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Sather.pm0000644000175000017500000001330213226470762026102 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'sather.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.03 #kate version 2.1 #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::Sather; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Char' => 'Char', 'Comment' => 'Comment', 'Data Type' => 'DataType', 'Decimal' => 'DecVal', 'Features' => 'Others', 'Float' => 'Float', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'String' => 'String', }); $self->listAdd('features', 'aget', 'aset', 'create', 'div', 'invariant', 'is_eq', 'is_geq', 'is_gt', 'is_leq', 'is_lt', 'is_neq', 'main', 'minus', 'mod', 'negate', 'not', 'plus', 'pow', 'times', ); $self->listAdd('keywords', 'ITER', 'ROUT', 'SAME', 'abstract', 'and', 'any', 'assert', 'attr', 'bind', 'break!', 'case', 'class', 'const', 'else', 'elsif', 'end', 'exception', 'external', 'false', 'fork', 'guard', 'if', 'immutable', 'in', 'include', 'initial', 'inout', 'is', 'lock', 'loop', 'new', 'once', 'or', 'out', 'par', 'parloop', 'partial', 'post', 'pre', 'private', 'protect', 'quit', 'raise', 'readonly', 'result', 'return', 'self', 'shared', 'spread', 'stub', 'then', 'true', 'type', 'typecase', 'until!', 'value', 'void', 'when', 'while!', 'yield', ); $self->listAdd('types', '$OB', '$REHASH', 'AREF', 'ARRAY', 'AVAL', 'BOOL', 'CHAR', 'EXT_OB', 'FLT', 'FLTD', 'FLTDX', 'FLTI', 'FLTX', 'INT', 'INTI', 'STR', 'SYS', ); $self->contextdata({ 'Comment' => { callback => \&parseComment, attribute => 'Comment', lineending => '#pop', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'String' => { callback => \&parseString, attribute => 'String', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|\\$|\\!'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Sather'; } sub parseComment { my ($self, $text) = @_; return 0; }; sub parseNormal { my ($self, $text) = @_; # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'types' # attribute => 'Data Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => 'features' # attribute => 'Features' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'features', 0, undef, 0, '#stay', 'Features')) { return 1 } # attribute => 'Float' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { return 1 } # attribute => 'Decimal' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => ''.'' # attribute => 'Char' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\'.\'', 0, 0, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # attribute => 'Comment' # char => '-' # char1 => '-' # context => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { return 1 } return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Sather - a Plugin for Sather syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Sather; my $sh = new Syntax::Highlight::Engine::Kate::Sather([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Sather is a plugin module that provides syntax highlighting for Sather to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Inform.pm0000644000175000017500000004613613226470762026121 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'inform.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.23 #kate version 2.3 #kate author Giancarlo Niccolai (giancarlo@niccolai.ws) #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::Inform; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Actions' => 'DataType', 'Comment' => 'Comment', 'Function' => 'Function', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Number' => 'DecVal', 'OpCode' => 'Reserved', 'Operator' => 'Operator', 'Pragma' => 'Others', 'PredefFunction' => 'Function', 'String' => 'String', 'Values' => 'BaseN', 'Word' => 'IString', }); $self->listAdd('ClassDeclOps', 'has', 'private', 'with', ); $self->listAdd('actions', 'Answer', 'Ask', 'AskFor', 'Attack', 'Blow', 'Burn', 'Buy', 'Climb', 'Climb', 'Close', 'Consult', 'Cut', 'Dig', 'Disrobe', 'Drink', 'Drop', 'Eat', 'Empty', 'Empty', 'EmptyT', 'Enter', 'Examine', 'Exit', 'Fill', 'FullScore', 'GetOff', 'GetOff', 'Give', 'Go', 'GoIn', 'GoIn', 'Insert', 'Inv', 'Inv', 'InvTall', 'InvWide', 'Jump', 'JumpOn', 'Kiss', 'LMode1', 'LMode2', 'LMode3', 'LetGo', 'Listen', 'Lock', 'Look', 'Mild', 'No', 'NotifyOff', 'NotifyOn', 'Objects', 'Open', 'Places', 'Pray', 'Pronouns', 'Pull', 'Push', 'PushDir', 'PutOn', 'Quit', 'Receive', 'Restart', 'Restore', 'Rub', 'Save', 'Score', 'ScriptOff', 'ScriptOn', 'Search', 'Set', 'SetTo', 'Show', 'Sing', 'Sing', 'Sing', 'Sleep', 'Smell', 'Sorry', 'Squeeze', 'Strong', 'Swim', 'Swing', 'SwitchOff', 'SwitchOn', 'Take', 'Taste', 'Tell', 'Think', 'ThrowAt', 'ThrownAt', 'Tie', 'Touch', 'Transfer', 'Turn', 'Unlock', 'VagueGo', 'Verify', 'Version', 'Wave', 'WaveHands', 'Wear', 'Yes', ); $self->listAdd('functions', 'Achieved', 'AddToScope', 'CDefArt', 'ChangeDefault', 'DefArt', 'DoMenu', 'EnglishNumber', 'HasLightSource', 'InDefArt', 'Locale', 'LoopOverScope', 'NextWord', 'NextWordStopped', 'NounDomain', 'ObjectIsUntouchable', 'OffersLight', 'PlaceInScope', 'PlayerTo', 'PrintShortName', 'ScopeWithin', 'SetTime', 'StartDaemon', 'StartTimer', 'StopDaemon', 'StopTimer', 'TestScope', 'TryNumber', 'UnsignedCompare', 'WordAddress', 'WordLenght', 'WriteListFrom', 'YesOrNo', 'ZRegion', 'allowpushdir', 'child', 'children', 'metaclass', 'parent', ); $self->listAdd('inline_pragmas', '#else', '#endif', '#ifdef', '#ifndef', ); $self->listAdd('keywords', 'box', 'break', 'continue', 'do', 'else', 'font', 'for', 'give', 'if', 'inversion', 'jump', 'move', 'new_line', 'objectloop', 'on', 'print', 'print_ret', 'quit', 'read', 'remove', 'restore', 'return', 'rfalse', 'rtrue', 'save', 'spaces', 'spring', 'style', 'switch', 'to', 'until', ); $self->listAdd('operators', 'has', 'hasn\\\'t', 'in', 'notin', 'ofclass', 'or', 'provides', ); $self->listAdd('pragmas', 'Abbreviate', 'Array', 'Attribute', 'Constant', 'Default', 'End', 'Endif', 'Extend', 'Global', 'Ifdef', 'Iffalse', 'Iffalse', 'Ifndef', 'Ifnot', 'Ifnot', 'Iftrue', 'Iftrue', 'Import', 'Include', 'Link', 'Lowstring', 'Message', 'Property', 'Release', 'Replace', 'Serial', 'Statusline', 'Switches', 'System_file', 'Verb', 'score', ); $self->listAdd('special_vals', 'Routine', 'String', 'action', 'actor', 'actors_location', 'bold', 'buffer', 'consult_from', 'consult_words', 'false', 'fixed', 'location', 'nothing', 'noun', 'off', 'on', 'player', 'roman', 'score', 'second', 'self', 'sender', 'the_time', 'true', 'underline', 'wn', ); $self->contextdata({ 'ClassDecl' => { callback => \&parseClassDecl, attribute => 'Normal Text', lineending => 'ClassDecl_1', }, 'ClassDecl_1' => { callback => \&parseClassDecl_1, attribute => 'Normal Text', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'PropDefVal rules' => { callback => \&parsePropDefValrules, attribute => 'Normal Text', }, 'TopLevel' => { callback => \&parseTopLevel, attribute => 'Normal Text', }, 'comment' => { callback => \&parsecomment, attribute => 'Comment', lineending => '#pop', }, 'funcdef' => { callback => \&parsefuncdef, attribute => 'Normal Text', }, 'has_decl' => { callback => \&parsehas_decl, attribute => 'Normal Text', }, 'prop_def' => { callback => \&parseprop_def, attribute => 'Normal Text', }, 'prop_func_def' => { callback => \&parseprop_func_def, attribute => 'Normal Text', }, 'string' => { callback => \&parsestring, attribute => 'String', }, 'word' => { callback => \&parseword, attribute => 'Word', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('TopLevel'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Inform'; } sub parseClassDecl { my ($self, $text) = @_; # context => 'PropDefVal rules' # type => 'IncludeRules' if ($self->includeRules('PropDefVal rules', $text)) { return 1 } return 0; }; sub parseClassDecl_1 { my ($self, $text) = @_; # String => '^[\t ]*has ' # attribute => 'Keyword' # context => 'has_decl' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '^[\\t ]*has ', 1, 0, 0, undef, 0, 'has_decl', 'Keyword')) { return 1 } # String => 'ClassDeclOps' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'ClassDeclOps', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '[a-zA-Z_]+\w*' # attribute => 'Function' # context => 'prop_def' # type => 'RegExpr' if ($self->testRegExpr($text, '[a-zA-Z_]+\\w*', 0, 0, 0, undef, 0, 'prop_def', 'Function')) { return 1 } # attribute => 'Pragma' # char => ';' # context => '#pop' # endRegion => 'reg_class' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'Pragma')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # attribute => 'Comment' # char => '!' # context => 'comment' # type => 'DetectChar' if ($self->testDetectChar($text, '!', 0, 0, 0, undef, 0, 'comment', 'Comment')) { return 1 } # attribute => 'String' # char => '"' # context => 'string' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'String')) { return 1 } # attribute => 'Word' # char => ''' # context => 'word' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'word', 'Word')) { return 1 } # String => 'inline_pragmas' # attribute => 'Pragma' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'inline_pragmas', 0, undef, 0, '#stay', 'Pragma')) { return 1 } # String => '--?>' # attribute => 'Operator' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '--?>', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'actions' # attribute => 'Actions' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'actions', 0, undef, 0, '#stay', 'Actions')) { return 1 } # String => 'functions' # attribute => 'PredefFunction' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'PredefFunction')) { return 1 } # String => 'special_vals' # attribute => 'Values' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'special_vals', 0, undef, 0, '#stay', 'Values')) { return 1 } # String => 'operators' # attribute => 'Operator' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'operators', 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '##[a-zA-Z_]+\w*' # attribute => 'Actions' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '##[a-zA-Z_]+\\w*', 0, 0, 0, undef, 0, '#stay', 'Actions')) { return 1 } # String => '@[a-zA-Z_]+\w*' # attribute => 'OpCode' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '@[a-zA-Z_]+\\w*', 0, 0, 0, undef, 0, '#stay', 'OpCode')) { return 1 } # String => '\$[0-9a-fA-F]{1,4}' # attribute => 'Number' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$[0-9a-fA-F]{1,4}', 0, 0, 0, undef, 0, '#stay', 'Number')) { return 1 } # String => '[a-zA-Z_]+\w*' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[a-zA-Z_]+\\w*', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '\d+' # attribute => 'Number' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\d+', 0, 0, 0, undef, 0, '#stay', 'Number')) { return 1 } # attribute => 'Keyword' # beginRegion => 'reg_compound' # char => '{' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # attribute => 'Keyword' # char => '}' # context => '#stay' # endRegion => 'reg_compound' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '%&()+-<=>{|}~' # attribute => 'Operator' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '%&()+-<=>{|}~', 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } return 0; }; sub parsePropDefValrules { my ($self, $text) = @_; # attribute => 'Comment' # char => '!' # context => 'comment' # type => 'DetectChar' if ($self->testDetectChar($text, '!', 0, 0, 0, undef, 0, 'comment', 'Comment')) { return 1 } # attribute => 'String' # char => '"' # context => 'string' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'String')) { return 1 } # attribute => 'Word' # char => ''' # context => 'word' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'word', 'Word')) { return 1 } # attribute => 'Function' # beginRegion => 'reg_prop_def_func' # char => '[' # context => 'prop_func_def' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'prop_func_def', 'Function')) { return 1 } # attribute => 'Operator' # char => ',' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ',', 0, 0, 0, undef, 0, '#pop', 'Operator')) { return 1 } # String => '\$[0-9a-fA-F]{1,4}' # attribute => 'Number' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$[0-9a-fA-F]{1,4}', 0, 0, 0, undef, 0, '#stay', 'Number')) { return 1 } # String => '\d+' # attribute => 'Number' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\d+', 0, 0, 0, undef, 0, '#stay', 'Number')) { return 1 } return 0; }; sub parseTopLevel { my ($self, $text) = @_; # attribute => 'Comment' # char => '!' # context => 'comment' # type => 'DetectChar' if ($self->testDetectChar($text, '!', 0, 0, 0, undef, 0, 'comment', 'Comment')) { return 1 } # attribute => 'String' # char => '"' # context => 'string' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'String')) { return 1 } # String => '[[]\s*[a-zA-Z_]+\w*' # attribute => 'Function' # beginRegion => 'reg_function' # context => 'funcdef' # type => 'RegExpr' if ($self->testRegExpr($text, '[[]\\s*[a-zA-Z_]+\\w*', 0, 0, 0, undef, 0, 'funcdef', 'Function')) { return 1 } # String => ' *object | *class ' # attribute => 'Pragma' # beginRegion => 'reg_class' # column => '0' # context => 'ClassDecl' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, ' *object | *class ', 1, 0, 0, 0, 0, 'ClassDecl', 'Pragma')) { return 1 } # String => 'pragmas' # attribute => 'Pragma' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'pragmas', 0, undef, 0, '#stay', 'Pragma')) { return 1 } # String => 'inline_pragmas' # attribute => 'Pragma' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'inline_pragmas', 0, undef, 0, '#stay', 'Pragma')) { return 1 } # String => '--?>' # attribute => 'Operator' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '--?>', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '[a-zA-Z_]+\d*' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[a-zA-Z_]+\\d*', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '\$[0-9a-fA-F]{1,4}' # attribute => 'Number' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$[0-9a-fA-F]{1,4}', 0, 0, 0, undef, 0, '#stay', 'Number')) { return 1 } # String => '\d+' # attribute => 'Number' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\d+', 0, 0, 0, undef, 0, '#stay', 'Number')) { return 1 } return 0; }; sub parsecomment { my ($self, $text) = @_; return 0; }; sub parsefuncdef { my ($self, $text) = @_; # context => 'Normal' # type => 'IncludeRules' if ($self->includeRules('Normal', $text)) { return 1 } # attribute => 'Function' # char => ']' # char1 => ';' # context => '#pop' # endRegion => 'reg_function' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, ']', ';', 0, 0, 0, undef, 0, '#pop', 'Function')) { return 1 } return 0; }; sub parsehas_decl { my ($self, $text) = @_; # attribute => 'Pragma' # char => ';' # context => '#pop#pop#pop' # endRegion => 'reg_class' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Pragma')) { return 1 } # context => 'PropDefVal rules' # type => 'IncludeRules' if ($self->includeRules('PropDefVal rules', $text)) { return 1 } return 0; }; sub parseprop_def { my ($self, $text) = @_; # attribute => 'Function' # char => ',' # context => '#pop' # endRegion => 'reg_prop' # type => 'DetectChar' if ($self->testDetectChar($text, ',', 0, 0, 0, undef, 0, '#pop', 'Function')) { return 1 } # attribute => 'Pragma' # char => ';' # context => '#pop#pop#pop' # endRegion => 'reg_class' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Pragma')) { return 1 } # attribute => 'Function' # beginRegion => 'reg_prop_func' # char => '[' # context => 'prop_func_def' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'prop_func_def', 'Function')) { return 1 } # context => 'PropDefVal rules' # type => 'IncludeRules' if ($self->includeRules('PropDefVal rules', $text)) { return 1 } return 0; }; sub parseprop_func_def { my ($self, $text) = @_; # attribute => 'Function' # char => ']' # context => '#pop' # endRegion => 'reg_prop_func' # type => 'DetectChar' if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Function')) { return 1 } # context => 'Normal' # type => 'IncludeRules' if ($self->includeRules('Normal', $text)) { return 1 } return 0; }; sub parsestring { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; sub parseword { my ($self, $text) = @_; # attribute => 'Word' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Word')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Inform - a Plugin for Inform syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Inform; my $sh = new Syntax::Highlight::Engine::Kate::Inform([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Inform is a plugin module that provides syntax highlighting for Inform to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Debian_Control.pm0000644000175000017500000002127013226470762027541 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'debiancontrol.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 0.82 #kate version 2.4 #generated: Sun Feb 3 22:02:04 2008, localtime package Syntax::Highlight::Engine::Kate::Debian_Control; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Email' => 'Others', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Value' => 'DataType', 'Variable' => 'Others', 'Version' => 'DecVal', }); $self->contextdata({ 'Constrain' => { callback => \&parseConstrain, attribute => 'Version', }, 'DependencyField' => { callback => \&parseDependencyField, attribute => 'Value', lineending => '#pop', }, 'Field' => { callback => \&parseField, attribute => 'Value', lineending => '#pop', }, 'Variable' => { callback => \&parseVariable, attribute => 'Variable', lineending => '#pop', }, 'noname' => { callback => \&parsenoname, attribute => 'Normal Text', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('noname'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Debian Control'; } sub parseConstrain { my ($self, $text) = @_; # attribute => 'Keyword' # char => '$' # char1 => '{' # context => 'Variable' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '$', '{', 0, 0, 0, undef, 0, 'Variable', 'Keyword')) { return 1 } # String => '[!<=>]' # attribute => 'Keyword' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[!<=>]', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # attribute => 'Keyword' # char => ')' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Keyword')) { return 1 } # attribute => 'Keyword' # char => ']' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Keyword')) { return 1 } return 0; }; sub parseDependencyField { my ($self, $text) = @_; # String => '<.*@.*>' # attribute => 'Email' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '<.*@.*>', 0, 0, 0, undef, 0, '#stay', 'Email')) { return 1 } # attribute => 'Keyword' # char => '$' # char1 => '{' # context => 'Variable' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '$', '{', 0, 0, 0, undef, 0, 'Variable', 'Keyword')) { return 1 } # String => '[,\|]' # attribute => 'Keyword' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[,\\|]', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # attribute => 'Keyword' # char => '(' # context => 'Constrain' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'Constrain', 'Keyword')) { return 1 } # attribute => 'Keyword' # char => '[' # context => 'Constrain' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'Constrain', 'Keyword')) { return 1 } return 0; }; sub parseField { my ($self, $text) = @_; # String => '<.*@.*>' # attribute => 'Email' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '<.*@.*>', 0, 0, 0, undef, 0, '#stay', 'Email')) { return 1 } # attribute => 'Keyword' # char => '$' # char1 => '{' # context => 'Variable' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '$', '{', 0, 0, 0, undef, 0, 'Variable', 'Keyword')) { return 1 } return 0; }; sub parseVariable { my ($self, $text) = @_; # attribute => 'Keyword' # char => '}' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Keyword')) { return 1 } return 0; }; sub parsenoname { my ($self, $text) = @_; # String => 'Depends:' # attribute => 'Keyword' # context => 'DependencyField' # type => 'StringDetect' if ($self->testStringDetect($text, 'Depends:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) { return 1 } # String => 'Recommends:' # attribute => 'Keyword' # context => 'DependencyField' # type => 'StringDetect' if ($self->testStringDetect($text, 'Recommends:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) { return 1 } # String => 'Suggests:' # attribute => 'Keyword' # context => 'DependencyField' # type => 'StringDetect' if ($self->testStringDetect($text, 'Suggests:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) { return 1 } # String => 'Conflicts:' # attribute => 'Keyword' # context => 'DependencyField' # type => 'StringDetect' if ($self->testStringDetect($text, 'Conflicts:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) { return 1 } # String => 'Provides:' # attribute => 'Keyword' # context => 'DependencyField' # type => 'StringDetect' if ($self->testStringDetect($text, 'Provides:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) { return 1 } # String => 'Replaces:' # attribute => 'Keyword' # context => 'DependencyField' # type => 'StringDetect' if ($self->testStringDetect($text, 'Replaces:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) { return 1 } # String => 'Enhances:' # attribute => 'Keyword' # context => 'DependencyField' # type => 'StringDetect' if ($self->testStringDetect($text, 'Enhances:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) { return 1 } # String => 'Pre-Depends:' # attribute => 'Keyword' # context => 'DependencyField' # type => 'StringDetect' if ($self->testStringDetect($text, 'Pre-Depends:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) { return 1 } # String => 'Build-Depends:' # attribute => 'Keyword' # context => 'DependencyField' # type => 'StringDetect' if ($self->testStringDetect($text, 'Build-Depends:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) { return 1 } # String => 'Build-Depends-Indep:' # attribute => 'Keyword' # context => 'DependencyField' # type => 'StringDetect' if ($self->testStringDetect($text, 'Build-Depends-Indep:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) { return 1 } # String => 'Build-Conflicts:' # attribute => 'Keyword' # context => 'DependencyField' # type => 'StringDetect' if ($self->testStringDetect($text, 'Build-Conflicts:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) { return 1 } # String => 'Build-Conflicts-Indep:' # attribute => 'Keyword' # context => 'DependencyField' # type => 'StringDetect' if ($self->testStringDetect($text, 'Build-Conflicts-Indep:', 0, 0, 0, undef, 0, 'DependencyField', 'Keyword')) { return 1 } # String => '[^ ]*:' # attribute => 'Keyword' # column => '0' # context => 'Field' # minimal => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '[^ ]*?:', 0, 0, 0, 0, 0, 'Field', 'Keyword')) { return 1 } # attribute => 'Value' # char => ' ' # column => '0' # context => 'Field' # type => 'DetectChar' if ($self->testDetectChar($text, ' ', 0, 0, 0, 0, 0, 'Field', 'Value')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Debian_Control - a Plugin for Debian Control syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Debian_Control; my $sh = new Syntax::Highlight::Engine::Kate::Debian_Control([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Debian_Control is a plugin module that provides syntax highlighting for Debian Control to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Kate_File_Template.pm0000644000175000017500000001471013226470762030336 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'katetemplate.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.00 #kate version 2.3 #kate author Anders Lund #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::Kate_File_Template; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Comment' => 'Comment', 'Error' => 'Error', 'Escape' => 'Others', 'Header Keyword' => 'Operator', 'Header Text' => 'Normal', 'Keyword' => 'Keyword', 'Macro' => 'DataType', 'Normal Text' => 'Normal', 'Property' => 'DecVal', 'Property Value' => 'String', }); $self->listAdd('macros', 'date', 'datetime', 'email', 'month', 'organisation', 'realname', 'time', 'username', 'year', ); $self->listAdd('properties', 'author', 'description', 'documentname', 'group', 'highlight', 'icon', 'template', ); $self->contextdata({ 'Normal Text' => { callback => \&parseNormalText, attribute => 'Normal Text', lineending => '#pop', }, 'escape' => { callback => \&parseescape, attribute => 'Escape', }, 'header' => { callback => \&parseheader, attribute => 'Comment', lineending => '#pop', }, 'headervalue' => { callback => \&parseheadervalue, attribute => 'Property Value', lineending => '#pop#pop', }, 'macros' => { callback => \&parsemacros, attribute => 'Error', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal Text'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Kate File Template'; } sub parseNormalText { my ($self, $text) = @_; # String => '^katetemplate:' # attribute => 'Header Keyword' # context => 'header' # type => 'RegExpr' if ($self->testRegExpr($text, '^katetemplate:', 0, 0, 0, undef, 0, 'header', 'Header Keyword')) { return 1 } # String => '\\[$%]\{[^}\s]+\}' # attribute => 'Normal' # context => 'escape' # lookAhead => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\[$%]\\{[^}\\s]+\\}', 0, 0, 1, undef, 0, 'escape', 'Normal')) { return 1 } # String => '[$%]\{[^}\s]+\}' # attribute => 'Macro' # context => 'macros' # lookAhead => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '[$%]\\{[^}\\s]+\\}', 0, 0, 1, undef, 0, 'macros', 'Macro')) { return 1 } # attribute => 'Escape' # char => '\' # char1 => '^' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '^', 0, 0, 0, undef, 0, '#stay', 'Escape')) { return 1 } # attribute => 'Keyword' # char => '^' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '^', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } return 0; }; sub parseescape { my ($self, $text) = @_; # attribute => 'Escape' # char => '\' # char1 => '$' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '$', 0, 0, 0, undef, 0, '#pop', 'Escape')) { return 1 } return 0; }; sub parseheader { my ($self, $text) = @_; # String => 'properties' # attribute => 'Property' # context => 'headervalue' # type => 'keyword' if ($self->testKeyword($text, 'properties', 0, undef, 0, 'headervalue', 'Property')) { return 1 } return 0; }; sub parseheadervalue { my ($self, $text) = @_; # attribute => 'Header Text' # char => '=' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, '#stay', 'Header Text')) { return 1 } # String => ' \w+\s*=' # context => '#pop' # lookAhead => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, ' \\w+\\s*=', 0, 0, 1, undef, 0, '#pop', undef)) { return 1 } return 0; }; sub parsemacros { my ($self, $text) = @_; # attribute => 'Keyword' # char => '$' # char1 => '{' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '$', '{', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # attribute => 'Keyword' # char => '%' # char1 => '{' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '%', '{', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # attribute => 'Keyword' # char => '}' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Keyword')) { return 1 } # String => '[^}\s]+' # attribute => 'Macro' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[^}\\s]+', 0, 0, 0, undef, 0, '#stay', 'Macro')) { return 1 } # String => 'macros' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'macros', 0, undef, 0, '#stay', 'Keyword')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Kate_File_Template - a Plugin for Kate File Template syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Kate_File_Template; my $sh = new Syntax::Highlight::Engine::Kate::Kate_File_Template([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Kate_File_Template is a plugin module that provides syntax highlighting for Kate File Template to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/BaseTestchild.pm0000644000175000017500000000031213226470762027367 0ustar manwarmanwarpackage Syntax::Highlight::Engine::Kate::BaseTestchild; our $VERSION = '0.14'; use strict; use warnings; # stub, just to get indexed by PAUSE and hide old version of this file from CPAN smokers. 1; Syntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Tcl_Tk.pm0000644000175000017500000003354513226470762026047 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'tcl.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.08 #kate version 2.4 #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::Tcl_Tk; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Char' => 'Char', 'Comment' => 'Comment', 'Decimal' => 'DecVal', 'Float' => 'Float', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Parameter' => 'Others', 'Region Marker' => 'RegionMarker', 'String' => 'String', 'Variable' => 'DataType', }); $self->listAdd('keywords', 'AppleScript', 'OptProc', 'after', 'append', 'argc', 'argv', 'array', 'auto_execk', 'auto_load', 'auto_mkindex', 'auto_path', 'auto_reset', 'beep', 'bell', 'bgerror', 'binary', 'bind', 'bindtags', 'break', 'button', 'canvas', 'case', 'catch', 'cd', 'checkbutton', 'clipboard', 'clock', 'close', 'concat', 'console', 'continue', 'dde', 'destroy', 'else', 'elseif', 'encoding', 'entry', 'env', 'eof', 'error', 'errorCode', 'errorInfo', 'eval', 'event', 'exec', 'exit', 'expr', 'fblocked', 'fconfigure', 'fcopy', 'file', 'fileevent', 'flush', 'focus', 'font', 'for', 'foreach', 'format', 'frame', 'gets', 'glob', 'global', 'grab', 'grid', 'history', 'if', 'image', 'incr', 'info', 'interp', 'join', 'label', 'lappend', 'lindex', 'linsert', 'list', 'listbox', 'llength', 'load', 'lower', 'lrange', 'lreplace', 'lsearch', 'lsort', 'menu', 'menubutton', 'message', 'namespace', 'open', 'option', 'pack', 'package', 'parray', 'pid', 'pkg_mkindex', 'place', 'proc', 'puts', 'pwd', 'radiobutton', 'raise', 'read', 'regexp', 'registry', 'regsub', 'rename', 'resource', 'return', 'scale', 'scan', 'scrollbar', 'seek', 'selection', 'send', 'set', 'socket', 'source', 'split', 'string', 'subst', 'switch', 'tclLog', 'tcl_endOfWord', 'tcl_findLibrary', 'tcl_library', 'tcl_patchLevel', 'tcl_platform', 'tcl_precision', 'tcl_rcFileName', 'tcl_rcRsrcName', 'tcl_startOfNextWord', 'tcl_startOfPreviousWord', 'tcl_traceCompile', 'tcl_traceExec', 'tcl_version', 'tcl_wordBreakAfter', 'tcl_wordBreakBefore', 'tell', 'text', 'time', 'tk', 'tkTabToWindow', 'tk_chooseColor', 'tk_chooseDirectory', 'tk_focusFollowMouse', 'tk_focusNext', 'tk_focusPrev', 'tk_getOpenFile', 'tk_getSaveFile', 'tk_library', 'tk_messageBox', 'tk_optionMenu', 'tk_patchLevel', 'tk_popup', 'tk_strictMotif', 'tk_version', 'tkwait', 'toplevel', 'trace', 'unknown', 'unset', 'update', 'uplevel', 'upvar', 'variable', 'vwait', 'while', 'winfo', 'wm', ); $self->listAdd('keywords-opt', 'activate', 'actual', 'add', 'addtag', 'append', 'appname', 'args', 'aspect', 'atime', 'atom', 'atomname', 'attributes', 'bbox', 'bind', 'body', 'broadcast', 'bytelength', 'cancel', 'canvasx', 'canvasy', 'caret', 'cells', 'cget', 'channels', 'children', 'class', 'clear', 'clicks', 'client', 'clone', 'cmdcount', 'colormapfull', 'colormapwindows', 'command', 'commands', 'compare', 'complete', 'configure', 'containing', 'convertfrom', 'convertto', 'coords', 'copy', 'create', 'current', 'curselection', 'dchars', 'debug', 'default', 'deiconify', 'delete', 'delta', 'depth', 'deselect', 'dirname', 'dlineinfo', 'dtag', 'dump', 'edit', 'entrycget', 'entryconfigure', 'equal', 'executable', 'exists', 'extension', 'families', 'find', 'first', 'flash', 'focus', 'focusmodel', 'forget', 'format', 'fpixels', 'fraction', 'frame', 'functions', 'generate', 'geometry', 'get', 'gettags', 'globals', 'grid', 'group', 'handle', 'height', 'hide', 'hostname', 'iconbitmap', 'iconify', 'iconmask', 'iconname', 'iconposition', 'iconwindow', 'icursor', 'id', 'identify', 'idle', 'ifneeded', 'image', 'index', 'info', 'insert', 'interps', 'inuse', 'invoke', 'is', 'isdirectory', 'isfile', 'ismapped', 'itemcget', 'itemconfigure', 'join', 'keys', 'last', 'length', 'level', 'library', 'link', 'loaded', 'locals', 'lower', 'lstat', 'manager', 'map', 'mark', 'match', 'maxsize', 'measure', 'metrics', 'minsize', 'mkdir', 'move', 'mtime', 'name', 'nameofexecutable', 'names', 'nativename', 'nearest', 'normalize', 'number', 'overrideredirect', 'own', 'owned', 'panecget', 'paneconfigure', 'panes', 'parent', 'patchlevel', 'pathname', 'pathtype', 'pixels', 'pointerx', 'pointerxy', 'pointery', 'positionfrom', 'post', 'postcascade', 'postscript', 'present', 'procs', 'protocol', 'provide', 'proxy', 'raise', 'range', 'readable', 'readlink', 'release', 'remove', 'rename', 'repeat', 'replace', 'reqheight', 'require', 'reqwidth', 'resizable', 'rgb', 'rootname', 'rootx', 'rooty', 'scale', 'scaling', 'scan', 'screen', 'screencells', 'screendepth', 'screenheight', 'screenmmheight', 'screenmmwidth', 'screenvisual', 'screenwidth', 'script', 'search', 'seconds', 'see', 'select', 'selection', 'separator', 'server', 'set', 'sharedlibextension', 'show', 'size', 'sizefrom', 'split', 'stackorder', 'stat', 'state', 'status', 'system', 'tag', 'tail', 'tclversion', 'title', 'tolower', 'toplevel', 'totitle', 'toupper', 'transient', 'trim', 'trimleft', 'trimright', 'type', 'types', 'unknown', 'unpost', 'useinputmethods', 'validate', 'values', 'variable', 'vars', 'vcompare', 'vdelete', 'versions', 'viewable', 'vinfo', 'visual', 'visualid', 'visualsavailable', 'volumes', 'vrootheight', 'vrootwidth', 'vrootx', 'vrooty', 'vsatisfies', 'width', 'window', 'windowingsystem', 'withdraw', 'wordend', 'wordstart', 'writable', 'x', 'xview', 'y', ); $self->contextdata({ 'Base' => { callback => \&parseBase, attribute => 'Normal Text', }, 'String' => { callback => \&parseString, attribute => 'String', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Base'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Tcl/Tk'; } sub parseBase { my ($self, $text) = @_; # String => '#\s*BEGIN.*$' # attribute => 'Region Marker' # beginRegion => 'region' # context => '#stay' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*BEGIN.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { return 1 } # String => '#\s*END.*$' # attribute => 'Region Marker' # context => '#stay' # endRegion => 'region' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*END.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'keywords-opt' # attribute => 'Parameter' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords-opt', 0, undef, 0, '#stay', 'Parameter')) { return 1 } # attribute => 'Float' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { return 1 } # attribute => 'Decimal' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => '\\.' # attribute => 'Char' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'Char')) { return 1 } # String => '\W-\w+' # attribute => 'Parameter' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\W-\\w+', 0, 0, 0, undef, 0, '#stay', 'Parameter')) { return 1 } # String => '\$\{[^\}]+\}' # attribute => 'Variable' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$\\{[^\\}]+\\}', 0, 0, 0, undef, 0, '#stay', 'Variable')) { return 1 } # String => '\$(::)?[\S\D]\w+' # attribute => 'Variable' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$(::)?[\\S\\D]\\w+', 0, 0, 0, undef, 0, '#stay', 'Variable')) { return 1 } # String => '[^\\]""' # attribute => 'String' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[^\\\\]""', 0, 0, 0, undef, 0, '#stay', 'String')) { return 1 } # String => '[^\\]"' # attribute => 'String' # context => 'String' # type => 'RegExpr' if ($self->testRegExpr($text, '[^\\\\]"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # String => '#.*$' # attribute => 'Comment' # context => '#stay' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 1, '#stay', 'Comment')) { return 1 } # String => ';\s*#.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, ';\\s*#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # attribute => 'Keyword' # beginRegion => 'block' # char => '{' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # attribute => 'Keyword' # char => '}' # context => '#stay' # endRegion => 'block' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # attribute => 'Keyword' # char => '[' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # attribute => 'Keyword' # char => ']' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } return 0; }; sub parseString { my ($self, $text) = @_; # String => '\\.' # attribute => 'Char' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } # attribute => 'Variable' # char => '$' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '$', 0, 0, 0, undef, 0, '#stay', 'Variable')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Tcl_Tk - a Plugin for Tcl/Tk syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Tcl_Tk; my $sh = new Syntax::Highlight::Engine::Kate::Tcl_Tk([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Tcl_Tk is a plugin module that provides syntax highlighting for Tcl/Tk to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Pascal.pm0000644000175000017500000002462713226470762026073 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'pascal.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.20 #kate version 2.3 #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::Pascal; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Alert' => 'Alert', 'Comment' => 'Comment', 'Directive' => 'Others', 'ISO/Delphi Extended' => 'Function', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Number' => 'DecVal', 'String' => 'String', 'Type' => 'DataType', }); $self->listAdd('ISO/Delphi Extended', 'as', 'bindable', 'constructor', 'destructor', 'except', 'export', 'finally', 'implementation', 'import', 'inherited', 'inline', 'interface', 'is', 'module', 'on', 'only', 'otherwise', 'private', 'property', 'protected', 'public', 'qualified', 'raise', 'restricted', 'shl', 'shr', 'threadvar', 'try', ); $self->listAdd('attention', '###', 'FIXME', 'TODO', ); $self->listAdd('keywords', 'and', 'array', 'asm', 'at', 'automated', 'break', 'case', 'const', 'continue', 'dispinterface', 'dispose', 'div', 'do', 'downto', 'else', 'exit', 'false', 'file', 'finalization', 'for', 'function', 'goto', 'if', 'in', 'initialization', 'label', 'library', 'mod', 'new', 'nil', 'not', 'of', 'operator', 'or', 'packed', 'procedure', 'program', 'published', 'record', 'repeat', 'resourcestring', 'self', 'set', 'then', 'to', 'true', 'type', 'unit', 'until', 'uses', 'var', 'while', 'with', 'xor', ); $self->listAdd('types', 'AnsiChar', 'AnsiString', 'Boolean', 'Byte', 'ByteBool', 'Cardinal', 'Char', 'Comp', 'Currency', 'Double', 'Extended', 'File', 'Int64', 'Integer', 'LongBool', 'LongInt', 'LongWord', 'Pointer', 'Real', 'Real48', 'ShortInt', 'ShortString', 'Single', 'SmallInt', 'String', 'Text', 'Variant', 'WideChar', 'WideString', 'Word', 'WordBool', ); $self->contextdata({ 'Comment1' => { callback => \&parseComment1, attribute => 'Comment', }, 'Comment2' => { callback => \&parseComment2, attribute => 'Comment', }, 'Comment3' => { callback => \&parseComment3, attribute => 'Comment', lineending => '#pop', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'Prep1' => { callback => \&parsePrep1, attribute => 'Directive', lineending => '#pop', }, 'Prep2' => { callback => \&parsePrep2, attribute => 'Directive', lineending => '#pop', }, 'String' => { callback => \&parseString, attribute => 'String', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Pascal'; } sub parseComment1 { my ($self, $text) = @_; # String => 'attention' # attribute => 'Alert' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'attention', 0, undef, 0, '#stay', 'Alert')) { return 1 } # attribute => 'Comment' # char => '}' # context => '#pop' # endRegion => 'Region2' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseComment2 { my ($self, $text) = @_; # String => 'attention' # attribute => 'Alert' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'attention', 0, undef, 0, '#stay', 'Alert')) { return 1 } # attribute => 'Comment' # char => '*' # char1 => ')' # context => '#pop' # endRegion => 'Region3' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', ')', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseComment3 { my ($self, $text) = @_; # String => 'attention' # attribute => 'Alert' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'attention', 0, undef, 0, '#stay', 'Alert')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # String => '\b(begin|case|record)(?=(\{[^}]*(\}|$)|\(\*.*(\*\)|$))*([\s]|$|//))' # attribute => 'Keyword' # beginRegion => 'Region1' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(begin|case|record)(?=(\\{[^}]*(\\}|$)|\\(\\*.*(\\*\\)|$))*([\\s]|$|//))', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b((object|class)(?=(\(.*\))?(\{[^}]*(\}|$)|\(\*.*(\*\)|$))*;?([\s]|$|//))|try(?=(\{[^}]*(\}|$)|\(\*.*(\*\)|$))*([\s]|$|//)))' # attribute => 'ISO/Delphi Extended' # beginRegion => 'Region1' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b((object|class)(?=(\\(.*\\))?(\\{[^}]*(\\}|$)|\\(\\*.*(\\*\\)|$))*;?([\\s]|$|//))|try(?=(\\{[^}]*(\\}|$)|\\(\\*.*(\\*\\)|$))*([\\s]|$|//)))', 1, 0, 0, undef, 0, '#stay', 'ISO/Delphi Extended')) { return 1 } # String => '\bend(?=((\{[^}]*(\}|$)|\(\*.*(\*\)|$))*)([.;\s]|$)|//|$)' # attribute => 'Keyword' # context => '#stay' # endRegion => 'Region1' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bend(?=((\\{[^}]*(\\}|$)|\\(\\*.*(\\*\\)|$))*)([.;\\s]|$)|//|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'ISO/Delphi Extended' # attribute => 'ISO/Delphi Extended' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'ISO/Delphi Extended', 0, undef, 0, '#stay', 'ISO/Delphi Extended')) { return 1 } # String => 'types' # attribute => 'Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Type')) { return 1 } # attribute => 'Number' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Number')) { return 1 } # attribute => 'Number' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Number')) { return 1 } # attribute => 'String' # char => ''' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # String => '(*$' # attribute => 'Directive' # context => 'Prep1' # type => 'StringDetect' if ($self->testStringDetect($text, '(*$', 0, 0, 0, undef, 0, 'Prep1', 'Directive')) { return 1 } # attribute => 'Directive' # char => '{' # char1 => '$' # context => 'Prep2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '{', '$', 0, 0, 0, undef, 0, 'Prep2', 'Directive')) { return 1 } # attribute => 'Comment' # beginRegion => 'Region2' # char => '{' # context => 'Comment1' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'Comment1', 'Comment')) { return 1 } # attribute => 'Comment' # beginRegion => 'Region3' # char => '(' # char1 => '*' # context => 'Comment2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '(', '*', 0, 0, 0, undef, 0, 'Comment2', 'Comment')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Comment3' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment3', 'Comment')) { return 1 } return 0; }; sub parsePrep1 { my ($self, $text) = @_; # attribute => 'Directive' # char => '*' # char1 => ')' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', ')', 0, 0, 0, undef, 0, '#pop', 'Directive')) { return 1 } return 0; }; sub parsePrep2 { my ($self, $text) = @_; # attribute => 'Directive' # char => '}' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Directive')) { return 1 } return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Pascal - a Plugin for Pascal syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Pascal; my $sh = new Syntax::Highlight::Engine::Kate::Pascal([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Pascal is a plugin module that provides syntax highlighting for Pascal to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Java.pm0000644000175000017500000030431413226470762025543 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'java.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.15 #kate version 2.4 #kate author Alfredo Luiz Foltran Fialho (alfoltran@ig.com.br) #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::Java; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Char' => 'Char', 'Comment' => 'Comment', 'Data Type' => 'DataType', 'Decimal' => 'DecVal', 'Float' => 'Float', 'Function' => 'Function', 'Hex' => 'BaseN', 'Imports' => 'Keyword', 'Java15' => 'Normal', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Octal' => 'BaseN', 'PrintfString' => 'String', 'StaticImports' => 'Keyword', 'String' => 'String', 'String Char' => 'Char', 'Symbol' => 'Normal', }); $self->listAdd('java15', 'ACTIVE', 'ACTIVITY_COMPLETED', 'ACTIVITY_REQUIRED', 'ARG_IN', 'ARG_INOUT', 'ARG_OUT', 'AWTError', 'AWTEvent', 'AWTEventListener', 'AWTEventListenerProxy', 'AWTEventMulticaster', 'AWTException', 'AWTKeyStroke', 'AWTPermission', 'AbstractAction', 'AbstractBorder', 'AbstractButton', 'AbstractCellEditor', 'AbstractCollection', 'AbstractColorChooserPanel', 'AbstractDocument', 'AbstractDocument.AttributeContext', 'AbstractDocument.Content', 'AbstractDocument.ElementEdit', 'AbstractExecutorService', 'AbstractInterruptibleChannel', 'AbstractLayoutCache', 'AbstractLayoutCache.NodeDimensions', 'AbstractList', 'AbstractListModel', 'AbstractMap', 'AbstractMethodError', 'AbstractPreferences', 'AbstractQueue', 'AbstractQueuedSynchronizer', 'AbstractSelectableChannel', 'AbstractSelectionKey', 'AbstractSelector', 'AbstractSequentialList', 'AbstractSet', 'AbstractSpinnerModel', 'AbstractTableModel', 'AbstractUndoableEdit', 'AbstractWriter', 'AccessControlContext', 'AccessControlException', 'AccessController', 'AccessException', 'Accessible', 'AccessibleAction', 'AccessibleAttributeSequence', 'AccessibleBundle', 'AccessibleComponent', 'AccessibleContext', 'AccessibleEditableText', 'AccessibleExtendedComponent', 'AccessibleExtendedTable', 'AccessibleExtendedText', 'AccessibleHyperlink', 'AccessibleHypertext', 'AccessibleIcon', 'AccessibleKeyBinding', 'AccessibleObject', 'AccessibleRelation', 'AccessibleRelationSet', 'AccessibleResourceBundle', 'AccessibleRole', 'AccessibleSelection', 'AccessibleState', 'AccessibleStateSet', 'AccessibleStreamable', 'AccessibleTable', 'AccessibleTableModelChange', 'AccessibleText', 'AccessibleTextSequence', 'AccessibleValue', 'AccountException', 'AccountExpiredException', 'AccountLockedException', 'AccountNotFoundException', 'Acl', 'AclEntry', 'AclNotFoundException', 'Action', 'ActionEvent', 'ActionListener', 'ActionMap', 'ActionMapUIResource', 'Activatable', 'ActivateFailedException', 'ActivationDesc', 'ActivationException', 'ActivationGroup', 'ActivationGroupDesc', 'ActivationGroupDesc.CommandEnvironment', 'ActivationGroupID', 'ActivationGroup_Stub', 'ActivationID', 'ActivationInstantiator', 'ActivationMonitor', 'ActivationSystem', 'Activator', 'ActiveEvent', 'ActivityCompletedException', 'ActivityRequiredException', 'AdapterActivator', 'AdapterActivatorOperations', 'AdapterAlreadyExists', 'AdapterAlreadyExistsHelper', 'AdapterInactive', 'AdapterInactiveHelper', 'AdapterManagerIdHelper', 'AdapterNameHelper', 'AdapterNonExistent', 'AdapterNonExistentHelper', 'AdapterStateHelper', 'AddressHelper', 'Adjustable', 'AdjustmentEvent', 'AdjustmentListener', 'Adler32', 'AffineTransform', 'AffineTransformOp', 'AlgorithmParameterGenerator', 'AlgorithmParameterGeneratorSpi', 'AlgorithmParameterSpec', 'AlgorithmParameters', 'AlgorithmParametersSpi', 'AllPermission', 'AlphaComposite', 'AlreadyBound', 'AlreadyBoundException', 'AlreadyBoundHelper', 'AlreadyBoundHolder', 'AlreadyConnectedException', 'AncestorEvent', 'AncestorListener', 'AnnotatedElement', 'Annotation', 'Annotation', 'AnnotationFormatError', 'AnnotationTypeMismatchException', 'Any', 'AnyHolder', 'AnySeqHelper', 'AnySeqHelper', 'AnySeqHolder', 'AppConfigurationEntry', 'AppConfigurationEntry.LoginModuleControlFlag', 'Appendable', 'Applet', 'AppletContext', 'AppletInitializer', 'AppletStub', 'ApplicationException', 'Arc2D', 'Arc2D.Double', 'Arc2D.Float', 'Area', 'AreaAveragingScaleFilter', 'ArithmeticException', 'Array', 'Array', 'ArrayBlockingQueue', 'ArrayIndexOutOfBoundsException', 'ArrayList', 'ArrayStoreException', 'ArrayType', 'Arrays', 'AssertionError', 'AsyncBoxView', 'AsynchronousCloseException', 'AtomicBoolean', 'AtomicInteger', 'AtomicIntegerArray', 'AtomicIntegerFieldUpdater', 'AtomicLong', 'AtomicLongArray', 'AtomicLongFieldUpdater', 'AtomicMarkableReference', 'AtomicReference', 'AtomicReferenceArray', 'AtomicReferenceFieldUpdater', 'AtomicStampedReference', 'Attr', 'Attribute', 'Attribute', 'Attribute', 'AttributeChangeNotification', 'AttributeChangeNotificationFilter', 'AttributeException', 'AttributeInUseException', 'AttributeList', 'AttributeList', 'AttributeList', 'AttributeListImpl', 'AttributeModificationException', 'AttributeNotFoundException', 'AttributeSet', 'AttributeSet', 'AttributeSet.CharacterAttribute', 'AttributeSet.ColorAttribute', 'AttributeSet.FontAttribute', 'AttributeSet.ParagraphAttribute', 'AttributeSetUtilities', 'AttributeValueExp', 'AttributedCharacterIterator', 'AttributedCharacterIterator.Attribute', 'AttributedString', 'Attributes', 'Attributes', 'Attributes', 'Attributes.Name', 'Attributes2', 'Attributes2Impl', 'AttributesImpl', 'AudioClip', 'AudioFileFormat', 'AudioFileFormat.Type', 'AudioFileReader', 'AudioFileWriter', 'AudioFormat', 'AudioFormat.Encoding', 'AudioInputStream', 'AudioPermission', 'AudioSystem', 'AuthPermission', 'AuthProvider', 'AuthenticationException', 'AuthenticationException', 'AuthenticationNotSupportedException', 'Authenticator', 'Authenticator.RequestorType', 'AuthorizeCallback', 'Autoscroll', 'BAD_CONTEXT', 'BAD_INV_ORDER', 'BAD_OPERATION', 'BAD_PARAM', 'BAD_POLICY', 'BAD_POLICY_TYPE', 'BAD_POLICY_VALUE', 'BAD_QOS', 'BAD_TYPECODE', 'BMPImageWriteParam', 'BackingStoreException', 'BadAttributeValueExpException', 'BadBinaryOpValueExpException', 'BadKind', 'BadLocationException', 'BadPaddingException', 'BadStringOperationException', 'BandCombineOp', 'BandedSampleModel', 'BaseRowSet', 'BasicArrowButton', 'BasicAttribute', 'BasicAttributes', 'BasicBorders', 'BasicBorders.ButtonBorder', 'BasicBorders.FieldBorder', 'BasicBorders.MarginBorder', 'BasicBorders.MenuBarBorder', 'BasicBorders.RadioButtonBorder', 'BasicBorders.RolloverButtonBorder', 'BasicBorders.SplitPaneBorder', 'BasicBorders.ToggleButtonBorder', 'BasicButtonListener', 'BasicButtonUI', 'BasicCheckBoxMenuItemUI', 'BasicCheckBoxUI', 'BasicColorChooserUI', 'BasicComboBoxEditor', 'BasicComboBoxEditor.UIResource', 'BasicComboBoxRenderer', 'BasicComboBoxRenderer.UIResource', 'BasicComboBoxUI', 'BasicComboPopup', 'BasicControl', 'BasicDesktopIconUI', 'BasicDesktopPaneUI', 'BasicDirectoryModel', 'BasicEditorPaneUI', 'BasicFileChooserUI', 'BasicFormattedTextFieldUI', 'BasicGraphicsUtils', 'BasicHTML', 'BasicIconFactory', 'BasicInternalFrameTitlePane', 'BasicInternalFrameUI', 'BasicLabelUI', 'BasicListUI', 'BasicLookAndFeel', 'BasicMenuBarUI', 'BasicMenuItemUI', 'BasicMenuUI', 'BasicOptionPaneUI', 'BasicOptionPaneUI.ButtonAreaLayout', 'BasicPanelUI', 'BasicPasswordFieldUI', 'BasicPermission', 'BasicPopupMenuSeparatorUI', 'BasicPopupMenuUI', 'BasicProgressBarUI', 'BasicRadioButtonMenuItemUI', 'BasicRadioButtonUI', 'BasicRootPaneUI', 'BasicScrollBarUI', 'BasicScrollPaneUI', 'BasicSeparatorUI', 'BasicSliderUI', 'BasicSpinnerUI', 'BasicSplitPaneDivider', 'BasicSplitPaneUI', 'BasicStroke', 'BasicTabbedPaneUI', 'BasicTableHeaderUI', 'BasicTableUI', 'BasicTextAreaUI', 'BasicTextFieldUI', 'BasicTextPaneUI', 'BasicTextUI', 'BasicTextUI.BasicCaret', 'BasicTextUI.BasicHighlighter', 'BasicToggleButtonUI', 'BasicToolBarSeparatorUI', 'BasicToolBarUI', 'BasicToolTipUI', 'BasicTreeUI', 'BasicViewportUI', 'BatchUpdateException', 'BeanContext', 'BeanContextChild', 'BeanContextChildComponentProxy', 'BeanContextChildSupport', 'BeanContextContainerProxy', 'BeanContextEvent', 'BeanContextMembershipEvent', 'BeanContextMembershipListener', 'BeanContextProxy', 'BeanContextServiceAvailableEvent', 'BeanContextServiceProvider', 'BeanContextServiceProviderBeanInfo', 'BeanContextServiceRevokedEvent', 'BeanContextServiceRevokedListener', 'BeanContextServices', 'BeanContextServicesListener', 'BeanContextServicesSupport', 'BeanContextServicesSupport.BCSSServiceProvider', 'BeanContextSupport', 'BeanContextSupport.BCSIterator', 'BeanDescriptor', 'BeanInfo', 'Beans', 'BevelBorder', 'Bidi', 'BigDecimal', 'BigInteger', 'BinaryRefAddr', 'BindException', 'Binding', 'Binding', 'BindingHelper', 'BindingHolder', 'BindingIterator', 'BindingIteratorHelper', 'BindingIteratorHolder', 'BindingIteratorOperations', 'BindingIteratorPOA', 'BindingListHelper', 'BindingListHolder', 'BindingType', 'BindingTypeHelper', 'BindingTypeHolder', 'BitSet', 'Blob', 'BlockView', 'BlockingQueue', 'Book', 'Boolean', 'BooleanControl', 'BooleanControl.Type', 'BooleanHolder', 'BooleanSeqHelper', 'BooleanSeqHolder', 'Border', 'BorderFactory', 'BorderLayout', 'BorderUIResource', 'BorderUIResource.BevelBorderUIResource', 'BorderUIResource.CompoundBorderUIResource', 'BorderUIResource.EmptyBorderUIResource', 'BorderUIResource.EtchedBorderUIResource', 'BorderUIResource.LineBorderUIResource', 'BorderUIResource.MatteBorderUIResource', 'BorderUIResource.TitledBorderUIResource', 'BoundedRangeModel', 'Bounds', 'Bounds', 'Box', 'Box.Filler', 'BoxLayout', 'BoxView', 'BoxedValueHelper', 'BreakIterator', 'BrokenBarrierException', 'Buffer', 'BufferCapabilities', 'BufferCapabilities.FlipContents', 'BufferOverflowException', 'BufferStrategy', 'BufferUnderflowException', 'BufferedImage', 'BufferedImageFilter', 'BufferedImageOp', 'BufferedInputStream', 'BufferedOutputStream', 'BufferedReader', 'BufferedWriter', 'Button', 'ButtonGroup', 'ButtonModel', 'ButtonUI', 'Byte', 'ByteArrayInputStream', 'ByteArrayOutputStream', 'ByteBuffer', 'ByteChannel', 'ByteHolder', 'ByteLookupTable', 'ByteOrder', 'CDATASection', 'CMMException', 'CODESET_INCOMPATIBLE', 'COMM_FAILURE', 'CRC32', 'CRL', 'CRLException', 'CRLSelector', 'CSS', 'CSS.Attribute', 'CTX_RESTRICT_SCOPE', 'CacheRequest', 'CacheResponse', 'CachedRowSet', 'Calendar', 'Callable', 'CallableStatement', 'Callback', 'CallbackHandler', 'CancelablePrintJob', 'CancellationException', 'CancelledKeyException', 'CannotProceed', 'CannotProceedException', 'CannotProceedHelper', 'CannotProceedHolder', 'CannotRedoException', 'CannotUndoException', 'Canvas', 'CardLayout', 'Caret', 'CaretEvent', 'CaretListener', 'CellEditor', 'CellEditorListener', 'CellRendererPane', 'CertPath', 'CertPath.CertPathRep', 'CertPathBuilder', 'CertPathBuilderException', 'CertPathBuilderResult', 'CertPathBuilderSpi', 'CertPathParameters', 'CertPathTrustManagerParameters', 'CertPathValidator', 'CertPathValidatorException', 'CertPathValidatorResult', 'CertPathValidatorSpi', 'CertSelector', 'CertStore', 'CertStoreException', 'CertStoreParameters', 'CertStoreSpi', 'Certificate', 'Certificate', 'Certificate', 'Certificate.CertificateRep', 'CertificateEncodingException', 'CertificateEncodingException', 'CertificateException', 'CertificateException', 'CertificateExpiredException', 'CertificateExpiredException', 'CertificateFactory', 'CertificateFactorySpi', 'CertificateNotYetValidException', 'CertificateNotYetValidException', 'CertificateParsingException', 'CertificateParsingException', 'ChangeEvent', 'ChangeListener', 'ChangedCharSetException', 'Channel', 'ChannelBinding', 'Channels', 'CharArrayReader', 'CharArrayWriter', 'CharBuffer', 'CharConversionException', 'CharHolder', 'CharSeqHelper', 'CharSeqHolder', 'CharSequence', 'Character', 'Character.Subset', 'Character.UnicodeBlock', 'CharacterCodingException', 'CharacterData', 'CharacterIterator', 'Charset', 'CharsetDecoder', 'CharsetEncoder', 'CharsetProvider', 'Checkbox', 'CheckboxGroup', 'CheckboxMenuItem', 'CheckedInputStream', 'CheckedOutputStream', 'Checksum', 'Choice', 'ChoiceCallback', 'ChoiceFormat', 'Chromaticity', 'Cipher', 'CipherInputStream', 'CipherOutputStream', 'CipherSpi', 'Class', 'ClassCastException', 'ClassCircularityError', 'ClassDefinition', 'ClassDesc', 'ClassFileTransformer', 'ClassFormatError', 'ClassLoader', 'ClassLoaderRepository', 'ClassLoadingMXBean', 'ClassNotFoundException', 'ClientRequestInfo', 'ClientRequestInfoOperations', 'ClientRequestInterceptor', 'ClientRequestInterceptorOperations', 'Clip', 'Clipboard', 'ClipboardOwner', 'Clob', 'CloneNotSupportedException', 'Cloneable', 'Closeable', 'ClosedByInterruptException', 'ClosedChannelException', 'ClosedSelectorException', 'CodeSets', 'CodeSigner', 'CodeSource', 'Codec', 'CodecFactory', 'CodecFactoryHelper', 'CodecFactoryOperations', 'CodecOperations', 'CoderMalfunctionError', 'CoderResult', 'CodingErrorAction', 'CollationElementIterator', 'CollationKey', 'Collator', 'Collection', 'CollectionCertStoreParameters', 'Collections', 'Color', 'ColorChooserComponentFactory', 'ColorChooserUI', 'ColorConvertOp', 'ColorModel', 'ColorSelectionModel', 'ColorSpace', 'ColorSupported', 'ColorType', 'ColorUIResource', 'ComboBoxEditor', 'ComboBoxModel', 'ComboBoxUI', 'ComboPopup', 'Comment', 'CommunicationException', 'Comparable', 'Comparator', 'CompilationMXBean', 'Compiler', 'CompletionService', 'CompletionStatus', 'CompletionStatusHelper', 'Component', 'ComponentAdapter', 'ComponentColorModel', 'ComponentEvent', 'ComponentIdHelper', 'ComponentInputMap', 'ComponentInputMapUIResource', 'ComponentListener', 'ComponentOrientation', 'ComponentSampleModel', 'ComponentUI', 'ComponentView', 'Composite', 'CompositeContext', 'CompositeData', 'CompositeDataSupport', 'CompositeName', 'CompositeType', 'CompositeView', 'CompoundBorder', 'CompoundControl', 'CompoundControl.Type', 'CompoundEdit', 'CompoundName', 'Compression', 'ConcurrentHashMap', 'ConcurrentLinkedQueue', 'ConcurrentMap', 'ConcurrentModificationException', 'Condition', 'Configuration', 'ConfigurationException', 'ConfirmationCallback', 'ConnectException', 'ConnectException', 'ConnectIOException', 'Connection', 'ConnectionEvent', 'ConnectionEventListener', 'ConnectionPendingException', 'ConnectionPoolDataSource', 'ConsoleHandler', 'Constructor', 'Container', 'ContainerAdapter', 'ContainerEvent', 'ContainerListener', 'ContainerOrderFocusTraversalPolicy', 'ContentHandler', 'ContentHandler', 'ContentHandlerFactory', 'ContentModel', 'Context', 'Context', 'ContextList', 'ContextNotEmptyException', 'ContextualRenderedImageFactory', 'Control', 'Control', 'Control.Type', 'ControlFactory', 'ControllerEventListener', 'ConvolveOp', 'CookieHandler', 'CookieHolder', 'Copies', 'CopiesSupported', 'CopyOnWriteArrayList', 'CopyOnWriteArraySet', 'CountDownLatch', 'CounterMonitor', 'CounterMonitorMBean', 'CredentialException', 'CredentialExpiredException', 'CredentialNotFoundException', 'CropImageFilter', 'CubicCurve2D', 'CubicCurve2D.Double', 'CubicCurve2D.Float', 'Currency', 'Current', 'Current', 'Current', 'CurrentHelper', 'CurrentHelper', 'CurrentHelper', 'CurrentHolder', 'CurrentOperations', 'CurrentOperations', 'CurrentOperations', 'Cursor', 'CustomMarshal', 'CustomValue', 'Customizer', 'CyclicBarrier', 'DATA_CONVERSION', 'DESKeySpec', 'DESedeKeySpec', 'DGC', 'DHGenParameterSpec', 'DHKey', 'DHParameterSpec', 'DHPrivateKey', 'DHPrivateKeySpec', 'DHPublicKey', 'DHPublicKeySpec', 'DISCARDING', 'DOMConfiguration', 'DOMError', 'DOMErrorHandler', 'DOMException', 'DOMImplementation', 'DOMImplementationLS', 'DOMImplementationList', 'DOMImplementationRegistry', 'DOMImplementationSource', 'DOMLocator', 'DOMLocator', 'DOMResult', 'DOMSource', 'DOMStringList', 'DSAKey', 'DSAKeyPairGenerator', 'DSAParameterSpec', 'DSAParams', 'DSAPrivateKey', 'DSAPrivateKeySpec', 'DSAPublicKey', 'DSAPublicKeySpec', 'DTD', 'DTDConstants', 'DTDHandler', 'DataBuffer', 'DataBufferByte', 'DataBufferDouble', 'DataBufferFloat', 'DataBufferInt', 'DataBufferShort', 'DataBufferUShort', 'DataFlavor', 'DataFormatException', 'DataInput', 'DataInputStream', 'DataInputStream', 'DataLine', 'DataLine.Info', 'DataOutput', 'DataOutputStream', 'DataOutputStream', 'DataSource', 'DataTruncation', 'DatabaseMetaData', 'DatagramChannel', 'DatagramPacket', 'DatagramSocket', 'DatagramSocketImpl', 'DatagramSocketImplFactory', 'DatatypeConfigurationException', 'DatatypeConstants', 'DatatypeConstants.Field', 'DatatypeFactory', 'Date', 'Date', 'DateFormat', 'DateFormat.Field', 'DateFormatSymbols', 'DateFormatter', 'DateTimeAtCompleted', 'DateTimeAtCreation', 'DateTimeAtProcessing', 'DateTimeSyntax', 'DebugGraphics', 'DecimalFormat', 'DecimalFormatSymbols', 'DeclHandler', 'DefaultBoundedRangeModel', 'DefaultButtonModel', 'DefaultCaret', 'DefaultCellEditor', 'DefaultColorSelectionModel', 'DefaultComboBoxModel', 'DefaultDesktopManager', 'DefaultEditorKit', 'DefaultEditorKit.BeepAction', 'DefaultEditorKit.CopyAction', 'DefaultEditorKit.CutAction', 'DefaultEditorKit.DefaultKeyTypedAction', 'DefaultEditorKit.InsertBreakAction', 'DefaultEditorKit.InsertContentAction', 'DefaultEditorKit.InsertTabAction', 'DefaultEditorKit.PasteAction', 'DefaultFocusManager', 'DefaultFocusTraversalPolicy', 'DefaultFormatter', 'DefaultFormatterFactory', 'DefaultHandler', 'DefaultHandler2', 'DefaultHighlighter', 'DefaultHighlighter.DefaultHighlightPainter', 'DefaultKeyboardFocusManager', 'DefaultListCellRenderer', 'DefaultListCellRenderer.UIResource', 'DefaultListModel', 'DefaultListSelectionModel', 'DefaultLoaderRepository', 'DefaultLoaderRepository', 'DefaultMenuLayout', 'DefaultMetalTheme', 'DefaultMutableTreeNode', 'DefaultPersistenceDelegate', 'DefaultSingleSelectionModel', 'DefaultStyledDocument', 'DefaultStyledDocument.AttributeUndoableEdit', 'DefaultStyledDocument.ElementSpec', 'DefaultTableCellRenderer', 'DefaultTableCellRenderer.UIResource', 'DefaultTableColumnModel', 'DefaultTableModel', 'DefaultTextUI', 'DefaultTreeCellEditor', 'DefaultTreeCellRenderer', 'DefaultTreeModel', 'DefaultTreeSelectionModel', 'DefinitionKind', 'DefinitionKindHelper', 'Deflater', 'DeflaterOutputStream', 'DelayQueue', 'Delayed', 'Delegate', 'Delegate', 'Delegate', 'DelegationPermission', 'Deprecated', 'Descriptor', 'DescriptorAccess', 'DescriptorSupport', 'DesignMode', 'DesktopIconUI', 'DesktopManager', 'DesktopPaneUI', 'Destination', 'DestroyFailedException', 'Destroyable', 'Dialog', 'Dictionary', 'DigestException', 'DigestInputStream', 'DigestOutputStream', 'Dimension', 'Dimension2D', 'DimensionUIResource', 'DirContext', 'DirObjectFactory', 'DirStateFactory', 'DirStateFactory.Result', 'DirectColorModel', 'DirectoryManager', 'DisplayMode', 'DnDConstants', 'Doc', 'DocAttribute', 'DocAttributeSet', 'DocFlavor', 'DocFlavor.BYTE_ARRAY', 'DocFlavor.CHAR_ARRAY', 'DocFlavor.INPUT_STREAM', 'DocFlavor.READER', 'DocFlavor.SERVICE_FORMATTED', 'DocFlavor.STRING', 'DocFlavor.URL', 'DocPrintJob', 'Document', 'Document', 'DocumentBuilder', 'DocumentBuilderFactory', 'DocumentEvent', 'DocumentEvent.ElementChange', 'DocumentEvent.EventType', 'DocumentFilter', 'DocumentFilter.FilterBypass', 'DocumentFragment', 'DocumentHandler', 'DocumentListener', 'DocumentName', 'DocumentParser', 'DocumentType', 'Documented', 'DomainCombiner', 'DomainManager', 'DomainManagerOperations', 'Double', 'DoubleBuffer', 'DoubleHolder', 'DoubleSeqHelper', 'DoubleSeqHolder', 'DragGestureEvent', 'DragGestureListener', 'DragGestureRecognizer', 'DragSource', 'DragSourceAdapter', 'DragSourceContext', 'DragSourceDragEvent', 'DragSourceDropEvent', 'DragSourceEvent', 'DragSourceListener', 'DragSourceMotionListener', 'Driver', 'DriverManager', 'DriverPropertyInfo', 'DropTarget', 'DropTarget.DropTargetAutoScroller', 'DropTargetAdapter', 'DropTargetContext', 'DropTargetDragEvent', 'DropTargetDropEvent', 'DropTargetEvent', 'DropTargetListener', 'DuplicateFormatFlagsException', 'DuplicateName', 'DuplicateNameHelper', 'Duration', 'DynAny', 'DynAny', 'DynAnyFactory', 'DynAnyFactoryHelper', 'DynAnyFactoryOperations', 'DynAnyHelper', 'DynAnyOperations', 'DynAnySeqHelper', 'DynArray', 'DynArray', 'DynArrayHelper', 'DynArrayOperations', 'DynEnum', 'DynEnum', 'DynEnumHelper', 'DynEnumOperations', 'DynFixed', 'DynFixed', 'DynFixedHelper', 'DynFixedOperations', 'DynSequence', 'DynSequence', 'DynSequenceHelper', 'DynSequenceOperations', 'DynStruct', 'DynStruct', 'DynStructHelper', 'DynStructOperations', 'DynUnion', 'DynUnion', 'DynUnionHelper', 'DynUnionOperations', 'DynValue', 'DynValue', 'DynValueBox', 'DynValueBoxOperations', 'DynValueCommon', 'DynValueCommonOperations', 'DynValueHelper', 'DynValueOperations', 'DynamicImplementation', 'DynamicImplementation', 'DynamicMBean', 'ECField', 'ECFieldF2m', 'ECFieldFp', 'ECGenParameterSpec', 'ECKey', 'ECParameterSpec', 'ECPoint', 'ECPrivateKey', 'ECPrivateKeySpec', 'ECPublicKey', 'ECPublicKeySpec', 'ENCODING_CDR_ENCAPS', 'EOFException', 'EditorKit', 'Element', 'Element', 'Element', 'ElementIterator', 'ElementType', 'Ellipse2D', 'Ellipse2D.Double', 'Ellipse2D.Float', 'EllipticCurve', 'EmptyBorder', 'EmptyStackException', 'EncodedKeySpec', 'Encoder', 'Encoding', 'EncryptedPrivateKeyInfo', 'Entity', 'Entity', 'EntityReference', 'EntityResolver', 'EntityResolver2', 'Enum', 'EnumConstantNotPresentException', 'EnumControl', 'EnumControl.Type', 'EnumMap', 'EnumSet', 'EnumSyntax', 'Enumeration', 'Environment', 'Error', 'ErrorHandler', 'ErrorListener', 'ErrorManager', 'EtchedBorder', 'Event', 'EventContext', 'EventDirContext', 'EventHandler', 'EventListener', 'EventListenerList', 'EventListenerProxy', 'EventObject', 'EventQueue', 'EventSetDescriptor', 'Exception', 'ExceptionDetailMessage', 'ExceptionInInitializerError', 'ExceptionList', 'ExceptionListener', 'Exchanger', 'ExecutionException', 'Executor', 'ExecutorCompletionService', 'ExecutorService', 'Executors', 'ExemptionMechanism', 'ExemptionMechanismException', 'ExemptionMechanismSpi', 'ExpandVetoException', 'ExportException', 'Expression', 'ExtendedRequest', 'ExtendedResponse', 'Externalizable', 'FREE_MEM', 'FactoryConfigurationError', 'FailedLoginException', 'FeatureDescriptor', 'Fidelity', 'Field', 'FieldNameHelper', 'FieldNameHelper', 'FieldPosition', 'FieldView', 'File', 'FileCacheImageInputStream', 'FileCacheImageOutputStream', 'FileChannel', 'FileChannel.MapMode', 'FileChooserUI', 'FileDescriptor', 'FileDialog', 'FileFilter', 'FileFilter', 'FileHandler', 'FileImageInputStream', 'FileImageOutputStream', 'FileInputStream', 'FileLock', 'FileLockInterruptionException', 'FileNameMap', 'FileNotFoundException', 'FileOutputStream', 'FilePermission', 'FileReader', 'FileSystemView', 'FileView', 'FileWriter', 'FilenameFilter', 'Filter', 'FilterInputStream', 'FilterOutputStream', 'FilterReader', 'FilterWriter', 'FilteredImageSource', 'FilteredRowSet', 'Finishings', 'FixedHeightLayoutCache', 'FixedHolder', 'FlatteningPathIterator', 'FlavorEvent', 'FlavorException', 'FlavorListener', 'FlavorMap', 'FlavorTable', 'Float', 'FloatBuffer', 'FloatControl', 'FloatControl.Type', 'FloatHolder', 'FloatSeqHelper', 'FloatSeqHolder', 'FlowLayout', 'FlowView', 'FlowView.FlowStrategy', 'Flushable', 'FocusAdapter', 'FocusEvent', 'FocusListener', 'FocusManager', 'FocusTraversalPolicy', 'Font', 'FontFormatException', 'FontMetrics', 'FontRenderContext', 'FontUIResource', 'FormSubmitEvent', 'FormSubmitEvent.MethodType', 'FormView', 'Format', 'Format.Field', 'FormatConversionProvider', 'FormatFlagsConversionMismatchException', 'FormatMismatch', 'FormatMismatchHelper', 'Formattable', 'FormattableFlags', 'Formatter', 'Formatter', 'FormatterClosedException', 'ForwardRequest', 'ForwardRequest', 'ForwardRequestHelper', 'ForwardRequestHelper', 'Frame', 'Future', 'FutureTask', 'GSSContext', 'GSSCredential', 'GSSException', 'GSSManager', 'GSSName', 'GZIPInputStream', 'GZIPOutputStream', 'GapContent', 'GarbageCollectorMXBean', 'GatheringByteChannel', 'GaugeMonitor', 'GaugeMonitorMBean', 'GeneralPath', 'GeneralSecurityException', 'GenericArrayType', 'GenericDeclaration', 'GenericSignatureFormatError', 'GlyphJustificationInfo', 'GlyphMetrics', 'GlyphVector', 'GlyphView', 'GlyphView.GlyphPainter', 'GradientPaint', 'GraphicAttribute', 'Graphics', 'Graphics2D', 'GraphicsConfigTemplate', 'GraphicsConfiguration', 'GraphicsDevice', 'GraphicsEnvironment', 'GrayFilter', 'GregorianCalendar', 'GridBagConstraints', 'GridBagLayout', 'GridLayout', 'Group', 'Guard', 'GuardedObject', 'HOLDING', 'HTML', 'HTML.Attribute', 'HTML.Tag', 'HTML.UnknownTag', 'HTMLDocument', 'HTMLDocument.Iterator', 'HTMLEditorKit', 'HTMLEditorKit.HTMLFactory', 'HTMLEditorKit.HTMLTextAction', 'HTMLEditorKit.InsertHTMLTextAction', 'HTMLEditorKit.LinkController', 'HTMLEditorKit.Parser', 'HTMLEditorKit.ParserCallback', 'HTMLFrameHyperlinkEvent', 'HTMLWriter', 'Handler', 'HandlerBase', 'HandshakeCompletedEvent', 'HandshakeCompletedListener', 'HasControls', 'HashAttributeSet', 'HashDocAttributeSet', 'HashMap', 'HashPrintJobAttributeSet', 'HashPrintRequestAttributeSet', 'HashPrintServiceAttributeSet', 'HashSet', 'Hashtable', 'HeadlessException', 'HierarchyBoundsAdapter', 'HierarchyBoundsListener', 'HierarchyEvent', 'HierarchyListener', 'Highlighter', 'Highlighter.Highlight', 'Highlighter.HighlightPainter', 'HostnameVerifier', 'HttpRetryException', 'HttpURLConnection', 'HttpsURLConnection', 'HyperlinkEvent', 'HyperlinkEvent.EventType', 'HyperlinkListener', 'ICC_ColorSpace', 'ICC_Profile', 'ICC_ProfileGray', 'ICC_ProfileRGB', 'IDLEntity', 'IDLType', 'IDLTypeHelper', 'IDLTypeOperations', 'ID_ASSIGNMENT_POLICY_ID', 'ID_UNIQUENESS_POLICY_ID', 'IIOByteBuffer', 'IIOException', 'IIOImage', 'IIOInvalidTreeException', 'IIOMetadata', 'IIOMetadataController', 'IIOMetadataFormat', 'IIOMetadataFormatImpl', 'IIOMetadataNode', 'IIOParam', 'IIOParamController', 'IIOReadProgressListener', 'IIOReadUpdateListener', 'IIOReadWarningListener', 'IIORegistry', 'IIOServiceProvider', 'IIOWriteProgressListener', 'IIOWriteWarningListener', 'IMPLICIT_ACTIVATION_POLICY_ID', 'IMP_LIMIT', 'INACTIVE', 'INITIALIZE', 'INTERNAL', 'INTF_REPOS', 'INVALID_ACTIVITY', 'INVALID_TRANSACTION', 'INV_FLAG', 'INV_IDENT', 'INV_OBJREF', 'INV_POLICY', 'IOException', 'IOR', 'IORHelper', 'IORHolder', 'IORInfo', 'IORInfoOperations', 'IORInterceptor', 'IORInterceptorOperations', 'IORInterceptor_3_0', 'IORInterceptor_3_0Helper', 'IORInterceptor_3_0Holder', 'IORInterceptor_3_0Operations', 'IRObject', 'IRObjectOperations', 'Icon', 'IconUIResource', 'IconView', 'IdAssignmentPolicy', 'IdAssignmentPolicyOperations', 'IdAssignmentPolicyValue', 'IdUniquenessPolicy', 'IdUniquenessPolicyOperations', 'IdUniquenessPolicyValue', 'IdentifierHelper', 'Identity', 'IdentityHashMap', 'IdentityScope', 'IllegalAccessError', 'IllegalAccessException', 'IllegalArgumentException', 'IllegalBlockSizeException', 'IllegalBlockingModeException', 'IllegalCharsetNameException', 'IllegalClassFormatException', 'IllegalComponentStateException', 'IllegalFormatCodePointException', 'IllegalFormatConversionException', 'IllegalFormatException', 'IllegalFormatFlagsException', 'IllegalFormatPrecisionException', 'IllegalFormatWidthException', 'IllegalMonitorStateException', 'IllegalPathStateException', 'IllegalSelectorException', 'IllegalStateException', 'IllegalThreadStateException', 'Image', 'ImageCapabilities', 'ImageConsumer', 'ImageFilter', 'ImageGraphicAttribute', 'ImageIO', 'ImageIcon', 'ImageInputStream', 'ImageInputStreamImpl', 'ImageInputStreamSpi', 'ImageObserver', 'ImageOutputStream', 'ImageOutputStreamImpl', 'ImageOutputStreamSpi', 'ImageProducer', 'ImageReadParam', 'ImageReader', 'ImageReaderSpi', 'ImageReaderWriterSpi', 'ImageTranscoder', 'ImageTranscoderSpi', 'ImageTypeSpecifier', 'ImageView', 'ImageWriteParam', 'ImageWriter', 'ImageWriterSpi', 'ImagingOpException', 'ImplicitActivationPolicy', 'ImplicitActivationPolicyOperations', 'ImplicitActivationPolicyValue', 'IncompatibleClassChangeError', 'IncompleteAnnotationException', 'InconsistentTypeCode', 'InconsistentTypeCode', 'InconsistentTypeCodeHelper', 'IndexColorModel', 'IndexOutOfBoundsException', 'IndexedPropertyChangeEvent', 'IndexedPropertyDescriptor', 'IndirectionException', 'Inet4Address', 'Inet6Address', 'InetAddress', 'InetSocketAddress', 'Inflater', 'InflaterInputStream', 'InheritableThreadLocal', 'Inherited', 'InitialContext', 'InitialContextFactory', 'InitialContextFactoryBuilder', 'InitialDirContext', 'InitialLdapContext', 'InlineView', 'InputContext', 'InputEvent', 'InputMap', 'InputMapUIResource', 'InputMethod', 'InputMethodContext', 'InputMethodDescriptor', 'InputMethodEvent', 'InputMethodHighlight', 'InputMethodListener', 'InputMethodRequests', 'InputMismatchException', 'InputSource', 'InputStream', 'InputStream', 'InputStream', 'InputStreamReader', 'InputSubset', 'InputVerifier', 'Insets', 'InsetsUIResource', 'InstanceAlreadyExistsException', 'InstanceNotFoundException', 'InstantiationError', 'InstantiationException', 'Instrument', 'Instrumentation', 'InsufficientResourcesException', 'IntBuffer', 'IntHolder', 'Integer', 'IntegerSyntax', 'Interceptor', 'InterceptorOperations', 'InternalError', 'InternalFrameAdapter', 'InternalFrameEvent', 'InternalFrameFocusTraversalPolicy', 'InternalFrameListener', 'InternalFrameUI', 'InternationalFormatter', 'InterruptedException', 'InterruptedIOException', 'InterruptedNamingException', 'InterruptibleChannel', 'IntrospectionException', 'IntrospectionException', 'Introspector', 'Invalid', 'InvalidActivityException', 'InvalidAddress', 'InvalidAddressHelper', 'InvalidAddressHolder', 'InvalidAlgorithmParameterException', 'InvalidApplicationException', 'InvalidAttributeIdentifierException', 'InvalidAttributeValueException', 'InvalidAttributeValueException', 'InvalidAttributesException', 'InvalidClassException', 'InvalidDnDOperationException', 'InvalidKeyException', 'InvalidKeyException', 'InvalidKeySpecException', 'InvalidMarkException', 'InvalidMidiDataException', 'InvalidName', 'InvalidName', 'InvalidName', 'InvalidNameException', 'InvalidNameHelper', 'InvalidNameHelper', 'InvalidNameHolder', 'InvalidObjectException', 'InvalidOpenTypeException', 'InvalidParameterException', 'InvalidParameterSpecException', 'InvalidPolicy', 'InvalidPolicyHelper', 'InvalidPreferencesFormatException', 'InvalidPropertiesFormatException', 'InvalidRelationIdException', 'InvalidRelationServiceException', 'InvalidRelationTypeException', 'InvalidRoleInfoException', 'InvalidRoleValueException', 'InvalidSearchControlsException', 'InvalidSearchFilterException', 'InvalidSeq', 'InvalidSlot', 'InvalidSlotHelper', 'InvalidTargetObjectTypeException', 'InvalidTransactionException', 'InvalidTypeForEncoding', 'InvalidTypeForEncodingHelper', 'InvalidValue', 'InvalidValue', 'InvalidValueHelper', 'InvocationEvent', 'InvocationHandler', 'InvocationTargetException', 'InvokeHandler', 'IstringHelper', 'ItemEvent', 'ItemListener', 'ItemSelectable', 'Iterable', 'Iterator', 'IvParameterSpec', 'JApplet', 'JButton', 'JCheckBox', 'JCheckBoxMenuItem', 'JColorChooser', 'JComboBox', 'JComboBox.KeySelectionManager', 'JComponent', 'JDesktopPane', 'JDialog', 'JEditorPane', 'JFileChooser', 'JFormattedTextField', 'JFormattedTextField.AbstractFormatter', 'JFormattedTextField.AbstractFormatterFactory', 'JFrame', 'JInternalFrame', 'JInternalFrame.JDesktopIcon', 'JLabel', 'JLayeredPane', 'JList', 'JMException', 'JMRuntimeException', 'JMXAuthenticator', 'JMXConnectionNotification', 'JMXConnector', 'JMXConnectorFactory', 'JMXConnectorProvider', 'JMXConnectorServer', 'JMXConnectorServerFactory', 'JMXConnectorServerMBean', 'JMXConnectorServerProvider', 'JMXPrincipal', 'JMXProviderException', 'JMXServerErrorException', 'JMXServiceURL', 'JMenu', 'JMenuBar', 'JMenuItem', 'JOptionPane', 'JPEGHuffmanTable', 'JPEGImageReadParam', 'JPEGImageWriteParam', 'JPEGQTable', 'JPanel', 'JPasswordField', 'JPopupMenu', 'JPopupMenu.Separator', 'JProgressBar', 'JRadioButton', 'JRadioButtonMenuItem', 'JRootPane', 'JScrollBar', 'JScrollPane', 'JSeparator', 'JSlider', 'JSpinner', 'JSpinner.DateEditor', 'JSpinner.DefaultEditor', 'JSpinner.ListEditor', 'JSpinner.NumberEditor', 'JSplitPane', 'JTabbedPane', 'JTable', 'JTable.PrintMode', 'JTableHeader', 'JTextArea', 'JTextComponent', 'JTextComponent.KeyBinding', 'JTextField', 'JTextPane', 'JToggleButton', 'JToggleButton.ToggleButtonModel', 'JToolBar', 'JToolBar.Separator', 'JToolTip', 'JTree', 'JTree.DynamicUtilTreeNode', 'JTree.EmptySelectionModel', 'JViewport', 'JWindow', 'JarEntry', 'JarException', 'JarFile', 'JarInputStream', 'JarOutputStream', 'JarURLConnection', 'JdbcRowSet', 'JobAttributes', 'JobAttributes.DefaultSelectionType', 'JobAttributes.DestinationType', 'JobAttributes.DialogType', 'JobAttributes.MultipleDocumentHandlingType', 'JobAttributes.SidesType', 'JobHoldUntil', 'JobImpressions', 'JobImpressionsCompleted', 'JobImpressionsSupported', 'JobKOctets', 'JobKOctetsProcessed', 'JobKOctetsSupported', 'JobMediaSheets', 'JobMediaSheetsCompleted', 'JobMediaSheetsSupported', 'JobMessageFromOperator', 'JobName', 'JobOriginatingUserName', 'JobPriority', 'JobPrioritySupported', 'JobSheets', 'JobState', 'JobStateReason', 'JobStateReasons', 'JoinRowSet', 'Joinable', 'KerberosKey', 'KerberosPrincipal', 'KerberosTicket', 'Kernel', 'Key', 'KeyAdapter', 'KeyAgreement', 'KeyAgreementSpi', 'KeyAlreadyExistsException', 'KeyEvent', 'KeyEventDispatcher', 'KeyEventPostProcessor', 'KeyException', 'KeyFactory', 'KeyFactorySpi', 'KeyGenerator', 'KeyGeneratorSpi', 'KeyListener', 'KeyManagementException', 'KeyManager', 'KeyManagerFactory', 'KeyManagerFactorySpi', 'KeyPair', 'KeyPairGenerator', 'KeyPairGeneratorSpi', 'KeyRep', 'KeyRep.Type', 'KeySpec', 'KeyStore', 'KeyStore.Builder', 'KeyStore.CallbackHandlerProtection', 'KeyStore.Entry', 'KeyStore.LoadStoreParameter', 'KeyStore.PasswordProtection', 'KeyStore.PrivateKeyEntry', 'KeyStore.ProtectionParameter', 'KeyStore.SecretKeyEntry', 'KeyStore.TrustedCertificateEntry', 'KeyStoreBuilderParameters', 'KeyStoreException', 'KeyStoreSpi', 'KeyStroke', 'KeyboardFocusManager', 'Keymap', 'LDAPCertStoreParameters', 'LIFESPAN_POLICY_ID', 'LOCATION_FORWARD', 'LSException', 'LSInput', 'LSLoadEvent', 'LSOutput', 'LSParser', 'LSParserFilter', 'LSProgressEvent', 'LSResourceResolver', 'LSSerializer', 'LSSerializerFilter', 'Label', 'LabelUI', 'LabelView', 'LanguageCallback', 'LastOwnerException', 'LayeredHighlighter', 'LayeredHighlighter.LayerPainter', 'LayoutFocusTraversalPolicy', 'LayoutManager', 'LayoutManager2', 'LayoutQueue', 'LdapContext', 'LdapName', 'LdapReferralException', 'Lease', 'Level', 'LexicalHandler', 'LifespanPolicy', 'LifespanPolicyOperations', 'LifespanPolicyValue', 'LimitExceededException', 'Line', 'Line.Info', 'Line2D', 'Line2D.Double', 'Line2D.Float', 'LineBorder', 'LineBreakMeasurer', 'LineEvent', 'LineEvent.Type', 'LineListener', 'LineMetrics', 'LineNumberInputStream', 'LineNumberReader', 'LineUnavailableException', 'LinkException', 'LinkLoopException', 'LinkRef', 'LinkageError', 'LinkedBlockingQueue', 'LinkedHashMap', 'LinkedHashSet', 'LinkedList', 'List', 'List', 'ListCellRenderer', 'ListDataEvent', 'ListDataListener', 'ListIterator', 'ListModel', 'ListResourceBundle', 'ListSelectionEvent', 'ListSelectionListener', 'ListSelectionModel', 'ListUI', 'ListView', 'ListenerNotFoundException', 'LoaderHandler', 'LocalObject', 'Locale', 'LocateRegistry', 'Locator', 'Locator2', 'Locator2Impl', 'LocatorImpl', 'Lock', 'LockSupport', 'LogManager', 'LogRecord', 'LogStream', 'Logger', 'LoggingMXBean', 'LoggingPermission', 'LoginContext', 'LoginException', 'LoginModule', 'Long', 'LongBuffer', 'LongHolder', 'LongLongSeqHelper', 'LongLongSeqHolder', 'LongSeqHelper', 'LongSeqHolder', 'LookAndFeel', 'LookupOp', 'LookupTable', 'MARSHAL', 'MBeanAttributeInfo', 'MBeanConstructorInfo', 'MBeanException', 'MBeanFeatureInfo', 'MBeanInfo', 'MBeanNotificationInfo', 'MBeanOperationInfo', 'MBeanParameterInfo', 'MBeanPermission', 'MBeanRegistration', 'MBeanRegistrationException', 'MBeanServer', 'MBeanServerBuilder', 'MBeanServerConnection', 'MBeanServerDelegate', 'MBeanServerDelegateMBean', 'MBeanServerFactory', 'MBeanServerForwarder', 'MBeanServerInvocationHandler', 'MBeanServerNotification', 'MBeanServerNotificationFilter', 'MBeanServerPermission', 'MBeanTrustPermission', 'MGF1ParameterSpec', 'MLet', 'MLetMBean', 'Mac', 'MacSpi', 'MalformedInputException', 'MalformedLinkException', 'MalformedObjectNameException', 'MalformedParameterizedTypeException', 'MalformedURLException', 'ManageReferralControl', 'ManagementFactory', 'ManagementPermission', 'ManagerFactoryParameters', 'Manifest', 'Map', 'Map.Entry', 'MappedByteBuffer', 'MarshalException', 'MarshalledObject', 'MaskFormatter', 'MatchResult', 'Matcher', 'Math', 'MathContext', 'MatteBorder', 'Media', 'MediaName', 'MediaPrintableArea', 'MediaSize', 'MediaSize.Engineering', 'MediaSize.ISO', 'MediaSize.JIS', 'MediaSize.NA', 'MediaSize.Other', 'MediaSizeName', 'MediaTracker', 'MediaTray', 'Member', 'MemoryCacheImageInputStream', 'MemoryCacheImageOutputStream', 'MemoryHandler', 'MemoryImageSource', 'MemoryMXBean', 'MemoryManagerMXBean', 'MemoryNotificationInfo', 'MemoryPoolMXBean', 'MemoryType', 'MemoryUsage', 'Menu', 'MenuBar', 'MenuBarUI', 'MenuComponent', 'MenuContainer', 'MenuDragMouseEvent', 'MenuDragMouseListener', 'MenuElement', 'MenuEvent', 'MenuItem', 'MenuItemUI', 'MenuKeyEvent', 'MenuKeyListener', 'MenuListener', 'MenuSelectionManager', 'MenuShortcut', 'MessageDigest', 'MessageDigestSpi', 'MessageFormat', 'MessageFormat.Field', 'MessageProp', 'MetaEventListener', 'MetaMessage', 'MetalBorders', 'MetalBorders.ButtonBorder', 'MetalBorders.Flush3DBorder', 'MetalBorders.InternalFrameBorder', 'MetalBorders.MenuBarBorder', 'MetalBorders.MenuItemBorder', 'MetalBorders.OptionDialogBorder', 'MetalBorders.PaletteBorder', 'MetalBorders.PopupMenuBorder', 'MetalBorders.RolloverButtonBorder', 'MetalBorders.ScrollPaneBorder', 'MetalBorders.TableHeaderBorder', 'MetalBorders.TextFieldBorder', 'MetalBorders.ToggleButtonBorder', 'MetalBorders.ToolBarBorder', 'MetalButtonUI', 'MetalCheckBoxIcon', 'MetalCheckBoxUI', 'MetalComboBoxButton', 'MetalComboBoxEditor', 'MetalComboBoxEditor.UIResource', 'MetalComboBoxIcon', 'MetalComboBoxUI', 'MetalDesktopIconUI', 'MetalFileChooserUI', 'MetalIconFactory', 'MetalIconFactory.FileIcon16', 'MetalIconFactory.FolderIcon16', 'MetalIconFactory.PaletteCloseIcon', 'MetalIconFactory.TreeControlIcon', 'MetalIconFactory.TreeFolderIcon', 'MetalIconFactory.TreeLeafIcon', 'MetalInternalFrameTitlePane', 'MetalInternalFrameUI', 'MetalLabelUI', 'MetalLookAndFeel', 'MetalMenuBarUI', 'MetalPopupMenuSeparatorUI', 'MetalProgressBarUI', 'MetalRadioButtonUI', 'MetalRootPaneUI', 'MetalScrollBarUI', 'MetalScrollButton', 'MetalScrollPaneUI', 'MetalSeparatorUI', 'MetalSliderUI', 'MetalSplitPaneUI', 'MetalTabbedPaneUI', 'MetalTextFieldUI', 'MetalTheme', 'MetalToggleButtonUI', 'MetalToolBarUI', 'MetalToolTipUI', 'MetalTreeUI', 'Method', 'MethodDescriptor', 'MidiChannel', 'MidiDevice', 'MidiDevice.Info', 'MidiDeviceProvider', 'MidiEvent', 'MidiFileFormat', 'MidiFileReader', 'MidiFileWriter', 'MidiMessage', 'MidiSystem', 'MidiUnavailableException', 'MimeTypeParseException', 'MinimalHTMLWriter', 'MissingFormatArgumentException', 'MissingFormatWidthException', 'MissingResourceException', 'Mixer', 'Mixer.Info', 'MixerProvider', 'ModelMBean', 'ModelMBeanAttributeInfo', 'ModelMBeanConstructorInfo', 'ModelMBeanInfo', 'ModelMBeanInfoSupport', 'ModelMBeanNotificationBroadcaster', 'ModelMBeanNotificationInfo', 'ModelMBeanOperationInfo', 'ModificationItem', 'Modifier', 'Monitor', 'MonitorMBean', 'MonitorNotification', 'MonitorSettingException', 'MouseAdapter', 'MouseDragGestureRecognizer', 'MouseEvent', 'MouseInfo', 'MouseInputAdapter', 'MouseInputListener', 'MouseListener', 'MouseMotionAdapter', 'MouseMotionListener', 'MouseWheelEvent', 'MouseWheelListener', 'MultiButtonUI', 'MultiColorChooserUI', 'MultiComboBoxUI', 'MultiDesktopIconUI', 'MultiDesktopPaneUI', 'MultiDoc', 'MultiDocPrintJob', 'MultiDocPrintService', 'MultiFileChooserUI', 'MultiInternalFrameUI', 'MultiLabelUI', 'MultiListUI', 'MultiLookAndFeel', 'MultiMenuBarUI', 'MultiMenuItemUI', 'MultiOptionPaneUI', 'MultiPanelUI', 'MultiPixelPackedSampleModel', 'MultiPopupMenuUI', 'MultiProgressBarUI', 'MultiRootPaneUI', 'MultiScrollBarUI', 'MultiScrollPaneUI', 'MultiSeparatorUI', 'MultiSliderUI', 'MultiSpinnerUI', 'MultiSplitPaneUI', 'MultiTabbedPaneUI', 'MultiTableHeaderUI', 'MultiTableUI', 'MultiTextUI', 'MultiToolBarUI', 'MultiToolTipUI', 'MultiTreeUI', 'MultiViewportUI', 'MulticastSocket', 'MultipleComponentProfileHelper', 'MultipleComponentProfileHolder', 'MultipleDocumentHandling', 'MultipleMaster', 'MutableAttributeSet', 'MutableComboBoxModel', 'MutableTreeNode', 'NON_EXISTENT', 'NO_IMPLEMENT', 'NO_MEMORY', 'NO_PERMISSION', 'NO_RESOURCES', 'NO_RESPONSE', 'NVList', 'Name', 'NameAlreadyBoundException', 'NameCallback', 'NameClassPair', 'NameComponent', 'NameComponentHelper', 'NameComponentHolder', 'NameDynAnyPair', 'NameDynAnyPairHelper', 'NameDynAnyPairSeqHelper', 'NameHelper', 'NameHolder', 'NameList', 'NameNotFoundException', 'NameParser', 'NameValuePair', 'NameValuePair', 'NameValuePairHelper', 'NameValuePairHelper', 'NameValuePairSeqHelper', 'NamedNodeMap', 'NamedValue', 'NamespaceChangeListener', 'NamespaceContext', 'NamespaceSupport', 'Naming', 'NamingContext', 'NamingContextExt', 'NamingContextExtHelper', 'NamingContextExtHolder', 'NamingContextExtOperations', 'NamingContextExtPOA', 'NamingContextHelper', 'NamingContextHolder', 'NamingContextOperations', 'NamingContextPOA', 'NamingEnumeration', 'NamingEvent', 'NamingException', 'NamingExceptionEvent', 'NamingListener', 'NamingManager', 'NamingSecurityException', 'NavigationFilter', 'NavigationFilter.FilterBypass', 'NegativeArraySizeException', 'NetPermission', 'NetworkInterface', 'NoClassDefFoundError', 'NoConnectionPendingException', 'NoContext', 'NoContextHelper', 'NoInitialContextException', 'NoPermissionException', 'NoRouteToHostException', 'NoServant', 'NoServantHelper', 'NoSuchAlgorithmException', 'NoSuchAttributeException', 'NoSuchElementException', 'NoSuchFieldError', 'NoSuchFieldException', 'NoSuchMethodError', 'NoSuchMethodException', 'NoSuchObjectException', 'NoSuchPaddingException', 'NoSuchProviderException', 'Node', 'NodeChangeEvent', 'NodeChangeListener', 'NodeList', 'NonReadableChannelException', 'NonWritableChannelException', 'NoninvertibleTransformException', 'NotActiveException', 'NotBoundException', 'NotCompliantMBeanException', 'NotContextException', 'NotEmpty', 'NotEmptyHelper', 'NotEmptyHolder', 'NotFound', 'NotFoundHelper', 'NotFoundHolder', 'NotFoundReason', 'NotFoundReasonHelper', 'NotFoundReasonHolder', 'NotOwnerException', 'NotSerializableException', 'NotYetBoundException', 'NotYetConnectedException', 'Notation', 'Notification', 'NotificationBroadcaster', 'NotificationBroadcasterSupport', 'NotificationEmitter', 'NotificationFilter', 'NotificationFilterSupport', 'NotificationListener', 'NotificationResult', 'NullCipher', 'NullPointerException', 'Number', 'NumberFormat', 'NumberFormat.Field', 'NumberFormatException', 'NumberFormatter', 'NumberOfDocuments', 'NumberOfInterveningJobs', 'NumberUp', 'NumberUpSupported', 'NumericShaper', 'OAEPParameterSpec', 'OBJECT_NOT_EXIST', 'OBJ_ADAPTER', 'OMGVMCID', 'ORB', 'ORB', 'ORBIdHelper', 'ORBInitInfo', 'ORBInitInfoOperations', 'ORBInitializer', 'ORBInitializerOperations', 'ObjID', 'Object', 'Object', 'ObjectAlreadyActive', 'ObjectAlreadyActiveHelper', 'ObjectChangeListener', 'ObjectFactory', 'ObjectFactoryBuilder', 'ObjectHelper', 'ObjectHolder', 'ObjectIdHelper', 'ObjectIdHelper', 'ObjectImpl', 'ObjectImpl', 'ObjectInput', 'ObjectInputStream', 'ObjectInputStream.GetField', 'ObjectInputValidation', 'ObjectInstance', 'ObjectName', 'ObjectNotActive', 'ObjectNotActiveHelper', 'ObjectOutput', 'ObjectOutputStream', 'ObjectOutputStream.PutField', 'ObjectReferenceFactory', 'ObjectReferenceFactoryHelper', 'ObjectReferenceFactoryHolder', 'ObjectReferenceTemplate', 'ObjectReferenceTemplateHelper', 'ObjectReferenceTemplateHolder', 'ObjectReferenceTemplateSeqHelper', 'ObjectReferenceTemplateSeqHolder', 'ObjectStreamClass', 'ObjectStreamConstants', 'ObjectStreamException', 'ObjectStreamField', 'ObjectView', 'Observable', 'Observer', 'OceanTheme', 'OctetSeqHelper', 'OctetSeqHolder', 'Oid', 'OpenDataException', 'OpenMBeanAttributeInfo', 'OpenMBeanAttributeInfoSupport', 'OpenMBeanConstructorInfo', 'OpenMBeanConstructorInfoSupport', 'OpenMBeanInfo', 'OpenMBeanInfoSupport', 'OpenMBeanOperationInfo', 'OpenMBeanOperationInfoSupport', 'OpenMBeanParameterInfo', 'OpenMBeanParameterInfoSupport', 'OpenType', 'OpenType', 'OperatingSystemMXBean', 'Operation', 'OperationNotSupportedException', 'OperationsException', 'Option', 'OptionPaneUI', 'OptionalDataException', 'OrientationRequested', 'OutOfMemoryError', 'OutputDeviceAssigned', 'OutputKeys', 'OutputStream', 'OutputStream', 'OutputStream', 'OutputStreamWriter', 'OverlappingFileLockException', 'OverlayLayout', 'Override', 'Owner', 'PBEKey', 'PBEKeySpec', 'PBEParameterSpec', 'PDLOverrideSupported', 'PERSIST_STORE', 'PKCS8EncodedKeySpec', 'PKIXBuilderParameters', 'PKIXCertPathBuilderResult', 'PKIXCertPathChecker', 'PKIXCertPathValidatorResult', 'PKIXParameters', 'POA', 'POAHelper', 'POAManager', 'POAManagerOperations', 'POAOperations', 'PRIVATE_MEMBER', 'PSSParameterSpec', 'PSource', 'PSource.PSpecified', 'PUBLIC_MEMBER', 'Pack200', 'Pack200.Packer', 'Pack200.Unpacker', 'Package', 'PackedColorModel', 'PageAttributes', 'PageAttributes.ColorType', 'PageAttributes.MediaType', 'PageAttributes.OrientationRequestedType', 'PageAttributes.OriginType', 'PageAttributes.PrintQualityType', 'PageFormat', 'PageRanges', 'Pageable', 'PagedResultsControl', 'PagedResultsResponseControl', 'PagesPerMinute', 'PagesPerMinuteColor', 'Paint', 'PaintContext', 'PaintEvent', 'Panel', 'PanelUI', 'Paper', 'ParagraphView', 'ParagraphView', 'Parameter', 'ParameterBlock', 'ParameterDescriptor', 'ParameterMetaData', 'ParameterMode', 'ParameterModeHelper', 'ParameterModeHolder', 'ParameterizedType', 'ParseException', 'ParsePosition', 'Parser', 'Parser', 'ParserAdapter', 'ParserConfigurationException', 'ParserDelegator', 'ParserFactory', 'PartialResultException', 'PasswordAuthentication', 'PasswordCallback', 'PasswordView', 'Patch', 'PathIterator', 'Pattern', 'PatternSyntaxException', 'Permission', 'Permission', 'PermissionCollection', 'Permissions', 'PersistenceDelegate', 'PersistentMBean', 'PhantomReference', 'Pipe', 'Pipe.SinkChannel', 'Pipe.SourceChannel', 'PipedInputStream', 'PipedOutputStream', 'PipedReader', 'PipedWriter', 'PixelGrabber', 'PixelInterleavedSampleModel', 'PlainDocument', 'PlainView', 'Point', 'Point2D', 'Point2D.Double', 'Point2D.Float', 'PointerInfo', 'Policy', 'Policy', 'Policy', 'PolicyError', 'PolicyErrorCodeHelper', 'PolicyErrorHelper', 'PolicyErrorHolder', 'PolicyFactory', 'PolicyFactoryOperations', 'PolicyHelper', 'PolicyHolder', 'PolicyListHelper', 'PolicyListHolder', 'PolicyNode', 'PolicyOperations', 'PolicyQualifierInfo', 'PolicyTypeHelper', 'Polygon', 'PooledConnection', 'Popup', 'PopupFactory', 'PopupMenu', 'PopupMenuEvent', 'PopupMenuListener', 'PopupMenuUI', 'Port', 'Port.Info', 'PortUnreachableException', 'PortableRemoteObject', 'PortableRemoteObjectDelegate', 'Position', 'Position.Bias', 'Predicate', 'PreferenceChangeEvent', 'PreferenceChangeListener', 'Preferences', 'PreferencesFactory', 'PreparedStatement', 'PresentationDirection', 'Principal', 'Principal', 'PrincipalHolder', 'PrintEvent', 'PrintException', 'PrintGraphics', 'PrintJob', 'PrintJobAdapter', 'PrintJobAttribute', 'PrintJobAttributeEvent', 'PrintJobAttributeListener', 'PrintJobAttributeSet', 'PrintJobEvent', 'PrintJobListener', 'PrintQuality', 'PrintRequestAttribute', 'PrintRequestAttributeSet', 'PrintService', 'PrintServiceAttribute', 'PrintServiceAttributeEvent', 'PrintServiceAttributeListener', 'PrintServiceAttributeSet', 'PrintServiceLookup', 'PrintStream', 'PrintWriter', 'Printable', 'PrinterAbortException', 'PrinterException', 'PrinterGraphics', 'PrinterIOException', 'PrinterInfo', 'PrinterIsAcceptingJobs', 'PrinterJob', 'PrinterLocation', 'PrinterMakeAndModel', 'PrinterMessageFromOperator', 'PrinterMoreInfo', 'PrinterMoreInfoManufacturer', 'PrinterName', 'PrinterResolution', 'PrinterState', 'PrinterStateReason', 'PrinterStateReasons', 'PrinterURI', 'PriorityBlockingQueue', 'PriorityQueue', 'PrivateClassLoader', 'PrivateCredentialPermission', 'PrivateKey', 'PrivateMLet', 'PrivilegedAction', 'PrivilegedActionException', 'PrivilegedExceptionAction', 'Process', 'ProcessBuilder', 'ProcessingInstruction', 'ProfileDataException', 'ProfileIdHelper', 'ProgressBarUI', 'ProgressMonitor', 'ProgressMonitorInputStream', 'Properties', 'PropertyChangeEvent', 'PropertyChangeListener', 'PropertyChangeListenerProxy', 'PropertyChangeSupport', 'PropertyDescriptor', 'PropertyEditor', 'PropertyEditorManager', 'PropertyEditorSupport', 'PropertyPermission', 'PropertyResourceBundle', 'PropertyVetoException', 'ProtectionDomain', 'ProtocolException', 'Provider', 'Provider.Service', 'ProviderException', 'Proxy', 'Proxy', 'Proxy.Type', 'ProxySelector', 'PublicKey', 'PushbackInputStream', 'PushbackReader', 'QName', 'QuadCurve2D', 'QuadCurve2D.Double', 'QuadCurve2D.Float', 'Query', 'QueryEval', 'QueryExp', 'Queue', 'QueuedJobCount', 'RC2ParameterSpec', 'RC5ParameterSpec', 'REBIND', 'REQUEST_PROCESSING_POLICY_ID', 'RGBImageFilter', 'RMIClassLoader', 'RMIClassLoaderSpi', 'RMIClientSocketFactory', 'RMIConnection', 'RMIConnectionImpl', 'RMIConnectionImpl_Stub', 'RMIConnector', 'RMIConnectorServer', 'RMICustomMaxStreamFormat', 'RMIFailureHandler', 'RMIIIOPServerImpl', 'RMIJRMPServerImpl', 'RMISecurityException', 'RMISecurityManager', 'RMIServer', 'RMIServerImpl', 'RMIServerImpl_Stub', 'RMIServerSocketFactory', 'RMISocketFactory', 'RSAKey', 'RSAKeyGenParameterSpec', 'RSAMultiPrimePrivateCrtKey', 'RSAMultiPrimePrivateCrtKeySpec', 'RSAOtherPrimeInfo', 'RSAPrivateCrtKey', 'RSAPrivateCrtKeySpec', 'RSAPrivateKey', 'RSAPrivateKeySpec', 'RSAPublicKey', 'RSAPublicKeySpec', 'RTFEditorKit', 'Random', 'RandomAccess', 'RandomAccessFile', 'Raster', 'RasterFormatException', 'RasterOp', 'Rdn', 'ReadOnlyBufferException', 'ReadWriteLock', 'Readable', 'ReadableByteChannel', 'Reader', 'RealmCallback', 'RealmChoiceCallback', 'Receiver', 'Rectangle', 'Rectangle2D', 'Rectangle2D.Double', 'Rectangle2D.Float', 'RectangularShape', 'ReentrantLock', 'ReentrantReadWriteLock', 'ReentrantReadWriteLock.ReadLock', 'ReentrantReadWriteLock.WriteLock', 'Ref', 'RefAddr', 'Reference', 'Reference', 'ReferenceQueue', 'ReferenceUriSchemesSupported', 'Referenceable', 'ReferralException', 'ReflectPermission', 'ReflectionException', 'RefreshFailedException', 'Refreshable', 'Region', 'RegisterableService', 'Registry', 'RegistryHandler', 'RejectedExecutionException', 'RejectedExecutionHandler', 'Relation', 'RelationException', 'RelationNotFoundException', 'RelationNotification', 'RelationService', 'RelationServiceMBean', 'RelationServiceNotRegisteredException', 'RelationSupport', 'RelationSupportMBean', 'RelationType', 'RelationTypeNotFoundException', 'RelationTypeSupport', 'RemarshalException', 'Remote', 'RemoteCall', 'RemoteException', 'RemoteObject', 'RemoteObjectInvocationHandler', 'RemoteRef', 'RemoteServer', 'RemoteStub', 'RenderContext', 'RenderableImage', 'RenderableImageOp', 'RenderableImageProducer', 'RenderedImage', 'RenderedImageFactory', 'Renderer', 'RenderingHints', 'RenderingHints.Key', 'RepaintManager', 'ReplicateScaleFilter', 'RepositoryIdHelper', 'Request', 'RequestInfo', 'RequestInfoOperations', 'RequestProcessingPolicy', 'RequestProcessingPolicyOperations', 'RequestProcessingPolicyValue', 'RequestingUserName', 'RequiredModelMBean', 'RescaleOp', 'ResolutionSyntax', 'ResolveResult', 'Resolver', 'ResourceBundle', 'ResponseCache', 'ResponseHandler', 'Result', 'ResultSet', 'ResultSetMetaData', 'Retention', 'RetentionPolicy', 'ReverbType', 'Robot', 'Role', 'RoleInfo', 'RoleInfoNotFoundException', 'RoleList', 'RoleNotFoundException', 'RoleResult', 'RoleStatus', 'RoleUnresolved', 'RoleUnresolvedList', 'RootPaneContainer', 'RootPaneUI', 'RoundRectangle2D', 'RoundRectangle2D.Double', 'RoundRectangle2D.Float', 'RoundingMode', 'RowMapper', 'RowSet', 'RowSetEvent', 'RowSetInternal', 'RowSetListener', 'RowSetMetaData', 'RowSetMetaDataImpl', 'RowSetReader', 'RowSetWarning', 'RowSetWriter', 'RuleBasedCollator', 'RunTime', 'RunTimeOperations', 'Runnable', 'Runtime', 'RuntimeErrorException', 'RuntimeException', 'RuntimeMBeanException', 'RuntimeMXBean', 'RuntimeOperationsException', 'RuntimePermission', 'SAXException', 'SAXNotRecognizedException', 'SAXNotSupportedException', 'SAXParseException', 'SAXParser', 'SAXParserFactory', 'SAXResult', 'SAXSource', 'SAXTransformerFactory', 'SERVANT_RETENTION_POLICY_ID', 'SQLData', 'SQLException', 'SQLInput', 'SQLInputImpl', 'SQLOutput', 'SQLOutputImpl', 'SQLPermission', 'SQLWarning', 'SSLContext', 'SSLContextSpi', 'SSLEngine', 'SSLEngineResult', 'SSLEngineResult.HandshakeStatus', 'SSLEngineResult.Status', 'SSLException', 'SSLHandshakeException', 'SSLKeyException', 'SSLPeerUnverifiedException', 'SSLPermission', 'SSLProtocolException', 'SSLServerSocket', 'SSLServerSocketFactory', 'SSLSession', 'SSLSessionBindingEvent', 'SSLSessionBindingListener', 'SSLSessionContext', 'SSLSocket', 'SSLSocketFactory', 'SUCCESSFUL', 'SYNC_WITH_TRANSPORT', 'SYSTEM_EXCEPTION', 'SampleModel', 'Sasl', 'SaslClient', 'SaslClientFactory', 'SaslException', 'SaslServer', 'SaslServerFactory', 'Savepoint', 'Scanner', 'ScatteringByteChannel', 'ScheduledExecutorService', 'ScheduledFuture', 'ScheduledThreadPoolExecutor', 'Schema', 'SchemaFactory', 'SchemaFactoryLoader', 'SchemaViolationException', 'ScrollBarUI', 'ScrollPane', 'ScrollPaneAdjustable', 'ScrollPaneConstants', 'ScrollPaneLayout', 'ScrollPaneLayout.UIResource', 'ScrollPaneUI', 'Scrollable', 'Scrollbar', 'SealedObject', 'SearchControls', 'SearchResult', 'SecretKey', 'SecretKeyFactory', 'SecretKeyFactorySpi', 'SecretKeySpec', 'SecureCacheResponse', 'SecureClassLoader', 'SecureRandom', 'SecureRandomSpi', 'Security', 'SecurityException', 'SecurityManager', 'SecurityPermission', 'Segment', 'SelectableChannel', 'SelectionKey', 'Selector', 'SelectorProvider', 'Semaphore', 'SeparatorUI', 'Sequence', 'SequenceInputStream', 'Sequencer', 'Sequencer.SyncMode', 'SerialArray', 'SerialBlob', 'SerialClob', 'SerialDatalink', 'SerialException', 'SerialJavaObject', 'SerialRef', 'SerialStruct', 'Serializable', 'SerializablePermission', 'Servant', 'ServantActivator', 'ServantActivatorHelper', 'ServantActivatorOperations', 'ServantActivatorPOA', 'ServantAlreadyActive', 'ServantAlreadyActiveHelper', 'ServantLocator', 'ServantLocatorHelper', 'ServantLocatorOperations', 'ServantLocatorPOA', 'ServantManager', 'ServantManagerOperations', 'ServantNotActive', 'ServantNotActiveHelper', 'ServantObject', 'ServantRetentionPolicy', 'ServantRetentionPolicyOperations', 'ServantRetentionPolicyValue', 'ServerCloneException', 'ServerError', 'ServerException', 'ServerIdHelper', 'ServerNotActiveException', 'ServerRef', 'ServerRequest', 'ServerRequestInfo', 'ServerRequestInfoOperations', 'ServerRequestInterceptor', 'ServerRequestInterceptorOperations', 'ServerRuntimeException', 'ServerSocket', 'ServerSocketChannel', 'ServerSocketFactory', 'ServiceContext', 'ServiceContextHelper', 'ServiceContextHolder', 'ServiceContextListHelper', 'ServiceContextListHolder', 'ServiceDetail', 'ServiceDetailHelper', 'ServiceIdHelper', 'ServiceInformation', 'ServiceInformationHelper', 'ServiceInformationHolder', 'ServiceNotFoundException', 'ServicePermission', 'ServiceRegistry', 'ServiceRegistry.Filter', 'ServiceUI', 'ServiceUIFactory', 'ServiceUnavailableException', 'Set', 'SetOfIntegerSyntax', 'SetOverrideType', 'SetOverrideTypeHelper', 'Severity', 'Shape', 'ShapeGraphicAttribute', 'SheetCollate', 'Short', 'ShortBuffer', 'ShortBufferException', 'ShortHolder', 'ShortLookupTable', 'ShortMessage', 'ShortSeqHelper', 'ShortSeqHolder', 'Sides', 'Signature', 'SignatureException', 'SignatureSpi', 'SignedObject', 'Signer', 'SimpleAttributeSet', 'SimpleBeanInfo', 'SimpleDateFormat', 'SimpleDoc', 'SimpleFormatter', 'SimpleTimeZone', 'SimpleType', 'SinglePixelPackedSampleModel', 'SingleSelectionModel', 'Size2DSyntax', 'SizeLimitExceededException', 'SizeRequirements', 'SizeSequence', 'Skeleton', 'SkeletonMismatchException', 'SkeletonNotFoundException', 'SliderUI', 'Socket', 'SocketAddress', 'SocketChannel', 'SocketException', 'SocketFactory', 'SocketHandler', 'SocketImpl', 'SocketImplFactory', 'SocketOptions', 'SocketPermission', 'SocketSecurityException', 'SocketTimeoutException', 'SoftBevelBorder', 'SoftReference', 'SortControl', 'SortKey', 'SortResponseControl', 'SortedMap', 'SortedSet', 'SortingFocusTraversalPolicy', 'Soundbank', 'SoundbankReader', 'SoundbankResource', 'Source', 'SourceDataLine', 'SourceLocator', 'SpinnerDateModel', 'SpinnerListModel', 'SpinnerModel', 'SpinnerNumberModel', 'SpinnerUI', 'SplitPaneUI', 'Spring', 'SpringLayout', 'SpringLayout.Constraints', 'SslRMIClientSocketFactory', 'SslRMIServerSocketFactory', 'Stack', 'StackOverflowError', 'StackTraceElement', 'StandardMBean', 'StartTlsRequest', 'StartTlsResponse', 'State', 'StateEdit', 'StateEditable', 'StateFactory', 'Statement', 'Statement', 'StreamCorruptedException', 'StreamHandler', 'StreamPrintService', 'StreamPrintServiceFactory', 'StreamResult', 'StreamSource', 'StreamTokenizer', 'Streamable', 'StreamableValue', 'StrictMath', 'String', 'StringBuffer', 'StringBufferInputStream', 'StringBuilder', 'StringCharacterIterator', 'StringContent', 'StringHolder', 'StringIndexOutOfBoundsException', 'StringMonitor', 'StringMonitorMBean', 'StringNameHelper', 'StringReader', 'StringRefAddr', 'StringSelection', 'StringSeqHelper', 'StringSeqHolder', 'StringTokenizer', 'StringValueExp', 'StringValueHelper', 'StringWriter', 'Stroke', 'Struct', 'StructMember', 'StructMemberHelper', 'Stub', 'StubDelegate', 'StubNotFoundException', 'Style', 'StyleConstants', 'StyleConstants.CharacterConstants', 'StyleConstants.ColorConstants', 'StyleConstants.FontConstants', 'StyleConstants.ParagraphConstants', 'StyleContext', 'StyleSheet', 'StyleSheet.BoxPainter', 'StyleSheet.ListPainter', 'StyledDocument', 'StyledEditorKit', 'StyledEditorKit.AlignmentAction', 'StyledEditorKit.BoldAction', 'StyledEditorKit.FontFamilyAction', 'StyledEditorKit.FontSizeAction', 'StyledEditorKit.ForegroundAction', 'StyledEditorKit.ItalicAction', 'StyledEditorKit.StyledTextAction', 'StyledEditorKit.UnderlineAction', 'Subject', 'SubjectDelegationPermission', 'SubjectDomainCombiner', 'SupportedValuesAttribute', 'SuppressWarnings', 'SwingConstants', 'SwingPropertyChangeSupport', 'SwingUtilities', 'SyncFactory', 'SyncFactoryException', 'SyncFailedException', 'SyncProvider', 'SyncProviderException', 'SyncResolver', 'SyncScopeHelper', 'SynchronousQueue', 'SynthConstants', 'SynthContext', 'SynthGraphicsUtils', 'SynthLookAndFeel', 'SynthPainter', 'SynthStyle', 'SynthStyleFactory', 'Synthesizer', 'SysexMessage', 'System', 'SystemColor', 'SystemException', 'SystemFlavorMap', 'TAG_ALTERNATE_IIOP_ADDRESS', 'TAG_CODE_SETS', 'TAG_INTERNET_IOP', 'TAG_JAVA_CODEBASE', 'TAG_MULTIPLE_COMPONENTS', 'TAG_ORB_TYPE', 'TAG_POLICIES', 'TAG_RMI_CUSTOM_MAX_STREAM_FORMAT', 'TCKind', 'THREAD_POLICY_ID', 'TIMEOUT', 'TRANSACTION_MODE', 'TRANSACTION_REQUIRED', 'TRANSACTION_ROLLEDBACK', 'TRANSACTION_UNAVAILABLE', 'TRANSIENT', 'TRANSPORT_RETRY', 'TabExpander', 'TabSet', 'TabStop', 'TabableView', 'TabbedPaneUI', 'TableCellEditor', 'TableCellRenderer', 'TableColumn', 'TableColumnModel', 'TableColumnModelEvent', 'TableColumnModelListener', 'TableHeaderUI', 'TableModel', 'TableModelEvent', 'TableModelListener', 'TableUI', 'TableView', 'TabularData', 'TabularDataSupport', 'TabularType', 'TagElement', 'TaggedComponent', 'TaggedComponentHelper', 'TaggedComponentHolder', 'TaggedProfile', 'TaggedProfileHelper', 'TaggedProfileHolder', 'Target', 'TargetDataLine', 'TargetedNotification', 'Templates', 'TemplatesHandler', 'Text', 'TextAction', 'TextArea', 'TextAttribute', 'TextComponent', 'TextEvent', 'TextField', 'TextHitInfo', 'TextInputCallback', 'TextLayout', 'TextLayout.CaretPolicy', 'TextListener', 'TextMeasurer', 'TextOutputCallback', 'TextSyntax', 'TextUI', 'TexturePaint', 'Thread', 'Thread.State', 'Thread.UncaughtExceptionHandler', 'ThreadDeath', 'ThreadFactory', 'ThreadGroup', 'ThreadInfo', 'ThreadLocal', 'ThreadMXBean', 'ThreadPolicy', 'ThreadPolicyOperations', 'ThreadPolicyValue', 'ThreadPoolExecutor', 'ThreadPoolExecutor.AbortPolicy', 'ThreadPoolExecutor.CallerRunsPolicy', 'ThreadPoolExecutor.DiscardOldestPolicy', 'ThreadPoolExecutor.DiscardPolicy', 'Throwable', 'Tie', 'TileObserver', 'Time', 'TimeLimitExceededException', 'TimeUnit', 'TimeZone', 'TimeoutException', 'Timer', 'Timer', 'Timer', 'TimerAlarmClockNotification', 'TimerMBean', 'TimerNotification', 'TimerTask', 'Timestamp', 'Timestamp', 'TitledBorder', 'TooManyListenersException', 'ToolBarUI', 'ToolTipManager', 'ToolTipUI', 'Toolkit', 'Track', 'TransactionRequiredException', 'TransactionRolledbackException', 'TransactionService', 'TransactionalWriter', 'TransferHandler', 'Transferable', 'TransformAttribute', 'Transformer', 'TransformerConfigurationException', 'TransformerException', 'TransformerFactory', 'TransformerFactoryConfigurationError', 'TransformerHandler', 'Transmitter', 'Transparency', 'TreeCellEditor', 'TreeCellRenderer', 'TreeExpansionEvent', 'TreeExpansionListener', 'TreeMap', 'TreeModel', 'TreeModelEvent', 'TreeModelListener', 'TreeNode', 'TreePath', 'TreeSelectionEvent', 'TreeSelectionListener', 'TreeSelectionModel', 'TreeSet', 'TreeUI', 'TreeWillExpandListener', 'TrustAnchor', 'TrustManager', 'TrustManagerFactory', 'TrustManagerFactorySpi', 'Type', 'TypeCode', 'TypeCodeHolder', 'TypeInfo', 'TypeInfoProvider', 'TypeMismatch', 'TypeMismatch', 'TypeMismatch', 'TypeMismatchHelper', 'TypeMismatchHelper', 'TypeNotPresentException', 'TypeVariable', 'Types', 'UID', 'UIDefaults', 'UIDefaults.ActiveValue', 'UIDefaults.LazyInputMap', 'UIDefaults.LazyValue', 'UIDefaults.ProxyLazyValue', 'UIManager', 'UIManager.LookAndFeelInfo', 'UIResource', 'ULongLongSeqHelper', 'ULongLongSeqHolder', 'ULongSeqHelper', 'ULongSeqHolder', 'UNKNOWN', 'UNKNOWN', 'UNSUPPORTED_POLICY', 'UNSUPPORTED_POLICY_VALUE', 'URI', 'URIException', 'URIResolver', 'URISyntax', 'URISyntaxException', 'URL', 'URLClassLoader', 'URLConnection', 'URLDecoder', 'URLEncoder', 'URLStreamHandler', 'URLStreamHandlerFactory', 'URLStringHelper', 'USER_EXCEPTION', 'UShortSeqHelper', 'UShortSeqHolder', 'UTFDataFormatException', 'UUID', 'UndeclaredThrowableException', 'UndoManager', 'UndoableEdit', 'UndoableEditEvent', 'UndoableEditListener', 'UndoableEditSupport', 'UnexpectedException', 'UnicastRemoteObject', 'UnionMember', 'UnionMemberHelper', 'UnknownEncoding', 'UnknownEncodingHelper', 'UnknownError', 'UnknownException', 'UnknownFormatConversionException', 'UnknownFormatFlagsException', 'UnknownGroupException', 'UnknownHostException', 'UnknownHostException', 'UnknownObjectException', 'UnknownServiceException', 'UnknownUserException', 'UnknownUserExceptionHelper', 'UnknownUserExceptionHolder', 'UnmappableCharacterException', 'UnmarshalException', 'UnmodifiableClassException', 'UnmodifiableSetException', 'UnrecoverableEntryException', 'UnrecoverableKeyException', 'Unreferenced', 'UnresolvedAddressException', 'UnresolvedPermission', 'UnsatisfiedLinkError', 'UnsolicitedNotification', 'UnsolicitedNotificationEvent', 'UnsolicitedNotificationListener', 'UnsupportedAddressTypeException', 'UnsupportedAudioFileException', 'UnsupportedCallbackException', 'UnsupportedCharsetException', 'UnsupportedClassVersionError', 'UnsupportedEncodingException', 'UnsupportedFlavorException', 'UnsupportedLookAndFeelException', 'UnsupportedOperationException', 'UserDataHandler', 'UserException', 'Util', 'UtilDelegate', 'Utilities', 'VMID', 'VM_ABSTRACT', 'VM_CUSTOM', 'VM_NONE', 'VM_TRUNCATABLE', 'Validator', 'ValidatorHandler', 'ValueBase', 'ValueBaseHelper', 'ValueBaseHolder', 'ValueExp', 'ValueFactory', 'ValueHandler', 'ValueHandlerMultiFormat', 'ValueInputStream', 'ValueMember', 'ValueMemberHelper', 'ValueOutputStream', 'VariableHeightLayoutCache', 'Vector', 'VerifyError', 'VersionSpecHelper', 'VetoableChangeListener', 'VetoableChangeListenerProxy', 'VetoableChangeSupport', 'View', 'ViewFactory', 'ViewportLayout', 'ViewportUI', 'VirtualMachineError', 'Visibility', 'VisibilityHelper', 'VoiceStatus', 'Void', 'VolatileImage', 'WCharSeqHelper', 'WCharSeqHolder', 'WStringSeqHelper', 'WStringSeqHolder', 'WStringValueHelper', 'WeakHashMap', 'WeakReference', 'WebRowSet', 'WildcardType', 'Window', 'WindowAdapter', 'WindowConstants', 'WindowEvent', 'WindowFocusListener', 'WindowListener', 'WindowStateListener', 'WrappedPlainView', 'WritableByteChannel', 'WritableRaster', 'WritableRenderedImage', 'WriteAbortedException', 'Writer', 'WrongAdapter', 'WrongAdapterHelper', 'WrongPolicy', 'WrongPolicyHelper', 'WrongTransaction', 'WrongTransactionHelper', 'WrongTransactionHolder', 'X500Principal', 'X500PrivateCredential', 'X509CRL', 'X509CRLEntry', 'X509CRLSelector', 'X509CertSelector', 'X509Certificate', 'X509Certificate', 'X509EncodedKeySpec', 'X509ExtendedKeyManager', 'X509Extension', 'X509KeyManager', 'X509TrustManager', 'XAConnection', 'XADataSource', 'XAException', 'XAResource', 'XMLConstants', 'XMLDecoder', 'XMLEncoder', 'XMLFilter', 'XMLFilterImpl', 'XMLFormatter', 'XMLGregorianCalendar', 'XMLParseException', 'XMLReader', 'XMLReaderAdapter', 'XMLReaderFactory', 'XPath', 'XPathConstants', 'XPathException', 'XPathExpression', 'XPathExpressionException', 'XPathFactory', 'XPathFactoryConfigurationException', 'XPathFunction', 'XPathFunctionException', 'XPathFunctionResolver', 'XPathVariableResolver', 'Xid', 'XmlReader', 'XmlWriter', 'ZipEntry', 'ZipException', 'ZipFile', 'ZipInputStream', 'ZipOutputStream', 'ZoneView', '_BindingIteratorImplBase', '_BindingIteratorStub', '_DynAnyFactoryStub', '_DynAnyStub', '_DynArrayStub', '_DynEnumStub', '_DynFixedStub', '_DynSequenceStub', '_DynStructStub', '_DynUnionStub', '_DynValueStub', '_IDLTypeStub', '_NamingContextExtStub', '_NamingContextImplBase', '_NamingContextStub', '_PolicyStub', '_Remote_Stub', '_ServantActivatorStub', '_ServantLocatorStub', ); $self->listAdd('keywords', '@interface', 'abstract', 'break', 'case', 'catch', 'class', 'continue', 'default', 'do', 'else', 'enum', 'extends', 'false', 'finally', 'for', 'goto', 'if', 'implements', 'instanceof', 'interface', 'native', 'new', 'null', 'private', 'protected', 'public', 'return', 'strictfp', 'super', 'switch', 'synchronized', 'this', 'throw', 'throws', 'transient', 'true', 'try', 'volatile', 'while', ); $self->listAdd('types', 'boolean', 'byte', 'char', 'const', 'double', 'final', 'float', 'int', 'long', 'short', 'static', 'void', ); $self->contextdata({ 'Commentar 1' => { callback => \&parseCommentar1, attribute => 'Comment', lineending => '#pop', }, 'Commentar 2' => { callback => \&parseCommentar2, attribute => 'Comment', }, 'Imports' => { callback => \&parseImports, attribute => 'Normal Text', lineending => '#pop', }, 'Member' => { callback => \&parseMember, attribute => 'Normal Text', lineending => '#pop', fallthrough => '#pop', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'Printf' => { callback => \&parsePrintf, attribute => 'Printf', lineending => '#pop', }, 'PrintfString' => { callback => \&parsePrintfString, attribute => 'PrintfString', lineending => '#pop', }, 'StaticImports' => { callback => \&parseStaticImports, attribute => 'Normal Text', lineending => '#pop', }, 'String' => { callback => \&parseString, attribute => 'String', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Java'; } sub parseCommentar1 { my ($self, $text) = @_; return 0; }; sub parseCommentar2 { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # endRegion => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseImports { my ($self, $text) = @_; # String => '\s*.*$' # attribute => 'Imports' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*.*$', 0, 0, 0, undef, 0, '#pop', 'Imports')) { return 1 } return 0; }; sub parseMember { my ($self, $text) = @_; # String => '\b[_a-zA-Z]\w*(?=[\s]*)' # attribute => 'Function' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b[_a-zA-Z]\\w*(?=[\\s]*)', 0, 0, 0, undef, 0, '#pop', 'Function')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # context => '##Javadoc' # type => 'IncludeRules' if ($self->includePlugin('Javadoc', $text)) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'types' # attribute => 'Data Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => 'java15' # attribute => 'Java15' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'java15', 0, undef, 0, '#stay', 'Java15')) { return 1 } # attribute => 'Float' # context => '#stay' # items => 'ARRAY(0x1739d60)' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { # String => 'fF' # attribute => 'Float' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, 'fF', 0, 0, undef, 0, '#stay', 'Float')) { return 1 } } # attribute => 'Octal' # context => '#stay' # type => 'HlCOct' if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) { return 1 } # attribute => 'Hex' # context => '#stay' # type => 'HlCHex' if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) { return 1 } # attribute => 'Decimal' # context => '#stay' # items => 'ARRAY(0x12b6ff0)' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { # String => 'ULL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'ULL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LUL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LUL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LLU' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LLU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'UL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'UL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LU' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'U' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'U', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'L' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'L', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } } # attribute => 'Char' # context => '#stay' # type => 'HlCChar' if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) { return 1 } # String => '//\s*BEGIN.*$' # attribute => 'Decimal' # beginRegion => 'Region1' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '//\\s*BEGIN.*$', 0, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => '//\s*END.*$' # attribute => 'Decimal' # context => '#stay' # endRegion => 'Region1' # type => 'RegExpr' if ($self->testRegExpr($text, '//\\s*END.*$', 0, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # String => '\.(format|printf)\b' # attribute => 'Function' # context => 'Printf' # type => 'RegExpr' if ($self->testRegExpr($text, '\\.(format|printf)\\b', 0, 0, 0, undef, 0, 'Printf', 'Function')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Commentar 1' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) { return 1 } # attribute => 'Comment' # beginRegion => 'Comment' # char => '/' # char1 => '*' # context => 'Commentar 2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) { return 1 } # attribute => 'Symbol' # beginRegion => 'Brace1' # char => '{' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # attribute => 'Symbol' # char => '}' # context => '#stay' # endRegion => 'Brace1' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # String => '\.{3,3}\s+' # attribute => 'Keyword' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\.{3,3}\\s+', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\b(import\s+static)\b' # attribute => 'Keyword' # context => 'StaticImports' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(import\\s+static)\\b', 0, 0, 0, undef, 0, 'StaticImports', 'Keyword')) { return 1 } # String => '\b(package|import)\b' # attribute => 'Keyword' # context => 'Imports' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(package|import)\\b', 0, 0, 0, undef, 0, 'Imports', 'Keyword')) { return 1 } # String => '\b[_\w][_\w\d]*(?=[\s]*(/\*\s*\d+\s*\*/\s*)?[(])' # attribute => 'Function' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b[_\\w][_\\w\\d]*(?=[\\s]*(/\\*\\s*\\d+\\s*\\*/\\s*)?[(])', 0, 0, 0, undef, 0, '#stay', 'Function')) { return 1 } # String => '[.]{1,1}' # attribute => 'Symbol' # context => 'Member' # type => 'RegExpr' if ($self->testRegExpr($text, '[.]{1,1}', 0, 0, 0, undef, 0, 'Member', 'Symbol')) { return 1 } # String => ':!%&()+,-/.*<=>?[]|~^;' # attribute => 'Symbol' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, ':!%&()+,-/.*<=>?[]|~^;', 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } return 0; }; sub parsePrintf { my ($self, $text) = @_; # attribute => 'Normal Text' # char => ';' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } # attribute => 'String' # char => '"' # context => 'PrintfString' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'PrintfString', 'String')) { return 1 } return 0; }; sub parsePrintfString { my ($self, $text) = @_; # attribute => 'String' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) { return 1 } # attribute => 'String Char' # context => '#stay' # type => 'HlCStringChar' if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } # String => '%(\d+\$)?(-|#|\+|\ |0|,|\()*\d*(\.\d+)?[a-hosxA-CEGHSX]' # attribute => 'String Char' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '%(\\d+\\$)?(-|#|\\+|\\ |0|,|\\()*\\d*(\\.\\d+)?[a-hosxA-CEGHSX]', 0, 0, 0, undef, 0, '#stay', 'String Char')) { return 1 } # String => '%(\d+\$)?(-|#|\+|\ |0|,|\()*\d*(t|T)(a|A|b|B|c|C|d|D|e|F|h|H|I|j|k|l|L|m|M|N|p|P|Q|r|R|s|S|T|y|Y|z|Z)' # attribute => 'String Char' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '%(\\d+\\$)?(-|#|\\+|\\ |0|,|\\()*\\d*(t|T)(a|A|b|B|c|C|d|D|e|F|h|H|I|j|k|l|L|m|M|N|p|P|Q|r|R|s|S|T|y|Y|z|Z)', 0, 0, 0, undef, 0, '#stay', 'String Char')) { return 1 } # String => '%(%|n)' # attribute => 'String Char' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '%(%|n)', 0, 0, 0, undef, 0, '#stay', 'String Char')) { return 1 } return 0; }; sub parseStaticImports { my ($self, $text) = @_; # String => '\s*.*$' # attribute => 'StaticImports' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*.*$', 0, 0, 0, undef, 0, '#pop', 'StaticImports')) { return 1 } return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) { return 1 } # attribute => 'String Char' # context => '#stay' # type => 'HlCStringChar' if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Java - a Plugin for Java syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Java; my $sh = new Syntax::Highlight::Engine::Kate::Java([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Java is a plugin module that provides syntax highlighting for Java to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Literate_Haskell.pm0000644000175000017500000003220613226470762030074 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'literate-haskell.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.04 #kate version 2.4 #kate author Marcel Martin (mmar@freenet.de) #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::Literate_Haskell; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Char' => 'Char', 'Class' => 'Keyword', 'Comment' => 'Comment', 'Constructor' => 'Others', 'Data Constructor' => 'Keyword', 'Decimal' => 'DecVal', 'Float' => 'Float', 'Function' => 'Function', 'Function Definition' => 'Function', 'Infix Operator' => 'Others', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Special' => 'Char', 'String' => 'String', 'Type Constructor' => 'DataType', }); $self->listAdd('classes', 'Bounded', 'Enum', 'Eq', 'Floating', 'Fractional', 'Functor', 'Integral', 'Ix', 'Monad', 'Num', 'Ord', 'Read', 'Real', 'RealFloat', 'RealFrac', 'Show', ); $self->listAdd('data constructors', 'EQ', 'False', 'GT', 'Just', 'LT', 'Left', 'Nothing', 'Right', 'True', ); $self->listAdd('functions', 'FilePath', 'IOError', 'abs', 'acos', 'acosh', 'all', 'and', 'any', 'appendFile', 'approxRational', 'asTypeOf', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'basicIORun', 'break', 'catch', 'ceiling', 'chr', 'compare', 'concat', 'concatMap', 'const', 'cos', 'cosh', 'curry', 'cycle', 'decodeFloat', 'denominator', 'digitToInt', 'div', 'divMod', 'drop', 'dropWhile', 'either', 'elem', 'encodeFloat', 'enumFrom', 'enumFromThen', 'enumFromThenTo', 'enumFromTo', 'error', 'even', 'exp', 'exponent', 'fail', 'filter', 'flip', 'floatDigits', 'floatRadix', 'floatRange', 'floor', 'fmap', 'foldl', 'foldl1', 'foldr', 'foldr1', 'fromDouble', 'fromEnum', 'fromInt', 'fromInteger', 'fromIntegral', 'fromRational', 'fst', 'gcd', 'getChar', 'getContents', 'getLine', 'head', 'id', 'inRange', 'index', 'init', 'intToDigit', 'interact', 'ioError', 'isAlpha', 'isAlphaNum', 'isAscii', 'isControl', 'isDenormalized', 'isDigit', 'isHexDigit', 'isIEEE', 'isInfinite', 'isLower', 'isNaN', 'isNegativeZero', 'isOctDigit', 'isPrint', 'isSpace', 'isUpper', 'iterate', 'last', 'lcm', 'length', 'lex', 'lexDigits', 'lexLitChar', 'lines', 'log', 'logBase', 'lookup', 'map', 'mapM', 'mapM_', 'max', 'maxBound', 'maximum', 'maybe', 'min', 'minBound', 'minimum', 'mod', 'negate', 'not', 'notElem', 'null', 'numerator', 'odd', 'or', 'ord', 'otherwise', 'pi', 'pred', 'primExitWith', 'print', 'product', 'properFraction', 'putChar', 'putStr', 'putStrLn', 'quot', 'quotRem', 'range', 'rangeSize', 'read', 'readDec', 'readFile', 'readFloat', 'readHex', 'readIO', 'readInt', 'readList', 'readLitChar', 'readLn', 'readOct', 'readParen', 'readSigned', 'reads', 'readsPrec', 'realToFrac', 'recip', 'rem', 'repeat', 'replicate', 'return', 'reverse', 'round', 'scaleFloat', 'scanl', 'scanl1', 'scanr', 'scanr1', 'seq', 'sequence', 'sequence_', 'show', 'showChar', 'showInt', 'showList', 'showLitChar', 'showParen', 'showSigned', 'showString', 'shows', 'showsPrec', 'significand', 'signum', 'sin', 'sinh', 'snd', 'span', 'splitAt', 'sqrt', 'subtract', 'succ', 'sum', 'tail', 'take', 'takeWhile', 'tan', 'tanh', 'threadToIOResult', 'toEnum', 'toInt', 'toInteger', 'toLower', 'toRational', 'toUpper', 'truncate', 'uncurry', 'undefined', 'unlines', 'until', 'unwords', 'unzip', 'unzip3', 'userError', 'words', 'writeFile', 'zip', 'zip3', 'zipWith', 'zipWith3', ); $self->listAdd('infix operators', 'div', 'elem', 'mod', 'notElem', 'quot', 'rem', 'seq', ); $self->listAdd('keywords', 'case', 'class', 'data', 'deriving', 'do', 'else', 'if', 'in', 'infixl', 'infixr', 'instance', 'let', 'module', 'of', 'primitive', 'then', 'type', 'where', ); $self->listAdd('type constructors', 'Bool', 'Char', 'Double', 'Either', 'Float', 'IO', 'Int', 'Integer', 'Maybe', 'Ordering', 'Ratio', 'Rational', 'ReadS', 'ShowS', 'String', ); $self->contextdata({ 'comment_multi_line' => { callback => \&parsecomment_multi_line, attribute => 'Comment', }, 'comment_single_line' => { callback => \&parsecomment_single_line, attribute => 'Comment', lineending => '#pop', }, 'function_definition' => { callback => \&parsefunction_definition, attribute => 'Function Definition', lineending => '#pop', }, 'infix' => { callback => \&parseinfix, attribute => 'Infix Operator', }, 'literate-normal' => { callback => \&parseliteratenormal, attribute => 'Comment', }, 'normal' => { callback => \&parsenormal, attribute => 'Normal Text', lineending => 'literate-normal', }, 'single_char' => { callback => \&parsesingle_char, attribute => 'Char', lineending => '#pop', }, 'string' => { callback => \&parsestring, attribute => 'String', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('literate-normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Literate Haskell'; } sub parsecomment_multi_line { my ($self, $text) = @_; # attribute => 'Comment' # char => '-' # char1 => '}' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '-', '}', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parsecomment_single_line { my ($self, $text) = @_; return 0; }; sub parsefunction_definition { my ($self, $text) = @_; # attribute => 'Function Definition' # char => ';' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'Function Definition')) { return 1 } return 0; }; sub parseinfix { my ($self, $text) = @_; # attribute => 'Infix Operator' # char => '`' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, '#pop', 'Infix Operator')) { return 1 } return 0; }; sub parseliteratenormal { my ($self, $text) = @_; # attribute => 'Special' # char => '>' # column => '0' # context => 'normal' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, 0, 0, 'normal', 'Special')) { return 1 } return 0; }; sub parsenormal { my ($self, $text) = @_; # attribute => 'Comment' # char => '{' # char1 => '-' # context => 'comment_multi_line' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '{', '-', 0, 0, 0, undef, 0, 'comment_multi_line', 'Comment')) { return 1 } # attribute => 'Comment' # char => '-' # char1 => '-' # context => 'comment_single_line' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, 'comment_single_line', 'Comment')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'classes' # attribute => 'Class' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'classes', 0, undef, 0, '#stay', 'Class')) { return 1 } # String => 'type constructors' # attribute => 'Type Constructor' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'type constructors', 0, undef, 0, '#stay', 'Type Constructor')) { return 1 } # String => 'functions' # attribute => 'Function' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) { return 1 } # String => 'data constructors' # attribute => 'Data Constructor' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'data constructors', 0, undef, 0, '#stay', 'Data Constructor')) { return 1 } # attribute => 'String' # char => '"' # context => 'string' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'String')) { return 1 } # attribute => 'Infix Operator' # char => '`' # context => 'infix' # type => 'DetectChar' if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, 'infix', 'Infix Operator')) { return 1 } # String => '\w[']+' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\w[\']+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Char' # char => ''' # context => 'single_char' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'single_char', 'Char')) { return 1 } # String => '\s*[a-z_]+\w*'*\s*::' # attribute => 'Function Definition' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*[a-z_]+\\w*\'*\\s*::', 0, 0, 0, undef, 0, '#stay', 'Function Definition')) { return 1 } # attribute => 'Float' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { return 1 } # attribute => 'Decimal' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { return 1 } return 0; }; sub parsesingle_char { my ($self, $text) = @_; # String => '\\.' # attribute => 'Char' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'Char' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Char')) { return 1 } return 0; }; sub parsestring { my ($self, $text) = @_; # String => '\\.' # attribute => 'String' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'String')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Literate_Haskell - a Plugin for Literate Haskell syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Literate_Haskell; my $sh = new Syntax::Highlight::Engine::Kate::Literate_Haskell([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Literate_Haskell is a plugin module that provides syntax highlighting for Literate Haskell to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Javadoc.pm0000644000175000017500000004613613226470762026236 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'javadoc.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.03 #kate version 2.4 #kate author Alfredo Luiz Foltran Fialho (alfoltran@ig.com.br) #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::Javadoc; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'BlockTag' => 'Keyword', 'InlineTag' => 'Keyword', 'Javadoc' => 'Comment', 'JavadocFS' => 'Comment', 'JavadocParam' => 'Keyword', 'Normal Text' => 'Normal', 'SeeTag' => 'Keyword', }); $self->contextdata({ 'FindJavadoc' => { callback => \&parseFindJavadoc, attribute => 'Normal Text', }, 'InlineTagar' => { callback => \&parseInlineTagar, attribute => 'InlineTag', lineending => '#pop', }, 'JavadocFSar' => { callback => \&parseJavadocFSar, attribute => 'JavadocFS', }, 'JavadocParam' => { callback => \&parseJavadocParam, attribute => 'Javadoc', lineending => '#pop', }, 'Javadocar' => { callback => \&parseJavadocar, attribute => 'Javadoc', }, 'LiteralTagar' => { callback => \&parseLiteralTagar, attribute => 'InlineTag', lineending => '#pop', }, 'SeeTag' => { callback => \&parseSeeTag, attribute => 'SeeTag', lineending => '#pop', }, 'Start' => { callback => \&parseStart, attribute => 'Normal Text', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Start'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Javadoc'; } sub parseFindJavadoc { my ($self, $text) = @_; # String => '/**' # attribute => 'JavadocFS' # beginRegion => 'Javadoc' # context => 'JavadocFSar' # type => 'StringDetect' if ($self->testStringDetect($text, '/**', 0, 0, 0, undef, 0, 'JavadocFSar', 'JavadocFS')) { return 1 } return 0; }; sub parseInlineTagar { my ($self, $text) = @_; # attribute => 'InlineTag' # char => '}' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'InlineTag')) { return 1 } # attribute => 'JavadocFS' # char => '*' # char1 => '/' # context => '#pop#pop#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop#pop#pop', 'JavadocFS')) { return 1 } # context => '##HTML' # type => 'IncludeRules' if ($self->includePlugin('HTML', $text)) { return 1 } return 0; }; sub parseJavadocFSar { my ($self, $text) = @_; # attribute => 'JavadocFS' # char => '*' # char1 => '/' # context => '#pop' # endRegion => 'Javadoc' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'JavadocFS')) { return 1 } # String => '(!|\?)' # attribute => 'JavadocFS' # context => 'Javadocar' # type => 'RegExpr' if ($self->testRegExpr($text, '(!|\\?)', 0, 0, 0, undef, 0, 'Javadocar', 'JavadocFS')) { return 1 } # String => '(\.\s*$)' # attribute => 'JavadocFS' # context => 'Javadocar' # type => 'RegExpr' if ($self->testRegExpr($text, '(\\.\\s*$)', 0, 0, 0, undef, 0, 'Javadocar', 'JavadocFS')) { return 1 } # String => '(\.\s)(?![\da-z])' # attribute => 'JavadocFS' # context => 'Javadocar' # type => 'RegExpr' if ($self->testRegExpr($text, '(\\.\\s)(?![\\da-z])', 0, 0, 0, undef, 0, 'Javadocar', 'JavadocFS')) { return 1 } # String => '\**\s*(?=@(author|deprecated|exception|param|return|see|serial|serialData|serialField|since|throws|version)(\s|$))' # attribute => 'JavadocFS' # context => 'Javadocar' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\**\\s*(?=@(author|deprecated|exception|param|return|see|serial|serialData|serialField|since|throws|version)(\\s|$))', 0, 0, 0, undef, 1, 'Javadocar', 'JavadocFS')) { return 1 } # String => '{@code ' # attribute => 'InlineTag' # context => 'LiteralTagar' # type => 'StringDetect' if ($self->testStringDetect($text, '{@code ', 0, 0, 0, undef, 0, 'LiteralTagar', 'InlineTag')) { return 1 } # String => '{@code ' # attribute => 'InlineTag' # context => 'LiteralTagar' # type => 'StringDetect' if ($self->testStringDetect($text, '{@code ', 0, 0, 0, undef, 0, 'LiteralTagar', 'InlineTag')) { return 1 } # String => '{@docRoot}' # attribute => 'InlineTag' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '{@docRoot}', 0, 0, 0, undef, 0, '#stay', 'InlineTag')) { return 1 } # String => '{@inheritDoc}' # attribute => 'InlineTag' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '{@inheritDoc}', 0, 0, 0, undef, 0, '#stay', 'InlineTag')) { return 1 } # String => '{@link ' # attribute => 'InlineTag' # context => 'InlineTagar' # type => 'StringDetect' if ($self->testStringDetect($text, '{@link ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) { return 1 } # String => '{@link ' # attribute => 'InlineTag' # context => 'InlineTagar' # type => 'StringDetect' if ($self->testStringDetect($text, '{@link ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) { return 1 } # String => '{@linkplain ' # attribute => 'InlineTag' # context => 'InlineTagar' # type => 'StringDetect' if ($self->testStringDetect($text, '{@linkplain ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) { return 1 } # String => '{@linkplain ' # attribute => 'InlineTag' # context => 'InlineTagar' # type => 'StringDetect' if ($self->testStringDetect($text, '{@linkplain ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) { return 1 } # String => '{@literal ' # attribute => 'InlineTag' # context => 'LiteralTagar' # type => 'StringDetect' if ($self->testStringDetect($text, '{@literal ', 0, 0, 0, undef, 0, 'LiteralTagar', 'InlineTag')) { return 1 } # String => '{@literal ' # attribute => 'InlineTag' # context => 'LiteralTagar' # type => 'StringDetect' if ($self->testStringDetect($text, '{@literal ', 0, 0, 0, undef, 0, 'LiteralTagar', 'InlineTag')) { return 1 } # String => '{@value}' # attribute => 'InlineTag' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '{@value}', 0, 0, 0, undef, 0, '#stay', 'InlineTag')) { return 1 } # String => '{@value ' # attribute => 'InlineTag' # context => 'InlineTagar' # type => 'StringDetect' if ($self->testStringDetect($text, '{@value ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) { return 1 } # String => '{@value ' # attribute => 'InlineTag' # context => 'InlineTagar' # type => 'StringDetect' if ($self->testStringDetect($text, '{@value ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) { return 1 } # context => '##HTML' # type => 'IncludeRules' if ($self->includePlugin('HTML', $text)) { return 1 } return 0; }; sub parseJavadocParam { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # String => '\S*(?=\*/)' # attribute => 'JavadocParam' # context => '#pop#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\S*(?=\\*/)', 0, 0, 0, undef, 0, '#pop#pop', 'JavadocParam')) { return 1 } # String => '\S*(\s|$)' # attribute => 'JavadocParam' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\S*(\\s|$)', 0, 0, 0, undef, 0, '#pop', 'JavadocParam')) { return 1 } return 0; }; sub parseJavadocar { my ($self, $text) = @_; # attribute => 'JavadocFS' # char => '*' # char1 => '/' # context => '#pop#pop' # endRegion => 'Javadoc' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop#pop', 'JavadocFS')) { return 1 } # String => '\*+(?!/)' # attribute => 'JavadocFS' # context => '#stay' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\*+(?!/)', 0, 0, 0, undef, 1, '#stay', 'JavadocFS')) { return 1 } # String => '@author ' # attribute => 'BlockTag' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '@author ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) { return 1 } # String => '@deprecated ' # attribute => 'BlockTag' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '@deprecated ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) { return 1 } # String => '@exception ' # attribute => 'BlockTag' # context => 'JavadocParam' # type => 'StringDetect' if ($self->testStringDetect($text, '@exception ', 0, 0, 0, undef, 0, 'JavadocParam', 'BlockTag')) { return 1 } # String => '@param ' # attribute => 'BlockTag' # context => 'JavadocParam' # type => 'StringDetect' if ($self->testStringDetect($text, '@param ', 0, 0, 0, undef, 0, 'JavadocParam', 'BlockTag')) { return 1 } # String => '@return ' # attribute => 'BlockTag' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '@return ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) { return 1 } # String => '@see ' # attribute => 'BlockTag' # context => 'SeeTag' # type => 'StringDetect' if ($self->testStringDetect($text, '@see ', 0, 0, 0, undef, 0, 'SeeTag', 'BlockTag')) { return 1 } # String => '@serial ' # attribute => 'BlockTag' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '@serial ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) { return 1 } # String => '@serialData ' # attribute => 'BlockTag' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '@serialData ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) { return 1 } # String => '@serialField ' # attribute => 'BlockTag' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '@serialField ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) { return 1 } # String => '@since ' # attribute => 'BlockTag' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '@since ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) { return 1 } # String => '@throws ' # attribute => 'BlockTag' # context => 'JavadocParam' # type => 'StringDetect' if ($self->testStringDetect($text, '@throws ', 0, 0, 0, undef, 0, 'JavadocParam', 'BlockTag')) { return 1 } # String => '@version ' # attribute => 'BlockTag' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '@version ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) { return 1 } # String => '@author ' # attribute => 'BlockTag' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '@author ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) { return 1 } # String => '@deprecated ' # attribute => 'BlockTag' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '@deprecated ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) { return 1 } # String => '@exception ' # attribute => 'BlockTag' # context => 'JavadocParam' # type => 'StringDetect' if ($self->testStringDetect($text, '@exception ', 0, 0, 0, undef, 0, 'JavadocParam', 'BlockTag')) { return 1 } # String => '@param ' # attribute => 'BlockTag' # context => 'JavadocParam' # type => 'StringDetect' if ($self->testStringDetect($text, '@param ', 0, 0, 0, undef, 0, 'JavadocParam', 'BlockTag')) { return 1 } # String => '@return ' # attribute => 'BlockTag' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '@return ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) { return 1 } # String => '@see ' # attribute => 'BlockTag' # context => 'SeeTag' # type => 'StringDetect' if ($self->testStringDetect($text, '@see ', 0, 0, 0, undef, 0, 'SeeTag', 'BlockTag')) { return 1 } # String => '@serial ' # attribute => 'BlockTag' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '@serial ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) { return 1 } # String => '@serialData ' # attribute => 'BlockTag' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '@serialData ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) { return 1 } # String => '@serialField ' # attribute => 'BlockTag' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '@serialField ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) { return 1 } # String => '@since ' # attribute => 'BlockTag' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '@since ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) { return 1 } # String => '@throws ' # attribute => 'BlockTag' # context => 'JavadocParam' # type => 'StringDetect' if ($self->testStringDetect($text, '@throws ', 0, 0, 0, undef, 0, 'JavadocParam', 'BlockTag')) { return 1 } # String => '@version ' # attribute => 'BlockTag' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '@version ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) { return 1 } # String => '{@code ' # attribute => 'InlineTag' # context => 'LiteralTagar' # type => 'StringDetect' if ($self->testStringDetect($text, '{@code ', 0, 0, 0, undef, 0, 'LiteralTagar', 'InlineTag')) { return 1 } # String => '{@code ' # attribute => 'InlineTag' # context => 'LiteralTagar' # type => 'StringDetect' if ($self->testStringDetect($text, '{@code ', 0, 0, 0, undef, 0, 'LiteralTagar', 'InlineTag')) { return 1 } # String => '{@docRoot}' # attribute => 'InlineTag' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '{@docRoot}', 0, 0, 0, undef, 0, '#stay', 'InlineTag')) { return 1 } # String => '{@inheritDoc}' # attribute => 'InlineTag' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '{@inheritDoc}', 0, 0, 0, undef, 0, '#stay', 'InlineTag')) { return 1 } # String => '{@link ' # attribute => 'InlineTag' # context => 'InlineTagar' # type => 'StringDetect' if ($self->testStringDetect($text, '{@link ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) { return 1 } # String => '{@link ' # attribute => 'InlineTag' # context => 'InlineTagar' # type => 'StringDetect' if ($self->testStringDetect($text, '{@link ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) { return 1 } # String => '{@linkplain ' # attribute => 'InlineTag' # context => 'InlineTagar' # type => 'StringDetect' if ($self->testStringDetect($text, '{@linkplain ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) { return 1 } # String => '{@linkplain ' # attribute => 'InlineTag' # context => 'InlineTagar' # type => 'StringDetect' if ($self->testStringDetect($text, '{@linkplain ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) { return 1 } # String => '{@literal ' # attribute => 'InlineTag' # context => 'LiteralTagar' # type => 'StringDetect' if ($self->testStringDetect($text, '{@literal ', 0, 0, 0, undef, 0, 'LiteralTagar', 'InlineTag')) { return 1 } # String => '{@literal ' # attribute => 'InlineTag' # context => 'LiteralTagar' # type => 'StringDetect' if ($self->testStringDetect($text, '{@literal ', 0, 0, 0, undef, 0, 'LiteralTagar', 'InlineTag')) { return 1 } # String => '{@value}' # attribute => 'InlineTag' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '{@value}', 0, 0, 0, undef, 0, '#stay', 'InlineTag')) { return 1 } # String => '{@value ' # attribute => 'InlineTag' # context => 'InlineTagar' # type => 'StringDetect' if ($self->testStringDetect($text, '{@value ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) { return 1 } # String => '{@value ' # attribute => 'InlineTag' # context => 'InlineTagar' # type => 'StringDetect' if ($self->testStringDetect($text, '{@value ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) { return 1 } # context => '##HTML' # type => 'IncludeRules' if ($self->includePlugin('HTML', $text)) { return 1 } return 0; }; sub parseLiteralTagar { my ($self, $text) = @_; # attribute => 'InlineTag' # char => '}' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'InlineTag')) { return 1 } # attribute => 'JavadocFS' # char => '*' # char1 => '/' # context => '#pop#pop#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop#pop#pop', 'JavadocFS')) { return 1 } return 0; }; sub parseSeeTag { my ($self, $text) = @_; # attribute => 'JavadocFS' # char => '*' # char1 => '/' # context => '#pop#pop#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop#pop#pop', 'JavadocFS')) { return 1 } # context => '##HTML' # type => 'IncludeRules' if ($self->includePlugin('HTML', $text)) { return 1 } return 0; }; sub parseStart { my ($self, $text) = @_; # context => 'FindJavadoc' # type => 'IncludeRules' if ($self->includeRules('FindJavadoc', $text)) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Javadoc - a Plugin for Javadoc syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Javadoc; my $sh = new Syntax::Highlight::Engine::Kate::Javadoc([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Javadoc is a plugin module that provides syntax highlighting for Javadoc to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/REXX.pm0000644000175000017500000001704213226470762025447 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'rexx.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.01 #kate version 2.3 #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::REXX; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Alert' => 'Alert', 'Built In' => 'Normal', 'Comment' => 'Comment', 'Function' => 'Function', 'Instructions' => 'Keyword', 'Normal Text' => 'Normal', 'String' => 'String', 'Symbol' => 'Normal', }); $self->listAdd('builtin', 'abbrev', 'abs', 'address', 'b2x', 'bitand', 'bitor', 'bitxor', 'c2d', 'c2x', 'center', 'charin', 'charout', 'chars', 'compare', 'condition', 'copies', 'd2c', 'd2x', 'datatype', 'date', 'delstr', 'delword', 'digits', 'errortext', 'form', 'format', 'fuzz', 'insert', 'lastpos', 'left', 'linein', 'lineout', 'lines', 'max', 'min', 'overlay', 'pos', 'queued', 'random', 'reverse', 'right', 'sign', 'sourceline', 'space', 'stream', 'strip', 'substr', 'subword', 'symbol', 'time', 'trace', 'translate', 'trunc', 'value', 'verify', 'word', 'wordindex', 'wordlength', 'wordpos', 'words', 'x2b', 'x2c', 'x2d', 'xrange', ); $self->listAdd('instructions', 'arg', 'drop', 'else', 'end', 'exit', 'forever', 'if', 'interpret', 'iterate', 'leave', 'nop', 'options', 'otherwise', 'pull', 'push', 'queue', 'return', 'say', 'select', 'syntax', 'then', ); $self->contextdata({ 'Commentar 1' => { callback => \&parseCommentar1, attribute => 'Comment', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'String' => { callback => \&parseString, attribute => 'String', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'REXX'; } sub parseCommentar1 { my ($self, $text) = @_; # String => '(FIXME|TODO)' # attribute => 'Alert' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) { return 1 } # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # endRegion => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # String => 'instructions' # attribute => 'Instructions' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'instructions', 0, undef, 0, '#stay', 'Instructions')) { return 1 } # String => 'builtin' # attribute => 'Built In' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'builtin', 0, undef, 0, '#stay', 'Built In')) { return 1 } # String => '\bsignal([\s]*(on|off)[\s]*(error|failure|halt|notready|novalue|syntax|lostdigits))*' # attribute => 'Instructions' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bsignal([\\s]*(on|off)[\\s]*(error|failure|halt|notready|novalue|syntax|lostdigits))*', 1, 0, 0, undef, 0, '#stay', 'Instructions')) { return 1 } # String => '\bcall([\s]*(on|off)[\s]*(error|failure|halt|notready))*' # attribute => 'Instructions' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bcall([\\s]*(on|off)[\\s]*(error|failure|halt|notready))*', 1, 0, 0, undef, 0, '#stay', 'Instructions')) { return 1 } # String => '\b(trace|address)\s*[_\w\d]' # attribute => 'Instructions' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(trace|address)\\s*[_\\w\\d]', 1, 0, 0, undef, 0, '#stay', 'Instructions')) { return 1 } # String => '\bprocedure([\s]*expose)?' # attribute => 'Instructions' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bprocedure([\\s]*expose)?', 1, 0, 0, undef, 0, '#stay', 'Instructions')) { return 1 } # String => '\bdo([\s]*forever)?' # attribute => 'Instructions' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bdo([\\s]*forever)?', 1, 0, 0, undef, 0, '#stay', 'Instructions')) { return 1 } # attribute => 'String' # char => ''' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # attribute => 'Comment' # beginRegion => 'Comment' # char => '/' # char1 => '*' # context => 'Commentar 1' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) { return 1 } # String => ':!%&()+,-/.*<=>?[]{|}~^;' # attribute => 'Symbol' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, ':!%&()+,-/.*<=>?[]{|}~^;', 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # String => '\b[_\w][_\w\d]*(?=[\s]*[(:])' # attribute => 'Function' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b[_\\w][_\\w\\d]*(?=[\\s]*[(:])', 0, 0, 0, undef, 0, '#stay', 'Function')) { return 1 } return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) { return 1 } # attribute => 'String' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::REXX - a Plugin for REXX syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::REXX; my $sh = new Syntax::Highlight::Engine::Kate::REXX([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::REXX is a plugin module that provides syntax highlighting for REXX to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Ferite.pm0000644000175000017500000002773713226470762026113 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'ferite.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.04 #kate version 2.4 #generated: Sun Feb 3 22:02:04 2008, localtime package Syntax::Highlight::Engine::Kate::Ferite; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Alert' => 'Alert', 'Char' => 'Char', 'Comment' => 'Comment', 'Data Type' => 'DataType', 'Decimal' => 'DecVal', 'Float' => 'Float', 'Hex' => 'BaseN', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Octal' => 'BaseN', 'Prep. Lib' => 'Others', 'Preprocessor' => 'Others', 'String' => 'String', 'String Char' => 'Char', 'Symbol' => 'Normal', }); $self->listAdd('keywords', 'break', 'case', 'class', 'continue', 'do', 'else', 'fix', 'for', 'function', 'global', 'if', 'iferr', 'namespace', 'new', 'null', 'return', 'self', 'super', 'uses', 'while', ); $self->listAdd('types', 'array', 'final', 'number', 'object', 'static', 'string', 'void', ); $self->contextdata({ 'Comment' => { callback => \&parseComment, attribute => 'Comment', lineending => '#pop', }, 'Default' => { callback => \&parseDefault, attribute => 'Normal Text', }, 'Multiline Comment' => { callback => \&parseMultilineComment, attribute => 'Comment', }, 'Multiline Comment 2' => { callback => \&parseMultilineComment2, attribute => 'Comment', }, 'Preprocessor' => { callback => \&parsePreprocessor, attribute => 'Preprocessor', lineending => '#pop', }, 'String' => { callback => \&parseString, attribute => 'String', lineending => '#pop', }, 'Undeffed' => { callback => \&parseUndeffed, attribute => 'Comment', }, 'unknown' => { callback => \&parseunknown, attribute => 'Normal Text', lineending => '#pop', }, 'unknown 2' => { callback => \&parseunknown2, attribute => 'Normal Text', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Default'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'ferite'; } sub parseComment { my ($self, $text) = @_; # String => '(FIXME|TODO)' # attribute => 'Alert' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) { return 1 } return 0; }; sub parseDefault { my ($self, $text) = @_; # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'types' # attribute => 'Data Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) { return 1 } # attribute => 'Float' # context => '#stay' # items => 'ARRAY(0xfd97c0)' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { # String => 'fF' # attribute => 'Float' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, 'fF', 0, 0, undef, 0, '#stay', 'Float')) { return 1 } } # attribute => 'Octal' # context => '#stay' # type => 'HlCOct' if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) { return 1 } # attribute => 'Hex' # context => '#stay' # type => 'HlCHex' if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) { return 1 } # attribute => 'Decimal' # context => '#stay' # items => 'ARRAY(0x11bdd60)' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { # String => 'ULL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'ULL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LUL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LUL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LLU' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LLU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'UL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'UL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LU' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'U' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'U', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'L' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'L', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } } # attribute => 'Char' # context => '#stay' # type => 'HlCChar' if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '*' # context => 'Multiline Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Multiline Comment', 'Comment')) { return 1 } # String => '!%&()+,-<=>?[]^{|}~' # attribute => 'Symbol' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '!%&()+,-<=>?[]^{|}~', 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # String => '#if 0' # attribute => 'Comment' # context => 'Undeffed' # insensitive => 'FALSE' # type => 'StringDetect' if ($self->testStringDetect($text, '#if 0', 0, 0, 0, undef, 0, 'Undeffed', 'Comment')) { return 1 } # attribute => 'Preprocessor' # char => '#' # column => '0' # context => 'Preprocessor' # type => 'DetectChar' if ($self->testDetectChar($text, '#', 0, 0, 0, 0, 0, 'Preprocessor', 'Preprocessor')) { return 1 } return 0; }; sub parseMultilineComment { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } # String => '(FIXME|TODO)' # attribute => 'Alert' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) { return 1 } return 0; }; sub parseMultilineComment2 { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parsePreprocessor { my ($self, $text) = @_; # attribute => 'Preprocessor' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Preprocessor')) { return 1 } # attribute => 'Prep. Lib' # char => '"' # char1 => '"' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'Prep. Lib')) { return 1 } # attribute => 'Prep. Lib' # char => '<' # char1 => '>' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'Prep. Lib')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '*' # context => 'Multiline Comment 2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Multiline Comment 2', 'Comment')) { return 1 } return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) { return 1 } # attribute => 'String Char' # context => '#stay' # type => 'HlCStringChar' if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; sub parseUndeffed { my ($self, $text) = @_; # String => '(FIXME|TODO)' # attribute => 'Alert' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) { return 1 } # String => '#endif' # attribute => 'Comment' # column => '0' # context => '#pop' # type => 'StringDetect' if ($self->testStringDetect($text, '#endif', 0, 0, 0, 0, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseunknown { my ($self, $text) = @_; return 0; }; sub parseunknown2 { my ($self, $text) = @_; return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Ferite - a Plugin for ferite syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Ferite; my $sh = new Syntax::Highlight::Engine::Kate::Ferite([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Ferite is a plugin module that provides syntax highlighting for ferite to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Modulaminus2.pm0000644000175000017500000001736113226470762027244 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'modula-2.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.03 #kate version 2.1 #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::Modulaminus2; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Comment' => 'Comment', 'Directive' => 'Others', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Number' => 'DecVal', 'String' => 'String', 'Type' => 'DataType', }); $self->listAdd('directives', 'ALLOCATE', 'ASSEMBLER', 'Accessible', 'Append', 'Assign', 'CAPS', 'Close', 'Concat', 'Copy', 'DEALLOCATE', 'Delete', 'Done', 'EOF', 'EmptyString', 'Erase', 'GetArgs', 'GetCard', 'GetChar', 'GetEnv', 'GetInt', 'GetLongReal', 'GetReal', 'GetString', 'Insert', 'Length', 'Open', 'OpenInput', 'OpenOutput', 'PutBf', 'PutCard', 'PutChar', 'PutInt', 'PutLn', 'PutLongReal', 'PutReal', 'PutString', 'Read', 'ReadCard', 'ReadInt', 'ReadLongReal', 'ReadReal', 'ReadString', 'ResetClock', 'SIZE', 'StrEq', 'SystemTime', 'UserTime', 'Write', 'WriteBf', 'WriteCard', 'WriteInt', 'WriteLn', 'WriteLongReal', 'WriteReal', 'WriteString', 'compare', 'pos', ); $self->listAdd('keywords', 'ABS', 'AND', 'ARRAY', 'ASM', 'BEGIN', 'BITSET', 'BY', 'CAP', 'CASE', 'CHR', 'CONST', 'DEC', 'DEFINITION', 'DIV', 'DO', 'ELSE', 'ELSIF', 'END', 'EXCL', 'EXIT', 'EXPORT', 'FALSE', 'FOR', 'FOREIGN', 'FROM', 'HALT', 'HIGH', 'IF', 'IMPLEMENTATION', 'IMPORT', 'IN', 'INC', 'INCL', 'IOTRANSFER', 'LOOP', 'MAX', 'MIN', 'MOD', 'MODULE', 'NEWPROCESS', 'NIL', 'NOT', 'ODD', 'OF', 'OR', 'ORD', 'PROC', 'PROCEDURE', 'QUALIFIED', 'RECORD', 'REPEAT', 'RETURN', 'SET', 'THEN', 'TO', 'TRANSFER', 'TRUE', 'TRUNC', 'TYPE', 'UNTIL', 'VAL', 'VAR', 'WHILE', 'WITH', ); $self->listAdd('types', 'ADDRESS', 'ADR', 'BOOLEAN', 'CARDINAL', 'CHAR', 'File', 'INTEGER', 'LONGINT', 'LONGREAL', 'POINTER', 'REAL', 'SHORTCARD', 'SHORTINT', ); $self->contextdata({ 'Comment2' => { callback => \&parseComment2, attribute => 'Comment', }, 'Comment3' => { callback => \&parseComment3, attribute => 'Comment', lineending => '#pop', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'Prep1' => { callback => \&parsePrep1, attribute => 'Directive', }, 'String1' => { callback => \&parseString1, attribute => 'String', lineending => '#pop', }, 'String2' => { callback => \&parseString2, attribute => 'String', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Modula-2'; } sub parseComment2 { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => ')' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', ')', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseComment3 { my ($self, $text) = @_; return 0; }; sub parseNormal { my ($self, $text) = @_; # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'directives' # attribute => 'Directive' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'directives', 0, undef, 0, '#stay', 'Directive')) { return 1 } # String => 'types' # attribute => 'Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Type')) { return 1 } # attribute => 'Number' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Number')) { return 1 } # attribute => 'Number' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Number')) { return 1 } # attribute => 'String' # char => '"' # context => 'String1' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String1', 'String')) { return 1 } # attribute => 'String' # char => ''' # context => 'String2' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String2', 'String')) { return 1 } # String => '(*$' # attribute => 'Directive' # context => 'Prep1' # type => 'StringDetect' if ($self->testStringDetect($text, '(*$', 0, 0, 0, undef, 0, 'Prep1', 'Directive')) { return 1 } # attribute => 'Comment' # char => '(' # char1 => '*' # context => 'Comment2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '(', '*', 0, 0, 0, undef, 0, 'Comment2', 'Comment')) { return 1 } return 0; }; sub parsePrep1 { my ($self, $text) = @_; # String => '$*)' # attribute => 'Directive' # context => 'Prep1' # type => 'StringDetect' if ($self->testStringDetect($text, '$*)', 0, 0, 0, undef, 0, 'Prep1', 'Directive')) { return 1 } return 0; }; sub parseString1 { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; sub parseString2 { my ($self, $text) = @_; # attribute => 'String' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Modulaminus2 - a Plugin for Modula-2 syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Modulaminus2; my $sh = new Syntax::Highlight::Engine::Kate::Modulaminus2([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Modulaminus2 is a plugin module that provides syntax highlighting for Modula-2 to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Music_Publisher.pm0000644000175000017500000013656613226470762027773 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'mup.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.06 #kate version 2.4 #kate author Wilbert Berendsen (wilbert@kde.nl) #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::Music_Publisher; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Barline' => 'DecVal', 'Comment' => 'Comment', 'Context' => 'Keyword', 'Error' => 'Error', 'Location' => 'Operator', 'Location Probably' => 'Reserved', 'Lyrics' => 'BaseN', 'Macro' => 'Others', 'Newscore' => 'BString', 'Normal Text' => 'Normal', 'Note' => 'Normal', 'Note Attribute' => 'Normal', 'Parameter' => 'Char', 'Print Command' => 'BaseN', 'Special Char' => 'Keyword', 'String' => 'String', 'String Error' => 'Error', 'String Lyrics' => 'String', 'String Special' => 'IString', 'Tuplet' => 'RegionMarker', 'Unset Command' => 'Variable', 'Value' => 'Float', }); $self->listAdd('mupcontexts', 'block', 'bottom', 'bottom2', 'footer', 'footer2', 'grids', 'header', 'header2', 'headshapes', 'music', 'music', 'score', 'staff', 'top', 'top2', 'voice', ); $self->listAdd('mupfontnames', 'avantgarde', 'bookman', 'courier', 'helvetica', 'newcentury', 'palatino', 'times', ); $self->listAdd('mupfontstyles', 'bold', 'boldital', 'ital', 'rom', ); $self->listAdd('mupgraphics', 'bulge', 'curve', 'dashed', 'dotted', 'down', 'line', 'medium', 'midi', 'mussym', 'octave', 'pedal', 'phrase', 'roll', 'to', 'to', 'up', 'wavy', 'wide', 'with', ); $self->listAdd('muplocations', 'above', 'all', 'below', 'between', ); $self->listAdd('mupmacrodirectives', 'else', 'include', 'undef', ); $self->listAdd('mupmacrodirectives_end', '@', 'endif', ); $self->listAdd('mupmacrodirectives_start', 'define', 'ifdef', 'ifndef', ); $self->listAdd('mupmusicchars', '128rest', '16rest', '1n', '1rest', '256rest', '2n', '2rest', '32rest', '4n', '4rest', '64rest', '8rest', 'acc_gt', 'acc_hat', 'acc_uhat', 'begped', 'cclef', 'coda', 'com', 'copyright', 'cut', 'dblflat', 'dblsharp', 'dblwhole', 'diamond', 'dim', 'dn128n', 'dn16n', 'dn256n', 'dn2n', 'dn32n', 'dn4n', 'dn64n', 'dn8n', 'dnbow', 'dnflag', 'dot', 'dwhdiamond', 'dwhrest', 'endped', 'fclef', 'ferm', 'filldiamond', 'flat', 'gclef', 'halfdim', 'invmor', 'invturn', 'leg', 'measrpt', 'mor', 'nat', 'pedal', 'qwhrest', 'rr', 'sharp', 'sign', 'sm128rest', 'sm16rest', 'sm1n', 'sm1rest', 'sm256rest', 'sm2n', 'sm2rest', 'sm32rest', 'sm4n', 'sm4rest', 'sm64rest', 'sm8rest', 'smacc_gt', 'smacc_hat', 'smacc_uhat', 'smbegped', 'smcclef', 'smcoda', 'smcom', 'smcopyright', 'smcut', 'smdblflat', 'smdblsharp', 'smdblwhole', 'smdiamond', 'smdim', 'smdn128n', 'smdn16n', 'smdn256n', 'smdn2n', 'smdn32n', 'smdn4n', 'smdn64n', 'smdn8n', 'smdnbow', 'smdnflag', 'smdot', 'smdwhdiamond', 'smdwhrest', 'smendped', 'smfclef', 'smferm', 'smfilldiamond', 'smflat', 'smgclef', 'smhalfdim', 'sminvmor', 'sminvturn', 'smleg', 'smmeasrpt', 'smmor', 'smnat', 'smpedal', 'smqwhrest', 'smrr', 'smsharp', 'smsign', 'smtr', 'smtriangle', 'smturn', 'smuferm', 'smup128n', 'smup16n', 'smup256n', 'smup2n', 'smup32n', 'smup4n', 'smup64n', 'smup8n', 'smupbow', 'smupflag', 'smuwedge', 'smwedge', 'smxnote', 'tr', 'triangle', 'turn', 'uferm', 'up128n', 'up16n', 'up256n', 'up2n', 'up32n', 'up4n', 'up64n', 'up8n', 'upbow', 'upflag', 'uwedge', 'wedge', 'xnote', ); $self->listAdd('mupparameters', 'aboveorder', 'addtranspose', 'barstyle', 'beamslope', 'beamstyle', 'beloworder', 'betweenorder', 'bottommargin', 'brace', 'bracket', 'cancelkey', 'chorddist', 'clef', 'crescdist', 'defoct', 'dist', 'division', 'dyndist', 'endingstyle', 'firstpage', 'font', 'fontfamily', 'gridfret', 'gridsatend', 'gridscale', 'gridswhereused', 'key', 'label', 'label2', 'leftmargin', 'lyricsalign', 'lyricsfont', 'lyricsfontfamily', 'lyricssize', 'measnum', 'measnumfont', 'measnumfontfamily', 'measnumsize', 'noteheads', 'numbermrpt', 'ontheline', 'packexp', 'packfact', 'pad', 'pageheight', 'pagewidth', 'panelsperpage', 'pedstyle', 'printmultnum', 'rehstyle', 'release', 'restcombine', 'restsymmult', 'rightmargin', 'scale', 'scorepad', 'scoresep', 'size', 'stafflines', 'staffpad', 'staffs', 'staffscale', 'staffsep', 'stemlen', 'swingunit', 'sylposition', 'tabwhitebox', 'time', 'timeunit', 'topmargin', 'transpose', 'units', 'visible', 'vscheme', 'warn', ); $self->listAdd('mupprintcommands', 'center', 'left', 'paragraph', 'postscript', 'print', 'right', 'title', ); $self->listAdd('mupprintspecifiers', 'analysis', 'chord', 'dyn', 'figbass', ); $self->listAdd('mupspecialchars', '\\\'\\\'', '<<', '>>', 'A\\\'', 'A:', 'AE', 'A^', 'A`', 'Aacute', 'Acircumflex', 'Adieresis', 'Agrave', 'Ao', 'Aring', 'Atilde', 'A~', 'C,', 'Ccedilla', 'E\\\'', 'E:', 'E^', 'E`', 'Eacute', 'Ecircumflex', 'Edieresis', 'Egrave', 'I\\\'', 'I^', 'I`', 'Iacute', 'Icircumflex', 'Idieresis', 'Igrave', 'L/', 'Lslash', 'Ntilde', 'N~', 'O\\\'', 'O/', 'O:', 'OE', 'O^', 'O`', 'Oacute', 'Ocircumflex', 'Odieresis', 'Ograve', 'Oslash', 'Otilde', 'O~', 'Scaron', 'Sv', 'U\\\'', 'U:', 'U^', 'U`', 'Uacute', 'Ucircumflex', 'Udieresis', 'Ugrave', 'Y:', 'Ydieresis', 'Zcaron', 'Zv', '``', 'a\\\'', 'a:', 'a^', 'a`', 'aacute', 'acircumflex', 'acute', 'adieresis', 'ae', 'agrave', 'ao', 'aring', 'atilde', 'a~', 'breve', 'bullet', 'c,', 'caron', 'ccedilla', 'cedilla', 'cent', 'dagger', 'daggerdbl', 'dieresis', 'dotaccent', 'dotlessi', 'e\\\'', 'e:', 'e^', 'e`', 'eacute', 'ecircumflex', 'edieresis', 'egrave', 'emdash', 'exclamdown', 'germandbls', 'grave', 'guildsinglleft', 'guillemotleft', 'guillemotright', 'guilsinglright', 'hungarumlaut', 'i\\\'', 'i:', 'i:', 'i^', 'i`', 'iacute', 'icircumflex', 'idieresis', 'igrave', 'l/', 'lslash', 'macron', 'ntilde', 'n~', 'o\\\'', 'o/', 'o:', 'o^', 'o`', 'oacute', 'ocircumflex', 'odieresis', 'oe', 'ogonek', 'ograve', 'ordfeminine', 'ordmasculine', 'oslash', 'otilde', 'o~', 'questiondown', 'quotedblbase', 'quotedblleft', 'quotedblright', 'ring', 'scaron', 'space', 'ss', 'sterling', 'sv', 'u\\\'', 'u:', 'u^', 'u`', 'uacute', 'ucircumflex', 'udieresis', 'ugrave', 'y:', 'ydieresis', 'yen', 'zcaron', 'zv', ); $self->listAdd('mupvalues', '1drum', '1n', '2f', '2o', '3f', '3o', '5drum', '5n', '8treble', 'alt', 'alto', 'aug', 'augmented', 'baritone', 'barred', 'bass', 'boxed', 'chord', 'circled', 'cm', 'common', 'cut', 'dim', 'diminished', 'down', 'drum', 'dyn', 'ending', 'frenchviolin', 'grouped', 'inches', 'line', 'lyrics', 'maj', 'major', 'mezzosoprano', 'min', 'minor', 'mussym', 'n', 'octave', 'othertext', 'pedal', 'pedstar', 'per', 'perfect', 'plain', 'reh', 'soprano', 'tab', 'tenor', 'times', 'top', 'treble', 'treble8', 'up', 'whereused', 'y', ); $self->contextdata({ 'Bar Rehearsal' => { callback => \&parseBarRehearsal, attribute => 'Barline', lineending => '#pop', fallthrough => '#pop', }, 'Barline' => { callback => \&parseBarline, attribute => 'Barline', lineending => '#pop', fallthrough => '#pop', }, 'Bracket' => { callback => \&parseBracket, attribute => 'Note Attribute', lineending => '#pop', fallthrough => '#pop', }, 'Bracket Hs' => { callback => \&parseBracketHs, attribute => 'Note Attribute', lineending => '#pop', fallthrough => '#pop', }, 'Bracket With' => { callback => \&parseBracketWith, attribute => 'Note Attribute', lineending => '#pop', fallthrough => '#pop', }, 'Comment' => { callback => \&parseComment, attribute => 'Comment', lineending => '#pop', }, 'Font Name' => { callback => \&parseFontName, attribute => 'String Special', fallthrough => '#pop', }, 'Font Size' => { callback => \&parseFontSize, attribute => 'String Special', fallthrough => '#pop', }, 'Font Style' => { callback => \&parseFontStyle, attribute => 'String Special', fallthrough => '#pop', }, 'Location' => { callback => \&parseLocation, attribute => 'Normal Text', lineending => '#pop', fallthrough => '#pop', }, 'Location Probably' => { callback => \&parseLocationProbably, attribute => 'Location Problably', lineending => '#pop', fallthrough => '#pop', }, 'Macro' => { callback => \&parseMacro, attribute => 'Macro', lineending => '#pop', }, 'Macro Location' => { callback => \&parseMacroLocation, attribute => 'Location', lineending => '#pop', fallthrough => '#pop', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'Note' => { callback => \&parseNote, attribute => 'Note', lineending => '#pop', fallthrough => '#pop', }, 'Note Probably' => { callback => \&parseNoteProbably, attribute => 'Note', lineending => '#pop', fallthrough => '#pop', }, 'Parameter' => { callback => \&parseParameter, attribute => 'Parameter', lineending => '#pop', fallthrough => '#pop', }, 'Print Command' => { callback => \&parsePrintCommand, attribute => 'Print Command', lineending => '#pop', fallthrough => '#pop', }, 'Special Char' => { callback => \&parseSpecialChar, attribute => 'String Special', fallthrough => '#pop', }, 'String' => { callback => \&parseString, attribute => 'String', }, 'Tuplet' => { callback => \&parseTuplet, attribute => 'Tuplet', lineending => '#pop', fallthrough => '#pop', }, 'Unset' => { callback => \&parseUnset, attribute => 'Parameter', lineending => '#pop', fallthrough => '#pop', }, 'Value' => { callback => \&parseValue, attribute => 'Value', lineending => '#pop', fallthrough => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Music Publisher'; } sub parseBarRehearsal { my ($self, $text) = @_; # String => '\s+' # attribute => 'Print Command' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Print Command')) { return 1 } # String => 'mupfontnames' # attribute => 'Print Command' # context => 'Print Command' # type => 'keyword' if ($self->testKeyword($text, 'mupfontnames', 0, undef, 0, 'Print Command', 'Print Command')) { return 1 } # String => 'mupfontstyles' # attribute => 'Print Command' # context => 'Print Command' # type => 'keyword' if ($self->testKeyword($text, 'mupfontstyles', 0, undef, 0, 'Print Command', 'Print Command')) { return 1 } # String => '\b(let|mnum|num)\b' # attribute => 'Barline' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(let|mnum|num)\\b', 0, 0, 0, undef, 0, '#pop', 'Barline')) { return 1 } # context => 'Macro' # type => 'IncludeRules' if ($self->includeRules('Macro', $text)) { return 1 } return 0; }; sub parseBarline { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # String => '\b(ending|endending|hidechanges)\b' # attribute => 'Barline' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(ending|endending|hidechanges)\\b', 0, 0, 0, undef, 0, '#stay', 'Barline')) { return 1 } # String => '\breh(earsal)?\b' # attribute => 'Barline' # context => 'Bar Rehearsal' # type => 'RegExpr' if ($self->testRegExpr($text, '\\breh(earsal)?\\b', 0, 0, 0, undef, 0, 'Bar Rehearsal', 'Barline')) { return 1 } # String => '\bmnum\s*=\s*[0-9]+' # attribute => 'Barline' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bmnum\\s*=\\s*[0-9]+', 0, 0, 0, undef, 0, '#stay', 'Barline')) { return 1 } # String => '\bnum\s*=\s*[0-9]+' # attribute => 'Barline' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bnum\\s*=\\s*[0-9]+', 0, 0, 0, undef, 0, '#stay', 'Barline')) { return 1 } # String => '\blet\s*=\s*("[A-Z]{1,2}")?' # attribute => 'Barline' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\blet\\s*=\\s*("[A-Z]{1,2}")?', 0, 0, 0, undef, 0, '#stay', 'Barline')) { return 1 } # String => '\bpad\s+[0-9]+' # attribute => 'Barline' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bpad\\s+[0-9]+', 0, 0, 0, undef, 0, '#stay', 'Barline')) { return 1 } # String => '=([a-z]|_[a-z][a-z_0-9]*)\b' # attribute => 'Location' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '=([a-z]|_[a-z][a-z_0-9]*)\\b', 0, 0, 0, undef, 0, '#stay', 'Location')) { return 1 } # context => 'Macro' # type => 'IncludeRules' if ($self->includeRules('Macro', $text)) { return 1 } return 0; }; sub parseBracket { my ($self, $text) = @_; # attribute => 'Special Char' # char => ']' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Special Char')) { return 1 } # String => '[\s;,]+' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\s;,]+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '\b(grace|xnote|cue|diam|up|down)\b' # attribute => 'Note Attribute' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(grace|xnote|cue|diam|up|down)\\b', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) { return 1 } # String => '\b(slash|len|pad|ho|dist)\s*[0-9.+-]*' # attribute => 'Note Attribute' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(slash|len|pad|ho|dist)\\s*[0-9.+-]*', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) { return 1 } # String => '\bwith\s*(?=[A-Z"^>.-])' # attribute => 'Note Attribute' # context => 'Bracket With' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bwith\\s*(?=[A-Z"^>.-])', 0, 0, 0, undef, 0, 'Bracket With', 'Note Attribute')) { return 1 } # String => '\bhs\s*(?=[A-Z"])' # attribute => 'Note Attribute' # context => 'Bracket Hs' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bhs\\s*(?=[A-Z"])', 0, 0, 0, undef, 0, 'Bracket Hs', 'Note Attribute')) { return 1 } # String => '=([a-z]|_[a-z][a-z_0-9]*)\b' # attribute => 'Location' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '=([a-z]|_[a-z][a-z_0-9]*)\\b', 0, 0, 0, undef, 0, '#stay', 'Location')) { return 1 } # String => '\bc\b' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bc\\b', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # context => 'Macro' # type => 'IncludeRules' if ($self->includeRules('Macro', $text)) { return 1 } return 0; }; sub parseBracketHs { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # context => 'Macro' # type => 'IncludeRules' if ($self->includeRules('Macro', $text)) { return 1 } return 0; }; sub parseBracketWith { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # String => '[>.^-]+' # attribute => 'Note Attribute' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[>.^-]+', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) { return 1 } # String => '[\s,]+' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\s,]+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # context => 'Macro' # type => 'IncludeRules' if ($self->includeRules('Macro', $text)) { return 1 } return 0; }; sub parseComment { my ($self, $text) = @_; # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } return 0; }; sub parseFontName { my ($self, $text) = @_; # attribute => 'String Special' # char => ')' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'String Special')) { return 1 } # String => '[ABCHNPT][RBIX](?=\))' # attribute => 'String Special' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[ABCHNPT][RBIX](?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) { return 1 } # String => 'mupfontnames' # attribute => 'String Special' # context => 'Font Style' # type => 'keyword' if ($self->testKeyword($text, 'mupfontnames', 0, undef, 0, 'Font Style', 'String Special')) { return 1 } # String => '(PV|previous)(?=\))' # attribute => 'String Special' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(PV|previous)(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) { return 1 } # String => '[^ )"]+' # attribute => 'String Error' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[^ )"]+', 0, 0, 0, undef, 0, '#stay', 'String Error')) { return 1 } return 0; }; sub parseFontSize { my ($self, $text) = @_; # attribute => 'String Special' # char => ')' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'String Special')) { return 1 } # String => '[-+]?[0-9]+(?=\))' # attribute => 'String Special' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[-+]?[0-9]+(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) { return 1 } # String => '(PV|previous)(?=\))' # attribute => 'String Special' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(PV|previous)(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) { return 1 } # String => '[^ )"]+' # attribute => 'String Error' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[^ )"]+', 0, 0, 0, undef, 0, '#stay', 'String Error')) { return 1 } return 0; }; sub parseFontStyle { my ($self, $text) = @_; # String => '\s+' # attribute => 'String Special' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'String Special')) { return 1 } # String => 'mupfontstyles' # attribute => 'String Special' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'mupfontstyles', 0, undef, 0, '#stay', 'String Special')) { return 1 } # String => '[^ )"]+' # attribute => 'String Error' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[^ )"]+', 0, 0, 0, undef, 0, '#stay', 'String Error')) { return 1 } return 0; }; sub parseLocation { my ($self, $text) = @_; # String => '[\+\-\s]+' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\+\\-\\s]+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Normal Text' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '\btime\b' # attribute => 'Location' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\btime\\b', 0, 0, 0, undef, 0, '#stay', 'Location')) { return 1 } # context => 'Macro' # type => 'IncludeRules' if ($self->includeRules('Macro', $text)) { return 1 } return 0; }; sub parseLocationProbably { my ($self, $text) = @_; # String => '[h-qt-z]|_[a-z][a-z_0-9]*' # attribute => 'Location Probably' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[h-qt-z]|_[a-z][a-z_0-9]*', 0, 0, 0, undef, 0, '#pop', 'Location Probably')) { return 1 } return 0; }; sub parseMacro { my ($self, $text) = @_; # String => 'mupmacrodirectives_start' # attribute => 'Macro' # beginRegion => 'macro' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'mupmacrodirectives_start', 0, undef, 0, '#stay', 'Macro')) { return 1 } # String => 'mupmacrodirectives_end' # attribute => 'Macro' # context => '#stay' # endRegion => 'macro' # type => 'keyword' if ($self->testKeyword($text, 'mupmacrodirectives_end', 0, undef, 0, '#stay', 'Macro')) { return 1 } # String => 'mupmacrodirectives' # attribute => 'Macro' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'mupmacrodirectives', 0, undef, 0, '#stay', 'Macro')) { return 1 } # String => '[A-Z][A-Z0-9_]*(?=\.[xynews]\b)' # attribute => 'Macro' # context => 'Macro Location' # type => 'RegExpr' if ($self->testRegExpr($text, '[A-Z][A-Z0-9_]*(?=\\.[xynews]\\b)', 0, 0, 0, undef, 0, 'Macro Location', 'Macro')) { return 1 } # String => '[A-Z][A-Z0-9_]*' # attribute => 'Macro' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[A-Z][A-Z0-9_]*', 0, 0, 0, undef, 0, '#stay', 'Macro')) { return 1 } # attribute => 'Macro' # char => '@' # context => '#stay' # endRegion => 'macro' # type => 'DetectChar' if ($self->testDetectChar($text, '@', 0, 0, 0, undef, 0, '#stay', 'Macro')) { return 1 } return 0; }; sub parseMacroLocation { my ($self, $text) = @_; # String => '..' # attribute => 'Location Probably' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '..', 0, 0, 0, undef, 0, '#pop', 'Location Probably')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # String => 'mupcontexts' # attribute => 'Context' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'mupcontexts', 0, undef, 0, '#stay', 'Context')) { return 1 } # String => '\blyrics\b' # attribute => 'Lyrics' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\blyrics\\b', 0, 0, 0, undef, 0, '#stay', 'Lyrics')) { return 1 } # String => '\b((dashed|dotted)\s+)?(bar|endbar|dblbar|invisbar|repeatstart|repeatboth|repeatend|restart)\b' # attribute => 'Barline' # context => 'Barline' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b((dashed|dotted)\\s+)?(bar|endbar|dblbar|invisbar|repeatstart|repeatboth|repeatend|restart)\\b', 0, 0, 0, undef, 0, 'Barline', 'Barline')) { return 1 } # String => '\bnew(score|page)\b' # attribute => 'Newscore' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bnew(score|page)\\b', 0, 0, 0, undef, 0, '#stay', 'Newscore')) { return 1 } # String => '\bmultirest\s+[0-9]+\b' # attribute => 'Newscore' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bmultirest\\s+[0-9]+\\b', 0, 0, 0, undef, 0, '#stay', 'Newscore')) { return 1 } # String => '\bunset\b' # attribute => 'Unset Command' # context => 'Unset' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bunset\\b', 0, 0, 0, undef, 0, 'Unset', 'Unset Command')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # String => '\\$' # attribute => 'Special Char' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\$', 0, 0, 0, undef, 0, '#stay', 'Special Char')) { return 1 } # String => 'mupprintcommands' # attribute => 'Print Command' # context => 'Print Command' # type => 'keyword' if ($self->testKeyword($text, 'mupprintcommands', 0, undef, 0, 'Print Command', 'Print Command')) { return 1 } # String => 'mupfontnames' # attribute => 'Print Command' # context => 'Print Command' # type => 'keyword' if ($self->testKeyword($text, 'mupfontnames', 0, undef, 0, 'Print Command', 'Print Command')) { return 1 } # String => 'mupfontstyles' # attribute => 'Print Command' # context => 'Print Command' # type => 'keyword' if ($self->testKeyword($text, 'mupfontstyles', 0, undef, 0, 'Print Command', 'Print Command')) { return 1 } # String => '\b((ragged|justified)\s+)?paragraph\b' # attribute => 'Print Command' # context => 'Print Command' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b((ragged|justified)\\s+)?paragraph\\b', 0, 0, 0, undef, 0, 'Print Command', 'Print Command')) { return 1 } # String => 'mupprintspecifiers' # attribute => 'Print Command' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'mupprintspecifiers', 0, undef, 0, '#stay', 'Print Command')) { return 1 } # String => 'mupgraphics' # attribute => 'Print Command' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'mupgraphics', 0, undef, 0, '#stay', 'Print Command')) { return 1 } # String => 'muplocations' # attribute => 'Print Command' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'muplocations', 0, undef, 0, '#stay', 'Print Command')) { return 1 } # String => '\bdist(?=\s+[^=])' # attribute => 'Print Command' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bdist(?=\\s+[^=])', 0, 0, 0, undef, 0, '#stay', 'Print Command')) { return 1 } # String => 'mupparameters' # attribute => 'Parameter' # context => 'Parameter' # type => 'keyword' if ($self->testKeyword($text, 'mupparameters', 0, undef, 0, 'Parameter', 'Parameter')) { return 1 } # String => '\[(?=(grace|xnote|cue|diam|with|slash|up|down|len|pad|ho|dist|hs|c\b|=))' # attribute => 'Special Char' # context => 'Bracket' # type => 'RegExpr' if ($self->testRegExpr($text, '\\[(?=(grace|xnote|cue|diam|with|slash|up|down|len|pad|ho|dist|hs|c\\b|=))', 0, 0, 0, undef, 0, 'Bracket', 'Special Char')) { return 1 } # attribute => 'Special Char' # char => '}' # context => 'Tuplet' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, 'Tuplet', 'Special Char')) { return 1 } # String => '[]{' # attribute => 'Special Char' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '[]{', 0, 0, undef, 0, '#stay', 'Special Char')) { return 1 } # String => '(<<|>>)' # attribute => 'Special Char' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(<<|>>)', 0, 0, 0, undef, 0, '#stay', 'Special Char')) { return 1 } # String => '(\(\s*)?((1/4|1/2|1|2|4|8|16|32|64|128|256)\.*\s*)?((\(\s*)?([a-grs]|us)(?!bm)([0-9'?\sxn]|[+-]+|[&#]{1,2}|\(\s*[&#]{1,2}\s*\)|\(\s*[xn]\s*\)|\(\s*[0-9]\s*\))*\)?\s*)*\s*(?=[;~=" 'Note' # context => 'Note' # type => 'RegExpr' if ($self->testRegExpr($text, '(\\(\\s*)?((1/4|1/2|1|2|4|8|16|32|64|128|256)\\.*\\s*)?((\\(\\s*)?([a-grs]|us)(?!bm)([0-9\'?\\sxn]|[+-]+|[&#]{1,2}|\\(\\s*[&#]{1,2}\\s*\\)|\\(\\s*[xn]\\s*\\)|\\(\\s*[0-9]\\s*\\))*\\)?\\s*)*\\s*(?=[;~=" ';\s*(?=[~=<]|\b(bm|es?bm|dashed|dotted|tie|slur|alt|hs|ifn?def|else|elseif|endif)\b)' # attribute => 'Normal Text' # context => 'Note' # type => 'RegExpr' if ($self->testRegExpr($text, ';\\s*(?=[~=<]|\\b(bm|es?bm|dashed|dotted|tie|slur|alt|hs|ifn?def|else|elseif|endif)\\b)', 0, 0, 0, undef, 0, 'Note', 'Normal Text')) { return 1 } # String => '(1/4|1/2|1|2|4|8|16|32|64|128|256)?mu?[rs]+\s*(?=;)' # attribute => 'Note' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(1/4|1/2|1|2|4|8|16|32|64|128|256)?mu?[rs]+\\s*(?=;)', 0, 0, 0, undef, 0, '#stay', 'Note')) { return 1 } # String => 'm\s*rpt\s*(?=;)' # attribute => 'Note' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, 'm\\s*rpt\\s*(?=;)', 0, 0, 0, undef, 0, '#stay', 'Note')) { return 1 } # String => '=([a-z]|_[a-z][a-z_0-9]*)\b' # attribute => 'Location' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '=([a-z]|_[a-z][a-z_0-9]*)\\b', 0, 0, 0, undef, 0, '#stay', 'Location')) { return 1 } # String => '([a-z]|_[a-z][a-z_0-9]*)\.[xynews]\b' # attribute => 'Location' # context => 'Location' # type => 'RegExpr' if ($self->testRegExpr($text, '([a-z]|_[a-z][a-z_0-9]*)\\.[xynews]\\b', 0, 0, 0, undef, 0, 'Location', 'Location')) { return 1 } # String => '([a-z]|_[a-z][a-z_0-9]*)\.(?=[A-Z])' # attribute => 'Location Probably' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '([a-z]|_[a-z][a-z_0-9]*)\\.(?=[A-Z])', 0, 0, 0, undef, 0, '#stay', 'Location Probably')) { return 1 } # String => '[(,]\s*(?=([h-qt-z]|_[a-z][a-z_0-9]*)\s*[,)])' # attribute => 'Normal Text' # context => 'Location Probably' # type => 'RegExpr' if ($self->testRegExpr($text, '[(,]\\s*(?=([h-qt-z]|_[a-z][a-z_0-9]*)\\s*[,)])', 0, 0, 0, undef, 0, 'Location Probably', 'Normal Text')) { return 1 } # String => '[(,]\s*(?=[a-grs]\s*[,)])' # attribute => 'Normal Text' # context => 'Note Probably' # type => 'RegExpr' if ($self->testRegExpr($text, '[(,]\\s*(?=[a-grs]\\s*[,)])', 0, 0, 0, undef, 0, 'Note Probably', 'Normal Text')) { return 1 } # context => 'Macro' # type => 'IncludeRules' if ($self->includeRules('Macro', $text)) { return 1 } # String => '[0-9.]*\s*til\s*(([0-9]+m(\s*\+\s*[0-9.]+)?)|[0-9.]+)\s*;' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[0-9.]*\\s*til\\s*(([0-9]+m(\\s*\\+\\s*[0-9.]+)?)|[0-9.]+)\\s*;', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '[0-9]*[a-z_]+' # attribute => 'Error' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[0-9]*[a-z_]+', 0, 0, 0, undef, 0, '#stay', 'Error')) { return 1 } return 0; }; sub parseNote { my ($self, $text) = @_; # String => '(\bdashed\s+|\bdotted\s+)?(<(/n|\\n|n/|n\\|[a-g]([+-]*|[0-7]))?>|tie|slur|[~])' # attribute => 'Note Attribute' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(\\bdashed\\s+|\\bdotted\\s+)?(<(/n|\\\\n|n/|n\\\\|[a-g]([+-]*|[0-7]))?>|tie|slur|[~])', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) { return 1 } # String => '^(/|[a-g]([+-]*|[0-7]))' # attribute => 'Note Attribute' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '^(/|[a-g]([+-]*|[0-7]))', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) { return 1 } # String => '\bbm\b(\s+with\s+staff\s+(below|above)\b)?' # attribute => 'Note Attribute' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bbm\\b(\\s+with\\s+staff\\s+(below|above)\\b)?', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) { return 1 } # String => '\bes?bm\b' # attribute => 'Note Attribute' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bes?bm\\b', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) { return 1 } # String => '\balt\s+[1-9]\b' # attribute => 'Note Attribute' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\balt\\s+[1-9]\\b', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) { return 1 } # String => '\bhs\s+' # attribute => 'Note Attribute' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bhs\\s+', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # context => 'Macro' # type => 'IncludeRules' if ($self->includeRules('Macro', $text)) { return 1 } return 0; }; sub parseNoteProbably { my ($self, $text) = @_; # String => '[a-grs]*' # attribute => 'Note' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[a-grs]*', 0, 0, 0, undef, 0, '#pop', 'Note')) { return 1 } return 0; }; sub parseParameter { my ($self, $text) = @_; # attribute => 'Normal Text' # char => '=' # context => 'Value' # type => 'DetectChar' if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, 'Value', 'Normal Text')) { return 1 } # String => '\s+' # attribute => 'Parameter' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Parameter')) { return 1 } return 0; }; sub parsePrintCommand { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # String => 'mupfontstyles' # attribute => 'Print Command' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'mupfontstyles', 0, undef, 0, '#stay', 'Print Command')) { return 1 } # String => '\bnl\b' # attribute => 'Print Command' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bnl\\b', 0, 0, 0, undef, 0, '#stay', 'Print Command')) { return 1 } # String => '\([0-9]+\)' # attribute => 'Print Command' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\([0-9]+\\)', 0, 0, 0, undef, 0, '#pop', 'Print Command')) { return 1 } return 0; }; sub parseSpecialChar { my ($self, $text) = @_; # attribute => 'String Special' # char => ')' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'String Special')) { return 1 } # String => 'mupspecialchars' # attribute => 'String Special' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'mupspecialchars', 0, undef, 0, '#stay', 'String Special')) { return 1 } # String => 'mupmusicchars' # attribute => 'String Special' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'mupmusicchars', 0, undef, 0, '#stay', 'String Special')) { return 1 } # String => '[AaEeOo]['`:^~](?=\))' # attribute => 'String Special' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[AaEeOo][\'`:^~](?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) { return 1 } # String => '[IiUu]['`:^](?=\))' # attribute => 'String Special' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[IiUu][\'`:^](?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) { return 1 } # String => '[Nn]~(?=\))' # attribute => 'String Special' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[Nn]~(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) { return 1 } # String => '[Yy]:(?=\))' # attribute => 'String Special' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[Yy]:(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) { return 1 } # String => '[LlOo]/(?=\))' # attribute => 'String Special' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[LlOo]/(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) { return 1 } # String => '[Cc],(?=\))' # attribute => 'String Special' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[Cc],(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) { return 1 } # String => '(>>|<<|``|'')(?=\))' # attribute => 'String Special' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(>>|<<|``|\'\')(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) { return 1 } # String => '[^)"]+' # attribute => 'String Error' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[^)"]+', 0, 0, 0, undef, 0, '#stay', 'String Error')) { return 1 } return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } # String => '[\\][][{}%#"nb|^:,\\/ ]' # attribute => 'String Special' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\\\][][{}%#"nb|^:,\\\\/ ]', 0, 0, 0, undef, 0, '#stay', 'String Special')) { return 1 } # String => '\(' # attribute => 'String Special' # context => 'Special Char' # type => 'StringDetect' if ($self->testStringDetect($text, '\\(', 0, 0, 0, undef, 0, 'Special Char', 'String Special')) { return 1 } # String => '\f(' # attribute => 'String Special' # context => 'Font Name' # type => 'StringDetect' if ($self->testStringDetect($text, '\\f(', 0, 0, 0, undef, 0, 'Font Name', 'String Special')) { return 1 } # String => '\s(' # attribute => 'String Special' # context => 'Font Size' # type => 'StringDetect' if ($self->testStringDetect($text, '\\s(', 0, 0, 0, undef, 0, 'Font Size', 'String Special')) { return 1 } # String => '\\v\(-?[0-9]{1,3}\)' # attribute => 'String Special' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\v\\(-?[0-9]{1,3}\\)', 0, 0, 0, undef, 0, '#stay', 'String Special')) { return 1 } # String => '[~<>|^]' # attribute => 'String Lyrics' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[~<>|^]', 0, 0, 0, undef, 0, '#stay', 'String Lyrics')) { return 1 } # String => '[-+]?[0-9]+\|' # attribute => 'String Lyrics' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[-+]?[0-9]+\\|', 0, 0, 0, undef, 0, '#stay', 'String Lyrics')) { return 1 } return 0; }; sub parseTuplet { my ($self, $text) = @_; # String => '\s*(above|below)?\s*[0-9]{1,2}(y|n|num)?(\s*,\s*[0-9]{1,2}\.?([+][0-9]{1,2}\.?)*)?' # attribute => 'Tuplet' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*(above|below)?\\s*[0-9]{1,2}(y|n|num)?(\\s*,\\s*[0-9]{1,2}\\.?([+][0-9]{1,2}\\.?)*)?', 0, 0, 0, undef, 0, '#pop', 'Tuplet')) { return 1 } return 0; }; sub parseUnset { my ($self, $text) = @_; # String => 'mupparameters' # attribute => 'Parameter' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'mupparameters', 0, undef, 0, '#stay', 'Parameter')) { return 1 } # String => '[\s,]+' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\s,]+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '\w+' # attribute => 'Error' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\w+', 0, 0, 0, undef, 0, '#pop', 'Error')) { return 1 } return 0; }; sub parseValue { my ($self, $text) = @_; # attribute => 'Normal Text' # char => ';' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } # String => '[\s,&()-]+' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\s,&()-]+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => 'mupvalues' # attribute => 'Value' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'mupvalues', 0, undef, 0, '#stay', 'Value')) { return 1 } # String => 'mupfontnames' # attribute => 'Value' # context => '#pop' # type => 'keyword' if ($self->testKeyword($text, 'mupfontnames', 0, undef, 0, '#pop', 'Value')) { return 1 } # String => 'mupfontstyles' # attribute => 'Value' # context => '#pop' # type => 'keyword' if ($self->testKeyword($text, 'mupfontstyles', 0, undef, 0, '#pop', 'Value')) { return 1 } # String => '\b[1-9][0-9]*/(1|2|4|8|16|32|64|128)n?\b' # attribute => 'Value' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b[1-9][0-9]*/(1|2|4|8|16|32|64|128)n?\\b', 0, 0, 0, undef, 0, '#stay', 'Value')) { return 1 } # String => '\b[a-g][#&]?'?([0-9]\b)?' # attribute => 'Value' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b[a-g][#&]?\'?([0-9]\\b)?', 0, 0, 0, undef, 0, '#stay', 'Value')) { return 1 } # String => '[0-7][#&]' # attribute => 'Value' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[0-7][#&]', 0, 0, 0, undef, 0, '#stay', 'Value')) { return 1 } # String => 'r\b' # attribute => 'Value' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, 'r\\b', 0, 0, 0, undef, 0, '#stay', 'Value')) { return 1 } # attribute => 'Value' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Value')) { return 1 } # attribute => 'Value' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Value')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # context => 'Macro' # type => 'IncludeRules' if ($self->includeRules('Macro', $text)) { return 1 } # String => '[a-z][a-z0-9]*' # attribute => 'Error' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[a-z][a-z0-9]*', 0, 0, 0, undef, 0, '#stay', 'Error')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Music_Publisher - a Plugin for Music Publisher syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Music_Publisher; my $sh = new Syntax::Highlight::Engine::Kate::Music_Publisher([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Music_Publisher is a plugin module that provides syntax highlighting for Music Publisher to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/LilyPond.pm0000644000175000017500000017555013226470762026424 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'lilypond.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.01 #kate version 2.3 #kate author Andrea Primiani (primiani@dag.it) #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::LilyPond; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Bar' => 'Char', 'Chord' => 'BaseN', 'Comment' => 'Comment', 'Context' => 'DataType', 'Decoration' => 'Reserved', 'Drums' => 'RegionMarker', 'Dynamics' => 'BString', 'Header' => 'Float', 'Keyword' => 'Keyword', 'Lyrics' => 'DecVal', 'Normal Text' => 'Normal', 'Preprocessor' => 'IString', 'Repeat' => 'Operator', 'Sharp' => 'Others', 'Slur' => 'Variable', 'String' => 'String', 'Tuplet' => 'Float', }); $self->listAdd('commands', '\\\\clef', '\\\\key', '\\\\tempo', '\\\\time', ); $self->listAdd('repeats', '"percent"', '"tremolo"', '\\\\alternative', '\\\\repeat', 'unfold', 'volta', ); $self->contextdata({ 'Command' => { callback => \&parseCommand, attribute => 'Header', }, 'Comment' => { callback => \&parseComment, attribute => 'Comment', lineending => '#pop', }, 'Context' => { callback => \&parseContext, attribute => 'Normal Text', }, 'Header' => { callback => \&parseHeader, attribute => 'Header', }, 'Keyword' => { callback => \&parseKeyword, attribute => 'Keyword', lineending => '#pop', }, 'Lyrics' => { callback => \&parseLyrics, attribute => 'Lyrics', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'Preprocessor' => { callback => \&parsePreprocessor, attribute => 'Preprocessor', lineending => '#pop', }, 'Repeat' => { callback => \&parseRepeat, attribute => 'Normal Text', }, 'Slur' => { callback => \&parseSlur, attribute => 'Normal', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(1); $self->initialize; bless ($self, $class); return $self; } sub language { return 'LilyPond'; } sub parseCommand { my ($self, $text) = @_; # attribute => 'Header' # char => '(' # context => 'Command' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'Command', 'Header')) { return 1 } # attribute => 'Header' # char => ')' # context => '#pop' # endRegion => 'command' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Header')) { return 1 } return 0; }; sub parseComment { my ($self, $text) = @_; return 0; }; sub parseContext { my ($self, $text) = @_; # attribute => 'Context' # char => '>' # char1 => '>' # context => '#pop' # endRegion => 'context' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '>', '>', 0, 0, 0, undef, 0, '#pop', 'Context')) { return 1 } return 0; }; sub parseHeader { my ($self, $text) = @_; # attribute => 'Keyword' # char => '}' # context => '#pop' # endRegion => 'header' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Keyword')) { return 1 } return 0; }; sub parseKeyword { my ($self, $text) = @_; return 0; }; sub parseLyrics { my ($self, $text) = @_; # attribute => 'Comment' # char => '%' # context => 'Comment' # type => 'DetectChar' if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { return 1 } # attribute => 'Lyrics' # char => '}' # context => '#pop' # endRegion => 'lyrics' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Lyrics')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # String => 'repeats' # attribute => 'Repeat' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'repeats', 0, undef, 0, '#stay', 'Repeat')) { return 1 } # String => 'commands' # attribute => 'Keyword' # context => 'Keyword' # type => 'keyword' if ($self->testKeyword($text, 'commands', 0, undef, 0, 'Keyword', 'Keyword')) { return 1 } # String => '\addquote' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\addquote', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\aeolian' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\aeolian', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\applymusic' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\applymusic', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\applyoutput' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\applyoutput', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\autochange' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\autochange', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bar' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\bar', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bold' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\bold', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\bookpaper' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\bookpaper', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\book' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\book', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\breathe' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\breathe', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\breve ' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\breve ', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\cadenzaOff' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\cadenzaOff', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\cadenzaOn' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\cadenzaOn', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\change' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\change', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\chords' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\chords', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\column' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\column', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\consists' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\consists', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\context' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\context', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\default' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\default', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\dorian' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\dorian', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\dotsBoth' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\dotsBoth', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\dotsDown' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\dotsDown', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\dotsUp' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\dotsUp', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\drums' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\drums', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\dynamicBoth' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\dynamicBoth', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\dynamicDown' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\dynamicDown', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\dynamicUp' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\dynamicUp', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\emptyText' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\emptyText', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\fatText' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\fatText', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\figures' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\figures', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\finger' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\finger', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\flat' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\flat', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\germanChords' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\germanChords', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\include' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\include', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\input' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\input', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\italic' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\italic', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\ionian' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\ionian', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\locrian' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\locrian', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\longa' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\longa', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\lydian' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\lydian', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\lyricsto' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\lyricsto', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\major' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\major', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\mark' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\mark', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\markup' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\markup', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\midi' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\midi', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\minor' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\minor', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\mixolydian' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\mixolydian', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\musicglyph' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\musicglyph', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\newlyrics' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\newlyrics', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\new' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\new', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\noBeam' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\noBeam', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\notes' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\notes', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\octave' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\octave', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\once' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\once', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\oneVoice' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\oneVoice', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\override' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\override', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\pageBreak' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\pageBreak', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\paper' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\paper', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\partcombine' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\partcombine', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\partial' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\partial', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\phrasingSlurBoth' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\phrasingSlurBoth', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\phrasingSlurDown' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\phrasingSlurDown', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\phrasingSlurUp' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\phrasingSlurUp', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\phrigian' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\phrigian', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\property' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\property', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\quote' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\quote', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\raise' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\raise', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\relative' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\relative', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\remove' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\remove', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\renameinput' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\renameinput', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\rest' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\rest', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\revert' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\revert', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\score' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\score', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\scriptBoth' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\scriptBoth', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\scriptDown' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\scriptDown', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\scriptUp' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\scriptUp', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\semiGermanChords' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\semiGermanChords', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\setEasyHeads' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\setEasyHeads', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\setHairpinCresc' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\setHairpinCresc', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\setTextCresc' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\setTextCresc', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\set' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\set', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\shiftOff' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\shiftOff', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\shiftOnnn' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\shiftOnnn', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\shiftOnn' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\shiftOnn', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\shiftOn' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\shiftOn', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\simultaneous' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\simultaneous', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\skip ' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\skip ', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\slurBoth' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\slurBoth', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\slurDotted' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\slurDotted', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\slurDown' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\slurDown', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\slurSolid' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\slurSolid', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\slurUp' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\slurUp', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\smaller' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\smaller', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\startGroup' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\startGroup', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\startTextSpan' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\startTextSpan', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\stemBoth' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\stemBoth', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\stemDown' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\stemDown', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\stemUp' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\stemUp', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\stopGroup' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\stopGroup', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\stopTextSpan' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\stopTextSpan', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\tag' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\tag', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\tempo' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\tempo', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\thumb' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\thumb', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\tieBoth' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\tieBoth', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\tieDotted' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\tieDotted', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\tieDown' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\tieDown', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\tieSolid' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\tieSolid', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\tieUp' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\tieUp', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\transpose' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\transpose', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\transposition' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\transposition', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\tupletBoth' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\tupletBoth', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\tupletDown' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\tupletDown', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\tupletUp' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\tupletUp', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\typewriter' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\typewriter', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\voiceFour' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\voiceFour', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\unset' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\unset', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\voiceOne' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\voiceOne', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\voiceThree' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\voiceThree', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\voiceTwo' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\voiceTwo', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\with' # attribute => 'Keyword' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\with', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\accento' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\accento', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\acciaccatura' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\acciaccatura', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\appoggiatura' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\appoggiatura', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\arpeggioBoth' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\arpeggioBoth', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\arpeggioBracket' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\arpeggioBracket', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\arpeggioDown' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\arpeggioDown', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\arpeggioUp' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\arpeggioUp', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\arpeggio' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\arpeggio', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\coda' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\coda', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\downbow' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\downbow', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\downmordent' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\downmordent', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\downprall' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\downprall', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\fermataMarkup' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\fermataMarkup', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\fermata' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\fermata', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\flageolet' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\flageolet', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\glissando' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\glissando', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\grace' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\grace', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\harmonic' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\harmonic', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\lheel' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\lheel', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\lineprall' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\lineprall', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\longfermata' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\longfermata', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\ltoe' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\ltoe', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\melismaEnd' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\melismaEnd', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\melisma' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\melisma', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\mordent' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\mordent', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\open' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\open', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\portato' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\portato', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\prall' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\prall', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\pralldown' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\pralldown', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\prallmordent' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\prallmordent', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\prallprall' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\prallprall', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\prallup' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\prallup', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\reverseturn' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\reverseturn', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\rheel' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\rheel', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\rtoe' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\rtoe', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\segno' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\segno', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\shortfermata' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\shortfermata', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\signumcongruentiae' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\signumcongruentiae', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\sostenutoDown' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\sostenutoDown', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\sostenutoUp' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\sostenutoUp', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\staccatissimo' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\staccatissimo', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\staccato' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\staccato', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\stopped' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\stopped', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\sustainDown' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\sustainDown', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\sustainUp' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\sustainUp', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\tenuto' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\tenuto', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\thumb' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\thumb', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\trill' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\trill', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\turn' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\turn', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\upbow' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\upbow', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\upmordent' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\upmordent', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\upprall' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\upprall', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\varcoda' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\varcoda', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => '\verylongfermata' # attribute => 'Decoration' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '\\verylongfermata', 0, 0, 0, undef, 0, '#stay', 'Decoration')) { return 1 } # String => ' hihat' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' hihat', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' snaredrum' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' snaredrum', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' crashcymbal' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' crashcymbal', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' openhihat' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' openhihat', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' halfopenhihat' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' halfopenhihat', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' closedhihat' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' closedhihat', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' bassdrum' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' bassdrum', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' snare' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' snare', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' bd' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' bd', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' sn' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' sn', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' cymc' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' cymc', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' cyms' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' cyms', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' cymr' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' cymr', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' hhho' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' hhho', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' hhc' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' hhc', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' hho' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' hho', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' hhp' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' hhp', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' hh' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' hh', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' cb' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' cb', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' hc' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' hc', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' ssl' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' ssl', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' ssh' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' ssh', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' ss' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' ss', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' tommmh' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' tommmh', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' tommh' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' tommh', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' tomh' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' tomh', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' toml' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' toml', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' tomfh' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' tomfh', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' tomfl' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' tomfl', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' timh' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' timh', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' timl' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' timl', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' cgho' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' cgho', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' cghm' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' cghm', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' cgh' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' cgh', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' cglo' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' cglo', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' cglm' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' cglm', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' cgl' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' cgl', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' boho' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' boho', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' bohm' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' bohm', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' boh' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' boh', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' bolo' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' bolo', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' bolm' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' bolm', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' bol' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' bol', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' trio' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' trio', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' trim' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' trim', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' tri' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' tri', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' guis' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' guis', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' guil' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' guil', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' gui' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' gui', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' cl' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' cl', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' tamb' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' tamb', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' cab' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' cab', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => ' mar' # attribute => 'Drums' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ' mar', 0, 0, 0, undef, 0, '#stay', 'Drums')) { return 1 } # String => '\\times [1-9]?/[1-9]?' # attribute => 'Tuplet' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\times [1-9]?/[1-9]?', 0, 0, 0, undef, 0, '#pop', 'Tuplet')) { return 1 } # String => '\lyrics {' # attribute => 'Lyrics' # beginRegion => 'lyrics' # context => 'Lyrics' # type => 'StringDetect' if ($self->testStringDetect($text, '\\lyrics {', 0, 0, 0, undef, 0, 'Lyrics', 'Lyrics')) { return 1 } # String => '\newlyrics {' # attribute => 'Lyrics' # beginRegion => 'lyrics' # context => 'Lyrics' # type => 'StringDetect' if ($self->testStringDetect($text, '\\newlyrics {', 0, 0, 0, undef, 0, 'Lyrics', 'Lyrics')) { return 1 } # String => '\\header\s*{' # attribute => 'Keyword' # beginRegion => 'header' # context => 'Header' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\header\\s*{', 0, 0, 0, undef, 0, 'Header', 'Keyword')) { return 1 } # attribute => 'String' # char => '"' # char1 => '"' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'String')) { return 1 } # attribute => 'Chord' # char => '{' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Chord')) { return 1 } # attribute => 'Chord' # char => '}' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Chord')) { return 1 } # attribute => 'Chord' # char => '[' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, '#stay', 'Chord')) { return 1 } # attribute => 'Chord' # char => ']' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#stay', 'Chord')) { return 1 } # attribute => 'Chord' # char => '<' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '<', 0, 0, 0, undef, 0, '#stay', 'Chord')) { return 1 } # attribute => 'Chord' # char => '>' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#stay', 'Chord')) { return 1 } # attribute => 'Header' # beginRegion => 'command' # char => '#' # char1 => '(' # context => 'Command' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '#', '(', 0, 0, 0, undef, 0, 'Command', 'Header')) { return 1 } # attribute => 'Context' # beginRegion => 'context' # char => '<' # char1 => '<' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '<', '<', 0, 0, 0, undef, 0, '#stay', 'Context')) { return 1 } # attribute => 'Context' # char => '>' # char1 => '>' # context => '#stay' # endRegion => 'context' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '>', '>', 0, 0, 0, undef, 0, '#stay', 'Context')) { return 1 } # attribute => 'Chord' # char => '~' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '~', 0, 0, 0, undef, 0, '#stay', 'Chord')) { return 1 } # attribute => 'Bar' # char => '|' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '|', 0, 0, 0, undef, 0, '#stay', 'Bar')) { return 1 } # String => '[1-9]+:[1-9]+\b' # attribute => 'Repeat' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[1-9]+:[1-9]+\\b', 0, 0, 0, undef, 0, '#stay', 'Repeat')) { return 1 } # String => '\\?\(' # attribute => 'Slur' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\?\\(', 0, 0, 0, undef, 0, '#stay', 'Slur')) { return 1 } # String => '\\?\)' # attribute => 'Slur' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\?\\)', 0, 0, 0, undef, 0, '#stay', 'Slur')) { return 1 } # String => '\\fff\b' # attribute => 'Dynamics' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\fff\\b', 0, 0, 0, undef, 0, '#stay', 'Dynamics')) { return 1 } # String => '\\ff\b' # attribute => 'Dynamics' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\ff\\b', 0, 0, 0, undef, 0, '#stay', 'Dynamics')) { return 1 } # String => '\\ppp\b' # attribute => 'Dynamics' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\ppp\\b', 0, 0, 0, undef, 0, '#stay', 'Dynamics')) { return 1 } # String => '\\pp\b' # attribute => 'Dynamics' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\pp\\b', 0, 0, 0, undef, 0, '#stay', 'Dynamics')) { return 1 } # String => '\\m?[f|p]\b' # attribute => 'Dynamics' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\m?[f|p]\\b', 0, 0, 0, undef, 0, '#stay', 'Dynamics')) { return 1 } # String => '\\[s|r]fz?\b' # attribute => 'Dynamics' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\[s|r]fz?\\b', 0, 0, 0, undef, 0, '#stay', 'Dynamics')) { return 1 } # String => '_[_.\|+>^-]\b?' # attribute => 'Dynamics' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '_[_.\\|+>^-]\\b?', 0, 0, 0, undef, 0, '#stay', 'Dynamics')) { return 1 } # String => '\^[_.\|+>^-]\b?' # attribute => 'Dynamics' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\^[_.\\|+>^-]\\b?', 0, 0, 0, undef, 0, '#stay', 'Dynamics')) { return 1 } # String => '-[_.\|+>^-]\b?' # attribute => 'Dynamics' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '-[_.\\|+>^-]\\b?', 0, 0, 0, undef, 0, '#stay', 'Dynamics')) { return 1 } # attribute => 'Dynamics' # char => '\' # char1 => '<' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '<', 0, 0, 0, undef, 0, '#stay', 'Dynamics')) { return 1 } # attribute => 'Dynamics' # char => '\' # char1 => '>' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '>', 0, 0, 0, undef, 0, '#stay', 'Dynamics')) { return 1 } # attribute => 'Dynamics' # char => '\' # char1 => '!' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '!', 0, 0, 0, undef, 0, '#stay', 'Dynamics')) { return 1 } # String => '-[0-5]\b' # attribute => 'Dynamics' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '-[0-5]\\b', 0, 0, 0, undef, 0, '#stay', 'Dynamics')) { return 1 } # attribute => 'Comment' # char => '%' # context => 'Comment' # type => 'DetectChar' if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { return 1 } return 0; }; sub parsePreprocessor { my ($self, $text) = @_; return 0; }; sub parseRepeat { my ($self, $text) = @_; # attribute => 'Normal Text' # char => '}' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } # String => '"tremolo"' # attribute => 'Repeat' # context => '#pop' # type => 'StringDetect' if ($self->testStringDetect($text, '"tremolo"', 0, 0, 0, undef, 0, '#pop', 'Repeat')) { return 1 } # String => '"percent"' # attribute => 'Repeat' # context => '#pop' # type => 'StringDetect' if ($self->testStringDetect($text, '"percent"', 0, 0, 0, undef, 0, '#pop', 'Repeat')) { return 1 } # String => 'volta\b[1-9]\b' # attribute => 'Repeat' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, 'volta\\b[1-9]\\b', 0, 0, 0, undef, 0, '#pop', 'Repeat')) { return 1 } return 0; }; sub parseSlur { my ($self, $text) = @_; # String => '\\?\(' # attribute => 'Slur' # context => 'Slur' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\?\\(', 0, 0, 0, undef, 0, 'Slur', 'Slur')) { return 1 } # String => '\\?\)' # attribute => 'Slur' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\?\\)', 0, 0, 0, undef, 0, '#pop', 'Slur')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::LilyPond - a Plugin for LilyPond syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::LilyPond; my $sh = new Syntax::Highlight::Engine::Kate::LilyPond([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::LilyPond is a plugin module that provides syntax highlighting for LilyPond to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/WINE_Config.pm0000644000175000017500000001065413226470762026712 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'winehq.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.03 #kate version 2.4 #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::WINE_Config; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Comment' => 'Comment', 'Key' => 'DataType', 'Normal Text' => 'Normal', 'RegistryBeginEnd' => 'Float', 'Section' => 'Keyword', 'Value' => 'Variable', 'ValueFilesystem1' => 'BaseN', 'ValueFilesystem2' => 'DecVal', }); $self->contextdata({ 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'Value' => { callback => \&parseValue, attribute => 'Normal Text', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(1); $self->initialize; bless ($self, $class); return $self; } sub language { return 'WINE Config'; } sub parseNormal { my ($self, $text) = @_; # String => 'WINE REGISTRY Version.*$' # attribute => 'RegistryBeginEnd' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, 'WINE REGISTRY Version.*$', 0, 0, 0, undef, 0, '#stay', 'RegistryBeginEnd')) { return 1 } # String => '#\s*<\s*wineconf\s*>' # attribute => 'RegistryBeginEnd' # column => '0' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*<\\s*wineconf\\s*>', 0, 0, 0, 0, 0, '#stay', 'RegistryBeginEnd')) { return 1 } # String => '#\s*<\s*\/\s*wineconf\s*>' # attribute => 'RegistryBeginEnd' # column => '0' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*<\\s*\\/\\s*wineconf\\s*>', 0, 0, 0, 0, 0, '#stay', 'RegistryBeginEnd')) { return 1 } # String => '\[.*\]$' # attribute => 'Section' # column => '0' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\[.*\\]$', 0, 0, 0, 0, 0, '#stay', 'Section')) { return 1 } # String => ';.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, ';.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # String => '\s*"\s*[a-zA-Z0-9_.:*]*\s*"' # attribute => 'Key' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*"\\s*[a-zA-Z0-9_.:*]*\\s*"', 0, 0, 0, undef, 0, '#stay', 'Key')) { return 1 } # attribute => 'Normal Text' # char => '=' # context => 'Value' # type => 'DetectChar' if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, 'Value', 'Normal Text')) { return 1 } return 0; }; sub parseValue { my ($self, $text) = @_; # String => '\s*".*"' # attribute => 'Value' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*".*"', 0, 0, 0, undef, 0, '#stay', 'Value')) { return 1 } # String => ';.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, ';.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::WINE_Config - a Plugin for WINE Config syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::WINE_Config; my $sh = new Syntax::Highlight::Engine::Kate::WINE_Config([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::WINE_Config is a plugin module that provides syntax highlighting for WINE Config to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Cdash.pm0000644000175000017500000002622513226470762025706 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'cs.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.14 #kate version 2.3 #generated: Sun Feb 3 22:02:04 2008, localtime package Syntax::Highlight::Engine::Kate::Cdash; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Char' => 'Char', 'Comment' => 'Comment', 'Data Type' => 'DataType', 'Decimal' => 'DecVal', 'Float' => 'Float', 'Function' => 'Function', 'Hex' => 'BaseN', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Octal' => 'BaseN', 'String' => 'String', 'String Char' => 'Char', 'Symbol' => 'Normal', }); $self->listAdd('keywords', '#define', '#elif', '#else', '#endif', '#error', '#if', '#line', '#undef', '#warning', 'abstract', 'as', 'base', 'break', 'case', 'catch', 'checked', 'class', 'continue', 'default', 'delegate', 'do', 'else', 'enum', 'event', 'explicit', 'extern', 'false', 'finally', 'fixed', 'for', 'foreach', 'goto', 'if', 'implicit', 'in', 'interface', 'internal', 'is', 'lock', 'namespace', 'new', 'null', 'operator', 'out', 'override', 'params', 'private', 'protected', 'public', 'readonly', 'ref', 'return', 'sealed', 'sizeof', 'stackalloc', 'static', 'struct', 'switch', 'this', 'throw', 'true', 'try', 'typeof', 'unchecked', 'unsafe', 'using', 'virtual', 'while', ); $self->listAdd('types', 'bool', 'byte', 'char', 'const', 'decimal', 'double', 'float', 'int', 'long', 'object', 'sbyte', 'short', 'string', 'uint', 'ulong', 'ushort', 'void', ); $self->contextdata({ 'Commentar 1' => { callback => \&parseCommentar1, attribute => 'Comment', lineending => '#pop', }, 'Commentar 2' => { callback => \&parseCommentar2, attribute => 'Comment', }, 'Member' => { callback => \&parseMember, attribute => 'Normal Text', lineending => '#pop', fallthrough => '#pop', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'String' => { callback => \&parseString, attribute => 'String', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'C#'; } sub parseCommentar1 { my ($self, $text) = @_; return 0; }; sub parseCommentar2 { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseMember { my ($self, $text) = @_; # String => '\b[_\w][_\w\d]*(?=[\s]*)' # attribute => 'Function' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b[_\\w][_\\w\\d]*(?=[\\s]*)', 0, 0, 0, undef, 0, '#pop', 'Function')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'types' # attribute => 'Data Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) { return 1 } # attribute => 'Float' # context => '#stay' # items => 'ARRAY(0x10f55a0)' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { # String => 'fF' # attribute => 'Float' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, 'fF', 0, 0, undef, 0, '#stay', 'Float')) { return 1 } } # attribute => 'Octal' # context => '#stay' # type => 'HlCOct' if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) { return 1 } # attribute => 'Hex' # context => '#stay' # type => 'HlCHex' if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) { return 1 } # attribute => 'Decimal' # context => '#stay' # items => 'ARRAY(0x1095b90)' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { # String => 'ULL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'ULL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LUL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LUL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LLU' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LLU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'UL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'UL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LU' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'U' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'U', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'L' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'L', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } } # attribute => 'Char' # context => '#stay' # type => 'HlCChar' if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # context => '##Doxygen' # type => 'IncludeRules' if ($self->includePlugin('Doxygen', $text)) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Commentar 1' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '*' # context => 'Commentar 2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) { return 1 } # attribute => 'Symbol' # beginRegion => 'block1' # char => '{' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # attribute => 'Symbol' # char => '}' # context => '#stay' # endRegion => 'block1' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # String => '#region.*$' # attribute => 'Decimal' # beginRegion => 'Region1' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#region.*$', 0, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => '#endregion.*$' # attribute => 'Decimal' # context => '#stay' # endRegion => 'Region1' # type => 'RegExpr' if ($self->testRegExpr($text, '#endregion.*$', 0, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => '\b[_\w][_\w\d]*(?=[\s]*[(])' # attribute => 'Function' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b[_\\w][_\\w\\d]*(?=[\\s]*[(])', 0, 0, 0, undef, 0, '#stay', 'Function')) { return 1 } # String => '[.]{1,1}' # attribute => 'Symbol' # context => 'Member' # type => 'RegExpr' if ($self->testRegExpr($text, '[.]{1,1}', 0, 0, 0, undef, 0, 'Member', 'Symbol')) { return 1 } # String => ':!%&()+,-/.*<=>?[]|~^;' # attribute => 'Symbol' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, ':!%&()+,-/.*<=>?[]|~^;', 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # context => '#pop' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#pop', 'String')) { return 1 } # attribute => 'String Char' # context => '#stay' # type => 'HlCStringChar' if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Cdash - a Plugin for C# syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Cdash; my $sh = new Syntax::Highlight::Engine::Kate::Cdash([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Cdash is a plugin module that provides syntax highlighting for C# to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/ComponentminusPascal.pm0000644000175000017500000002737013226470762031030 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'component-pascal.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.05 #kate version 2.1 #kate author Werner Braun (wb@o3-software.de) #generated: Sun Feb 3 22:02:04 2008, localtime package Syntax::Highlight::Engine::Kate::ComponentminusPascal; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Attribute' => 'Others', 'Builtin' => 'Normal', 'Char' => 'Char', 'CommentMaior' => 'Comment', 'CommentMinor' => 'Comment', 'Exit' => 'Keyword', 'ExportFull' => 'Others', 'ExportReadOnly' => 'Others', 'Float' => 'Float', 'Integer' => 'BaseN', 'Keyword' => 'Keyword', 'MemAlloc' => 'Keyword', 'Normal Text' => 'Normal', 'Operator' => 'Normal', 'Relation' => 'Normal', 'SpecialValues' => 'DecVal', 'String' => 'String', 'Type' => 'DataType', }); $self->listAdd('attributes', 'ABSTRACT', 'EMPTY', 'EXTENSIBLE', 'LIMITED', ); $self->listAdd('builtins', 'ABS', 'ASH', 'BITS', 'CAP', 'CHR', 'DEC', 'ENTIER', 'EXCL', 'INC', 'INCL', 'LEN', 'LONG', 'MAX', 'MIN', 'ODD', 'ORD', 'SHORT', 'SIZE', ); $self->listAdd('exits', 'ASSERT', 'EXIT', 'HALT', 'RETURN', ); $self->listAdd('keywords', 'BEGIN', 'BY', 'CASE', 'CLOSE', 'CONST', 'DO', 'ELSE', 'ELSIF', 'END', 'FOR', 'IF', 'IMPORT', 'LOOP', 'MODULE', 'NEW', 'OF', 'OUT', 'PROCEDURE', 'REPEAT', 'THEN', 'TO', 'TYPE', 'UNTIL', 'VAR', 'WHILE', 'WITH', ); $self->listAdd('specials', 'FALSE', 'INF', 'NIL', 'TRUE', ); $self->listAdd('types', 'ANYPTR', 'ANYREC', 'ARRAY', 'BOOLEAN', 'BYTE', 'CHAR', 'INTEGER', 'LONGINT', 'POINTER', 'REAL', 'RECORD', 'SET', 'SHORTCHAR', 'SHORTINT', 'SHORTREAL', ); $self->contextdata({ 'Comment1' => { callback => \&parseComment1, attribute => 'CommentMaior', }, 'Comment2' => { callback => \&parseComment2, attribute => 'CommentMinor', }, 'CommentN' => { callback => \&parseCommentN, attribute => 'CommentMinor', }, 'CommentN2' => { callback => \&parseCommentN2, attribute => 'CommentMinor', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'String1' => { callback => \&parseString1, attribute => 'String', }, 'String2' => { callback => \&parseString2, attribute => 'String', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Component-Pascal'; } sub parseComment1 { my ($self, $text) = @_; # attribute => 'CommentMaior' # char => '*' # char1 => ')' # context => '#pop' # endRegion => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', ')', 0, 0, 0, undef, 0, '#pop', 'CommentMaior')) { return 1 } # attribute => 'CommentMinor' # char => '(' # char1 => '*' # context => 'CommentN' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '(', '*', 0, 0, 0, undef, 0, 'CommentN', 'CommentMinor')) { return 1 } return 0; }; sub parseComment2 { my ($self, $text) = @_; # attribute => 'CommentMinor' # char => '*' # char1 => ')' # context => '#pop' # endRegion => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', ')', 0, 0, 0, undef, 0, '#pop', 'CommentMinor')) { return 1 } # attribute => 'CommentMinor' # char => '(' # char1 => '*' # context => 'CommentN' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '(', '*', 0, 0, 0, undef, 0, 'CommentN', 'CommentMinor')) { return 1 } return 0; }; sub parseCommentN { my ($self, $text) = @_; # attribute => 'CommentMinor' # char => '*' # char1 => ')' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', ')', 0, 0, 0, undef, 0, '#pop', 'CommentMinor')) { return 1 } # attribute => 'CommentMinor' # char => '(' # char1 => '*' # context => 'CommentN2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '(', '*', 0, 0, 0, undef, 0, 'CommentN2', 'CommentMinor')) { return 1 } return 0; }; sub parseCommentN2 { my ($self, $text) = @_; # attribute => 'CommentMinor' # char => '*' # char1 => ')' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', ')', 0, 0, 0, undef, 0, '#pop', 'CommentMinor')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # String => '(**' # attribute => 'CommentMaior' # beginRegion => 'Comment' # context => 'Comment1' # type => 'StringDetect' if ($self->testStringDetect($text, '(**', 0, 0, 0, undef, 0, 'Comment1', 'CommentMaior')) { return 1 } # attribute => 'CommentMinor' # beginRegion => 'Comment' # char => '(' # char1 => '*' # context => 'Comment2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '(', '*', 0, 0, 0, undef, 0, 'Comment2', 'CommentMinor')) { return 1 } # attribute => 'String' # char => '"' # context => 'String1' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String1', 'String')) { return 1 } # attribute => 'String' # char => ''' # context => 'String2' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String2', 'String')) { return 1 } # String => 'PROCEDURE\s' # attribute => 'Keyword' # beginRegion => 'Proc' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, 'PROCEDURE\\s', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'ABSTRACT;|EMPTY;|END\s*[A-Za-z][A-Za-z0-9_]*\;' # attribute => 'Normal Text' # context => '#stay' # endRegion => 'Proc' # type => 'RegExpr' if ($self->testRegExpr($text, 'ABSTRACT;|EMPTY;|END\\s*[A-Za-z][A-Za-z0-9_]*\\;', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => 'RECORD' # attribute => 'Type' # beginRegion => 'Rec' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, 'RECORD', 0, 0, 0, undef, 0, '#stay', 'Type')) { return 1 } # String => 'END' # attribute => 'Keyword' # context => '#stay' # endRegion => 'Rec' # type => 'RegExpr' if ($self->testRegExpr($text, 'END', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'NEW' # attribute => 'MemAlloc' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, 'NEW', 0, 0, 0, undef, 0, '#stay', 'MemAlloc')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'exits' # attribute => 'Exit' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'exits', 0, undef, 0, '#stay', 'Exit')) { return 1 } # String => 'types' # attribute => 'Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Type')) { return 1 } # String => 'attributes' # attribute => 'Attribute' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'attributes', 0, undef, 0, '#stay', 'Attribute')) { return 1 } # String => 'builtins' # attribute => 'Builtin' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'builtins', 0, undef, 0, '#stay', 'Builtin')) { return 1 } # String => 'specials' # attribute => 'SpecialValues' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'specials', 0, undef, 0, '#stay', 'SpecialValues')) { return 1 } # String => '\s[\+|\-]{0,1}[0-9]([0-9]*|[0-9A-F]*(H|L))' # attribute => 'Integer' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s[\\+|\\-]{0,1}[0-9]([0-9]*|[0-9A-F]*(H|L))', 0, 0, 0, undef, 0, '#stay', 'Integer')) { return 1 } # attribute => 'Float' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { return 1 } # String => '\s[0-9][0-9A-F]*X' # attribute => 'Char' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s[0-9][0-9A-F]*X', 0, 0, 0, undef, 0, '#stay', 'Char')) { return 1 } # String => '[A-Za-z][A-Za-z0-9_]*\*' # attribute => 'ExportFull' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[A-Za-z][A-Za-z0-9_]*\\*', 0, 0, 0, undef, 0, '#stay', 'ExportFull')) { return 1 } # String => '[A-Za-z][A-Za-z0-9_]*\-' # attribute => 'ExportReadOnly' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[A-Za-z][A-Za-z0-9_]*\\-', 0, 0, 0, undef, 0, '#stay', 'ExportReadOnly')) { return 1 } # String => '\s(=|#|<|<=|>|>=|IN\s|IS)' # attribute => 'Relation' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s(=|#|<|<=|>|>=|IN\\s|IS)', 0, 0, 0, undef, 0, '#stay', 'Relation')) { return 1 } # String => '\s(\+|\-|OR|\*|/|DIV|MOD|\&)' # attribute => 'Operator' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s(\\+|\\-|OR|\\*|/|DIV|MOD|\\&)', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } return 0; }; sub parseString1 { my ($self, $text) = @_; # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; sub parseString2 { my ($self, $text) = @_; # attribute => 'String' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::ComponentminusPascal - a Plugin for Component-Pascal syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::ComponentminusPascal; my $sh = new Syntax::Highlight::Engine::Kate::ComponentminusPascal([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::ComponentminusPascal is a plugin module that provides syntax highlighting for Component-Pascal to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Template.pm0000644000175000017500000006477313226470762026451 0ustar manwarmanwar# Copyright (c) 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. package Syntax::Highlight::Engine::Kate::Template; our $VERSION = '0.14'; use strict; use Carp qw(cluck); use Data::Dumper; #my $regchars = '\\^.$|()[]*+?'; sub new { my $proto = shift; my $class = ref($proto) || $proto; my %args = (@_); my $debug = delete $args{'debug'}; unless (defined($debug)) { $debug = 0 }; my $substitutions = delete $args{'substitutions'}; unless (defined($substitutions)) { $substitutions = {} }; my $formattable = delete $args{'format_table'}; unless (defined($formattable)) { $formattable = {} }; my $engine = delete $args{'engine'}; my $self = {}; $self->{'attributes'} = {}, $self->{'captured'} = []; $self->{'contextdata'} = {}; $self->{'basecontext'} = ''; $self->{'debug'} = $debug; $self->{'deliminators'} = ''; $self->{'engine'} = ''; $self->{'format_table'} = $formattable; $self->{'keywordscase'} = 1; $self->{'lastchar'} = ''; $self->{'linesegment'} = ''; $self->{'lists'} = {}; $self->{'linestart'} = 1; $self->{'out'} = []; $self->{'plugins'} = {}; $self->{'snippet'} = ''; $self->{'snippetattribute'} = ''; $self->{'stack'} = []; $self->{'substitutions'} = $substitutions; bless ($self, $class); unless (defined $engine) { $engine = $self }; $self->engine($engine); $self->initialize; return $self; } sub attributes { my $self = shift; if (@_) { $self->{'attributes'} = shift; }; return $self->{'attributes'}; } sub basecontext { my $self = shift; if (@_) { $self->{'basecontext'} = shift; }; return $self->{'basecontext'}; } sub captured { my ($self, $c) = @_; if (defined($c)) { my $t = $self->engine->stackTop; my $n = 0; my @o = (); while (defined($c->[$n])) { push @o, $c->[$n]; $n ++; } if (@o) { $t->[2] = \@o; } }; } sub capturedGet { my ($self, $num) = @_; my $s = $self->engine->{stack}; if (defined($s->[1])) { my $c = $s->[1]->[2]; $num --; if (defined($c)) { if (defined($c->[$num])) { my $r = $c->[$num]; return $r; } else { warn "capture number $num not defined"; } } else { warn "dynamic substitution is called for but nothing to substitute\n"; return undef; } } else { warn "no parent context to take captures from"; } } #sub captured { # my $self = shift; # if (@_) { # $self->{'captured'} = shift; ## print Dumper($self->{'captured'}); # }; # return $self->{'captured'} ## my ($self, $c) = @_; ## if (defined($c)) { ## my $t = $self->engine->stackTop; ## my $n = 0; ## my @o = (); ## while (defined($c->[$n])) { ## push @o, $c->[$n]; ## $n ++; ## } ## if (@o) { ## $t->[2] = \@o; ## } ## }; #} # #sub capturedGet { # my ($self, $num) = @_; # my $s = $self->captured; # if (defined $s) { # $num --; # if (defined($s->[$num])) { # return $s->[$num]; # } else { # $self->logwarning("capture number $num not defined"); # } # } else { # $self->logwarning("dynamic substitution is called for but nothing to substitute"); # return undef; # } #} sub capturedParse { my ($self, $string, $mode) = @_; my $s = ''; if (defined($mode)) { if ($string =~ s/^(\d)//) { $s = $self->capturedGet($1); if ($string ne '') { $self->logwarning("character class is longer then 1 character, ignoring the rest"); } } } else { while ($string ne '') { if ($string =~ s/^([^\%]*)\%(\d)//) { my $r = $self->capturedGet($2); if ($r ne '') { $s = $s . $1 . $r } else { $s = $s . $1 . '%' . $2; $self->logwarning("target is an empty string"); } } else { $string =~ s/^(.)//; $s = "$s$1"; } } } return $s; } sub column { my $self = shift; return length($self->{linesegment}); } sub contextdata { my $self = shift; if (@_) { $self->{'contextdata'} = shift; }; return $self->{'contextdata'}; } sub contextInfo { my ($self, $context, $item) = @_; if (exists $self->{contextdata}->{$context}) { my $c = $self->{contextdata}->{$context}; if (exists $c->{$item}) { return $c->{$item} } else { return undef; } } else { $self->logwarning("undefined context '$context'"); return undef; } } sub contextParse { my ($self, $plug, $context) = @_; if ($context =~ /^#pop/i) { while ($context =~ s/#pop//i) { $self->stackPull; } } elsif ($context =~ /^#stay/i) { #don't do anything } elsif ($context =~ /^##(.+)/) { my $new = $self->pluginGet($1); $self->stackPush([$new, $new->{basecontext}]); } else { $self->stackPush([$plug, $context]); } } sub debug { my $self = shift; if (@_) { $self->{'debug'} = shift; }; return $self->{'debug'}; } sub debugTest { my $self = shift; if (@_) { $self->{'debugtest'} = shift; }; return $self->{'debugtest'}; } sub deliminators { my $self = shift; if (@_) { $self->{'deliminators'} = shift; }; return $self->{'deliminators'}; } sub engine { my $self = shift; if (@_) { $self->{'engine'} = shift; }; return $self->{'engine'}; } sub firstnonspace { my ($self, $string) = @_; my $line = $self->{linesegment}; if (($line =~ /^\s*$/) and ($string =~ /^[^\s]/)) { return 1 } return '' } sub formatTable { my $self = shift; if (@_) { $self->{'format_table'} = shift; }; return $self->{'format_table'}; } sub highlight { my ($self, $text) = @_; $self->snippet(''); my $out = $self->{out}; @$out = (); while ($text ne '') { my $top = $self->stackTop; if (defined($top)) { my ($plug, $context) = @$top; if ($text =~ s/^(\n)//) { $self->snippetForce; my $e = $plug->contextInfo($context, 'lineending'); if (defined($e)) { $self->contextParse($plug, $e) } my $attr = $plug->{attributes}->{$plug->contextInfo($context, 'attribute')}; $self->snippetParse($1, $attr); $self->snippetForce; $self->{linesegment} = ''; my $b = $plug->contextInfo($context, 'linebeginning'); if (defined($b)) { $self->contextParse($plug, $b) } } else { my $sub = $plug->contextInfo($context, 'callback'); my $result = &$sub($plug, \$text); unless($result) { my $f = $plug->contextInfo($context, 'fallthrough'); if (defined($f)) { $self->contextParse($plug, $f); } else { $text =~ s/^(.)//; my $attr = $plug->{attributes}->{$plug->contextInfo($context, 'attribute')}; $self->snippetParse($1, $attr); } } } } else { push @$out, length($text), 'Normal'; $text = ''; } } $self->snippetForce; return @$out; } sub highlightText { my ($self, $text) = @_; my $res = ''; my @hl = $self->highlight($text); while (@hl) { my $f = shift @hl; my $t = shift @hl; unless (defined($t)) { $t = 'Normal' } my $s = $self->{substitutions}; my $rr = ''; while ($f ne '') { my $k = substr($f , 0, 1); $f = substr($f, 1, length($f) -1); if (exists $s->{$k}) { $rr = $rr . $s->{$k} } else { $rr = $rr . $k; } } my $rt = $self->formatTable; if (exists $rt->{$t}) { my $o = $rt->{$t}; $res = $res . $o->[0] . $rr . $o->[1]; } else { $res = $res . $rr; $self->logwarning("undefined format tag '$t'"); } } return $res; } sub includePlugin { my ($self, $language, $text) = @_; my $eng = $self->{engine}; my $plug = $eng->pluginGet($language); if (defined($plug)) { my $context = $plug->{basecontext}; my $call = $plug->contextInfo($context, 'callback'); if (defined($call)) { return &$call($plug, $text); } else { $self->logwarning("cannot find callback for context '$context'"); } } return 0; } sub includeRules { my ($self, $context, $text) = @_; my $call = $self->contextInfo($context, 'callback'); if (defined($call)) { return &$call($self, $text); } else { $self->logwarning("cannot find callback for context '$context'"); } return 0; } sub initialize { my $self = shift; if ($self->engine eq $self) { $self->stack([[$self, $self->{basecontext}]]); } } sub keywordscase { my $self = shift; if (@_) { $self->{'keywordscase'} = shift; } return $self->{'keywordscase'} } sub languagePlug { my ($cw, $name) = @_; my %numb = ( '1' => 'One', '2' => 'Two', '3' => 'Three', '4' => 'Four', '5' => 'Five', '6' => 'Six', '7' => 'Seven', '8' => 'Eight', '9' => 'Nine', '0' => 'Zero', ); if ($name =~ s/^(\d)//) { $name = $numb{$1} . $name; } $name =~ s/\.//; $name =~ s/\+/plus/g; $name =~ s/\-/minus/g; $name =~ s/#/dash/g; $name =~ s/[^0-9a-zA-Z]/_/g; $name =~ s/__/_/g; $name =~ s/_$//; $name = ucfirst($name); return $name; } sub lastchar { my $self = shift; my $l = $self->{linesegment}; if ($l eq '') { return "\n" } #last character was a newline return substr($l, length($l) - 1, 1); } sub lastcharDeliminator { my $self = shift; my $deliminators = '\s|\~|\!|\%|\^|\&|\*|\+|\(|\)|-|=|\{|\}|\[|\]|:|;|<|>|,|\\|\||\.|\?|\/'; if ($self->linestart or ($self->lastchar =~ /$deliminators/)) { return 1; } return ''; } sub linesegment { my $self = shift; if (@_) { $self->{'linesegment'} = shift; }; return $self->{'linesegment'}; } sub linestart { my $self = shift; if ($self->linesegment eq '') { return 1 } return ''; } sub lists { my $self = shift; if (@_) { $self->{'lists'} = shift; } return $self->{'lists'} } sub out { my $self = shift; if (@_) { $self->{'out'} = shift; } return $self->{'out'}; } sub listAdd { my $self = shift; my $listname = shift; my $lst = $self->{lists}; if (@_) { my @l = reverse sort @_; $lst->{$listname} = \@l; } else { $lst->{$listname} = []; } } sub logwarning { my ($self, $warning) = @_; my $top = $self->engine->stackTop; if (defined $top) { my $lang = $top->[0]->language; my $context = $top->[1]; $warning = "$warning\n Language => $lang, Context => $context\n"; } else { $warning = "$warning\n STACK IS EMPTY: PANIC\n" } cluck($warning); } sub parseResult { my ($self, $text, $string, $lahead, $column, $fnspace, $context, $attr) = @_; my $eng = $self->engine; if ($fnspace) { unless ($eng->firstnonspace($$text)) { return '' } } if (defined($column)) { if ($column ne $eng->column) { return ''; } } unless ($lahead) { $$text = substr($$text, length($string)); my $r; unless (defined($attr)) { my $t = $eng->stackTop; my ($plug, $ctext) = @$t; $r = $plug->{attributes}->{$plug->contextInfo($ctext, 'attribute')}; } else { $r = $self->{attributes}->{$attr}; } $eng->snippetParse($string, $r); } $eng->contextParse($self, $context); return 1 } sub pluginGet { my ($self, $language) = @_; my $plugs = $self->{'plugins'}; unless (exists($plugs->{$language})) { my $lang_plug = $self->languagePlug($language); my $modname = 'Syntax::Highlight::Engine::Kate::'; if (defined $lang_plug) { $modname .= $lang_plug; } unless (defined($modname)) { $self->logwarning("no valid module found for language '$language'"); return undef; } my $plug; eval "use $modname; \$plug = new $modname(engine => \$self);"; if (defined($plug)) { $plugs->{$language} = $plug; } else { $self->logwarning("cannot create plugin for language '$language'\n--------------\n$@"); } } if (exists($plugs->{$language})) { return $plugs->{$language}; } return undef; } sub reset { my $self = shift; $self->stack([[$self, $self->{basecontext}]]); $self->out([]); $self->snippet(''); } sub snippet { my $self = shift; if (@_) { $self->{'snippet'} = shift; } return $self->{'snippet'}; } sub snippetAppend { my ($self, $ch) = @_; return if not defined $ch; $self->{'snippet'} = $self->{'snippet'} . $ch; if ($ch ne '') { $self->{linesegment} = $self->{linesegment} . $ch; } return; } sub snippetAttribute { my $self = shift; if (@_) { $self->{'snippetattribute'} = shift; } return $self->{'snippetattribute'}; } sub snippetForce { my $self = shift; my $parse = $self->snippet; if ($parse ne '') { my $out = $self->{'out'}; push(@$out, $parse, $self->{snippetattribute}); $self->snippet(''); } } sub snippetParse { my $self = shift; my $snip = shift; my $attr = shift; if ((defined $attr) and ($attr ne $self->{snippetattribute})) { $self->snippetForce; $self->{snippetattribute} = $attr; } $self->snippetAppend($snip); } sub stack { my $self = shift; if (@_) { $self->{'stack'} = shift; } return $self->{'stack'}; } sub stackPush { my ($self, $val) = @_; my $stack = $self->{stack}; unshift(@$stack, $val); } sub stackPull { my ($self, $val) = @_; my $stack = $self->{stack}; return shift(@$stack); } sub stackTop { my $self = shift; return $self->{stack}->[0]; } sub stateCompare { my ($self, $state) = @_; my $h = [ $self->stateGet ]; my $equal = 0; if (Dumper($h) eq Dumper($state)) { $equal = 1 }; return $equal; } sub stateGet { my $self = shift; my $s = $self->{stack}; return @$s; } sub stateSet { my $self = shift; my $s = $self->{stack}; @$s = (@_); } sub substitutions { my $self = shift; if (@_) { $self->{'substitutions'} = shift; } return $self->{'substitutions'}; } sub testAnyChar { my $self = shift; my $text = shift; my $string = shift; my $insensitive = shift; my $test = substr($$text, 0, 1); my $bck = $test; if ($insensitive) { $string = lc($string); $test = lc($test); } if (index($string, $test) > -1) { return $self->parseResult($text, $bck, @_); } return '' } sub testDetectChar { my $self = shift; my $text = shift; my $char = shift; my $insensitive = shift; my $dyn = shift; if ($dyn) { $char = $self->capturedParse($char, 1); } my $test = substr($$text, 0, 1); my $bck = $test; if ($insensitive) { $char = lc($char); $test = lc($test); } if ($char eq $test) { return $self->parseResult($text, $bck, @_); } return '' } sub testDetect2Chars { my $self = shift; my $text = shift; my $char = shift; my $char1 = shift; my $insensitive = shift; my $dyn = shift; if ($dyn) { $char = $self->capturedParse($char, 1); $char1 = $self->capturedParse($char1, 1); } my $string = $char . $char1; my $test = substr($$text, 0, 2); my $bck = $test; if ($insensitive) { $string = lc($string); $test = lc($test); } if ($string eq $test) { return $self->parseResult($text, $bck, @_); } return '' } sub testDetectIdentifier { my $self = shift; my $text = shift; if ($$text =~ /^([a-zA-Z_][a-zA-Z0-9_]+)/) { return $self->parseResult($text, $1, @_); } return '' } sub testDetectSpaces { my $self = shift; my $text = shift; if ($$text =~ /^([\\040|\\t]+)/) { return $self->parseResult($text, $1, @_); } return '' } sub testFloat { my $self = shift; my $text = shift; if ($self->engine->lastcharDeliminator) { if ($$text =~ /^((?=\.?\d)\d*(?:\.\d*)?(?:[Ee][+-]?\d+)?)/) { return $self->parseResult($text, $1, @_); } } return '' } sub testHlCChar { my $self = shift; my $text = shift; if ($$text =~ /^('.')/) { return $self->parseResult($text, $1, @_); } return '' } sub testHlCHex { my $self = shift; my $text = shift; if ($self->engine->lastcharDeliminator) { if ($$text =~ /^(0x[0-9a-fA-F]+)/) { return $self->parseResult($text, $1, @_); } } return '' } sub testHlCOct { my $self = shift; my $text = shift; if ($self->engine->lastcharDeliminator) { if ($$text =~ /^(0[0-7]+)/) { return $self->parseResult($text, $1, @_); } } return '' } sub testHlCStringChar { my $self = shift; my $text = shift; if ($$text =~ /^(\\[a|b|e|f|n|r|t|v|'|"|\?])/) { return $self->parseResult($text, $1, @_); } if ($$text =~ /^(\\x[0-9a-fA-F][0-9a-fA-F]?)/) { return $self->parseResult($text, $1, @_); } if ($$text =~ /^(\\[0-7][0-7]?[0-7]?)/) { return $self->parseResult($text, $1, @_); } return '' } sub testInt { my $self = shift; my $text = shift; if ($self->engine->lastcharDeliminator) { if ($$text =~ /^([+-]?\d+)/) { return $self->parseResult($text, $1, @_); } } return '' } sub testKeyword { my $self = shift; my $text = shift; my $list = shift; my $eng = $self->{engine}; my $deliminators = $self->{deliminators}; if (($eng->lastcharDeliminator) and ($$text =~ /^([^$deliminators]+)/)) { my $match = $1; my $l = $self->{lists}->{$list}; if (defined($l)) { my @list = @$l; my @rl = (); unless ($self->{keywordscase}) { @rl = grep { (lc($match) eq lc($_)) } @list; } else { @rl = grep { ($match eq $_) } @list; } if (@rl) { return $self->parseResult($text, $match, @_); } } else { $self->logwarning("list '$list' is not defined, failing test"); } } return '' } sub testLineContinue { my $self = shift; my $text = shift; my $lahead = shift; if ($lahead) { if ($$text =~ /^\\\n/) { $self->parseResult($text, "\\", $lahead, @_); return 1; } } else { if ($$text =~ s/^(\\)(\n)/$2/) { return $self->parseResult($text, "\\", $lahead, @_); } } return '' } sub testRangeDetect { my $self = shift; my $text = shift; my $char = shift; my $char1 = shift; my $insensitive = shift; my $string = "$char\[^$char1\]+$char1"; return $self->testRegExpr($text, $string, $insensitive, 0, @_); } sub testRegExpr { my $self = shift; my $text = shift; my $reg = shift; my $insensitive = shift; my $dynamic = shift; if ($dynamic) { $reg = $self->capturedParse($reg); } my $eng = $self->{engine}; if ($reg =~ s/^\^//) { unless ($eng->linestart) { return ''; } } elsif ($reg =~ s/^\\(b)//i) { my $lastchar = $eng->lastchar; if ($1 eq 'b') { if ($lastchar =~ /\w/) { return '' } } else { if ($lastchar =~ /\W/) { return '' } } } $reg = "^($reg)"; my $sample = $$text; # emergency measurements to avoid exception (szabgab) $reg = eval { qr/$reg/ }; if ($@) { warn $@; return ''; } my $match; if ($insensitive) { if ($sample =~ /$reg/i) { $match = $1; if ($#-) { no strict 'refs'; my @cap = map {$$_} 2 .. $#-; $self->captured(\@cap) } } } else { if ($sample =~ /$reg/) { $match = $1; if ($#-) { no strict 'refs'; my @cap = map {$$_} 2 .. $#-; $self->captured(\@cap); } } } if ((defined($match)) and ($match ne '')) { return $self->parseResult($text, $match, @_); } return '' } sub testStringDetect { my $self = shift; my $text = shift; my $string = shift; my $insensitive = shift; my $dynamic = shift; if ($dynamic) { $string = $self->capturedParse($string); } my $test = substr($$text, 0, length($string)); my $bck = $test; if ($insensitive) { $string = lc($string); $test = lc($test); } if ($string eq $test) { return $self->parseResult($text, $bck, @_); } return '' } 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Template - a template for syntax highlighting plugins =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Template is a framework to assist authors of plugin modules. All methods to provide highlighting to the Syntax::Highlight::Engine::Kate module are there, Just no syntax definitions and callbacks. An instance of Syntax::Highlight::Engine::Kate::Template should never be created, it's meant to be sub classed only. =head1 METHODS =over 4 =item B(I); Sets and returns a reference to the attributes hash. =item B(I); Sets and returns the basecontext instance variable. This is the context that is used when highlighting starts. =item B(I<$cap>); Puts $cap in the first element of the stack, the current context. Used when the context is dynamic. =item B(I<$num>); Returns the $num'th element that was captured in the current context. =item B(I<$string>, I<$mode>); If B<$mode> is specified, B<$string> should only be one character long and numeric. B will return the Nth captured element of the current context. If B<$mode> is not specified, all occurrences of %[1-9] will be replaced by the captured element of the current context. =item B returns the column position in the line that is currently highlighted. =item B(I<\%data>); Sets and returns a reference to the contextdata hash. =item B(I<$context>, I<$item>); returns the value of several context options. B<$item> can be B, B, B, B, B. =item B(I<$plugin>, I<$context>); Called by the plugins after a test succeeds. if B<$context> has following values: #pop returns to the previous context, removes to top item in the stack. Can also be specified as #pop#pop etc. #stay does nothing. ##.... Switches to the plugin specified in .... and assumes it's basecontext. .... Swtiches to the context specified in .... =item B(I); Sets and returns a string that is a regular expression for detecting deliminators. =item B Returns a reference to the Syntax::Highlight::Engine::Kate module that created this plugin. =item B(I<$string>); returns true if the current line did not contain a non-spatial character so far and the first character in B<$string> is also a spatial character. =item B sets and returns the instance variable B. See also the option B =item B(I<$text>); highlights I<$text>. It does so by selecting the proper callback from the B hash and invoke it. It will do so until $text has been reduced to an empty string. returns a paired list of snippets of text and the attribute with which they should be highlighted. =item B(I<$text>); highlights I<$text> and reformats it using the B and B =item B(I<$language>, I<\$text>); Includes the plugin for B<$language> in the highlighting. =item B(I<$language>, I<\$text>); Includes the plugin for B<$language> in the highlighting. =item B Sets and returns the keywordscase instance variable. =item B return the last character that was processed. =item B returns true if the last character processed was a deliminator. =item B returns the string of text in the current line that has been processed so far, =item B returns true if processing is currently at the beginning of a line. =item B(I<'listname'>, I<$item1>, I<$item2> ...); Adds a list to the 'lists' hash. =item B(I); sets and returns the instance variable 'lists'. =item B(I); sets and returns the instance variable 'out'. =item B(I<\$text>, I<$match>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); Called by every one of the test methods below. If the test matches, it will do a couple of subtests. If B<$column> is a defined numerical value it will test if the process is at the requested column. If B<$firnonspace> is true, it will test this also. Ig it is not a look ahead and all tests are passed, B<$match> is then parsed and removed from B<$$text>. =item B(I<$language>); Returns a reference to a plugin object for the specified language. Creating an instance if needed. =item B Resets the highlight engine to a fresh state, does not change the syntx. =item B Contains the current snippet of text that will have one attribute. The moment the attribute changes it will be parsed. =item B(I<$string>) appends I<$string> to the current snippet. =item B(I<$attribute>) Sets and returns the used attribute. =item B Forces the current snippet to be parsed. =item B(I<$text>, I) If attribute is defined and differs from the current attribute it does a snippetForce and sets the current attribute to B<$attribute>. Then it does a snippetAppend of B<$text> =item B sets and returns the instance variable 'stack', a reference to an array =item B retrieves the element that is on top of the stack, decrements stacksize by 1. =item B(I<$tagname>); puts I<$tagname> on top of the stack, increments stacksize by 1 =item B Retrieves the element that is on top of the stack. =item B(I<\@state>) Compares two lists, \@state and the stack. returns true if they match. =item B Returns a list containing the entire stack. =item B(I<@list>) Accepts I<@list> as the current stack. =item B sets and returns a reference to the substitutions hash. =back The methods below all return a boolean value. =over 4 =item B(I<\$text>, I<$string>, I<$insensitive>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$char>, I<$insensitive>, I<$dynamic>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$char1>, I<$char2>, I<$insensitive>, I<$dynamic>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$list>, I<$insensitive>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$char1>, I<$char2>, I<$insensitive>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$reg>, I<$insensitive>, I<$dynamic>, I<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =item B(I<\$text>, I<$string>, I<$insensitive>, I<$dynamic>, II<$lookahaed>, I<$column>, I<$firstnonspace>, I<$context>, I<$attribute>); =back =head1 ACKNOWLEDGEMENTS All the people who wrote Kate and the syntax highlight xml files. =head1 AUTHOR AND COPYRIGHT This module is written and maintained by: Hans Jeuken < haje at toneel dot demon dot nl > Copyright (c) 2006 by Hans Jeuken, all rights reserved. You may freely distribute and/or modify this module under same terms as Perl itself =head1 SEE ALSO Synax::Highlight::Engine::Kate http:://www.kate-editor.org Syntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/JavaScript.pm0000644000175000017500000005333213226470762026731 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'javascript.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.10 #kate version 2.3 #kate author Anders Lund (anders@alweb.dk), Joseph Wenninger (jowenn@kde.org), Whitehawk Stormchaser (zerokode@gmx.net) #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::JavaScript; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Char' => 'Char', 'Comment' => 'Comment', 'Data Type' => 'DataType', 'Decimal' => 'DecVal', 'Events' => 'Operator', 'Float' => 'Float', 'Function' => 'Function', 'Keyword' => 'Keyword', 'Math' => 'BString', 'Normal Text' => 'Normal', 'Objects' => 'Reserved', 'Pattern Character Class' => 'BaseN', 'Pattern Internal Operator' => 'Float', 'Region Marker' => 'RegionMarker', 'Regular Expression' => 'Others', 'String' => 'String', 'String Char' => 'Char', 'Symbol' => 'Normal', }); $self->listAdd('events', 'onAbort', 'onBlur', 'onChange', 'onClick', 'onError', 'onFocus', 'onLoad', 'onMouseOut', 'onMouseOver', 'onReset', 'onSelect', 'onSubmit', 'onUnload', ); $self->listAdd('functions', 'Number', 'escape', 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'reload', 'taint', 'unescape', 'untaint', 'write', ); $self->listAdd('keywords', 'break', 'case', 'catch', 'const', 'continue', 'default', 'delete', 'do', 'else', 'false', 'finally', 'for', 'function', 'if', 'in', 'new', 'return', 'switch', 'throw', 'true', 'try', 'typeof', 'var', 'void', 'while', 'with', ); $self->listAdd('math', 'E', 'LN10', 'LN2', 'LOG10E', 'LOG2E', 'PI', 'SQRT1_2', 'SQRT2', 'abs', 'acos', 'asin', 'atan', 'atan2', 'ceil', 'cos', 'ctg', 'exp', 'floor', 'log', 'pow', 'round', 'sin', 'sqrt', 'tan', ); $self->listAdd('methods', 'MAX_VALUE', 'MIN_VALUE', 'NEGATIVE_INFINITY', 'NaN', 'POSITIVE_INFINITY', 'URL', 'UTC', 'above', 'action', 'alert', 'alinkColor', 'anchor', 'anchors', 'appCodeName', 'appName', 'appVersion', 'applets', 'apply', 'argument', 'arguments', 'arity', 'availHeight', 'availWidth', 'back', 'background', 'below', 'bgColor', 'big', 'blink', 'blur', 'bold', 'border', 'border', 'call', 'caller', 'charAt', 'charCodeAt', 'checked', 'clearInterval', 'clearTimeout', 'click', 'clip', 'close', 'closed', 'colorDepth', 'compile', 'complete', 'confirm', 'constructor', 'cookie', 'current', 'cursor', 'data', 'defaultChecked', 'defaultSelected', 'defaultStatus', 'defaultValue', 'description', 'disableExternalCapture', 'domain', 'elements', 'embeds', 'enableExternalCapture', 'enabledPlugin', 'encoding', 'eval', 'exec', 'fgColor', 'filename', 'find', 'fixed', 'focus', 'fontcolor', 'fontsize', 'form', 'formName', 'forms', 'forward', 'frames', 'fromCharCode', 'getDate', 'getDay', 'getHours', 'getMiliseconds', 'getMinutes', 'getMonth', 'getSeconds', 'getSelection', 'getTime', 'getTimezoneOffset', 'getUTCDate', 'getUTCDay', 'getUTCFullYear', 'getUTCHours', 'getUTCMilliseconds', 'getUTCMinutes', 'getUTCMonth', 'getUTCSeconds', 'getYear', 'global', 'go', 'hash', 'height', 'history', 'home', 'host', 'hostname', 'href', 'hspace', 'ignoreCase', 'images', 'index', 'indexOf', 'innerHeight', 'innerWidth', 'input', 'italics', 'javaEnabled', 'join', 'language', 'lastIndex', 'lastIndexOf', 'lastModified', 'lastParen', 'layerX', 'layerY', 'layers', 'left', 'leftContext', 'length', 'link', 'linkColor', 'links', 'load', 'location', 'locationbar', 'lowsrc', 'match', 'menubar', 'method', 'mimeTypes', 'modifiers', 'moveAbove', 'moveBelow', 'moveBy', 'moveTo', 'moveToAbsolute', 'multiline', 'name', 'negative_infinity', 'next', 'open', 'opener', 'options', 'outerHeight', 'outerWidth', 'pageX', 'pageXoffset', 'pageY', 'pageYoffset', 'parent', 'parse', 'pathname', 'personalbar', 'pixelDepth', 'platform', 'plugins', 'pop', 'port', 'positive_infinity', 'preference', 'previous', 'print', 'prompt', 'protocol', 'prototype', 'push', 'referrer', 'refresh', 'releaseEvents', 'reload', 'replace', 'reset', 'resizeBy', 'resizeTo', 'reverse', 'rightContext', 'screenX', 'screenY', 'scroll', 'scrollBy', 'scrollTo', 'scrollbar', 'search', 'select', 'selected', 'selectedIndex', 'self', 'setDate', 'setHours', 'setMinutes', 'setMonth', 'setSeconds', 'setTime', 'setTimeout', 'setUTCDate', 'setUTCDay', 'setUTCFullYear', 'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds', 'setYear', 'shift', 'siblingAbove', 'siblingBelow', 'small', 'sort', 'source', 'splice', 'split', 'src', 'status', 'statusbar', 'strike', 'sub', 'submit', 'substr', 'substring', 'suffixes', 'sup', 'taintEnabled', 'target', 'test', 'text', 'title', 'toGMTString', 'toLocaleString', 'toLowerCase', 'toSource', 'toString', 'toUTCString', 'toUpperCase', 'toolbar', 'top', 'type', 'unshift', 'unwatch', 'userAgent', 'value', 'valueOf', 'visibility', 'vlinkColor', 'vspace', 'watch', 'which', 'width', 'width', 'write', 'writeln', 'x', 'y', 'zIndex', ); $self->listAdd('objects', 'Anchor', 'Applet', 'Area', 'Array', 'Boolean', 'Button', 'Checkbox', 'Date', 'FileUpload', 'Form', 'Frame', 'Function', 'Hidden', 'Image', 'Layer', 'Link', 'Math', 'Max', 'MimeType', 'Min', 'Object', 'Password', 'Plugin', 'Radio', 'RegExp', 'Reset', 'Screen', 'Select', 'String', 'Text', 'Textarea', 'Window', 'document', 'navigator', 'this', 'window', ); $self->contextdata({ '(Internal regex catch)' => { callback => \&parseBoInternalregexcatchBc, attribute => 'Normal Text', fallthrough => '#pop', }, '(charclass caret first check)' => { callback => \&parseBocharclasscaretfirstcheckBc, attribute => 'Pattern Internal Operator', lineending => '#pop', fallthrough => 'Regular Expression Character Class', }, '(regex caret first check)' => { callback => \&parseBoregexcaretfirstcheckBc, attribute => 'Pattern Internal Operator', lineending => '#pop', fallthrough => 'Regular Expression', }, 'Comment' => { callback => \&parseComment, attribute => 'Comment', lineending => '#pop', }, 'Multi/inline Comment' => { callback => \&parseMultiinlineComment, attribute => 'Comment', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'Regular Expression' => { callback => \&parseRegularExpression, attribute => 'Regular Expression', }, 'Regular Expression Character Class' => { callback => \&parseRegularExpressionCharacterClass, attribute => 'Pattern Character Class', }, 'String' => { callback => \&parseString, attribute => 'String', lineending => '#pop', }, 'String 1' => { callback => \&parseString1, attribute => 'String Char', lineending => '#pop', }, 'region_marker' => { callback => \&parseregion_marker, attribute => 'Region Marker', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'JavaScript'; } sub parseBoInternalregexcatchBc { my ($self, $text) = @_; # String => '\s*' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '//(?=;)' # attribute => 'Regular Expression' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '//(?=;)', 0, 0, 0, undef, 0, '#pop', 'Regular Expression')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '*' # context => 'Multi/inline Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Multi/inline Comment', 'Comment')) { return 1 } # attribute => 'Regular Expression' # char => '/' # context => '(regex caret first check)' # type => 'DetectChar' if ($self->testDetectChar($text, '/', 0, 0, 0, undef, 0, '(regex caret first check)', 'Regular Expression')) { return 1 } return 0; }; sub parseBocharclasscaretfirstcheckBc { my ($self, $text) = @_; # attribute => 'Pattern Internal Operator' # char => '^' # context => 'Regular Expression Character Class' # type => 'DetectChar' if ($self->testDetectChar($text, '^', 0, 0, 0, undef, 0, 'Regular Expression Character Class', 'Pattern Internal Operator')) { return 1 } return 0; }; sub parseBoregexcaretfirstcheckBc { my ($self, $text) = @_; # attribute => 'Pattern Internal Operator' # char => '^' # context => 'Regular Expression' # type => 'DetectChar' if ($self->testDetectChar($text, '^', 0, 0, 0, undef, 0, 'Regular Expression', 'Pattern Internal Operator')) { return 1 } return 0; }; sub parseComment { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } return 0; }; sub parseMultiinlineComment { my ($self, $text) = @_; # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # endRegion => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # String => '//BEGIN' # attribute => 'Region Marker' # beginRegion => 'Region1' # context => 'region_marker' # type => 'StringDetect' if ($self->testStringDetect($text, '//BEGIN', 0, 0, 0, undef, 0, 'region_marker', 'Region Marker')) { return 1 } # String => '//END' # attribute => 'Region Marker' # context => 'region_marker' # endRegion => 'Region1' # type => 'RegExpr' if ($self->testRegExpr($text, '//END', 0, 0, 0, undef, 0, 'region_marker', 'Region Marker')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'functions' # attribute => 'Function' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) { return 1 } # String => 'objects' # attribute => 'Objects' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'objects', 0, undef, 0, '#stay', 'Objects')) { return 1 } # String => 'math' # attribute => 'Math' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'math', 0, undef, 0, '#stay', 'Math')) { return 1 } # String => 'events' # attribute => 'Events' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'events', 0, undef, 0, '#stay', 'Events')) { return 1 } # String => 'methods' # attribute => 'Data Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'methods', 0, undef, 0, '#stay', 'Data Type')) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'Float' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { return 1 } # attribute => 'Decimal' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # attribute => 'String' # char => ''' # context => 'String 1' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String 1', 'String')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { return 1 } # attribute => 'Comment' # beginRegion => 'Comment' # char => '/' # char1 => '*' # context => 'Multi/inline Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Multi/inline Comment', 'Comment')) { return 1 } # String => '[=?:]' # attribute => 'Normal Text' # context => '(Internal regex catch)' # type => 'RegExpr' if ($self->testRegExpr($text, '[=?:]', 0, 0, 0, undef, 0, '(Internal regex catch)', 'Normal Text')) { return 1 } # String => '\(' # attribute => 'Normal Text' # context => '(Internal regex catch)' # type => 'RegExpr' if ($self->testRegExpr($text, '\\(', 0, 0, 0, undef, 0, '(Internal regex catch)', 'Normal Text')) { return 1 } # attribute => 'Symbol' # beginRegion => 'Brace1' # char => '{' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # attribute => 'Symbol' # char => '}' # context => '#stay' # endRegion => 'Brace1' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # String => ':!%&+,-/.*<=>?[]|~^;' # attribute => 'Symbol' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, ':!%&+,-/.*<=>?[]|~^;', 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } return 0; }; sub parseRegularExpression { my ($self, $text) = @_; # String => '/[ig]{0,2}' # attribute => 'Regular Expression' # context => '#pop#pop#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '/[ig]{0,2}', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Regular Expression')) { return 1 } # String => '\{[\d, ]+\}' # attribute => 'Pattern Internal Operator' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\{[\\d, ]+\\}', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { return 1 } # String => '\\[bB]' # attribute => 'Pattern Internal Operator' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\[bB]', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { return 1 } # String => '\\[nrtvfDdSsWw]' # attribute => 'Pattern Character Class' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\[nrtvfDdSsWw]', 0, 0, 0, undef, 0, '#stay', 'Pattern Character Class')) { return 1 } # attribute => 'Pattern Character Class' # char => '[' # context => '(charclass caret first check)' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, '(charclass caret first check)', 'Pattern Character Class')) { return 1 } # String => '\\.' # attribute => 'Pattern Internal Operator' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { return 1 } # String => '\$(?=/)' # attribute => 'Pattern Internal Operator' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$(?=/)', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { return 1 } # String => '?+*()|' # attribute => 'Pattern Internal Operator' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '?+*()|', 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { return 1 } return 0; }; sub parseRegularExpressionCharacterClass { my ($self, $text) = @_; # String => '\\[\[\]]' # attribute => 'Pattern Character Class' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\[\\[\\]]', 0, 0, 0, undef, 0, '#stay', 'Pattern Character Class')) { return 1 } # attribute => 'Pattern Character Class' # char => ']' # context => '#pop#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop#pop', 'Pattern Character Class')) { return 1 } return 0; }; sub parseString { my ($self, $text) = @_; # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'String Char' # context => '#stay' # type => 'HlCStringChar' if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; sub parseString1 { my ($self, $text) = @_; # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # attribute => 'String Char' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String Char')) { return 1 } return 0; }; sub parseregion_marker { my ($self, $text) = @_; # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::JavaScript - a Plugin for JavaScript syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::JavaScript; my $sh = new Syntax::Highlight::Engine::Kate::JavaScript([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::JavaScript is a plugin module that provides syntax highlighting for JavaScript to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/AVR_Assembler.pm0000644000175000017500000002146413226470762027311 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'asm-avr.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.03 #kate version 2.4 #kate author Roland Nagy #generated: Sun Feb 3 22:02:04 2008, localtime package Syntax::Highlight::Engine::Kate::AVR_Assembler; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Binary' => 'BaseN', 'Char' => 'Char', 'Comment' => 'Comment', 'Decimal' => 'DecVal', 'Float' => 'Float', 'Hex' => 'BaseN', 'Keyword' => 'Keyword', 'Label' => 'Function', 'Normal Text' => 'Normal', 'Octal' => 'BaseN', 'Preprocessor' => 'Others', 'String' => 'String', 'String Char' => 'Char', 'Symbol' => 'Normal', }); $self->listAdd('keywords', 'adc', 'add', 'adiw', 'and', 'andi', 'asr', 'bclr', 'bld', 'brbc', 'brbs', 'break', 'breq', 'brge', 'brhc', 'brhs', 'brid', 'brie', 'brlo', 'brlt', 'brmi', 'brne', 'brpl', 'brsh', 'brtc', 'brts', 'brvc', 'brvs', 'bset', 'bst', 'call', 'cbi', 'cbr', 'clc', 'clh', 'cli', 'cln', 'clr', 'cls', 'clt', 'clv', 'clz', 'com', 'cp', 'cpc', 'cpi', 'cpse', 'dec', 'eicall', 'eijmp', 'elpm', 'eor', 'fmul', 'fmuls', 'fmulsu', 'icall', 'ijmp', 'in', 'inc', 'jmp', 'ld', 'ldi', 'lds', 'lpm', 'lsl', 'lsr', 'mov', 'movw', 'mul', 'muls', 'mulsu', 'neg', 'nop', 'or', 'ori', 'out', 'pop', 'push', 'rcall', 'ret', 'reti', 'rjmp', 'rol', 'ror', 'sbc', 'sbci', 'sbi', 'sbic', 'sbis', 'sbiw', 'sbr', 'sbrc', 'sbrs', 'sec', 'seh', 'sei', 'sen', 'ser', 'ses', 'set', 'sev', 'sez', 'sleep', 'spm', 'st', 'sts', 'sub', 'subi', 'swap', 'tst', 'wdr', ); $self->contextdata({ 'Commentar 1' => { callback => \&parseCommentar1, attribute => 'Comment', }, 'Commentar 2' => { callback => \&parseCommentar2, attribute => 'Comment', lineending => '#pop', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'Preprocessor' => { callback => \&parsePreprocessor, attribute => 'Preprocessor', lineending => '#pop', }, 'Some Context' => { callback => \&parseSomeContext, attribute => 'Normal Text', lineending => '#pop', }, 'String' => { callback => \&parseString, attribute => 'String', lineending => '#pop', }, }); $self->deliminators('\\s||\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|_|\\.|\\$'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'AVR Assembler'; } sub parseCommentar1 { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseCommentar2 { my ($self, $text) = @_; return 0; }; sub parseNormal { my ($self, $text) = @_; # String => '[A-Za-z0-9_.$]+:' # attribute => 'Label' # context => '#stay' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '[A-Za-z0-9_.$]+:', 0, 0, 0, undef, 1, '#stay', 'Label')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # attribute => 'Octal' # context => '#stay' # type => 'HlCOct' if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) { return 1 } # attribute => 'Hex' # context => '#stay' # type => 'HlCHex' if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) { return 1 } # String => '0[bB][01]+' # attribute => 'Binary' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '0[bB][01]+', 0, 0, 0, undef, 0, '#stay', 'Binary')) { return 1 } # attribute => 'Decimal' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => '0[fFeEdD][-+]?[0-9]*\.?[0-9]*[eE]?[-+]?[0-9]+' # attribute => 'Float' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '0[fFeEdD][-+]?[0-9]*\\.?[0-9]*[eE]?[-+]?[0-9]+', 0, 0, 0, undef, 0, '#stay', 'Float')) { return 1 } # String => '[A-Za-z_.$][A-Za-z0-9_.$]*' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[A-Za-z_.$][A-Za-z0-9_.$]*', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => ''(\\x[0-9a-fA-F][0-9a-fA-F]?|\\[0-7]?[0-7]?[0-7]?|\\.|.)' # attribute => 'Char' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\'(\\\\x[0-9a-fA-F][0-9a-fA-F]?|\\\\[0-7]?[0-7]?[0-7]?|\\\\.|.)', 0, 0, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '*' # context => 'Commentar 1' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) { return 1 } # attribute => 'Comment' # char => '@' # context => 'Commentar 2' # type => 'DetectChar' if ($self->testDetectChar($text, '@', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) { return 1 } # attribute => 'Comment' # char => ';' # context => 'Commentar 2' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) { return 1 } # String => '!#%&*()+,-<=>?/:[]^{|}~' # attribute => 'Symbol' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '!#%&*()+,-<=>?/:[]^{|}~', 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # String => '^#' # attribute => 'Preprocessor' # context => 'Preprocessor' # type => 'RegExpr' if ($self->testRegExpr($text, '^#', 0, 0, 0, undef, 0, 'Preprocessor', 'Preprocessor')) { return 1 } return 0; }; sub parsePreprocessor { my ($self, $text) = @_; return 0; }; sub parseSomeContext { my ($self, $text) = @_; return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # context => 'Some Context' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, 'Some Context', 'String')) { return 1 } # attribute => 'String Char' # context => '#stay' # type => 'HlCStringChar' if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::AVR_Assembler - a Plugin for AVR Assembler syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::AVR_Assembler; my $sh = new Syntax::Highlight::Engine::Kate::AVR_Assembler([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::AVR_Assembler is a plugin module that provides syntax highlighting for AVR Assembler to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/CSS_PHP.pm0000644000175000017500000007200613226470762026021 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'css-php.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.99 #kate version 2.4 #kate author Wilbert Berendsen (wilbert@kde.nl) #generated: Sun Feb 3 22:02:04 2008, localtime package Syntax::Highlight::Engine::Kate::CSS_PHP; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Alert' => 'Alert', 'At Rule' => 'DecVal', 'Comment' => 'Comment', 'Error' => 'Error', 'Important' => 'Keyword', 'Media' => 'DecVal', 'Normal Text' => 'Normal', 'Property' => 'Keyword', 'Region Marker' => 'RegionMarker', 'Selector Attr' => 'Char', 'Selector Class' => 'Float', 'Selector Id' => 'Float', 'Selector Pseudo' => 'DecVal', 'String' => 'String', 'Unknown Property' => 'Error', 'Value' => 'DataType', }); $self->listAdd('colors', 'ActiveBorder', 'ActiveCaption', 'AppWorkspace', 'Background', 'ButtonFace', 'ButtonHighlight', 'ButtonShadow', 'ButtonText', 'CaptionText', 'GrayText', 'Highlight', 'HighlightText', 'InactiveBorder', 'InactiveCaption', 'InactiveCaptionText', 'InfoBackground', 'InfoText', 'Menu', 'MenuText', 'Scrollbar', 'ThreeDDarkShadow', 'ThreeDFace', 'ThreeDHighlight', 'ThreeDLightShadow', 'ThreeDShadow', 'Window', 'WindowFrame', 'WindowText', 'aqua', 'black', 'blue', 'fuchsia', 'gray', 'green', 'lime', 'maroon', 'navy', 'olive', 'purple', 'red', 'silver', 'teal', 'white', 'yellow', ); $self->listAdd('mediatypes', 'all', 'aural', 'braille', 'embossed', 'handheld', 'print', 'projection', 'screen', 'tty', 'tv', ); $self->listAdd('paren', 'attr', 'counter', 'counters', 'format', 'local', 'rect', 'rgb', 'url', ); $self->listAdd('properties', 'ascent', 'azimuth', 'background', 'background-attachment', 'background-color', 'background-image', 'background-position', 'background-repeat', 'baseline', 'bbox', 'border', 'border-bottom', 'border-bottom-color', 'border-bottom-style', 'border-bottom-width', 'border-collapse', 'border-color', 'border-left', 'border-left-color', 'border-left-style', 'border-left-width', 'border-right', 'border-right-color', 'border-right-style', 'border-right-width', 'border-spacing', 'border-style', 'border-top', 'border-top-color', 'border-top-style', 'border-top-width', 'border-width', 'bottom', 'box-sizing', 'cap-height', 'caption-side', 'centerline', 'clear', 'clip', 'color', 'content', 'counter-increment', 'counter-reset', 'cue', 'cue-after', 'cue-before', 'cursor', 'definition-src', 'descent', 'direction', 'display', 'elevation', 'empty-cells', 'float', 'font', 'font-family', 'font-family', 'font-size', 'font-size', 'font-size-adjust', 'font-stretch', 'font-stretch', 'font-style', 'font-style', 'font-variant', 'font-variant', 'font-weight', 'font-weight', 'height', 'konq_bgpos_x', 'konq_bgpos_y', 'left', 'letter-spacing', 'line-height', 'list-style', 'list-style-image', 'list-style-keyword', 'list-style-position', 'list-style-type', 'margin', 'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'marker-offset', 'mathline', 'max-height', 'max-width', 'min-height', 'min-width', 'opacity', 'orphans', 'outline', 'outline-color', 'outline-style', 'outline-width', 'overflow', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'page', 'page-break-after', 'page-break-before', 'page-break-inside', 'panose-1', 'pause', 'pause-after', 'pause-before', 'pitch', 'pitch-range', 'play-during', 'position', 'quotes', 'richness', 'right', 'size', 'slope', 'speak', 'speak-header', 'speak-numeral', 'speak-punctuation', 'speech-rate', 'src', 'stemh', 'stemv', 'stress', 'table-layout', 'text-align', 'text-decoration', 'text-decoration-color', 'text-indent', 'text-shadow', 'text-shadow', 'text-transform', 'top', 'topline', 'unicode-bidi', 'unicode-range', 'units-per-em', 'vertical-align', 'visibility', 'voice-family', 'volume', 'white-space', 'widows', 'width', 'widths', 'word-spacing', 'x-height', 'z-index', ); $self->listAdd('pseudoclasses', 'active', 'after', 'before', 'checked', 'disabled', 'empty', 'enabled', 'first-child', 'first-letter', 'first-line', 'first-of-type', 'focus', 'hover', 'indeterminate', 'last-child', 'last-of-type', 'link', 'only-child', 'only-of-type', 'root', 'selection', 'target', 'visited', ); $self->listAdd('types', '100', '200', '300', '400', '500', '600', '700', '800', '900', 'above', 'absolute', 'always', 'armenian', 'auto', 'avoid', 'baseline', 'below', 'bidi-override', 'blink', 'block', 'bold', 'bolder', 'border-box', 'both', 'bottom', 'box', 'break', 'capitalize', 'caption', 'center', 'circle', 'cjk-ideographic', 'close-quote', 'collapse', 'compact', 'condensed', 'content-box', 'crop', 'cross', 'crosshair', 'cursive', 'dashed', 'decimal', 'decimal-leading-zero', 'default', 'disc', 'dotted', 'double', 'e-resize', 'embed', 'expanded', 'extra-condensed', 'extra-expanded', 'fantasy', 'fixed', 'georgian', 'groove', 'hand', 'hebrew', 'help', 'hidden', 'hide', 'higher', 'hiragana', 'hiragana-iroha', 'icon', 'inherit', 'inline', 'inline-table', 'inset', 'inside', 'invert', 'italic', 'justify', 'katakana', 'katakana-iroha', 'konq-center', 'landscape', 'large', 'larger', 'left', 'level', 'light', 'lighter', 'line-through', 'list-item', 'loud', 'lower', 'lower-alpha', 'lower-greek', 'lower-latin', 'lower-roman', 'lowercase', 'ltr', 'marker', 'medium', 'menu', 'message-box', 'middle', 'mix', 'monospace', 'move', 'n-resize', 'narrower', 'ne-resize', 'no-close-quote', 'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap', 'nw-resize', 'oblique', 'open-quote', 'outset', 'outside', 'overline', 'pointer', 'portrait', 'pre', 'pre-line', 'pre-wrap', 'relative', 'repeat', 'repeat-x', 'repeat-y', 'ridge', 'right', 'rtl', 'run-in', 's-resize', 'sans-serif', 'scroll', 'se-resize', 'semi-condensed', 'semi-expanded', 'separate', 'serif', 'show', 'small', 'small-caps', 'small-caption', 'smaller', 'solid', 'square', 'static', 'static-position', 'status-bar', 'sub', 'super', 'sw-resize', 'table', 'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row', 'table-row-group', 'text', 'text-bottom', 'text-top', 'thick', 'thin', 'top', 'transparent', 'ultra-condensed', 'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin', 'upper-roman', 'uppercase', 'visible', 'w-resize', 'wait', 'wider', 'x-large', 'x-small', 'xx-large', 'xx-small', ); $self->contextdata({ 'Base' => { callback => \&parseBase, attribute => 'Normal Text', }, 'Comment' => { callback => \&parseComment, attribute => 'Comment', }, 'FindComments' => { callback => \&parseFindComments, attribute => 'Normal Text', }, 'FindPHP' => { callback => \&parseFindPHP, }, 'FindRuleSets' => { callback => \&parseFindRuleSets, attribute => 'Normal Text', }, 'FindStrings' => { callback => \&parseFindStrings, attribute => 'Normal Text', }, 'FindValues' => { callback => \&parseFindValues, attribute => 'Normal Text', }, 'Import' => { callback => \&parseImport, attribute => 'Normal Text', }, 'InsideString' => { callback => \&parseInsideString, attribute => 'String', }, 'Media' => { callback => \&parseMedia, attribute => 'Normal Text', }, 'Media2' => { callback => \&parseMedia2, attribute => 'Normal Text', }, 'PropParen' => { callback => \&parsePropParen, attribute => 'Normal Text', }, 'PropParen2' => { callback => \&parsePropParen2, attribute => 'Normal Text', }, 'Rule' => { callback => \&parseRule, attribute => 'Normal Text', }, 'Rule2' => { callback => \&parseRule2, attribute => 'Normal Text', }, 'RuleSet' => { callback => \&parseRuleSet, attribute => 'Normal Text', }, 'SelAttr' => { callback => \&parseSelAttr, attribute => 'Selector Attr', }, 'SelPseudo' => { callback => \&parseSelPseudo, attribute => 'Selector Pseudo', lineending => '#pop', fallthrough => '#pop', }, 'StringDQ' => { callback => \&parseStringDQ, attribute => 'String', }, 'StringSQ' => { callback => \&parseStringSQ, attribute => 'String', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|<|=|>|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|-|\\%'); $self->basecontext('Base'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'CSS/PHP'; } sub parseBase { my ($self, $text) = @_; # context => 'FindPHP' # type => 'IncludeRules' if ($self->includeRules('FindPHP', $text)) { return 1 } # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', undef)) { return 1 } # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # context => 'FindRuleSets' # type => 'IncludeRules' if ($self->includeRules('FindRuleSets', $text)) { return 1 } return 0; }; sub parseComment { my ($self, $text) = @_; # context => 'FindPHP' # type => 'IncludeRules' if ($self->includeRules('FindPHP', $text)) { return 1 } # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # endRegion => 'comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } return 0; }; sub parseFindComments { my ($self, $text) = @_; # context => 'FindPHP' # type => 'IncludeRules' if ($self->includeRules('FindPHP', $text)) { return 1 } # String => '/\*BEGIN.*\*/' # attribute => 'Region Marker' # beginRegion => 'UserDefined' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '/\\*BEGIN.*\\*/', 0, 0, 0, undef, 0, '#stay', 'Region Marker')) { return 1 } # String => '/\*END.*\*/' # attribute => 'Region Marker' # context => '#stay' # endRegion => 'UserDefined' # type => 'RegExpr' if ($self->testRegExpr($text, '/\\*END.*\\*/', 0, 0, 0, undef, 0, '#stay', 'Region Marker')) { return 1 } # attribute => 'Comment' # beginRegion => 'comment' # char => '/' # char1 => '*' # context => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { return 1 } return 0; }; sub parseFindPHP { my ($self, $text) = @_; # String => '<\?(?:=|php)?' # context => '##PHP/PHP' # lookAhead => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '<\\?(?:=|php)?', 0, 0, 1, undef, 0, '##PHP/PHP', undef)) { return 1 } return 0; }; sub parseFindRuleSets { my ($self, $text) = @_; # context => 'FindPHP' # type => 'IncludeRules' if ($self->includeRules('FindPHP', $text)) { return 1 } # String => '@media\b' # attribute => 'Media' # context => 'Media' # type => 'RegExpr' if ($self->testRegExpr($text, '@media\\b', 0, 0, 0, undef, 0, 'Media', 'Media')) { return 1 } # String => '@import\b' # attribute => 'At Rule' # context => 'Import' # type => 'RegExpr' if ($self->testRegExpr($text, '@import\\b', 0, 0, 0, undef, 0, 'Import', 'At Rule')) { return 1 } # String => '@(font-face|charset)\b' # attribute => 'At Rule' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '@(font-face|charset)\\b', 0, 0, 0, undef, 0, '#stay', 'At Rule')) { return 1 } # attribute => 'Property' # beginRegion => 'ruleset' # char => '{' # context => 'RuleSet' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'RuleSet', 'Property')) { return 1 } # attribute => 'Selector Attr' # char => '[' # context => 'SelAttr' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'SelAttr', 'Selector Attr')) { return 1 } # String => '#[A-Za-z0-9][\w\-]*' # attribute => 'Selector Id' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#[A-Za-z0-9][\\w\\-]*', 0, 0, 0, undef, 0, '#stay', 'Selector Id')) { return 1 } # String => '\.[A-Za-z0-9][\w\-]*' # attribute => 'Selector Class' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\.[A-Za-z0-9][\\w\\-]*', 0, 0, 0, undef, 0, '#stay', 'Selector Class')) { return 1 } # String => ':lang\([\w_-]+\)' # attribute => 'Selector Pseudo' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, ':lang\\([\\w_-]+\\)', 0, 0, 0, undef, 0, '#stay', 'Selector Pseudo')) { return 1 } # attribute => 'Selector Pseudo' # char => ':' # context => 'SelPseudo' # type => 'DetectChar' if ($self->testDetectChar($text, ':', 0, 0, 0, undef, 0, 'SelPseudo', 'Selector Pseudo')) { return 1 } # context => 'FindStrings' # type => 'IncludeRules' if ($self->includeRules('FindStrings', $text)) { return 1 } # context => 'FindComments' # type => 'IncludeRules' if ($self->includeRules('FindComments', $text)) { return 1 } return 0; }; sub parseFindStrings { my ($self, $text) = @_; # context => 'FindPHP' # type => 'IncludeRules' if ($self->includeRules('FindPHP', $text)) { return 1 } # attribute => 'String' # char => '"' # context => 'StringDQ' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'StringDQ', 'String')) { return 1 } # attribute => 'String' # char => ''' # context => 'StringSQ' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'StringSQ', 'String')) { return 1 } return 0; }; sub parseFindValues { my ($self, $text) = @_; # context => 'FindPHP' # type => 'IncludeRules' if ($self->includeRules('FindPHP', $text)) { return 1 } # String => '[-+]?[0-9.]+(em|ex|px|in|cm|mm|pt|pc|deg|rad|grad|ms|s|Hz|kHz)\b' # attribute => 'Value' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[-+]?[0-9.]+(em|ex|px|in|cm|mm|pt|pc|deg|rad|grad|ms|s|Hz|kHz)\\b', 0, 0, 0, undef, 0, '#stay', 'Value')) { return 1 } # String => '[-+]?[0-9.]+[%]?' # attribute => 'Value' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[-+]?[0-9.]+[%]?', 0, 0, 0, undef, 0, '#stay', 'Value')) { return 1 } # String => '[\w\-]+' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\w\\-]+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } return 0; }; sub parseImport { my ($self, $text) = @_; # context => 'FindPHP' # type => 'IncludeRules' if ($self->includeRules('FindPHP', $text)) { return 1 } # attribute => 'At Rule' # char => ';' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'At Rule')) { return 1 } # String => 'mediatypes' # attribute => 'Media' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'mediatypes', 0, undef, 0, '#stay', 'Media')) { return 1 } # context => 'FindValues' # type => 'IncludeRules' if ($self->includeRules('FindValues', $text)) { return 1 } # context => 'FindStrings' # type => 'IncludeRules' if ($self->includeRules('FindStrings', $text)) { return 1 } # context => 'FindComments' # type => 'IncludeRules' if ($self->includeRules('FindComments', $text)) { return 1 } return 0; }; sub parseInsideString { my ($self, $text) = @_; # context => 'FindPHP' # type => 'IncludeRules' if ($self->includeRules('FindPHP', $text)) { return 1 } # String => '\\["']' # attribute => 'String' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\["\']', 0, 0, 0, undef, 0, '#stay', 'String')) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } return 0; }; sub parseMedia { my ($self, $text) = @_; # context => 'FindPHP' # type => 'IncludeRules' if ($self->includeRules('FindPHP', $text)) { return 1 } # attribute => 'Media' # beginRegion => 'media' # char => '{' # context => 'Media2' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'Media2', 'Media')) { return 1 } # String => 'mediatypes' # attribute => 'Media' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'mediatypes', 0, undef, 0, '#stay', 'Media')) { return 1 } # attribute => 'Media' # char => ',' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, ',', 0, 0, 0, undef, 0, '#stay', 'Media')) { return 1 } # context => 'FindComments' # type => 'IncludeRules' if ($self->includeRules('FindComments', $text)) { return 1 } # String => '\S+' # attribute => 'Error' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\S+', 0, 0, 0, undef, 0, '#stay', 'Error')) { return 1 } return 0; }; sub parseMedia2 { my ($self, $text) = @_; # context => 'FindPHP' # type => 'IncludeRules' if ($self->includeRules('FindPHP', $text)) { return 1 } # attribute => 'Media' # char => '}' # context => '#pop#pop' # endRegion => 'media' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop', 'Media')) { return 1 } # context => 'FindRuleSets' # type => 'IncludeRules' if ($self->includeRules('FindRuleSets', $text)) { return 1 } return 0; }; sub parsePropParen { my ($self, $text) = @_; # context => 'FindPHP' # type => 'IncludeRules' if ($self->includeRules('FindPHP', $text)) { return 1 } # attribute => 'Value' # char => '(' # context => 'PropParen2' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'PropParen2', 'Value')) { return 1 } # context => 'FindComments' # type => 'IncludeRules' if ($self->includeRules('FindComments', $text)) { return 1 } # String => '\S' # attribute => 'Error' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#stay', 'Error')) { return 1 } return 0; }; sub parsePropParen2 { my ($self, $text) = @_; # context => 'FindPHP' # type => 'IncludeRules' if ($self->includeRules('FindPHP', $text)) { return 1 } # attribute => 'Value' # char => ')' # context => '#pop#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop#pop', 'Value')) { return 1 } # context => 'FindValues' # type => 'IncludeRules' if ($self->includeRules('FindValues', $text)) { return 1 } # context => 'FindStrings' # type => 'IncludeRules' if ($self->includeRules('FindStrings', $text)) { return 1 } # context => 'FindComments' # type => 'IncludeRules' if ($self->includeRules('FindComments', $text)) { return 1 } return 0; }; sub parseRule { my ($self, $text) = @_; # context => 'FindPHP' # type => 'IncludeRules' if ($self->includeRules('FindPHP', $text)) { return 1 } # attribute => 'Property' # char => ':' # context => 'Rule2' # type => 'DetectChar' if ($self->testDetectChar($text, ':', 0, 0, 0, undef, 0, 'Rule2', 'Property')) { return 1 } # String => '\S' # attribute => 'Error' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#stay', 'Error')) { return 1 } return 0; }; sub parseRule2 { my ($self, $text) = @_; # context => 'FindPHP' # type => 'IncludeRules' if ($self->includeRules('FindPHP', $text)) { return 1 } # attribute => 'Property' # char => ';' # context => '#pop#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop#pop', 'Property')) { return 1 } # attribute => 'Property' # char => '}' # context => '#pop#pop#pop' # endRegion => 'ruleset' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Property')) { return 1 } # String => 'types' # attribute => 'Value' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Value')) { return 1 } # String => 'colors' # attribute => 'Value' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'colors', 0, undef, 0, '#stay', 'Value')) { return 1 } # String => '#([0-9A-Fa-f]{3}){1,4}\b' # attribute => 'Value' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#([0-9A-Fa-f]{3}){1,4}\\b', 0, 0, 0, undef, 0, '#stay', 'Value')) { return 1 } # String => 'paren' # attribute => 'Value' # context => 'PropParen' # type => 'keyword' if ($self->testKeyword($text, 'paren', 0, undef, 0, 'PropParen', 'Value')) { return 1 } # String => '!important\b' # attribute => 'Important' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '!important\\b', 0, 0, 0, undef, 0, '#stay', 'Important')) { return 1 } # context => 'FindValues' # type => 'IncludeRules' if ($self->includeRules('FindValues', $text)) { return 1 } # context => 'FindStrings' # type => 'IncludeRules' if ($self->includeRules('FindStrings', $text)) { return 1 } # context => 'FindComments' # type => 'IncludeRules' if ($self->includeRules('FindComments', $text)) { return 1 } return 0; }; sub parseRuleSet { my ($self, $text) = @_; # context => 'FindPHP' # type => 'IncludeRules' if ($self->includeRules('FindPHP', $text)) { return 1 } # attribute => 'Property' # char => '}' # context => '#pop' # endRegion => 'ruleset' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Property')) { return 1 } # String => 'properties' # attribute => 'Property' # context => 'Rule' # type => 'keyword' if ($self->testKeyword($text, 'properties', 0, undef, 0, 'Rule', 'Property')) { return 1 } # String => '-?[A-Za-z_-]+(?=\s*:)' # attribute => 'Unknown Property' # context => 'Rule' # type => 'RegExpr' if ($self->testRegExpr($text, '-?[A-Za-z_-]+(?=\\s*:)', 0, 0, 0, undef, 0, 'Rule', 'Unknown Property')) { return 1 } # context => 'FindComments' # type => 'IncludeRules' if ($self->includeRules('FindComments', $text)) { return 1 } # String => '\S' # attribute => 'Error' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#stay', 'Error')) { return 1 } return 0; }; sub parseSelAttr { my ($self, $text) = @_; # context => 'FindPHP' # type => 'IncludeRules' if ($self->includeRules('FindPHP', $text)) { return 1 } # attribute => 'Selector Attr' # char => ']' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Selector Attr')) { return 1 } # context => 'FindStrings' # type => 'IncludeRules' if ($self->includeRules('FindStrings', $text)) { return 1 } return 0; }; sub parseSelPseudo { my ($self, $text) = @_; # context => 'FindPHP' # type => 'IncludeRules' if ($self->includeRules('FindPHP', $text)) { return 1 } # String => 'pseudoclasses' # attribute => 'Selector Pseudo' # context => '#pop' # type => 'keyword' if ($self->testKeyword($text, 'pseudoclasses', 0, undef, 0, '#pop', 'Selector Pseudo')) { return 1 } return 0; }; sub parseStringDQ { my ($self, $text) = @_; # context => 'FindPHP' # type => 'IncludeRules' if ($self->includeRules('FindPHP', $text)) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } # context => 'InsideString' # type => 'IncludeRules' if ($self->includeRules('InsideString', $text)) { return 1 } return 0; }; sub parseStringSQ { my ($self, $text) = @_; # context => 'FindPHP' # type => 'IncludeRules' if ($self->includeRules('FindPHP', $text)) { return 1 } # attribute => 'String' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } # context => 'InsideString' # type => 'IncludeRules' if ($self->includeRules('InsideString', $text)) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::CSS_PHP - a Plugin for CSS/PHP syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::CSS_PHP; my $sh = new Syntax::Highlight::Engine::Kate::CSS_PHP([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::CSS_PHP is a plugin module that provides syntax highlighting for CSS/PHP to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Scilab.pm0000644000175000017500000005632213226470762026062 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'sci.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.03 #kate version 2.3 #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::Scilab; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Comment' => 'Comment', 'Constants-keyword' => 'Variable', 'Control-keywords' => 'Operator', 'Decimal' => 'DecVal', 'Float' => 'Float', 'Function-keywords' => 'Function', 'Normal Text' => 'Normal', 'String' => 'String', 'Structure-keywords' => 'Keyword', 'Warning-keywords' => 'Others', 'functions' => 'Function', }); $self->listAdd('Constants-keyword', '$', '%F', '%T', '%e', '%eps', '%f', '%i', '%inf', '%io', '%nan', '%pi', '%s', '%t', '%z', 'MSDOS', ); $self->listAdd('Control-keywords', 'abort', 'break', 'pause', 'quit', 'resume', 'return', ); $self->listAdd('Function-keywords', 'endfunction', 'function', ); $self->listAdd('Structure-keywords', 'do', 'else', 'elseif', 'end', 'for', 'if', 'select', 'then', 'while', ); $self->listAdd('Warning-keywords', 'error', 'warning', ); $self->listAdd('functions', '%asn', '%helps', '%k', '%sn', 'ABSBLK_f', 'AFFICH_f', 'ANDLOG_f', 'ANIMXY_f', 'AdCommunications', 'BIGSOM_f', 'CLINDUMMY_f', 'CLKINV_f', 'CLKIN_f', 'CLKOUTV_f', 'CLKOUT_f', 'CLKSOMV_f', 'CLKSOM_f', 'CLKSPLIT_f', 'CLOCK_f', 'CLR_f', 'CLSS_f', 'CONST_f', 'COSBLK_f', 'CURV_f', 'Communications', 'CreateLink', 'DELAYV_f', 'DELAY_f', 'DEMUX_f', 'DLRADAPT_f', 'DLR_f', 'DLSS_f', 'DestroyLink', 'EVENTSCOPE_f', 'EVTDLY_f', 'EVTGEN_f', 'EXPBLK_f', 'Example', 'ExecAppli', 'ExecScilab', 'ExeclScilab', 'GAINBLK_f', 'GAIN_f', 'GENERAL_f', 'GENERIC_f', 'GENSIN_f', 'GENSQR_f', 'G_make', 'GetMsg', 'Graphics', 'HALT_f', 'IFTHEL_f', 'INTEGRAL_f', 'INTRP2BLK_f', 'INTRPLBLK_f', 'INVBLK_f', 'IN_f', 'LOGBLK_f', 'LOOKUP_f', 'MAX_f', 'MCLOCK_f', 'MFCLCK_f', 'MIN_f', 'MUX_f', 'Matplot', 'Matplot1', 'NEGTOPOS_f', 'OUT_f', 'POSTONEG_f', 'POWBLK_f', 'PROD_f', 'QUANT_f', 'RAND_f', 'READC_f', 'REGISTER_f', 'RELAY_f', 'RFILE_f', 'SAMPLEHOLD_f', 'SAT_f', 'SAWTOOTH_f', 'SCOPE_f', 'SCOPXY_f', 'SELECT_f', 'SINBLK_f', 'SOM_f', 'SPLIT_f', 'STOP_f', 'SUPER_f', 'ScilabEval', 'SendMsg', 'Sfgrayplot', 'Sgrayplot', 'TANBLK_f', 'TCLSS_f', 'TEXT_f', 'TIME_f', 'TK_EvalFile', 'TK_EvalStr', 'TK_GetVar', 'TK_SetVar', 'TRASH_f', 'WFILE_f', 'WRITEC_f', 'WaitMsg', 'ZCROSS_f', 'abcd', 'abinv', 'abs', 'acos', 'acosh', 'acoshm', 'acosm', 'add_edge', 'add_node', 'addcolor', 'addf', 'addinter', 'addmenu', 'adj2sp', 'adj_lists', 'aff2ab', 'alufunctions', 'amell', 'analpf', 'analyze', 'and', 'ans', 'apropos', 'arc_graph', 'arc_number', 'argn', 'arhnk', 'arl2', 'arma', 'arma2p', 'armac', 'armax', 'armax1', 'arsimul', 'artest', 'articul', 'ascii', 'asin', 'asinh', 'asinhm', 'asinm', 'atan', 'atanh', 'atanhm', 'atanm', 'augment', 'auread', 'auwrite', 'backslash', 'balanc', 'balreal', 'bandwr', 'bdiag', 'besseli', 'besselj', 'besselk', 'bessely', 'best_match', 'bezout', 'bifish', 'bilin', 'binomial', 'black', 'bloc2exp', 'bloc2ss', 'bode', 'bool2s', 'boolean', 'boucle', 'bstap', 'buttmag', 'bvode', 'c_link', 'cainv', 'calerf', 'calfrq', 'call', 'canon', 'casc', 'ccontrg', 'cdfbet', 'cdfbin', 'cdfchi', 'cdfchn', 'cdff', 'cdffnc', 'cdfgam', 'cdfnbn', 'cdfnor', 'cdfpoi', 'cdft', 'ceil', 'cepstrum', 'chain_struct', 'chaintest', 'champ', 'champ1', 'chart', 'chdir', 'cheb1mag', 'cheb2mag', 'check_graph', 'chepol', 'chfact', 'chol', 'chsolve', 'circuit', 'classmarkov', 'clean', 'clear', 'clearfun', 'clearglobal', 'close', 'cls2dls', 'cmb_lin', 'cmndred', 'code2str', 'coeff', 'coff', 'coffg', 'colcomp', 'colcompr', 'colinout', 'colnew', 'colon', 'colormap', 'colregul', 'comp', 'companion', 'con_nodes', 'cond', 'conj', 'connex', 'cont_frm', 'cont_mat', 'contour', 'contour2d', 'contour2di', 'contourf', 'contr', 'contract_edge', 'contrss', 'convex_hull', 'convol', 'convstr', 'copfac', 'corr', 'cos', 'cosh', 'coshm', 'cosm', 'cotg', 'coth', 'cothm', 'csim', 'cspect', 'ctr_gram', 'cumprod', 'cumsum', 'curblock', 'cycle_basis', 'czt', 'dasrt', 'dassl', 'datafit', 'date', 'dbphi', 'dcf', 'ddp', 'debug', 'dec2hex', 'deff', 'degree', 'delbpt', 'delete_arcs', 'delete_nodes', 'delip', 'delmenu', 'demos', 'denom', 'derivat', 'derivative-', 'des2ss', 'des2tf', 'det', 'determ', 'detr', 'dft', 'dhnorm', 'diag', 'diary', 'diophant', 'disp', 'dispbpt', 'dispfile', 'dlgamma', 'dot', 'double', 'dragrect', 'drawaxis', 'driver', 'dscr', 'dsimul', 'dt_ility', 'dtsi', 'edge_number', 'edit', 'edit_curv', 'eigenmarkov', 'ell1mag', 'empty', 'emptystr', 'eqfir', 'eqiir', 'equal', 'equil', 'equil1', 'ereduc', 'erf', 'erfc', 'erfcx', 'errbar', 'errcatch', 'errclear', 'error', 'eval', 'eval3d', 'eval3dp', 'evans', 'evstr', 'excel2sci', 'exec', 'execstr', 'exists', 'exit', 'exp', 'expm', 'external', 'extraction', 'eye', 'fac3d', 'factors', 'faurre', 'fchamp', 'fcontour', 'fcontour2d', 'fec', 'feedback', 'feval', 'ffilt', 'fft', 'fgrayplot', 'figure', 'file', 'fileinfo', 'filter', 'find', 'find_freq', 'find_path', 'findm', 'findobj', 'fit_dat', 'fix', 'floor', 'flts', 'format', 'formatman', 'fort', 'fourplan', 'fplot2d', 'fplot3d', 'fplot3d1', 'fprintf', 'fprintfMat', 'frep2tf', 'freq', 'freson', 'frexp', 'frfit', 'frmag', 'fscanf', 'fscanfMat', 'fsfirlin', 'fsolve', 'fspecg', 'fstabst', 'fstair', 'full', 'fullrf', 'fullrfk', 'fun2string', 'funcprot', 'funptr', 'fusee', 'g_margin', 'gainplot', 'gamitg', 'gamma', 'gammaln', 'gcare', 'gcd', 'gcf', 'gen_net', 'genfac3d', 'genlib', 'genmarkov', 'geom3d', 'get', 'get_function_path', 'getblocklabel', 'getcolor', 'getcwd', 'getd', 'getdate', 'getenv', 'getf', 'getfield', 'getfont', 'getio', 'getlinestyle', 'getmark', 'getpid', 'getscicosvars', 'getsymbol', 'getvalue', 'getversion', 'gfare', 'gfrancis', 'girth', 'givens', 'glever', 'glist', 'global', 'gpeche', 'gr_menu', 'graduate', 'grand', 'graph-list', 'graph_2_mat', 'graph_center', 'graph_complement', 'graph_diameter', 'graph_power', 'graph_simp', 'graph_sum', 'graph_union', 'graycolormap', 'grayplot', 'graypolarplot', 'grep', 'group', 'gschur', 'gsort', 'gspec', 'gstacksize', 'gtild', 'h2norm', 'h_cl', 'h_inf', 'h_inf_st', 'h_norm', 'halt', 'hamilton', 'hank', 'hankelsv', 'hat', 'havewindow', 'help', 'hermit', 'hess', 'hex2dec', 'hilb', 'hist3d', 'histplot', 'horner', 'host', 'hotcolormap', 'householder', 'hrmt', 'htrianr', 'hypermat', 'hypermatrices', 'iconvert', 'ieee', 'iir', 'iirgroup', 'iirlp', 'ilib_build', 'ilib_compile', 'ilib_for_link', 'ilib_gen_Make', 'ilib_gen_gateway', 'ilib_gen_loader', 'im_inv', 'imag', 'impl', 'imrep2ss', 'input', 'insertion', 'int', 'int16', 'int2d', 'int32', 'int3d', 'int8', 'intc', 'intdec', 'integrate', 'interp', 'interpln', 'intersci', 'intersect', 'intg', 'intl', 'intppty', 'intsplin', 'inttrap', 'inttype', 'inv', 'inv_coeff', 'invr', 'invsyslin', 'is_connex', 'isdef', 'iserror', 'isglobal', 'isinf', 'isnan', 'isoview', 'isreal', 'jmat', 'kalm', 'karmarkar', 'kernel', 'keyboard', 'knapsack', 'kpure', 'krac2', 'kron', 'kroneck', 'lasterror', 'lattn', 'lattp', 'lcf', 'lcm', 'lcmdiag', 'ldiv', 'ldivf', 'leastsq', 'left', 'legends', 'length', 'leqr', 'less', 'lev', 'levin', 'lex_sort', 'lft', 'lgfft', 'lib', 'lin', 'lin2mu', 'lindquist', 'line_graph', 'lines', 'linf', 'linfn', 'link', 'linpro', 'linsolve', 'linspace', 'list', 'lmisolver', 'lmitool', 'load', 'load_graph', 'loadwave', 'locate', 'log', 'log10', 'log2', 'logm', 'logspace', 'lotest', 'lqe', 'lqg', 'lqg2stan', 'lqg_ltr', 'lqr', 'lsslist', 'lstcat', 'ltitr', 'lu', 'ludel', 'lufact', 'luget', 'lusolve', 'lyap', 'm_circle', 'macglov', 'macr2lst', 'macro', 'macrovar', 'make_graph', 'man', 'manedit', 'mapsound', 'markp2ss', 'mat_2_graph', 'matrices', 'matrix', 'max', 'max_cap_path', 'max_clique', 'max_flow', 'maxi', 'mclearerr', 'mclose', 'mean', 'median', 'meof', 'mese', 'mesh2d', 'metanet', 'metanet_sync', 'mfft', 'mfile2sci', 'mfprintf', 'mfscanf', 'mget', 'mgeti', 'mgetl', 'mgetstr', 'milk_drop', 'min', 'min_lcost_cflow', 'min_lcost_flow1', 'min_lcost_flow2', 'min_qcost_flow', 'min_weight_tree', 'mine', 'mini', 'minreal', 'minss', 'minus', 'mlist', 'mode', 'modulo', 'mopen', 'mprintf', 'mps2linpro', 'mput', 'mputl', 'mputstr', 'mrfit', 'mscanf', 'mseek', 'msprintf', 'msscanf', 'mtell', 'mtlb_load', 'mtlb_mode', 'mtlb_save', 'mtlb_sparse', 'mu2lin', 'mulf', 'names', 'narsimul', 'nehari', 'neighbors', 'netclose', 'netwindow', 'netwindows', 'newest', 'newfun', 'nf3d', 'nlev', 'nnz', 'node_number', 'nodes_2_path', 'nodes_degrees', 'noisegen', 'norm', 'not', 'null', 'numer', 'nyquist', 'obs_gram', 'obscont', 'obscont1', 'observer', 'obsv_mat', 'obsvss', 'ode', 'ode_discrete', 'ode_root', 'odedc', 'odedi', 'odeoptions', 'oldload', 'oldsave', 'ones', 'optim', 'or', 'orth', 'overloading', 'p_margin', 'param3d', 'param3d1', 'paramfplot2d', 'parents', 'parrot', 'part', 'path_2_nodes', 'pbig', 'pdiv', 'pen2ea', 'pencan', 'penlaur', 'percent', 'perfect_match', 'pertrans', 'pfss', 'phasemag', 'phc', 'pinv', 'pipe_network', 'playsnd', 'plot', 'plot2d', 'plot2d1', 'plot2d2', 'plot2d3', 'plot2d4', 'plot3d', 'plot3d1', 'plot3d2', 'plot3d3', 'plot_graph', 'plotframe', 'plotprofile', 'plus', 'plzr', 'pmodulo', 'pol2des', 'pol2str', 'pol2tex', 'polar', 'polarplot', 'polfact', 'poly', 'portr3d', 'portrait', 'power', 'ppol', 'prbs_a', 'predecessors', 'predef', 'print', 'printf', 'printf_conversion', 'printing', 'prod', 'profile', 'proj', 'projsl', 'projspec', 'psmall', 'pspect', 'pvm', 'pvm_addhosts', 'pvm_bcast', 'pvm_bufinfo', 'pvm_config', 'pvm_delhosts', 'pvm_error', 'pvm_exit', 'pvm_get_timer', 'pvm_getinst', 'pvm_gsize', 'pvm_halt', 'pvm_joingroup', 'pvm_kill', 'pvm_lvgroup', 'pvm_mytid', 'pvm_probe', 'pvm_recv', 'pvm_reduce', 'pvm_sci2f77', 'pvm_send', 'pvm_set_timer', 'pvm_spawn', 'pvm_spawn_independent', 'pvm_start', 'pvm_tidtohost', 'pvmd3', 'pwd', 'qassign', 'qr', 'quapro', 'quaskro', 'quit', 'quote', 'rand', 'randpencil', 'range', 'rank', 'rat', 'rational', 'rcond', 'rdivf', 'read', 'read4b', 'readb', 'readc_', 'readmps', 'real', 'recur', 'reglin', 'remez', 'remezb', 'repfreq', 'replot', 'residu', 'ric_desc', 'ricc', 'riccati', 'rlist', 'roots', 'rotate', 'round', 'routh_t', 'rowcomp', 'rowcompr', 'rowinout', 'rowregul', 'rowshuff', 'rpem', 'rref', 'rtitr', 'salesman', 'save', 'save_graph', 'savewave', 'scaling', 'scanf', 'scanf_conversion', 'schur', 'sci2exp', 'sci2for', 'sci2map', 'sciargs', 'scicos', 'scicos_block', 'scicos_cpr', 'scicos_graphics', 'scicos_link', 'scicos_main', 'scicos_menus', 'scicos_model', 'scicosim', 'scifunc_block', 'scilab', 'scilink', 'sd2sci', 'secto3d', 'semi', 'semicolumn', 'semidef', 'sensi', 'set', 'setbpt', 'setfield', 'setmenu', 'setscicosvars', 'sfact', 'sgrid', 'shortest_path', 'show_arcs', 'show_graph', 'show_nodes', 'showprofile', 'sign', 'signm', 'simp', 'simp_mode', 'sin', 'sinc', 'sincd', 'sinh', 'sinhm', 'sinm', 'size', 'slash', 'sm2des', 'sm2ss', 'smooth', 'solve', 'sort', 'sound', 'sp2adj', 'spaninter', 'spanplus', 'spantwo', 'sparse', 'spchol', 'spcompack', 'spec', 'specfact', 'speye', 'spget', 'splin', 'split_edge', 'spones', 'sprand', 'sprintf', 'spzeros', 'sqroot', 'sqrt', 'sqrtm', 'square', 'squarewave', 'srfaur', 'srkf', 'ss2des', 'ss2ss', 'ss2tf', 'sscanf', 'sskf', 'ssprint', 'ssrand', 'st_deviation', 'st_ility', 'stabil', 'stacksize', 'standard_define', 'standard_draw', 'standard_input', 'standard_origin', 'standard_output', 'star', 'startup', 'str2code', 'strcat', 'strindex', 'string', 'strings', 'stripblanks', 'strong_con_nodes', 'strong_connex', 'strsubst', 'subf', 'subgraph', 'subplot', 'successors', 'sum', 'supernode', 'sva', 'svd', 'svplot', 'sylm', 'sylv', 'symbols', 'sysconv', 'sysdiag', 'sysfact-', 'syslin', 'syssize', 'system', 'systems', 'systmat', 'tan', 'tangent', 'tanh', 'tanhm', 'tanm', 'tdinit', 'testmatrix', 'texprint', 'tf2des', 'tf2ss', 'tilda', 'time_id', 'timer', 'titlepage', 'tlist', 'toeplitz', 'trace', 'trans', 'trans_closure', 'translatepaths', 'trfmod', 'trianfml', 'tril', 'trisolve', 'triu', 'trzeros', 'type', 'typename', 'typeof', 'ui_observer', 'uicontrol', 'uimenu', 'uint16', 'uint32', 'uint8', 'ulink', 'union', 'unique', 'unix', 'unix_g', 'unix_s', 'unix_w', 'unix_x', 'unobs', 'unsetmenu', 'user', 'varargin', 'varargout', 'varn', 'warning', 'wavread', 'wavwrite', 'wfir', 'what', 'where', 'whereami', 'whereis', 'who', 'whos', 'wiener', 'wigner', 'window', 'winsid', 'writb', 'write', 'write4b', 'x_choices', 'x_choose', 'x_dialog', 'x_matrix', 'x_mdialog', 'x_message', 'x_message_modeless', 'xarc', 'xarcs', 'xarrows', 'xaxis', 'xbasc', 'xbasimp', 'xbasr', 'xchange', 'xclea', 'xclear', 'xclick', 'xclip', 'xdel', 'xend', 'xfarc', 'xfarcs', 'xfpoly', 'xfpolys', 'xfrect', 'xget', 'xgetech', 'xgetfile', 'xgetmouse', 'xgraduate', 'xgrid', 'xinfo', 'xinit', 'xlfont', 'xload', 'xname', 'xnumb', 'xpause', 'xpoly', 'xpolys', 'xrect', 'xrects', 'xrpoly', 'xs2fig', 'xsave', 'xsegs', 'xselect', 'xset', 'xsetech', 'xsetm', 'xstring', 'xstringb', 'xstringl', 'xtape', 'xtitle', 'yulewalk', 'zeropen', 'zeros', 'zgrid', 'zpbutt', 'zpch1', 'zpch2', 'zpell', ); $self->contextdata({ 'main' => { callback => \&parsemain, attribute => 'Normal Text', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|\\%|\\$'); $self->basecontext('main'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'scilab'; } sub parsemain { my ($self, $text) = @_; # String => 'Structure-keywords' # attribute => 'Structure-keywords' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'Structure-keywords', 0, undef, 0, '#stay', 'Structure-keywords')) { return 1 } # String => 'Control-keywords' # attribute => 'Control-keywords' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'Control-keywords', 0, undef, 0, '#stay', 'Control-keywords')) { return 1 } # String => 'Function-keywords' # attribute => 'Function-keywords' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'Function-keywords', 0, undef, 0, '#stay', 'Function-keywords')) { return 1 } # String => 'Warning-keywords' # attribute => 'Warning-keywords' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'Warning-keywords', 0, undef, 0, '#stay', 'Warning-keywords')) { return 1 } # String => 'Constants-keyword' # attribute => 'Constants-keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'Constants-keyword', 0, undef, 0, '#stay', 'Constants-keyword')) { return 1 } # String => 'functions' # attribute => 'functions' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'functions')) { return 1 } # attribute => 'Float' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { return 1 } # attribute => 'Decimal' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => '//.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '//.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # attribute => 'String' # char => '"' # char1 => '"' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Scilab - a Plugin for scilab syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Scilab; my $sh = new Syntax::Highlight::Engine::Kate::Scilab([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Scilab is a plugin module that provides syntax highlighting for scilab to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Perl.pm0000644000175000017500000023757413226470762025601 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'perl.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.20 #kate version 2.4 #kate author Anders Lund (anders@alweb.dk) #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::Perl; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Comment' => 'Comment', 'Data' => 'Normal', 'Data Type' => 'DataType', 'Decimal' => 'DecVal', 'Float' => 'Float', 'Function' => 'Function', 'Hex' => 'BaseN', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Nothing' => 'Comment', 'Octal' => 'BaseN', 'Operator' => 'Operator', 'Pattern' => 'Others', 'Pattern Character Class' => 'BaseN', 'Pattern Internal Operator' => 'Char', 'Pod' => 'Comment', 'Pragma' => 'Keyword', 'Special Variable' => 'Variable', 'String' => 'String', 'String (interpolated)' => 'String', 'String Special Character' => 'Char', }); $self->listAdd('functions', 'abs', 'accept', 'alarm', 'atan2', 'bind', 'binmode', 'bless', 'caller', 'chdir', 'chmod', 'chomp', 'chop', 'chown', 'chr', 'chroot', 'close', 'closedir', 'connect', 'cos', 'crypt', 'dbmclose', 'dbmopen', 'defined', 'delete', 'die', 'dump', 'endgrent', 'endhostent', 'endnetent', 'endprotoent', 'endpwent', 'endservent', 'eof', 'eval', 'exec', 'exists', 'exit', 'exp', 'fcntl', 'fileno', 'flock', 'fork', 'format', 'formline', 'getc', 'getgrent', 'getgrgid', 'getgrnam', 'gethostbyaddr', 'gethostbyname', 'gethostent', 'getlogin', 'getnetbyaddr', 'getnetbyname', 'getnetent', 'getpeername', 'getpgrp', 'getppid', 'getpriority', 'getprotobyname', 'getprotobynumber', 'getprotoent', 'getpwent', 'getpwnam', 'getpwuid', 'getservbyname', 'getservbyport', 'getservent', 'getsockname', 'getsockopt', 'glob', 'gmtime', 'goto', 'grep', 'hex', 'import', 'index', 'int', 'ioctl', 'join', 'keys', 'kill', 'last', 'lc', 'lcfirst', 'length', 'link', 'listen', 'localtime', 'lock', 'log', 'lstat', 'map', 'mkdir', 'msgctl', 'msgget', 'msgrcv', 'msgsnd', 'oct', 'open', 'opendir', 'ord', 'pack', 'package', 'pipe', 'pop', 'pos', 'print', 'printf', 'prototype', 'push', 'quotemeta', 'rand', 'read', 'readdir', 'readline', 'readlink', 'recv', 'redo', 'ref', 'rename', 'reset', 'return', 'reverse', 'rewinddir', 'rindex', 'rmdir', 'scalar', 'seek', 'seekdir', 'select', 'semctl', 'semget', 'semop', 'send', 'setgrent', 'sethostent', 'setnetent', 'setpgrp', 'setpriority', 'setprotoent', 'setpwent', 'setservent', 'setsockopt', 'shift', 'shmctl', 'shmget', 'shmread', 'shmwrite', 'shutdown', 'sin', 'sleep', 'socket', 'socketpair', 'sort', 'splice', 'split', 'sprintf', 'sqrt', 'srand', 'stat', 'study', 'sub', 'substr', 'symlink', 'syscall', 'sysread', 'sysseek', 'system', 'syswrite', 'tell', 'telldir', 'tie', 'time', 'times', 'truncate', 'uc', 'ucfirst', 'umask', 'undef', 'unlink', 'unpack', 'unshift', 'untie', 'utime', 'values', 'vec', 'wait', 'waitpid', 'wantarray', 'warn', 'write', ); $self->listAdd('keywords', 'BEGIN', 'END', '__DATA__', '__END__', '__FILE__', '__LINE__', '__PACKAGE__', 'break', 'continue', 'do', 'each', 'else', 'elsif', 'for', 'foreach', 'if', 'last', 'local', 'my', 'next', 'no', 'our', 'package', 'require', 'require', 'return', 'sub', 'unless', 'until', 'use', 'while', ); $self->listAdd('operators', '!=', '%', '&', '&&', '&&=', '&=', '*', '**=', '*=', '+', '+=', ',', '-', '-=', '->', '.', '/=', '::', ';', '<', '<<', '=', '=>', '>', '>>', '?=', '\\\\', '^', 'and', 'eq', 'ne', 'not', 'or', '|', '|=', '||', '||=', '~=', ); $self->listAdd('pragmas', 'bytes', 'constant', 'diagnostics', 'english', 'filetest', 'integer', 'less', 'locale', 'open', 'sigtrap', 'strict', 'subs', 'utf8', 'vars', 'warnings', ); $self->contextdata({ 'Backticked' => { callback => \&parseBackticked, attribute => 'String (interpolated)', }, 'comment' => { callback => \&parsecomment, attribute => 'Comment', lineending => '#pop', }, 'data_handle' => { callback => \&parsedata_handle, attribute => 'Data', }, 'end_handle' => { callback => \&parseend_handle, attribute => 'Nothing', }, 'find_here_document' => { callback => \&parsefind_here_document, attribute => 'Normal Text', lineending => '#pop', }, 'find_pattern' => { callback => \&parsefind_pattern, attribute => 'Pattern', }, 'find_qqx' => { callback => \&parsefind_qqx, attribute => 'Normal Text', }, 'find_quoted' => { callback => \&parsefind_quoted, attribute => 'Normal Text', }, 'find_qw' => { callback => \&parsefind_qw, attribute => 'Normal Text', }, 'find_subst' => { callback => \&parsefind_subst, attribute => 'Normal Text', }, 'find_variable' => { callback => \&parsefind_variable, attribute => 'Data Type', lineending => '#pop', fallthrough => '#pop', }, 'find_variable_unsafe' => { callback => \&parsefind_variable_unsafe, attribute => 'Data Type', lineending => '#pop', fallthrough => '#pop', }, 'here_document' => { callback => \&parsehere_document, attribute => 'String (interpolated)', dynamic => 1, }, 'here_document_dumb' => { callback => \&parsehere_document_dumb, attribute => 'Normal Text', dynamic => 1, }, 'ip_string' => { callback => \&parseip_string, attribute => 'String (interpolated)', }, 'ip_string_2' => { callback => \&parseip_string_2, attribute => 'String (interpolated)', }, 'ip_string_3' => { callback => \&parseip_string_3, attribute => 'String (interpolated)', }, 'ip_string_4' => { callback => \&parseip_string_4, attribute => 'String (interpolated)', }, 'ip_string_5' => { callback => \&parseip_string_5, attribute => 'String (interpolated)', }, 'ip_string_6' => { callback => \&parseip_string_6, attribute => 'String (interpolated)', dynamic => 1, }, 'ipstring_internal' => { callback => \&parseipstring_internal, attribute => 'String (interpolated)', }, 'normal' => { callback => \&parsenormal, attribute => 'Normal Text', }, 'package_qualified_blank' => { callback => \&parsepackage_qualified_blank, attribute => 'Normal Text', }, 'pat_char_class' => { callback => \&parsepat_char_class, attribute => 'Pattern Character Class', }, 'pat_ext' => { callback => \&parsepat_ext, attribute => 'Pattern Internal Operator', }, 'pattern' => { callback => \&parsepattern, attribute => 'Pattern', dynamic => 1, }, 'pattern_brace' => { callback => \&parsepattern_brace, attribute => 'Pattern', }, 'pattern_bracket' => { callback => \&parsepattern_bracket, attribute => 'Pattern', }, 'pattern_paren' => { callback => \&parsepattern_paren, attribute => 'Pattern', }, 'pattern_slash' => { callback => \&parsepattern_slash, attribute => 'Pattern', }, 'pattern_sq' => { callback => \&parsepattern_sq, attribute => 'Pattern', }, 'pod' => { callback => \&parsepod, attribute => 'Pod', }, 'quote_word' => { callback => \&parsequote_word, attribute => 'Normal Text', dynamic => 1, }, 'quote_word_brace' => { callback => \&parsequote_word_brace, attribute => 'Normal Text', }, 'quote_word_bracket' => { callback => \&parsequote_word_bracket, attribute => 'Normal Text', }, 'quote_word_paren' => { callback => \&parsequote_word_paren, attribute => 'Normal Text', }, 'regex_pattern_internal' => { callback => \&parseregex_pattern_internal, attribute => 'Pattern', }, 'regex_pattern_internal_ip' => { callback => \&parseregex_pattern_internal_ip, attribute => 'Pattern', }, 'regex_pattern_internal_rules_1' => { callback => \&parseregex_pattern_internal_rules_1, }, 'regex_pattern_internal_rules_2' => { callback => \&parseregex_pattern_internal_rules_2, }, 'slash_safe_escape' => { callback => \&parseslash_safe_escape, attribute => 'Normal Text', lineending => '#pop', fallthrough => '#pop', }, 'string' => { callback => \&parsestring, attribute => 'String', }, 'string_2' => { callback => \&parsestring_2, attribute => 'String', }, 'string_3' => { callback => \&parsestring_3, attribute => 'String', }, 'string_4' => { callback => \&parsestring_4, attribute => 'String', }, 'string_5' => { callback => \&parsestring_5, attribute => 'String', }, 'string_6' => { callback => \&parsestring_6, attribute => 'String', dynamic => 1, }, 'sub_arg_definition' => { callback => \&parsesub_arg_definition, attribute => 'Normal Text', fallthrough => '#pop#pop', }, 'sub_name_def' => { callback => \&parsesub_name_def, attribute => 'Normal Text', lineending => '#pop', fallthrough => '#pop', }, 'subst_bracket_pattern' => { callback => \&parsesubst_bracket_pattern, attribute => 'Pattern', }, 'subst_bracket_replace' => { callback => \&parsesubst_bracket_replace, attribute => 'String (interpolated)', }, 'subst_curlybrace_middle' => { callback => \&parsesubst_curlybrace_middle, attribute => 'Normal Text', }, 'subst_curlybrace_pattern' => { callback => \&parsesubst_curlybrace_pattern, attribute => 'Pattern', }, 'subst_curlybrace_replace' => { callback => \&parsesubst_curlybrace_replace, attribute => 'String (interpolated)', }, 'subst_curlybrace_replace_recursive' => { callback => \&parsesubst_curlybrace_replace_recursive, attribute => 'String (interpolated)', }, 'subst_paren_pattern' => { callback => \&parsesubst_paren_pattern, attribute => 'Pattern', }, 'subst_paren_replace' => { callback => \&parsesubst_paren_replace, attribute => 'String (interpolated)', }, 'subst_slash_pattern' => { callback => \&parsesubst_slash_pattern, attribute => 'Pattern', dynamic => 1, }, 'subst_slash_replace' => { callback => \&parsesubst_slash_replace, attribute => 'String (interpolated)', dynamic => 1, }, 'subst_sq_pattern' => { callback => \&parsesubst_sq_pattern, attribute => 'Pattern', }, 'subst_sq_replace' => { callback => \&parsesubst_sq_replace, attribute => 'String', }, 'tr' => { callback => \&parsetr, attribute => 'Pattern', lineending => '#pop', fallthrough => '#pop', }, 'var_detect' => { callback => \&parsevar_detect, attribute => 'Data Type', lineending => '#pop#pop', fallthrough => '#pop#pop', }, 'var_detect_rules' => { callback => \&parsevar_detect_rules, attribute => 'Data Type', lineending => '#pop#pop', }, 'var_detect_unsafe' => { callback => \&parsevar_detect_unsafe, attribute => 'Data Type', lineending => '#pop#pop', fallthrough => '#pop#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'Perl'; } sub parseBackticked { my ($self, $text) = @_; # context => 'ipstring_internal' # type => 'IncludeRules' if ($self->includeRules('ipstring_internal', $text)) { return 1 } # attribute => 'Operator' # char => '`' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, '#pop', 'Operator')) { return 1 } return 0; }; sub parsecomment { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } return 0; }; sub parsedata_handle { my ($self, $text) = @_; # String => '\=(?:head[1-6]|over|back|item|for|begin|end|pod)\s+.*' # attribute => 'Pod' # beginRegion => 'POD' # column => '0' # context => 'pod' # type => 'RegExpr' if ($self->testRegExpr($text, '\\=(?:head[1-6]|over|back|item|for|begin|end|pod)\\s+.*', 0, 0, 0, 0, 0, 'pod', 'Pod')) { return 1 } # String => '__END__' # attribute => 'Keyword' # context => 'normal' # firstNonSpace => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, '__END__', 0, 0, 0, undef, 1, 'normal', 'Keyword')) { return 1 } return 0; }; sub parseend_handle { my ($self, $text) = @_; # String => '^\=(?:head[1-6]|over|back|item|for|begin|end|pod)\s*.*' # attribute => 'Pod' # context => 'pod' # type => 'RegExpr' if ($self->testRegExpr($text, '^\\=(?:head[1-6]|over|back|item|for|begin|end|pod)\\s*.*', 0, 0, 0, undef, 0, 'pod', 'Pod')) { return 1 } # String => '__DATA__' # attribute => 'Keyword' # context => 'data_handle' # firstNonSpace => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, '__DATA__', 0, 0, 0, undef, 1, 'data_handle', 'Keyword')) { return 1 } return 0; }; sub parsefind_here_document { my ($self, $text) = @_; # String => '(\w+)\s*;?' # attribute => 'Keyword' # context => 'here_document' # type => 'RegExpr' if ($self->testRegExpr($text, '(\\w+)\\s*;?', 0, 0, 0, undef, 0, 'here_document', 'Keyword')) { return 1 } # String => '\s*"([^"]+)"\s*;?' # attribute => 'Keyword' # context => 'here_document' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*"([^"]+)"\\s*;?', 0, 0, 0, undef, 0, 'here_document', 'Keyword')) { return 1 } # String => '\s*`([^`]+)`\s*;?' # attribute => 'Keyword' # context => 'here_document' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*`([^`]+)`\\s*;?', 0, 0, 0, undef, 0, 'here_document', 'Keyword')) { return 1 } # String => '\s*'([^']+)'\s*;?' # attribute => 'Keyword' # context => 'here_document_dumb' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*\'([^\']+)\'\\s*;?', 0, 0, 0, undef, 0, 'here_document_dumb', 'Keyword')) { return 1 } return 0; }; sub parsefind_pattern { my ($self, $text) = @_; # String => '\s+#.*' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s+#.*', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # attribute => 'Operator' # beginRegion => 'Pattern' # char => '{' # context => 'pattern_brace' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'pattern_brace', 'Operator')) { return 1 } # attribute => 'Operator' # beginRegion => 'Pattern' # char => '(' # context => 'pattern_paren' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'pattern_paren', 'Operator')) { return 1 } # attribute => 'Operator' # beginRegion => 'Pattern' # char => '[' # context => 'pattern_bracket' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'pattern_bracket', 'Operator')) { return 1 } # attribute => 'Operator' # beginRegion => 'Pattern' # char => ''' # context => 'pattern_sq' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'pattern_sq', 'Operator')) { return 1 } # String => '([^\w\s])' # attribute => 'Operator' # beginRegion => 'Pattern' # context => 'pattern' # type => 'RegExpr' if ($self->testRegExpr($text, '([^\\w\\s])', 0, 0, 0, undef, 0, 'pattern', 'Operator')) { return 1 } return 0; }; sub parsefind_qqx { my ($self, $text) = @_; # attribute => 'Operator' # beginRegion => 'String' # char => '(' # context => 'ip_string_2' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'ip_string_2', 'Operator')) { return 1 } # attribute => 'Operator' # beginRegion => 'String' # char => '{' # context => 'ip_string_3' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'ip_string_3', 'Operator')) { return 1 } # attribute => 'Operator' # beginRegion => 'String' # char => '[' # context => 'ip_string_4' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'ip_string_4', 'Operator')) { return 1 } # attribute => 'Operator' # beginRegion => 'String' # char => '<' # context => 'ip_string_5' # type => 'DetectChar' if ($self->testDetectChar($text, '<', 0, 0, 0, undef, 0, 'ip_string_5', 'Operator')) { return 1 } # String => '([^a-zA-Z0-9_\s[\]{}()])' # attribute => 'Operator' # beginRegion => 'String' # context => 'ip_string_6' # type => 'RegExpr' if ($self->testRegExpr($text, '([^a-zA-Z0-9_\\s[\\]{}()])', 0, 0, 0, undef, 0, 'ip_string_6', 'Operator')) { return 1 } # String => '\s+#.*' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s+#.*', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } return 0; }; sub parsefind_quoted { my ($self, $text) = @_; # String => 'x\s*(')' # attribute => 'Operator' # beginRegion => 'String' # context => 'string_6' # type => 'RegExpr' if ($self->testRegExpr($text, 'x\\s*(\')', 0, 0, 0, undef, 0, 'string_6', 'Operator')) { return 1 } # String => 'qx' # attribute => 'Operator' # context => 'find_qqx' # type => 'AnyChar' if ($self->testAnyChar($text, 'qx', 0, 0, undef, 0, 'find_qqx', 'Operator')) { return 1 } # attribute => 'Operator' # char => 'w' # context => 'find_qw' # type => 'DetectChar' if ($self->testDetectChar($text, 'w', 0, 0, 0, undef, 0, 'find_qw', 'Operator')) { return 1 } # attribute => 'Operator' # beginRegion => 'String' # char => '(' # context => 'string_2' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'string_2', 'Operator')) { return 1 } # attribute => 'Operator' # beginRegion => 'String' # char => '{' # context => 'string_3' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'string_3', 'Operator')) { return 1 } # attribute => 'Operator' # beginRegion => 'String' # char => '[' # context => 'string_4' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'string_4', 'Operator')) { return 1 } # attribute => 'Operator' # beginRegion => 'String' # char => '<' # context => 'string_5' # type => 'DetectChar' if ($self->testDetectChar($text, '<', 0, 0, 0, undef, 0, 'string_5', 'Operator')) { return 1 } # String => '([^a-zA-Z0-9_\s[\]{}()])' # attribute => 'Operator' # beginRegion => 'String' # context => 'string_6' # type => 'RegExpr' if ($self->testRegExpr($text, '([^a-zA-Z0-9_\\s[\\]{}()])', 0, 0, 0, undef, 0, 'string_6', 'Operator')) { return 1 } # String => '\s+#.*' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s+#.*', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } return 0; }; sub parsefind_qw { my ($self, $text) = @_; # attribute => 'Operator' # beginRegion => 'Wordlist' # char => '(' # context => 'quote_word_paren' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'quote_word_paren', 'Operator')) { return 1 } # attribute => 'Operator' # beginRegion => 'Wordlist' # char => '{' # context => 'quote_word_brace' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'quote_word_brace', 'Operator')) { return 1 } # attribute => 'Operator' # beginRegion => 'Wordlist' # char => '[' # context => 'quote_word_bracket' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'quote_word_bracket', 'Operator')) { return 1 } # String => '([^a-zA-Z0-9_\s[\]{}()])' # attribute => 'Operator' # beginRegion => 'Wordlist' # context => 'quote_word' # type => 'RegExpr' if ($self->testRegExpr($text, '([^a-zA-Z0-9_\\s[\\]{}()])', 0, 0, 0, undef, 0, 'quote_word', 'Operator')) { return 1 } # String => '\s+#.*' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s+#.*', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } return 0; }; sub parsefind_subst { my ($self, $text) = @_; # String => '\s+#.*' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s+#.*', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # attribute => 'Operator' # beginRegion => 'Pattern' # char => '{' # context => 'subst_curlybrace_pattern' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'subst_curlybrace_pattern', 'Operator')) { return 1 } # attribute => 'Operator' # beginRegion => 'Pattern' # char => '(' # context => 'subst_paren_pattern' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'subst_paren_pattern', 'Operator')) { return 1 } # attribute => 'Operator' # beginRegion => 'Pattern' # char => '[' # context => 'subst_bracket_pattern' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'subst_bracket_pattern', 'Operator')) { return 1 } # attribute => 'Operator' # beginRegion => 'Pattern' # char => ''' # context => 'subst_sq_pattern' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'subst_sq_pattern', 'Operator')) { return 1 } # String => '([^\w\s[\]{}()])' # attribute => 'Operator' # beginRegion => 'Pattern' # context => 'subst_slash_pattern' # type => 'RegExpr' if ($self->testRegExpr($text, '([^\\w\\s[\\]{}()])', 0, 0, 0, undef, 0, 'subst_slash_pattern', 'Operator')) { return 1 } return 0; }; sub parsefind_variable { my ($self, $text) = @_; # String => '\$[0-9]+' # attribute => 'Special Variable' # context => 'var_detect' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$[0-9]+', 0, 0, 0, undef, 0, 'var_detect', 'Special Variable')) { return 1 } # String => '[@\$](?:[\+\-_]\B|ARGV\b|INC\b)' # attribute => 'Special Variable' # context => 'var_detect' # type => 'RegExpr' if ($self->testRegExpr($text, '[@\\$](?:[\\+\\-_]\\B|ARGV\\b|INC\\b)', 0, 0, 0, undef, 0, 'var_detect', 'Special Variable')) { return 1 } # String => '[%\$](?:INC\b|ENV\b|SIG\b)' # attribute => 'Special Variable' # context => 'var_detect' # type => 'RegExpr' if ($self->testRegExpr($text, '[%\\$](?:INC\\b|ENV\\b|SIG\\b)', 0, 0, 0, undef, 0, 'var_detect', 'Special Variable')) { return 1 } # String => '\$\$[\$\w_]' # attribute => 'Data Type' # context => 'var_detect' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$\\$[\\$\\w_]', 0, 0, 0, undef, 0, 'var_detect', 'Data Type')) { return 1 } # String => '\$[#_][\w_]' # attribute => 'Data Type' # context => 'var_detect' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$[#_][\\w_]', 0, 0, 0, undef, 0, 'var_detect', 'Data Type')) { return 1 } # String => '\$+::' # attribute => 'Data Type' # context => 'var_detect' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$+::', 0, 0, 0, undef, 0, 'var_detect', 'Data Type')) { return 1 } # String => '\$[^a-zA-Z0-9\s{][A-Z]?' # attribute => 'Special Variable' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$[^a-zA-Z0-9\\s{][A-Z]?', 0, 0, 0, undef, 0, '#stay', 'Special Variable')) { return 1 } # String => '[\$@%]\{[\w_]+\}' # attribute => 'Data Type' # context => 'var_detect' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\$@%]\\{[\\w_]+\\}', 0, 0, 0, undef, 0, 'var_detect', 'Data Type')) { return 1 } # String => '$@%' # attribute => 'Data Type' # context => 'var_detect' # type => 'AnyChar' if ($self->testAnyChar($text, '$@%', 0, 0, undef, 0, 'var_detect', 'Data Type')) { return 1 } # String => '\*[a-zA-Z_]+' # attribute => 'Data Type' # context => 'var_detect' # type => 'RegExpr' if ($self->testRegExpr($text, '\\*[a-zA-Z_]+', 0, 0, 0, undef, 0, 'var_detect', 'Data Type')) { return 1 } # String => '\*[^a-zA-Z0-9\s{][A-Z]?' # attribute => 'Special Variable' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\*[^a-zA-Z0-9\\s{][A-Z]?', 0, 0, 0, undef, 0, '#stay', 'Special Variable')) { return 1 } # String => '$@%*' # attribute => 'Operator' # context => '#pop' # type => 'AnyChar' if ($self->testAnyChar($text, '$@%*', 0, 0, undef, 0, '#pop', 'Operator')) { return 1 } return 0; }; sub parsefind_variable_unsafe { my ($self, $text) = @_; # String => '\$[0-9]+' # attribute => 'Special Variable' # context => 'var_detect_unsafe' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$[0-9]+', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Special Variable')) { return 1 } # String => '[@\$](?:[\+\-_]\B|ARGV\b|INC\b)' # attribute => 'Special Variable' # context => 'var_detect_unsafe' # type => 'RegExpr' if ($self->testRegExpr($text, '[@\\$](?:[\\+\\-_]\\B|ARGV\\b|INC\\b)', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Special Variable')) { return 1 } # String => '[%\$](?:INC\b|ENV\b|SIG\b)' # attribute => 'Special Variable' # context => 'var_detect_unsafe' # type => 'RegExpr' if ($self->testRegExpr($text, '[%\\$](?:INC\\b|ENV\\b|SIG\\b)', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Special Variable')) { return 1 } # String => '\$\$[\$\w_]' # attribute => 'Data Type' # context => 'var_detect_unsafe' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$\\$[\\$\\w_]', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) { return 1 } # String => '\$[#_][\w_]' # attribute => 'Data Type' # context => 'var_detect_unsafe' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$[#_][\\w_]', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) { return 1 } # String => '\$+::' # attribute => 'Data Type' # context => 'var_detect_unsafe' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$+::', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) { return 1 } # String => '\$[^a-zA-Z0-9\s{][A-Z]?' # attribute => 'Special Variable' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$[^a-zA-Z0-9\\s{][A-Z]?', 0, 0, 0, undef, 0, '#stay', 'Special Variable')) { return 1 } # String => '[\$@%]\{[\w_]+\}' # attribute => 'Data Type' # context => 'var_detect_unsafe' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\$@%]\\{[\\w_]+\\}', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) { return 1 } # String => '[\$@%]' # attribute => 'Data Type' # context => 'var_detect_unsafe' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\$@%]', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) { return 1 } # String => '\*\w+' # attribute => 'Data Type' # context => 'var_detect_unsafe' # type => 'RegExpr' if ($self->testRegExpr($text, '\\*\\w+', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) { return 1 } # String => '$@%*' # attribute => 'Operator' # context => '#pop' # type => 'AnyChar' if ($self->testAnyChar($text, '$@%*', 0, 0, undef, 0, '#pop', 'Operator')) { return 1 } return 0; }; sub parsehere_document { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # String => '%1' # attribute => 'Keyword' # column => '0' # context => '#pop#pop' # dynamic => 'true' # endRegion => 'HereDocument' # type => 'RegExpr' if ($self->testRegExpr($text, '%1', 0, 1, 0, 0, 0, '#pop#pop', 'Keyword')) { return 1 } # String => '\=\s*<<\s*["']?([A-Z0-9_\-]+)["']?' # attribute => 'Keyword' # beginRegion => 'HEREDoc' # context => 'here_document' # type => 'RegExpr' if ($self->testRegExpr($text, '\\=\\s*<<\\s*["\']?([A-Z0-9_\\-]+)["\']?', 0, 0, 0, undef, 0, 'here_document', 'Keyword')) { return 1 } # context => 'ipstring_internal' # type => 'IncludeRules' if ($self->includeRules('ipstring_internal', $text)) { return 1 } return 0; }; sub parsehere_document_dumb { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # String => '%1' # attribute => 'Keyword' # column => '0' # context => '#pop#pop' # dynamic => 'true' # endRegion => 'HereDocument' # type => 'RegExpr' if ($self->testRegExpr($text, '%1', 0, 1, 0, 0, 0, '#pop#pop', 'Keyword')) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } return 0; }; sub parseip_string { my ($self, $text) = @_; # attribute => 'Operator' # char => '"' # context => '#pop' # endRegion => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Operator')) { return 1 } # context => 'ipstring_internal' # type => 'IncludeRules' if ($self->includeRules('ipstring_internal', $text)) { return 1 } return 0; }; sub parseip_string_2 { my ($self, $text) = @_; # attribute => 'String (interpolated)' # char => '(' # char1 => ')' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '(', ')', 0, 0, undef, 0, '#stay', 'String (interpolated)')) { return 1 } # attribute => 'Operator' # char => ')' # context => '#pop#pop#pop' # endRegion => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) { return 1 } # context => 'ipstring_internal' # type => 'IncludeRules' if ($self->includeRules('ipstring_internal', $text)) { return 1 } return 0; }; sub parseip_string_3 { my ($self, $text) = @_; # attribute => 'String (interpolated)' # char => '{' # char1 => '}' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '{', '}', 0, 0, undef, 0, '#stay', 'String (interpolated)')) { return 1 } # attribute => 'Operator' # char => '}' # context => '#pop#pop#pop' # endRegion => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) { return 1 } # context => 'ipstring_internal' # type => 'IncludeRules' if ($self->includeRules('ipstring_internal', $text)) { return 1 } return 0; }; sub parseip_string_4 { my ($self, $text) = @_; # attribute => 'String (interpolated)' # char => '[' # char1 => ']' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '[', ']', 0, 0, undef, 0, '#stay', 'String (interpolated)')) { return 1 } # attribute => 'Operator' # char => ']' # context => '#pop#pop#pop' # endRegion => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) { return 1 } # context => 'ipstring_internal' # type => 'IncludeRules' if ($self->includeRules('ipstring_internal', $text)) { return 1 } return 0; }; sub parseip_string_5 { my ($self, $text) = @_; # attribute => 'String (interpolated)' # char => '<' # char1 => '>' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'String (interpolated)')) { return 1 } # attribute => 'Operator' # char => '>' # context => '#pop#pop#pop' # endRegion => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) { return 1 } # context => 'ipstring_internal' # type => 'IncludeRules' if ($self->includeRules('ipstring_internal', $text)) { return 1 } return 0; }; sub parseip_string_6 { my ($self, $text) = @_; # String => '\\%1' # attribute => 'String (interpolated)' # context => '#stay' # dynamic => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\%1', 0, 1, 0, undef, 0, '#stay', 'String (interpolated)')) { return 1 } # attribute => 'Operator' # char => '1' # context => '#pop#pop#pop' # dynamic => 'true' # endRegion => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '1', 0, 1, 0, undef, 0, '#pop#pop#pop', 'Operator')) { return 1 } # context => 'ipstring_internal' # type => 'IncludeRules' if ($self->includeRules('ipstring_internal', $text)) { return 1 } return 0; }; sub parseipstring_internal { my ($self, $text) = @_; # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # String => '\\[UuLlEtnaefr]' # attribute => 'String Special Character' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\[UuLlEtnaefr]', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { return 1 } # String => '\\.' # attribute => 'String (interpolated)' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'String (interpolated)')) { return 1 } # String => '(?:[\$@]\S|%[\w{])' # attribute => 'Normal Text' # context => 'find_variable_unsafe' # lookAhead => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '(?:[\\$@]\\S|%[\\w{])', 0, 0, 1, undef, 0, 'find_variable_unsafe', 'Normal Text')) { return 1 } return 0; }; sub parsenormal { my ($self, $text) = @_; # String => '^#!\/.*' # attribute => 'Keyword' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '^#!\\/.*', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '__DATA__' # attribute => 'Keyword' # context => 'data_handle' # firstNonSpace => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, '__DATA__', 0, 0, 0, undef, 1, 'data_handle', 'Keyword')) { return 1 } # String => '__END__' # attribute => 'Keyword' # context => '#stay' # firstNonSpace => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, '__END__', 0, 0, 0, undef, 1, '#stay', 'Keyword')) { return 1 } # String => '\bsub\s+' # attribute => 'Keyword' # context => 'sub_name_def' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bsub\\s+', 0, 0, 0, undef, 0, 'sub_name_def', 'Keyword')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'operators' # attribute => 'Operator' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'operators', 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => 'functions' # attribute => 'Function' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) { return 1 } # String => 'pragmas' # attribute => 'Pragma' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'pragmas', 0, undef, 0, '#stay', 'Pragma')) { return 1 } # String => '\=(?:head[1-6]|over|back|item|for|begin|end|pod)(\s|$)' # attribute => 'Pod' # beginRegion => 'POD' # column => '0' # context => 'pod' # type => 'RegExpr' if ($self->testRegExpr($text, '\\=(?:head[1-6]|over|back|item|for|begin|end|pod)(\\s|$)', 0, 0, 0, 0, 0, 'pod', 'Pod')) { return 1 } # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'Comment' # char => '#' # context => 'comment' # type => 'DetectChar' if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'comment', 'Comment')) { return 1 } # attribute => 'Octal' # context => 'slash_safe_escape' # type => 'HlCOct' if ($self->testHlCOct($text, 0, undef, 0, 'slash_safe_escape', 'Octal')) { return 1 } # attribute => 'Hex' # context => 'slash_safe_escape' # type => 'HlCHex' if ($self->testHlCHex($text, 0, undef, 0, 'slash_safe_escape', 'Hex')) { return 1 } # attribute => 'Float' # context => 'slash_safe_escape' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, 'slash_safe_escape', 'Float')) { return 1 } # attribute => 'Decimal' # context => 'slash_safe_escape' # type => 'Int' if ($self->testInt($text, 0, undef, 0, 'slash_safe_escape', 'Decimal')) { return 1 } # String => '\\(["'])[^\1]' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\(["\'])[^\\1]', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Normal Text' # char => '&' # char1 => ''' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '&', '\'', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Operator' # beginRegion => 'String' # char => '"' # context => 'ip_string' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'ip_string', 'Operator')) { return 1 } # attribute => 'Operator' # beginRegion => 'String' # char => ''' # context => 'string' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'string', 'Operator')) { return 1 } # attribute => 'Operator' # char => '`' # context => 'Backticked' # type => 'DetectChar' if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, 'Backticked', 'Operator')) { return 1 } # String => '(?:[$@]\S|%[\w{]|\*[^\d\*{\$@%=(])' # attribute => 'Normal Text' # context => 'find_variable' # lookAhead => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '(?:[$@]\\S|%[\\w{]|\\*[^\\d\\*{\\$@%=(])', 0, 0, 1, undef, 0, 'find_variable', 'Normal Text')) { return 1 } # String => '<[A-Z0-9_]+>' # attribute => 'Keyword' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '<[A-Z0-9_]+>', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => '\s*<<(?=\w+|\s*["'])' # attribute => 'Operator' # beginRegion => 'HereDocument' # context => 'find_here_document' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*<<(?=\\w+|\\s*["\'])', 0, 0, 0, undef, 0, 'find_here_document', 'Operator')) { return 1 } # String => '\s*\}\s*/' # attribute => 'Normal Text' # context => '#stay' # endRegion => 'Block' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*\\}\\s*/', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '\s*[)]\s*/' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*[)]\\s*/', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '\w+::' # attribute => 'Function' # context => 'sub_name_def' # type => 'RegExpr' if ($self->testRegExpr($text, '\\w+::', 0, 0, 0, undef, 0, 'sub_name_def', 'Function')) { return 1 } # String => '\w+[=]' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\w+[=]', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '\bq(?=[qwx]?\s*[^\w\s])' # attribute => 'Operator' # context => 'find_quoted' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bq(?=[qwx]?\\s*[^\\w\\s])', 0, 0, 0, undef, 0, 'find_quoted', 'Operator')) { return 1 } # String => '\bs(?=\s*[^\w\s])' # attribute => 'Operator' # context => 'find_subst' # type => 'RegExpr' if ($self->testRegExpr($text, '\\bs(?=\\s*[^\\w\\s])', 0, 0, 0, undef, 0, 'find_subst', 'Operator')) { return 1 } # String => '\b(?:tr|y)\s*(?=[^\w\s\]})])' # attribute => 'Operator' # context => 'tr' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(?:tr|y)\\s*(?=[^\\w\\s\\]})])', 0, 0, 0, undef, 0, 'tr', 'Operator')) { return 1 } # String => '\b(?:m|qr)(?=\s*[^\w\s\]})])' # attribute => 'Operator' # context => 'find_pattern' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b(?:m|qr)(?=\\s*[^\\w\\s\\]})])', 0, 0, 0, undef, 0, 'find_pattern', 'Operator')) { return 1 } # String => '[\w_]+\s*/' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\w_]+\\s*/', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # String => '[<>"':]/' # attribute => 'Normal Text' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[<>"\':]/', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Operator' # beginRegion => 'Pattern' # char => '/' # context => 'pattern_slash' # type => 'DetectChar' if ($self->testDetectChar($text, '/', 0, 0, 0, undef, 0, 'pattern_slash', 'Operator')) { return 1 } # String => '-[rwxoRWXOeszfdlpSbctugkTBMAC]' # attribute => 'Operator' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '-[rwxoRWXOeszfdlpSbctugkTBMAC]', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # attribute => 'Normal Text' # beginRegion => 'Block' # char => '{' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Normal Text' # char => '}' # context => '#stay' # endRegion => 'Block' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } return 0; }; sub parsepackage_qualified_blank { my ($self, $text) = @_; # String => '[\w_]+' # attribute => 'Normal Text' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\w_]+', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } return 0; }; sub parsepat_char_class { my ($self, $text) = @_; # attribute => 'Pattern Internal Operator' # char => '^' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '^', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { return 1 } # attribute => 'Pattern Character Class' # char => '\' # char1 => '\' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'Pattern Character Class')) { return 1 } # attribute => 'Pattern Character Class' # char => '\' # char1 => ']' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', ']', 0, 0, 0, undef, 0, '#stay', 'Pattern Character Class')) { return 1 } # String => '\[:^?[a-z]+:\]' # attribute => 'Pattern Character Class' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\[:^?[a-z]+:\\]', 0, 0, 0, undef, 0, '#stay', 'Pattern Character Class')) { return 1 } # attribute => 'Pattern Internal Operator' # char => ']' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Pattern Internal Operator')) { return 1 } return 0; }; sub parsepat_ext { my ($self, $text) = @_; # String => '\#[^)]*' # attribute => 'Comment' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\#[^)]*', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } # String => '[:=!><]+' # attribute => 'Pattern Internal Operator' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '[:=!><]+', 0, 0, 0, undef, 0, '#pop', 'Pattern Internal Operator')) { return 1 } # attribute => 'Pattern Internal Operator' # char => ')' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Pattern Internal Operator')) { return 1 } return 0; }; sub parsepattern { my ($self, $text) = @_; # String => '\$(?=%1)' # attribute => 'Pattern Internal Operator' # context => '#stay' # dynamic => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$(?=%1)', 0, 1, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { return 1 } # String => '%1[cgimosx]*' # attribute => 'Operator' # context => '#pop#pop' # dynamic => 'true' # endRegion => 'Pattern' # type => 'RegExpr' if ($self->testRegExpr($text, '%1[cgimosx]*', 0, 1, 0, undef, 0, '#pop#pop', 'Operator')) { return 1 } # context => 'regex_pattern_internal_ip' # type => 'IncludeRules' if ($self->includeRules('regex_pattern_internal_ip', $text)) { return 1 } # String => '\$(?=\%1)' # attribute => 'Pattern Internal Operator' # context => '#stay' # dynamic => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$(?=\\%1)', 0, 1, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { return 1 } return 0; }; sub parsepattern_brace { my ($self, $text) = @_; # String => '\}[cgimosx]*' # attribute => 'Operator' # context => '#pop#pop' # endRegion => 'Pattern' # type => 'RegExpr' if ($self->testRegExpr($text, '\\}[cgimosx]*', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) { return 1 } # context => 'regex_pattern_internal_ip' # type => 'IncludeRules' if ($self->includeRules('regex_pattern_internal_ip', $text)) { return 1 } return 0; }; sub parsepattern_bracket { my ($self, $text) = @_; # String => '\][cgimosx]*' # attribute => 'Operator' # context => '#pop#pop' # endRegion => 'Pattern' # type => 'RegExpr' if ($self->testRegExpr($text, '\\][cgimosx]*', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) { return 1 } # context => 'regex_pattern_internal_ip' # type => 'IncludeRules' if ($self->includeRules('regex_pattern_internal_ip', $text)) { return 1 } return 0; }; sub parsepattern_paren { my ($self, $text) = @_; # String => '\)[cgimosx]*' # attribute => 'Operator' # context => '#pop#pop' # endRegion => 'Pattern' # type => 'RegExpr' if ($self->testRegExpr($text, '\\)[cgimosx]*', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) { return 1 } # context => 'regex_pattern_internal_ip' # type => 'IncludeRules' if ($self->includeRules('regex_pattern_internal_ip', $text)) { return 1 } return 0; }; sub parsepattern_slash { my ($self, $text) = @_; # String => '\$(?=/)' # attribute => 'Pattern Internal Operator' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$(?=/)', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { return 1 } # context => 'regex_pattern_internal_ip' # type => 'IncludeRules' if ($self->includeRules('regex_pattern_internal_ip', $text)) { return 1 } # String => '/[cgimosx]*' # attribute => 'Operator' # context => '#pop' # endRegion => 'Pattern' # type => 'RegExpr' if ($self->testRegExpr($text, '/[cgimosx]*', 0, 0, 0, undef, 0, '#pop', 'Operator')) { return 1 } return 0; }; sub parsepattern_sq { my ($self, $text) = @_; # String => ''[cgimosx]*' # attribute => 'Operator' # context => '#pop#pop' # endRegion => 'Pattern' # type => 'RegExpr' if ($self->testRegExpr($text, '\'[cgimosx]*', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) { return 1 } # context => 'regex_pattern_internal' # type => 'IncludeRules' if ($self->includeRules('regex_pattern_internal', $text)) { return 1 } return 0; }; sub parsepod { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # String => '\=(?:head[1-6]|over|back|item|for|begin|end|pod)\s*.*' # attribute => 'Pod' # beginRegion => 'POD' # column => '0' # context => '#stay' # endRegion => 'POD' # type => 'RegExpr' if ($self->testRegExpr($text, '\\=(?:head[1-6]|over|back|item|for|begin|end|pod)\\s*.*', 0, 0, 0, 0, 0, '#stay', 'Pod')) { return 1 } # String => '\=cut\b.*' # attribute => 'Pod' # column => '0' # context => '#pop' # endRegion => 'POD' # type => 'RegExpr' if ($self->testRegExpr($text, '\\=cut\\b.*', 0, 0, 0, 0, 0, '#pop', 'Pod')) { return 1 } return 0; }; sub parsequote_word { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # String => '\\%1' # attribute => 'Normal Text' # context => '#stay' # dynamic => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\%1', 0, 1, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Operator' # char => '1' # context => '#pop#pop#pop' # dynamic => 'true' # endRegion => 'Wordlist' # type => 'DetectChar' if ($self->testDetectChar($text, '1', 0, 1, 0, undef, 0, '#pop#pop#pop', 'Operator')) { return 1 } return 0; }; sub parsequote_word_brace { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'Normal Text' # char => '\' # char1 => '}' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '}', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Operator' # char => '}' # context => '#pop#pop#pop' # endRegion => 'Wordlist' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) { return 1 } return 0; }; sub parsequote_word_bracket { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'Normal Text' # char => '\' # char1 => ']' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', ']', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Operator' # char => ']' # context => '#pop#pop#pop' # endRegion => 'Wordlist' # type => 'DetectChar' if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) { return 1 } return 0; }; sub parsequote_word_paren { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'Normal Text' # char => '\' # char1 => ')' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', ')', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Operator' # char => ')' # context => '#pop#pop#pop' # endRegion => 'Wordlist' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) { return 1 } return 0; }; sub parseregex_pattern_internal { my ($self, $text) = @_; # context => 'regex_pattern_internal_rules_1' # type => 'IncludeRules' if ($self->includeRules('regex_pattern_internal_rules_1', $text)) { return 1 } # context => 'regex_pattern_internal_rules_2' # type => 'IncludeRules' if ($self->includeRules('regex_pattern_internal_rules_2', $text)) { return 1 } return 0; }; sub parseregex_pattern_internal_ip { my ($self, $text) = @_; # context => 'regex_pattern_internal_rules_1' # type => 'IncludeRules' if ($self->includeRules('regex_pattern_internal_rules_1', $text)) { return 1 } # String => '[$@][^]\s{}()|>']' # attribute => 'Data Type' # context => 'find_variable_unsafe' # lookAhead => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '[$@][^]\\s{}()|>\']', 0, 0, 1, undef, 0, 'find_variable_unsafe', 'Data Type')) { return 1 } # context => 'regex_pattern_internal_rules_2' # type => 'IncludeRules' if ($self->includeRules('regex_pattern_internal_rules_2', $text)) { return 1 } return 0; }; sub parseregex_pattern_internal_rules_1 { my ($self, $text) = @_; # String => '#.*$' # attribute => 'Comment' # context => '#stay' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 1, '#stay', 'Comment')) { return 1 } # String => '\\[anDdSsWw]' # attribute => 'Pattern Character Class' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\[anDdSsWw]', 0, 0, 0, undef, 0, '#stay', 'Pattern Character Class')) { return 1 } # String => '\\[ABbEGLlNUuQdQZz]' # attribute => 'Pattern Internal Operator' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\[ABbEGLlNUuQdQZz]', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { return 1 } # String => '\\[\d]+' # attribute => 'Special Variable' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\[\\d]+', 0, 0, 0, undef, 0, '#stay', 'Special Variable')) { return 1 } # String => '\\.' # attribute => 'Pattern' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'Pattern')) { return 1 } return 0; }; sub parseregex_pattern_internal_rules_2 { my ($self, $text) = @_; # attribute => 'Pattern Internal Operator' # char => '(' # char1 => '?' # context => 'pat_ext' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '(', '?', 0, 0, 0, undef, 0, 'pat_ext', 'Pattern Internal Operator')) { return 1 } # attribute => 'Pattern Internal Operator' # char => '[' # context => 'pat_char_class' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'pat_char_class', 'Pattern Internal Operator')) { return 1 } # String => '[()?^*+|]' # attribute => 'Pattern Internal Operator' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[()?^*+|]', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { return 1 } # String => '\{[\d, ]+\}' # attribute => 'Pattern Internal Operator' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\{[\\d, ]+\\}', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { return 1 } # attribute => 'Pattern Internal Operator' # char => '$' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '$', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { return 1 } # String => '\s{3,}#.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s{3,}#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } return 0; }; sub parseslash_safe_escape { my ($self, $text) = @_; # String => '\s*\]?\s*/' # attribute => 'Normal Text' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*\\]?\\s*/', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } # String => '\s*\}?\s*/' # attribute => 'Normal Text' # context => '#pop' # endRegion => 'Block' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*\\}?\\s*/', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } # String => '\s*\)?\s*/' # attribute => 'Normal Text' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*\\)?\\s*/', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#pop' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#pop', 'Keyword')) { return 1 } return 0; }; sub parsestring { my ($self, $text) = @_; # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'String Special Character' # char => '\' # char1 => ''' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '\'', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { return 1 } # attribute => 'String Special Character' # char => '\' # char1 => '\' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { return 1 } # attribute => 'Operator' # char => ''' # context => '#pop' # endRegion => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Operator')) { return 1 } return 0; }; sub parsestring_2 { my ($self, $text) = @_; # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'String Special Character' # char => '\' # char1 => ')' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', ')', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { return 1 } # attribute => 'String Special Character' # char => '\' # char1 => '\' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { return 1 } # attribute => 'String' # char => '(' # char1 => ')' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '(', ')', 0, 0, undef, 0, '#stay', 'String')) { return 1 } # attribute => 'Operator' # char => ')' # context => '#pop#pop' # endRegion => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) { return 1 } return 0; }; sub parsestring_3 { my ($self, $text) = @_; # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'String Special Character' # char => '\' # char1 => '}' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '}', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { return 1 } # attribute => 'String Special Character' # char => '\' # char1 => '\' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { return 1 } # attribute => 'String' # char => '{' # char1 => '}' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '{', '}', 0, 0, undef, 0, '#stay', 'String')) { return 1 } # attribute => 'Operator' # char => '}' # context => '#pop#pop' # endRegion => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) { return 1 } return 0; }; sub parsestring_4 { my ($self, $text) = @_; # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'String Special Character' # char => '\' # char1 => ']' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', ']', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { return 1 } # attribute => 'String Special Character' # char => '\' # char1 => '\' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { return 1 } # attribute => 'String' # char => '[' # char1 => ']' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '[', ']', 0, 0, undef, 0, '#stay', 'String')) { return 1 } # attribute => 'Operator' # char => ']' # context => '#pop#pop' # endRegion => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) { return 1 } return 0; }; sub parsestring_5 { my ($self, $text) = @_; # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'String Special Character' # char => '\' # char1 => '<' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '<', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { return 1 } # attribute => 'String Special Character' # char => '\' # char1 => '\' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { return 1 } # attribute => 'String' # char => '\' # char1 => '>' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '>', 0, 0, 0, undef, 0, '#stay', 'String')) { return 1 } # attribute => 'String' # char => '<' # char1 => '>' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'String')) { return 1 } # attribute => 'Operator' # char => '>' # context => '#pop#pop' # endRegion => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) { return 1 } return 0; }; sub parsestring_6 { my ($self, $text) = @_; # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'String Special Character' # char => '\' # char1 => '\' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { return 1 } # String => '\\%1' # attribute => 'String Special Character' # context => '#stay' # dynamic => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\\\%1', 0, 1, 0, undef, 0, '#stay', 'String Special Character')) { return 1 } # attribute => 'Operator' # char => '1' # context => '#pop#pop' # dynamic => 'true' # endRegion => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '1', 0, 1, 0, undef, 0, '#pop#pop', 'Operator')) { return 1 } return 0; }; sub parsesub_arg_definition { my ($self, $text) = @_; # String => '*$@%' # attribute => 'Data Type' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '*$@%', 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '&\[];' # attribute => 'Normal Text' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '&\\[];', 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Normal Text' # char => ')' # context => 'slash_safe_escape' # type => 'DetectChar' if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, 'slash_safe_escape', 'Normal Text')) { return 1 } return 0; }; sub parsesub_name_def { my ($self, $text) = @_; # String => '\w+' # attribute => 'Function' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\w+', 0, 0, 0, undef, 0, '#stay', 'Function')) { return 1 } # String => '\$\S' # attribute => 'Normal Text' # context => 'find_variable' # lookAhead => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$\\S', 0, 0, 1, undef, 0, 'find_variable', 'Normal Text')) { return 1 } # String => '\s*\(' # attribute => 'Normal Text' # context => 'sub_arg_definition' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*\\(', 0, 0, 0, undef, 0, 'sub_arg_definition', 'Normal Text')) { return 1 } # attribute => 'Normal Text' # char => ':' # char1 => ':' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, ':', ':', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } return 0; }; sub parsesubst_bracket_pattern { my ($self, $text) = @_; # String => '\s+#.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s+#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # context => 'regex_pattern_internal_ip' # type => 'IncludeRules' if ($self->includeRules('regex_pattern_internal_ip', $text)) { return 1 } # attribute => 'Operator' # char => ']' # context => 'subst_bracket_replace' # endRegion => 'Pattern' # type => 'DetectChar' if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, 'subst_bracket_replace', 'Operator')) { return 1 } return 0; }; sub parsesubst_bracket_replace { my ($self, $text) = @_; # context => 'ipstring_internal' # type => 'IncludeRules' if ($self->includeRules('ipstring_internal', $text)) { return 1 } # attribute => 'Operator' # beginRegion => 'Replacement' # char => '[' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '\][cegimosx]*' # attribute => 'Operator' # context => '#pop#pop#pop' # endRegion => 'Replacement' # type => 'RegExpr' if ($self->testRegExpr($text, '\\][cegimosx]*', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) { return 1 } return 0; }; sub parsesubst_curlybrace_middle { my ($self, $text) = @_; # String => '#.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # attribute => 'Operator' # beginRegion => 'Replacement' # char => '{' # context => 'subst_curlybrace_replace' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'subst_curlybrace_replace', 'Operator')) { return 1 } return 0; }; sub parsesubst_curlybrace_pattern { my ($self, $text) = @_; # String => '\s+#.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s+#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # context => 'regex_pattern_internal_ip' # type => 'IncludeRules' if ($self->includeRules('regex_pattern_internal_ip', $text)) { return 1 } # attribute => 'Operator' # char => '}' # context => 'subst_curlybrace_middle' # endRegion => 'Pattern' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, 'subst_curlybrace_middle', 'Operator')) { return 1 } return 0; }; sub parsesubst_curlybrace_replace { my ($self, $text) = @_; # context => 'ipstring_internal' # type => 'IncludeRules' if ($self->includeRules('ipstring_internal', $text)) { return 1 } # attribute => 'Normal Text' # beginRegion => 'Block' # char => '{' # context => 'subst_curlybrace_replace_recursive' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'subst_curlybrace_replace_recursive', 'Normal Text')) { return 1 } # String => '\}[cegimosx]*' # attribute => 'Operator' # context => '#pop#pop#pop#pop' # endRegion => 'Replacement' # type => 'RegExpr' if ($self->testRegExpr($text, '\\}[cegimosx]*', 0, 0, 0, undef, 0, '#pop#pop#pop#pop', 'Operator')) { return 1 } return 0; }; sub parsesubst_curlybrace_replace_recursive { my ($self, $text) = @_; # attribute => 'String (interpolated)' # beginRegion => 'Block' # char => '{' # context => 'subst_curlybrace_replace_recursive' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'subst_curlybrace_replace_recursive', 'String (interpolated)')) { return 1 } # attribute => 'Normal Text' # char => '}' # context => '#pop' # endRegion => 'Block' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { return 1 } # context => 'ipstring_internal' # type => 'IncludeRules' if ($self->includeRules('ipstring_internal', $text)) { return 1 } return 0; }; sub parsesubst_paren_pattern { my ($self, $text) = @_; # String => '\s+#.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s+#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # context => 'regex_pattern_internal_ip' # type => 'IncludeRules' if ($self->includeRules('regex_pattern_internal_ip', $text)) { return 1 } # attribute => 'Operator' # char => '}' # context => 'subst_paren_replace' # endRegion => 'Pattern' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, 'subst_paren_replace', 'Operator')) { return 1 } return 0; }; sub parsesubst_paren_replace { my ($self, $text) = @_; # context => 'ipstring_internal' # type => 'IncludeRules' if ($self->includeRules('ipstring_internal', $text)) { return 1 } # attribute => 'Operator' # beginRegion => 'Replacement' # char => '(' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => '\)[cegimosx]*' # attribute => 'Operator' # context => '#pop#pop#pop' # endRegion => 'Replacement' # type => 'RegExpr' if ($self->testRegExpr($text, '\\)[cegimosx]*', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) { return 1 } return 0; }; sub parsesubst_slash_pattern { my ($self, $text) = @_; # String => '\$(?=%1)' # attribute => 'Pattern Internal Operator' # context => '#stay' # dynamic => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '\\$(?=%1)', 0, 1, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { return 1 } # String => '(%1)' # attribute => 'Operator' # beginRegion => 'Replacement' # context => 'subst_slash_replace' # dynamic => 'true' # endRegion => 'Pattern' # type => 'RegExpr' if ($self->testRegExpr($text, '(%1)', 0, 1, 0, undef, 0, 'subst_slash_replace', 'Operator')) { return 1 } # context => 'regex_pattern_internal_ip' # type => 'IncludeRules' if ($self->includeRules('regex_pattern_internal_ip', $text)) { return 1 } return 0; }; sub parsesubst_slash_replace { my ($self, $text) = @_; # context => 'ipstring_internal' # type => 'IncludeRules' if ($self->includeRules('ipstring_internal', $text)) { return 1 } # String => '%1[cegimosx]*' # attribute => 'Operator' # context => '#pop#pop#pop' # dynamic => 'true' # endRegion => 'Replacement' # type => 'RegExpr' if ($self->testRegExpr($text, '%1[cegimosx]*', 0, 1, 0, undef, 0, '#pop#pop#pop', 'Operator')) { return 1 } return 0; }; sub parsesubst_sq_pattern { my ($self, $text) = @_; # String => '\s+#.*$' # attribute => 'Comment' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s+#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { return 1 } # context => 'regex_pattern_internal' # type => 'IncludeRules' if ($self->includeRules('regex_pattern_internal', $text)) { return 1 } # attribute => 'Operator' # beginRegion => 'Pattern' # char => ''' # context => 'subst_sq_replace' # endRegion => 'Pattern' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'subst_sq_replace', 'Operator')) { return 1 } return 0; }; sub parsesubst_sq_replace { my ($self, $text) = @_; # String => ''[cegimosx]*' # attribute => 'Operator' # context => '#pop#pop#pop' # endRegion => 'Replacement' # type => 'RegExpr' if ($self->testRegExpr($text, '\'[cegimosx]*', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) { return 1 } return 0; }; sub parsetr { my ($self, $text) = @_; # String => '\([^)]*\)\s*\(?:[^)]*\)' # attribute => 'Pattern' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\([^)]*\\)\\s*\\(?:[^)]*\\)', 0, 0, 0, undef, 0, '#pop', 'Pattern')) { return 1 } # String => '\{[^}]*\}\s*\{[^}]*\}' # attribute => 'Pattern' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\{[^}]*\\}\\s*\\{[^}]*\\}', 0, 0, 0, undef, 0, '#pop', 'Pattern')) { return 1 } # String => '\[[^}]*\]\s*\[[^\]]*\]' # attribute => 'Pattern' # context => '#pop' # type => 'RegExpr' if ($self->testRegExpr($text, '\\[[^}]*\\]\\s*\\[[^\\]]*\\]', 0, 0, 0, undef, 0, '#pop', 'Pattern')) { return 1 } # String => '([^a-zA-Z0-9_\s[\]{}()]).*\1.*\1' # attribute => 'Pattern' # context => '#pop' # minimal => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '([^a-zA-Z0-9_\\s[\\]{}()]).*?\\1.*?\\1', 0, 0, 0, undef, 0, '#pop', 'Pattern')) { return 1 } return 0; }; sub parsevar_detect { my ($self, $text) = @_; # context => 'var_detect_rules' # type => 'IncludeRules' if ($self->includeRules('var_detect_rules', $text)) { return 1 } # context => 'slash_safe_escape' # type => 'IncludeRules' if ($self->includeRules('slash_safe_escape', $text)) { return 1 } return 0; }; sub parsevar_detect_rules { my ($self, $text) = @_; # String => '[\w_]+' # attribute => 'Data Type' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\w_]+', 0, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # attribute => 'Normal Text' # char => ':' # char1 => ':' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, ':', ':', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Operator' # char => ''' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#stay', 'Operator')) { return 1 } # attribute => 'Normal Text' # char => '-' # char1 => '>' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '-', '>', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Normal Text' # char => '+' # char1 => '+' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '+', '+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } # attribute => 'Normal Text' # char => '-' # char1 => '-' # context => '#stay' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { return 1 } return 0; }; sub parsevar_detect_unsafe { my ($self, $text) = @_; # context => 'var_detect_rules' # type => 'IncludeRules' if ($self->includeRules('var_detect_rules', $text)) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Perl - a Plugin for Perl syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Perl; my $sh = new Syntax::Highlight::Engine::Kate::Perl([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Perl is a plugin module that provides syntax highlighting for Perl to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the author Syntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Convert/0000755000175000017500000000000013226471445025736 5ustar manwarmanwarSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Convert/XMLData.pm0000644000175000017500000001125113226470762027527 0ustar manwarmanwar# Copyright (c) 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. package Syntax::Highlight::Engine::Kate::Convert::XMLData; use strict; use warnings; use XML::TokeParser; use Data::Dumper; our $VERSION = '0.14'; my $regchars = "\\^.\$|()[]{}*+?~!%^&/"; sub new { my $proto = shift; my $class = ref($proto) || $proto; my $file = shift @_; unless (defined($file)) { $file = ''; } my $self = { basecontext => '', contexts => {}, adddeliminators => '', weakdeliminators => '', filename => '', itemdata => {}, keywordscase => 1, language => {}, lists => {}, metadata =>{}, }; bless ($self, $class); if (defined($file)) { $self->loadXML($file) } return $self; } sub basecontext { my $self = shift; if (@_) { $self->{'basecontext'} = shift } return $self->{'basecontext'} } sub contexts { my $self = shift; if (@_) { $self->{'contexts'} = shift } return $self->{'contexts'} } sub additionalDeliminator { my $self = shift; if (@_) { $self->{'adddeliminators'} = shift } return $self->{'adddeliminators'} } sub weakDeliminator { my $self = shift; if (@_) { $self->{'weakdeliminators'} = shift } return $self->{'weakdeliminators'} } sub filename { my $self = shift; if (@_) { $self->{'filename'} = shift } return $self->{'filename'} } sub getItems { my ($self, $parser) = @_; my @list = (); while (my $token = $parser->get_token) { if ($token->[0] eq 'S') { my $t = $token->[2]; $t->{'type'} = $token->[1]; my @items = $self->getItems($parser); if (@items) { $t->{'items'} = \@items } push @list, $t; } elsif ($token->[0] eq 'E') { return @list; } } } sub itemdata { my $self = shift; if (@_) { $self->{'itemdata'} = shift } return $self->{'itemdata'} } sub keywordscase { my $self = shift; if (@_) { $self->{'keywordscase'} = shift } return $self->{'keywordscase'} } sub loadXML { my ($self, $file) = @_; unless (open KATE, "<$file") { die "cannot open $file"; }; print "loading $file\n"; my $parser = new XML::TokeParser(\*KATE, Noempty => 1); my %curargs = (); my @curlist = (); my $curitem = ''; my $mode = 'base'; while (my $token = $parser->get_token) { if ($mode eq 'base') { if ($token->[0] eq 'S') { if ($token->[1] eq 'language') { my $args = $token->[2]; $self->language($args); } elsif ($token->[1] eq 'list') { $curitem = $token->[2]->{'name'}; # print "current list '$curitem'\n"; $mode = 'list'; } elsif ($token->[1] eq 'context') { my $ctx = delete $token->[2]->{'name'}; unless (defined($ctx)) { $ctx ='noname' }; # print "current context '$ctx'\n"; my $ar = $token->[2]; my %args = %$ar; if ($self->basecontext eq '') { $self->basecontext($ctx); } my @items = $self->getItems($parser); if (@items) { $args{'items'} = \@items }; $self->contexts->{$ctx} = \%args; } elsif ($token->[1] eq 'itemData') { my $style = $token->[2]->{'defStyleNum'}; unless (defined($style)) { $style = '';}; $style =~ s/^ds//; $self->itemdata->{$token->[2]->{'name'}} = $style; } elsif ($token->[1] eq 'keywords') { my $case = delete $token->[2]->{'casesensitive'}; if (defined($case)) { if (lc($case) eq 'true') { $self->keywordscase(1); } else { $self->keywordscase(0); } } my $wdelim = delete $token->[2]->{'weakDeliminator'}; if (defined($wdelim)) { $self->weakDeliminator($wdelim) } my $adelim = delete $token->[2]->{'additionalDeliminator'}; if (defined($wdelim)) { $self->additionalDeliminator($wdelim) } } } } elsif ($mode eq 'list') { if ($token->[0] eq 'T') { my $tx = $token->[1]; $tx =~ s/^\s+//; $tx =~ s/\s+$//; push @curlist, $tx; } elsif ($token->[0] eq 'E') { if ($token->[1] eq 'list') { $self->lists->{$curitem} = [ @curlist ]; $mode = 'base'; @curlist = (); $curitem = ''; } } } } close KATE; $self->filename($file); } sub language { my $self = shift; if (@_) { $self->{'language'} = shift } return $self->{'language'} } sub lists { my $self = shift; if (@_) { $self->{'lists'} = shift } return $self->{'lists'} } sub metadata { my $self = shift; my $key = shift; my $m = $self->{'metadata'}; if (@_) { $m->{$key} = shift; } my $res = ''; if (exists $m->{$key}) { $res = $m->{$key} } return $res; } sub metadataBackup { my $self = shift; my $m = $self->{'metadata'}; my $dstr = Dumper($m); my $VAR1; eval $dstr; return $VAR1; } sub samplefile { my $self = shift; if (@_) { $self->{'samplefile'} = shift } return $self->{'samplefile'}; } 1; Syntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Convert/ToolKit.pm0000644000175000017500000006627013226470762027675 0ustar manwarmanwar# Copyright (c) 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. package Syntax::Highlight::Engine::Kate::Convert::ToolKit; our $VERSION = '0.14'; use strict; use warnings; use XML::Dumper; require Syntax::Highlight::Engine::Kate::Convert::XMLData; use File::Basename; my $regfile = "SHEKREGISTRY.xml"; my $regchars = "\\^.\$|()[]{}*+?~!%^&/"; my %tests = ( AnyChar => \&testRuleAnyChar, DetectChar => \&testRuleDetectChar, Detect2Chars => \&testRuleDetect2Chars, DetectIdentifier => \&testRuleDetectIdentifier, DetectSpaces => \&testRuleDetectSpaces, Float => \&testRuleFloat, HlCChar => \&testRuleHlCChar, HlCHex => \&testRuleHlCHex, HlCOct => \&testRuleHlCOct, HlCStringChar => \&testRuleHlCStringChar, IncludeRules => \&testRuleIncludeRules, Int => \&testRuleInt, keyword => \&testRuleKeyword, LineContinue => \&testRuleLineContinue, RangeDetect => \&testRuleRangeDetect, RegExpr => \&testRuleRegExpr, StringDetect => \&testRuleStringDetect, ); my %parses = ( AnyChar => \&pmRuleAnyChar, DetectChar => \&pmRuleDetectChar, Detect2Chars => \&pmRuleDetect2Chars, DetectIdentifier => \&pmRuleDetectIdentifier, DetectSpaces => \&pmRuleDetectSpaces, Float => \&pmRuleFloat, HlCChar => \&pmRuleHlCChar, HlCHex => \&pmRuleHlCHex, HlCOct => \&pmRuleHlCOct, HlCStringChar => \&pmRuleHlCStringChar, IncludeRules => \&pmRuleIncludeRules, Int => \&pmRuleInt, keyword => \&pmRuleKeyword, LineContinue => \&pmRuleLineContinue, RangeDetect => \&pmRuleRangeDetect, RegExpr => \&pmRuleRegExpr, StringDetect => \&pmRuleStringDetect, ); my @stdoptions = qw(lookAhead column firstNonSpace context attribute); my $stringtest = sub { return (length(shift) > 0) }; my $booltest = sub { my $l = lc(shift) ; return (($l eq 'true') or ($l eq 'false') or ($l eq '0') or ($l eq '1')) }; my $chartest = sub { return (length(shift) eq 1) }; my %testopts = ( attribute => $stringtest, char => $chartest, char1 => $chartest, column => sub { return (shift =~ /^\d+$/)}, context => $stringtest, dynamic => $booltest, firstNonSpace =>$booltest, insensitive => $booltest, lookAhead => $booltest, minimal => $booltest, String => $stringtest, ); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = { indent => 0, indentchar => ' ', curlang => '', curcontext => '', guiadd => sub { }, logcmd => sub { warn shift }, outcmd => sub { print shift }, policy => 'abort', polcmd => sub { return 0 }, reportdata => [], registered => {}, runtestspace => '', verbose => 1, version => '0.01', }; bless ($self, $class); return $self; } sub booleanize { my ($self, $d) = @_; if (lc($d) eq 'true') { $d = 1 }; if (lc($d) eq 'false') { $d = 0 }; if (($d ne 0) and ($d ne 1)) { return undef }; return $d; } sub checkIntegrity { my $self = shift; my @l = @_; unless (@l) { @l = $self->registered }; while (@l) { my $lang = shift @l; $self->curlang($lang); $self->indent(0); my $xml = $self->xmldata($lang); if (defined($xml)) { my $ctx = $xml->contexts; foreach my $k (sort keys %$ctx) { $self->curcontext($k); $self->lprint("checking context $k"); $self->indentUp; my $itl = $ctx->{$k}->{'items'}; $self->testContextItems(@$itl); $self->indentDown; } } else { $self->log("could not retrieve data for $lang"); } } } sub curcontext { my $self = shift; if (@_) { $self->{'curcontext'} = shift; }; return $self->{'curcontext'}; } sub curlang { my $self = shift; if (@_) { $self->{'curlang'} = shift; }; return $self->{'curlang'}; } sub guiadd { my $self = shift; if (@_) { $self->{'guiadd'} = shift; }; return $self->{'guiadd'}; } sub indent { my $self = shift; if (@_) { $self->{'indent'} = shift; }; return $self->{'indent'}; } sub indentchar { my $self = shift; if (@_) { $self->{'indentchar'} = shift; }; return $self->{'indentchar'}; } sub indentDown { my $self = shift; if ($self->indent > 0) { $self->indent($self->indent - 1); } else { $self->log("indentation already 0\n"); } } sub indentUp { my $self = shift; $self->indent($self->indent + 1); } sub log { my ($self, $msg) = @_; my $c = $self->logcmd; &$c($msg); } sub logcmd { my $self = shift; if (@_) { $self->{'logcmd'} = shift; }; return $self->{'logcmd'}; } sub lprint { my ($self, $txt) = @_; if (defined($txt)) { #check if only a newline should be given if ($txt ne '') { #do not indent empty lines my $c = 0; while ($c < $self->{'indent'}) { $txt = $self->indentchar . $txt; $c ++; } } } else { $txt = ''; } my $c = $self->outcmd; &$c("$txt\n"); } sub moduleName { my ($self, $name) = @_; my %numb = ( '1' => 'One', '2' => 'Two', '3' => 'Three', '4' => 'Four', '5' => 'Five', '6' => 'Six', '7' => 'Seven', '8' => 'Eight', '9' => 'Nine', '0' => 'Zero', ); if ($name =~ s/^(\d)//) { $name = $numb{$1} . $name; } $name =~ s/\.//; $name =~ s/\+/plus/g; $name =~ s/\-/minus/g; $name =~ s/#/dash/g; $name =~ s/[^0-9a-zA-Z]/_/g; $name =~ s/__/_/g; $name =~ s/_$//; $name = ucfirst($name); return $name; } sub outcmd { my $self = shift; if (@_) { $self->{'outcmd'} = shift; }; return $self->{'outcmd'}; } sub pmGenerate { my $self = shift; my @l = @_; unless (@l) { @l = $self->registered }; while (@l) { my $lang = shift @l; my $vbck = $self->verbose; $self->verbose(0); $self->indent(0); $self->curlang($lang); my $xml = $self->xmldata($lang); my $file = basename($xml->filename); my $lh = $xml->language; my $name = $self->moduleName($lang); my $i = $xml->itemdata; my %itemdata = %$i; my $l = $xml->lists; my %lists = %$l; my $c = $xml->contexts; my %contexts = %$c; $self->lprint("# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved."); $self->lprint("# This program is free software; you can redistribute it and/or"); $self->lprint("# modify it under the same terms as Perl itself."); $self->lprint; $self->lprint("# This file was generated from the '$file' file of the syntax highlight"); $self->lprint("# engine of the kate text editor (http://www.kate-editor.org"); $self->lprint; if (exists $lh->{'version'}) { $self->lprint("#kate xml version " . $lh->{'version'}); } if (exists $lh->{'kateversion'}) { $self->lprint("#kate version " . $lh->{"kateversion"}); } if (exists $lh->{'author'}) { $self->lprint("#kate author " . $lh->{"author"}); } my $time = localtime; $self->lprint("#generated: $time, localtime"); $self->lprint; $self->lprint("package Syntax::Highlight::Engine::Kate::$name;"); $self->lprint; $self->lprint("use vars qw(\$VERSION);"); $self->lprint("\$VERSION = '" . $self->version . "';"); $self->lprint; $self->lprint("use strict;"); $self->lprint("use warnings;"); $self->lprint("use base('Syntax::Highlight::Engine::Kate::Template');"); $self->lprint; $self->lprint("sub new {"); $self->indentUp; $self->lprint("my \$proto = shift;"); $self->lprint("my \$class = ref(\$proto) || \$proto;"); $self->lprint("my \$self = \$class->SUPER::new(\@_);"); if (%itemdata) { $self->lprint("\$self->attributes({"); $self->indentUp; foreach my $at (sort keys %itemdata) { my $v = $itemdata{$at}; $self->lprint("'$at' => '$v',"); } $self->indentDown; $self->lprint("});"); } if (%lists) { foreach my $k (sort keys %lists) { $self->lprint("\$self->listAdd('$k',"); $self->indentUp; my $il = $lists{$k}; foreach my $i (sort @$il) { $i =~ s/\\/\\\\/g; $i =~ s/\'/\\'/g; $self->lprint($self->stringalize($i) . ","); } $self->indentDown; $self->lprint(");"); } } $self->lprint("\$self->contextdata({"); $self->indentUp; foreach my $ctx (sort keys %contexts) { my $p = $contexts{$ctx}; $self->lprint("'$ctx' => {"); $self->indentUp; $self->lprint("callback => \\&" . $self->pmMethodName($ctx) . ","); if (exists $p->{'attribute'}) { my $coi = $p->{'attribute'}; $self->lprint("attribute => '$coi',"); } if (exists $p->{'lineEndContext'}) { my $e = $p->{'lineEndContext'}; unless ($e eq '#stay') { $self->lprint("lineending => '$e',"); } } if (exists $p->{'lineBeginContext'}) { my $e = $p->{'lineBeginContext'}; unless ($e eq '#stay') { $self->lprint("linebeginning => '$e',"); } } if (exists $p->{'fallthrough'}) { my $e = $p->{'fallthrough'}; if ($e eq 'true') { if (exists $p->{'fallthroughContext'}) { my $e = $p->{'fallthroughContext'}; $self->lprint("fallthrough => '$e',"); } } } if (exists $p->{'dynamic'}) { my $e = $p->{'dynamic'}; if ($e eq 'true') { $self->lprint("dynamic => 1,"); } } $self->indentDown; $self->lprint("},"); } $self->indentDown; $self->lprint("});"); my $deliminators = ".():!+,-<=>%&*/;?[]^{|}~\\"; my $wdelim = $xml->weakDeliminator; while ($wdelim ne '') { $wdelim =~ s/^(.)//; my $wd = $1; if (index($regchars, $wd) >= 0) { $wd = "\\$wd" }; $deliminators =~ s/$wd//; } my $adelim = $xml->additionalDeliminator; $deliminators = $deliminators . $adelim; my @delimchars = split //, $deliminators; my $tmp = ''; for (@delimchars) { my $dc = $_; if (index($regchars, $dc ) >= 0) { $dc = "\\$dc" }; $tmp = "$tmp|$dc"; } $tmp = '\\s|' . $tmp; $self->lprint("\$self->deliminators(" . $self->stringalize($tmp) . ");"); $self->lprint("\$self->basecontext(" . $self->stringalize($xml->basecontext) . ");"); $self->lprint("\$self->keywordscase(" . $xml->keywordscase . ");"); $self->lprint("\$self->initialize;"); $self->lprint("bless (\$self, \$class);"); $self->lprint("return \$self;"); $self->indentDown; $self->lprint("}"); $self->lprint; $self->lprint("sub language {"); $self->indentUp; $self->lprint("return " . $self->stringalize($lang) . ";"); $self->indentDown; $self->lprint("}"); $self->lprint; foreach my $ctxt (sort keys %contexts) { $self->curcontext($ctxt); $self->lprint("sub " . $self->pmMethodName($ctxt) . " {"); $self->indentUp; $self->lprint("my (\$self, \$text) = \@_;"); my $c = $contexts{$ctxt}; my $it = $c->{'items'}; $self->pmParseRules(@$it); # $self->indentDown; # $self->lprint("}\n\n"); $self->lprint("return 0;"); $self->indentDown; $self->lprint("};"); $self->lprint; } $self->lprint; $self->lprint("1;"); $self->lprint; $self->lprint("__END__"); $self->lprint; $self->lprint("=head1 NAME"); $self->lprint; $self->lprint("Syntax::Highlight::Engine::Kate::$name - a Plugin for $lang syntax highlighting"); $self->lprint; $self->lprint("=head1 SYNOPSIS"); $self->lprint; $self->lprint(" require Syntax::Highlight::Engine::Kate::$name;"); $self->lprint(" my \$sh = new Syntax::Highlight::Engine::Kate::$name(["); #todotodotodotodo $self->lprint(" ]);"); $self->lprint; $self->lprint("=head1 DESCRIPTION"); $self->lprint; $self->lprint("Syntax::Highlight::Engine::Kate::$name is a plugin module that provides syntax highlighting"); $self->lprint("for $lang to the Syntax::Haghlight::Engine::Kate highlighting engine."); $self->lprint; $self->lprint("This code is generated from the syntax definition files used"); $self->lprint("by the Kate project."); $self->lprint("It works quite fine, but can use refinement and optimization."); $self->lprint; $self->lprint("It inherits Syntax::Higlight::Engine::Kate::Template. See also there."); $self->lprint; $self->lprint("=cut"); $self->lprint; $self->lprint("=head1 AUTHOR"); $self->lprint; $self->lprint("Hans Jeuken (haje toneel demon nl)"); $self->lprint; $self->lprint("=cut"); $self->lprint; $self->lprint("=head1 BUGS"); $self->lprint; $self->lprint("Unknown. If you find any, please contact the author"); $self->lprint; $self->lprint("=cut"); $self->lprint; $self->verbose($vbck); } } sub pmMethodName { my ($self, $in) = @_; $in =~ s/\(/Bo/g; $in =~ s/\)/Bc/g; $in =~ s/\{/Co/g; $in =~ s/\}/Cc/g; $in =~ s/\[/So/g; $in =~ s/\]/Sc/g; $in =~ s/([^A-za-z0-9_])//g; return "parse$in"; } sub pmParseRules { my $self = shift; for (@_) { my $rule = $_; foreach my $k (sort keys %$rule) { $self->lprint("# $k => '" . $rule->{$k} . "'"); } my $test = $tests{$rule->{'type'}}; if (&$test($self, $rule)) { my $call = $parses{$rule->{'type'}}; &$call($self, $rule); } else { $self->lprint("#This rule is buggy, not sending it to output"); } } } sub pmParseRuleFinish { my ($self, $rule) = @_; $self->indentUp; if (exists $rule->{'items'}) { my $i = $rule->{'items'}; $self->pmParseRules(@$i); #recursive; } else { $self->lprint("return 1"); } $self->indentDown; $self->lprint("}"); } sub pmParseRuleConvertArgs { my $self = shift; my $rule = shift; my $r = ""; my %default = ( lookAhead => 0, insensitive => 0, minimal => 0, dynamic => 0, context => '#stay', firstNonSpace => 0, ); while (@_) { my $n = shift; my $d; if (exists($rule->{$n})) { $d = $rule->{$n}; } elsif (exists($default{$n})) { $d = $default{$n}; } else { $d = undef; } if (defined($d)) { my @boole = qw(insensitive dynamic firstNonSpace lookAhead minimal); my @str = qw(String char char1 context attribute); if ($n eq 'String') { $d = $self->stringalize($d); } elsif (grep {$n eq $_} @boole) { $d = $self->booleanize($d); } elsif (grep {$n eq $_} @str) { $d = $self->stringalize($d); } } else { $d = "undef" } if ($r ne '') { $r = $r . ', ' } $r = $r . $d; } return $r } sub pmRuleAnyChar { my ($self, $rule) = @_; my $optxt = $self->pmParseRuleConvertArgs($rule, qw/String insensitive/, @stdoptions); $self->lprint("if (\$self->testAnyChar(\$text, $optxt)) {"); $self->pmParseRuleFinish($rule); } sub pmRuleDetectChar { my ($self, $rule) = @_; my $optxt = $self->pmParseRuleConvertArgs($rule, qw/char insensitive dynamic/, @stdoptions); $self->lprint("if (\$self->testDetectChar(\$text, $optxt)) {"); $self->pmParseRuleFinish($rule); } sub pmRuleDetect2Chars { my ($self, $rule) = @_; my $optxt = $self->pmParseRuleConvertArgs($rule, qw/char char1 insensitive dynamic/, @stdoptions); $self->lprint("if (\$self->testDetect2Chars(\$text, $optxt)) {"); $self->pmParseRuleFinish($rule); } sub pmRuleDetectIdentifier { my ($self, $rule) = @_; my $optxt = $self->pmParseRuleConvertArgs($rule, @stdoptions); $self->lprint("if (\$self->testDetectIdentifier(\$text, $optxt)) {"); $self->pmParseRuleFinish($rule); } sub pmRuleDetectSpaces { my ($self, $rule) = @_; my $optxt = $self->pmParseRuleConvertArgs($rule, @stdoptions); $self->lprint("if (\$self->testDetectSpaces(\$text, $optxt)) {"); $self->pmParseRuleFinish($rule); } sub pmRuleFloat { my ($self, $rule) = @_; my $optxt = $self->pmParseRuleConvertArgs($rule, @stdoptions); $self->lprint("if (\$self->testFloat(\$text, $optxt)) {"); $self->pmParseRuleFinish($rule); } sub pmRuleHlCChar { my ($self, $rule) = @_; my $optxt = $self->pmParseRuleConvertArgs($rule, @stdoptions); $self->lprint("if (\$self->testHlCChar(\$text, $optxt)) {"); $self->pmParseRuleFinish($rule); } sub pmRuleHlCHex { my ($self, $rule) = @_; my $optxt = $self->pmParseRuleConvertArgs($rule, @stdoptions); $self->lprint("if (\$self->testHlCHex(\$text, $optxt)) {"); $self->pmParseRuleFinish($rule); } sub pmRuleHlCOct { my ($self, $rule) = @_; my $optxt = $self->pmParseRuleConvertArgs($rule, @stdoptions); $self->lprint("if (\$self->testHlCOct(\$text, $optxt)) {"); $self->pmParseRuleFinish($rule); } sub pmRuleHlCStringChar { my ($self, $rule) = @_; my $optxt = $self->pmParseRuleConvertArgs($rule, @stdoptions); $self->lprint("if (\$self->testHlCStringChar(\$text, $optxt)) {"); $self->pmParseRuleFinish($rule); } sub pmRuleIncludeRules { my ($self, $rule) = @_; my $context = $self->stringalize($rule->{'context'}); my $ed; if ($context =~ s/^(')##/$1/) { $ed = "includePlugin"; } else { $ed = "includeRules"; } $self->lprint("if (\$self->$ed($context, \$text)) {"); $self->pmParseRuleFinish($rule); } sub pmRuleInt { my ($self, $rule) = @_; my $optxt = $self->pmParseRuleConvertArgs($rule, @stdoptions); $self->lprint("if (\$self->testInt(\$text, $optxt)) {"); $self->pmParseRuleFinish($rule); } sub pmRuleKeyword { my ($self, $rule) = @_; my $optxt = $self->pmParseRuleConvertArgs($rule, 'String', @stdoptions); $self->lprint("if (\$self->testKeyword(\$text, $optxt)) {"); $self->pmParseRuleFinish($rule); } sub pmRuleLineContinue { my ($self, $rule) = @_; my $optxt = $self->pmParseRuleConvertArgs($rule, @stdoptions); $self->lprint("if (\$self->testLineContinue(\$text, $optxt)) {"); $self->pmParseRuleFinish($rule); } sub pmRuleRangeDetect { my ($self, $rule) = @_; my $optxt = $self->pmParseRuleConvertArgs($rule, qw/char char1 insensitive/, @stdoptions); $self->lprint("if (\$self->testRangeDetect(\$text, $optxt)) {"); $self->pmParseRuleFinish($rule); } sub pmRuleRegExpr { my ($self, $rule) = @_; my $optxt = $self->pmParseRuleConvertArgs($rule, qw/insensitive dynamic/, @stdoptions); my $string = $rule->{'String'}; my $minimal = $rule->{'minimal'}; unless (defined($minimal)) { $minimal = 0 } $minimal = $self->booleanize($minimal); my $reg = ''; if ($minimal) { my $lastchar = ''; while ($string ne '') { if ($string =~ s/^(\*|\+)//) { $reg = "$reg$1"; if ($lastchar ne "\\") { $reg = "$reg?"; } $lastchar = $1; } else { $string =~ s/^(.)//; $reg = "$reg$1"; $lastchar = $1; } } } else { $reg = $string; } $reg = $self->stringalize($reg); $self->lprint("if (\$self->testRegExpr(\$text, $reg, $optxt)) {"); $self->pmParseRuleFinish($rule); } sub pmRuleStringDetect { my ($self, $rule) = @_; my $optxt = $self->pmParseRuleConvertArgs($rule, qw/String insensitive dynamic/, @stdoptions); $self->lprint("if (\$self->testStringDetect(\$text, $optxt)) {"); $self->pmParseRuleFinish($rule); } sub policy { my $self = shift; if (@_) { $self->{'policy'} = shift; }; return $self->{'policy'}; } sub register { my ($self, $new) = @_; my $reg = $self->{'registered'}; my $k = new Syntax::Highlight::Engine::Kate::Convert::XMLData($new); if (defined($k)) { my $name = $k->language->{'name'}; if (exists $reg->{$name}) { $self->log("language $name already registered, aborting"); } else { $reg->{$name} = $k; my $cmd = $self->guiadd; &$cmd($name); return $name; } } else { $self->log("cannot load $new"); } return undef } sub registered { my $self = shift; my $reg = $self->{'registered'}; return sort {uc($a) cmp uc($b)} keys %$reg; } sub registryLoad { my $self = shift; unless (-e $regfile) { return }; my $dump = new XML::Dumper; my $h = $dump->xml2pl($regfile); foreach my $k (sort keys %$h) { my $n = $self->register($k); my $x = $self->xmldata($n); my $m = $h->{$k}; foreach my $l (keys %$m) { $x->metadata($l, $m->{$l}); } } } sub registrySave { my $self = shift; my @keys = $self->registered; my %h = (); foreach my $k (@keys) { my $x = $self->xmldata($k); $h{$x->filename} = $x->metadataBackup; } my $dump = new XML::Dumper; $dump->pl2xml(\%h, $regfile); } sub reportAdd { my ($self, $status, $rule, $msg) = @_; if ($self->verbose) { my $st = 'OK '; unless ($status) { $st = 'ERROR ' }; $self->lprint($st . $msg); } my $lang = $self->curlang; my $context = $self->curcontext; my $log = $self->reportdata; push @$log, [$status, $lang, $context, $rule, $msg]; } sub reportClear { my $self = shift; $self->reportdata([]); } sub reportdata { my $self = shift; if (@_) { $self->{'reportdata'} = shift; }; return $self->{'reportdata'}; } sub reportGenerate { my ($self, $status) = @_; unless (defined($status)) { $status = -1 }; my @pos = ('Fail', 'Pass'); my @items = (); my $l = $self->reportdata; if ($status ne -1) { foreach my $t (@$l) { if ($t->[0] eq $status) { push @items, $t; } } } else { @items = @$l } foreach my $i (@items) { my $txt = $pos[$i->[0]] . " "; $txt = $txt . $self->textLength($i->[1], 16); $txt = $txt . $self->textLength($i->[2], 30); $txt = $txt . $self->textLength($i->[3], 14); $self->lprint($txt . " : " . $i->[4]); } } #sub runtestLoad { # (my $self, $code) = @_; # my $sp = new Safe('MySafe'); # $sp->reval($code); # if ($@) { $self->log(%@) } # my $name = $self->moduleName($self->xmldata($curentry)->language->{'name'}); # my $mod = "MySafe::Syntax::Highlight::Engine::Kate::$name"; # $sp->share('&' . $mod . '::highlight'); # $sp->share('&' . $mod . '::reset'); # my $p; # eval ('$p = new ' . $mod); # if ($@) { $self->log(%@) } # if (defined($p)) { # $self->runtest($p) # } else { # $self->runtest(''); # } #} # sub runtest { my $self = shift; if (@_) { $self->{'runtest'} = shift; }; return $self->{'runtest'}; } sub stringalize { my ($self, $in) = @_; $in =~ s/\\/\\\\/g; $in =~ s/\'/\\'/g; # $in =~ s/\$/\\\$/g; $in = "'$in'"; return $in; } sub testContextItems { my $self = shift; my @test = sort keys %testopts; while (@_) { my $item = shift; my $type = $item->{'type'}; $self->lprint("testing rule $type"); $self->indentUp; if (exists $tests{$type}) { my $c = $tests{$type}; &$c($self, $item); } else { $self->reportType(0, $type, "rule type $type does NOT exist"); } if (exists $item->{'items'}) { my $i = $item->{'items'}; $self->lprint("testing sub rules"); $self->indentUp; $self->testContextItems(@$i); #recursive $self->indentDown; } $self->indentDown; } } sub testRuleOptions { my ($self, $item) = @_; my @test = sort keys %testopts; my $type = $item->{'type'}; my $result = 1; #test the options to the rule foreach my $t (@test) { my $o = $item->{$t}; if (defined($o)) { my $c = $testopts{$t}; if (&$c($o)) { $self->reportAdd(1, $type, "option '$t' with value '$o' is valid"); } else { $self->reportAdd(0, $type, "option '$t', value '$o' is NOT valid"); $result = 0; } } } #test if attribute points to something defined if (exists($item->{'attribute'})) { my $att = $item->{'attribute'}; if (exists $self->xmldata($self->curlang)->itemdata->{$att}) { $self->reportAdd(1, $type, "attribute '$att' is defined in itemdata"); } else { $self->reportAdd(0, $type, "attribute '$att' is NOT defined in itemdata"); $result = 0; } } #test if context points to something defined if (exists($item->{'context'})) { my $ctx = $item->{'context'}; if ($ctx eq '#stay') { $self->reportAdd(1, $type, "context '$ctx' recognized"); } elsif ($ctx =~ /^##(.+)/) { my $x = $self->xmldata($1); if (defined($1)) { $self->reportAdd(1, $type, "context '$ctx' refers to language '$1'"); } else { $self->reportAdd(0, $type, "context '$ctx' refers to undefined language '$1'"); $result = 0; } } elsif ($ctx =~ /^[#pop]+$/) { $self->reportAdd(1, $type, "context '$ctx' recognized"); } elsif (exists $self->xmldata($self->curlang)->contexts->{$ctx}) { $self->reportAdd(1, $type, "context '$ctx' is defined in contexts"); } else { $self->reportAdd(0, $type, "context '$ctx' is NOT defined in contexts"); $result = 0; } } return $result; } sub testRuleAnyChar { my ($self, $item) = @_; my $result = 1; unless ($self->testRuleOptions($item)) { $result = 0 }; return $result; } sub testRuleDetectChar { my ($self, $item) = @_; my $result = 1; unless ($self->testRuleOptions($item)) { $result = 0 }; return $result; } sub testRuleDetect2Chars { my ($self, $item) = @_; my $result = 1; unless ($self->testRuleOptions($item)) { $result = 0 }; return $result; } sub testRuleDetectIdentifier { my ($self, $item) = @_; my $result = 1; unless ($self->testRuleOptions($item)) { $result = 0 }; return $result; } sub testRuleDetectSpaces { my ($self, $item) = @_; my $result = 1; unless ($self->testRuleOptions($item)) { $result = 0 }; return $result; } sub testRuleFloat { my ($self, $item) = @_; my $result = 1; unless ($self->testRuleOptions($item)) { $result = 0 }; return $result; } sub testRuleHlCChar { my ($self, $item) = @_; my $result = 1; unless ($self->testRuleOptions($item)) { $result = 0 }; return $result; } sub testRuleHlCHex { my ($self, $item) = @_; my $result = 1; unless ($self->testRuleOptions($item)) { $result = 0 }; return $result; } sub testRuleHlCOct { my ($self, $item) = @_; my $result = 1; unless ($self->testRuleOptions($item)) { $result = 0 }; return $result; } sub testRuleHlCStringChar { my ($self, $item) = @_; my $result = 1; unless ($self->testRuleOptions($item)) { $result = 0 }; return $result; } sub testRuleIncludeRules { my ($self, $item) = @_; my $result = 1; unless ($self->testRuleOptions($item)) { $result = 0 }; return $result; } sub testRuleInt { my ($self, $item) = @_; my $result = 1; unless ($self->testRuleOptions($item)) { $result = 0 }; return $result; } sub testRuleKeyword { my ($self, $item) = @_; my $s = $item->{'String'}; my $l = $self->xmldata($self->curlang)->lists->{$s}; my $val = 0; if (defined($l) ) { $self->reportAdd(1, $item->{'type'}, "$s refers to an existing list"); $val = 1; } else { $self->reportAdd(0, $item->{'type'}, "$s does not refer to an existing list"); } return $val; } sub testRuleLineContinue { my ($self, $item) = @_; my $result = 1; unless ($self->testRuleOptions($item)) { $result = 0 }; return $result; } sub testRuleRangeDetect { my ($self, $item) = @_; my $result = 1; unless ($self->testRuleOptions($item)) { $result = 0 }; return $result; } sub testRuleRegExpr { my ($self, $item) = @_; my $s = $item->{'String'}; my $res = "regex test '$s'"; my $stub = "stubtext"; eval "\$stub =~ /\$s/"; my $val = 0; if ($@) { my $bck = $@; chomp $bck; $self->reportAdd(0, $item->{'type'}, "$res : $bck"); } else { $self->reportAdd(1, $item->{'type'}, $res); $val = 1; } # $self->lprint($res); return $val; } sub testRuleStringDetect { my ($self, $item) = @_; my $result = 1; unless ($self->testRuleOptions($item)) { $result = 0 }; return $result; } sub textLength { my ($cw, $txt, $length) = @_; while (length($txt) < $length) { $txt = $txt . " " } return $txt; } sub verbose { my $self = shift; if (@_) { $self->{'verbose'} = shift; }; return $self->{'verbose'}; } sub version { my $self = shift; if (@_) { $self->{'version'} = shift; }; return $self->{'version'}; } sub xmldata { my ($self, $lang) = @_; if (defined($lang)) { my $r = $self->{'registered'}; unless (exists $r->{$lang}) { return undef } return $r->{$lang} } else { $self->log("language not specified, cannot return xmldata object"); return undef; } } 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Convert::ToolKit - helper routines, especially for generating highlight definitions from Kate's originals. =head1 SYNOPSIS use Syntax::Highlight::Engine::Kate::Convert::ToolKit; $hlfile = "/some/path/some-lang.xml"; $toolkit = new Syntax::Highlight::Engine::Kate::Convert::ToolKit(); # $toolkit->outcmd = sub { ... }; # optionally redefine bare output $outfile = $toolkit->register($hlfile); $toolkit->pmGenerate($outfile); =head1 DESCRIPTION ToolKit module carries helper routines, notably conversion from native highlight definitions of Kate to the ones as used by L. For convenience, such conversion process is wrapped into provided L script. This module requires L and L which are not listed as dependencies of Syntax::Highlight::Engine::Kate. Syntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/SQL_MySQL.pm0000644000175000017500000003647613226470762026361 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'sql-mysql.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.08 #kate version 2.4 #kate author Shane Wright (me@shanewright.co.uk) #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::SQL_MySQL; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Comment' => 'Comment', 'Data Type' => 'DataType', 'Decimal' => 'DecVal', 'Float' => 'Float', 'Function' => 'Function', 'Identifier' => 'Others', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Operator' => 'Normal', 'Preprocessor' => 'Others', 'String' => 'String', 'String Char' => 'Char', 'Symbol' => 'Char', }); $self->listAdd('functions', 'ABS', 'ACOS', 'ADDDATE', 'AES_DECRYPT', 'AES_ENCRYPT', 'ASCII', 'ASIN', 'ATAN', 'ATAN2', 'AVG', 'BENCHMARK', 'BIN', 'BIT_AND', 'BIT_COUNT', 'BIT_LENGTH', 'BIT_OR', 'CAST', 'CEILING', 'CHAR', 'CHARACTER_LENGTH', 'CHAR_LENGTH', 'CONCAT', 'CONCAT_WS', 'CONNECTION_ID', 'CONV', 'CONVERT', 'COS', 'COT', 'COUNT', 'CURDATE', 'CURRENT_DATE', 'CURRENT_TIME', 'CURRENT_TIMESTAMP', 'CURTIME', 'DATABASE', 'DATE_ADD', 'DATE_FORMAT', 'DATE_SUB', 'DAYNAME', 'DAYOFMONTH', 'DAYOFWEEK', 'DAYOFYEAR', 'DECODE', 'DEGREES', 'DES_DECRYPT', 'DES_ENCRYPT', 'ELT', 'ENCODE', 'ENCRYPT', 'EXP', 'EXPORT_SET', 'EXTRACT', 'FIELD', 'FIND_IN_SET', 'FLOOR', 'FORMAT', 'FOUND_ROWS', 'FROM_DAYS', 'FROM_UNIXTIME', 'GET_LOCK', 'GREATEST', 'HEX', 'HOUR', 'INET_ATON', 'INET_NTOA', 'INSERT', 'INSTR', 'IS_FREE_LOCK', 'LAST_INSERT_ID', 'LCASE', 'LEAST', 'LEFT', 'LENGTH', 'LN', 'LOAD_FILE', 'LOCATE', 'LOG', 'LOG10', 'LOG2', 'LOWER', 'LPAD', 'LTRIM', 'MAKE_SET', 'MASTER_POS_WAIT', 'MAX', 'MD5', 'MID', 'MIN', 'MINUTE', 'MOD', 'MONTH', 'MONTHNAME', 'NOW', 'OCT', 'OCTET_LENGTH', 'ORD', 'PASSWORD', 'PERIOD_ADD', 'PERIOD_DIFF', 'PI', 'POSITION', 'POW', 'POWER', 'QUARTER', 'QUOTE', 'RADIANS', 'RAND', 'RELEASE_LOCK', 'REPEAT', 'REPLACE', 'REVERSE', 'RIGHT', 'ROUND', 'RPAD', 'RTRIM', 'SECOND', 'SEC_TO_TIME', 'SESSION_USER', 'SHA', 'SHA1', 'SIGN', 'SIN', 'SOUNDEX', 'SPACE', 'SQRT', 'STD', 'STDDEV', 'SUBDATE', 'SUBSTRING', 'SUBSTRING_INDEX', 'SUM', 'SYSDATE', 'SYSTEM_USER', 'TAN', 'TIME_FORMAT', 'TIME_TO_SEC', 'TO_DAYS', 'TRIM', 'TRUNCATE', 'UCASE', 'UNIX_TIMESTAMP', 'UPPER', 'USER', 'VERSION', 'WEEK', 'WEEKDAY', 'YEAR', 'YEARWEEK', ); $self->listAdd('keywords', 'ACCESS', 'ADD', 'ALL', 'ALTER', 'ANALYZE', 'AND', 'AS', 'ASC', 'AUTO_INCREMENT', 'BDB', 'BERKELEYDB', 'BETWEEN', 'BOTH', 'BY', 'CASCADE', 'CASE', 'CHANGE', 'COLUMN', 'COLUMNS', 'CONSTRAINT', 'CREATE', 'CROSS', 'CURRENT_DATE', 'CURRENT_TIME', 'CURRENT_TIMESTAMP', 'DATABASE', 'DATABASES', 'DAY_HOUR', 'DAY_MINUTE', 'DAY_SECOND', 'DEC', 'DEFAULT', 'DELAYED', 'DELETE', 'DESC', 'DESCRIBE', 'DISTINCT', 'DISTINCTROW', 'DROP', 'ELSE', 'ENCLOSED', 'ESCAPED', 'EXISTS', 'EXPLAIN', 'FIELDS', 'FOR', 'FOREIGN', 'FROM', 'FULLTEXT', 'FUNCTION', 'GRANT', 'GROUP', 'HAVING', 'HIGH_PRIORITY', 'IF', 'IGNORE', 'IN', 'INDEX', 'INFILE', 'INNER', 'INNODB', 'INSERT', 'INTERVAL', 'INTO', 'IS', 'JOIN', 'KEY', 'KEYS', 'KILL', 'LEADING', 'LEFT', 'LIKE', 'LIMIT', 'LINES', 'LOAD', 'LOCK', 'LOW_PRIORITY', 'MASTER_SERVER_ID', 'MATCH', 'MRG_MYISAM', 'NATURAL', 'NOT', 'NULL', 'NUMERIC', 'ON', 'OPTIMIZE', 'OPTION', 'OPTIONALLY', 'OR', 'ORDER', 'OUTER', 'OUTFILE', 'PARTIAL', 'PRECISION', 'PRIMARY', 'PRIVILEGES', 'PROCEDURE', 'PURGE', 'READ', 'REFERENCES', 'REGEXP', 'RENAME', 'REPLACE', 'REQUIRE', 'RESTRICT', 'RETURNS', 'REVOKE', 'RIGHT', 'RLIKE', 'SELECT', 'SET', 'SHOW', 'SONAME', 'SQL_BIG_RESULT', 'SQL_CALC_FOUND_ROWS', 'SQL_SMALL_RESULT', 'SSL', 'STARTING', 'STRAIGHT_JOIN', 'STRIPED', 'TABLE', 'TABLES', 'TERMINATED', 'THEN', 'TO', 'TRAILING', 'UNION', 'UNIQUE', 'UNLOCK', 'UNSIGNED', 'UPDATE', 'USAGE', 'USE', 'USER_RESOURCES', 'USING', 'VALUES', 'VARYING', 'WHEN', 'WHERE', 'WITH', 'WRITE', 'XOR', 'YEAR_MONTH', 'ZEROFILL', ); $self->listAdd('operators', '!=', '*', '**', '+', '-', '..', '/', ':=', '<', '<=', '<>', '=', '=>', '>', '>=', '^=', '||', '~=', ); $self->listAdd('types', 'BIGINT', 'BINARY', 'BLOB', 'CHAR', 'CHARACTER', 'DECIMAL', 'DOUBLE', 'FLOAT', 'HOUR_MINUTE', 'HOUR_SECOND', 'INT', 'INTEGER', 'LONG', 'LONGBLOB', 'LONGTEXT', 'MEDIUMBLOB', 'MEDIUMINT', 'MEDIUMTEXT', 'MIDDLEINT', 'MINUTE_SECOND', 'REAL', 'SMALLINT', 'TEXT', 'TINYBLOB', 'TINYINT', 'TINYTEXT', 'VARBINARY', 'VARCHAR', ); $self->contextdata({ 'Identifier' => { callback => \&parseIdentifier, attribute => 'Identifier', lineending => '#pop', }, 'MultiLineComment' => { callback => \&parseMultiLineComment, attribute => 'Comment', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'Preprocessor' => { callback => \&parsePreprocessor, attribute => 'Preprocessor', lineending => '#pop', }, 'SingleLineComment' => { callback => \&parseSingleLineComment, attribute => 'Comment', lineending => '#pop', }, 'String' => { callback => \&parseString, attribute => 'String', }, }); $self->deliminators('\\s||\\(|\\)|,|\\%|\\&|;|\\?|\\[|\\]|\\{|\\}|\\\\|\\+|-|\\*|\\/|\\||=|\\!|<|>|\\~|\\^|:|\\.'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'SQL (MySQL)'; } sub parseIdentifier { my ($self, $text) = @_; # attribute => 'Identifier' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Identifier')) { return 1 } return 0; }; sub parseMultiLineComment { my ($self, $text) = @_; # attribute => 'Comment' # context => '#pop' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#pop', 'Comment')) { return 1 } # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # endRegion => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'operators' # attribute => 'Operator' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'operators', 0, undef, 0, '#stay', 'Operator')) { return 1 } # String => 'functions' # attribute => 'Function' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) { return 1 } # String => 'types' # attribute => 'Data Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%bulk_exceptions\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%bulk_exceptions\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%bulk_rowcount\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%bulk_rowcount\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%found\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%found\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%isopen\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%isopen\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%notfound\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%notfound\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%rowcount\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%rowcount\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%rowtype\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%rowtype\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # String => '%type\b' # attribute => 'Data Type' # context => '#stay' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '%type\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) { return 1 } # attribute => 'Float' # context => '#stay' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { return 1 } # attribute => 'Decimal' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # attribute => 'String' # char => ''' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # attribute => 'Comment' # char => '#' # context => 'SingleLineComment' # type => 'DetectChar' if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'SingleLineComment', 'Comment')) { return 1 } # attribute => 'Comment' # char => '-' # char1 => '-' # context => 'SingleLineComment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, 'SingleLineComment', 'Comment')) { return 1 } # attribute => 'Comment' # beginRegion => 'Comment' # char => '/' # char1 => '*' # context => 'MultiLineComment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'MultiLineComment', 'Comment')) { return 1 } # String => 'rem\b' # attribute => 'Comment' # column => '0' # context => 'SingleLineComment' # insensitive => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, 'rem\\b', 1, 0, 0, 0, 0, 'SingleLineComment', 'Comment')) { return 1 } # attribute => 'Comment' # char => '"' # context => 'Identifier' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'Identifier', 'Comment')) { return 1 } # String => ':&' # attribute => 'Symbol' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, ':&', 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # String => '/$' # attribute => 'Symbol' # column => '0' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '/$', 0, 0, 0, 0, 0, '#stay', 'Symbol')) { return 1 } # String => '@@?[^@ \t\r\n]' # attribute => 'Preprocessor' # column => '0' # context => 'Preprocessor' # type => 'RegExpr' if ($self->testRegExpr($text, '@@?[^@ \\t\\r\\n]', 0, 0, 0, 0, 0, 'Preprocessor', 'Preprocessor')) { return 1 } return 0; }; sub parsePreprocessor { my ($self, $text) = @_; return 0; }; sub parseSingleLineComment { my ($self, $text) = @_; return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # context => '#pop' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#pop', 'String')) { return 1 } # attribute => 'String Char' # context => '#stay' # type => 'HlCStringChar' if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { return 1 } # attribute => 'Symbol' # char => '&' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '&', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # attribute => 'String' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::SQL_MySQL - a Plugin for SQL (MySQL) syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::SQL_MySQL; my $sh = new Syntax::Highlight::Engine::Kate::SQL_MySQL([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::SQL_MySQL is a plugin module that provides syntax highlighting for SQL (MySQL) to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/Xorg_Configuration.pm0000644000175000017500000001544413226470762030473 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'xorg.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.01 #kate author Jan Janssen (medhefgo@web.de) #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::Xorg_Configuration; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Alert' => 'Error', 'Comment' => 'Comment', 'Float' => 'Float', 'Int' => 'DecVal', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Section' => 'Function', 'Section Name' => 'String', 'Value' => 'DataType', 'Value2' => 'Others', }); $self->contextdata({ 'Comment' => { callback => \&parseComment, attribute => 'Comment', lineending => '#pop', }, 'Keyword' => { callback => \&parseKeyword, attribute => 'Keyword', lineending => '#pop', }, 'Section' => { callback => \&parseSection, attribute => 'Normal Text', }, 'Section Content' => { callback => \&parseSectionContent, attribute => 'Normal Text', }, 'xorg' => { callback => \&parsexorg, attribute => 'Normal Text', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('xorg'); $self->keywordscase(1); $self->initialize; bless ($self, $class); return $self; } sub language { return 'x.org Configuration'; } sub parseComment { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } return 0; }; sub parseKeyword { my ($self, $text) = @_; # attribute => 'Value' # char => '"' # char1 => '"' # type => 'RangeDetect' if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'Value')) { return 1 } # attribute => 'Value' # char => ''' # char1 => ''' # type => 'RangeDetect' if ($self->testRangeDetect($text, '\'', '\'', 0, 0, undef, 0, '#stay', 'Value')) { return 1 } # attribute => 'Float' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { return 1 } # attribute => 'Int' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Int')) { return 1 } # String => '[\w\d]+' # attribute => 'Value2' # type => 'RegExpr' if ($self->testRegExpr($text, '[\\w\\d]+', 0, 0, 0, undef, 0, '#stay', 'Value2')) { return 1 } # char => '#' # context => 'Comment' # type => 'DetectChar' if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'Comment', undef)) { return 1 } return 0; }; sub parseSection { my ($self, $text) = @_; # attribute => 'Section Name' # char => '"' # char1 => '"' # context => 'Section Content' # type => 'RangeDetect' if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, 'Section Content', 'Section Name')) { return 1 } # attribute => 'Section Name' # char => ''' # char1 => ''' # context => 'Section Content' # type => 'RangeDetect' if ($self->testRangeDetect($text, '\'', '\'', 0, 0, undef, 0, 'Section Content', 'Section Name')) { return 1 } # attribute => 'Alert' # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', 'Alert')) { return 1 } # char => '#' # context => 'Comment' # type => 'DetectChar' if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'Comment', undef)) { return 1 } return 0; }; sub parseSectionContent { my ($self, $text) = @_; # String => 'EndSection' # attribute => 'Section' # context => '#pop#pop' # endRegion => 'Section' # insensitive => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, 'EndSection', 1, 0, 0, undef, 0, '#pop#pop', 'Section')) { return 1 } # String => 'EndSubSection' # attribute => 'Section' # context => '#pop#pop' # endRegion => 'SubSection' # insensitive => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, 'EndSubSection', 1, 0, 0, undef, 0, '#pop#pop', 'Section')) { return 1 } # String => 'SubSection' # attribute => 'Section' # beginRegion => 'SubSection' # context => 'Section' # insensitive => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, 'SubSection', 1, 0, 0, undef, 0, 'Section', 'Section')) { return 1 } # String => '\b\w+\b' # context => 'Keyword' # type => 'RegExpr' if ($self->testRegExpr($text, '\\b\\w+\\b', 0, 0, 0, undef, 0, 'Keyword', undef)) { return 1 } # char => '#' # context => 'Comment' # type => 'DetectChar' if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'Comment', undef)) { return 1 } return 0; }; sub parsexorg { my ($self, $text) = @_; # String => 'Section' # attribute => 'Section' # beginRegion => 'Section' # context => 'Section' # insensitive => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, 'Section', 1, 0, 0, undef, 0, 'Section', 'Section')) { return 1 } # char => '#' # context => 'Comment' # type => 'DetectChar' if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'Comment', undef)) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::Xorg_Configuration - a Plugin for x.org Configuration syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::Xorg_Configuration; my $sh = new Syntax::Highlight::Engine::Kate::Xorg_Configuration([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::Xorg_Configuration is a plugin module that provides syntax highlighting for x.org Configuration to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/PicAsm.pm0000644000175000017500000004317113226470762026037 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'picsrc.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.07 #kate version 2.3 #kate author Alain GIBAUD (alain.gibaud@univ-valenciennes.fr) #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::PicAsm; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Alert' => 'Alert', 'Based Numbers' => 'BaseN', 'Char' => 'Char', 'Comment' => 'Comment', 'Directives' => 'Others', 'Error' => 'Error', 'GPASM-macros' => 'BString', 'InstructionAttr' => 'Operator', 'Instructions' => 'Keyword', 'Normal Text' => 'Normal', 'Prep. Lib' => 'Others', 'Preprocessor' => 'Others', 'String' => 'String', 'Symbol' => 'Variable', 'Unbased Numbers' => 'DecVal', }); $self->listAdd('conditional', 'else', 'endif', 'endw', 'idef', 'if', 'ifndef', 'include', 'while', '{', '}', ); $self->listAdd('directives', 'CBLOCK', 'CONSTANT', 'DA', 'DATA', 'DB', 'DE', 'DT', 'DW', 'END', 'ENDC', 'ENDM', 'EQU', 'ERROR', 'ERRORLEVEL', 'EXITM', 'FILL', 'LIST', 'LOCAL', 'MACRO', 'MESSG', 'NOEXPAND', 'NOLIST', 'ORG', 'PAGE', 'PROCESSOR', 'RADIX', 'RES', 'SET', 'SPACE', 'SUBTITLE', 'TITLE', 'VARIABLE', '__BADRAM', '__CONFIG', '__IDLOCS', '__MAXRAM', 'cblock', 'constant', 'da', 'data', 'db', 'de', 'dt', 'dw', 'end', 'endc', 'endm', 'equ', 'error', 'errorlevel', 'exitm', 'fill', 'list', 'local', 'macro', 'messg', 'noexpand', 'nolist', 'org', 'page', 'processor', 'radix', 'res', 'set', 'space', 'subtitle', 'title', 'variable', ); $self->listAdd('gpasm_macro', 'ADDCF', 'B', 'CLRC', 'CLRZ', 'MOVFW', 'SETC', 'SETZ', 'SKPC', 'SKPNC', 'SKPNZ', 'SKPZ', 'SUBCF', 'TSTF', 'addcf', 'b', 'clrc', 'clrz', 'movfw', 'setc', 'setz', 'skpc', 'skpnc', 'skpnz', 'skpz', 'subcf', 'tstf', ); $self->listAdd('instruction_attr', 'A', 'ACCESS', 'BANKED', 'F', 'W', ); $self->listAdd('instructions', 'ADDLW', 'ADDWF', 'ADDWFC', 'ANDLW', 'ANDWF', 'BC', 'BCF', 'BN', 'BNC', 'BNOV', 'BNZ', 'BOV', 'BRA', 'BSF', 'BTFSC', 'BTFSS', 'BTG', 'BZ', 'CALL', 'CLRF', 'CLRW', 'CLRWDT', 'COMF', 'CPFSEQ', 'CPFSGT', 'CPFSLT', 'DAW', 'DCFSNZ', 'DECF', 'DECFSZ', 'GOTO', 'INCF', 'INCFSZ', 'INFSNZ', 'IORLW', 'IORWF', 'LFSR', 'MOVF', 'MOVFF', 'MOVLB', 'MOVLW', 'MOVWF', 'MULLW', 'MULWF', 'NEGF', 'NOP', 'OPTION', 'POP', 'PUSH', 'RCALL', 'RESET', 'RETFIE', 'RETLW', 'RETURN', 'RLCF', 'RLF', 'RLNCF', 'RRCF', 'RRF', 'RRNCF', 'SETF', 'SLEEP', 'SUBFWB', 'SUBLW', 'SUBWF', 'SUBWFB', 'SWAPF', 'TBLRD', 'TBLWT', 'TSTFSZ', 'XORLW', 'XORWF', 'addlw', 'addwf', 'addwfc', 'andlw', 'andwf', 'bc', 'bcf', 'bn', 'bnc', 'bnov', 'bnz', 'bov', 'bra', 'bsf', 'btfsc', 'btfss', 'btg', 'bz', 'call', 'clrf', 'clrw', 'clrwdt', 'comf', 'cpfseq', 'cpfsgt', 'cpfslt', 'daw', 'dcfsnz', 'decf', 'decfsz', 'goto', 'incf', 'incfsz', 'infsnz', 'iorlw', 'iorwf', 'lfsr', 'movf', 'movff', 'movlb', 'movlw', 'movwf', 'mullw', 'mulwf', 'negf', 'nop', 'option', 'pop', 'push', 'rcall', 'reset', 'retfie', 'retlw', 'return', 'rlcf', 'rlf', 'rlncf', 'rrcf', 'rrf', 'rrncf', 'setf', 'sleep', 'subfwb', 'sublw', 'subwf', 'subwfb', 'swapf', 'tblrd', 'tblwt', 'tstfsz', 'xorlw', 'xorwf', ); $self->contextdata({ 'ASCIIChar' => { callback => \&parseASCIIChar, attribute => 'Char', lineending => '#pop', }, 'QuotedNumError' => { callback => \&parseQuotedNumError, attribute => 'Error', lineending => '#pop#pop', }, 'binaryDigits' => { callback => \&parsebinaryDigits, attribute => 'Based Numbers', lineending => '#pop', }, 'comment' => { callback => \&parsecomment, attribute => 'Comment', lineending => '#pop', }, 'decimalDigits' => { callback => \&parsedecimalDigits, attribute => 'Based Numbers', lineending => '#pop', }, 'hexDigits' => { callback => \&parsehexDigits, attribute => 'Based Numbers', lineending => '#pop', }, 'normal' => { callback => \&parsenormal, attribute => 'Normal Text', }, 'octDigits' => { callback => \&parseoctDigits, attribute => 'Based Numbers', lineending => '#pop', }, 'string' => { callback => \&parsestring, attribute => 'String', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'PicAsm'; } sub parseASCIIChar { my ($self, $text) = @_; # attribute => 'Char' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Char')) { return 1 } # String => '.[^']' # attribute => 'Error' # context => 'QuotedNumError' # type => 'RegExpr' if ($self->testRegExpr($text, '.[^\']', 0, 0, 0, undef, 0, 'QuotedNumError', 'Error')) { return 1 } return 0; }; sub parseQuotedNumError { my ($self, $text) = @_; # attribute => 'Error' # char => ''' # context => '#pop#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop#pop', 'Error')) { return 1 } return 0; }; sub parsebinaryDigits { my ($self, $text) = @_; # attribute => 'Based Numbers' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Based Numbers')) { return 1 } # String => '[^0-1]' # attribute => 'Error' # context => 'QuotedNumError' # type => 'RegExpr' if ($self->testRegExpr($text, '[^0-1]', 0, 0, 0, undef, 0, 'QuotedNumError', 'Error')) { return 1 } return 0; }; sub parsecomment { my ($self, $text) = @_; # String => '(INPUT|OUTPUT|PARAMETERS|AUTHOR|EMAIL)' # attribute => 'Instructions' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(INPUT|OUTPUT|PARAMETERS|AUTHOR|EMAIL)', 0, 0, 0, undef, 0, '#stay', 'Instructions')) { return 1 } # String => '(FIXME|TODO)' # attribute => 'Alert' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) { return 1 } return 0; }; sub parsedecimalDigits { my ($self, $text) = @_; # attribute => 'Based Numbers' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Based Numbers')) { return 1 } # String => '\D' # attribute => 'Error' # context => 'QuotedNumError' # type => 'RegExpr' if ($self->testRegExpr($text, '\\D', 0, 0, 0, undef, 0, 'QuotedNumError', 'Error')) { return 1 } return 0; }; sub parsehexDigits { my ($self, $text) = @_; # attribute => 'Based Numbers' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Based Numbers')) { return 1 } # String => '[^0-9A-Fa-f]' # attribute => 'Error' # context => 'QuotedNumError' # type => 'RegExpr' if ($self->testRegExpr($text, '[^0-9A-Fa-f]', 0, 0, 0, undef, 0, 'QuotedNumError', 'Error')) { return 1 } return 0; }; sub parsenormal { my ($self, $text) = @_; # String => 'directives' # attribute => 'Directives' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'directives', 0, undef, 0, '#stay', 'Directives')) { return 1 } # String => 'instructions' # attribute => 'Instructions' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'instructions', 0, undef, 0, '#stay', 'Instructions')) { return 1 } # String => 'instruction_attr' # attribute => 'InstructionAttr' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'instruction_attr', 0, undef, 0, '#stay', 'InstructionAttr')) { return 1 } # String => 'conditional' # attribute => 'Preprocessor' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'conditional', 0, undef, 0, '#stay', 'Preprocessor')) { return 1 } # String => 'gpasm_macro' # attribute => 'GPASM-macros' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'gpasm_macro', 0, undef, 0, '#stay', 'GPASM-macros')) { return 1 } # attribute => 'Based Numbers' # context => '#stay' # type => 'HlCHex' if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Based Numbers')) { return 1 } # String => '([ \t,][0-9A-F]+H[ \t,])' # attribute => 'Based Numbers' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '([ \\t,][0-9A-F]+H[ \\t,])', 1, 0, 0, undef, 0, '#stay', 'Based Numbers')) { return 1 } # String => '([ \t,][0-9A-F]+H)$' # attribute => 'Based Numbers' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '([ \\t,][0-9A-F]+H)$', 1, 0, 0, undef, 0, '#stay', 'Based Numbers')) { return 1 } # String => '([ \t,][0-9]+D)' # attribute => 'Based Numbers' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '([ \\t,][0-9]+D)', 1, 0, 0, undef, 0, '#stay', 'Based Numbers')) { return 1 } # String => '([ \t,][0-7]+O)' # attribute => 'Based Numbers' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '([ \\t,][0-7]+O)', 1, 0, 0, undef, 0, '#stay', 'Based Numbers')) { return 1 } # String => '([ \t,][0-1]+B)' # attribute => 'Based Numbers' # context => '#stay' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, '([ \\t,][0-1]+B)', 1, 0, 0, undef, 0, '#stay', 'Based Numbers')) { return 1 } # attribute => 'Unbased Numbers' # context => '#stay' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Unbased Numbers')) { return 1 } # attribute => 'Char' # context => '#stay' # type => 'HlCChar' if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'Char' # char => 'A' # char1 => ''' # context => 'ASCIIChar' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, 'A', '\'', 0, 0, 0, undef, 0, 'ASCIIChar', 'Char')) { return 1 } # attribute => 'Char' # char => 'a' # char1 => ''' # context => 'ASCIIChar' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, 'a', '\'', 0, 0, 0, undef, 0, 'ASCIIChar', 'Char')) { return 1 } # attribute => 'Based Numbers' # char => 'B' # char1 => ''' # context => 'binaryDigits' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, 'B', '\'', 0, 0, 0, undef, 0, 'binaryDigits', 'Based Numbers')) { return 1 } # attribute => 'Based Numbers' # char => 'b' # char1 => ''' # context => 'binaryDigits' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, 'b', '\'', 0, 0, 0, undef, 0, 'binaryDigits', 'Based Numbers')) { return 1 } # attribute => 'Based Numbers' # char => 'H' # char1 => ''' # context => 'hexDigits' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, 'H', '\'', 0, 0, 0, undef, 0, 'hexDigits', 'Based Numbers')) { return 1 } # attribute => 'Based Numbers' # char => 'h' # char1 => ''' # context => 'hexDigits' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, 'h', '\'', 0, 0, 0, undef, 0, 'hexDigits', 'Based Numbers')) { return 1 } # attribute => 'Based Numbers' # char => 'O' # char1 => ''' # context => 'octDigits' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, 'O', '\'', 0, 0, 0, undef, 0, 'octDigits', 'Based Numbers')) { return 1 } # attribute => 'Based Numbers' # char => 'o' # char1 => ''' # context => 'octDigits' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, 'o', '\'', 0, 0, 0, undef, 0, 'octDigits', 'Based Numbers')) { return 1 } # attribute => 'Based Numbers' # char => 'D' # char1 => ''' # context => 'decimalDigits' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, 'D', '\'', 0, 0, 0, undef, 0, 'decimalDigits', 'Based Numbers')) { return 1 } # attribute => 'Based Numbers' # char => 'd' # char1 => ''' # context => 'decimalDigits' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, 'd', '\'', 0, 0, 0, undef, 0, 'decimalDigits', 'Based Numbers')) { return 1 } # attribute => 'String' # char => '"' # context => 'string' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'String')) { return 1 } # attribute => 'Comment' # char => ';' # context => 'comment' # type => 'DetectChar' if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, 'comment', 'Comment')) { return 1 } # String => '-/*%+=><&|^!~' # attribute => 'Symbol' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, '-/*%+=><&|^!~', 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # String => '#define' # attribute => 'Preprocessor' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '#define', 0, 0, 0, undef, 0, '#stay', 'Preprocessor')) { return 1 } # String => '#undefine' # attribute => 'Preprocessor' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '#undefine', 0, 0, 0, undef, 0, '#stay', 'Preprocessor')) { return 1 } # String => '#v' # attribute => 'Preprocessor' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, '#v', 0, 0, 0, undef, 0, '#stay', 'Preprocessor')) { return 1 } return 0; }; sub parseoctDigits { my ($self, $text) = @_; # attribute => 'Based Numbers' # char => ''' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Based Numbers')) { return 1 } # String => '[^0-7]' # attribute => 'Error' # context => 'QuotedNumError' # type => 'RegExpr' if ($self->testRegExpr($text, '[^0-7]', 0, 0, 0, undef, 0, 'QuotedNumError', 'Error')) { return 1 } return 0; }; sub parsestring { my ($self, $text) = @_; # attribute => 'String' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) { return 1 } # attribute => 'Char' # context => '#stay' # type => 'HlCStringChar' if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::PicAsm - a Plugin for PicAsm syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::PicAsm; my $sh = new Syntax::Highlight::Engine::Kate::PicAsm([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::PicAsm is a plugin module that provides syntax highlighting for PicAsm to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/C.pm0000644000175000017500000004242113226470762025042 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'c.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.25 #kate version 2.4 #generated: Sun Feb 3 22:02:04 2008, localtime package Syntax::Highlight::Engine::Kate::C; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Alert' => 'Alert', 'Char' => 'Char', 'Comment' => 'Comment', 'Data Type' => 'DataType', 'Decimal' => 'DecVal', 'Float' => 'Float', 'Hex' => 'BaseN', 'Keyword' => 'Keyword', 'Normal Text' => 'Normal', 'Octal' => 'BaseN', 'Prep. Lib' => 'Others', 'Preprocessor' => 'Others', 'Region Marker' => 'RegionMarker', 'String' => 'String', 'String Char' => 'Char', 'Symbol' => 'Normal', }); $self->listAdd('keywords', 'break', 'case', 'continue', 'default', 'do', 'else', 'enum', 'extern', 'for', 'goto', 'if', 'inline', 'return', 'sizeof', 'struct', 'switch', 'typedef', 'union', 'while', ); $self->listAdd('types', '_Bool', '_Complex', '_Imaginary', 'auto', 'char', 'const', 'double', 'float', 'int', 'long', 'register', 'restrict', 'short', 'signed', 'static', 'unsigned', 'void', 'volatile', ); $self->contextdata({ 'Commentar 1' => { callback => \&parseCommentar1, attribute => 'Comment', lineending => '#pop', }, 'Commentar 2' => { callback => \&parseCommentar2, attribute => 'Comment', }, 'Commentar/Preprocessor' => { callback => \&parseCommentarPreprocessor, attribute => 'Comment', }, 'Define' => { callback => \&parseDefine, attribute => 'Preprocessor', lineending => '#pop', }, 'Normal' => { callback => \&parseNormal, attribute => 'Normal Text', }, 'Outscoped' => { callback => \&parseOutscoped, attribute => 'Comment', }, 'Outscoped intern' => { callback => \&parseOutscopedintern, attribute => 'Comment', }, 'Preprocessor' => { callback => \&parsePreprocessor, attribute => 'Preprocessor', lineending => '#pop', }, 'Region Marker' => { callback => \&parseRegionMarker, attribute => 'Region Marker', lineending => '#pop', }, 'String' => { callback => \&parseString, attribute => 'String', lineending => '#pop', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'C'; } sub parseCommentar1 { my ($self, $text) = @_; # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } return 0; }; sub parseCommentar2 { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # endRegion => 'Comment' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } return 0; }; sub parseCommentarPreprocessor { my ($self, $text) = @_; # attribute => 'Comment' # char => '*' # char1 => '/' # context => '#pop' # endRegion => 'Comment2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseDefine { my ($self, $text) = @_; # attribute => 'Preprocessor' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Preprocessor')) { return 1 } return 0; }; sub parseNormal { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # String => '#\s*if\s+0' # attribute => 'Preprocessor' # beginRegion => 'Outscoped' # context => 'Outscoped' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*if\\s+0', 0, 0, 0, undef, 1, 'Outscoped', 'Preprocessor')) { return 1 } # attribute => 'Preprocessor' # char => '#' # context => 'Preprocessor' # firstNonSpace => 'true' # type => 'DetectChar' if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 1, 'Preprocessor', 'Preprocessor')) { return 1 } # String => '//BEGIN' # attribute => 'Region Marker' # beginRegion => 'Region1' # context => 'Region Marker' # firstNonSpace => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, '//BEGIN', 0, 0, 0, undef, 1, 'Region Marker', 'Region Marker')) { return 1 } # String => '//END' # attribute => 'Region Marker' # context => 'Region Marker' # endRegion => 'Region1' # firstNonSpace => 'true' # type => 'StringDetect' if ($self->testStringDetect($text, '//END', 0, 0, 0, undef, 1, 'Region Marker', 'Region Marker')) { return 1 } # String => 'keywords' # attribute => 'Keyword' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { return 1 } # String => 'types' # attribute => 'Data Type' # context => '#stay' # type => 'keyword' if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'Symbol' # beginRegion => 'Brace1' # char => '{' # context => '#stay' # type => 'DetectChar' if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # attribute => 'Symbol' # char => '}' # context => '#stay' # endRegion => 'Brace1' # type => 'DetectChar' if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } # attribute => 'Float' # context => '#stay' # items => 'ARRAY(0x12df8b0)' # type => 'Float' if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { # String => 'fF' # attribute => 'Float' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, 'fF', 0, 0, undef, 0, '#stay', 'Float')) { return 1 } } # attribute => 'Octal' # context => '#stay' # type => 'HlCOct' if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) { return 1 } # attribute => 'Hex' # context => '#stay' # type => 'HlCHex' if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) { return 1 } # attribute => 'Decimal' # context => '#stay' # items => 'ARRAY(0x12207d0)' # type => 'Int' if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { # String => 'ULL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'ULL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LUL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LUL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LLU' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LLU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'UL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'UL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LU' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'LL' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'LL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'U' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'U', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } # String => 'L' # attribute => 'Decimal' # context => '#stay' # insensitive => 'TRUE' # type => 'StringDetect' if ($self->testStringDetect($text, 'L', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { return 1 } } # attribute => 'Char' # context => '#stay' # type => 'HlCChar' if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # context => '##Doxygen' # type => 'IncludeRules' if ($self->includePlugin('Doxygen', $text)) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Commentar 1' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) { return 1 } # attribute => 'Comment' # beginRegion => 'Comment' # char => '/' # char1 => '*' # context => 'Commentar 2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) { return 1 } # String => ':!%&()+,-/.*<=>?[]|~^;' # attribute => 'Symbol' # context => '#stay' # type => 'AnyChar' if ($self->testAnyChar($text, ':!%&()+,-/.*<=>?[]|~^;', 0, 0, undef, 0, '#stay', 'Symbol')) { return 1 } return 0; }; sub parseOutscoped { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # context => '##Doxygen' # type => 'IncludeRules' if ($self->includePlugin('Doxygen', $text)) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Commentar 1' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) { return 1 } # attribute => 'Comment' # beginRegion => 'Comment' # char => '/' # char1 => '*' # context => 'Commentar 2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) { return 1 } # String => '#\s*if' # attribute => 'Comment' # beginRegion => 'Outscoped' # context => 'Outscoped intern' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*if', 0, 0, 0, undef, 1, 'Outscoped intern', 'Comment')) { return 1 } # String => '#\s*(endif|else|elif)' # attribute => 'Preprocessor' # context => '#pop' # endRegion => 'Outscoped' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*(endif|else|elif)', 0, 0, 0, undef, 1, '#pop', 'Preprocessor')) { return 1 } return 0; }; sub parseOutscopedintern { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # attribute => 'String' # char => '"' # context => 'String' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { return 1 } # context => '##Doxygen' # type => 'IncludeRules' if ($self->includePlugin('Doxygen', $text)) { return 1 } # attribute => 'Comment' # char => '/' # char1 => '/' # context => 'Commentar 1' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) { return 1 } # attribute => 'Comment' # beginRegion => 'Comment' # char => '/' # char1 => '*' # context => 'Commentar 2' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) { return 1 } # String => '#\s*if' # attribute => 'Comment' # beginRegion => 'Outscoped' # context => 'Outscoped intern' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*if', 0, 0, 0, undef, 1, 'Outscoped intern', 'Comment')) { return 1 } # String => '#\s*endif' # attribute => 'Comment' # context => '#pop' # endRegion => 'Outscoped' # firstNonSpace => 'true' # type => 'RegExpr' if ($self->testRegExpr($text, '#\\s*endif', 0, 0, 0, undef, 1, '#pop', 'Comment')) { return 1 } return 0; }; sub parsePreprocessor { my ($self, $text) = @_; # attribute => 'Preprocessor' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Preprocessor')) { return 1 } # String => 'define.*((?=\\))' # attribute => 'Preprocessor' # context => 'Define' # type => 'RegExpr' if ($self->testRegExpr($text, 'define.*((?=\\\\))', 0, 0, 0, undef, 0, 'Define', 'Preprocessor')) { return 1 } # String => 'define.*' # attribute => 'Preprocessor' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, 'define.*', 0, 0, 0, undef, 0, '#stay', 'Preprocessor')) { return 1 } # attribute => 'Prep. Lib' # char => '"' # char1 => '"' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'Prep. Lib')) { return 1 } # attribute => 'Prep. Lib' # char => '<' # char1 => '>' # context => '#stay' # type => 'RangeDetect' if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'Prep. Lib')) { return 1 } # context => '##Doxygen' # type => 'IncludeRules' if ($self->includePlugin('Doxygen', $text)) { return 1 } # attribute => 'Comment' # beginRegion => 'Comment2' # char => '/' # char1 => '*' # context => 'Commentar/Preprocessor' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar/Preprocessor', 'Comment')) { return 1 } return 0; }; sub parseRegionMarker { my ($self, $text) = @_; return 0; }; sub parseString { my ($self, $text) = @_; # attribute => 'String' # context => '#stay' # type => 'LineContinue' if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) { return 1 } # attribute => 'String Char' # context => '#stay' # type => 'HlCStringChar' if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { return 1 } # attribute => 'String' # char => '"' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { return 1 } return 0; }; 1; __END__ =head1 NAME Syntax::Highlight::Engine::Kate::C - a Plugin for C syntax highlighting =head1 SYNOPSIS require Syntax::Highlight::Engine::Kate::C; my $sh = new Syntax::Highlight::Engine::Kate::C([ ]); =head1 DESCRIPTION Syntax::Highlight::Engine::Kate::C is a plugin module that provides syntax highlighting for C to the Syntax::Haghlight::Engine::Kate highlighting engine. This code is generated from the syntax definition files used by the Kate project. It works quite fine, but can use refinement and optimization. It inherits Syntax::Higlight::Engine::Kate::Template. See also there. =head1 AUTHOR Hans Jeuken (haje toneel demon nl) =head1 BUGS Unknown. If you find any, please contact the authorSyntax-Highlight-Engine-Kate-0.14/lib/Syntax/Highlight/Engine/Kate/HTML.pm0000644000175000017500000006035113226470762025426 0ustar manwarmanwar# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'html.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.98 #kate version 2.4 #kate author Wilbert Berendsen (wilbert@kde.nl) #generated: Sun Feb 3 22:02:05 2008, localtime package Syntax::Highlight::Engine::Kate::HTML; our $VERSION = '0.14'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Attribute' => 'Others', 'CDATA' => 'BaseN', 'Comment' => 'Comment', 'Doctype' => 'DataType', 'Element' => 'Keyword', 'EntityRef' => 'DecVal', 'Error' => 'Error', 'Normal Text' => 'Normal', 'PEntityRef' => 'DecVal', 'Processing Instruction' => 'Keyword', 'Value' => 'String', }); $self->contextdata({ 'CDATA' => { callback => \&parseCDATA, attribute => 'Normal Text', }, 'CSS' => { callback => \&parseCSS, attribute => 'Normal Text', }, 'CSS content' => { callback => \&parseCSScontent, attribute => 'Normal Text', }, 'Comment' => { callback => \&parseComment, attribute => 'Comment', }, 'Doctype' => { callback => \&parseDoctype, attribute => 'Normal Text', }, 'Doctype Internal Subset' => { callback => \&parseDoctypeInternalSubset, attribute => 'Normal Text', }, 'Doctype Markupdecl' => { callback => \&parseDoctypeMarkupdecl, attribute => 'Normal Text', }, 'Doctype Markupdecl DQ' => { callback => \&parseDoctypeMarkupdeclDQ, attribute => 'Value', }, 'Doctype Markupdecl SQ' => { callback => \&parseDoctypeMarkupdeclSQ, attribute => 'Value', }, 'El Close' => { callback => \&parseElClose, attribute => 'Normal Text', }, 'El Close 2' => { callback => \&parseElClose2, attribute => 'Normal Text', }, 'El Close 3' => { callback => \&parseElClose3, attribute => 'Normal Text', }, 'El Open' => { callback => \&parseElOpen, attribute => 'Normal Text', }, 'FindAttributes' => { callback => \&parseFindAttributes, attribute => 'Normal Text', }, 'FindDTDRules' => { callback => \&parseFindDTDRules, attribute => 'Normal Text', }, 'FindEntityRefs' => { callback => \&parseFindEntityRefs, attribute => 'Normal Text', }, 'FindHTML' => { callback => \&parseFindHTML, attribute => 'Normal Text', }, 'FindPEntityRefs' => { callback => \&parseFindPEntityRefs, attribute => 'Normal Text', }, 'JS' => { callback => \&parseJS, attribute => 'Normal Text', }, 'JS comment close' => { callback => \&parseJScommentclose, attribute => 'Comment', lineending => '#pop', }, 'JS content' => { callback => \&parseJScontent, attribute => 'Normal Text', }, 'PI' => { callback => \&parsePI, attribute => 'Normal Text', }, 'Start' => { callback => \&parseStart, attribute => 'Normal Text', }, 'Value' => { callback => \&parseValue, attribute => 'Normal Text', fallthrough => 'Value NQ', }, 'Value DQ' => { callback => \&parseValueDQ, attribute => 'Value', }, 'Value NQ' => { callback => \&parseValueNQ, attribute => 'Normal Text', lineending => '#pop#pop', fallthrough => '#pop#pop', }, 'Value SQ' => { callback => \&parseValueSQ, attribute => 'Value', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Start'); $self->keywordscase(1); $self->initialize; bless ($self, $class); return $self; } sub language { return 'HTML'; } sub parseCDATA { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # String => ']]>' # attribute => 'CDATA' # context => '#pop' # endRegion => 'cdata' # type => 'StringDetect' if ($self->testStringDetect($text, ']]>', 0, 0, 0, undef, 0, '#pop', 'CDATA')) { return 1 } # String => ']]>' # attribute => 'EntityRef' # context => '#stay' # type => 'StringDetect' if ($self->testStringDetect($text, ']]>', 0, 0, 0, undef, 0, '#stay', 'EntityRef')) { return 1 } return 0; }; sub parseCSS { my ($self, $text) = @_; # attribute => 'Element' # char => '/' # char1 => '>' # context => '#pop' # endRegion => 'style' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '>', 0, 0, 0, undef, 0, '#pop', 'Element')) { return 1 } # attribute => 'Element' # char => '>' # context => 'CSS content' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, 'CSS content', 'Element')) { return 1 } # context => 'FindAttributes' # type => 'IncludeRules' if ($self->includeRules('FindAttributes', $text)) { return 1 } # String => '\S' # attribute => 'Error' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#stay', 'Error')) { return 1 } return 0; }; sub parseCSScontent { my ($self, $text) = @_; # String => ' 'Element' # context => 'El Close 2' # endRegion => 'style' # insensitive => 'TRUE' # type => 'RegExpr' if ($self->testRegExpr($text, ' '##CSS' # includeAttrib => 'true' # type => 'IncludeRules' if ($self->includePlugin('CSS', $text)) { return 1 } return 0; }; sub parseComment { my ($self, $text) = @_; # type => 'DetectSpaces' if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # context => '##Alerts' # type => 'IncludeRules' if ($self->includePlugin('Alerts', $text)) { return 1 } # type => 'DetectIdentifier' if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # String => '-->' # attribute => 'Comment' # context => '#pop' # endRegion => 'comment' # type => 'StringDetect' if ($self->testStringDetect($text, '-->', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } # String => '-(-(?!->))+' # attribute => 'Error' # context => '#stay' # type => 'RegExpr' if ($self->testRegExpr($text, '-(-(?!->))+', 0, 0, 0, undef, 0, '#stay', 'Error')) { return 1 } return 0; }; sub parseDoctype { my ($self, $text) = @_; # attribute => 'Doctype' # char => '>' # context => '#pop' # endRegion => 'doctype' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'Doctype')) { return 1 } # attribute => 'Doctype' # beginRegion => 'int_subset' # char => '[' # context => 'Doctype Internal Subset' # type => 'DetectChar' if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'Doctype Internal Subset', 'Doctype')) { return 1 } return 0; }; sub parseDoctypeInternalSubset { my ($self, $text) = @_; # attribute => 'Doctype' # char => ']' # context => '#pop' # endRegion => 'int_subset' # type => 'DetectChar' if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Doctype')) { return 1 } # context => 'FindDTDRules' # type => 'IncludeRules' if ($self->includeRules('FindDTDRules', $text)) { return 1 } # String => ' <%-- The top label table. --%>
The following parameters were detected:
<%-- Display the parameters which might have been passed in. --%> <%-- Label; Actual Parameter String; Value Detected --%> <%-- Label; Actual Parameter String; Value Detected --%> <%-- Label; Actual Parameter String; Value Detected --%> <%-- Label; Actual Parameter String; Value Detected --%> <%-- Label; Actual Parameter String; Value Detected --%>
PARAMETER_1 <%=PARAMETER_1%> "<%=parm1%>"
PARAMETER_2 <%=PARAMETER_2%> "<%=parm2%>"
PARAMETER_3 <%=PARAMETER_3%> "<%=parm3%>"
PARAMETER_4 <%=PARAMETER_4%> "<%=parm4%>"
PARAMETER_5 <%=PARAMETER_5%> "<%=parm5%>"


<%-- Display our list of random Integers (shows code folding). --%> <% if (intList != null && intList.size() > 0) { %> <% Iterator intListIt = intList.iterator(); while (intListIt.hasNext()) { Integer i = (Integer) intListIt.next(); %> <% } } else { %> <% } %>
Here are the elements of intList...
<%=i.toString()%>
Oooops, we forgot to initialize intList!


<%-- We can call javascript functions. --%>
Test our javascript...


<%-- If we actually had defined a tag library. --%>


<%-- Expression language. --%>
myParam's value: ""
<%! /* A place for class variables and functions... */ // Define some sample parameter names that this page might understand. private static final String PARAMETER_1 = "p1"; private static final String PARAMETER_2 = "p2"; private static final String PARAMETER_3 = "p3"; private static final String PARAMETER_4 = "p4"; private static final String PARAMETER_5 = "p5"; // Returns str trimmed, or an empty string if str is null. private static String noNull(String str) { String retStr; if (str == null) retStr = ""; else retStr = str.trim(); return retStr; } // Returns a list of Integers with listSize elements. private static List getIntList(int listSize) { ArrayList retList = new ArrayList(listSize); for (int i = 0; i < listSize; i++) retList.add(new Integer( (int) (Math.random() * 100) )); return retList; } %>Syntax-Highlight-Engine-Kate-0.14/samples/highlight.tex0000644000175000017500000000212413032300413022373 0ustar manwarmanwar% LaTeX test file for kate's syntax highlighting and code folding \ordinaryLaTeXcommandwithoption[10pt,a4paper]{article} % BEGIN region %comment, this is all ok % $ \%no comments please \\%comment % END of region \newcommand{\nohighlighting} \section{normal} \ref{blue} \pageref{blue} \cite{blue} \begin{environmentshavespecialcolors} normal \end{environmentshavespecialcolors} $equations are green, \commands somewhat darker$ normal $$equations are green, \commands somewhat darker$$ normal \( \frac{1}{2} \begin{test} \end{test} \) normal \[ %comment displaymath \] normal \begin{equation} green\darkergreen \begin{test} \test \end{test} \end{equation} \begin{equation*} green\darkergreen %comment \begin{test} \test \end{test} \%no comment \end{equation*} \{ %this should be comment \verb%this shouldn't be%and this should be normal text \begin{verbatim} text inside a verbatim environment is also treated special $ %, you can even put a \begin{verbatim} inside \end{verbatim} normal \begin{Verbatim} &@@#^%&^#$ \end{Verbatim} \begin{Verbatim*} @*&^#@*(^#(*@& \end{Verbatim*} normalSyntax-Highlight-Engine-Kate-0.14/samples/highlight.asm0000644000175000017500000001476413032300413022370 0ustar manwarmanwar; ; Decodeur de trame pulsadis EJP et préavis EJP ; (pic 12C508 ou 509) ; Alain Gibaud, 20-2-2001 ; ; ======================================================== list r=hex,p=p12c508 include "p12c508.inc" GP0 equ 0 GP1 equ 1 GP2 equ 2 GP3 equ 3 GP4 equ 4 GP5 equ 5 TO equ 4 ; masques pour acceder aux pattes GP0bit equ 1 << GP0 GP1bit equ 1 << GP1 GP2bit equ 1 << GP2 GP3bit equ 1 << GP3 GP4bit equ 1 << GP4 GP5bit equ 1 << GP5 ; ======================================================== ; affectation des pattes ; ; sorties: (actives niv bas) NORMAL equ GP0 ; LED verte ALERTE equ GP1 ; LED orange EJP equ GP2 ; LED rouge ; entrees:( actives niv bas) SIGNAL equ GP3 ; avec pull-up, en provenance filtre 175 Hz ; GP4-5 sont utilisees par l'horloge ; ======================================================== ; variables: TICKS equ 0x7 ; compteur de ticks (1 tick = 2/100 s) SLOT equ 0x8 ; numero slot dans la trame ; ======================================================= ; Macros pour alleger le code ... ; ; Teste si min <= (var) < max ; branche en "in" si oui, en "out" si non. ; Lminmax macro var,min,max,outm,in,outp movlw min subwf var,W ; (var) - min btfss STATUS,C goto outm ; C=0 => resutat < 0 => var < min movlw max subwf var,W ; (var) - max btfss STATUS,C goto in goto outp ; C=1 => resutat >= 0 => var >= min endm ; ; Attend que le bit "bit" du registre "reg" soit a 1 ; Waitbit1 macro reg,bit local Wait1 Wait1 btfss reg,bit goto Wait1 endm ; ; Attend que le bit "bit" du registre "reg" soit a 0 ; Waitbit0 macro reg,bit local Wait0 Wait0 btfsc reg,bit goto Wait0 endm ; ; Branche en "label" si (reg) == num, sinon continue ; Beq macro label,reg,num movlw num subwf reg,W btfsc STATUS,Z goto label endm ; ; Branche en "label" si (reg) != num, sinon continue ; Bne macro label,reg,num movlw num subwf reg,W btfss STATUS,Z goto label endm ; ; Branche en "label" si (reg) < num, sinon continue ; Blt macro label,reg,num movlw num subwf reg,W ; reg - W btfss STATUS,C goto label ; C=0 => reg - W < 0 endm ; ; Branche en "label" si (reg) >= num, sinon continue ; Bge macro label,reg,num movlw num subwf reg,W ; reg - W btfsc STATUS,C goto label ; C=1 => reg - W >= 0 endm ; ======================================================== ; CONFIG word ( en FFF ) ; bits 11:5 don't care ; bit 4 : MCLRE enabled = 1, tied to Vdd = 0 ; bit 3 : code protection off = 1, on = 0 ; bit 2 : no watchdog = 0, watchdog = 1 ; bit 1-0 ; EXTRC = 00, INTRC = 10, XT = 01, LP = 00 __CONFIG B'000000001101' ; (horloge a quartz, avec watchdog) ; ======================================================== org 0 goto debut ;========================================================= ; sous-programmes ; ======================================================== ; regarde si le timer est passe a 0 ; si oui, le compteur de ticks est incremente ; et on attend le repassage a 1 ; Cette routine DOIT etre appelee tout les 2/100 s ou plus souvent tickcount clrwdt movf TMR0,W btfss STATUS,Z retlw 0 incf TICKS,F ; attendre que le timer ait depasse 0 waitnoZ clrwdt movf TMR0,W btfsc STATUS,Z goto waitnoZ retlw 0 ; ; les 2 fct qui suivent maintiennent, le compteur de ticks ; (en plus de scruter une patte) ; attente d'un signal (logique negative) waitsignal call tickcount btfsc GPIO,SIGNAL goto waitsignal retlw 0 ; attente fin signal waitnosignal call tickcount btfss GPIO,SIGNAL goto waitnosignal retlw 0 ; remet a zero le compteur de ticks et le timer et le watchdog clearticks clrwdt clrw movwf TICKS movwf TMR0 ; pour eviter un timeout immediat, le timer est charge ; a 1, et le 1er tick ne fait que 0.019922s au lieu de 0.2s ; (ce n'est pas grave dans la mesure ou de toute facon, ; le temps de traitement entre les different declenchements ; de chrono n'est pas nul) incf TMR0,F retlw 0 ; ; ========================================================== ; debut ; reset par Watchdog ? btfsc STATUS,TO goto notimeout ; TO == 0 : OUI clrwdt goto 0x1FF ; recalibrage, 0x3FF sur 12C509 ; TO == 1 : NON notimeout movwf OSCCAL ; recalibrer l'horloge clrf TMR0 ; RAZ timer ; GPWU=1 : disable wake up on pin change ; GPPU=0 : enable pullups (a voir avec le hard ..) ; T0CS=0 : timer connected to F/4 ; T0SE=x : dont't care ; PSA=0 : prescaler assigned to timer ; PS2-0= : timer prescaler 111= 1/256, 101 = 1/64, 011 = 1/16 movlw B'10010101' option ; config des pattes movlw B'00001000' ; GP0-2 en sortie, GP3 entree tris GPIO ; se mettre en mode normal bcf GPIO,NORMAL bsf GPIO,ALERTE bsf GPIO,EJP attendre_trame call waitnosignal ; attendre ... call waitsignal ; ... front montant call clearticks call waitnosignal ; 45 tk = 0.9s, 55 tk = 1.1s Lminmax TICKS,D'45',D'55',attendre_trame,pulse1s,attendre_trame pulse1s ; attendre 162,5 tk = 2.75 s + 0.5 s = 3.25 s call clearticks again325 call tickcount Lminmax TICKS,D'162',D'162',again325,again325,end325 end325 ; on est maintenant au centre du 1er bit ; il suffit d'echantillonner toutes les 2.5s movlw 1 movwf SLOT sample btfsc GPIO,SIGNAL ; logique negative goto slot40 ; signal detecte !! Bne not5,SLOT,D'5' ; slot == 5 ? ; oui - 5 = passage en alerte bsf GPIO,NORMAL ; bit a 1 = LED eteinte bsf GPIO,EJP ; bit a 1 = LED eteinte bcf GPIO,ALERTE ; bit a 0 = LED allumee goto nextslot not5 Bne not15,SLOT,D'15' ; slot == 15 ? ; oui btfsc GPIO,ALERTE ; deja en alerte ? goto endejp ; oui - 5 & 15 = debut ejp bsf GPIO,NORMAL ; bit a 1 = LED eteinte bsf GPIO,ALERTE ; bit a 1 = LED eteinte bcf GPIO,EJP ; bit a 0 = LED allumee goto nextslot endejp ; non - 15 seul = fin ejp bsf GPIO,EJP ; bit a 1 = LED eteinte bsf GPIO,ALERTE ; bit a 1 = LED eteinte bcf GPIO,NORMAL ; bit a 0 = LED allumee goto nextslot not15 slot40 ; slot 40 ? Bne nextslot,SLOT,D'40' ; slot == 40 ? ; et attendre une nouvelle trame goto attendre_trame nextslot incf SLOT,F ; si le signal est a 1, on en profite pour se resynchroniser ; sur son front descendant, au cas ou l'emetteur ne soit pas ; bien conforme au protocole. btfss GPIO,SIGNAL goto resynchro ; attendre 125 ticks = 2.5s call clearticks again125 call tickcount Lminmax TICKS,D'125',D'126',again125,sample,again125 resynchro call waitnosignal call clearticks again100 ; attente 2 s (100 ticks) call tickcount Lminmax TICKS,D'100',D'101',again100,sample,again100 end Syntax-Highlight-Engine-Kate-0.14/samples/highlight.lhs0000644000175000017500000001064413032300413022367 0ustar manwarmanwartest file for Haskell syntax highlighting in KDE's Kate The test file for literate Haskell can be easily created like this: cat highlight.hs | sed -e "s|^|> |" -e "s|> -- ||" -e "s|^> $||" > highlight.lhs You only have to manually edit the multi-line comment below. this is a single-line comment {- this is a multi-line comment Things like "a string" or a 'c' character shouldn't be highlighted in here. I could even start a new one-line comment. -} a data definition > data Tree a = Br (Tree a) (Tree a) | Leaf a | Nil deriving (Show, Eq) function definition, "funnyfunction::", "Integer", "Int", "Bool" should be highlighted > funnyfunction::(Tree a)=>[a]->Integer->Int->Bool strings and chars first line of function definitions (type declaration) should be highlighted > strangefunction::Int->String > strangefunction 1 = "hello" > strangefunction 2 = "what's up" > strangefunction 3 = (strangefunction 1) ++ ", " ++ (strangefunction 2) > strangefunction 4 = 'a':'b':'c':'"':[] -- will return "abc" > strangefunction 5 = '\n':[] > strangefunction 6 = '\invalidhaskell':[] function name including the single quote character and infix operator (`div`) > justtesting'::Int->Int > justtesting' 2 = 2+1 > justtesting' 9 = 7 `div` 2 same definition as above, slightly different function name and a couple more whitespaces > justtesting'' :: Int -> Int > justtesting'' 2 = 3 > justtesting'' 9 = 3 + 9 - 9 the following lines are copied out of Haskell's "Prelude.hs" > infixl 7 *, /, `quot`, `rem`, `div`, `mod`, :%, % everything highlighted except the "a" > class Bounded a where > minBound, maxBound :: a > class (Num a, Ord a) => Real a where > toRational :: a -> Rational finally, some keyword lists keywords > case, class, data, deriving, do, else, if, in, infixl, infixr, instance, let, module, of, primitive, > then, type, where infix operators > quot, rem, div, mod, elem, notElem, seq this stuff is not handled yet > !!, %, &&, $!, $, *, **, -,., /=, <, <=, =<<, ==, >, >=, >>, >>=, ^, ^^, ++, || functions > FilePath, IOError, abs, acos, acosh, all, and, any, appendFile, > approxRational, asTypeOf, asin, asinh, atan, atan2, atanh, basicIORun, > break, catch, ceiling, chr, compare, concat, concatMap, const, cos, cosh, > curry, cycle, decodeFloat, denominator, digitToInt, div, divMod, drop, > dropWhile, either, elem, encodeFloat, enumFrom, enumFromThen, > enumFromThenTo, enumFromTo, error, even, exp, exponent, fail, filter, flip, > floatDigits, floatRadix, floatRange, floor, fmap, foldl, foldl1, foldr, > foldr1, fromDouble, fromEnum, fromInt, fromInteger, fromIntegral, > fromRational, fst, gcd, getChar, getContents, getLine, head, id, inRange, > index, init, intToDigit, interact, ioError, isAlpha, isAlphaNum, isAscii, > isControl, isDenormalized, isDigit, isHexDigit, isIEEE, isInfinite, isLower, > isNaN, isNegativeZero, isOctDigit, isPrint, isSpace, isUpper, iterate, last, > lcm, length, lex, lexDigits, lexLitChar, lines, log, logBase, lookup, map, > mapM, mapM_, max, maxBound, maximum, maybe, min, minBound, minimum, mod, > negate, not, notElem, null, numerator, odd, or, ord, otherwise, pi, pred, > primExitWith, print, product, properFraction, putChar, putStr, putStrLn, > quot, quotRem, range, rangeSize, read, readDec, readFile, readFloat, > readHex, readIO, readInt, readList, readLitChar, readLn, readOct, readParen, > readSigned, reads, readsPrec, realToFrac, recip, rem, repeat, replicate, > return, reverse, round, scaleFloat, scanl, scanl1, scanr, scanr1, seq, > sequence, sequence_, show, showChar, showInt, showList, showLitChar, > showParen, showSigned, showString, shows, showsPrec, significand, signum, > sin, sinh, snd, span, splitAt, sqrt, subtract, succ, sum, tail, take, > either, elem, encodeFloat, enumFrom, enumFromThen, enumFromThenTo, > enumFromTo, error, even, exp, exponent, fail, filter, flip, floatDigits, > floatRadix, floatRange, floor, fmap, takeWhile, tan, tanh, threadToIOResult, > toEnum, toInt, toInteger, toLower, toRational, toUpper, truncate, uncurry, > undefined, unlines, until, unwords, unzip, unzip3, userError, words, > writeFile, zip, zip3, zipWith, zipWith3 type constructors > Bool, Char, Double, Either, Float, IO, Integer, Int, Maybe, Ordering, Rational, Ratio, ReadS, > ShowS, String classes > Bounded, Enum, Eq, Floating, Fractional, Functor, Integral, Ix, Monad, Num, Ord, Read, RealFloat, > RealFrac, Real, Show data constructors > EQ, False, GT, Just, LT, Left, Nothing, Right, True Syntax-Highlight-Engine-Kate-0.14/samples/highlight.css0000644000175000017500000000124313032300413022364 0ustar manwarmanwar/** * This is a pseudo CSS file to test Kate's CSS syntax highlighting. */ @import url("othersheet.css") screen, tv; body { font-size: 15pt; font-family: Verdana,Helvetica,"Bitstream Vera Sans", sans-serif; margin-top: 0px; /* yet another comment */ margin-bottom: 0px; // this is no comment, it's just broken! margin-left: 0px; margin-right: 0px; } .something { margin-right: 0px; } a:hover { } #header, p.intro:first-letter, p:lang(nl), img[align="right"] { border: 1px solid red !important; -moz-border-radius: 15px; /* unknown properties render as error */ } @media print { #header { display: none; } } /* TODO: add more tests, e.g. media */ Syntax-Highlight-Engine-Kate-0.14/samples/highlight.pl0000644000175000017500000000142413032300413022210 0ustar manwarmanwar#!/usr/bin/perl -w # This is a pseudo Perl file to test Kate's Perl syntax highlighting. # TODO: this is incomplete, add more syntax examples! $VERSION = sprintf '4.%03d', q$Revision: #24 $ =~ /\D(\d+)\s*$/; sub prg($) { my $var = shift; '\'\\' $var =~ s/bla/foo/igs; $var =~ s!bla!foo!igs; $var =~ s#bla#foo#igs; $var =~ tr/a-z/A-Z/; ($match) = ($var =~ m/(.*?)/igs); $test = 2/453453.21; $test /= 2; print qq~d fsd fsdf sdfl sd~ $" = '/'; $foo = <<__EOF; d ahfdklf klsdfl sdf sd fsd sdf sdfsdlkf sd __EOF $x = "dasds"; next if( $match eq "two" ); next if( $match =~ /go/i ); @array = (1,2,3); # a comment @array = qw(apple foo bar); push(@array, 4); %hash = (red => 'rot', blue => 'blau'); print keys(%hash); } sub blah { } &blah; prg("test"); Syntax-Highlight-Engine-Kate-0.14/samples/highlight_lpc.c0000644000175000017500000000275113032300413022661 0ustar manwarmanwar// NOTE: This is a test file for kate's LPC syntax highlighting. // This is a Single-Line Comment /* This is a Multi- Line Comment */ // This again is a Single-Line Comment which should end here /* // And this is an evil single line comment \ which should include this and the next line because of the \ Do not use this style at home, kids. // BEGIN region marker // END of region marker private void create() { // Some Preprocessor stuff: #define SOME_STUFF if(foo("bar")) \ { \ bar("foo"); \ } // Preprocessor, Keyword, Preprocessor-String, Multiline // Some closures: #'create; #'?!; /* Some other Data Types: */ int i = 1; // Integer. float b = 2.34; // Float. int c = 0b001; // Binary int e = 0x019Beef; // Hexadecimal int f = 0o2345; // Octal string a = "Wheee"; // String string x = "Wheee\ heee"; // Multi-Line String, again, don't use this. /* Some keywords: */ if(1) { switch(2) { case 3: 4; break; } } else { return 0; } } /* WARNING: If the above function is part of a multi-line comment, it's buggy. The WARNING: itself should be a comment-keyword. That's not actually part of the language, but simply used to highlight important stuff inside comments like TODO: etc. */ Syntax-Highlight-Engine-Kate-0.14/samples/highlight.m3u0000644000175000017500000000141313032300413022277 0ustar manwarmanwar#EXTM3U #EXTINF:189,Amália Rodrigues - Who Will Buy 01. Amália Rodrigues - Who Will Buy.mp3 #EXTINF:210,Amália Rodrigues - Long Ago And Far Away 02. Amália Rodrigues - Long Ago And Far Away.mp3 #EXTINF:232,Amália Rodrigues - All The Things You Are 03. Amália Rodrigues - All The Things You Are.mp3 #EXTINF:174,Amália Rodrigues - Blue Moon 04. Amália Rodrigues - Blue Moon.mp3 #EXTINF:200,Amália Rodrigues - Summertime 05. Amália Rodrigues - Summertime.mp3 #EXTINF:179,Amália Rodrigues - The Nearness Of You 06. Amália Rodrigues - The Nearness Of You.mp3 #EXTINF:177,Amália Rodrigues - I Can't Begin To Tell You 07. Amália Rodrigues - I Can't Begin To Tell You.mp3 #EXTINF:170,Amália Rodrigues - I Can't Help Loving The Man 08. Amália Rodrigues - I Can't Help Loving The Man.mp3 Syntax-Highlight-Engine-Kate-0.14/samples/highlight_octave.m0000644000175000017500000000363513032300413023400 0ustar manwarmanwar##===================================================== % Octave test code for Kate/Kwrite syntax highlighting % (shamelessly copied from Matlab's, since the two % are very similar) % kate: hl Octave; ##===================================================== % Numbers _____________________________________________ 5, 5.5, .1, 0.1, 0.4e5, 1.2e-5, 5i, 5.3i, 6j, .345+3i 5', 5.5', .1', 0.1', 0.4e5', 1.2e-5', 5i', 5.3i', 6j', .345+3i' % Operators ___________________________________________ % relational operators 'asdf'~=4, c<=4, d>=4, ab, a==b, b||c, b&&c % elementwise arithmetic operators a.^b, a.*b a./b, 1:4:5 % single-character binary arithmetic a+3, a-3, a*2, a^3, a/3, a\3, a|b, a&b % unary operators a = ~g; g = @sfdgdsf(sdfsd,345); g.' + 1i.' - ('asdf').' % separators and delimiter (asd),[sadf];{asdf},;;,;;;() % continuation a = 1+ ... 2; % Strings and adjoint _________________________________ % incomplete strings 'string 'str'' 'str''ing 'str''\' % complete strings 'string' % simple string '''' '\'' % strings containing ' 'str''ing' % one string containing ' 'string' 'string' % two strings 'asdf' "asdf""" variable % two strings and a variable 'asdf''asdf'' fsgdfg' + (asdf)' - 'asdf'.' + []''''.';'' 'sadf'.' % string transpose % adjoint {'asdf'}' + 1 ('asdf')' + 1 ['asdf']' + 1 '' var''' % empty string, var with >1 adjoints [5]'*{5}'*('asd')'.'+(5)'*6'*asdf'*asdf'.' % many adjoints A'*B + 1 % adjoint A.'*B + 1 % transpose A.'.'*B + 1 % double transpose A'.' + 1 % adjoint, then transpose A.'' % transpose, then adjoint % System command ______________________________________ !hostname !cp * /tmp % Reserved keywords ___________________________________ function, persistent, global endfunction switch, case, otherwise endswitch if, else, elseif endif try, end_try_catch for, while, break, continue endfor endwhile return function, FUNCTION, Function % case sensitive! endfunctionSyntax-Highlight-Engine-Kate-0.14/samples/highlight.bib0000644000175000017500000000103213032300413022324 0ustar manwarmanwar% test file for kate's bibtex syntax highlighting @Article{artikel, author = {Me}, title = {Something}, journal = {JHEP}, year = {2003}, } @Book { boek, author = "Someone", title = "Something", journal = "Nucl. Phys. B", year = "2003", } This is ignored by BibTeX, no special highlighting %This is not a comment, it is just ignored (thanks to the people in #latex) :) @string{test="lange string die ik niet vaak opnieuw wil intikken"} @PhdThesis{thesis, author = {Me}, title = {Dunno}, school = {ITFA}, year = {2005, hopefully}, } Syntax-Highlight-Engine-Kate-0.14/samples/highlight.cmake0000644000175000017500000000273313032300413022661 0ustar manwarmanwar#this CMakeLists.txt doesn't do anything useful, but it shoudl demonstrate the cmake syntax highlighting #Alexander Neundorf #ok this is a comment #and another line #a built-in command, it's bold black ADD_DEFINITIONS(-Wall -Wctor-dtor-privacy -Woverloaded-virtual -Wno-long-long -pipe -fno-builtin -fno-exceptions) #and another function INCLUDE_DIRECTORIES( #comments are also highlighted inside function parameters #variables are blue ${CMAKE_CURRENT_SOURCE_DIR}/../../lib/qt4/include/Qt ) # BEGIN defining a macro MACRO(ECOS_ADD_EXECUTABLE _exe_NAME ) #special parameters are italic, see the STATIC in the next line ADD_LIBRARY(${_exe_NAME} STATIC ${ARGN}) #but not in the following line ? ADD_LIBRARY(${_exe_NAME} STATIC ${ARGN}) #another command with a bunch of variables and special parameters ADD_CUSTOM_COMMAND( TARGET ${_exe_NAME} PRE_LINK COMMAND ${CMAKE_C_COMPILER} ARGS -o ${_exe_NAME} $\(${_exe_NAME}_SRC_OBJS\) -nostdlib -nostartfiles -Lecos/install/lib -Ttarget.ld ) #add the created files to the make_clean_files SET(ECOS_ADD_MAKE_CLEAN_FILES ${ECOS_ADD_MAKE_CLEAN_FILES};${_exe_NAME};) #and another command... SET_DIRECTORY_PROPERTIES( PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${ECOS_ADD_MAKE_CLEAN_FILES}" ) ENDMACRO(ECOS_ADD_EXECUTABLE) # END of macro #calling a self-defined function, variables are also blue here ECOS_ADD_EXECUTABLE(${PROJECT_NAME} ${the_sources} ${qt4_moc_SRCS}) Syntax-Highlight-Engine-Kate-0.14/samples/highlight.lex0000644000175000017500000000250213032300413022363 0ustar manwarmanwar/* This test file tests kates Lex/Flex highlighting */ %option c++ %option yyclass="KateTester" %option yylineno /* This is a C(++) comment */ /* This one is a lex comment ! */ %{ #include #include "realparser.hpp" using namespace std; %} /* Some definitions */ DIGIT [0-9] LETTER [_a-zA-Z] %% /* Comment *shall be indented here* */ [ \t\n\r]+ /* Note: there is a bad } just here vvv */ \/\*([^\*]|\*[^/])*\*\/ { foo(a, b, c); } } /* A start condition scope... */ { "a" { /* C mode ! */ return 0; } "b" %{ /* C mode, too ! */ return 0; %} "c" return 0; // C++ comment } /* Big rule */ \"([^"\\]|\\.)*\" { yylval.string_val = new char[strlen(yytext) + 1]; int j = 0, i = 1; while (yytext[i] != '"') if (yytext[i] != '\\') yylval.string_val[j++] = yytext[i++]; else switch (yytext[i + 1]) { case 'n': yylval.string_val[j++] = '\n'; i += 2; break; default: yylval.string_val[j++] << yytext[i + 1], i += 2; } yylval.string_val[j] = 0; return TOK_STRING; } /* Dot (match all) */ . {return yylval.int_val = yytext[0];} %% // Here is pure C(++) #include int main(void) { std::cout << "Hello, World\n"; return 0; } Syntax-Highlight-Engine-Kate-0.14/samples/highlight.glsl0000644000175000017500000000206013032300413022533 0ustar manwarmanwar// This is a test file for the Katepart GLSL Syntax Highlighting. normal text // this is a single-line comment normal text /* this is a multi-line comment */ normal text some_symbol.some_member; some_symbol.some_member_function(); some_function(); // this is a function void main() { float f = 1.4e3; // decimal float literal int i1 = 2884; // decimal int literal int i2 = 0x44; // hex int literal int i3 = 0456; // octal int literal } // this is a structure struct some_struct { vec3 some_member_vector; }; # this is #preprocessor code // all keywords break continue do for while if else true false discard return struct // all basic types float int void bool mat2 mat3 mat4 vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler1DShadow // all type qualifiers attribute const uniform varying in out inout // attensions: // FIXME // TODO // BUG // some of the std functions radians degrees sin cos tan asin acos atan // some of the std variables gl_Position gl_PointSize gl_ClipVertex Syntax-Highlight-Engine-Kate-0.14/samples/highlight.rb0000644000175000017500000001246713032300413022211 0ustar manwarmanwar# This file is a testcase for the highlighting of Ruby code # It's not executable code, but a collection of code snippets # require 'Config' require 'DO/Clients' require 'DO/DBClients' def CGI::escapeElement(string, *elements) elements = elements[0] if elements[0].kind_of?(Array) unless elements.empty? string.gsub(/<\/?(?:#{elements.join("|")})(?!\w)(?:.|\n)*?>/ni) do CGI::escapeHTML($&) end else string end end case inputLine when "debug" dumpDebugInfo dumpSymbols when /p\s+(\w+)/ dumpVariable($1) when "quit", "exit" exit else print "Illegal command: #{inputLine}" end kind = case year #hi there when 1850..1889 then "Blues" when 1940..1950 then "Bebop" else "Jazz" end # URL-encode a string. # url_encoded_string = CGI::escape("'Stop!' said Fred") # # => "%27Stop%21%27+said+Fred" def CGI::escape(string) string.gsub(/([^ a-zA-Z0-9_.-]+)/n) do '%' + $1.unpack('H2' * $1.size).join('%').upcase end.tr(' ', '+') end # Class ClientManager # # definition : Import, store and export the various data used by the application. # This class is the sole interface between the application and the underlying database. mon, day, year = $1, $2, $3 if /(\d\d)-(\d\d)-(\d\d)/ puts "a = #{a}" if fDebug print total unless total == 0 while gets next if /^#/ # Skip comments parseLine unless /^$/ # Don't parse empty lines end if artist == "John Coltrane" #hi there artist = "'Trane" #hi there end unless nicknames == "no" #hi there handle = if aSong.artist == "Gillespie" then #hi there "Dizzy" elsif aSong.artist == "Parker" then "Bird" else #hi there "unknown" end if aSong.artist == "Gillespie" then handle = "Dizzy" elsif aSong.artist == "Parker" then handle = "Bird" else handle = "unknown" end #hi there case line when /title=(.*)/ puts "Title is #$1" when /track=(.*)/ puts "Track is #$1" when /artist=(.*)/ puts "Artist is #$1" end case shape when Square, Rectangle # ... when Circle # ... when Triangle # ... else # ... end until playList.duration > 60 #hi there playList.add(songList.pop) end 3.times do print "Ho! " end loop { # block ... } songList.each do |aSong| aSong.play end i = 0 doUntil(i > 3) { print i, " " i += 1 } def system_call # ... code which throws SystemCallError rescue SystemCallError $stderr.print "IO failed: " + $! opFile.close File.delete(opName) raise end class ClientManager # constructor def initialize(dbase) @dbClient = DBClient.new(dbase) @clients = Clients.new end def prout(a, b, xy="jj") 24 end ############################################################### # # CLIENTS SECTION # ############################################################### # update the clients object by retrieving the related data from the database # returns the number of clients def refreshClients @clients.clean unless @sqlQuery.nil? then @sqlQuery.selectClient.each do |row| @clients.addClient(row[0],row[1],row[2],row[3],row[4],row[5], row[6], row[7], row[8]) end else puts "SqlQuery wasn't created : cannot read data from database" end return @clients.length end end # Mixin module for HTML version 3 generation methods. module Html3 # :nodoc: # The DOCTYPE declaration for this version of HTML def doctype %|| end # Initialise the HTML generation methods for this version. def element_init extend TagMaker methods = "" # - - for element in %w[ HTML HEAD BODY P PLAINTEXT DT DD LI OPTION tr th td ] methods += <<-BEGIN + nO_element_def(element) + <<-END def #{element.downcase}(attributes = {}) BEGIN end END end eval(methods) end end # following snippet from Webrick's log.rb # test cases for general delimited input # quoted strings %Q|this is a string| %Q{this is a string} %Q(this is a string) %Q %Q[this is a string] %|also a string| %{also a string} %(also a string) % %[also a string] # apostrophed strings %q|apostrophed| %q{apostrophed} %q(apostrophed) %q %q[apostrophed] # regular expressions %r{expression} %r(expression) %r %r[expression] %r|expression| # shell commands %x{ls -l} %x(ls -l) %x %x[ls -l] # sometimes it's useful to have the command on multiple lines %x{ls -l | grep test } # token array %w{one two three} %w(one two three) %w %w[one two three] # snippet from Net::IMAP # I object to putting String, Integer and Array into kernel methods. # While these classes are builtin in Ruby, this is an implementation detail # that should not be exposed to the user. # If we want to handle all std-lib classes, fine. But then they should be in their # own std-lib keyword category. def send_data(data) case data when nil put_string("NIL") when String send_string_data(data) when Integer send_number_data(data) when Array send_list_data(data) when Time send_time_data(data) when Symbol send_symbol_data(data) else data.send_data(self) end end Syntax-Highlight-Engine-Kate-0.14/samples/highlight.xml0000644000175000017500000000267313032300413022404 0ustar manwarmanwar This is a pseudo XML file to test Kate's XML syntax highlighting. Doctype: Processing instruction: Comments: Comment inside element: content Markup inside comment: Empty element: Simple element plus content: some content some content Namespace for elements and attributes: content content Elements containing allowed characters: Elements containing allowed start characters: <:element foo="test"/> <_element foo="test"/> Single quotes (the same as double quotes): content Allowed Whitespace: content Entities:   å å å И 水 Illegal XML, should not be highlighted: <0foobar> -- no digit as first character <-foo> -- no dash as first character Syntax-Highlight-Engine-Kate-0.14/samples/highlight.lisp0000644000175000017500000000146013032300413022544 0ustar manwarmanwar;; This test file tests kates common lisp highlighting #| multilinecomment :) |# ;BEGIN region marker ;END end (defun bin-search (obj vec) (let ((len (length vec))) (and (not (zerop len)) (finder obj vec 0 (- len 1))))) (defun parse-date (str) (let ((toks (tokens str #'constituent 0))) (list (parse-integer (first toks)) (parse-month (second toks)) (parse-integer (third toks))))) (defconstant month-names #("jan" "feb" "mar" "apr" "may" "jun" "jul" "aug" "sep" "oct" "nov" "dec")) (defstruct buf vec (start -1) (used -1) (new -1) (end -1)) (defparameter *words* (make-hash-table :size 10000)) (defmacro while (test &rest body) `(do () ((not ,test)) ,@body)) (define-modify-macro append1f (val) (lambda (lst val) (append lst (list val)))) Syntax-Highlight-Engine-Kate-0.14/samples/highlight.pike0000644000175000017500000000114713032300413022527 0ustar manwarmanwar#! /bin/env pike /* This file is a syntax highlight test for Kate. * FIXME: Improve it to contain more (and more unusual) syntax examples. */ #define PIKE_ON_THE_WEB /* Is this address correct? */ "http://pike.ida.liu.se/" int main(int argc, array(string) args) { // Write funny things with Pike :) write(`+("Command line arguments (%d of them): ", @map(args, `+, " ")) + "\n", argc); write("\nVisit Pike site at %s\n\n", PIKE_ON_THE_WEB); for (int i = 1; i <= 3; i++) write(":" + ")" * i + " "); write("\n" + ({"Bye", "bye"}) * "-" + "!\n"); return 0; } Syntax-Highlight-Engine-Kate-0.14/samples/highlight.uc0000644000175000017500000001360713032300413022212 0ustar manwarmanwar//============================================================================= // Shield Gun //============================================================================= class ShieldGun extends Weapon config(user); #EXEC OBJ LOAD FILE=InterfaceContent.utx var Sound ShieldHitSound; var String ShieldHitForce; replication { reliable if (Role == ROLE_Authority) ClientTakeHit; } simulated function DoAutoSwitch() { } simulated event RenderOverlays( Canvas Canvas ) { local int m; if ((Hand < -1.0) || (Hand > 1.0)) { for (m = 0; m < NUM_FIRE_MODES; m++) { if (FireMode[m] != None) { FireMode[m].DrawMuzzleFlash(Canvas); } } } Super.RenderOverlays(Canvas); } // AI Interface function GiveTo(Pawn Other, optional Pickup Pickup) { Super.GiveTo(Other, Pickup); if ( Bot(Other.Controller) != None ) Bot(Other.Controller).bHasImpactHammer = true; } function bool CanAttack(Actor Other) { return true; } simulated function Timer() { local Bot B; if (ClientState == WS_BringUp) { // check if owner is bot waiting to do impact jump B = Bot(Instigator.Controller); if ( (B != None) && B.bPreparingMove && (B.ImpactTarget != None) ) { B.ImpactJump(); B = None; } } Super.Timer(); if ( (B != None) && (B.Enemy != None) ) BotFire(false); } function FireHack(byte Mode) { if ( Mode == 0 ) { FireMode[0].PlayFiring(); FireMode[0].FlashMuzzleFlash(); FireMode[0].StartMuzzleSmoke(); IncrementFlashCount(0); } } /* BestMode() choose between regular or alt-fire */ function byte BestMode() { local float EnemyDist; local bot B; B = Bot(Instigator.Controller); if ( (B == None) || (B.Enemy == None) ) return 1; EnemyDist = VSize(B.Enemy.Location - Instigator.Location); if ( EnemyDist > 2 * Instigator.GroundSpeed ) return 1; if ( (B.MoveTarget != B.Enemy) && ((EnemyDist > 0.5 * Instigator.GroundSpeed) || (((B.Enemy.Location - Instigator.Location) Dot vector(Instigator.Rotation)) <= 0)) ) return 1; return 0; } // super desireable for bot waiting to impact jump function float GetAIRating() { local Bot B; local float EnemyDist; B = Bot(Instigator.Controller); if ( B == None ) return AIRating; if ( B.bPreparingMove && (B.ImpactTarget != None) ) return 9; if ( B.PlayerReplicationInfo.HasFlag != None ) { if ( Instigator.Health < 50 ) return AIRating + 0.35; return AIRating + 0.25; } if ( B.Enemy == None ) return AIRating; EnemyDist = VSize(B.Enemy.Location - Instigator.Location); if ( B.Stopped() && (EnemyDist > 100) ) return 0.1; if ( (EnemyDist < 750) && (B.Skill <= 2) && !B.Enemy.IsA('Bot') && (ShieldGun(B.Enemy.Weapon) != None) ) return FClamp(300/(EnemyDist + 1), 0.6, 0.75); if ( EnemyDist > 400 ) return 0.1; if ( (Instigator.Weapon != self) && (EnemyDist < 120) ) return 0.25; return ( FMin(0.6, 90/(EnemyDist + 1)) ); } // End AI interface function AdjustPlayerDamage( out int Damage, Pawn InstigatedBy, Vector HitLocation, out Vector Momentum, class DamageType) { local int Drain; local vector Reflect; local vector HitNormal; local float DamageMax; DamageMax = 100.0; if ( DamageType == class'Fell' ) DamageMax = 20.0; else if( !DamageType.default.bArmorStops || (DamageType == class'DamTypeShieldImpact' && InstigatedBy == Instigator) ) return; if ( CheckReflect(HitLocation, HitNormal, 0) ) { Drain = Min( Ammo[1].AmmoAmount*2, Damage ); Drain = Min(Drain,DamageMax); Reflect = MirrorVectorByNormal( Normal(Location - HitLocation), Vector(Instigator.Rotation) ); Damage -= Drain; Momentum *= 1.25; Ammo[1].UseAmmo(Drain/2); DoReflectEffect(Drain/2); } } function DoReflectEffect(int Drain) { PlaySound(ShieldHitSound, SLOT_None); ShieldAltFire(FireMode[1]).TakeHit(Drain); ClientTakeHit(Drain); } simulated function ClientTakeHit(int Drain) { ClientPlayForceFeedback(ShieldHitForce); ShieldAltFire(FireMode[1]).TakeHit(Drain); } function bool CheckReflect( Vector HitLocation, out Vector RefNormal, int AmmoDrain ) { local Vector HitDir; local Vector FaceDir; if (!FireMode[1].bIsFiring || Ammo[0].AmmoAmount == 0) return false; FaceDir = Vector(Instigator.Controller.Rotation); HitDir = Normal(Instigator.Location - HitLocation + Vect(0,0,8)); //Log(self@"HitDir"@(FaceDir dot HitDir)); RefNormal = FaceDir; if ( FaceDir dot HitDir < -0.37 ) // 68 degree protection arc { if (AmmoDrain > 0) Ammo[0].UseAmmo(AmmoDrain); return true; } return false; } function AnimEnd(int channel) { if (FireMode[0].bIsFiring) { LoopAnim('Charged'); } else if (!FireMode[1].bIsFiring) { Super.AnimEnd(channel); } } function float SuggestAttackStyle() { return 0.8; } function float SuggestDefenseStyle() { return -0.8; } simulated function float ChargeBar() { return FMin(1,FireMode[0].HoldTime/ShieldFire(FireMode[0]).FullyChargedTime); } defaultproperties { ItemName="Shield Gun" IconMaterial=Material'InterfaceContent.Hud.SkinA' IconCoords=(X1=200,Y1=281,X2=321,Y2=371) bShowChargingBar=true bCanThrow=false FireModeClass(0)=ShieldFire FireModeClass(1)=ShieldAltFire InventoryGroup=1 Mesh=mesh'Weapons.ShieldGun_1st' BobDamping=2.2 PickupClass=class'ShieldGunPickup' EffectOffset=(X=15.0,Y=6.7,Z=1.2) bMeleeWeapon=true ShieldHitSound=Sound'WeaponSounds.ShieldGun.ShieldReflection' DrawScale=0.4 PutDownAnim=PutDown DisplayFOV=60 PlayerViewOffset=(X=2,Y=-0.7,Z=-2.7) PlayerViewPivot=(Pitch=500,Roll=0,Yaw=500) UV2Texture=Material'XGameShaders.WeaponEnvShader' AttachmentClass=class'ShieldAttachment' SelectSound=Sound'WeaponSounds.ShieldGun_change' SelectForce="ShieldGun_change" ShieldHitForce="ShieldReflection" AIRating=0.35 CurrentRating=0.35 DefaultPriority=2 } Syntax-Highlight-Engine-Kate-0.14/samples/highlight.php0000644000175000017500000000051713032300413022366 0ustar manwarmanwar test"; ?> Syntax-Highlight-Engine-Kate-0.14/samples/highlight.js0000644000175000017500000000650713032300413022220 0ustar manwarmanwar/* test.js - test for javascript.xml syntax file */ // Note: this script will not, and is not supposed to, comile in any js engine. /* NOTE: The words "todo", "fixme" and "note" should be rendered in a different style within comments, match should be caseless (to test for regexp insensitive attribute). The regex used for this rule is */ String = /\b(?:fixme|todo|note)\b/ /* Thus, for example "Notebook" is not caught by this rule. (the "?:" in the subpattern is there to avoid the regex engine wasting time saving a backref, which is not used for anything. I do not know if the overhead of parsing that is greater than the time saved by not capturing the text...) The rule for catching these words is placed in a context "Comment common", which is used by both comment contexts (single line, multiline) using the new "IncludeRules" item. */ // test if regex support works - nice with new fallthrough prop in context:) somestring.replace( /dooh/ , "bah!"); re=/foo/ig; // hehe somestring.search( /^foo\w+\s\d{0,15}$/ ); re = /dooh/; // This is supposedly legal: re = somebool ? /foo/ : /bar/; // NOTE - Special case: an empty regex, not a comment. // The rule uses a positive lookahead assertion to catch it: "//(?=;)". re = //; re = /a|b/; /* Tests for the regex parser. It will parse classes, quanitfiers, special characters and regex operaters, as specified in the netscape documentation for javascript. Regexps are only parsed in their clean form, as the RegExp(string) constructor is using a quoted string. TODO: Find out if more regex feats should be supported. Consider using more itemDatas - assertion, quantifier are options. */ re = /^text\s+\d+\s*$/; re = /a pattern with caret \(^\) in it/; re = /(\d{0,4})\D/; re = /[a-zA-Z_]+/; re = /[^\d^]+/; re = /\s+?\w+\.$/; re = /\/\//; re = /a|b/; // a test if #pop back from a comment will work re = /*/foo/*/ /bar/; // ^ POP // ^ we got back after pop in comment, if there is regexp attribs here :-) /* Some tests if the fallthrough works. The fallthrough happens if a regexp is not found in a possible (!) position, which is after "search(" or "replace(" or "=" or "?" or ":" in version 0.1 of the xml file */ var foo = 'bar'; // ^ fallthrough! somestring.replace( new RegExp("\\b\\w+\\b"), "word: $1"); // ^ fallthrough expected. ("new" whould be bold) something.method = function ( a, b, c ) { /* ... */ } // ^ fallthrough ?! something.other = function ( d, e, f ) { /* ... */ } // fallthrough expected at col 0 ("function" should be bold) var ary = new Array(5); // ^ fallthrough ? (if keyword is correctly rendered) var b = a ? 1 : 0; // ^ ^ fallthroughs. numbers must be rendered correctly. var c = d ? true : false; var conditinalstring = b ? "something" : "something else"; // guess... /* Normal program flow... */ if (something) dostuff(); else dont(); return; try { bla() } catch (e) { alert("ERROR! : " + e) } for (int i=0; i < j; i++) document.write("i is" + i + "
"); while (something) { block(); picky: if (!1) break; else continue; } with (a) { do { stuff( b ); // a.b if it exists } while (itmakessense); } switch (i) { case 0: f(); break; default: break; } Syntax-Highlight-Engine-Kate-0.14/samples/highlight.basetest0000644000175000017500000000326613032300413023415 0ustar manwarmanwar you notice certain characters are colored red. /home/[user]/ Test in i n 32.56 matches. this does45.43not match this(23.88matches this 87.778 matches this matches 1009.6666 0-f should match 0x0123456789abcdefg this should not0x0123456789abcdefg 0-7 should match 012345678 this should not012345678 \n \045 \xfa #including comment works => IncludeRules works 32 matches. this does45not match this(23matches this 87 matches this matches 1009 Test he is not she or her or his and ; && .and. for.now Test \\\\ Test after dawn Test <66> only at linestart case insensitive Test der it works Character on the fifth column of every line is matched each character that is not a spatial on every line is matched (123s) matches. only integer part matches (123t). #if matches are found => lookAhead also works #if matches are found => lookAhead also works #if matches are found => lookAhead also works 4 matches #if matches are found => lookAhead also works 45 matches 4 does not ~kkdkd~ "match"nomatch "match"nomatch" \~ matches Syntax-Highlight-Engine-Kate-0.14/samples/highlight.cpp0000644000175000017500000001375213032300413022366 0ustar manwarmanwar/* This is a comment NOTE works */ //BEGIN INCLUDES #include "katehighlight.h" #include "katehighlight.moc" #include #include //END //BEGIN defines // same as in kmimemagic, no need to feed more data #define KATE_HL_HOWMANY 1024 // min. x seconds between two dynamic contexts reset static const int KATE_DYNAMIC_CONTEXTS_RESET_DELAY = 30 * 1000; // x is a QString. if x is "true" or "1" this expression returns "true" #define IS_TRUE(x) x.lower() == QString("true") || x.toInt() == 1 //END defines //BEGIN Prviate HL classes inline bool kateInsideString (const QString &str, QChar ch) { for (uint i=0; i < str.length(); i++) if (*(str.unicode()+i) == ch) return true; return false; } class KateHlItem { public: KateHlItem(int attribute, int context,signed char regionId, signed char regionId2); virtual ~KateHlItem(); public: // Now, the function returns the offset detected, or 0 if no match is found. // bool linestart isn't needed, this is equivalent to offset == 0. virtual int checkHgl(const QString& text, int offset, int len) = 0; virtual bool lineContinue(){return false;} virtual QStringList *capturedTexts() {return 0;} static void dynamicSubstitute(QString& str, const QStringList *args); int attr; int ctx; signed char region; signed char region2; bool lookAhead; bool dynamic; int column; // start enable flags, nicer than the virtual methodes // saves function calls }; //END //BEGIN STATICS KateHlManager *KateHlManager::s_self = 0; static const bool trueBool = true; static const QString stdDeliminator = QString (" \t.():!+,-<=>%&*/;?[]^{|}~\\"); //END //BEGIN NON MEMBER FUNCTIONS static KateHlItemData::ItemStyles getDefStyleNum(QString name) { if (name=="dsNormal") return KateHlItemData::dsNormal; else if (name=="dsKeyword") return KateHlItemData::dsKeyword; else if (name=="dsError") return KateHlItemData::dsError; return KateHlItemData::dsNormal; } //END //BEGIN KateHlItem KateHlItem::KateHlItem(int attribute, int context,signed char regionId,signed char regionId2) : attr(attribute), ctx(context), region(regionId), alwaysStartEnable (true), customStartEnable (false) { } KateHlItem::~KateHlItem() { //kdDebug(13010)<<"In hlItem::~KateHlItem()"<= '0' && c <= '9') { if ((uint)(c - '0') < args->size()) { str.replace(i, 2, (*args)[c - '0']); i += ((*args)[c - '0']).length() - 1; } else { str.replace(i, 2, ""); --i; } } } } } //END //BEGIN KateHlStringDetect KateHlStringDetect::KateHlStringDetect(int attribute, int context, signed char regionId,signed char regionId2,const QString &s, bool inSensitive) : KateHlItem(attribute, context,regionId,regionId2) , str(inSensitive ? s.upper() : s) , strLen (str.length()) , _inSensitive(inSensitive) { } //BEGIN KateHlCFloat KateHlCFloat::KateHlCFloat(int attribute, int context, signed char regionId,signed char regionId2) : KateHlFloat(attribute,context,regionId,regionId2) { alwaysStartEnable = false; } //END /** * Creates a new dynamic context or reuse an old one if it has already been created. */ int KateHighlighting::makeDynamicContext(KateHlContext *model, const QStringList *args) { QPair key(model, args->front()); short value; if (dynamicCtxs.contains(key)) value = dynamicCtxs[key]; else { kdDebug(13010) << "new stuff: " << startctx << endl; KateHlContext *newctx = model->clone(args); m_contexts.push_back (newctx); value = startctx++; dynamicCtxs[key] = value; KateHlManager::self()->incDynamicCtxs(); } // kdDebug(13010) << "Dynamic context: using context #" << value << " (for model " << model << " with args " << *args << ")" << endl; return value; } /** * Drop all dynamic contexts. Shall be called with extreme care, and shall be immediatly * followed by a full HL invalidation. */ void KateHighlighting::dropDynamicContexts() { for (uint i=base_startctx; i < m_contexts.size(); ++i) delete m_contexts[i]; m_contexts.resize (base_startctx); dynamicCtxs.clear(); startctx = base_startctx; } /** * Parse the text and fill in the context array and folding list array * * @param prevLine The previous line, the context array is picked up from that if present. * @param textLine The text line to parse * @param foldinglist will be filled * @param ctxChanged will be set to reflect if the context changed */ void KateHighlighting::doHighlight ( KateTextLine *prevLine, KateTextLine *textLine, QMemArray* foldingList, bool *ctxChanged ) void KateHighlighting::loadWildcards() { KConfig *config = KateHlManager::self()->getKConfig(); config->setGroup("Highlighting " + iName); QString extensionString = config->readEntry("Wildcards", iWildcards); if (extensionSource != extensionString) { regexpExtensions.clear(); plainExtensions.clear(); extensionSource = extensionString; static QRegExp sep("\\s*;\\s*"); QStringList l = QStringList::split( sep, extensionSource ); static QRegExp boringExpression("\\*\\.[\\d\\w]+"); for( QStringList::Iterator it = l.begin(); it != l.end(); ++it ) if (boringExpression.exactMatch(*it)) plainExtensions.append((*it).mid(1)); else regexpExtensions.append(QRegExp((*it), true, true)); } } QValueList& KateHighlighting::getRegexpExtensions() { return regexpExtensions; } //END KateViewHighlightAction // kate: space-indent on; indent-width 2; replace-tabs on; Syntax-Highlight-Engine-Kate-0.14/samples/highlight.wrl0000644000175000017500000000275413032300413022410 0ustar manwarmanwar#VRML V2.0 utf8 # # VRML highlighting test for Kate's syntax highlighting # # Keywords DEF, EXTERNPROTO, FALSE, IS, NULL, PROTO, ROUTE, TO, TRUE, USE, eventIn, eventOut, exposedField, field # Data types MFColor, MFFloat, MFInt32, MFNode. MFRotation, MFString, MFTime, MFVec2f, MFVec3f, SFBool, SFColor, SFFloat, SFImage, SFInt32, SFNode, SFRotation, SFString, SFTime, SFVec2f, SFVec3f # Predefined nodes Anchor, Appearance, AudioClip, Background, Billboard, Box, Collision, Color, ColorInterpolator, Cone, Coordinate, CoordinateInterpolator, Cylinder, CylinderSensor, DirectionalLight, ElevationGrid, Extrusion, Fog, FontStyle, Group, ImageTexture, IndexedFaceSet, IndexedLineSet, Inline, LOD, Material, MovieTexture, NavigationInfo, Normal, NormalInterpolator, OrientationInterpolator, PixelTexture, PlaneSensor, PointLight, PointSet, PositionInterpolator, ProximitySensor, ScalarInterpolator, Script, Shape, Sound, Sphere, SphereSensor, SpotLight, Switch, Text, TextureCoordinate, TextureTransform, TimeSensor, TouchSensor, Transform, Viewpoint, VisibilitySensor, WorldInfo # Some real VRML constructs to see if highlighting of int, float etc. works NavigationInfo { avatarSize [0.25, 1.6, 0.75] headlight TRUE speed 1 type ["WALK", "ANY"] visibilityLimit 0.0 } # some further testing for strings: linefeeds are allowed within strings Text { string ["some special in-string characters: \" \\ some more text in the next line and yet another line"] } Syntax-Highlight-Engine-Kate-0.14/samples/highlight.xsl0000644000175000017500000000645413032300413022413 0ustar manwarmanwar Linux at Home Links <xsl:value-of select="h:a/h:strong"/> <xsl:value-of select="normalize-space($title)"/> Syntax-Highlight-Engine-Kate-0.14/samples/highlight.exu0000644000175000017500000000417413032300413022403 0ustar manwarmanwar-- Test file for Kate's Euphoria syntax highlighting/code folding. -- BEGIN region marker test -- code here -- END region marker test -- The N Queens Problem: -- Place N Queens on an NxN chess board -- such that they don't threaten each other. constant N = 8 -- try some other sizes constant ROW = 1, COLUMN = 2 constant TRUE = 1, FALSE = 0 type square(sequence x) -- a square on the board return length(x) = 2 end type type row(integer x) -- a row on the board return x >= 1 and x <= N end type function threat(square q1, square q2) -- do two queens threaten each other? if q1[COLUMN] = q2[COLUMN] then return TRUE elsif q1[ROW] - q1[COLUMN] = q2[ROW] - q2[COLUMN] then return TRUE elsif q1[ROW] + q1[COLUMN] = q2[ROW] + q2[COLUMN] then return TRUE elsif q1[ROW] = q2[ROW] then return TRUE else return FALSE end if end function function conflict(square q, sequence queens) -- Would square p cause a conflict with other queens on board so far? for i = 1 to length(queens) do if threat(q, queens[i]) then return TRUE end if end for return FALSE end function integer soln soln = 0 -- solution number procedure print_board(sequence queens) -- print a solution, showing the Queens on the board integer k position(1, 1) printf(1, "Solution #%d\n\n ", soln) for c = 'a' to 'a' + N - 1 do printf(1, "%2s", c) end for puts(1, "\n") for r = 1 to N do printf(1, "%2d ", r) for c = 1 to N do if find({r,c}, queens) then puts(1, "Q ") else puts(1, ". ") end if end for puts(1, "\n") end for puts(1, "\nPress Enter. (q to quit) ") while TRUE do k = get_key() if k = 'q' then abort(0) elsif k != -1 then exit end if end while end procedure procedure place_queen(sequence queens) -- place queens on a NxN chess board -- (recursive procedure) row r -- only need to consider one row for each queen if length(queens) = N then soln += 1 print_board(queens) return end if r = length(queens)+1 for c = 1 to N do if not conflict({r,c}, queens) then place_queen(append(queens, {r,c})) end if end for end procedure Syntax-Highlight-Engine-Kate-0.14/samples/highlight.y0000644000175000017500000000201513032300413022042 0ustar manwarmanwar/* Yacc / Bison hl test file. * It won't compile :-) Sure ! */ %{ #include using namespace std; extern KateParser *parser; %} %locations %union { int int_val; double double_val; bool bool_val; char *string_val; char *ident_val; struct var *v; void *ptr; } %token TOK_NOT_EQUAL "!=" %token TOK_LESSER_E "<=" %token TOK_GREATER_E ">=" %token TOK_EQUAL_2 "==" %type type type_proc %% prog: KW_PROGRAM ident { parser->start($2); } prog_beg_glob_decl instructions { parser->endproc(0); } dev_procedures KW_ENDP ; number: integer_number | TOK_DOUBLE { $$ = new var; $$->type = KW_REEL; $$->cl = var::LITTERAL; $$->real = $1; }; %% #include int main(void) { puts("Hello, World!"); return 0; } Syntax-Highlight-Engine-Kate-0.14/samples/highlight.f900000644000175000017500000001265413032300413022202 0ustar manwarmanwar! This file is an example to test the syntax highlighting file F.xml ! (for fortran 90 and F) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! THIS IS AN EXAMPLE OF A MODULE ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! module module_example ! use 'implicit none' when you want all variables to be declared implicit none !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! PUBLICS AND PRIVATES ! In fortran 90 you can define your own operator public :: operator(.norm.) public :: operator(+) ! <-- you can also overload the usual operators public :: factorial public :: example_fn private :: point3d_add private :: point3d_norm !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! USER-DEFINED TYPES... ! This is a definition to use in declarations of real variables, ! parameters, etc. integer, parameter, public :: kr = selected_real_kind(10) ! This is a user-defined type type, public :: point3d real(kind=kr) :: x, y, z end type point3d ! This type is useless: it is only an example of type definition! type, public :: example_type complex(kind=kr) :: c ! <-- a complex number (two reals of kind kr)! real, dimension(-10:10) :: & ! <-- this line does not end here! r1, r2 ! <-- this is the final part of the previous line real, pointer, dimension(:) :: pointer_to_array_of_real real, dimension(:), pointer :: array_of_pointer_to_real end type example_type !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! INTERFACES... ! Interface for the norm of a 3-D vector interface operator(.norm.) module procedure point3d_norm end interface ! Interface for the operator '+' interface operator(+) module procedure point3d_add end interface !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! SOME DECLARATIONS... ! A real number can be declared with the following line: real(kind=kr) :: real_var1 ! But if you are not interested on the precision of floating point numbers, ! you can use simply: real :: real_var2 ! An array can be declared in two ways: real(kind=kr), dimension(1:10, -4:5), private :: a, b, c real(kind=kr), private :: d(1:10, -4:5) ! This is a string with fixed lenght character(len=10) :: str_var ! This is an allocatable array, which can be a target of a pointer type(example_type), private, dimension(:), allocatable, target :: & many_examples ! Fortran 90 hasn't got its own preprocessor, it uses the C preprocessor! #ifdef XXX c <-- this is a comment in the old fortran 77 style (fixed form) c This is a free form file, so we shouldn't use this kind of comments! c But fortran 90 still understands fixed form, when parsing sources with c the *.f extension. c ! <-- this 'c' shouldn't be highlighted as a comment! #endif contains ! The sum of two points pure function point3d_add(a, b) result(rs) type(point3d) :: rs type(point3d), intent(in) :: a, b rs%x = a%x + b%x rs%y = a%y + b%y rs%z = a%z + b%z end function point3d_add ! The norm of a point pure function point3d_norm(a) result(rs) real(kind=kr) :: rs type(point3d), intent(in) :: a rs = sqrt(a%x * a%x + a%y * a%y + a%z * a%z) end function point3d_norm ! A simple recursive function recursive function factorial(i) result (rs) integer :: rs integer, intent(in) :: i if ( i <= 1 ) then rs = 1 else rs = i * factorial(i - 1) end if end function factorial ! This is a useless function subroutine example_fn(int_arg, real_arg, str_arg) integer, intent(in) :: int_arg real(kind=kr), intent(out) :: real_arg character(len=*), intent(in) :: str_arg type(example_type), pointer :: p integer :: n, i, j logical :: flag flag = .true. ! .true. is not an operator! if ( flag .and. flag ) then ! .and. is a pre-defined operator print *, "blabla" end if ! Examples of inquiry functions: allocated, lbound, ubound. if ( .not. allocated(many_examples) ) then allocate( many_examples(10) ) end if print *, "Lower bound = ", lbound(many_examples, 1) print *, "Upper bound = ", ubound(many_examples, 1) p => many_examples(5) ! <-- p is a pointer ! A strange way to calculate i*i: add the first i odd numbers i = 6 j = 0 do n = 1, i j = j + (2*n - 1) end do print *, "i*i = ", i*i, j real_arg = real(j) ! <-- here the highlighting is not very good: ! it is unable to distinguish between this and a definition like: ! real(kind=kr) :: a deallocate( many_examples ) end subroutine example_fn end module module_example !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! THIS IS THE MAIN PROGRAM ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! program example use module_example ! this is another example of use of the 'implicit' keyword implicit double precision (a-h,o-z) real(kind=kr) :: var_out type(point3d) :: & a = point3d(0.0_kr, 1.0_kr, 2.0_kr), & b = point3d(4.0_kr, 5.0_kr, 6.0_kr) print *, "a + b = ", .norm. (a + b) print *, "factorial of 5 = ", factorial(5) call example_fn(1, var_out, "hello!") end program example Syntax-Highlight-Engine-Kate-0.14/samples/highlight.html0000644000175000017500000000614413032300413022545 0ustar manwarmanwar Tk::CodeText - a TextUndo widget with syntax highlighting capabilities


NAME

Tk::CodeText - a TextUndo widget with syntax highlighting capabilities


SYNOPSIS

 use Tk;
 require Tk::CodeText;
 my $m = new MainWindow;
 my $e = $m->Scrolled('CodeText',
        -disablemenu => 1,
        -syntax => 'Perl',
        -scrollbars => 'se',
 )->pack(-expand => 1, -fill => 'both');
 $m->configure(-menu => $e->menu);
 $m->MainLoop;


DESCRIPTION

Tk::CodeText inherits Tk::TextUndo and all its options and methods. Besides syntax highlighting, methods are provided for commenting and uncommenting as well as indenting and unindenting a selected area, matching pairs of braces, brackets and brackets and curlies and automatic indenting of new lines.

Syntax highlighting is done through a plugin approach. Currently there is support for Perl, Pod, HTML and Xresources. Adding languages is a matter of writing plugin modules. Theoretically this is not limited to programming languages. The plugin approach could also provide the possibility for grammar or spell checking in spoken languages.


OPTIONS

Name: autoindent
Class: Autoindent
Switch: -autoindent
Boolean, when you press the enter button, should the next line begin at the same position as the current line or not. By default false.

Name: commentchar
Class: Commentchar
Switch: -commentchar
By default ``#''.
Syntax-Highlight-Engine-Kate-0.14/samples/highlight.hs0000644000175000017500000001057013032300413022211 0ustar manwarmanwar-- test file for Haskell syntax highlighting in KDE's Kate -- The test file for literate Haskell can be easily created like this: -- cat highlight.hs | sed -e "s|^|> |" -e "s|> -- ||" -e "s|^> $||" > highlight.lhs -- You only have to manually edit the multi-line comment below. -- this is a single-line comment {- this is a multi-line comment Things like "a string" or a 'c' character shouldn't be highlighted in here. -- I could even start a new -- one-line comment. -} -- a data definition data Tree a = Br (Tree a) (Tree a) | Leaf a | Nil deriving (Show, Eq) -- function definition, "funnyfunction::", "Integer", "Int", "Bool" should be highlighted funnyfunction::(Tree a)=>[a]->Integer->Int->Bool -- strings and chars -- first line of function definitions (type declaration) should be highlighted strangefunction::Int->String strangefunction 1 = "hello" strangefunction 2 = "what's up" strangefunction 3 = (strangefunction 1) ++ ", " ++ (strangefunction 2) strangefunction 4 = 'a':'b':'c':'"':[] -- will return "abc" strangefunction 5 = '\n':[] strangefunction 6 = '\invalidhaskell':[] -- function name including the single quote character -- and infix operator (`div`) justtesting'::Int->Int justtesting' 2 = 2+1 justtesting' 9 = 7 `div` 2 -- same definition as above, slightly different function name and a couple more whitespaces justtesting'' :: Int -> Int justtesting'' 2 = 3 justtesting'' 9 = 3 + 9 - 9 -- the following lines are copied out of Haskell's "Prelude.hs" infixl 7 *, /, `quot`, `rem`, `div`, `mod`, :%, % -- everything highlighted except the "a" class Bounded a where minBound, maxBound :: a class (Num a, Ord a) => Real a where toRational :: a -> Rational -- finally, some keyword lists -- keywords case, class, data, deriving, do, else, if, in, infixl, infixr, instance, let, module, of, primitive, then, type, where -- infix operators quot, rem, div, mod, elem, notElem, seq -- this stuff is not handled yet !!, %, &&, $!, $, *, **, -,., /=, <, <=, =<<, ==, >, >=, >>, >>=, ^, ^^, ++, || -- functions FilePath, IOError, abs, acos, acosh, all, and, any, appendFile, approxRational, asTypeOf, asin, asinh, atan, atan2, atanh, basicIORun, break, catch, ceiling, chr, compare, concat, concatMap, const, cos, cosh, curry, cycle, decodeFloat, denominator, digitToInt, div, divMod, drop, dropWhile, either, elem, encodeFloat, enumFrom, enumFromThen, enumFromThenTo, enumFromTo, error, even, exp, exponent, fail, filter, flip, floatDigits, floatRadix, floatRange, floor, fmap, foldl, foldl1, foldr, foldr1, fromDouble, fromEnum, fromInt, fromInteger, fromIntegral, fromRational, fst, gcd, getChar, getContents, getLine, head, id, inRange, index, init, intToDigit, interact, ioError, isAlpha, isAlphaNum, isAscii, isControl, isDenormalized, isDigit, isHexDigit, isIEEE, isInfinite, isLower, isNaN, isNegativeZero, isOctDigit, isPrint, isSpace, isUpper, iterate, last, lcm, length, lex, lexDigits, lexLitChar, lines, log, logBase, lookup, map, mapM, mapM_, max, maxBound, maximum, maybe, min, minBound, minimum, mod, negate, not, notElem, null, numerator, odd, or, ord, otherwise, pi, pred, primExitWith, print, product, properFraction, putChar, putStr, putStrLn, quot, quotRem, range, rangeSize, read, readDec, readFile, readFloat, readHex, readIO, readInt, readList, readLitChar, readLn, readOct, readParen, readSigned, reads, readsPrec, realToFrac, recip, rem, repeat, replicate, return, reverse, round, scaleFloat, scanl, scanl1, scanr, scanr1, seq, sequence, sequence_, show, showChar, showInt, showList, showLitChar, showParen, showSigned, showString, shows, showsPrec, significand, signum, sin, sinh, snd, span, splitAt, sqrt, subtract, succ, sum, tail, take, either, elem, encodeFloat, enumFrom, enumFromThen, enumFromThenTo, enumFromTo, error, even, exp, exponent, fail, filter, flip, floatDigits, floatRadix, floatRange, floor, fmap, takeWhile, tan, tanh, threadToIOResult, toEnum, toInt, toInteger, toLower, toRational, toUpper, truncate, uncurry, undefined, unlines, until, unwords, unzip, unzip3, userError, words, writeFile, zip, zip3, zipWith, zipWith3 -- type constructors Bool, Char, Double, Either, Float, IO, Integer, Int, Maybe, Ordering, Rational, Ratio, ReadS, ShowS, String -- classes Bounded, Enum, Eq, Floating, Fractional, Functor, Integral, Ix, Monad, Num, Ord, Read, RealFloat, RealFrac, Real, Show -- data constructors EQ, False, GT, Just, LT, Left, Nothing, Right, True Syntax-Highlight-Engine-Kate-0.14/samples/highlight.awk0000644000175000017500000000066513032300413022365 0ustar manwarmanwar#!/usr # AWK hl test # BEGIN and END are also matched as patterns BEGIN { p = 0; } /some pattern/ { p++; } # / inside brackets is not considered end of expression # a loose division operator (/) is not mismatched as a pattern. $1 =~ /[^abc/]def/ || b == 3 / 5 { gsub ( FILENAME ); } # TODO and FIXME also work in comments in Awk. # Also backslash in patterns works. /\/usr\/bin\/awk/ { print "This is me"; } END { print p; } Syntax-Highlight-Engine-Kate-0.14/samples/highlight.dox0000644000175000017500000002540213032300413022371 0ustar manwarmanwarThis is a pseudo doxygen file to test Kate's doxyge syntax highlighting. Normal text, no HL. =================== a multiline comment may begin with a /*! */, too. That should work, because it is the same "entrance rule". popping tests: /** multiline */ end of doxygen HL mode /*! multiline */ end of doxygen HL mode //! singleline, where */ should be ignored! still doxygen HL mode /// singleline, where */ should be ignored! still doxygen HL mode ///< singleline, where */ should be ignored! still doxygen HL mode begin and end immediately: /********/ actually no doxygen comment - used for "info boxes" :) /**/ <-- it really works --- end of doxygen HL mode /*!*/ end of doxygen HL mode /** \code rest of line is normal comment HL */ end of doxygen HL mode /** \code rest of line is normal comment HL * comment HL mode */ end of doxygen HL mode /** \file aword rest of line is normal comment HL */ end of doxygen HL mode /** \file */aword <-- pop! no doxygen HL mode /** \file aword rest of line is normal comment HL * comment HL mode */ end of doxygen HL mode /** \brief A short description */ end of doxygen HL mode /** \brief */A <-- pop! end of doxygen HL mode /** \brief A short description * comment HL mode */ end of doxygen HL mode /** \page aword rest of line is string */ end of doxygen HL mode /** \page */aword <-- pop! end of doxygen HL mode /** \page aword rest of line is string * comment HL mode */ end of doxygen HL mode /** \image aword aword rest of line is normal HL */ end of doxygen HL mode /** \image aword */aword <-- pop! end of doxygen HL mode /** \image */aword aword <-- pop! end of doxygen HL mode /** \image aword aword rest of line is normal HL * comment HL mode */ end of doxygen HL mode Tests for HTML tags in doxygen HL mode: ======================================= /** */ end of doxygen HL mode /** end of doxygen HL mode /** end of doxygen HL mode /** end of doxygen HL mode /** end of doxygen HL mode /** end of doxygen HL mode /** end of doxygen HL mode /** end of doxygen HL mode /** end of doxygen HL mode /** end of doxygen HL mode /** */ end of doxygen HL mode /** end of doxygen HL mode /** end of doxygen HL mode /** end of doxygen HL mode /** end of doxygen HL mode /** end of doxygen HL mode /** end of doxygen HL mode /** end of doxygen HL mode /** end of doxygen HL mode /** end of doxygen HL mode /** <*/a href="blubb"> end of doxygen HL mode //! */ stay in doygen HL mode //! stay in doygen HL mode //! stay in doygen HL mode //! stay in doygen HL mode //! stay in doygen HL mode //! stay in doygen HL mode //! */ stay in doygen HL mode //! stay in doygen HL mode //! stay in doygen HL mode //! stay in doygen HL mode //! stay in doygen HL mode //! stay in doygen HL mode //! stay in doygen HL mode //! stay in doygen HL mode //! stay in doygen HL mode //! stay in doygen HL mode //! <*/a href="blubb"> stay in doygen HL mode //! stay in doygen HL /** \code rest of line is normal comment HL */ end of doxygen HL mode /** \code rest of end of doxygen HL mode /** \code rest of end of doxygen HL mode /** \code rest of end of doxygen HL mode /** \code rest of end of doxygen HL mode /** \code rest of end of doxygen HL mode /** \code rest of end of doxygen HL mode /** \code rest of end of doxygen HL mode /** \code rest <*/a href="blubb"> of end of doxygen HL mode /** \code rest of line is normal comment HL * comment HL mode text */ end of doxygen HL mode /** \file aword rest of line is normal comment HL */ end of doxygen HL mode /** \file awo*/rd end of doxygen HL mode /** \file aword end of doxygen HL mode /** \file awo<*/html_should_be_ignored_here>rd end of doxygen HL mode /** \file a*/word end of doxygen HL mode /** \file aword rest of line is normal comment HL * comment HL mode */ end of doxygen HL mode /** \brief A short of description */ end of doxygen HL mode /** \brief A short of end of doxygen HL mode /** \brief A short of end of doxygen HL mode /** \brief A short of end of doxygen HL mode /** \brief A short of end of doxygen HL mode /** \brief A short of end of doxygen HL mode /** \brief A short of <*//a href='blubb'> end of doxygen HL mode /** \brief A short of end of doxygen HL mode /** \brief A short of end of doxygen HL mode /** \brief A short of end of doxygen HL mode /** \brief A short of end of doxygen HL mode /** \brief A short of end of doxygen HL mode /** \brief A short of end of doxygen HL mode /** \brief A short of description * comment HL mode */ end of doxygen HL mode /** \page aword A short of description */ end of doxygen HL mode /** \page aword A short of end of doxygen HL mode /** \page aword A short of end of doxygen HL mode /** \page aword A short of end of doxygen HL mode /** \page aword A short of end of doxygen HL mode /** \page aword A short of end of doxygen HL mode /** \page aword A short of <*//a href='blubb'> end of doxygen HL mode /** \page aword A short of end of doxygen HL mode /** \page aword A short of end of doxygen HL mode /** \page aword A short of end of doxygen HL mode /** \page aword A short of end of doxygen HL mode /** \page aword A short of end of doxygen HL mode /** \page aword A short of end of doxygen HL mode /** \page aword A short <*/a href="blubb"> of end of doxygen HL mode /** \page aword A shor*/t of end of doxygen HL mode /** \page awor*/d A short of end of doxygen HL mode /** \page */aword A short of end of doxygen HL mode /** \page aword A short of description * comment HL mode */ end of doxygen HL mode /** \image aword aword rest of line is normal HL */ end of doxygen HL mode /** \image aword aword rest of line is*/ end of doxygen HL mode /** \image aword aword*/ end of doxygen HL mode /** \image aword aw*/ord end of doxygen HL mode /** \image aword */aword end of doxygen HL mode /** \image aword*/ end of doxygen HL mode /** \image awo*/rd end of doxygen HL mode /** \image */aword end of doxygen HL mode /** \ima*/ge end of doxygen HL mode /** \image aword aword rest of line is normal HL * comment HL mode */ end of doxygen HL mode Some further tests for singlelinecomments (* / should not pop!) =============================================================== /// a singlelinecommment blubb blubb */. stay in doxygen HL mode /// \code a singlelinecommment blubb b*/lubb. stay in doxygen HL mode /// \code*/ a singlelinecommment blubb blubb. stay in doxygen HL mode /// \code a singlelinecommment blubb blubb /// \brief a descriptive text (string) stay in doxygen HL mode /// \brief a descriptive text (string)*/ description should go on here /// \brief a descriptive text */(string) description should go on here /// \brief */a descriptive text (string) description should go on here /// \ref aword a descriptive text (string) */ description should go on here /// \ref aword a descriptive text (str*/ing) description should go on here /// \ref aword a des*/criptive text (string) description should go on here /// \ref aword*/ a descriptive text (string) description should go on here /// \ref aw*/ord a descriptive text (string) description should go on here /// \ref */aword a descriptive text (string) description should go on here HTML comment tests: =================== //! \ref word descriptive text (string) normal HL mode. //! \ref w descriptive text (string) /** \ref word descriptive text (string) normal HL mode. /** \ref w * normal doxygen HL mode. */ And final tests for a word: a single char: =========================================== //! \ref word descriptive text (string) //! \ref w descriptive text (string) //! \image word1 word2 b descriptive text (string) //! \image a word b descriptive text (string) //! \brief A b c d e description should go on here //! \file word rest of line is normal comment HL //! \file a word rest of line is normal comment HL no doxygen HL mode here. == END OF TESTFILE ==Syntax-Highlight-Engine-Kate-0.14/samples/highlight.pb0000644000175000017500000000323513032300413022200 0ustar manwarmanwar; This is a test file for kate's PureBasic highlighting. ; BMP2x Converter by Sven Langenkamp UseJPEGImageEncoder() UsePNGImageEncoder() Declare Convert(JPEG) Enumeration 1 #JPEG #PNG EndEnumeration ; BEGIN section ; END Global Count Global file.s Global filename.s Global fileext.s Global OutputFormat Global JPEGQuality Count = 0 OutputFormat = 1 JPEGQuality = -1 ; MAIN PROGRAM------------------------------------------------------------------ ;Request Options PrintN("Output Format") PrintN(" [1] JPEG") PrintN(" [2] PNG") Print ("> ") OutputFormat = Int(Input()) Select OutputFormat Case #JPEG: fileext = ".jpg" ;Request JPEG Quality PrintN("") PrintN("JPEG Quality") PrintN(" [0-10]") Print ("> ") JPEGQuality = Int(Input()) Case #PNG: fileext = ".png" EndSelect ;Convert all BMP files in the current directory ExamineDirectory(0, "", "*.bmp") While NextDirectoryEntry() file = DirectoryEntryName() filename = GetFilePart(file) If LoadImage(0, file) Select OutputFormat Case #JPEG: Convert(JPEGQuality) Case #PNG: Convert(-1) EndSelect Count = Count +1 EndIf Wend PrintN(Str(Count) + " files converted") CloseConsole() ; PROCUDURES-------------------------------------------------------------------- Procedure Convert(JPEG) Shared filename, fileext If JPEG > -1 SaveImage(0, filename + fileext, #PB_ImagePlugin_JPEG, JPEG) Else SaveImage(0, filename + fileext, #PB_ImagePlugin_PNG) EndIf PrintN(file + " converted to " + filename + fileext) EndProcedureSyntax-Highlight-Engine-Kate-0.14/samples/highlight.e0000644000175000017500000000376113032300413022027 0ustar manwarmanwar<' extend TB_NAME_T : [ ETRC ]; extend fifo { keep soft testbench == ETRC; }; extend ETRC fifo { keep direction == POP; keep soft type == CLASSIC; keep PORT_DATAOUT == appendf("esa_data[%d]" , id); keep PORT_POP_EMPTY == appendf("fifo_empty[%d]", id); keep PORT_POP_ALMOST_EMPTY == appendf("ESA_PopAE[%d]" , id); keep PORT_POP_ALMOST_FULL == appendf("ESA_PopAF[%d]" , id); keep PORT_POP_FULL == ""; keep PORT_POP_ERROR == ""; keep PORT_POP_REQ == appendf("etrc_popreq_n[%d]" , id); keep soft PORT_POP_CLK == "sysclk"; keep soft PORT_PUSH_CLK == "sysclk"; // keep logger.verbosity == HIGH; reset_sig() is { injector.reset_sig(); '(PORT_DATAOUT)' = 0; '(PORT_POP_EMPTY)' = 0; '(PORT_POP_ALMOST_EMPTY)' = 0; '(PORT_POP_ALMOST_FULL)' = 0; '(PORT_POP_REQ)' = 0; '(PORT_POP_CLK)' = 0; '(PORT_POP_CLK)' = 1; }; event clkSys is rise('sysclk'); event bug001 is true('pkdescnt[0]' == 1)@clkSys; on bug001 { dut_error("Bug 001 found ... crash!"); }; }; extend ETRC FIFO_INJECTOR { pkt_desc_if : pkt_desc_if is instance; keep pkt_desc_if.MAC_uid == id; add_new_pkt_desc() is also { pkt_desc_if.indicate_one_pck_desc_is_come_in_FIFO(); }; reset_sig() is { pkt_desc_if.reset_sig(); }; }; extend ETRC CLASSIC fifo { keep ae_seuil == 1; keep af_seuil == 46; keep fifo_size == 56; setState() is also { if (fifo_plot &&(sys.time > 200000) && // avoid fifo plot before beginning of operation of RAMC !((injector.generated_packet_nb == injector.max_generated_packets && injector.stream.size() == 0) || injector.generated_packet_nb == 0)) { if (fifo_use_logger) { messagef(HIGH, "ETRC[%d] : %d\n", id, fifo.size()); } else { out("__fifo_plot: ", sys.time, " ", fifo.size() ); }; }; }; }; '> Syntax-Highlight-Engine-Kate-0.14/samples/highlight.abc0000644000175000017500000000047713032300413022331 0ustar manwarmanwar% Taken from http://www.gre.ac.uk/~c.walshaw/abc/#examples T:Paddy O'Rafferty C:Trad. M:6/8 K:D dff cee|def gfe|dff cee|dfe dBA|dff cee|def gfe|faf gfe|1 dfe dBA:|2 dfe dcB|| ~A3 B3|gfe fdB|AFA B2c|dfe dcB|~A3 ~B3|efe efg|faf gfe|1 dfe dcB:|2 dfe dBA|| fAA eAA|def gfe|fAA eAA|dfe dBA|fAA eAA|def gfe|faf gfe|dfe dBA:| Syntax-Highlight-Engine-Kate-0.14/samples/highlight.asm-nasm0000644000175000017500000000062713032300413023315 0ustar manwarmanwar; Example file for nasm.xml kate syntax file ; compile with `nasm example.asm -f elf -o example.o` ; and link with 'gcc example.o -o example` ; Public domain ; kate: hl Intel x86 (NASM); section .data hello dd 'Hello World', 0x0A, 0h printf_param dd '%s', 0q section .text extern printf global main main: push ebp mov ebp, esp push hello push printf_param call printf mov eax, 0b leave ret Syntax-Highlight-Engine-Kate-0.14/samples/highlight_ocaml.ml0000644000175000017500000000722013032300413023360 0ustar manwarmanwar(* ocaml test file -- a big stew of Objective Caml syntax to use to test Kate's syntax highlighting. This will not run! :-) *) (* First a little piece of real OCaml that should look right: *) #load "basic";; (* Return a default value for a BASIC variable given its identifer. *) let default_value (ident : string) : basic_value = assert (String.length ident > 0); match ident.[String.length ident - 1] with | '$' -> Str "" | '%' -> Int 0 | '!' -> Flt 0.0 | _ -> Flt 0.0 ;; (* Directives: *) #load "pa_o";; #load "pa_o";; object # meth ;; (* not a directive - a method call *) object # meth ;; (* not a directive - a method call *) (* OCaml keywords: *) and as assert asr (* etc. there so many... *) (* Additional OCaml Revised Syntax keywords: *) (* These are in a seperate category so they can be coloured to look like identifiers when ordinary OCaml syntax is being used: *) declare where value (* There's no way to reliably highlight all OCaml type expressions, (they can be very complex) so just the built-in type names are highlighted.*) exn lazy_t format unit int real char string ref array bool list option let integers : int list = [ 123456789; (* decimal *) -0xabcedf0123456789; (* hexadecimal *) 0xABCDEF0123456789; (* hexadecimal *) -0o1234567; (* octal *) 0b01001010101010; (* binary *) -0Xabcedf0123456789; (* hexadecimal *) 0XABCDEF0123456789; (* hexadecimal *) -0O1234567; (* octal *) 0B01001010101010; (* binary *) -123_456_789; (* Underscores are allowed in numeric constants. *) 0x_abce_df01_2345_6789; -0o12_34_567; 0b_0100_1010_1010_1101; ];; let floats : real list = [ 12345.6789; -1.23456789e4; (* All variations of the exponent form *) 1.23456789e+4; -1.23456789e-4; 1.23456789E-4; -1.23456789E+4; 12_345.6789; (* Underscores are allowed in numeric constants. *) -1.23_456_789e+4; 12_345.6789; ];; let characters : char list = [ 'a'; ' '; 'ä'; '\n'; '\r'; '\t'; '\b'; (* Control characters. Only these four: not the full C-language range. *) '\000'; '\128'; (* Decimal character codes. These are always 3 digits. *) '\x02'; '\xff'; '\xFF'; (* Hexadecimal character codes. These are always 3 digits. *) '\\'; '\''; '\"'; '"' (* Quote character escapes. *) ];; (* Quotes used to mark constants in parsers should not be confused with character constant quotes. "Ticks" at the end of identifiers should not be confused with character constant quotes. *) let basic_identifier = parser [< ''F'; ''N'; name = s >] -> ID (s, 'f') | [< name = s' >] -> ID (s','i') ;; let strings : string list = [ ""; (* Empty string *) "a"; " "; "ä"; "ab"; "A\nB"; "A\rB"; "A\tB"; "A\bB"; (* Control characters. Only these four: not the full C-language range. *) "A\000B"; "A\128B"; (* Decimal character codes. These are always 3 digits. *) "A\x02B"; "A\xffB"; "A\xFFB"; (* Hexadecimal character codes. These are always 3 digits. *) "A\\B"; "A\'B"; "A'B"; "A\"B"; (* Quote character escapes. *) "A multiline\ string"; ]; let camlp4_quotations = [ <> ; <:QUOTE> ; <:QUÖTÈ> ; << A quote with an escape: \>> (end-quote symbol) >> ; << A quote with an escape: \<< (plain start quote-symbol) >> ; << A quote with an escape: \<:Trouvé< (labelled start-quote symbol) >> ; ];; (* end *) Syntax-Highlight-Engine-Kate-0.14/samples/highlight.do0000644000175000017500000000560413032300413022203 0ustar manwarmanwar/* Test file for kate's stata syntax highlighting */ *! version 1.2.0 2mar2003 E. Leuven program define spellsplit version 7 syntax [anything], spell(varlist min=2 max=2) [ by(varlist)] tokenize `spell' local date0 `1' local date1 `2' local f0 : format `date0' local f1 : format `date1' /* set default statistic */ local current "mean" gettoken left anything : anything, match(prns) while "`left'"!="" { if "`prns'"!="" { if !inlist("`left'","mean","sum") { di as error "Statistic `left' not supported" exit 198 } local current "`left'" } else { local `current'vars ``current'vars' `left' } gettoken left anything : anything, match(prns) } if ("`meanvars'"!="") { confirm var `meanvars' unab meanvars : `meanvars' } if ("`sumvars'"!="") { confirm var `sumvars' unab sumvars : `sumvars' } quietly { g _count = 1 local xvars `meanvars' `sumvars' _count /* create dummy by-var if no by option is specified */ if "`by'"=="" { tempvar by g byte `by' = 1 } tempvar `xvars' `by' /* create negative for subtraction when spell ends */ cap foreach v of varlist `xvars' { g double ``v'' = -`v' local txvars `txvars' ``v'' } cap foreach v of varlist `by' { g double ``v'' = `v' local txvars `txvars' ``v'' } stack `date0' `xvars' `by' `date1' `txvars', into(`date0' `xvars' `by') clear /* calculate totals per date */ cap foreach v of varlist `xvars' { egen double ``v'' = sum(`v'), by(`by' `date0') } /* unique dates only */ by `by' `date0', sort: keep if _n==1 /* calculate totals (+ when spell starts - when ends) */ sort `by' cap foreach v of varlist `xvars' { by `by': replace `v' = sum(``v'') } by `by': g `date1' = `date0'[_n + 1] drop if `date0'>`date1' drop _stack drop if _count==0 order `by' `date0' `date1' `xvars' format `date0' `f0' format `date1' `f1' cap for var `meanvars': replace X = X/_count compress } endSyntax-Highlight-Engine-Kate-0.14/samples/highlight.tcl0000644000175000017500000000146713032300413022366 0ustar manwarmanwar# tcl syntax highlighting sample script for Kate # # author: JM. Philippe 15/03/04 # escaped characters set String \{ set String \{ set String \" set String " \" " set String " \{ " #comments and not comments # is comments ;#is comments # is comments #

is html comment

puts ok; # is comments set String [string map {
{»is not comments}} $String] set String \#not_a_comment # blocks proc test {arg1 {arg2 {}} {arg3 {fr fq r}}} { if {1} {; #comments set String \{; # not a block start } } proc test args { set String \}; # not a block end } # BEGIN - collapsable comments # blablabla # END # strings set String "feqr feqr $gqer gqe" set String "feqr feqr \" $gqer \ gqe " set String {feqr feqr \{ $gqer \ gqe } # variables set b+1 [incr b] set {incr-b} ${b+1} puts ${incr-b} Syntax-Highlight-Engine-Kate-0.14/README0000644000175000017500000000151513032300413017121 0ustar manwarmanwarSyntax-Highlight-Engine-Kate version 0.01 ========================================= INSTALLATION To install this module type the following: perl Makefile.PL make make test make install DEMOS Following demos have been provided. hlhtml.pl and hlansi.pl. After the make command you may want to try something like: cat bin/hlhtml.pl | perl -Mblib bin/hlansi.pl Perl or cat bin/hlhtml.pl | perl -Mblib bin/hlhtml.pl Perl > tst.html just to get an overview of what this module actually does. COPYRIGHT AND LICENCE Put the correct copyright and licence information here. Copyright (C) 2006 by Hans Jeuken This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available. Syntax-Highlight-Engine-Kate-0.14/MANIFEST0000644000175000017500000001760213174332720017413 0ustar manwarmanwarMETA.yml .travis.yml bin/hl-kate-convert bin/hlansi.pl bin/hlhtml.pl bin/regen.pl Changes eg/kate.pl inc/Module/Install.pm inc/Module/Install/Base.pm inc/Module/Install/Can.pm inc/Module/Install/Fetch.pm inc/Module/Install/Makefile.pm inc/Module/Install/Metadata.pm inc/Module/Install/Win32.pm inc/Module/Install/WriteAll.pm lib/Syntax/Highlight/Engine/Kate.pm lib/Syntax/Highlight/Engine/Kate/ABC.pm lib/Syntax/Highlight/Engine/Kate/Ada.pm lib/Syntax/Highlight/Engine/Kate/AHDL.pm lib/Syntax/Highlight/Engine/Kate/Alerts.pm lib/Syntax/Highlight/Engine/Kate/All.pm lib/Syntax/Highlight/Engine/Kate/ANSI_C89.pm lib/Syntax/Highlight/Engine/Kate/Ansys.pm lib/Syntax/Highlight/Engine/Kate/Apache_Configuration.pm lib/Syntax/Highlight/Engine/Kate/Asm6502.pm lib/Syntax/Highlight/Engine/Kate/ASP.pm lib/Syntax/Highlight/Engine/Kate/AVR_Assembler.pm lib/Syntax/Highlight/Engine/Kate/AWK.pm lib/Syntax/Highlight/Engine/Kate/BaseTest.pm lib/Syntax/Highlight/Engine/Kate/BaseTestchild.pm lib/Syntax/Highlight/Engine/Kate/Bash.pm lib/Syntax/Highlight/Engine/Kate/BibTeX.pm lib/Syntax/Highlight/Engine/Kate/C.pm lib/Syntax/Highlight/Engine/Kate/Cdash.pm lib/Syntax/Highlight/Engine/Kate/Cg.pm lib/Syntax/Highlight/Engine/Kate/CGiS.pm lib/Syntax/Highlight/Engine/Kate/ChangeLog.pm lib/Syntax/Highlight/Engine/Kate/Cisco.pm lib/Syntax/Highlight/Engine/Kate/Clipper.pm lib/Syntax/Highlight/Engine/Kate/CMake.pm lib/Syntax/Highlight/Engine/Kate/ColdFusion.pm lib/Syntax/Highlight/Engine/Kate/Common_Lisp.pm lib/Syntax/Highlight/Engine/Kate/ComponentminusPascal.pm lib/Syntax/Highlight/Engine/Kate/Convert/ToolKit.pm lib/Syntax/Highlight/Engine/Kate/Convert/XMLData.pm lib/Syntax/Highlight/Engine/Kate/Cplusplus.pm lib/Syntax/Highlight/Engine/Kate/CSS.pm lib/Syntax/Highlight/Engine/Kate/CSS_PHP.pm lib/Syntax/Highlight/Engine/Kate/CUE_Sheet.pm lib/Syntax/Highlight/Engine/Kate/D.pm lib/Syntax/Highlight/Engine/Kate/De_DE.pm lib/Syntax/Highlight/Engine/Kate/Debian_Changelog.pm lib/Syntax/Highlight/Engine/Kate/Debian_Control.pm lib/Syntax/Highlight/Engine/Kate/Desktop.pm lib/Syntax/Highlight/Engine/Kate/Diff.pm lib/Syntax/Highlight/Engine/Kate/Doxygen.pm lib/Syntax/Highlight/Engine/Kate/E_Language.pm lib/Syntax/Highlight/Engine/Kate/Eiffel.pm lib/Syntax/Highlight/Engine/Kate/Email.pm lib/Syntax/Highlight/Engine/Kate/En_US.pm lib/Syntax/Highlight/Engine/Kate/Euphoria.pm lib/Syntax/Highlight/Engine/Kate/Ferite.pm lib/Syntax/Highlight/Engine/Kate/Fortran.pm lib/Syntax/Highlight/Engine/Kate/FourGL.pm lib/Syntax/Highlight/Engine/Kate/FourGLminusPER.pm lib/Syntax/Highlight/Engine/Kate/FreeBASIC.pm lib/Syntax/Highlight/Engine/Kate/GDL.pm lib/Syntax/Highlight/Engine/Kate/GLSL.pm lib/Syntax/Highlight/Engine/Kate/GNU_Assembler.pm lib/Syntax/Highlight/Engine/Kate/GNU_Gettext.pm lib/Syntax/Highlight/Engine/Kate/Haskell.pm lib/Syntax/Highlight/Engine/Kate/HTML.pm lib/Syntax/Highlight/Engine/Kate/IDL.pm lib/Syntax/Highlight/Engine/Kate/ILERPG.pm lib/Syntax/Highlight/Engine/Kate/Inform.pm lib/Syntax/Highlight/Engine/Kate/INI_Files.pm lib/Syntax/Highlight/Engine/Kate/Intel_x86_NASM.pm lib/Syntax/Highlight/Engine/Kate/Java.pm lib/Syntax/Highlight/Engine/Kate/Javadoc.pm lib/Syntax/Highlight/Engine/Kate/JavaScript.pm lib/Syntax/Highlight/Engine/Kate/JavaScript_PHP.pm lib/Syntax/Highlight/Engine/Kate/JSP.pm lib/Syntax/Highlight/Engine/Kate/Kate_File_Template.pm lib/Syntax/Highlight/Engine/Kate/KBasic.pm lib/Syntax/Highlight/Engine/Kate/LaTeX.pm lib/Syntax/Highlight/Engine/Kate/LDIF.pm lib/Syntax/Highlight/Engine/Kate/Lex_Flex.pm lib/Syntax/Highlight/Engine/Kate/LilyPond.pm lib/Syntax/Highlight/Engine/Kate/Literate_Haskell.pm lib/Syntax/Highlight/Engine/Kate/Logtalk.pm lib/Syntax/Highlight/Engine/Kate/LPC.pm lib/Syntax/Highlight/Engine/Kate/Lua.pm lib/Syntax/Highlight/Engine/Kate/M3U.pm lib/Syntax/Highlight/Engine/Kate/MABminusDB.pm lib/Syntax/Highlight/Engine/Kate/Makefile.pm lib/Syntax/Highlight/Engine/Kate/Mason.pm lib/Syntax/Highlight/Engine/Kate/Matlab.pm lib/Syntax/Highlight/Engine/Kate/MIPS_Assembler.pm lib/Syntax/Highlight/Engine/Kate/Modulaminus2.pm lib/Syntax/Highlight/Engine/Kate/Music_Publisher.pm lib/Syntax/Highlight/Engine/Kate/Nl.pm lib/Syntax/Highlight/Engine/Kate/Objective_Caml.pm lib/Syntax/Highlight/Engine/Kate/ObjectiveminusC.pm lib/Syntax/Highlight/Engine/Kate/Octave.pm lib/Syntax/Highlight/Engine/Kate/Pascal.pm lib/Syntax/Highlight/Engine/Kate/Perl.pm lib/Syntax/Highlight/Engine/Kate/Perl6.pm lib/Syntax/Highlight/Engine/Kate/PHP_HTML.pm lib/Syntax/Highlight/Engine/Kate/PHP_PHP.pm lib/Syntax/Highlight/Engine/Kate/PicAsm.pm lib/Syntax/Highlight/Engine/Kate/Pike.pm lib/Syntax/Highlight/Engine/Kate/PostScript.pm lib/Syntax/Highlight/Engine/Kate/POVminusRay.pm lib/Syntax/Highlight/Engine/Kate/Progress.pm lib/Syntax/Highlight/Engine/Kate/Prolog.pm lib/Syntax/Highlight/Engine/Kate/PureBasic.pm lib/Syntax/Highlight/Engine/Kate/Python.pm lib/Syntax/Highlight/Engine/Kate/Quake_Script.pm lib/Syntax/Highlight/Engine/Kate/R_Script.pm lib/Syntax/Highlight/Engine/Kate/RenderMan_RIB.pm lib/Syntax/Highlight/Engine/Kate/REXX.pm lib/Syntax/Highlight/Engine/Kate/RPM_Spec.pm lib/Syntax/Highlight/Engine/Kate/RSI_IDL.pm lib/Syntax/Highlight/Engine/Kate/Ruby.pm lib/Syntax/Highlight/Engine/Kate/Sather.pm lib/Syntax/Highlight/Engine/Kate/Scheme.pm lib/Syntax/Highlight/Engine/Kate/Scilab.pm lib/Syntax/Highlight/Engine/Kate/SGML.pm lib/Syntax/Highlight/Engine/Kate/Sieve.pm lib/Syntax/Highlight/Engine/Kate/SML.pm lib/Syntax/Highlight/Engine/Kate/Spice.pm lib/Syntax/Highlight/Engine/Kate/SQL.pm lib/Syntax/Highlight/Engine/Kate/SQL_MySQL.pm lib/Syntax/Highlight/Engine/Kate/SQL_PostgreSQL.pm lib/Syntax/Highlight/Engine/Kate/Stata.pm lib/Syntax/Highlight/Engine/Kate/TaskJuggler.pm lib/Syntax/Highlight/Engine/Kate/Tcl_Tk.pm lib/Syntax/Highlight/Engine/Kate/Template.pm lib/Syntax/Highlight/Engine/Kate/TI_Basic.pm lib/Syntax/Highlight/Engine/Kate/Txt2tags.pm lib/Syntax/Highlight/Engine/Kate/UnrealScript.pm lib/Syntax/Highlight/Engine/Kate/Velocity.pm lib/Syntax/Highlight/Engine/Kate/Verilog.pm lib/Syntax/Highlight/Engine/Kate/VHDL.pm lib/Syntax/Highlight/Engine/Kate/VRML.pm lib/Syntax/Highlight/Engine/Kate/Wikimedia.pm lib/Syntax/Highlight/Engine/Kate/WINE_Config.pm lib/Syntax/Highlight/Engine/Kate/XHarbour.pm lib/Syntax/Highlight/Engine/Kate/XML.pm lib/Syntax/Highlight/Engine/Kate/XML_Debug.pm lib/Syntax/Highlight/Engine/Kate/Xorg_Configuration.pm lib/Syntax/Highlight/Engine/Kate/Xslt.pm lib/Syntax/Highlight/Engine/Kate/Yacas.pm lib/Syntax/Highlight/Engine/Kate/Yacc_Bison.pm Makefile.PL MANIFEST This list of files README REGISTERED samples/highlight.abc samples/highlight.ahdl samples/highlight.asm samples/highlight.asm-avr samples/highlight.asm-nasm samples/highlight.asp samples/highlight.awk samples/highlight.basetest samples/highlight.bib samples/highlight.cmake samples/highlight.cpp samples/highlight.css samples/highlight.desktop samples/highlight.do samples/highlight.dox samples/highlight.e samples/highlight.eml samples/highlight.exu samples/highlight.f90 samples/highlight.glsl samples/highlight.hs samples/highlight.html samples/highlight.java samples/highlight.js samples/highlight.jsp samples/highlight.lex samples/highlight.lhs samples/highlight.lisp samples/highlight.ly samples/highlight.m samples/highlight.m3u samples/highlight.pb samples/highlight.php samples/highlight.pike samples/highlight.pl samples/highlight.pov samples/highlight.prg samples/highlight.ps samples/highlight.py samples/highlight.rb samples/highlight.rib samples/highlight.scheme samples/highlight.sh samples/highlight.sp samples/highlight.tcl samples/highlight.tex samples/highlight.uc samples/highlight.wrl samples/highlight.xml samples/highlight.xsl samples/highlight.y samples/highlight_lpc.c samples/highlight_ocaml.ml samples/highlight_octave.m samples/xorg.conf t/02-perl.t t/10-case.t t/Kate.t t/lib/TestHighlight.pm t/perl/before/kate.pl t/perl/before/maze.pl t/perl/before/template.pl t/perl/highlighted/kate.pl t/perl/highlighted/maze.pl t/perl/highlighted/template.pl t/perl_highlighting.t t/perl_todo.t xt/author/pod.t Syntax-Highlight-Engine-Kate-0.14/META.yml0000644000175000017500000000150613226471376017540 0ustar manwarmanwar--- abstract: 'a port to Perl of the syntax highlight engine of the Kate text editor.' author: - 'Hans Jeuken' build_requires: ExtUtils::MakeMaker: 6.59 Term::ANSIColor: 0 Test::Differences: 0.61 Test::More: 1.00 Test::Warn: 0.30 configure_requires: ExtUtils::MakeMaker: 6.59 distribution_type: module dynamic_config: 1 generated_by: 'Module::Install version 1.16' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Syntax-Highlight-Engine-Kate no_index: directory: - eg - inc - t - xt requires: Carp: 0 Data::Dumper: 0 File::Basename: 0 Path::Tiny: 0 perl: 5.006 resources: homepage: http://padre.perlide.org/ license: http://dev.perl.org/licenses/ repository: https://github.com/szabgab/Syntax-Highlight-Engine-Kate version: 0.14 Syntax-Highlight-Engine-Kate-0.14/Changes0000644000175000017500000000533513226471325017560 0ustar manwarmanwarRevision history for Perl extension Syntax::Highlight::Engine::Kate. 0.14 2018-01-13 MANWAR - Applied patch provided by @gregoa (RT #124073). 0.13 2017-11-28 MANWAR - Applied the patch provided by the original author @HANJE. 0.12 2017-10-26 MANWAR - Added META.yml back to MANIFEST file. 0.11 2017-10-26 MANWAR - [2017-10-26]: Tidied up .gitignore, Changes and MANIFEST file. - [2017-10-26]: Merge pull request #15 from kiwiroy/rt-76160 - [2017-01-02]: Merge pull request #14 from manwar/fix-cpants-issues - [2016-10-04]: Merge pull request #13 from pauloscustodio/pscust_1 - [2015-10-18]: Merge pull request #12 from nichtich/master 0.10 2015-08-01 - Documentation cleanup (Andy Jack) 0.09 2014-06-07 - Require Test::Warn for testing. - Support case insensitive names. RT #84982 (Jeff Fearn) - Replace use of File::Slurp with Path::Tiny (Martin McGrath) - Spelling RT #88156 (Debian) - Better error message when plugin is missing RT #20873 0.08 2013-05-27 - Add stub files Syntax::Highlight::Engine::Kate::BaseTest and Syntax::Highlight::Engine::Kate::BaseTestchild to kick the old ones out of the PAUSE index. #85463 0.07 2012-09-23 - fixed some errors in the BibTeX-related documentation (ZENOG) - revisited conversion of Kate's highlight definitions (Jan Pokorny) - Added some regression tests (Ovid) - Some cleanup and adding conversion script (jnpkrn) 0.06 2009-07-23 - Fixing #45512: broken test by silencing the warnings - Switch to use Test::More - Switch to Module::Install 0.05 2009-06-08 - Released by Gabor Szabo - Adding test and fixing RT bug #36328: no BaseTest and BaseTestchild modules 0.04 2008-02-04 0.03 2008-02-03 - Fixed countless errors. - Added support for Ansys, Apache Configuration, Email, FreeBASIC, Kate File Template, de_DE, en_EN, nl, M3U, Wikimedia, x.org Configuration - No more 16 Mb output at make test 0.02 2006-11-01 - Fixed bug in Perl with the q' ' construct. - Fixed bug in Template where testDetectSpaces would include a newline. - Moved all highlighting Methods from Kate to Template, so plugins can now function standalone. - Fixed reset, it did not work properly if Kate was screwed up by bugs, now it does. - Updated documentation. - Fixed startup penalty for Kate. Kate does not load all plugins at atartup, but searches for them programmatically. - Rewrote testing, Windows OS should now be able to cope with the length of the test-harness commandline. - Optimized testmethods in Template, gained some speed. 0.01 2006-05-29 - First release Syntax-Highlight-Engine-Kate-0.14/inc/0000755000175000017500000000000013226471445017033 5ustar manwarmanwarSyntax-Highlight-Engine-Kate-0.14/inc/Module/0000755000175000017500000000000013226471445020260 5ustar manwarmanwarSyntax-Highlight-Engine-Kate-0.14/inc/Module/Install.pm0000644000175000017500000003021713226471375022231 0ustar manwarmanwar#line 1 package Module::Install; # For any maintainers: # The load order for Module::Install is a bit magic. # It goes something like this... # # IF ( host has Module::Install installed, creating author mode ) { # 1. Makefile.PL calls "use inc::Module::Install" # 2. $INC{inc/Module/Install.pm} set to installed version of inc::Module::Install # 3. The installed version of inc::Module::Install loads # 4. inc::Module::Install calls "require Module::Install" # 5. The ./inc/ version of Module::Install loads # } ELSE { # 1. Makefile.PL calls "use inc::Module::Install" # 2. $INC{inc/Module/Install.pm} set to ./inc/ version of Module::Install # 3. The ./inc/ version of Module::Install loads # } use 5.006; use strict 'vars'; use Cwd (); use File::Find (); use File::Path (); use vars qw{$VERSION $MAIN}; BEGIN { # All Module::Install core packages now require synchronised versions. # This will be used to ensure we don't accidentally load old or # different versions of modules. # This is not enforced yet, but will be some time in the next few # releases once we can make sure it won't clash with custom # Module::Install extensions. $VERSION = '1.16'; # Storage for the pseudo-singleton $MAIN = undef; *inc::Module::Install::VERSION = *VERSION; @inc::Module::Install::ISA = __PACKAGE__; } sub import { my $class = shift; my $self = $class->new(@_); my $who = $self->_caller; #------------------------------------------------------------- # all of the following checks should be included in import(), # to allow "eval 'require Module::Install; 1' to test # installation of Module::Install. (RT #51267) #------------------------------------------------------------- # Whether or not inc::Module::Install is actually loaded, the # $INC{inc/Module/Install.pm} is what will still get set as long as # the caller loaded module this in the documented manner. # If not set, the caller may NOT have loaded the bundled version, and thus # they may not have a MI version that works with the Makefile.PL. This would # result in false errors or unexpected behaviour. And we don't want that. my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm'; unless ( $INC{$file} ) { die <<"END_DIE" } Please invoke ${\__PACKAGE__} with: use inc::${\__PACKAGE__}; not: use ${\__PACKAGE__}; END_DIE # This reportedly fixes a rare Win32 UTC file time issue, but # as this is a non-cross-platform XS module not in the core, # we shouldn't really depend on it. See RT #24194 for detail. # (Also, this module only supports Perl 5.6 and above). eval "use Win32::UTCFileTime" if $^O eq 'MSWin32' && $] >= 5.006; # If the script that is loading Module::Install is from the future, # then make will detect this and cause it to re-run over and over # again. This is bad. Rather than taking action to touch it (which # is unreliable on some platforms and requires write permissions) # for now we should catch this and refuse to run. if ( -f $0 ) { my $s = (stat($0))[9]; # If the modification time is only slightly in the future, # sleep briefly to remove the problem. my $a = $s - time; if ( $a > 0 and $a < 5 ) { sleep 5 } # Too far in the future, throw an error. my $t = time; if ( $s > $t ) { die <<"END_DIE" } Your installer $0 has a modification time in the future ($s > $t). This is known to create infinite loops in make. Please correct this, then run $0 again. END_DIE } # Build.PL was formerly supported, but no longer is due to excessive # difficulty in implementing every single feature twice. if ( $0 =~ /Build.PL$/i ) { die <<"END_DIE" } Module::Install no longer supports Build.PL. It was impossible to maintain duel backends, and has been deprecated. Please remove all Build.PL files and only use the Makefile.PL installer. END_DIE #------------------------------------------------------------- # To save some more typing in Module::Install installers, every... # use inc::Module::Install # ...also acts as an implicit use strict. $^H |= strict::bits(qw(refs subs vars)); #------------------------------------------------------------- unless ( -f $self->{file} ) { foreach my $key (keys %INC) { delete $INC{$key} if $key =~ /Module\/Install/; } local $^W; require "$self->{path}/$self->{dispatch}.pm"; File::Path::mkpath("$self->{prefix}/$self->{author}"); $self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self ); $self->{admin}->init; @_ = ($class, _self => $self); goto &{"$self->{name}::import"}; } local $^W; *{"${who}::AUTOLOAD"} = $self->autoload; $self->preload; # Unregister loader and worker packages so subdirs can use them again delete $INC{'inc/Module/Install.pm'}; delete $INC{'Module/Install.pm'}; # Save to the singleton $MAIN = $self; return 1; } sub autoload { my $self = shift; my $who = $self->_caller; my $cwd = Cwd::getcwd(); my $sym = "${who}::AUTOLOAD"; $sym->{$cwd} = sub { my $pwd = Cwd::getcwd(); if ( my $code = $sym->{$pwd} ) { # Delegate back to parent dirs goto &$code unless $cwd eq $pwd; } unless ($$sym =~ s/([^:]+)$//) { # XXX: it looks like we can't retrieve the missing function # via $$sym (usually $main::AUTOLOAD) in this case. # I'm still wondering if we should slurp Makefile.PL to # get some context or not ... my ($package, $file, $line) = caller; die <<"EOT"; Unknown function is found at $file line $line. Execution of $file aborted due to runtime errors. If you're a contributor to a project, you may need to install some Module::Install extensions from CPAN (or other repository). If you're a user of a module, please contact the author. EOT } my $method = $1; if ( uc($method) eq $method ) { # Do nothing return; } elsif ( $method =~ /^_/ and $self->can($method) ) { # Dispatch to the root M:I class return $self->$method(@_); } # Dispatch to the appropriate plugin unshift @_, ( $self, $1 ); goto &{$self->can('call')}; }; } sub preload { my $self = shift; unless ( $self->{extensions} ) { $self->load_extensions( "$self->{prefix}/$self->{path}", $self ); } my @exts = @{$self->{extensions}}; unless ( @exts ) { @exts = $self->{admin}->load_all_extensions; } my %seen; foreach my $obj ( @exts ) { while (my ($method, $glob) = each %{ref($obj) . '::'}) { next unless $obj->can($method); next if $method =~ /^_/; next if $method eq uc($method); $seen{$method}++; } } my $who = $self->_caller; foreach my $name ( sort keys %seen ) { local $^W; *{"${who}::$name"} = sub { ${"${who}::AUTOLOAD"} = "${who}::$name"; goto &{"${who}::AUTOLOAD"}; }; } } sub new { my ($class, %args) = @_; delete $INC{'FindBin.pm'}; { # to suppress the redefine warning local $SIG{__WARN__} = sub {}; require FindBin; } # ignore the prefix on extension modules built from top level. my $base_path = Cwd::abs_path($FindBin::Bin); unless ( Cwd::abs_path(Cwd::getcwd()) eq $base_path ) { delete $args{prefix}; } return $args{_self} if $args{_self}; $args{dispatch} ||= 'Admin'; $args{prefix} ||= 'inc'; $args{author} ||= ($^O eq 'VMS' ? '_author' : '.author'); $args{bundle} ||= 'inc/BUNDLES'; $args{base} ||= $base_path; $class =~ s/^\Q$args{prefix}\E:://; $args{name} ||= $class; $args{version} ||= $class->VERSION; unless ( $args{path} ) { $args{path} = $args{name}; $args{path} =~ s!::!/!g; } $args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm"; $args{wrote} = 0; bless( \%args, $class ); } sub call { my ($self, $method) = @_; my $obj = $self->load($method) or return; splice(@_, 0, 2, $obj); goto &{$obj->can($method)}; } sub load { my ($self, $method) = @_; $self->load_extensions( "$self->{prefix}/$self->{path}", $self ) unless $self->{extensions}; foreach my $obj (@{$self->{extensions}}) { return $obj if $obj->can($method); } my $admin = $self->{admin} or die <<"END_DIE"; The '$method' method does not exist in the '$self->{prefix}' path! Please remove the '$self->{prefix}' directory and run $0 again to load it. END_DIE my $obj = $admin->load($method, 1); push @{$self->{extensions}}, $obj; $obj; } sub load_extensions { my ($self, $path, $top) = @_; my $should_reload = 0; unless ( grep { ! ref $_ and lc $_ eq lc $self->{prefix} } @INC ) { unshift @INC, $self->{prefix}; $should_reload = 1; } foreach my $rv ( $self->find_extensions($path) ) { my ($file, $pkg) = @{$rv}; next if $self->{pathnames}{$pkg}; local $@; my $new = eval { local $^W; require $file; $pkg->can('new') }; unless ( $new ) { warn $@ if $@; next; } $self->{pathnames}{$pkg} = $should_reload ? delete $INC{$file} : $INC{$file}; push @{$self->{extensions}}, &{$new}($pkg, _top => $top ); } $self->{extensions} ||= []; } sub find_extensions { my ($self, $path) = @_; my @found; File::Find::find( sub { my $file = $File::Find::name; return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is; my $subpath = $1; return if lc($subpath) eq lc($self->{dispatch}); $file = "$self->{path}/$subpath.pm"; my $pkg = "$self->{name}::$subpath"; $pkg =~ s!/!::!g; # If we have a mixed-case package name, assume case has been preserved # correctly. Otherwise, root through the file to locate the case-preserved # version of the package name. if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) { my $content = Module::Install::_read($subpath . '.pm'); my $in_pod = 0; foreach ( split /\n/, $content ) { $in_pod = 1 if /^=\w/; $in_pod = 0 if /^=cut/; next if ($in_pod || /^=cut/); # skip pod text next if /^\s*#/; # and comments if ( m/^\s*package\s+($pkg)\s*;/i ) { $pkg = $1; last; } } } push @found, [ $file, $pkg ]; }, $path ) if -d $path; @found; } ##################################################################### # Common Utility Functions sub _caller { my $depth = 0; my $call = caller($depth); while ( $call eq __PACKAGE__ ) { $depth++; $call = caller($depth); } return $call; } # Done in evals to avoid confusing Perl::MinimumVersion eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@; sub _read { local *FH; open( FH, '<', $_[0] ) or die "open($_[0]): $!"; binmode FH; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; } END_NEW sub _read { local *FH; open( FH, "< $_[0]" ) or die "open($_[0]): $!"; binmode FH; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; } END_OLD sub _readperl { my $string = Module::Install::_read($_[0]); $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg; $string =~ s/(\n)\n*__(?:DATA|END)__\b.*\z/$1/s; $string =~ s/\n\n=\w+.+?\n\n=cut\b.+?\n+/\n\n/sg; return $string; } sub _readpod { my $string = Module::Install::_read($_[0]); $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg; return $string if $_[0] =~ /\.pod\z/; $string =~ s/(^|\n=cut\b.+?\n+)[^=\s].+?\n(\n=\w+|\z)/$1$2/sg; $string =~ s/\n*=pod\b[^\n]*\n+/\n\n/sg; $string =~ s/\n*=cut\b[^\n]*\n+/\n\n/sg; $string =~ s/^\n+//s; return $string; } # Done in evals to avoid confusing Perl::MinimumVersion eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@; sub _write { local *FH; open( FH, '>', $_[0] ) or die "open($_[0]): $!"; binmode FH; foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!"; } close FH or die "close($_[0]): $!"; } END_NEW sub _write { local *FH; open( FH, "> $_[0]" ) or die "open($_[0]): $!"; binmode FH; foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!"; } close FH or die "close($_[0]): $!"; } END_OLD # _version is for processing module versions (eg, 1.03_05) not # Perl versions (eg, 5.8.1). sub _version { my $s = shift || 0; my $d =()= $s =~ /(\.)/g; if ( $d >= 2 ) { # Normalise multipart versions $s =~ s/(\.)(\d{1,3})/sprintf("$1%03d",$2)/eg; } $s =~ s/^(\d+)\.?//; my $l = $1 || 0; my @v = map { $_ . '0' x (3 - length $_) } $s =~ /(\d{1,3})\D?/g; $l = $l . '.' . join '', @v if @v; return $l + 0; } sub _cmp { _version($_[1]) <=> _version($_[2]); } # Cloned from Params::Util::_CLASS sub _CLASS { ( defined $_[0] and ! ref $_[0] and $_[0] =~ m/^[^\W\d]\w*(?:::\w+)*\z/s ) ? $_[0] : undef; } 1; # Copyright 2008 - 2012 Adam Kennedy. Syntax-Highlight-Engine-Kate-0.14/inc/Module/Install/0000755000175000017500000000000013226471445021666 5ustar manwarmanwarSyntax-Highlight-Engine-Kate-0.14/inc/Module/Install/Makefile.pm0000644000175000017500000002743713226471376023761 0ustar manwarmanwar#line 1 package Module::Install::Makefile; use strict 'vars'; use ExtUtils::MakeMaker (); use Module::Install::Base (); use Fcntl qw/:flock :seek/; use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } sub Makefile { $_[0] } my %seen = (); sub prompt { shift; # Infinite loop protection my @c = caller(); if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) { die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])"; } # In automated testing or non-interactive session, always use defaults if ( ($ENV{AUTOMATED_TESTING} or -! -t STDIN) and ! $ENV{PERL_MM_USE_DEFAULT} ) { local $ENV{PERL_MM_USE_DEFAULT} = 1; goto &ExtUtils::MakeMaker::prompt; } else { goto &ExtUtils::MakeMaker::prompt; } } # Store a cleaned up version of the MakeMaker version, # since we need to behave differently in a variety of # ways based on the MM version. my $makemaker = eval $ExtUtils::MakeMaker::VERSION; # If we are passed a param, do a "newer than" comparison. # Otherwise, just return the MakeMaker version. sub makemaker { ( @_ < 2 or $makemaker >= eval($_[1]) ) ? $makemaker : 0 } # Ripped from ExtUtils::MakeMaker 6.56, and slightly modified # as we only need to know here whether the attribute is an array # or a hash or something else (which may or may not be appendable). my %makemaker_argtype = ( C => 'ARRAY', CONFIG => 'ARRAY', # CONFIGURE => 'CODE', # ignore DIR => 'ARRAY', DL_FUNCS => 'HASH', DL_VARS => 'ARRAY', EXCLUDE_EXT => 'ARRAY', EXE_FILES => 'ARRAY', FUNCLIST => 'ARRAY', H => 'ARRAY', IMPORTS => 'HASH', INCLUDE_EXT => 'ARRAY', LIBS => 'ARRAY', # ignore '' MAN1PODS => 'HASH', MAN3PODS => 'HASH', META_ADD => 'HASH', META_MERGE => 'HASH', PL_FILES => 'HASH', PM => 'HASH', PMLIBDIRS => 'ARRAY', PMLIBPARENTDIRS => 'ARRAY', PREREQ_PM => 'HASH', CONFIGURE_REQUIRES => 'HASH', SKIP => 'ARRAY', TYPEMAPS => 'ARRAY', XS => 'HASH', # VERSION => ['version',''], # ignore # _KEEP_AFTER_FLUSH => '', clean => 'HASH', depend => 'HASH', dist => 'HASH', dynamic_lib=> 'HASH', linkext => 'HASH', macro => 'HASH', postamble => 'HASH', realclean => 'HASH', test => 'HASH', tool_autosplit => 'HASH', # special cases where you can use makemaker_append CCFLAGS => 'APPENDABLE', DEFINE => 'APPENDABLE', INC => 'APPENDABLE', LDDLFLAGS => 'APPENDABLE', LDFROM => 'APPENDABLE', ); sub makemaker_args { my ($self, %new_args) = @_; my $args = ( $self->{makemaker_args} ||= {} ); foreach my $key (keys %new_args) { if ($makemaker_argtype{$key}) { if ($makemaker_argtype{$key} eq 'ARRAY') { $args->{$key} = [] unless defined $args->{$key}; unless (ref $args->{$key} eq 'ARRAY') { $args->{$key} = [$args->{$key}] } push @{$args->{$key}}, ref $new_args{$key} eq 'ARRAY' ? @{$new_args{$key}} : $new_args{$key}; } elsif ($makemaker_argtype{$key} eq 'HASH') { $args->{$key} = {} unless defined $args->{$key}; foreach my $skey (keys %{ $new_args{$key} }) { $args->{$key}{$skey} = $new_args{$key}{$skey}; } } elsif ($makemaker_argtype{$key} eq 'APPENDABLE') { $self->makemaker_append($key => $new_args{$key}); } } else { if (defined $args->{$key}) { warn qq{MakeMaker attribute "$key" is overriden; use "makemaker_append" to append values\n}; } $args->{$key} = $new_args{$key}; } } return $args; } # For mm args that take multiple space-separated args, # append an argument to the current list. sub makemaker_append { my $self = shift; my $name = shift; my $args = $self->makemaker_args; $args->{$name} = defined $args->{$name} ? join( ' ', $args->{$name}, @_ ) : join( ' ', @_ ); } sub build_subdirs { my $self = shift; my $subdirs = $self->makemaker_args->{DIR} ||= []; for my $subdir (@_) { push @$subdirs, $subdir; } } sub clean_files { my $self = shift; my $clean = $self->makemaker_args->{clean} ||= {}; %$clean = ( %$clean, FILES => join ' ', grep { length $_ } ($clean->{FILES} || (), @_), ); } sub realclean_files { my $self = shift; my $realclean = $self->makemaker_args->{realclean} ||= {}; %$realclean = ( %$realclean, FILES => join ' ', grep { length $_ } ($realclean->{FILES} || (), @_), ); } sub libs { my $self = shift; my $libs = ref $_[0] ? shift : [ shift ]; $self->makemaker_args( LIBS => $libs ); } sub inc { my $self = shift; $self->makemaker_args( INC => shift ); } sub _wanted_t { } sub tests_recursive { my $self = shift; my $dir = shift || 't'; unless ( -d $dir ) { die "tests_recursive dir '$dir' does not exist"; } my %tests = map { $_ => 1 } split / /, ($self->tests || ''); require File::Find; File::Find::find( sub { /\.t$/ and -f $_ and $tests{"$File::Find::dir/*.t"} = 1 }, $dir ); $self->tests( join ' ', sort keys %tests ); } sub write { my $self = shift; die "&Makefile->write() takes no arguments\n" if @_; # Check the current Perl version my $perl_version = $self->perl_version; if ( $perl_version ) { eval "use $perl_version; 1" or die "ERROR: perl: Version $] is installed, " . "but we need version >= $perl_version"; } # Make sure we have a new enough MakeMaker require ExtUtils::MakeMaker; if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) { # This previous attempted to inherit the version of # ExtUtils::MakeMaker in use by the module author, but this # was found to be untenable as some authors build releases # using future dev versions of EU:MM that nobody else has. # Instead, #toolchain suggests we use 6.59 which is the most # stable version on CPAN at time of writing and is, to quote # ribasushi, "not terminally fucked, > and tested enough". # TODO: We will now need to maintain this over time to push # the version up as new versions are released. $self->build_requires( 'ExtUtils::MakeMaker' => 6.59 ); $self->configure_requires( 'ExtUtils::MakeMaker' => 6.59 ); } else { # Allow legacy-compatibility with 5.005 by depending on the # most recent EU:MM that supported 5.005. $self->build_requires( 'ExtUtils::MakeMaker' => 6.36 ); $self->configure_requires( 'ExtUtils::MakeMaker' => 6.36 ); } # Generate the MakeMaker params my $args = $self->makemaker_args; $args->{DISTNAME} = $self->name; $args->{NAME} = $self->module_name || $self->name; $args->{NAME} =~ s/-/::/g; $args->{VERSION} = $self->version or die <<'EOT'; ERROR: Can't determine distribution version. Please specify it explicitly via 'version' in Makefile.PL, or set a valid $VERSION in a module, and provide its file path via 'version_from' (or 'all_from' if you prefer) in Makefile.PL. EOT if ( $self->tests ) { my @tests = split ' ', $self->tests; my %seen; $args->{test} = { TESTS => (join ' ', grep {!$seen{$_}++} @tests), }; } elsif ( $Module::Install::ExtraTests::use_extratests ) { # Module::Install::ExtraTests doesn't set $self->tests and does its own tests via harness. # So, just ignore our xt tests here. } elsif ( -d 'xt' and ($Module::Install::AUTHOR or $ENV{RELEASE_TESTING}) ) { $args->{test} = { TESTS => join( ' ', map { "$_/*.t" } grep { -d $_ } qw{ t xt } ), }; } if ( $] >= 5.005 ) { $args->{ABSTRACT} = $self->abstract; $args->{AUTHOR} = join ', ', @{$self->author || []}; } if ( $self->makemaker(6.10) ) { $args->{NO_META} = 1; #$args->{NO_MYMETA} = 1; } if ( $self->makemaker(6.17) and $self->sign ) { $args->{SIGN} = 1; } unless ( $self->is_admin ) { delete $args->{SIGN}; } if ( $self->makemaker(6.31) and $self->license ) { $args->{LICENSE} = $self->license; } my $prereq = ($args->{PREREQ_PM} ||= {}); %$prereq = ( %$prereq, map { @$_ } # flatten [module => version] map { @$_ } grep $_, ($self->requires) ); # Remove any reference to perl, PREREQ_PM doesn't support it delete $args->{PREREQ_PM}->{perl}; # Merge both kinds of requires into BUILD_REQUIRES my $build_prereq = ($args->{BUILD_REQUIRES} ||= {}); %$build_prereq = ( %$build_prereq, map { @$_ } # flatten [module => version] map { @$_ } grep $_, ($self->configure_requires, $self->build_requires) ); # Remove any reference to perl, BUILD_REQUIRES doesn't support it delete $args->{BUILD_REQUIRES}->{perl}; # Delete bundled dists from prereq_pm, add it to Makefile DIR my $subdirs = ($args->{DIR} || []); if ($self->bundles) { my %processed; foreach my $bundle (@{ $self->bundles }) { my ($mod_name, $dist_dir) = @$bundle; delete $prereq->{$mod_name}; $dist_dir = File::Basename::basename($dist_dir); # dir for building this module if (not exists $processed{$dist_dir}) { if (-d $dist_dir) { # List as sub-directory to be processed by make push @$subdirs, $dist_dir; } # Else do nothing: the module is already present on the system $processed{$dist_dir} = undef; } } } unless ( $self->makemaker('6.55_03') ) { %$prereq = (%$prereq,%$build_prereq); delete $args->{BUILD_REQUIRES}; } if ( my $perl_version = $self->perl_version ) { eval "use $perl_version; 1" or die "ERROR: perl: Version $] is installed, " . "but we need version >= $perl_version"; if ( $self->makemaker(6.48) ) { $args->{MIN_PERL_VERSION} = $perl_version; } } if ($self->installdirs) { warn qq{old INSTALLDIRS (probably set by makemaker_args) is overriden by installdirs\n} if $args->{INSTALLDIRS}; $args->{INSTALLDIRS} = $self->installdirs; } my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_} ) } keys %$args; my $user_preop = delete $args{dist}->{PREOP}; if ( my $preop = $self->admin->preop($user_preop) ) { foreach my $key ( keys %$preop ) { $args{dist}->{$key} = $preop->{$key}; } } my $mm = ExtUtils::MakeMaker::WriteMakefile(%args); $self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile'); } sub fix_up_makefile { my $self = shift; my $makefile_name = shift; my $top_class = ref($self->_top) || ''; my $top_version = $self->_top->VERSION || ''; my $preamble = $self->preamble ? "# Preamble by $top_class $top_version\n" . $self->preamble : ''; my $postamble = "# Postamble by $top_class $top_version\n" . ($self->postamble || ''); local *MAKEFILE; open MAKEFILE, "+< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!"; eval { flock MAKEFILE, LOCK_EX }; my $makefile = do { local $/; }; $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /; $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g; $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g; $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m; $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m; # Module::Install will never be used to build the Core Perl # Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks # PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist $makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m; #$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m; # Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well. $makefile =~ s/(\"?)-I\$\(PERL_LIB\)\1//g; # XXX - This is currently unused; not sure if it breaks other MM-users # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg; seek MAKEFILE, 0, SEEK_SET; truncate MAKEFILE, 0; print MAKEFILE "$preamble$makefile$postamble" or die $!; close MAKEFILE or die $!; 1; } sub preamble { my ($self, $text) = @_; $self->{preamble} = $text . $self->{preamble} if defined $text; $self->{preamble}; } sub postamble { my ($self, $text) = @_; $self->{postamble} ||= $self->admin->postamble; $self->{postamble} .= $text if defined $text; $self->{postamble} } 1; __END__ #line 544 Syntax-Highlight-Engine-Kate-0.14/inc/Module/Install/Base.pm0000644000175000017500000000214713226471376023105 0ustar manwarmanwar#line 1 package Module::Install::Base; use strict 'vars'; use vars qw{$VERSION}; BEGIN { $VERSION = '1.16'; } # Suspend handler for "redefined" warnings BEGIN { my $w = $SIG{__WARN__}; $SIG{__WARN__} = sub { $w }; } #line 42 sub new { my $class = shift; unless ( defined &{"${class}::call"} ) { *{"${class}::call"} = sub { shift->_top->call(@_) }; } unless ( defined &{"${class}::load"} ) { *{"${class}::load"} = sub { shift->_top->load(@_) }; } bless { @_ }, $class; } #line 61 sub AUTOLOAD { local $@; my $func = eval { shift->_top->autoload } or return; goto &$func; } #line 75 sub _top { $_[0]->{_top}; } #line 90 sub admin { $_[0]->_top->{admin} or Module::Install::Base::FakeAdmin->new; } #line 106 sub is_admin { ! $_[0]->admin->isa('Module::Install::Base::FakeAdmin'); } sub DESTROY {} package Module::Install::Base::FakeAdmin; use vars qw{$VERSION}; BEGIN { $VERSION = $Module::Install::Base::VERSION; } my $fake; sub new { $fake ||= bless(\@_, $_[0]); } sub AUTOLOAD {} sub DESTROY {} # Restore warning handler BEGIN { $SIG{__WARN__} = $SIG{__WARN__}->(); } 1; #line 159 Syntax-Highlight-Engine-Kate-0.14/inc/Module/Install/Metadata.pm0000644000175000017500000004330213226471376023751 0ustar manwarmanwar#line 1 package Module::Install::Metadata; use strict 'vars'; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } my @boolean_keys = qw{ sign }; my @scalar_keys = qw{ name module_name abstract version distribution_type tests installdirs }; my @tuple_keys = qw{ configure_requires build_requires requires recommends bundles resources }; my @resource_keys = qw{ homepage bugtracker repository }; my @array_keys = qw{ keywords author }; *authors = \&author; sub Meta { shift } sub Meta_BooleanKeys { @boolean_keys } sub Meta_ScalarKeys { @scalar_keys } sub Meta_TupleKeys { @tuple_keys } sub Meta_ResourceKeys { @resource_keys } sub Meta_ArrayKeys { @array_keys } foreach my $key ( @boolean_keys ) { *$key = sub { my $self = shift; if ( defined wantarray and not @_ ) { return $self->{values}->{$key}; } $self->{values}->{$key} = ( @_ ? $_[0] : 1 ); return $self; }; } foreach my $key ( @scalar_keys ) { *$key = sub { my $self = shift; return $self->{values}->{$key} if defined wantarray and !@_; $self->{values}->{$key} = shift; return $self; }; } foreach my $key ( @array_keys ) { *$key = sub { my $self = shift; return $self->{values}->{$key} if defined wantarray and !@_; $self->{values}->{$key} ||= []; push @{$self->{values}->{$key}}, @_; return $self; }; } foreach my $key ( @resource_keys ) { *$key = sub { my $self = shift; unless ( @_ ) { return () unless $self->{values}->{resources}; return map { $_->[1] } grep { $_->[0] eq $key } @{ $self->{values}->{resources} }; } return $self->{values}->{resources}->{$key} unless @_; my $uri = shift or die( "Did not provide a value to $key()" ); $self->resources( $key => $uri ); return 1; }; } foreach my $key ( grep { $_ ne "resources" } @tuple_keys) { *$key = sub { my $self = shift; return $self->{values}->{$key} unless @_; my @added; while ( @_ ) { my $module = shift or last; my $version = shift || 0; push @added, [ $module, $version ]; } push @{ $self->{values}->{$key} }, @added; return map {@$_} @added; }; } # Resource handling my %lc_resource = map { $_ => 1 } qw{ homepage license bugtracker repository }; sub resources { my $self = shift; while ( @_ ) { my $name = shift or last; my $value = shift or next; if ( $name eq lc $name and ! $lc_resource{$name} ) { die("Unsupported reserved lowercase resource '$name'"); } $self->{values}->{resources} ||= []; push @{ $self->{values}->{resources} }, [ $name, $value ]; } $self->{values}->{resources}; } # Aliases for build_requires that will have alternative # meanings in some future version of META.yml. sub test_requires { shift->build_requires(@_) } sub install_requires { shift->build_requires(@_) } # Aliases for installdirs options sub install_as_core { $_[0]->installdirs('perl') } sub install_as_cpan { $_[0]->installdirs('site') } sub install_as_site { $_[0]->installdirs('site') } sub install_as_vendor { $_[0]->installdirs('vendor') } sub dynamic_config { my $self = shift; my $value = @_ ? shift : 1; if ( $self->{values}->{dynamic_config} ) { # Once dynamic we never change to static, for safety return 0; } $self->{values}->{dynamic_config} = $value ? 1 : 0; return 1; } # Convenience command sub static_config { shift->dynamic_config(0); } sub perl_version { my $self = shift; return $self->{values}->{perl_version} unless @_; my $version = shift or die( "Did not provide a value to perl_version()" ); # Normalize the version $version = $self->_perl_version($version); # We don't support the really old versions unless ( $version >= 5.005 ) { die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n"; } $self->{values}->{perl_version} = $version; } sub all_from { my ( $self, $file ) = @_; unless ( defined($file) ) { my $name = $self->name or die( "all_from called with no args without setting name() first" ); $file = join('/', 'lib', split(/-/, $name)) . '.pm'; $file =~ s{.*/}{} unless -e $file; unless ( -e $file ) { die("all_from cannot find $file from $name"); } } unless ( -f $file ) { die("The path '$file' does not exist, or is not a file"); } $self->{values}{all_from} = $file; # Some methods pull from POD instead of code. # If there is a matching .pod, use that instead my $pod = $file; $pod =~ s/\.pm$/.pod/i; $pod = $file unless -e $pod; # Pull the different values $self->name_from($file) unless $self->name; $self->version_from($file) unless $self->version; $self->perl_version_from($file) unless $self->perl_version; $self->author_from($pod) unless @{$self->author || []}; $self->license_from($pod) unless $self->license; $self->abstract_from($pod) unless $self->abstract; return 1; } sub provides { my $self = shift; my $provides = ( $self->{values}->{provides} ||= {} ); %$provides = (%$provides, @_) if @_; return $provides; } sub auto_provides { my $self = shift; return $self unless $self->is_admin; unless (-e 'MANIFEST') { warn "Cannot deduce auto_provides without a MANIFEST, skipping\n"; return $self; } # Avoid spurious warnings as we are not checking manifest here. local $SIG{__WARN__} = sub {1}; require ExtUtils::Manifest; local *ExtUtils::Manifest::manicheck = sub { return }; require Module::Build; my $build = Module::Build->new( dist_name => $self->name, dist_version => $self->version, license => $self->license, ); $self->provides( %{ $build->find_dist_packages || {} } ); } sub feature { my $self = shift; my $name = shift; my $features = ( $self->{values}->{features} ||= [] ); my $mods; if ( @_ == 1 and ref( $_[0] ) ) { # The user used ->feature like ->features by passing in the second # argument as a reference. Accomodate for that. $mods = $_[0]; } else { $mods = \@_; } my $count = 0; push @$features, ( $name => [ map { ref($_) ? ( ref($_) eq 'HASH' ) ? %$_ : @$_ : $_ } @$mods ] ); return @$features; } sub features { my $self = shift; while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) { $self->feature( $name, @$mods ); } return $self->{values}->{features} ? @{ $self->{values}->{features} } : (); } sub no_index { my $self = shift; my $type = shift; push @{ $self->{values}->{no_index}->{$type} }, @_ if $type; return $self->{values}->{no_index}; } sub read { my $self = shift; $self->include_deps( 'YAML::Tiny', 0 ); require YAML::Tiny; my $data = YAML::Tiny::LoadFile('META.yml'); # Call methods explicitly in case user has already set some values. while ( my ( $key, $value ) = each %$data ) { next unless $self->can($key); if ( ref $value eq 'HASH' ) { while ( my ( $module, $version ) = each %$value ) { $self->can($key)->($self, $module => $version ); } } else { $self->can($key)->($self, $value); } } return $self; } sub write { my $self = shift; return $self unless $self->is_admin; $self->admin->write_meta; return $self; } sub version_from { require ExtUtils::MM_Unix; my ( $self, $file ) = @_; $self->version( ExtUtils::MM_Unix->parse_version($file) ); # for version integrity check $self->makemaker_args( VERSION_FROM => $file ); } sub abstract_from { require ExtUtils::MM_Unix; my ( $self, $file ) = @_; $self->abstract( bless( { DISTNAME => $self->name }, 'ExtUtils::MM_Unix' )->parse_abstract($file) ); } # Add both distribution and module name sub name_from { my ($self, $file) = @_; if ( Module::Install::_read($file) =~ m/ ^ \s* package \s* ([\w:]+) [\s|;]* /ixms ) { my ($name, $module_name) = ($1, $1); $name =~ s{::}{-}g; $self->name($name); unless ( $self->module_name ) { $self->module_name($module_name); } } else { die("Cannot determine name from $file\n"); } } sub _extract_perl_version { if ( $_[0] =~ m/ ^\s* (?:use|require) \s* v? ([\d_\.]+) \s* ; /ixms ) { my $perl_version = $1; $perl_version =~ s{_}{}g; return $perl_version; } else { return; } } sub perl_version_from { my $self = shift; my $perl_version=_extract_perl_version(Module::Install::_read($_[0])); if ($perl_version) { $self->perl_version($perl_version); } else { warn "Cannot determine perl version info from $_[0]\n"; return; } } sub author_from { my $self = shift; my $content = Module::Install::_read($_[0]); if ($content =~ m/ =head \d \s+ (?:authors?)\b \s* ([^\n]*) | =head \d \s+ (?:licen[cs]e|licensing|copyright|legal)\b \s* .*? copyright .*? \d\d\d[\d.]+ \s* (?:\bby\b)? \s* ([^\n]*) /ixms) { my $author = $1 || $2; # XXX: ugly but should work anyway... if (eval "require Pod::Escapes; 1") { # Pod::Escapes has a mapping table. # It's in core of perl >= 5.9.3, and should be installed # as one of the Pod::Simple's prereqs, which is a prereq # of Pod::Text 3.x (see also below). $author =~ s{ E<( (\d+) | ([A-Za-z]+) )> } { defined $2 ? chr($2) : defined $Pod::Escapes::Name2character_number{$1} ? chr($Pod::Escapes::Name2character_number{$1}) : do { warn "Unknown escape: E<$1>"; "E<$1>"; }; }gex; } elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) { # Pod::Text < 3.0 has yet another mapping table, # though the table name of 2.x and 1.x are different. # (1.x is in core of Perl < 5.6, 2.x is in core of # Perl < 5.9.3) my $mapping = ($Pod::Text::VERSION < 2) ? \%Pod::Text::HTML_Escapes : \%Pod::Text::ESCAPES; $author =~ s{ E<( (\d+) | ([A-Za-z]+) )> } { defined $2 ? chr($2) : defined $mapping->{$1} ? $mapping->{$1} : do { warn "Unknown escape: E<$1>"; "E<$1>"; }; }gex; } else { $author =~ s{E}{<}g; $author =~ s{E}{>}g; } $self->author($author); } else { warn "Cannot determine author info from $_[0]\n"; } } #Stolen from M::B my %license_urls = ( perl => 'http://dev.perl.org/licenses/', apache => 'http://apache.org/licenses/LICENSE-2.0', apache_1_1 => 'http://apache.org/licenses/LICENSE-1.1', artistic => 'http://opensource.org/licenses/artistic-license.php', artistic_2 => 'http://opensource.org/licenses/artistic-license-2.0.php', lgpl => 'http://opensource.org/licenses/lgpl-license.php', lgpl2 => 'http://opensource.org/licenses/lgpl-2.1.php', lgpl3 => 'http://opensource.org/licenses/lgpl-3.0.html', bsd => 'http://opensource.org/licenses/bsd-license.php', gpl => 'http://opensource.org/licenses/gpl-license.php', gpl2 => 'http://opensource.org/licenses/gpl-2.0.php', gpl3 => 'http://opensource.org/licenses/gpl-3.0.html', mit => 'http://opensource.org/licenses/mit-license.php', mozilla => 'http://opensource.org/licenses/mozilla1.1.php', open_source => undef, unrestricted => undef, restrictive => undef, unknown => undef, ); sub license { my $self = shift; return $self->{values}->{license} unless @_; my $license = shift or die( 'Did not provide a value to license()' ); $license = __extract_license($license) || lc $license; $self->{values}->{license} = $license; # Automatically fill in license URLs if ( $license_urls{$license} ) { $self->resources( license => $license_urls{$license} ); } return 1; } sub _extract_license { my $pod = shift; my $matched; return __extract_license( ($matched) = $pod =~ m/ (=head \d \s+ L(?i:ICEN[CS]E|ICENSING)\b.*?) (=head \d.*|=cut.*|)\z /xms ) || __extract_license( ($matched) = $pod =~ m/ (=head \d \s+ (?:C(?i:OPYRIGHTS?)|L(?i:EGAL))\b.*?) (=head \d.*|=cut.*|)\z /xms ); } sub __extract_license { my $license_text = shift or return; my @phrases = ( '(?:under )?the same (?:terms|license) as (?:perl|the perl (?:\d )?programming language)' => 'perl', 1, '(?:under )?the terms of (?:perl|the perl programming language) itself' => 'perl', 1, 'Artistic and GPL' => 'perl', 1, 'GNU general public license' => 'gpl', 1, 'GNU public license' => 'gpl', 1, 'GNU lesser general public license' => 'lgpl', 1, 'GNU lesser public license' => 'lgpl', 1, 'GNU library general public license' => 'lgpl', 1, 'GNU library public license' => 'lgpl', 1, 'GNU Free Documentation license' => 'unrestricted', 1, 'GNU Affero General Public License' => 'open_source', 1, '(?:Free)?BSD license' => 'bsd', 1, 'Artistic license 2\.0' => 'artistic_2', 1, 'Artistic license' => 'artistic', 1, 'Apache (?:Software )?license' => 'apache', 1, 'GPL' => 'gpl', 1, 'LGPL' => 'lgpl', 1, 'BSD' => 'bsd', 1, 'Artistic' => 'artistic', 1, 'MIT' => 'mit', 1, 'Mozilla Public License' => 'mozilla', 1, 'Q Public License' => 'open_source', 1, 'OpenSSL License' => 'unrestricted', 1, 'SSLeay License' => 'unrestricted', 1, 'zlib License' => 'open_source', 1, 'proprietary' => 'proprietary', 0, ); while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) { $pattern =~ s#\s+#\\s+#gs; if ( $license_text =~ /\b$pattern\b/i ) { return $license; } } return ''; } sub license_from { my $self = shift; if (my $license=_extract_license(Module::Install::_read($_[0]))) { $self->license($license); } else { warn "Cannot determine license info from $_[0]\n"; return 'unknown'; } } sub _extract_bugtracker { my @links = $_[0] =~ m#L<( https?\Q://rt.cpan.org/\E[^>]+| https?\Q://github.com/\E[\w_]+/[\w_]+/issues| https?\Q://code.google.com/p/\E[\w_\-]+/issues/list )>#gx; my %links; @links{@links}=(); @links=keys %links; return @links; } sub bugtracker_from { my $self = shift; my $content = Module::Install::_read($_[0]); my @links = _extract_bugtracker($content); unless ( @links ) { warn "Cannot determine bugtracker info from $_[0]\n"; return 0; } if ( @links > 1 ) { warn "Found more than one bugtracker link in $_[0]\n"; return 0; } # Set the bugtracker bugtracker( $links[0] ); return 1; } sub requires_from { my $self = shift; my $content = Module::Install::_readperl($_[0]); my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+(v?[\d\.]+)/mg; while ( @requires ) { my $module = shift @requires; my $version = shift @requires; $self->requires( $module => $version ); } } sub test_requires_from { my $self = shift; my $content = Module::Install::_readperl($_[0]); my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg; while ( @requires ) { my $module = shift @requires; my $version = shift @requires; $self->test_requires( $module => $version ); } } # Convert triple-part versions (eg, 5.6.1 or 5.8.9) to # numbers (eg, 5.006001 or 5.008009). # Also, convert double-part versions (eg, 5.8) sub _perl_version { my $v = $_[-1]; $v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e; $v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e; $v =~ s/(\.\d\d\d)000$/$1/; $v =~ s/_.+$//; if ( ref($v) ) { # Numify $v = $v + 0; } return $v; } sub add_metadata { my $self = shift; my %hash = @_; for my $key (keys %hash) { warn "add_metadata: $key is not prefixed with 'x_'.\n" . "Use appopriate function to add non-private metadata.\n" unless $key =~ /^x_/; $self->{values}->{$key} = $hash{$key}; } } ###################################################################### # MYMETA Support sub WriteMyMeta { die "WriteMyMeta has been deprecated"; } sub write_mymeta_yaml { my $self = shift; # We need YAML::Tiny to write the MYMETA.yml file unless ( eval { require YAML::Tiny; 1; } ) { return 1; } # Generate the data my $meta = $self->_write_mymeta_data or return 1; # Save as the MYMETA.yml file print "Writing MYMETA.yml\n"; YAML::Tiny::DumpFile('MYMETA.yml', $meta); } sub write_mymeta_json { my $self = shift; # We need JSON to write the MYMETA.json file unless ( eval { require JSON; 1; } ) { return 1; } # Generate the data my $meta = $self->_write_mymeta_data or return 1; # Save as the MYMETA.yml file print "Writing MYMETA.json\n"; Module::Install::_write( 'MYMETA.json', JSON->new->pretty(1)->canonical->encode($meta), ); } sub _write_mymeta_data { my $self = shift; # If there's no existing META.yml there is nothing we can do return undef unless -f 'META.yml'; # We need Parse::CPAN::Meta to load the file unless ( eval { require Parse::CPAN::Meta; 1; } ) { return undef; } # Merge the perl version into the dependencies my $val = $self->Meta->{values}; my $perl = delete $val->{perl_version}; if ( $perl ) { $val->{requires} ||= []; my $requires = $val->{requires}; # Canonize to three-dot version after Perl 5.6 if ( $perl >= 5.006 ) { $perl =~ s{^(\d+)\.(\d\d\d)(\d*)}{join('.', $1, int($2||0), int($3||0))}e } unshift @$requires, [ perl => $perl ]; } # Load the advisory META.yml file my @yaml = Parse::CPAN::Meta::LoadFile('META.yml'); my $meta = $yaml[0]; # Overwrite the non-configure dependency hashes delete $meta->{requires}; delete $meta->{build_requires}; delete $meta->{recommends}; if ( exists $val->{requires} ) { $meta->{requires} = { map { @$_ } @{ $val->{requires} } }; } if ( exists $val->{build_requires} ) { $meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } }; } return $meta; } 1; Syntax-Highlight-Engine-Kate-0.14/inc/Module/Install/Win32.pm0000644000175000017500000000340313226471376023131 0ustar manwarmanwar#line 1 package Module::Install::Win32; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } # determine if the user needs nmake, and download it if needed sub check_nmake { my $self = shift; $self->load('can_run'); $self->load('get_file'); require Config; return unless ( $^O eq 'MSWin32' and $Config::Config{make} and $Config::Config{make} =~ /^nmake\b/i and ! $self->can_run('nmake') ); print "The required 'nmake' executable not found, fetching it...\n"; require File::Basename; my $rv = $self->get_file( url => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe', ftp_url => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe', local_dir => File::Basename::dirname($^X), size => 51928, run => 'Nmake15.exe /o > nul', check_for => 'Nmake.exe', remove => 1, ); die <<'END_MESSAGE' unless $rv; ------------------------------------------------------------------------------- Since you are using Microsoft Windows, you will need the 'nmake' utility before installation. It's available at: http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe or ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe Please download the file manually, save it to a directory in %PATH% (e.g. C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to that directory, and run "Nmake15.exe" from there; that will create the 'nmake.exe' file needed by this module. You may then resume the installation process described in README. ------------------------------------------------------------------------------- END_MESSAGE } 1; Syntax-Highlight-Engine-Kate-0.14/inc/Module/Install/Fetch.pm0000644000175000017500000000462713226471376023271 0ustar manwarmanwar#line 1 package Module::Install::Fetch; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } sub get_file { my ($self, %args) = @_; my ($scheme, $host, $path, $file) = $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; if ( $scheme eq 'http' and ! eval { require LWP::Simple; 1 } ) { $args{url} = $args{ftp_url} or (warn("LWP support unavailable!\n"), return); ($scheme, $host, $path, $file) = $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; } $|++; print "Fetching '$file' from $host... "; unless (eval { require Socket; Socket::inet_aton($host) }) { warn "'$host' resolve failed!\n"; return; } return unless $scheme eq 'ftp' or $scheme eq 'http'; require Cwd; my $dir = Cwd::getcwd(); chdir $args{local_dir} or return if exists $args{local_dir}; if (eval { require LWP::Simple; 1 }) { LWP::Simple::mirror($args{url}, $file); } elsif (eval { require Net::FTP; 1 }) { eval { # use Net::FTP to get past firewall my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600); $ftp->login("anonymous", 'anonymous@example.com'); $ftp->cwd($path); $ftp->binary; $ftp->get($file) or (warn("$!\n"), return); $ftp->quit; } } elsif (my $ftp = $self->can_run('ftp')) { eval { # no Net::FTP, fallback to ftp.exe require FileHandle; my $fh = FileHandle->new; local $SIG{CHLD} = 'IGNORE'; unless ($fh->open("|$ftp -n")) { warn "Couldn't open ftp: $!\n"; chdir $dir; return; } my @dialog = split(/\n/, <<"END_FTP"); open $host user anonymous anonymous\@example.com cd $path binary get $file $file quit END_FTP foreach (@dialog) { $fh->print("$_\n") } $fh->close; } } else { warn "No working 'ftp' program available!\n"; chdir $dir; return; } unless (-f $file) { warn "Fetching failed: $@\n"; chdir $dir; return; } return if exists $args{size} and -s $file != $args{size}; system($args{run}) if exists $args{run}; unlink($file) if $args{remove}; print(((!exists $args{check_for} or -e $args{check_for}) ? "done!" : "failed! ($!)"), "\n"); chdir $dir; return !$?; } 1; Syntax-Highlight-Engine-Kate-0.14/inc/Module/Install/WriteAll.pm0000644000175000017500000000237613226471376023762 0ustar manwarmanwar#line 1 package Module::Install::WriteAll; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.16'; @ISA = qw{Module::Install::Base}; $ISCORE = 1; } sub WriteAll { my $self = shift; my %args = ( meta => 1, sign => 0, inline => 0, check_nmake => 1, @_, ); $self->sign(1) if $args{sign}; $self->admin->WriteAll(%args) if $self->is_admin; $self->check_nmake if $args{check_nmake}; unless ( $self->makemaker_args->{PL_FILES} ) { # XXX: This still may be a bit over-defensive... unless ($self->makemaker(6.25)) { $self->makemaker_args( PL_FILES => {} ) if -f 'Build.PL'; } } # Until ExtUtils::MakeMaker support MYMETA.yml, make sure # we clean it up properly ourself. $self->realclean_files('MYMETA.yml'); if ( $args{inline} ) { $self->Inline->write; } else { $self->Makefile->write; } # The Makefile write process adds a couple of dependencies, # so write the META.yml files after the Makefile. if ( $args{meta} ) { $self->Meta->write; } # Experimental support for MYMETA if ( $ENV{X_MYMETA} ) { if ( $ENV{X_MYMETA} eq 'JSON' ) { $self->Meta->write_mymeta_json; } else { $self->Meta->write_mymeta_yaml; } } return 1; } 1; Syntax-Highlight-Engine-Kate-0.14/inc/Module/Install/Can.pm0000644000175000017500000000615713226471376022741 0ustar manwarmanwar#line 1 package Module::Install::Can; use strict; use Config (); use ExtUtils::MakeMaker (); use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } # check if we can load some module ### Upgrade this to not have to load the module if possible sub can_use { my ($self, $mod, $ver) = @_; $mod =~ s{::|\\}{/}g; $mod .= '.pm' unless $mod =~ /\.pm$/i; my $pkg = $mod; $pkg =~ s{/}{::}g; $pkg =~ s{\.pm$}{}i; local $@; eval { require $mod; $pkg->VERSION($ver || 0); 1 }; } # Check if we can run some command sub can_run { my ($self, $cmd) = @_; my $_cmd = $cmd; return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd)); for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { next if $dir eq ''; require File::Spec; my $abs = File::Spec->catfile($dir, $cmd); return $abs if (-x $abs or $abs = MM->maybe_command($abs)); } return; } # Can our C compiler environment build XS files sub can_xs { my $self = shift; # Ensure we have the CBuilder module $self->configure_requires( 'ExtUtils::CBuilder' => 0.27 ); # Do we have the configure_requires checker? local $@; eval "require ExtUtils::CBuilder;"; if ( $@ ) { # They don't obey configure_requires, so it is # someone old and delicate. Try to avoid hurting # them by falling back to an older simpler test. return $self->can_cc(); } # Do we have a working C compiler my $builder = ExtUtils::CBuilder->new( quiet => 1, ); unless ( $builder->have_compiler ) { # No working C compiler return 0; } # Write a C file representative of what XS becomes require File::Temp; my ( $FH, $tmpfile ) = File::Temp::tempfile( "compilexs-XXXXX", SUFFIX => '.c', ); binmode $FH; print $FH <<'END_C'; #include "EXTERN.h" #include "perl.h" #include "XSUB.h" int main(int argc, char **argv) { return 0; } int boot_sanexs() { return 1; } END_C close $FH; # Can the C compiler access the same headers XS does my @libs = (); my $object = undef; eval { local $^W = 0; $object = $builder->compile( source => $tmpfile, ); @libs = $builder->link( objects => $object, module_name => 'sanexs', ); }; my $result = $@ ? 0 : 1; # Clean up all the build files foreach ( $tmpfile, $object, @libs ) { next unless defined $_; 1 while unlink; } return $result; } # Can we locate a (the) C compiler sub can_cc { my $self = shift; my @chunks = split(/ /, $Config::Config{cc}) or return; # $Config{cc} may contain args; try to find out the program part while (@chunks) { return $self->can_run("@chunks") || (pop(@chunks), next); } return; } # Fix Cygwin bug on maybe_command(); if ( $^O eq 'cygwin' ) { require ExtUtils::MM_Cygwin; require ExtUtils::MM_Win32; if ( ! defined(&ExtUtils::MM_Cygwin::maybe_command) ) { *ExtUtils::MM_Cygwin::maybe_command = sub { my ($self, $file) = @_; if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) { ExtUtils::MM_Win32->maybe_command($file); } else { ExtUtils::MM_Unix->maybe_command($file); } } } } 1; __END__ #line 236 Syntax-Highlight-Engine-Kate-0.14/REGISTERED0000755000175000017500000000452013032300413017623 0ustar manwarmanwar.desktop ./samples/highlight.desktop 4GL 4GL-PER ABC ./samples/highlight.abc Ada AHDL Alerts ANSI C89 Ansys Apache Configuration Asm6502 ASP ./samples/highlight.asp AVR Assembler ./samples/highlight.asm-avr AWK ./samples/highlight.awk Bash ./samples/highlight.sh BibTeX ./samples/highlight.bib C C# C++ ./samples/highlight.cpp Cg CGiS ChangeLog Cisco Clipper ./samples/highlight.prg CMake ./samples/highlight.cmake ColdFusion Common Lisp ./samples/highlight.lisp Component-Pascal CSS ./samples/highlight.css CSS/PHP CUE Sheet D Debian Changelog Debian Control de_DE Diff Doxygen ./samples/highlight.dox E Language ./samples/highlight.e Eiffel Email ./samples/highlight.eml en_US Euphoria ferite Fortran ./samples/highlight.f90 FreeBASIC GDL GLSL ./samples/highlight.glsl GNU Assembler GNU Gettext Haskell ./samples/highlight.lhs HTML ./samples/highlight.html IDL ILERPG Inform INI Files Intel x86 (NASM) ./samples/highlight.asm-nasm Java ./samples/highlight.java Javadoc JavaScript ./samples/highlight.js JavaScript/PHP JSP ./samples/highlight.jsp Kate File Template KBasic LaTeX ./samples/highlight.tex LDIF Lex/Flex ./samples/highlight.lex LilyPond ./samples/highlight.ly Literate Haskell ./samples/highlight.lhs Logtalk LPC ./samples/highlight_lpc.c Lua M3U ./samples/highlight.m3u MAB-DB Makefile Mason Matlab ./samples/highlight.m MIPS Assembler Modula-2 Music Publisher nl Objective Caml Objective-C Octave ./samples/highlight_octave.m Pascal Perl ./samples/highlight.pl PHP (HTML) ./samples/highlight.php PHP/PHP PicAsm ./samples/highlight.asm Pike ./samples/highlight.pike PostScript ./samples/highlight.ps POV-Ray ./samples/highlight.pov progress Prolog PureBasic ./samples/highlight.pb Python ./samples/highlight.py Quake Script R Script RenderMan RIB ./samples/highlight.rib REXX RPM Spec RSI IDL Ruby ./samples/highlight.rb Sather Scheme ./samples/highlight.scheme scilab SGML Sieve SML Spice ./samples/highlight.sp SQL SQL (MySQL) SQL (PostgreSQL) Stata ./samples/highlight.do TaskJuggler Tcl/Tk ./samples/highlight.tcl TI Basic txt2tags UnrealScript ./samples/highlight.uc Velocity Verilog VHDL VRML ./samples/highlight.wrl Wikimedia WINE Config x.org Configuration ./samples/xorg.conf xHarbour XML ./samples/highlight.xml xslt ./samples/highlight.xsl yacas Yacc/Bison ./samples/highlight.y Syntax-Highlight-Engine-Kate-0.14/xt/0000755000175000017500000000000013226471445016715 5ustar manwarmanwarSyntax-Highlight-Engine-Kate-0.14/xt/author/0000755000175000017500000000000013226471445020217 5ustar manwarmanwarSyntax-Highlight-Engine-Kate-0.14/xt/author/pod.t0000644000175000017500000000034213032300413021142 0ustar manwarmanwar#!/usr/bin/env perl use strict; use warnings; use Test::More; eval 'use Test::Pod 1.00'; plan skip_all => 'Test::Pod 1.00 required for testing POD' if $@; pod_file_ok('lib/Syntax/Highlight/Engine/Kate.pm'); done_testing(); Syntax-Highlight-Engine-Kate-0.14/eg/0000755000175000017500000000000013226471445016655 5ustar manwarmanwarSyntax-Highlight-Engine-Kate-0.14/eg/kate.pl0000755000175000017500000000072113032300413020116 0ustar manwarmanwar#!/usr/bin/perl use strict; use warnings FATAL => 'all'; use Data::Dumper; use Path::Tiny; use Syntax::Highlight::Engine::Kate::All; use Syntax::Highlight::Engine::Kate; my $kate = Syntax::Highlight::Engine::Kate->new( language => 'Perl', ); my $text = path(shift)->slurp; my @hl = $kate->highlight($text); print "==\n"; #print Dumper \@hl; while (@hl) { my $string = shift @hl; my $type = shift @hl; $type ||= 'Normal'; print "'$string' '$type'\n"; } Syntax-Highlight-Engine-Kate-0.14/bin/0000755000175000017500000000000013226471445017032 5ustar manwarmanwarSyntax-Highlight-Engine-Kate-0.14/bin/hlansi.pl0000755000175000017500000000327313032300413020632 0ustar manwarmanwar#!/usr/bin/perl -w # Copyright (c) 2005 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. use strict; use Term::ANSIColor; use Syntax::Highlight::Engine::Kate; unless (@ARGV) { die "You must supply a syntax mode as parameter" }; my $syntax = shift @ARGV; my $hl = new Syntax::Highlight::Engine::Kate( language => $syntax, substitutions => { "\n" => color('reset') . "\n", }, format_table => { Alert => [color('white bold on_green'), color('reset')], BaseN => [color('green'), color('reset')], BString => [color('red bold'), color('reset')], Char => [color('magenta'), color('reset')], Comment => [color('white bold on_blue'), color('reset')], DataType => [color('blue'), color('reset')], DecVal => [color('blue bold'), color('reset')], Error => [color('yellow bold on_red'), color('reset')], Float => [color('blue bold'), color('reset')], Function => [color('yellow bold on_blue'), color('reset')], IString => [color('red'), color('reset')], Keyword => [color('bold'), color('reset')], Normal => [color('reset'), color('reset')], Operator => [color('green'), color('reset')], Others => [color('yellow bold on_green'), color('reset')], RegionMarker => [color('black on_yellow bold'), color('reset')], Reserved => [color('magenta on_blue'), color('reset')], String => [color('red'), color('reset')], Variable => [color('blue on_red bold'), color('reset')], Warning => [color('green bold on_red'), color('reset')], }, ); my $newline = color('reset') . "\n"; while (my $in = <>) { # print $in; my $res = $hl->highlightText($in); # $res =~ s/\n/$newline/g; print $res; } Syntax-Highlight-Engine-Kate-0.14/bin/hl-kate-convert0000755000175000017500000000207513032300413021744 0ustar manwarmanwar#!/usr/bin/perl -w # Copyright 2012 Jan Pokorny . # This program is free software; you can redistribute it and/or modify it # under the terms of either: the GNU General Public License as published # by the Free Software Foundation; or the Artistic License. use strict; use Syntax::Highlight::Engine::Kate::Convert::ToolKit; my $toolkit = new Syntax::Highlight::Engine::Kate::Convert::ToolKit(); # TODO: optionally redefine bare output to respective files? # $toolkit->outcmd = sub { ... }; for (@ARGV) { my $hlfile = $_; my $outfile = $toolkit->register($hlfile); print "### ${outfile} ### "; # comment out the "loading" message $toolkit->pmGenerate($outfile); } __END__ =head1 NAME hl-kate-convert - generates highlight definitions from Kate's originals =head1 DESCRIPTION C is a script to convert native highlight definitions of Kate to the ones used by Syntax::Highlight::Engine::Kate. =head1 SYNOPSIS hl-kate-convert [...] Example: hl-kate-convert /some/path/some-lang.xml > SomeLang.pm Syntax-Highlight-Engine-Kate-0.14/bin/regen.pl0000755000175000017500000000133513032300413020451 0ustar manwarmanwar#!/usr/bin/env perl # use this script to regenerate the test data files in t/perl Add a new file # to t/perl/before and when you run this, a "highlighted" version will be # created in t/perl/highlighted directory use lib 't/lib'; use strict; use warnings; use TestHighlight ':all'; my $to_highlight = get_sample_perl_files(); my $total = keys %$to_highlight; my $current = 0; while ( my ( $orig, $new ) = each %$to_highlight ) { $current++; print "Processing $current out of $total ($orig)\n"; my $highlighter = get_highlighter('Perl'); my $highlighted = $highlighter->highlightText( slurp($orig) ); open my $fh, '>', $new or die "Cannot open $new for writing: $!"; print $fh $highlighted; } Syntax-Highlight-Engine-Kate-0.14/bin/hlhtml.pl0000755000175000017500000000344513032300413020645 0ustar manwarmanwar#!/usr/bin/perl -w # Copyright (c) 2005 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. use strict; use Term::ANSIColor; use Syntax::Highlight::Engine::Kate; unless (@ARGV) { die "You must supply a language mode as parameter" }; my $syntax = shift @ARGV; my $hl = new Syntax::Highlight::Engine::Kate( language => $syntax, substitutions => { '<' => '<', '>' => '>', '&' => '&', ' ' => ' ', "\t" => '   ', "\n" => "
\n", }, format_table => { Alert => ['', ''], BaseN => ['', ''], BString => ['', ''], Char => ['', ''], Comment => ['', ''], DataType => ['', ''], DecVal => ['', ''], Error => ['', ''], Float => ['', ''], Function => ['', ''], IString => ['', ''], Keyword => ['', ''], Normal => ['', ''], Operator => ['', ''], Others => ['', ''], RegionMarker => ['', ''], Reserved => ['', ''], String => ['', ''], Variable => ['', ''], Warning => ['', ''], }, ); print "\n\n\n\n"; my $text = ""; while (my $in = <>) { $text = $text . $in; # print $hl->highlightText($in); } print $hl->highlightText($text); print "\n\n"