Commit | Line | Data |
3fea05b9 |
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. |
4 | |
5 | # This file was generated from the 'picsrc.xml' file of the syntax highlight |
6 | # engine of the kate text editor (http://www.kate-editor.org |
7 | |
8 | #kate xml version 1.07 |
9 | #kate version 2.3 |
10 | #kate author Alain GIBAUD (alain.gibaud@univ-valenciennes.fr) |
11 | #generated: Sun Feb 3 22:02:06 2008, localtime |
12 | |
13 | package Syntax::Highlight::Engine::Kate::PicAsm; |
14 | |
15 | our $VERSION = '0.06'; |
16 | |
17 | use strict; |
18 | use warnings; |
19 | use base('Syntax::Highlight::Engine::Kate::Template'); |
20 | |
21 | sub new { |
22 | my $proto = shift; |
23 | my $class = ref($proto) || $proto; |
24 | my $self = $class->SUPER::new(@_); |
25 | $self->attributes({ |
26 | 'Alert' => 'Alert', |
27 | 'Based Numbers' => 'BaseN', |
28 | 'Char' => 'Char', |
29 | 'Comment' => 'Comment', |
30 | 'Directives' => 'Others', |
31 | 'Error' => 'Error', |
32 | 'GPASM-macros' => 'BString', |
33 | 'InstructionAttr' => 'Operator', |
34 | 'Instructions' => 'Keyword', |
35 | 'Normal Text' => 'Normal', |
36 | 'Prep. Lib' => 'Others', |
37 | 'Preprocessor' => 'Others', |
38 | 'String' => 'String', |
39 | 'Symbol' => 'Variable', |
40 | 'Unbased Numbers' => 'DecVal', |
41 | }); |
42 | $self->listAdd('conditional', |
43 | 'else', |
44 | 'endif', |
45 | 'endw', |
46 | 'idef', |
47 | 'if', |
48 | 'ifndef', |
49 | 'include', |
50 | 'while', |
51 | '{', |
52 | '}', |
53 | ); |
54 | $self->listAdd('directives', |
55 | 'CBLOCK', |
56 | 'CONSTANT', |
57 | 'DA', |
58 | 'DATA', |
59 | 'DB', |
60 | 'DE', |
61 | 'DT', |
62 | 'DW', |
63 | 'END', |
64 | 'ENDC', |
65 | 'ENDM', |
66 | 'EQU', |
67 | 'ERROR', |
68 | 'ERRORLEVEL', |
69 | 'EXITM', |
70 | 'FILL', |
71 | 'LIST', |
72 | 'LOCAL', |
73 | 'MACRO', |
74 | 'MESSG', |
75 | 'NOEXPAND', |
76 | 'NOLIST', |
77 | 'ORG', |
78 | 'PAGE', |
79 | 'PROCESSOR', |
80 | 'RADIX', |
81 | 'RES', |
82 | 'SET', |
83 | 'SPACE', |
84 | 'SUBTITLE', |
85 | 'TITLE', |
86 | 'VARIABLE', |
87 | '__BADRAM', |
88 | '__CONFIG', |
89 | '__IDLOCS', |
90 | '__MAXRAM', |
91 | 'cblock', |
92 | 'constant', |
93 | 'da', |
94 | 'data', |
95 | 'db', |
96 | 'de', |
97 | 'dt', |
98 | 'dw', |
99 | 'end', |
100 | 'endc', |
101 | 'endm', |
102 | 'equ', |
103 | 'error', |
104 | 'errorlevel', |
105 | 'exitm', |
106 | 'fill', |
107 | 'list', |
108 | 'local', |
109 | 'macro', |
110 | 'messg', |
111 | 'noexpand', |
112 | 'nolist', |
113 | 'org', |
114 | 'page', |
115 | 'processor', |
116 | 'radix', |
117 | 'res', |
118 | 'set', |
119 | 'space', |
120 | 'subtitle', |
121 | 'title', |
122 | 'variable', |
123 | ); |
124 | $self->listAdd('gpasm_macro', |
125 | 'ADDCF', |
126 | 'B', |
127 | 'CLRC', |
128 | 'CLRZ', |
129 | 'MOVFW', |
130 | 'SETC', |
131 | 'SETZ', |
132 | 'SKPC', |
133 | 'SKPNC', |
134 | 'SKPNZ', |
135 | 'SKPZ', |
136 | 'SUBCF', |
137 | 'TSTF', |
138 | 'addcf', |
139 | 'b', |
140 | 'clrc', |
141 | 'clrz', |
142 | 'movfw', |
143 | 'setc', |
144 | 'setz', |
145 | 'skpc', |
146 | 'skpnc', |
147 | 'skpnz', |
148 | 'skpz', |
149 | 'subcf', |
150 | 'tstf', |
151 | ); |
152 | $self->listAdd('instruction_attr', |
153 | 'A', |
154 | 'ACCESS', |
155 | 'BANKED', |
156 | 'F', |
157 | 'W', |
158 | ); |
159 | $self->listAdd('instructions', |
160 | 'ADDLW', |
161 | 'ADDWF', |
162 | 'ADDWFC', |
163 | 'ANDLW', |
164 | 'ANDWF', |
165 | 'BC', |
166 | 'BCF', |
167 | 'BN', |
168 | 'BNC', |
169 | 'BNOV', |
170 | 'BNZ', |
171 | 'BOV', |
172 | 'BRA', |
173 | 'BSF', |
174 | 'BTFSC', |
175 | 'BTFSS', |
176 | 'BTG', |
177 | 'BZ', |
178 | 'CALL', |
179 | 'CLRF', |
180 | 'CLRW', |
181 | 'CLRWDT', |
182 | 'COMF', |
183 | 'CPFSEQ', |
184 | 'CPFSGT', |
185 | 'CPFSLT', |
186 | 'DAW', |
187 | 'DCFSNZ', |
188 | 'DECF', |
189 | 'DECFSZ', |
190 | 'GOTO', |
191 | 'INCF', |
192 | 'INCFSZ', |
193 | 'INFSNZ', |
194 | 'IORLW', |
195 | 'IORWF', |
196 | 'LFSR', |
197 | 'MOVF', |
198 | 'MOVFF', |
199 | 'MOVLB', |
200 | 'MOVLW', |
201 | 'MOVWF', |
202 | 'MULLW', |
203 | 'MULWF', |
204 | 'NEGF', |
205 | 'NOP', |
206 | 'OPTION', |
207 | 'POP', |
208 | 'PUSH', |
209 | 'RCALL', |
210 | 'RESET', |
211 | 'RETFIE', |
212 | 'RETLW', |
213 | 'RETURN', |
214 | 'RLCF', |
215 | 'RLF', |
216 | 'RLNCF', |
217 | 'RRCF', |
218 | 'RRF', |
219 | 'RRNCF', |
220 | 'SETF', |
221 | 'SLEEP', |
222 | 'SUBFWB', |
223 | 'SUBLW', |
224 | 'SUBWF', |
225 | 'SUBWFB', |
226 | 'SWAPF', |
227 | 'TBLRD', |
228 | 'TBLWT', |
229 | 'TSTFSZ', |
230 | 'XORLW', |
231 | 'XORWF', |
232 | 'addlw', |
233 | 'addwf', |
234 | 'addwfc', |
235 | 'andlw', |
236 | 'andwf', |
237 | 'bc', |
238 | 'bcf', |
239 | 'bn', |
240 | 'bnc', |
241 | 'bnov', |
242 | 'bnz', |
243 | 'bov', |
244 | 'bra', |
245 | 'bsf', |
246 | 'btfsc', |
247 | 'btfss', |
248 | 'btg', |
249 | 'bz', |
250 | 'call', |
251 | 'clrf', |
252 | 'clrw', |
253 | 'clrwdt', |
254 | 'comf', |
255 | 'cpfseq', |
256 | 'cpfsgt', |
257 | 'cpfslt', |
258 | 'daw', |
259 | 'dcfsnz', |
260 | 'decf', |
261 | 'decfsz', |
262 | 'goto', |
263 | 'incf', |
264 | 'incfsz', |
265 | 'infsnz', |
266 | 'iorlw', |
267 | 'iorwf', |
268 | 'lfsr', |
269 | 'movf', |
270 | 'movff', |
271 | 'movlb', |
272 | 'movlw', |
273 | 'movwf', |
274 | 'mullw', |
275 | 'mulwf', |
276 | 'negf', |
277 | 'nop', |
278 | 'option', |
279 | 'pop', |
280 | 'push', |
281 | 'rcall', |
282 | 'reset', |
283 | 'retfie', |
284 | 'retlw', |
285 | 'return', |
286 | 'rlcf', |
287 | 'rlf', |
288 | 'rlncf', |
289 | 'rrcf', |
290 | 'rrf', |
291 | 'rrncf', |
292 | 'setf', |
293 | 'sleep', |
294 | 'subfwb', |
295 | 'sublw', |
296 | 'subwf', |
297 | 'subwfb', |
298 | 'swapf', |
299 | 'tblrd', |
300 | 'tblwt', |
301 | 'tstfsz', |
302 | 'xorlw', |
303 | 'xorwf', |
304 | ); |
305 | $self->contextdata({ |
306 | 'ASCIIChar' => { |
307 | callback => \&parseASCIIChar, |
308 | attribute => 'Char', |
309 | lineending => '#pop', |
310 | }, |
311 | 'QuotedNumError' => { |
312 | callback => \&parseQuotedNumError, |
313 | attribute => 'Error', |
314 | lineending => '#pop#pop', |
315 | }, |
316 | 'binaryDigits' => { |
317 | callback => \&parsebinaryDigits, |
318 | attribute => 'Based Numbers', |
319 | lineending => '#pop', |
320 | }, |
321 | 'comment' => { |
322 | callback => \&parsecomment, |
323 | attribute => 'Comment', |
324 | lineending => '#pop', |
325 | }, |
326 | 'decimalDigits' => { |
327 | callback => \&parsedecimalDigits, |
328 | attribute => 'Based Numbers', |
329 | lineending => '#pop', |
330 | }, |
331 | 'hexDigits' => { |
332 | callback => \&parsehexDigits, |
333 | attribute => 'Based Numbers', |
334 | lineending => '#pop', |
335 | }, |
336 | 'normal' => { |
337 | callback => \&parsenormal, |
338 | attribute => 'Normal Text', |
339 | }, |
340 | 'octDigits' => { |
341 | callback => \&parseoctDigits, |
342 | attribute => 'Based Numbers', |
343 | lineending => '#pop', |
344 | }, |
345 | 'string' => { |
346 | callback => \&parsestring, |
347 | attribute => 'String', |
348 | lineending => '#pop', |
349 | }, |
350 | }); |
351 | $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); |
352 | $self->basecontext('normal'); |
353 | $self->keywordscase(0); |
354 | $self->initialize; |
355 | bless ($self, $class); |
356 | return $self; |
357 | } |
358 | |
359 | sub language { |
360 | return 'PicAsm'; |
361 | } |
362 | |
363 | sub parseASCIIChar { |
364 | my ($self, $text) = @_; |
365 | # attribute => 'Char' |
366 | # char => ''' |
367 | # context => '#pop' |
368 | # type => 'DetectChar' |
369 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Char')) { |
370 | return 1 |
371 | } |
372 | # String => '.[^']' |
373 | # attribute => 'Error' |
374 | # context => 'QuotedNumError' |
375 | # type => 'RegExpr' |
376 | if ($self->testRegExpr($text, '.[^\']', 0, 0, 0, undef, 0, 'QuotedNumError', 'Error')) { |
377 | return 1 |
378 | } |
379 | return 0; |
380 | }; |
381 | |
382 | sub parseQuotedNumError { |
383 | my ($self, $text) = @_; |
384 | # attribute => 'Error' |
385 | # char => ''' |
386 | # context => '#pop#pop' |
387 | # type => 'DetectChar' |
388 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop#pop', 'Error')) { |
389 | return 1 |
390 | } |
391 | return 0; |
392 | }; |
393 | |
394 | sub parsebinaryDigits { |
395 | my ($self, $text) = @_; |
396 | # attribute => 'Based Numbers' |
397 | # char => ''' |
398 | # context => '#pop' |
399 | # type => 'DetectChar' |
400 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Based Numbers')) { |
401 | return 1 |
402 | } |
403 | # String => '[^0-1]' |
404 | # attribute => 'Error' |
405 | # context => 'QuotedNumError' |
406 | # type => 'RegExpr' |
407 | if ($self->testRegExpr($text, '[^0-1]', 0, 0, 0, undef, 0, 'QuotedNumError', 'Error')) { |
408 | return 1 |
409 | } |
410 | return 0; |
411 | }; |
412 | |
413 | sub parsecomment { |
414 | my ($self, $text) = @_; |
415 | # String => '(INPUT|OUTPUT|PARAMETERS|AUTHOR|EMAIL)' |
416 | # attribute => 'Instructions' |
417 | # context => '#stay' |
418 | # type => 'RegExpr' |
419 | if ($self->testRegExpr($text, '(INPUT|OUTPUT|PARAMETERS|AUTHOR|EMAIL)', 0, 0, 0, undef, 0, '#stay', 'Instructions')) { |
420 | return 1 |
421 | } |
422 | # String => '(FIXME|TODO)' |
423 | # attribute => 'Alert' |
424 | # context => '#stay' |
425 | # type => 'RegExpr' |
426 | if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) { |
427 | return 1 |
428 | } |
429 | return 0; |
430 | }; |
431 | |
432 | sub parsedecimalDigits { |
433 | my ($self, $text) = @_; |
434 | # attribute => 'Based Numbers' |
435 | # char => ''' |
436 | # context => '#pop' |
437 | # type => 'DetectChar' |
438 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Based Numbers')) { |
439 | return 1 |
440 | } |
441 | # String => '\D' |
442 | # attribute => 'Error' |
443 | # context => 'QuotedNumError' |
444 | # type => 'RegExpr' |
445 | if ($self->testRegExpr($text, '\\D', 0, 0, 0, undef, 0, 'QuotedNumError', 'Error')) { |
446 | return 1 |
447 | } |
448 | return 0; |
449 | }; |
450 | |
451 | sub parsehexDigits { |
452 | my ($self, $text) = @_; |
453 | # attribute => 'Based Numbers' |
454 | # char => ''' |
455 | # context => '#pop' |
456 | # type => 'DetectChar' |
457 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Based Numbers')) { |
458 | return 1 |
459 | } |
460 | # String => '[^0-9A-Fa-f]' |
461 | # attribute => 'Error' |
462 | # context => 'QuotedNumError' |
463 | # type => 'RegExpr' |
464 | if ($self->testRegExpr($text, '[^0-9A-Fa-f]', 0, 0, 0, undef, 0, 'QuotedNumError', 'Error')) { |
465 | return 1 |
466 | } |
467 | return 0; |
468 | }; |
469 | |
470 | sub parsenormal { |
471 | my ($self, $text) = @_; |
472 | # String => 'directives' |
473 | # attribute => 'Directives' |
474 | # context => '#stay' |
475 | # type => 'keyword' |
476 | if ($self->testKeyword($text, 'directives', 0, undef, 0, '#stay', 'Directives')) { |
477 | return 1 |
478 | } |
479 | # String => 'instructions' |
480 | # attribute => 'Instructions' |
481 | # context => '#stay' |
482 | # type => 'keyword' |
483 | if ($self->testKeyword($text, 'instructions', 0, undef, 0, '#stay', 'Instructions')) { |
484 | return 1 |
485 | } |
486 | # String => 'instruction_attr' |
487 | # attribute => 'InstructionAttr' |
488 | # context => '#stay' |
489 | # type => 'keyword' |
490 | if ($self->testKeyword($text, 'instruction_attr', 0, undef, 0, '#stay', 'InstructionAttr')) { |
491 | return 1 |
492 | } |
493 | # String => 'conditional' |
494 | # attribute => 'Preprocessor' |
495 | # context => '#stay' |
496 | # type => 'keyword' |
497 | if ($self->testKeyword($text, 'conditional', 0, undef, 0, '#stay', 'Preprocessor')) { |
498 | return 1 |
499 | } |
500 | # String => 'gpasm_macro' |
501 | # attribute => 'GPASM-macros' |
502 | # context => '#stay' |
503 | # type => 'keyword' |
504 | if ($self->testKeyword($text, 'gpasm_macro', 0, undef, 0, '#stay', 'GPASM-macros')) { |
505 | return 1 |
506 | } |
507 | # attribute => 'Based Numbers' |
508 | # context => '#stay' |
509 | # type => 'HlCHex' |
510 | if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Based Numbers')) { |
511 | return 1 |
512 | } |
513 | # String => '([ \t,][0-9A-F]+H[ \t,])' |
514 | # attribute => 'Based Numbers' |
515 | # context => '#stay' |
516 | # insensitive => 'TRUE' |
517 | # type => 'RegExpr' |
518 | if ($self->testRegExpr($text, '([ \\t,][0-9A-F]+H[ \\t,])', 1, 0, 0, undef, 0, '#stay', 'Based Numbers')) { |
519 | return 1 |
520 | } |
521 | # String => '([ \t,][0-9A-F]+H)$' |
522 | # attribute => 'Based Numbers' |
523 | # context => '#stay' |
524 | # insensitive => 'TRUE' |
525 | # type => 'RegExpr' |
526 | if ($self->testRegExpr($text, '([ \\t,][0-9A-F]+H)$', 1, 0, 0, undef, 0, '#stay', 'Based Numbers')) { |
527 | return 1 |
528 | } |
529 | # String => '([ \t,][0-9]+D)' |
530 | # attribute => 'Based Numbers' |
531 | # context => '#stay' |
532 | # insensitive => 'TRUE' |
533 | # type => 'RegExpr' |
534 | if ($self->testRegExpr($text, '([ \\t,][0-9]+D)', 1, 0, 0, undef, 0, '#stay', 'Based Numbers')) { |
535 | return 1 |
536 | } |
537 | # String => '([ \t,][0-7]+O)' |
538 | # attribute => 'Based Numbers' |
539 | # context => '#stay' |
540 | # insensitive => 'TRUE' |
541 | # type => 'RegExpr' |
542 | if ($self->testRegExpr($text, '([ \\t,][0-7]+O)', 1, 0, 0, undef, 0, '#stay', 'Based Numbers')) { |
543 | return 1 |
544 | } |
545 | # String => '([ \t,][0-1]+B)' |
546 | # attribute => 'Based Numbers' |
547 | # context => '#stay' |
548 | # insensitive => 'TRUE' |
549 | # type => 'RegExpr' |
550 | if ($self->testRegExpr($text, '([ \\t,][0-1]+B)', 1, 0, 0, undef, 0, '#stay', 'Based Numbers')) { |
551 | return 1 |
552 | } |
553 | # attribute => 'Unbased Numbers' |
554 | # context => '#stay' |
555 | # type => 'Int' |
556 | if ($self->testInt($text, 0, undef, 0, '#stay', 'Unbased Numbers')) { |
557 | return 1 |
558 | } |
559 | # attribute => 'Char' |
560 | # context => '#stay' |
561 | # type => 'HlCChar' |
562 | if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) { |
563 | return 1 |
564 | } |
565 | # attribute => 'Char' |
566 | # char => 'A' |
567 | # char1 => ''' |
568 | # context => 'ASCIIChar' |
569 | # type => 'Detect2Chars' |
570 | if ($self->testDetect2Chars($text, 'A', '\'', 0, 0, 0, undef, 0, 'ASCIIChar', 'Char')) { |
571 | return 1 |
572 | } |
573 | # attribute => 'Char' |
574 | # char => 'a' |
575 | # char1 => ''' |
576 | # context => 'ASCIIChar' |
577 | # type => 'Detect2Chars' |
578 | if ($self->testDetect2Chars($text, 'a', '\'', 0, 0, 0, undef, 0, 'ASCIIChar', 'Char')) { |
579 | return 1 |
580 | } |
581 | # attribute => 'Based Numbers' |
582 | # char => 'B' |
583 | # char1 => ''' |
584 | # context => 'binaryDigits' |
585 | # type => 'Detect2Chars' |
586 | if ($self->testDetect2Chars($text, 'B', '\'', 0, 0, 0, undef, 0, 'binaryDigits', 'Based Numbers')) { |
587 | return 1 |
588 | } |
589 | # attribute => 'Based Numbers' |
590 | # char => 'b' |
591 | # char1 => ''' |
592 | # context => 'binaryDigits' |
593 | # type => 'Detect2Chars' |
594 | if ($self->testDetect2Chars($text, 'b', '\'', 0, 0, 0, undef, 0, 'binaryDigits', 'Based Numbers')) { |
595 | return 1 |
596 | } |
597 | # attribute => 'Based Numbers' |
598 | # char => 'H' |
599 | # char1 => ''' |
600 | # context => 'hexDigits' |
601 | # type => 'Detect2Chars' |
602 | if ($self->testDetect2Chars($text, 'H', '\'', 0, 0, 0, undef, 0, 'hexDigits', 'Based Numbers')) { |
603 | return 1 |
604 | } |
605 | # attribute => 'Based Numbers' |
606 | # char => 'h' |
607 | # char1 => ''' |
608 | # context => 'hexDigits' |
609 | # type => 'Detect2Chars' |
610 | if ($self->testDetect2Chars($text, 'h', '\'', 0, 0, 0, undef, 0, 'hexDigits', 'Based Numbers')) { |
611 | return 1 |
612 | } |
613 | # attribute => 'Based Numbers' |
614 | # char => 'O' |
615 | # char1 => ''' |
616 | # context => 'octDigits' |
617 | # type => 'Detect2Chars' |
618 | if ($self->testDetect2Chars($text, 'O', '\'', 0, 0, 0, undef, 0, 'octDigits', 'Based Numbers')) { |
619 | return 1 |
620 | } |
621 | # attribute => 'Based Numbers' |
622 | # char => 'o' |
623 | # char1 => ''' |
624 | # context => 'octDigits' |
625 | # type => 'Detect2Chars' |
626 | if ($self->testDetect2Chars($text, 'o', '\'', 0, 0, 0, undef, 0, 'octDigits', 'Based Numbers')) { |
627 | return 1 |
628 | } |
629 | # attribute => 'Based Numbers' |
630 | # char => 'D' |
631 | # char1 => ''' |
632 | # context => 'decimalDigits' |
633 | # type => 'Detect2Chars' |
634 | if ($self->testDetect2Chars($text, 'D', '\'', 0, 0, 0, undef, 0, 'decimalDigits', 'Based Numbers')) { |
635 | return 1 |
636 | } |
637 | # attribute => 'Based Numbers' |
638 | # char => 'd' |
639 | # char1 => ''' |
640 | # context => 'decimalDigits' |
641 | # type => 'Detect2Chars' |
642 | if ($self->testDetect2Chars($text, 'd', '\'', 0, 0, 0, undef, 0, 'decimalDigits', 'Based Numbers')) { |
643 | return 1 |
644 | } |
645 | # attribute => 'String' |
646 | # char => '"' |
647 | # context => 'string' |
648 | # type => 'DetectChar' |
649 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'String')) { |
650 | return 1 |
651 | } |
652 | # attribute => 'Comment' |
653 | # char => ';' |
654 | # context => 'comment' |
655 | # type => 'DetectChar' |
656 | if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, 'comment', 'Comment')) { |
657 | return 1 |
658 | } |
659 | # String => '-/*%+=><&|^!~' |
660 | # attribute => 'Symbol' |
661 | # context => '#stay' |
662 | # type => 'AnyChar' |
663 | if ($self->testAnyChar($text, '-/*%+=><&|^!~', 0, 0, undef, 0, '#stay', 'Symbol')) { |
664 | return 1 |
665 | } |
666 | # String => '#define' |
667 | # attribute => 'Preprocessor' |
668 | # context => '#stay' |
669 | # type => 'StringDetect' |
670 | if ($self->testStringDetect($text, '#define', 0, 0, 0, undef, 0, '#stay', 'Preprocessor')) { |
671 | return 1 |
672 | } |
673 | # String => '#undefine' |
674 | # attribute => 'Preprocessor' |
675 | # context => '#stay' |
676 | # type => 'StringDetect' |
677 | if ($self->testStringDetect($text, '#undefine', 0, 0, 0, undef, 0, '#stay', 'Preprocessor')) { |
678 | return 1 |
679 | } |
680 | # String => '#v' |
681 | # attribute => 'Preprocessor' |
682 | # context => '#stay' |
683 | # type => 'StringDetect' |
684 | if ($self->testStringDetect($text, '#v', 0, 0, 0, undef, 0, '#stay', 'Preprocessor')) { |
685 | return 1 |
686 | } |
687 | return 0; |
688 | }; |
689 | |
690 | sub parseoctDigits { |
691 | my ($self, $text) = @_; |
692 | # attribute => 'Based Numbers' |
693 | # char => ''' |
694 | # context => '#pop' |
695 | # type => 'DetectChar' |
696 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Based Numbers')) { |
697 | return 1 |
698 | } |
699 | # String => '[^0-7]' |
700 | # attribute => 'Error' |
701 | # context => 'QuotedNumError' |
702 | # type => 'RegExpr' |
703 | if ($self->testRegExpr($text, '[^0-7]', 0, 0, 0, undef, 0, 'QuotedNumError', 'Error')) { |
704 | return 1 |
705 | } |
706 | return 0; |
707 | }; |
708 | |
709 | sub parsestring { |
710 | my ($self, $text) = @_; |
711 | # attribute => 'String' |
712 | # context => '#stay' |
713 | # type => 'LineContinue' |
714 | if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) { |
715 | return 1 |
716 | } |
717 | # attribute => 'Char' |
718 | # context => '#stay' |
719 | # type => 'HlCStringChar' |
720 | if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'Char')) { |
721 | return 1 |
722 | } |
723 | # attribute => 'String' |
724 | # char => '"' |
725 | # context => '#pop' |
726 | # type => 'DetectChar' |
727 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { |
728 | return 1 |
729 | } |
730 | return 0; |
731 | }; |
732 | |
733 | |
734 | 1; |
735 | |
736 | __END__ |
737 | |
738 | =head1 NAME |
739 | |
740 | Syntax::Highlight::Engine::Kate::PicAsm - a Plugin for PicAsm syntax highlighting |
741 | |
742 | =head1 SYNOPSIS |
743 | |
744 | require Syntax::Highlight::Engine::Kate::PicAsm; |
745 | my $sh = new Syntax::Highlight::Engine::Kate::PicAsm([ |
746 | ]); |
747 | |
748 | =head1 DESCRIPTION |
749 | |
750 | Syntax::Highlight::Engine::Kate::PicAsm is a plugin module that provides syntax highlighting |
751 | for PicAsm to the Syntax::Haghlight::Engine::Kate highlighting engine. |
752 | |
753 | This code is generated from the syntax definition files used |
754 | by the Kate project. |
755 | It works quite fine, but can use refinement and optimization. |
756 | |
757 | It inherits Syntax::Higlight::Engine::Kate::Template. See also there. |
758 | |
759 | =cut |
760 | |
761 | =head1 AUTHOR |
762 | |
763 | Hans Jeuken (haje <at> toneel <dot> demon <dot> nl) |
764 | |
765 | =cut |
766 | |
767 | =head1 BUGS |
768 | |
769 | Unknown. If you find any, please contact the author |
770 | |
771 | =cut |
772 | |