1 # Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved.
2 # This program is free software; you can redistribute it and/or
3 # modify it under the same terms as Perl itself.
5 # This file was generated from the 'asm6502.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #generated: Sun Feb 3 22:02:04 2008, localtime
12 package Syntax::Highlight::Engine::Kate::Asm6502;
14 our $VERSION = '0.06';
18 use base('Syntax::Highlight::Engine::Kate::Template');
22 my $class = ref($proto) || $proto;
23 my $self = $class->SUPER::new(@_);
25 'Command' => 'Normal',
26 'Comment' => 'Comment',
27 'Data Type' => 'DataType',
28 'Decimal' => 'DecVal',
30 'Keyword' => 'Keyword',
31 'Normal Text' => 'Normal',
32 'Operator' => 'Others',
33 'Parameter' => 'Others',
34 'Preprocessor' => 'Others',
36 'Substitution' => 'Others',
40 callback => \&parseBase,
41 attribute => 'Normal Text',
44 callback => \&parseCommentar2,
45 attribute => 'Comment',
48 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
49 $self->basecontext('Base');
50 $self->keywordscase(0);
52 bless ($self, $class);
61 my ($self, $text) = @_;
62 # String => '#define.*$'
63 # attribute => 'Preprocessor'
66 if ($self->testRegExpr($text, '#define.*$', 0, 0, 0, undef, 0, '#stay', 'Preprocessor')) {
69 # String => '#include .*$'
70 # attribute => 'Preprocessor'
73 if ($self->testRegExpr($text, '#include .*$', 0, 0, 0, undef, 0, '#stay', 'Preprocessor')) {
77 # attribute => 'Comment'
80 if ($self->testRegExpr($text, ';.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
84 # attribute => 'Data Type'
87 if ($self->testRegExpr($text, '\\.byte', 0, 0, 0, undef, 0, '#stay', 'Data Type')) {
91 # attribute => 'Data Type'
94 if ($self->testRegExpr($text, '\\.byt', 0, 0, 0, undef, 0, '#stay', 'Data Type')) {
98 # attribute => 'Data Type'
101 if ($self->testRegExpr($text, '\\.word', 0, 0, 0, undef, 0, '#stay', 'Data Type')) {
105 # attribute => 'Data Type'
108 if ($self->testRegExpr($text, '\\.asc', 0, 0, 0, undef, 0, '#stay', 'Data Type')) {
112 # attribute => 'Data Type'
115 if ($self->testRegExpr($text, '\\.dsb', 0, 0, 0, undef, 0, '#stay', 'Data Type')) {
119 # attribute => 'Data Type'
122 if ($self->testRegExpr($text, '\\.fopt', 0, 0, 0, undef, 0, '#stay', 'Data Type')) {
126 # attribute => 'Data Type'
129 if ($self->testRegExpr($text, '\\.text', 0, 0, 0, undef, 0, '#stay', 'Data Type')) {
133 # attribute => 'Data Type'
136 if ($self->testRegExpr($text, '\\.data', 0, 0, 0, undef, 0, '#stay', 'Data Type')) {
140 # attribute => 'Data Type'
143 if ($self->testRegExpr($text, '\\.bss', 0, 0, 0, undef, 0, '#stay', 'Data Type')) {
147 # attribute => 'Data Type'
150 if ($self->testRegExpr($text, '\\.zero', 0, 0, 0, undef, 0, '#stay', 'Data Type')) {
153 # String => '\.align'
154 # attribute => 'Data Type'
157 if ($self->testRegExpr($text, '\\.align', 0, 0, 0, undef, 0, '#stay', 'Data Type')) {
160 # String => '\$[A-Za-z0-9]*'
164 if ($self->testRegExpr($text, '\\$[A-Za-z0-9]*', 0, 0, 0, undef, 0, '#stay', 'Hex')) {
168 # attribute => 'Keyword'
170 # insensitive => 'TRUE'
172 if ($self->testRegExpr($text, ',x$', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
176 # attribute => 'Keyword'
178 # insensitive => 'TRUE'
180 if ($self->testRegExpr($text, ',y$', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
184 # attribute => 'Keyword'
186 # insensitive => 'TRUE'
188 if ($self->testRegExpr($text, '#', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
192 # attribute => 'Keyword'
194 # insensitive => 'TRUE'
195 # type => 'StringDetect'
196 if ($self->testStringDetect($text, 'TAX', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
200 # attribute => 'Keyword'
202 # insensitive => 'TRUE'
203 # type => 'StringDetect'
204 if ($self->testStringDetect($text, 'ADC', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
208 # attribute => 'Keyword'
210 # insensitive => 'TRUE'
211 # type => 'StringDetect'
212 if ($self->testStringDetect($text, 'AND', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
216 # attribute => 'Keyword'
218 # insensitive => 'TRUE'
219 # type => 'StringDetect'
220 if ($self->testStringDetect($text, 'ASL', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
224 # attribute => 'Keyword'
226 # insensitive => 'TRUE'
227 # type => 'StringDetect'
228 if ($self->testStringDetect($text, 'BCC', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
232 # attribute => 'Keyword'
234 # insensitive => 'TRUE'
235 # type => 'StringDetect'
236 if ($self->testStringDetect($text, 'BCS', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
240 # attribute => 'Keyword'
242 # insensitive => 'TRUE'
243 # type => 'StringDetect'
244 if ($self->testStringDetect($text, 'BEQ', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
248 # attribute => 'Keyword'
250 # insensitive => 'TRUE'
251 # type => 'StringDetect'
252 if ($self->testStringDetect($text, 'BIT', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
256 # attribute => 'Keyword'
258 # insensitive => 'TRUE'
259 # type => 'StringDetect'
260 if ($self->testStringDetect($text, 'BMI', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
264 # attribute => 'Keyword'
266 # insensitive => 'TRUE'
267 # type => 'StringDetect'
268 if ($self->testStringDetect($text, 'BNE', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
272 # attribute => 'Keyword'
274 # insensitive => 'TRUE'
275 # type => 'StringDetect'
276 if ($self->testStringDetect($text, 'BPL', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
280 # attribute => 'Keyword'
282 # insensitive => 'TRUE'
283 # type => 'StringDetect'
284 if ($self->testStringDetect($text, 'BRK', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
288 # attribute => 'Keyword'
290 # insensitive => 'TRUE'
291 # type => 'StringDetect'
292 if ($self->testStringDetect($text, 'BVC', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
296 # attribute => 'Keyword'
298 # insensitive => 'TRUE'
299 # type => 'StringDetect'
300 if ($self->testStringDetect($text, 'BVS', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
304 # attribute => 'Keyword'
306 # insensitive => 'TRUE'
307 # type => 'StringDetect'
308 if ($self->testStringDetect($text, 'CLC', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
312 # attribute => 'Keyword'
314 # insensitive => 'TRUE'
315 # type => 'StringDetect'
316 if ($self->testStringDetect($text, 'CLD', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
320 # attribute => 'Keyword'
322 # insensitive => 'TRUE'
323 # type => 'StringDetect'
324 if ($self->testStringDetect($text, 'CLI', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
328 # attribute => 'Keyword'
330 # insensitive => 'TRUE'
331 # type => 'StringDetect'
332 if ($self->testStringDetect($text, 'CLV', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
336 # attribute => 'Keyword'
338 # insensitive => 'TRUE'
339 # type => 'StringDetect'
340 if ($self->testStringDetect($text, 'CMP', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
344 # attribute => 'Keyword'
346 # insensitive => 'TRUE'
347 # type => 'StringDetect'
348 if ($self->testStringDetect($text, 'CPX', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
352 # attribute => 'Keyword'
354 # insensitive => 'TRUE'
355 # type => 'StringDetect'
356 if ($self->testStringDetect($text, 'CPY', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
360 # attribute => 'Keyword'
362 # insensitive => 'TRUE'
363 # type => 'StringDetect'
364 if ($self->testStringDetect($text, 'DEC', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
368 # attribute => 'Keyword'
370 # insensitive => 'TRUE'
371 # type => 'StringDetect'
372 if ($self->testStringDetect($text, 'DEX', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
376 # attribute => 'Keyword'
378 # insensitive => 'TRUE'
379 # type => 'StringDetect'
380 if ($self->testStringDetect($text, 'DEY', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
384 # attribute => 'Keyword'
386 # insensitive => 'TRUE'
387 # type => 'StringDetect'
388 if ($self->testStringDetect($text, 'EOR', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
392 # attribute => 'Keyword'
394 # insensitive => 'TRUE'
395 # type => 'StringDetect'
396 if ($self->testStringDetect($text, 'INC', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
400 # attribute => 'Keyword'
402 # insensitive => 'TRUE'
403 # type => 'StringDetect'
404 if ($self->testStringDetect($text, 'INX', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
408 # attribute => 'Keyword'
410 # insensitive => 'TRUE'
411 # type => 'StringDetect'
412 if ($self->testStringDetect($text, 'INY', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
416 # attribute => 'Keyword'
418 # insensitive => 'TRUE'
419 # type => 'StringDetect'
420 if ($self->testStringDetect($text, 'JMP', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
424 # attribute => 'Keyword'
426 # insensitive => 'TRUE'
427 # type => 'StringDetect'
428 if ($self->testStringDetect($text, 'JSR', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
432 # attribute => 'Keyword'
434 # insensitive => 'TRUE'
435 # type => 'StringDetect'
436 if ($self->testStringDetect($text, 'LDA', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
440 # attribute => 'Keyword'
442 # insensitive => 'TRUE'
443 # type => 'StringDetect'
444 if ($self->testStringDetect($text, 'LDX', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
448 # attribute => 'Keyword'
450 # insensitive => 'TRUE'
451 # type => 'StringDetect'
452 if ($self->testStringDetect($text, 'LDY', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
456 # attribute => 'Keyword'
458 # insensitive => 'TRUE'
459 # type => 'StringDetect'
460 if ($self->testStringDetect($text, 'LSR', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
464 # attribute => 'Keyword'
466 # insensitive => 'TRUE'
467 # type => 'StringDetect'
468 if ($self->testStringDetect($text, 'NOP', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
472 # attribute => 'Keyword'
474 # insensitive => 'TRUE'
475 # type => 'StringDetect'
476 if ($self->testStringDetect($text, 'ORA', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
480 # attribute => 'Keyword'
482 # insensitive => 'TRUE'
483 # type => 'StringDetect'
484 if ($self->testStringDetect($text, 'PHA', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
488 # attribute => 'Keyword'
490 # insensitive => 'TRUE'
491 # type => 'StringDetect'
492 if ($self->testStringDetect($text, 'PHP', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
496 # attribute => 'Keyword'
498 # insensitive => 'TRUE'
499 # type => 'StringDetect'
500 if ($self->testStringDetect($text, 'PLA', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
504 # attribute => 'Keyword'
506 # insensitive => 'TRUE'
507 # type => 'StringDetect'
508 if ($self->testStringDetect($text, 'PLP', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
512 # attribute => 'Keyword'
514 # insensitive => 'TRUE'
515 # type => 'StringDetect'
516 if ($self->testStringDetect($text, 'ROL', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
520 # attribute => 'Keyword'
522 # insensitive => 'TRUE'
523 # type => 'StringDetect'
524 if ($self->testStringDetect($text, 'ROR', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
528 # attribute => 'Keyword'
530 # insensitive => 'TRUE'
531 # type => 'StringDetect'
532 if ($self->testStringDetect($text, 'RTI', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
536 # attribute => 'Keyword'
538 # insensitive => 'TRUE'
539 # type => 'StringDetect'
540 if ($self->testStringDetect($text, 'RTS', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
544 # attribute => 'Keyword'
546 # insensitive => 'TRUE'
547 # type => 'StringDetect'
548 if ($self->testStringDetect($text, 'SBC', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
552 # attribute => 'Keyword'
554 # insensitive => 'TRUE'
555 # type => 'StringDetect'
556 if ($self->testStringDetect($text, 'SEC', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
560 # attribute => 'Keyword'
562 # insensitive => 'TRUE'
563 # type => 'StringDetect'
564 if ($self->testStringDetect($text, 'SED', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
568 # attribute => 'Keyword'
570 # insensitive => 'TRUE'
571 # type => 'StringDetect'
572 if ($self->testStringDetect($text, 'SEI', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
576 # attribute => 'Keyword'
578 # insensitive => 'TRUE'
579 # type => 'StringDetect'
580 if ($self->testStringDetect($text, 'STA', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
584 # attribute => 'Keyword'
586 # insensitive => 'TRUE'
587 # type => 'StringDetect'
588 if ($self->testStringDetect($text, 'STX', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
592 # attribute => 'Keyword'
594 # insensitive => 'TRUE'
595 # type => 'StringDetect'
596 if ($self->testStringDetect($text, 'STY', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
600 # attribute => 'Keyword'
602 # insensitive => 'TRUE'
603 # type => 'StringDetect'
604 if ($self->testStringDetect($text, 'TAY', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
608 # attribute => 'Keyword'
610 # insensitive => 'TRUE'
611 # type => 'StringDetect'
612 if ($self->testStringDetect($text, 'TSX', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
616 # attribute => 'Keyword'
618 # insensitive => 'TRUE'
619 # type => 'StringDetect'
620 if ($self->testStringDetect($text, 'TXA', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
624 # attribute => 'Keyword'
626 # insensitive => 'TRUE'
627 # type => 'StringDetect'
628 if ($self->testStringDetect($text, 'TXS', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
632 # attribute => 'Keyword'
634 # insensitive => 'TRUE'
635 # type => 'StringDetect'
636 if ($self->testStringDetect($text, 'TYA', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
640 # attribute => 'Decimal'
643 if ($self->testRegExpr($text, '\\*=', 0, 0, 0, undef, 0, '#stay', 'Decimal')) {
646 # attribute => 'String'
650 # type => 'RangeDetect'
651 if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'String')) {
655 # attribute => 'Operator'
658 if ($self->testAnyChar($text, '-+<>=;', 0, 0, undef, 0, '#stay', 'Operator')) {
661 # attribute => 'Comment'
662 # beginRegion => 'Comment'
665 # context => 'Commentar 2'
666 # type => 'Detect2Chars'
667 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) {
673 sub parseCommentar2 {
674 my ($self, $text) = @_;
675 # attribute => 'Comment'
679 # endRegion => 'Comment'
680 # type => 'Detect2Chars'
681 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
694 Syntax::Highlight::Engine::Kate::Asm6502 - a Plugin for Asm6502 syntax highlighting
698 require Syntax::Highlight::Engine::Kate::Asm6502;
699 my $sh = new Syntax::Highlight::Engine::Kate::Asm6502([
704 Syntax::Highlight::Engine::Kate::Asm6502 is a plugin module that provides syntax highlighting
705 for Asm6502 to the Syntax::Haghlight::Engine::Kate highlighting engine.
707 This code is generated from the syntax definition files used
709 It works quite fine, but can use refinement and optimization.
711 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
717 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
723 Unknown. If you find any, please contact the author