File Coverage

blib/lib/Syntax/Highlight/Engine/Kate/Fortran.pm
Criterion Covered Total %
statement 159 249 63.8
branch 99 180 55.0
condition 1 3 33.3
subroutine 19 24 79.1
pod 0 21 0.0
total 278 477 58.2


line stmt bran cond sub pod time code
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 'fortran.xml' file of the syntax highlight
6             # engine of the kate text editor (http://www.kate-editor.org
7              
8             #kate xml version 1.11
9             #kate version 2.4
10             #kate author Franchin Matteo (fnch@libero.it)
11             #generated: Sun Feb 3 22:02:05 2008, localtime
12              
13             package Syntax::Highlight::Engine::Kate::Fortran;
14              
15             our $VERSION = '0.14';
16              
17 1     1   555 use strict;
  1         3  
  1         25  
18 1     1   4 use warnings;
  1         2  
  1         23  
19 1     1   5 use base('Syntax::Highlight::Engine::Kate::Template');
  1         1  
  1         2504  
20              
21             sub new {
22 2     2 0 571 my $proto = shift;
23 2   33     10 my $class = ref($proto) || $proto;
24 2         11 my $self = $class->SUPER::new(@_);
25 2         23 $self->attributes({
26             'Comment' => 'Comment',
27             'Data Type' => 'DataType',
28             'Decimal' => 'DecVal',
29             'Elemental Procedure' => 'BString',
30             'Float' => 'Float',
31             'IO Function' => 'Function',
32             'Inquiry Function' => 'Function',
33             'Keyword' => 'Keyword',
34             'Logical' => 'Reserved',
35             'Non elemental subroutine' => 'Keyword',
36             'Normal Text' => 'Normal',
37             'Operator' => 'Operator',
38             'Preprocessor' => 'Others',
39             'String' => 'String',
40             'Symbol' => 'Normal',
41             'Transformational Function' => 'Variable',
42             });
43 2         10 $self->listAdd('elemental_procs',
44             'abs',
45             'achar',
46             'acos',
47             'adjustl',
48             'adjustr',
49             'aimag',
50             'aint',
51             'alog',
52             'alog10',
53             'amax0',
54             'amax1',
55             'amin0',
56             'amin1',
57             'amod',
58             'anint',
59             'aprime',
60             'asin',
61             'atan',
62             'atan2',
63             'btest',
64             'cabs',
65             'ccos',
66             'ceiling',
67             'cexp',
68             'char',
69             'clog',
70             'cmplx',
71             'conjg',
72             'cos',
73             'cosh',
74             'csin',
75             'csqrt',
76             'dabs',
77             'dacos',
78             'dasin',
79             'datan',
80             'datan2',
81             'dble',
82             'dcmplx',
83             'dconjg',
84             'dcos',
85             'dcosh',
86             'ddim',
87             'ddmim',
88             'dexp',
89             'dfloat',
90             'dim',
91             'dimag',
92             'dint',
93             'dlog',
94             'dlog10',
95             'dmax1',
96             'dmin1',
97             'dmod',
98             'dnint',
99             'dprod',
100             'dreal',
101             'dsign',
102             'dsin',
103             'dsinh',
104             'dsqrt',
105             'dtan',
106             'dtanh',
107             'exp',
108             'exponent',
109             'float',
110             'floor',
111             'fraction',
112             'iabs',
113             'iachar',
114             'iand',
115             'ibclr',
116             'ibits',
117             'ibset',
118             'ichar',
119             'idim',
120             'idint',
121             'idnint',
122             'ieor',
123             'ifix',
124             'index',
125             'int',
126             'ior',
127             'ishft',
128             'ishftc',
129             'isign',
130             'len_trim',
131             'lge',
132             'lgt',
133             'lle',
134             'llt',
135             'log',
136             'log10',
137             'logical',
138             'max',
139             'max0',
140             'max1',
141             'merge',
142             'min',
143             'min0',
144             'min1',
145             'mod',
146             'modulo',
147             'mvbits',
148             'nearest',
149             'nint',
150             'not',
151             'rand',
152             'real',
153             'rrspacing',
154             'scale',
155             'scan',
156             'set_exponent',
157             'sign',
158             'sin',
159             'sinh',
160             'sngl',
161             'spacing',
162             'sqrt',
163             'tan',
164             'tanh',
165             'verify',
166             );
167 2         7 $self->listAdd('inquire_keywords',
168             'access',
169             'action',
170             'blank',
171             'delim',
172             'direct',
173             'err',
174             'exist',
175             'file',
176             'form',
177             'formatted',
178             'iostat',
179             'name',
180             'named',
181             'nextrec',
182             'number',
183             'opened',
184             'pad',
185             'position',
186             'read',
187             'readwrite',
188             'recl',
189             'sequential',
190             'unformatted',
191             'unit',
192             'write',
193             );
194 2         6 $self->listAdd('inquiry_fn',
195             'allocated',
196             'associated',
197             'bit_size',
198             'digits',
199             'epsilon',
200             'huge',
201             'kind',
202             'lbound',
203             'len',
204             'maxexponent',
205             'minexponent',
206             'precision',
207             'present',
208             'radix',
209             'range',
210             'shape',
211             'size',
212             'tiny',
213             'ubound',
214             );
215 2         7 $self->listAdd('io_functions',
216             'access',
217             'backspace',
218             'close',
219             'format',
220             'inquire',
221             'open',
222             'print',
223             'read',
224             'rewind',
225             'write',
226             );
227 2         6 $self->listAdd('io_keywords',
228             'advance',
229             'end',
230             'eor',
231             'err',
232             'fmt',
233             'iostat',
234             'size',
235             'status',
236             'unit',
237             );
238 2         7 $self->listAdd('keywords',
239             'allocate',
240             'assignment',
241             'break',
242             'call',
243             'case',
244             'common',
245             'contains',
246             'continue',
247             'cycle',
248             'deallocate',
249             'default',
250             'do',
251             'elemental',
252             'else',
253             'elseif',
254             'elsewhere',
255             'entry',
256             'equivalence',
257             'exit',
258             'external',
259             'for',
260             'forall',
261             'go',
262             'goto',
263             'if',
264             'implicit',
265             'include',
266             'interface',
267             'intrinsic',
268             'namelist',
269             'none',
270             'nullify',
271             'only',
272             'operator',
273             'pause',
274             'procedure',
275             'pure',
276             'record',
277             'recursive',
278             'result',
279             'return',
280             'select',
281             'selectcase',
282             'stop',
283             'then',
284             'to',
285             'use',
286             'where',
287             'while',
288             );
289 2         6 $self->listAdd('non_elem_subr',
290             'date_and_time',
291             'random_number',
292             'random_seed',
293             'system_clock',
294             );
295 2         5 $self->listAdd('open_keywords',
296             'access',
297             'action',
298             'blank',
299             'delim',
300             'err',
301             'file',
302             'form',
303             'iostat',
304             'pad',
305             'position',
306             'recl',
307             'status',
308             'unit',
309             );
310 2         6 $self->listAdd('transform_fn',
311             'all',
312             'any',
313             'count',
314             'cshift',
315             'dot_product',
316             'eoshift',
317             'matmul',
318             'maxloc',
319             'maxval',
320             'minloc',
321             'minval',
322             'pack',
323             'product',
324             'repeat',
325             'reshape',
326             'selected_int_kind',
327             'selected_real_kind',
328             'spread',
329             'sum',
330             'transfer',
331             'transpose',
332             'trim',
333             'unpack',
334             );
335 2         5 $self->listAdd('types',
336             'allocatable',
337             'double',
338             'optional',
339             'parameter',
340             'pointer',
341             'precision',
342             'private',
343             'public',
344             'save',
345             'sequence',
346             'target',
347             );
348 2         97 $self->contextdata({
349             'default' => {
350             callback => \&parsedefault,
351             attribute => 'Normal Text',
352             },
353             'end_of_string' => {
354             callback => \&parseend_of_string,
355             attribute => 'String',
356             fallthrough => '#pop#pop',
357             },
358             'find_begin_stmnts' => {
359             callback => \&parsefind_begin_stmnts,
360             attribute => 'Normal Text',
361             },
362             'find_comments' => {
363             callback => \&parsefind_comments,
364             attribute => 'Normal Text',
365             },
366             'find_decls' => {
367             callback => \&parsefind_decls,
368             attribute => 'Normal Text',
369             },
370             'find_end_stmnts' => {
371             callback => \&parsefind_end_stmnts,
372             attribute => 'Normal Text',
373             },
374             'find_intrinsics' => {
375             callback => \&parsefind_intrinsics,
376             attribute => 'Normal Text',
377             },
378             'find_io_paren' => {
379             callback => \&parsefind_io_paren,
380             attribute => 'Normal Text',
381             },
382             'find_io_stmnts' => {
383             callback => \&parsefind_io_stmnts,
384             attribute => 'Normal Text',
385             },
386             'find_numbers' => {
387             callback => \&parsefind_numbers,
388             attribute => 'Normal Text',
389             },
390             'find_op_and_log' => {
391             callback => \&parsefind_op_and_log,
392             attribute => 'Normal Text',
393             },
394             'find_paren' => {
395             callback => \&parsefind_paren,
396             attribute => 'Data Type',
397             lineending => '#pop',
398             },
399             'find_preprocessor' => {
400             callback => \&parsefind_preprocessor,
401             attribute => 'Normal Text',
402             },
403             'find_strings' => {
404             callback => \&parsefind_strings,
405             attribute => 'String',
406             },
407             'find_symbols' => {
408             callback => \&parsefind_symbols,
409             attribute => 'Normal Text',
410             },
411             'format_stmnt' => {
412             callback => \&parseformat_stmnt,
413             attribute => 'Normal Text',
414             },
415             'inside_func_paren' => {
416             callback => \&parseinside_func_paren,
417             attribute => 'Normal Text',
418             },
419             'string_1' => {
420             callback => \&parsestring_1,
421             attribute => 'String',
422             fallthrough => '#pop',
423             },
424             'string_2' => {
425             callback => \&parsestring_2,
426             attribute => 'String',
427             fallthrough => '#pop',
428             },
429             });
430 2         9 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
431 2         8 $self->basecontext('default');
432 2         7 $self->keywordscase(0);
433 2         6 $self->initialize;
434 2         5 bless ($self, $class);
435 2         10 return $self;
436             }
437              
438             sub language {
439 0     0 0 0 return 'Fortran';
440             }
441              
442             sub parsedefault {
443 4578     4578 0 6716 my ($self, $text) = @_;
444             # context => 'find_strings'
445             # type => 'IncludeRules'
446 4578 100       9085 if ($self->includeRules('find_strings', $text)) {
447 18         36 return 1
448             }
449             # context => 'find_decls'
450             # type => 'IncludeRules'
451 4560 100       8331 if ($self->includeRules('find_decls', $text)) {
452 144         313 return 1
453             }
454             # context => 'find_intrinsics'
455             # type => 'IncludeRules'
456 4416 100       9028 if ($self->includeRules('find_intrinsics', $text)) {
457 68         140 return 1
458             }
459             # context => 'find_io_stmnts'
460             # type => 'IncludeRules'
461 4348 100       9558 if ($self->includeRules('find_io_stmnts', $text)) {
462 4         9 return 1
463             }
464             # context => 'find_op_and_log'
465             # type => 'IncludeRules'
466 4344 100       9183 if ($self->includeRules('find_op_and_log', $text)) {
467 16         56 return 1
468             }
469             # context => 'find_numbers'
470             # type => 'IncludeRules'
471 4328 100       9090 if ($self->includeRules('find_numbers', $text)) {
472 36         78 return 1
473             }
474             # context => 'find_preprocessor'
475             # type => 'IncludeRules'
476 4292 50       9173 if ($self->includeRules('find_preprocessor', $text)) {
477 0         0 return 1
478             }
479             # context => 'find_comments'
480             # type => 'IncludeRules'
481 4292 50       9443 if ($self->includeRules('find_comments', $text)) {
482 0         0 return 1
483             }
484             # context => 'find_symbols'
485             # type => 'IncludeRules'
486 4292 100       8638 if ($self->includeRules('find_symbols', $text)) {
487 192         365 return 1
488             }
489             # context => 'find_end_stmnts'
490             # type => 'IncludeRules'
491 4100 100       7982 if ($self->includeRules('find_end_stmnts', $text)) {
492 8         21 return 1
493             }
494             # context => 'find_begin_stmnts'
495             # type => 'IncludeRules'
496 4092 100       8610 if ($self->includeRules('find_begin_stmnts', $text)) {
497 6         16 return 1
498             }
499 4086         7100 return 0;
500             };
501              
502             sub parseend_of_string {
503 0     0 0 0 my ($self, $text) = @_;
504             # type => 'DetectSpaces'
505 0 0       0 if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
506 0         0 return 1
507             }
508             # String => '&\s*$'
509             # attribute => 'Keyword'
510             # context => '#stay'
511             # type => 'RegExpr'
512 0 0       0 if ($self->testRegExpr($text, '&\\s*$', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
513 0         0 return 1
514             }
515             # attribute => 'Keyword'
516             # char => '&'
517             # context => '#pop'
518             # firstNonSpace => 'true'
519             # type => 'DetectChar'
520 0 0       0 if ($self->testDetectChar($text, '&', 0, 0, 0, undef, 1, '#pop', 'Keyword')) {
521 0         0 return 1
522             }
523             # String => '(!.*)?$'
524             # attribute => 'Comment'
525             # context => '#stay'
526             # firstNonSpace => 'true'
527             # type => 'RegExpr'
528 0 0       0 if ($self->testRegExpr($text, '(!.*)?$', 0, 0, 0, undef, 1, '#stay', 'Comment')) {
529 0         0 return 1
530             }
531 0         0 return 0;
532             };
533              
534             sub parsefind_begin_stmnts {
535 4092     4092 0 6082 my ($self, $text) = @_;
536             # String => '\bmodule\s+procedure\b'
537             # attribute => 'Keyword'
538             # context => '#stay'
539             # insensitive => 'TRUE'
540             # type => 'RegExpr'
541 4092 100       8606 if ($self->testRegExpr($text, '\\bmodule\\s+procedure\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
542 4         12 return 1
543             }
544             # String => '\b(program|subroutine|function|module|block\s*data)\b'
545             # attribute => 'Keyword'
546             # beginRegion => 'Unit'
547             # context => '#stay'
548             # insensitive => 'TRUE'
549             # type => 'RegExpr'
550 4088 100       9335 if ($self->testRegExpr($text, '\\b(program|subroutine|function|module|block\\s*data)\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
551 2         7 return 1
552             }
553 4086         8148 return 0;
554             };
555              
556             sub parsefind_comments {
557 4292     4292 0 6184 my ($self, $text) = @_;
558             # String => '[cC\*].*$'
559             # attribute => 'Comment'
560             # column => '0'
561             # context => '#stay'
562             # type => 'RegExpr'
563 4292 50       8402 if ($self->testRegExpr($text, '[cC\\*].*$', 0, 0, 0, 0, 0, '#stay', 'Comment')) {
564 0         0 return 1
565             }
566             # String => '!.*$'
567             # attribute => 'Comment'
568             # context => '#stay'
569             # type => 'RegExpr'
570 4292 50       10070 if ($self->testRegExpr($text, '!.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
571 0         0 return 1
572             }
573 4292         9785 return 0;
574             };
575              
576             sub parsefind_decls {
577 4560     4560 0 6416 my ($self, $text) = @_;
578             # String => '\binteger[\*]\d{1,2}'
579             # attribute => 'Data Type'
580             # context => '#stay'
581             # insensitive => 'TRUE'
582             # type => 'RegExpr'
583 4560 50       9939 if ($self->testRegExpr($text, '\\binteger[\\*]\\d{1,2}', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
584 0         0 return 1
585             }
586             # String => '\breal[\*]\d{1,2}'
587             # attribute => 'Data Type'
588             # context => '#stay'
589             # insensitive => 'TRUE'
590             # type => 'RegExpr'
591 4560 50       10790 if ($self->testRegExpr($text, '\\breal[\\*]\\d{1,2}', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
592 0         0 return 1
593             }
594             # String => '\bcomplex[\*]\d{1,2}'
595             # attribute => 'Data Type'
596             # context => '#stay'
597             # insensitive => 'TRUE'
598             # type => 'RegExpr'
599 4560 50       9958 if ($self->testRegExpr($text, '\\bcomplex[\\*]\\d{1,2}', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
600 0         0 return 1
601             }
602             # String => '\bend\s*type\b'
603             # attribute => 'Data Type'
604             # context => '#stay'
605             # insensitive => 'TRUE'
606             # type => 'RegExpr'
607 4560 100       9562 if ($self->testRegExpr($text, '\\bend\\s*type\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
608 4         13 return 1
609             }
610             # String => 'types'
611             # attribute => 'Data Type'
612             # context => '#stay'
613             # type => 'keyword'
614 4556 100       10764 if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) {
615 46         112 return 1
616             }
617             # String => '^\s*data\b'
618             # attribute => 'Data Type'
619             # context => '#stay'
620             # insensitive => 'TRUE'
621             # type => 'RegExpr'
622 4510 50       9662 if ($self->testRegExpr($text, '^\\s*data\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
623 0         0 return 1
624             }
625             # String => '^\s*real\s*[(]'
626             # attribute => 'Data Type'
627             # context => 'find_paren'
628             # insensitive => 'TRUE'
629             # type => 'RegExpr'
630 4510 100       9564 if ($self->testRegExpr($text, '^\\s*real\\s*[(]', 1, 0, 0, undef, 0, 'find_paren', 'Data Type')) {
631 10         24 return 1
632             }
633             # String => '^\s*real(?![\w\*])'
634             # attribute => 'Data Type'
635             # context => '#stay'
636             # insensitive => 'TRUE'
637             # type => 'RegExpr'
638 4500 100       9096 if ($self->testRegExpr($text, '^\\s*real(?![\\w\\*])', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
639 8         23 return 1
640             }
641             # String => '\bcharacter[*][0-9]+\b'
642             # attribute => 'Data Type'
643             # context => '#stay'
644             # insensitive => 'TRUE'
645             # type => 'RegExpr'
646 4492 50       8449 if ($self->testRegExpr($text, '\\bcharacter[*][0-9]+\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
647 0         0 return 1
648             }
649             # String => '\b(type|integer|complex|character|logical|intent|dimension)\b\s*[(]'
650             # attribute => 'Data Type'
651             # context => 'find_paren'
652             # insensitive => 'TRUE'
653             # type => 'RegExpr'
654 4492 100       9557 if ($self->testRegExpr($text, '\\b(type|integer|complex|character|logical|intent|dimension)\\b\\s*[(]', 1, 0, 0, undef, 0, 'find_paren', 'Data Type')) {
655 18         77 return 1
656             }
657             # String => '\b(type|integer|complex|character|logical|intent|dimension)\b'
658             # attribute => 'Data Type'
659             # context => '#stay'
660             # insensitive => 'TRUE'
661             # type => 'RegExpr'
662 4474 100       9921 if ($self->testRegExpr($text, '\\b(type|integer|complex|character|logical|intent|dimension)\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
663 14         42 return 1
664             }
665             # attribute => 'Data Type'
666             # char => ':'
667             # char1 => ':'
668             # context => '#stay'
669             # type => 'Detect2Chars'
670 4460 100       11677 if ($self->testDetect2Chars($text, ':', ':', 0, 0, 0, undef, 0, '#stay', 'Data Type')) {
671 44         143 return 1
672             }
673 4416         10162 return 0;
674             };
675              
676             sub parsefind_end_stmnts {
677 4100     4100 0 6383 my ($self, $text) = @_;
678             # String => '\bend\s*(program|subroutine|function|module|block\s*data)\b'
679             # attribute => 'Keyword'
680             # context => '#stay'
681             # endRegion => 'Unit'
682             # insensitive => 'TRUE'
683             # type => 'RegExpr'
684 4100 100       9469 if ($self->testRegExpr($text, '\\bend\\s*(program|subroutine|function|module|block\\s*data)\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
685 2         7 return 1
686             }
687             # String => '\bend\s*(do|if|select|where|forall|interface)\b'
688             # attribute => 'Keyword'
689             # context => '#stay'
690             # insensitive => 'TRUE'
691             # type => 'RegExpr'
692 4098 100       10410 if ($self->testRegExpr($text, '\\bend\\s*(do|if|select|where|forall|interface)\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
693 4         12 return 1
694             }
695             # String => '\bend\b'
696             # attribute => 'Keyword'
697             # context => '#stay'
698             # endRegion => 'Unit'
699             # insensitive => 'TRUE'
700             # type => 'RegExpr'
701 4094 100       9492 if ($self->testRegExpr($text, '\\bend\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
702 2         9 return 1
703             }
704 4092         8592 return 0;
705             };
706              
707             sub parsefind_intrinsics {
708 4416     4416 0 7157 my ($self, $text) = @_;
709             # String => 'keywords'
710             # attribute => 'Keyword'
711             # context => '#stay'
712             # type => 'keyword'
713 4416 100       9781 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
714 52         149 return 1
715             }
716             # String => 'elemental_procs'
717             # attribute => 'Elemental Procedure'
718             # context => '#stay'
719             # type => 'keyword'
720 4364 100       8964 if ($self->testKeyword($text, 'elemental_procs', 0, undef, 0, '#stay', 'Elemental Procedure')) {
721 8         24 return 1
722             }
723             # String => 'inquiry_fn'
724             # attribute => 'Inquiry Function'
725             # context => '#stay'
726             # type => 'keyword'
727 4356 100       8664 if ($self->testKeyword($text, 'inquiry_fn', 0, undef, 0, '#stay', 'Inquiry Function')) {
728 4         14 return 1
729             }
730             # String => 'transform_fn'
731             # attribute => 'Transformational Function'
732             # context => '#stay'
733             # type => 'keyword'
734 4352 100       9251 if ($self->testKeyword($text, 'transform_fn', 0, undef, 0, '#stay', 'Transformational Function')) {
735 4         11 return 1
736             }
737             # String => 'non_elem_subr'
738             # attribute => 'Non elemental subroutine'
739             # context => '#stay'
740             # type => 'keyword'
741 4348 50       10273 if ($self->testKeyword($text, 'non_elem_subr', 0, undef, 0, '#stay', 'Non elemental subroutine')) {
742 0         0 return 1
743             }
744 4348         9006 return 0;
745             };
746              
747             sub parsefind_io_paren {
748 0     0 0 0 my ($self, $text) = @_;
749             # attribute => 'IO Function'
750             # char => '*'
751             # context => '#stay'
752             # type => 'DetectChar'
753 0 0       0 if ($self->testDetectChar($text, '*', 0, 0, 0, undef, 0, '#stay', 'IO Function')) {
754 0         0 return 1
755             }
756             # attribute => 'Normal Text'
757             # char => '('
758             # context => 'inside_func_paren'
759             # type => 'DetectChar'
760 0 0       0 if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'inside_func_paren', 'Normal Text')) {
761 0         0 return 1
762             }
763             # attribute => 'IO Function'
764             # char => ')'
765             # context => '#pop'
766             # type => 'DetectChar'
767 0 0       0 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'IO Function')) {
768 0         0 return 1
769             }
770             # String => 'io_keywords'
771             # attribute => 'IO Function'
772             # context => '#stay'
773             # type => 'keyword'
774 0 0       0 if ($self->testKeyword($text, 'io_keywords', 0, undef, 0, '#stay', 'IO Function')) {
775 0         0 return 1
776             }
777             # String => 'inquire_keywords'
778             # attribute => 'IO Function'
779             # context => '#stay'
780             # type => 'keyword'
781 0 0       0 if ($self->testKeyword($text, 'inquire_keywords', 0, undef, 0, '#stay', 'IO Function')) {
782 0         0 return 1
783             }
784             # String => 'open_keywords'
785             # attribute => 'IO Function'
786             # context => '#stay'
787             # type => 'keyword'
788 0 0       0 if ($self->testKeyword($text, 'open_keywords', 0, undef, 0, '#stay', 'IO Function')) {
789 0         0 return 1
790             }
791             # context => 'find_strings'
792             # type => 'IncludeRules'
793 0 0       0 if ($self->includeRules('find_strings', $text)) {
794 0         0 return 1
795             }
796             # context => 'find_intrinsics'
797             # type => 'IncludeRules'
798 0 0       0 if ($self->includeRules('find_intrinsics', $text)) {
799 0         0 return 1
800             }
801             # context => 'find_numbers'
802             # type => 'IncludeRules'
803 0 0       0 if ($self->includeRules('find_numbers', $text)) {
804 0         0 return 1
805             }
806             # context => 'find_symbols'
807             # type => 'IncludeRules'
808 0 0       0 if ($self->includeRules('find_symbols', $text)) {
809 0         0 return 1
810             }
811 0         0 return 0;
812             };
813              
814             sub parsefind_io_stmnts {
815 4348     4348 0 7062 my ($self, $text) = @_;
816             # String => '\b(read|write|backspace|rewind|end\s*file|close)\s*[(]'
817             # attribute => 'IO Function'
818             # context => 'find_io_paren'
819             # insensitive => 'TRUE'
820             # type => 'RegExpr'
821 4348 50       10248 if ($self->testRegExpr($text, '\\b(read|write|backspace|rewind|end\\s*file|close)\\s*[(]', 1, 0, 0, undef, 0, 'find_io_paren', 'IO Function')) {
822 0         0 return 1
823             }
824             # String => '\bopen\s*[(]'
825             # attribute => 'IO Function'
826             # context => 'find_io_paren'
827             # insensitive => 'TRUE'
828             # type => 'RegExpr'
829 4348 50       9880 if ($self->testRegExpr($text, '\\bopen\\s*[(]', 1, 0, 0, undef, 0, 'find_io_paren', 'IO Function')) {
830 0         0 return 1
831             }
832             # String => '\binquire\s*[(]'
833             # attribute => 'IO Function'
834             # context => 'find_io_paren'
835             # insensitive => 'TRUE'
836             # type => 'RegExpr'
837 4348 50       9431 if ($self->testRegExpr($text, '\\binquire\\s*[(]', 1, 0, 0, undef, 0, 'find_io_paren', 'IO Function')) {
838 0         0 return 1
839             }
840             # String => '\bformat\s*[(]'
841             # attribute => 'IO Function'
842             # context => 'format_stmnt'
843             # insensitive => 'TRUE'
844             # type => 'RegExpr'
845 4348 50       10037 if ($self->testRegExpr($text, '\\bformat\\s*[(]', 1, 0, 0, undef, 0, 'format_stmnt', 'IO Function')) {
846 0         0 return 1
847             }
848             # String => '\bend\s*file\b'
849             # attribute => 'IO Function'
850             # context => '#stay'
851             # insensitive => 'TRUE'
852             # type => 'RegExpr'
853 4348 50       9595 if ($self->testRegExpr($text, '\\bend\\s*file\\b', 1, 0, 0, undef, 0, '#stay', 'IO Function')) {
854 0         0 return 1
855             }
856             # String => 'io_functions'
857             # attribute => 'IO Function'
858             # context => '#stay'
859             # type => 'keyword'
860 4348 100       10136 if ($self->testKeyword($text, 'io_functions', 0, undef, 0, '#stay', 'IO Function')) {
861 4         9 return 1
862             }
863 4344         8821 return 0;
864             };
865              
866             sub parsefind_numbers {
867 4328     4328 0 6288 my ($self, $text) = @_;
868             # String => '[0-9]*\.[0-9]+([de][+-]?[0-9]+)?([_]([0-9]+|[a-z][\w_]*))?'
869             # attribute => 'Float'
870             # context => '#stay'
871             # insensitive => 'TRUE'
872             # type => 'RegExpr'
873 4328 100       9318 if ($self->testRegExpr($text, '[0-9]*\\.[0-9]+([de][+-]?[0-9]+)?([_]([0-9]+|[a-z][\\w_]*))?', 1, 0, 0, undef, 0, '#stay', 'Float')) {
874 12         34 return 1
875             }
876             # String => '\b[0-9]+\.[0-9]*([de][+-]?[0-9]+)?([_]([0-9]+|[a-z][\w_]*))?(?![a-z])'
877             # attribute => 'Float'
878             # context => '#stay'
879             # insensitive => 'TRUE'
880             # type => 'RegExpr'
881 4316 50       11727 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')) {
882 0         0 return 1
883             }
884             # String => '\b[0-9]+[de][+-]?[0-9]+([_]([0-9]+|[a-z][\w_]*))?'
885             # attribute => 'Float'
886             # context => '#stay'
887             # insensitive => 'TRUE'
888             # type => 'RegExpr'
889 4316 50       10440 if ($self->testRegExpr($text, '\\b[0-9]+[de][+-]?[0-9]+([_]([0-9]+|[a-z][\\w_]*))?', 1, 0, 0, undef, 0, '#stay', 'Float')) {
890 0         0 return 1
891             }
892             # String => '\b[0-9]+([_]([0-9]+|[a-zA-Z][\w_]*))?'
893             # attribute => 'Decimal'
894             # context => '#stay'
895             # type => 'RegExpr'
896 4316 100       10104 if ($self->testRegExpr($text, '\\b[0-9]+([_]([0-9]+|[a-zA-Z][\\w_]*))?', 0, 0, 0, undef, 0, '#stay', 'Decimal')) {
897 24         64 return 1
898             }
899             # String => '\b[bozx](['][0-9a-f]+[']|["][0-9a-f]+["])'
900             # attribute => 'Decimal'
901             # context => '#stay'
902             # insensitive => 'TRUE'
903             # type => 'RegExpr'
904 4292 50       9873 if ($self->testRegExpr($text, '\\b[bozx]([\'][0-9a-f]+[\']|["][0-9a-f]+["])', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
905 0         0 return 1
906             }
907 4292         10792 return 0;
908             };
909              
910             sub parsefind_op_and_log {
911 4344     4344 0 6928 my ($self, $text) = @_;
912             # String => '\.(true|false)\.'
913             # attribute => 'Logical'
914             # context => '#stay'
915             # insensitive => 'TRUE'
916             # type => 'RegExpr'
917 4344 50       9300 if ($self->testRegExpr($text, '\\.(true|false)\\.', 1, 0, 0, undef, 0, '#stay', 'Logical')) {
918 0         0 return 1
919             }
920             # String => '\.[A-Za-z]+\.'
921             # attribute => 'Operator'
922             # context => '#stay'
923             # type => 'RegExpr'
924 4344 100       10218 if ($self->testRegExpr($text, '\\.[A-Za-z]+\\.', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
925 6         16 return 1
926             }
927             # String => '(==|/=|<|<=|>|>=)'
928             # attribute => 'Operator'
929             # context => '#stay'
930             # type => 'RegExpr'
931 4338 100       11000 if ($self->testRegExpr($text, '(==|/=|<|<=|>|>=)', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
932 10         29 return 1
933             }
934 4328         9705 return 0;
935             };
936              
937             sub parsefind_paren {
938 200     200 0 292 my ($self, $text) = @_;
939             # attribute => 'Data Type'
940             # char => '('
941             # context => 'find_paren'
942             # type => 'DetectChar'
943 200 50       422 if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'find_paren', 'Data Type')) {
944 0         0 return 1
945             }
946             # attribute => 'Data Type'
947             # char => ')'
948             # context => '#pop'
949             # type => 'DetectChar'
950 200 100       403 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Data Type')) {
951 28         54 return 1
952             }
953 172         280 return 0;
954             };
955              
956             sub parsefind_preprocessor {
957 4292     4292 0 6786 my ($self, $text) = @_;
958             # String => '(#|cDEC\$|CDEC\$).*$'
959             # attribute => 'Preprocessor'
960             # column => '0'
961             # context => '#stay'
962             # type => 'RegExpr'
963 4292 50       8733 if ($self->testRegExpr($text, '(#|cDEC\\$|CDEC\\$).*$', 0, 0, 0, 0, 0, '#stay', 'Preprocessor')) {
964 0         0 return 1
965             }
966 4292         9894 return 0;
967             };
968              
969             sub parsefind_strings {
970 4578     4578 0 7035 my ($self, $text) = @_;
971             # attribute => 'String'
972             # char => '''
973             # context => 'string_1'
974             # type => 'DetectChar'
975 4578 100       10040 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'string_1', 'String')) {
976 12         35 return 1
977             }
978             # attribute => 'String'
979             # char => '"'
980             # context => 'string_2'
981             # type => 'DetectChar'
982 4566 100       9314 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string_2', 'String')) {
983 6         17 return 1
984             }
985 4560         9156 return 0;
986             };
987              
988             sub parsefind_symbols {
989 4292     4292 0 6124 my ($self, $text) = @_;
990             # attribute => 'Keyword'
991             # char => '*'
992             # char1 => '*'
993             # context => '#stay'
994             # type => 'Detect2Chars'
995 4292 50       9994 if ($self->testDetect2Chars($text, '*', '*', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
996 0         0 return 1
997             }
998             # attribute => 'Keyword'
999             # char => '('
1000             # char1 => '/'
1001             # context => '#stay'
1002             # type => 'Detect2Chars'
1003 4292 50       8960 if ($self->testDetect2Chars($text, '(', '/', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
1004 0         0 return 1
1005             }
1006             # attribute => 'Keyword'
1007             # char => '/'
1008             # char1 => ')'
1009             # context => '#stay'
1010             # type => 'Detect2Chars'
1011 4292 50       8879 if ($self->testDetect2Chars($text, '/', ')', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
1012 0         0 return 1
1013             }
1014             # String => '&+-*/=?[]^{|}~'
1015             # attribute => 'Keyword'
1016             # context => '#stay'
1017             # type => 'AnyChar'
1018 4292 100       9798 if ($self->testAnyChar($text, '&+-*/=?[]^{|}~', 0, 0, undef, 0, '#stay', 'Keyword')) {
1019 58         178 return 1
1020             }
1021             # String => '(),'
1022             # attribute => 'Symbol'
1023             # context => '#stay'
1024             # type => 'AnyChar'
1025 4234 100       8209 if ($self->testAnyChar($text, '(),', 0, 0, undef, 0, '#stay', 'Symbol')) {
1026 134         339 return 1
1027             }
1028 4100         8430 return 0;
1029             };
1030              
1031             sub parseformat_stmnt {
1032 0     0 0 0 my ($self, $text) = @_;
1033             # attribute => 'IO Function'
1034             # char => '('
1035             # context => 'format_stmnt'
1036             # type => 'DetectChar'
1037 0 0       0 if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'format_stmnt', 'IO Function')) {
1038 0         0 return 1
1039             }
1040             # attribute => 'IO Function'
1041             # char => ')'
1042             # context => '#pop'
1043             # type => 'DetectChar'
1044 0 0       0 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'IO Function')) {
1045 0         0 return 1
1046             }
1047             # String => '[0-9]*/'
1048             # attribute => 'IO Function'
1049             # context => '#stay'
1050             # insensitive => 'TRUE'
1051             # type => 'RegExpr'
1052 0 0       0 if ($self->testRegExpr($text, '[0-9]*/', 1, 0, 0, undef, 0, '#stay', 'IO Function')) {
1053 0         0 return 1
1054             }
1055             # String => ':'
1056             # attribute => 'IO Function'
1057             # context => '#stay'
1058             # type => 'AnyChar'
1059 0 0       0 if ($self->testAnyChar($text, ':', 0, 0, undef, 0, '#stay', 'IO Function')) {
1060 0         0 return 1
1061             }
1062             # context => 'find_strings'
1063             # type => 'IncludeRules'
1064 0 0       0 if ($self->includeRules('find_strings', $text)) {
1065 0         0 return 1
1066             }
1067             # context => 'find_symbols'
1068             # type => 'IncludeRules'
1069 0 0       0 if ($self->includeRules('find_symbols', $text)) {
1070 0         0 return 1
1071             }
1072 0         0 return 0;
1073             };
1074              
1075             sub parseinside_func_paren {
1076 0     0 0 0 my ($self, $text) = @_;
1077             # attribute => 'Normal Text'
1078             # char => '('
1079             # context => 'inside_func_paren'
1080             # type => 'DetectChar'
1081 0 0       0 if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'inside_func_paren', 'Normal Text')) {
1082 0         0 return 1
1083             }
1084             # attribute => 'Normal Text'
1085             # char => ')'
1086             # context => '#pop'
1087             # type => 'DetectChar'
1088 0 0       0 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
1089 0         0 return 1
1090             }
1091             # context => 'find_strings'
1092             # type => 'IncludeRules'
1093 0 0       0 if ($self->includeRules('find_strings', $text)) {
1094 0         0 return 1
1095             }
1096             # context => 'find_intrinsics'
1097             # type => 'IncludeRules'
1098 0 0       0 if ($self->includeRules('find_intrinsics', $text)) {
1099 0         0 return 1
1100             }
1101             # context => 'find_numbers'
1102             # type => 'IncludeRules'
1103 0 0       0 if ($self->includeRules('find_numbers', $text)) {
1104 0         0 return 1
1105             }
1106 0         0 return 0;
1107             };
1108              
1109             sub parsestring_1 {
1110 12     12 0 26 my ($self, $text) = @_;
1111             # String => '[^']*''
1112             # attribute => 'String'
1113             # context => '#pop'
1114             # type => 'RegExpr'
1115 12 100       36 if ($self->testRegExpr($text, '[^\']*\'', 0, 0, 0, undef, 0, '#pop', 'String')) {
1116 10         27 return 1
1117             }
1118             # String => '&\s*$'
1119             # attribute => 'Keyword'
1120             # context => 'end_of_string'
1121             # type => 'RegExpr'
1122 2 50       9 if ($self->testRegExpr($text, '&\\s*$', 0, 0, 0, undef, 0, 'end_of_string', 'Keyword')) {
1123 0         0 return 1
1124             }
1125             # String => '.*(?=&\s*$)'
1126             # attribute => 'String'
1127             # context => 'end_of_string'
1128             # type => 'RegExpr'
1129 2 50       9 if ($self->testRegExpr($text, '.*(?=&\\s*$)', 0, 0, 0, undef, 0, 'end_of_string', 'String')) {
1130 0         0 return 1
1131             }
1132 2         4 return 0;
1133             };
1134              
1135             sub parsestring_2 {
1136 6     6 0 13 my ($self, $text) = @_;
1137             # String => '[^"]*"'
1138             # attribute => 'String'
1139             # context => '#pop'
1140             # type => 'RegExpr'
1141 6 50       21 if ($self->testRegExpr($text, '[^"]*"', 0, 0, 0, undef, 0, '#pop', 'String')) {
1142 6         16 return 1
1143             }
1144             # String => '&\s*$'
1145             # attribute => 'Keyword'
1146             # context => 'end_of_string'
1147             # type => 'RegExpr'
1148 0 0         if ($self->testRegExpr($text, '&\\s*$', 0, 0, 0, undef, 0, 'end_of_string', 'Keyword')) {
1149 0           return 1
1150             }
1151             # String => '.*(?=&\s*$)'
1152             # attribute => 'String'
1153             # context => 'end_of_string'
1154             # type => 'RegExpr'
1155 0 0         if ($self->testRegExpr($text, '.*(?=&\\s*$)', 0, 0, 0, undef, 0, 'end_of_string', 'String')) {
1156 0           return 1
1157             }
1158 0           return 0;
1159             };
1160              
1161              
1162             1;
1163              
1164             __END__