Kate/VRML.pm

filter: Statementstmt 94.8% 55 / 58 Branchbran 92.3% 24 / 26 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 5 totaltotal 85.2% 87 / 102 CC 15 SCAR 19.1
CC
15
Cov
92%
parseNormal
11.1
parseString
4.0
new
2.0
CRAP 6.7
« Kate/Lex_Flex.pm ↑ Summary Kate/ChangeLog.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 'vrml.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7  
8 #kate xml version 1.02
9 #kate author Volker Krause (volker.krause@rwth-aachen.de)
10 #generated: Sun Feb 3 22:02:06 2008, localtime
11  
12 package Syntax::Highlight::Engine::Kate::VRML;
13  
14 1 our $VERSION = '0.16';
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 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
Pod undocumented
21 2 my $proto = shift;
22 2 ▶ my $class = ref($proto) || $proto;
Condition33%1/3
ref $proto || $proto
l!l&&r!l&&!r
020
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 2 my $self = $class->SUPER::new(@_);
24 2 $self->attributes({
25 'Comment' => 'Comment',
26 'Data Type' => 'DataType',
27 'Decimal' => 'DecVal',
28 'Float' => 'Float',
29 'Hex' => 'BaseN',
30 'Keyword' => 'Keyword',
31 'Node' => 'Others',
32 'Normal Text' => 'Normal',
33 'String' => 'String',
34 'String Char' => 'Char',
35 });
36 2 $self->listAdd('keywords',
37 'DEF',
38 'EXTERNPROTO',
39 'FALSE',
40 'IS',
41 'NULL',
42 'PROTO',
43 'ROUTE',
44 'TO',
45 'TRUE',
46 'USE',
47 'eventIn',
48 'eventOut',
49 'exposedField',
50 'field',
51 );
52 2 $self->listAdd('nodes',
53 'Anchor',
54 'Appearance',
55 'AudioClip',
56 'Background',
57 'Billboard',
58 'Box',
59 'Collision',
60 'Color',
61 'ColorInterpolator',
62 'Cone',
63 'Coordinate',
64 'CoordinateInterpolator',
65 'Cylinder',
66 'CylinderSensor',
67 'DirectionalLight',
68 'ElevationGrid',
69 'Extrusion',
70 'Fog',
71 'FontStyle',
72 'Group',
73 'ImageTexture',
74 'IndexedFaceSet',
75 'IndexedLineSet',
76 'Inline',
77 'LOD',
78 'Material',
79 'MovieTexture',
80 'NavigationInfo',
81 'Normal',
82 'NormalInterpolator',
83 'OrientationInterpolator',
84 'PixelTexture',
85 'Plane',
86 'PlaneSensor',
87 'PointLight',
88 'PointSet',
89 'PositionInterpolator',
90 'ProximitySensor',
91 'ScalarInterpolator',
92 'Script',
93 'Sensor',
94 'Shape',
95 'Sound',
96 'Sphere',
97 'SphereSensor',
98 'SpotLight',
99 'Switch',
100 'Text',
101 'TextureCoordinate',
102 'TextureTransform',
103 'TimeSensor',
104 'TouchSensor',
105 'Transform',
106 'Viewpoint',
107 'VisibilitySensor',
108 'WorldInfo',
109 );
110 2 $self->listAdd('types',
111 'MFColor',
112 'MFFloat',
113 'MFInt32',
114 'MFNode',
115 'MFRotation',
116 'MFString',
117 'MFTime',
118 'MFVec2f',
119 'MFVec3f',
120 'SFBool',
121 'SFColor',
122 'SFFloat',
123 'SFImage',
124 'SFInt32',
125 'SFNode',
126 'SFRotation',
127 'SFString',
128 'SFTime',
129 'SFVec2f',
130 'SFVec3f',
131 );
132 2 $self->contextdata({
133 'Comment' => {
134 callback => \&parseComment,
135 attribute => 'Comment',
136 lineending => '#pop',
137 },
138 'Normal' => {
139 callback => \&parseNormal,
140 attribute => 'Normal Text',
141 },
142 'String' => {
143 callback => \&parseString,
144 attribute => 'String',
145 },
146 });
147 2 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
148 2 $self->basecontext('Normal');
149 2 $self->keywordscase(1);
150 2 $self->initialize;
151 2 bless ($self, $class);
152 2 return $self;
153 }
154  
155 0 ▶sub language {
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
156 0 return 'VRML';
157 }
158  
159 500 ▶sub parseComment {
Subroutine parseComment: called CC=1 SCAR=0.0
Pod undocumented
160 500 my ($self, $text) = @_;
161 500 return 0;
162 };
163  
164 762 ▶sub parseNormal {
Subroutine parseNormal: called CC=11 SCAR=24.1
Pod undocumented
165 762 my ($self, $text) = @_;
166 # String => 'keywords'
167 # attribute => 'Keyword'
168 # context => '#stay'
169 # type => 'keyword'
170 762 ▶ if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "keywords", 0, undef, 0, "#stay", "Keyword")) 30 732 762
171 30 return 1
172 }
173 # String => 'nodes'
174 # attribute => 'Node'
175 # context => '#stay'
176 # type => 'keyword'
177 732 ▶ if ($self->testKeyword($text, 'nodes', 0, undef, 0, '#stay', 'Node')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "nodes", 0, undef, 0, "#stay", "Node")) 112 620 732
178 112 return 1
179 }
180 # String => 'types'
181 # attribute => 'Data Type'
182 # context => '#stay'
183 # type => 'keyword'
184 620 ▶ if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "types", 0, undef, 0, "#stay", "Data Type")) 40 580 620
185 40 return 1
186 }
187 # attribute => 'Float'
188 # context => '#stay'
189 # type => 'Float'
190 580 ▶ if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testFloat($text, 0, undef, 0, "#stay", "Float")) 10 570 580
191 10 return 1
192 }
193 # attribute => 'Hex'
194 # context => '#stay'
195 # type => 'HlCHex'
196 570 ▶ if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testHlCHex($text, 0, undef, 0, "#stay", "Hex")) 0 570 570
197 0 return 1
198 }
199 # attribute => 'Decimal'
200 # context => '#stay'
201 # type => 'Int'
202 570 ▶ if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testInt($text, 0, undef, 0, "#stay", "Decimal")) 0 570 570
203 0 return 1
204 }
205 # attribute => 'Normal Text'
206 # beginRegion => 'Brace'
207 # char => '{'
208 # context => '#stay'
209 # type => 'DetectChar'
210 570 ▶ if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "{", 0, 0, 0, undef, 0, "#stay", "Normal Text")) 4 566 570
211 4 return 1
212 }
213 # attribute => 'Normal Text'
214 # char => '}'
215 # context => '#stay'
216 # endRegion => 'Brace'
217 # type => 'DetectChar'
218 566 ▶ if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "}", 0, 0, 0, undef, 0, "#stay", "Normal Text")) 4 562 566
219 4 return 1
220 }
221 # attribute => 'String'
222 # char => '"'
223 # context => 'String'
224 # type => 'DetectChar'
225 562 ▶ 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")) 6 556 562
226 6 return 1
227 }
228 # attribute => 'Comment'
229 # char => '#'
230 # context => 'Comment'
231 # type => 'DetectChar'
232 556 ▶ 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")) 18 538 556
233 18 return 1
234 }
235 538 return 0;
236 };
237  
238 236 ▶sub parseString {
Subroutine parseString: called CC=4 SCAR=13.9
Pod undocumented
239 236 my ($self, $text) = @_;
240 # attribute => 'String'
241 # context => '#stay'
242 # type => 'LineContinue'
243 236 ▶ if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testLineContinue($text, 0, undef, 0, "#stay", "String")) 2 234 236
244 2 return 1
245 }
246 # attribute => 'String Char'
247 # context => '#stay'
248 # type => 'HlCStringChar'
249 234 ▶ if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testHlCStringChar($text, 0, undef, 0, "#stay", "String Char")) 2 232 234
250 2 return 1
251 }
252 # attribute => 'String'
253 # char => '"'
254 # context => '#pop'
255 # type => 'DetectChar'
256 232 ▶ 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")) 6 226 232
257 6 return 1
258 }
259 226 return 0;
260 };
261  
262  
263 1 1;
264  
265 __END__
« Kate/Lex_Flex.pm ↑ Summary Kate/ChangeLog.pm »