File Coverage

blib/lib/Syntax/Highlight/Engine/Kate/RenderMan_RIB.pm
Criterion Covered Total %
statement 46 49 93.8
branch 16 18 88.8
condition 1 3 33.3
subroutine 7 8 87.5
pod 0 5 0.0
total 70 83 84.3


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 'rib.xml' file of the syntax highlight
6             # engine of the kate text editor (http://www.kate-editor.org
7              
8             #kate xml version 1.00
9             #kate version 2.3
10             #kate author David Williams
11             #generated: Sun Feb 3 22:02:06 2008, localtime
12              
13             package Syntax::Highlight::Engine::Kate::RenderMan_RIB;
14              
15             our $VERSION = '0.12';
16              
17 1     1   402 use strict;
  1         2  
  1         26  
18 1     1   4 use warnings;
  1         2  
  1         25  
19 1     1   4 use base('Syntax::Highlight::Engine::Kate::Template');
  1         2  
  1         495  
20              
21             sub new {
22 2     2 0 574 my $proto = shift;
23 2   33     11 my $class = ref($proto) || $proto;
24 2         11 my $self = $class->SUPER::new(@_);
25 2         17 $self->attributes({
26             'Comment' => 'Comment',
27             'External Resource' => 'Keyword',
28             'Float' => 'Float',
29             'Geometric Primitive' => 'Keyword',
30             'Graphics State' => 'Keyword',
31             'Integer' => 'DecVal',
32             'Motion' => 'Keyword',
33             'Normal Text' => 'Normal',
34             'String' => 'String',
35             });
36 2         9 $self->listAdd('External Resources',
37             'ArchiveRecord',
38             'ErrorHandler',
39             'MakeBump',
40             'MakeCubeFaceEnvironment',
41             'MakeLatLongEnvironment',
42             'MakeTexture',
43             );
44 2         8 $self->listAdd('Geometric Primitives',
45             'Basis',
46             'Cylinder',
47             'Disk',
48             'GeneralPolygon',
49             'Geometry',
50             'Hyperboloid',
51             'NuPatch',
52             'ObjectBegin',
53             'ObjectEnd',
54             'ObjectInstance',
55             'Paraboloid',
56             'Patch',
57             'PointsGeneralPolygons',
58             'PointsPolygons',
59             'Polygon',
60             'Procedural',
61             'SolidBegin',
62             'SolidEnd',
63             'Sphere',
64             'Torus',
65             );
66 2         9 $self->listAdd('Graphics States',
67             'AreaLightSource',
68             'Attribute',
69             'AttributeBegin',
70             'AttributeEnd',
71             'Begin',
72             'Bound',
73             'Clipping',
74             'Color',
75             'ColorSamples',
76             'ConcatTransform',
77             'CoordinateSystem',
78             'CropWindow',
79             'Declare',
80             'DepthOfField',
81             'Detail',
82             'DetailRange',
83             'Displacement',
84             'Display',
85             'End',
86             'Exterior',
87             'Format',
88             'FrameAspectRatio',
89             'FrameBegin',
90             'FrameEnd',
91             'GeometricApproximation',
92             'Hider',
93             'Identity',
94             'Illuminance',
95             'Illuminate',
96             'Interior',
97             'LightSource',
98             'Matte',
99             'Opacity',
100             'Option',
101             'Orientation',
102             'Perspective',
103             'PixelFilter',
104             'PixelSamples',
105             'PixelVariance',
106             'Projection',
107             'Quantize',
108             'RelativeDetail',
109             'Rotate',
110             'Scale',
111             'ScreenWindow',
112             'ShadingInterpolation',
113             'ShadingRate',
114             'Shutter',
115             'Sides',
116             'Skew',
117             'Surface',
118             'TextureCoordinates',
119             'Transform',
120             'TransformBegin',
121             'TransformEnd',
122             'TransformPoints',
123             'Translate',
124             'WorldBegin',
125             'WorldEnd',
126             'version',
127             );
128 2         5 $self->listAdd('Motions',
129             'MotionBegin',
130             'MotionEnd',
131             );
132 2         15 $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             lineending => '#pop',
146             },
147             });
148 2         8 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
149 2         7 $self->basecontext('Normal');
150 2         8 $self->keywordscase(1);
151 2         5 $self->initialize;
152 2         5 bless ($self, $class);
153 2         8 return $self;
154             }
155              
156             sub language {
157 0     0 0 0 return 'RenderMan RIB';
158             }
159              
160             sub parseComment {
161 194     194 0 304 my ($self, $text) = @_;
162 194         332 return 0;
163             };
164              
165             sub parseNormal {
166 2336     2336 0 3857 my ($self, $text) = @_;
167             # String => 'Graphics States'
168             # attribute => 'Graphics State'
169             # context => '#stay'
170             # type => 'keyword'
171 2336 100       5941 if ($self->testKeyword($text, 'Graphics States', 0, undef, 0, '#stay', 'Graphics State')) {
172 70         174 return 1
173             }
174             # String => 'Geometric Primitives'
175             # attribute => 'Geometric Primitive'
176             # context => '#stay'
177             # type => 'keyword'
178 2266 100       5718 if ($self->testKeyword($text, 'Geometric Primitives', 0, undef, 0, '#stay', 'Geometric Primitive')) {
179 16         42 return 1
180             }
181             # String => 'Motions'
182             # attribute => 'Motion'
183             # context => '#stay'
184             # type => 'keyword'
185 2250 50       5169 if ($self->testKeyword($text, 'Motions', 0, undef, 0, '#stay', 'Motion')) {
186 0         0 return 1
187             }
188             # String => 'External Resources'
189             # attribute => 'External Resource'
190             # context => '#stay'
191             # type => 'keyword'
192 2250 50       5166 if ($self->testKeyword($text, 'External Resources', 0, undef, 0, '#stay', 'External Resource')) {
193 0         0 return 1
194             }
195             # attribute => 'Float'
196             # context => '#stay'
197             # type => 'Float'
198 2250 100       5379 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
199 756         1741 return 1
200             }
201             # attribute => 'Integer'
202             # context => '#stay'
203             # type => 'Int'
204 1494 100       3753 if ($self->testInt($text, 0, undef, 0, '#stay', 'Integer')) {
205 162         421 return 1
206             }
207             # attribute => 'String'
208             # char => '"'
209             # context => 'String'
210             # type => 'DetectChar'
211 1332 100       3525 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
212 44         105 return 1
213             }
214             # attribute => 'Comment'
215             # char => '#'
216             # context => 'Comment'
217             # type => 'DetectChar'
218 1288 100       2821 if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
219 12         30 return 1
220             }
221 1276         2334 return 0;
222             };
223              
224             sub parseString {
225 318     318 0 503 my ($self, $text) = @_;
226             # attribute => 'String'
227             # char => '"'
228             # context => '#pop'
229             # type => 'DetectChar'
230 318 100       800 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
231 44         116 return 1
232             }
233 274         517 return 0;
234             };
235              
236              
237             1;
238              
239             __END__