Kate/Prolog.pm

filter: Statementstmt 39.1% 29 / 74 Branchbran 0.0% 0 / 34 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 40.0% 4 / 10 Podpod 0.0% 0 / 7 totaltotal 26.1% 34 / 130 SCAR 50.7
CC
19
Cov
27%
parsenormal
240.0
parsecommentregion
6.0
parsestring
6.0
CRAP 159.3
« Kate/PicAsm.pm ↑ Summary Kate/CSS.pm »
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 'prolog.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7  
8 #kate xml version 1.04
9 #kate version 2.1
10 #generated: Sun Feb 3 22:02:06 2008, localtime
11  
12 package Syntax::Highlight::Engine::Kate::Prolog;
13  
14 1 our $VERSION = '0.14';
15  
16 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶use base('Syntax::Highlight::Engine::Kate::Template');
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 sub new {
21 1 ▶ my $proto = shift;
Subroutine new: called CC=2 SCAR=6.9
Pod undocumented
22 1 ▶ my $class = ref($proto) || $proto;
Condition33%1/3
ref $proto || $proto
l!l&&r!l&&!r
010
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
23 1 my $self = $class->SUPER::new(@_);
24 1 $self->attributes({
25 'Arithmetic' => 'Keyword',
26 'Comment' => 'Comment',
27 'Data Type' => 'DataType',
28 'Identifier' => 'Normal',
29 'Integer' => 'DecVal',
30 'Keyword' => 'Keyword',
31 'Normal Text' => 'Normal',
32 'String' => 'String',
33 'Symbol' => 'Normal',
34 'Variable' => 'Others',
35 });
36 1 $self->listAdd('arith',
37 'abs',
38 'arctan',
39 'cos',
40 'div',
41 'exp',
42 'ln',
43 'log',
44 'mod',
45 'random',
46 'randominit',
47 'round',
48 'sin',
49 'sqrt',
50 'tan',
51 'trunc',
52 'val',
53 );
54 1 $self->listAdd('basetype',
55 'binary',
56 'byte',
57 'char',
58 'dword',
59 'integer',
60 'long',
61 'real',
62 'ref',
63 'sbyte',
64 'short',
65 'string',
66 'symbol',
67 'ulong',
68 'unsigned',
69 'ushort',
70 'word',
71 );
72 1 $self->listAdd('compiler',
73 'bgidriver',
74 'bgifont',
75 'check_determ',
76 'code',
77 'config',
78 'diagnostics',
79 'error',
80 'errorlevel',
81 'gstacksize',
82 'heap',
83 'nobreak',
84 'nowarnings',
85 'printermenu',
86 'project',
87 );
88 1 $self->listAdd('keywordl',
89 'abstract',
90 'align',
91 'and',
92 'as',
93 'class',
94 'clauses',
95 'constants',
96 'database',
97 'determ',
98 'domains',
99 'elsedef',
100 'endclass',
101 'enddef',
102 'erroneous',
103 'facts',
104 'failure',
105 'global',
106 'goal',
107 'if',
108 'ifdef',
109 'ifndef',
110 'implement',
111 'include',
112 'language',
113 'multi',
114 'nocopy',
115 'nondeterm',
116 'object',
117 'or',
118 'predicates',
119 'procedure',
120 'protected',
121 'reference',
122 'single',
123 'static',
124 'struct',
125 'this',
126 );
127 1 $self->listAdd('keywords',
128 'false',
129 'true',
130 );
131 1 $self->listAdd('keywordu',
132 'ABSTRACT',
133 'ALIGN',
134 'AND',
135 'AS',
136 'CLASS',
137 'CLAUSES',
138 'CONSTANTS',
139 'DATABASE',
140 'DETERM',
141 'DOMAINS',
142 'ELSEDEF',
143 'ENDCLASS',
144 'ENDDEF',
145 'ERRONEOUS',
146 'FACTS',
147 'FAILURE',
148 'GLOBAL',
149 'GOAL',
150 'IF',
151 'IFDEF',
152 'IFNDEF',
153 'IMPLEMENT',
154 'INCLUDE',
155 'LANGUAGE',
156 'MULTI',
157 'NOCOPY',
158 'NONDETERM',
159 'OBJECT',
160 'OR',
161 'PREDICATES',
162 'PROCEDURE',
163 'PROTECTED',
164 'REFERENCE',
165 'SINGLE',
166 'STATIC',
167 'STRUCT',
168 'THIS',
169 );
170 1 $self->listAdd('special',
171 'assert',
172 'asserta',
173 'assertz',
174 'bound',
175 'chain_inserta',
176 'chain_insertafter',
177 'chain_insertz',
178 'chain_terms',
179 'consult',
180 'db_btrees',
181 'db_chains',
182 'fail',
183 'findall',
184 'format',
185 'free',
186 'msgrecv',
187 'msgsend',
188 'nl',
189 'not',
190 'readterm',
191 'ref_term',
192 'retract',
193 'retractall',
194 'save',
195 'term_bin',
196 'term_replace',
197 'term_str',
198 'trap',
199 'write',
200 'writef',
201 );
202 1 $self->contextdata({
203 'comment' => {
204 callback => \&parsecomment,
205 attribute => 'Comment',
206 lineending => '#pop',
207 },
208 'comment region' => {
209 callback => \&parsecommentregion,
210 attribute => 'Comment',
211 },
212 'normal' => {
213 callback => \&parsenormal,
214 attribute => 'Symbol',
215 },
216 'string' => {
217 callback => \&parsestring,
218 attribute => 'String',
219 },
220 'string2' => {
221 callback => \&parsestring2,
222 attribute => 'String',
223 },
224 });
225 1 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
226 1 $self->basecontext('normal');
227 1 $self->keywordscase(0);
228 1 $self->initialize;
229 1 bless ($self, $class);
230 1 return $self;
231 }
232  
233 sub language {
234 0 ▶ return 'Prolog';
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
235 }
236  
237 sub parsecomment {
238 0 ▶ my ($self, $text) = @_;
Subroutine parsecomment: not called CC=1 SCAR=6.9
Pod undocumented
239 0 return 0;
240 };
241  
242 sub parsecommentregion {
243 0 ▶ my ($self, $text) = @_;
Subroutine parsecommentregion: not called CC=2 SCAR=17.9
Pod undocumented
244 # attribute => 'Comment'
245 # char => '*'
246 # char1 => '/'
247 # context => '#pop'
248 # type => 'Detect2Chars'
249 0 ▶ if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "*", "/", 0, 0, 0, undef, 0, "#pop", "Comment")) 0 0 0
250 0 return 1
251 }
252 0 return 0;
253 };
254  
255 sub parsenormal {
256 0 ▶ my ($self, $text) = @_;
Subroutine parsenormal: not called CC=15 SCAR=54.8
Pod undocumented
257 # String => 'keywordl'
258 # attribute => 'Keyword'
259 # context => '#stay'
260 # type => 'keyword'
261 0 ▶ if ($self->testKeyword($text, 'keywordl', 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "keywordl", 0, undef, 0, "#stay", "Keyword")) 0 0 0
262 0 return 1
263 }
264 # String => 'keywordu'
265 # attribute => 'Keyword'
266 # context => '#stay'
267 # type => 'keyword'
268 0 ▶ if ($self->testKeyword($text, 'keywordu', 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "keywordu", 0, undef, 0, "#stay", "Keyword")) 0 0 0
269 0 return 1
270 }
271 # String => 'arith'
272 # attribute => 'Arithmetic'
273 # context => '#stay'
274 # type => 'keyword'
275 0 ▶ if ($self->testKeyword($text, 'arith', 0, undef, 0, '#stay', 'Arithmetic')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "arith", 0, undef, 0, "#stay", "Arithmetic")) 0 0 0
276 0 return 1
277 }
278 # String => 'compiler'
279 # attribute => 'Keyword'
280 # context => '#stay'
281 # type => 'keyword'
282 0 ▶ if ($self->testKeyword($text, 'compiler', 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "compiler", 0, undef, 0, "#stay", "Keyword")) 0 0 0
283 0 return 1
284 }
285 # String => 'special'
286 # attribute => 'Keyword'
287 # context => '#stay'
288 # type => 'keyword'
289 0 ▶ if ($self->testKeyword($text, 'special', 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "special", 0, undef, 0, "#stay", "Keyword")) 0 0 0
290 0 return 1
291 }
292 # String => 'basetype'
293 # attribute => 'Data Type'
294 # context => '#stay'
295 # type => 'keyword'
296 0 ▶ if ($self->testKeyword($text, 'basetype', 0, undef, 0, '#stay', 'Data Type')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "basetype", 0, undef, 0, "#stay", "Data Type")) 0 0 0
297 0 return 1
298 }
299 # String => '[A-Z_][A-Za-z0-9_]*'
300 # attribute => 'Variable'
301 # context => '#stay'
302 # type => 'RegExpr'
303 0 ▶ if ($self->testRegExpr($text, '[A-Z_][A-Za-z0-9_]*', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "[A-Z_][A-Za-z0-9_]*", 0, 0, 0, undef, 0, "#stay", "Variable")) 0 0 0
304 0 return 1
305 }
306 # String => '[a-z][A-Za-z0-9_]*'
307 # attribute => 'Identifier'
308 # context => '#stay'
309 # type => 'RegExpr'
310 0 ▶ if ($self->testRegExpr($text, '[a-z][A-Za-z0-9_]*', 0, 0, 0, undef, 0, '#stay', 'Identifier')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "[a-z][A-Za-z0-9_]*", 0, 0, 0, undef, 0, "#stay", "Identifier")) 0 0 0
311 0 return 1
312 }
313 # attribute => 'Comment'
314 # char => '%'
315 # context => 'comment'
316 # type => 'DetectChar'
317 0 ▶ if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'comment', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "%", 0, 0, 0, undef, 0, "comment", "Comment")) 0 0 0
318 0 return 1
319 }
320 # attribute => 'Comment'
321 # char => '/'
322 # char1 => '*'
323 # context => 'comment region'
324 # type => 'Detect2Chars'
325 0 ▶ if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'comment region', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "/", "*", 0, 0, 0, undef, 0, "comment region", "Comment")) 0 0 0
326 0 return 1
327 }
328 # attribute => 'Integer'
329 # context => '#stay'
330 # type => 'Int'
331 0 ▶ if ($self->testInt($text, 0, undef, 0, '#stay', 'Integer')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testInt($text, 0, undef, 0, "#stay", "Integer")) 0 0 0
332 0 return 1
333 }
334 # attribute => 'String'
335 # char => '"'
336 # context => 'string'
337 # type => 'DetectChar'
338 0 ▶ if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "\"", 0, 0, 0, undef, 0, "string", "String")) 0 0 0
339 0 return 1
340 }
341 # attribute => 'String'
342 # char => '''
343 # context => 'string2'
344 # type => 'DetectChar'
345 0 ▶ if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'string2', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "'", 0, 0, 0, undef, 0, "string2", "String")) 0 0 0
346 0 return 1
347 }
348 # String => '~!^*()-+=[]|\:;,./?&<>'
349 # attribute => 'Symbol'
350 # context => '#stay'
351 # type => 'AnyChar'
352 0 ▶ if ($self->testAnyChar($text, '~!^*()-+=[]|\\:;,./?&<>', 0, 0, undef, 0, '#stay', 'Symbol')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testAnyChar($text, "~!^*()-+=[]|\\:;,./?&<>", 0, 0, undef, 0, "#stay", "Symbol")) 0 0 0
353 0 return 1
354 }
355 0 return 0;
356 };
357  
358 sub parsestring {
359 0 ▶ my ($self, $text) = @_;
Subroutine parsestring: not called CC=2 SCAR=17.9
Pod undocumented
360 # attribute => 'String'
361 # char => '"'
362 # context => '#pop'
363 # type => 'DetectChar'
364 0 ▶ if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "\"", 0, 0, 0, undef, 0, "#pop", "String")) 0 0 0
365 0 return 1
366 }
367 0 return 0;
368 };
369  
370 sub parsestring2 {
371 0 ▶ my ($self, $text) = @_;
Subroutine parsestring2: not called CC=2 SCAR=17.9
Pod undocumented
372 # attribute => 'String'
373 # char => '''
374 # context => '#pop'
375 # type => 'DetectChar'
376 0 ▶ if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "'", 0, 0, 0, undef, 0, "#pop", "String")) 0 0 0
377 0 return 1
378 }
379 0 return 0;
380 };
381  
382  
383 1 1;
384  
385 __END__
« Kate/PicAsm.pm ↑ Summary Kate/CSS.pm »