82d643dfcb3c7f4379c7047bc7a00c1894f3328d
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / RenderMan_RIB.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 '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 <david@david-williams.info>
11 #generated: Sun Feb  3 22:02:06 2008, localtime
12
13 package Syntax::Highlight::Engine::Kate::RenderMan_RIB;
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       '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    $self->listAdd('External Resources',
37       'ArchiveRecord',
38       'ErrorHandler',
39       'MakeBump',
40       'MakeCubeFaceEnvironment',
41       'MakeLatLongEnvironment',
42       'MakeTexture',
43    );
44    $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    $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    $self->listAdd('Motions',
129       'MotionBegin',
130       'MotionEnd',
131    );
132    $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    $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
149    $self->basecontext('Normal');
150    $self->keywordscase(1);
151    $self->initialize;
152    bless ($self, $class);
153    return $self;
154 }
155
156 sub language {
157    return 'RenderMan RIB';
158 }
159
160 sub parseComment {
161    my ($self, $text) = @_;
162    return 0;
163 };
164
165 sub parseNormal {
166    my ($self, $text) = @_;
167    # String => 'Graphics States'
168    # attribute => 'Graphics State'
169    # context => '#stay'
170    # type => 'keyword'
171    if ($self->testKeyword($text, 'Graphics States', 0, undef, 0, '#stay', 'Graphics State')) {
172       return 1
173    }
174    # String => 'Geometric Primitives'
175    # attribute => 'Geometric Primitive'
176    # context => '#stay'
177    # type => 'keyword'
178    if ($self->testKeyword($text, 'Geometric Primitives', 0, undef, 0, '#stay', 'Geometric Primitive')) {
179       return 1
180    }
181    # String => 'Motions'
182    # attribute => 'Motion'
183    # context => '#stay'
184    # type => 'keyword'
185    if ($self->testKeyword($text, 'Motions', 0, undef, 0, '#stay', 'Motion')) {
186       return 1
187    }
188    # String => 'External Resources'
189    # attribute => 'External Resource'
190    # context => '#stay'
191    # type => 'keyword'
192    if ($self->testKeyword($text, 'External Resources', 0, undef, 0, '#stay', 'External Resource')) {
193       return 1
194    }
195    # attribute => 'Float'
196    # context => '#stay'
197    # type => 'Float'
198    if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
199       return 1
200    }
201    # attribute => 'Integer'
202    # context => '#stay'
203    # type => 'Int'
204    if ($self->testInt($text, 0, undef, 0, '#stay', 'Integer')) {
205       return 1
206    }
207    # attribute => 'String'
208    # char => '"'
209    # context => 'String'
210    # type => 'DetectChar'
211    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
212       return 1
213    }
214    # attribute => 'Comment'
215    # char => '#'
216    # context => 'Comment'
217    # type => 'DetectChar'
218    if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
219       return 1
220    }
221    return 0;
222 };
223
224 sub parseString {
225    my ($self, $text) = @_;
226    # attribute => 'String'
227    # char => '"'
228    # context => '#pop'
229    # type => 'DetectChar'
230    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
231       return 1
232    }
233    return 0;
234 };
235
236
237 1;
238
239 __END__
240
241 =head1 NAME
242
243 Syntax::Highlight::Engine::Kate::RenderMan_RIB - a Plugin for RenderMan RIB syntax highlighting
244
245 =head1 SYNOPSIS
246
247  require Syntax::Highlight::Engine::Kate::RenderMan_RIB;
248  my $sh = new Syntax::Highlight::Engine::Kate::RenderMan_RIB([
249  ]);
250
251 =head1 DESCRIPTION
252
253 Syntax::Highlight::Engine::Kate::RenderMan_RIB is a  plugin module that provides syntax highlighting
254 for RenderMan RIB to the Syntax::Haghlight::Engine::Kate highlighting engine.
255
256 This code is generated from the syntax definition files used
257 by the Kate project.
258 It works quite fine, but can use refinement and optimization.
259
260 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
261
262 =cut
263
264 =head1 AUTHOR
265
266 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
267
268 =cut
269
270 =head1 BUGS
271
272 Unknown. If you find any, please contact the author
273
274 =cut
275